@matdata/yasgui 4.6.1

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/CHANGELOG.md ADDED
@@ -0,0 +1,175 @@
1
+ # Change Log
2
+
3
+ ## 4.6.1
4
+
5
+ ### Patch Changes
6
+
7
+ - 2285bff: Fix the display of results of DESCRIBE and CONSTRUCT queries.
8
+ - Updated dependencies [2285bff]
9
+ - @zazuko/yasqe@4.6.1
10
+ - @zazuko/yasr@4.6.1
11
+ - @zazuko/yasgui-utils@4.6.1
12
+
13
+ ## 4.6.0
14
+
15
+ ### Minor Changes
16
+
17
+ - f6cb66e: This adds a clear button for the endpoint field.
18
+
19
+ ### Patch Changes
20
+
21
+ - 2e04999: Upgrade various dependencies
22
+ - Updated dependencies [2e04999]
23
+ - Updated dependencies [0cd6b8e]
24
+ - @zazuko/yasqe@4.6.0
25
+ - @zazuko/yasgui-utils@4.6.0
26
+ - @zazuko/yasr@4.6.0
27
+
28
+ ## 4.5.0
29
+
30
+ ### Minor Changes
31
+
32
+ - 638c89e: Clear endpoint select autocomplete on click
33
+
34
+ ### Patch Changes
35
+
36
+ - @zazuko/yasgui-utils@4.5.0
37
+ - @zazuko/yasqe@4.5.0
38
+ - @zazuko/yasr@4.5.0
39
+
40
+ ## 4.4.3
41
+
42
+ ### Patch Changes
43
+
44
+ - Updated dependencies [b835764]
45
+ - @zazuko/yasqe@4.4.3
46
+ - @zazuko/yasgui-utils@4.4.3
47
+ - @zazuko/yasr@4.4.3
48
+
49
+ ## 4.4.2
50
+
51
+ ### Patch Changes
52
+
53
+ - Updated dependencies [c7ae45e]
54
+ - @zazuko/yasqe@4.4.2
55
+ - @zazuko/yasgui-utils@4.4.2
56
+ - @zazuko/yasr@4.4.2
57
+
58
+ ## 4.4.1
59
+
60
+ ### Patch Changes
61
+
62
+ - 7db4686: Fix typing issue that was preventing to run the demo as expected
63
+ - d4a0a87: Use `encodeURI` in CORS error message
64
+ - @zazuko/yasgui-utils@4.4.1
65
+ - @zazuko/yasqe@4.4.1
66
+ - @zazuko/yasr@4.4.1
67
+
68
+ ## 4.4.0
69
+
70
+ ### Minor Changes
71
+
72
+ - 2489238: Improve `div` groupment in Yasgui to enable better customization of the editor interface (by @vemonet in #20)
73
+ - 2489238: Replace `superagent` with standard `fetch` (from @vemonet in #19)
74
+
75
+ ### Patch Changes
76
+
77
+ - Updated dependencies [2489238]
78
+ - @zazuko/yasqe@4.4.0
79
+ - @zazuko/yasr@4.4.0
80
+ - @zazuko/yasgui-utils@4.4.0
81
+
82
+ ## 4.3.3
83
+
84
+ ### Patch Changes
85
+
86
+ - d918c63: Upgrade some dependencies
87
+ - d918c63: Add a `queryBefore` event on Yasgui and Yasqe (by @vemonet, in #16)
88
+ - Updated dependencies [d918c63]
89
+ - Updated dependencies [d918c63]
90
+ - Updated dependencies [d918c63]
91
+ - @zazuko/yasgui-utils@4.3.3
92
+ - @zazuko/yasqe@4.3.3
93
+ - @zazuko/yasr@4.3.3
94
+
95
+ ## 4.3.2
96
+
97
+ ### Patch Changes
98
+
99
+ - 574b86f: Improve the release process
100
+ - @zazuko/yasgui-utils@4.3.2
101
+ - @zazuko/yasqe@4.3.2
102
+ - @zazuko/yasr@4.3.2
103
+
104
+ ## 4.3.1
105
+
106
+ ### Patch Changes
107
+
108
+ - Updated dependencies [8aef253]
109
+ - Updated dependencies [cbf8286]
110
+ - Updated dependencies [6e78f30]
111
+ - @zazuko/yasr@4.3.1
112
+ - @zazuko/yasgui-utils@4.3.1
113
+ - @zazuko/yasqe@4.3.1
114
+
115
+ ## 4.3.0
116
+
117
+ ### Patch Changes
118
+
119
+ - b14ed24: Update Git repository to https://github.com/zazuko/Yasgui
120
+ - Updated dependencies [b14ed24]
121
+ - Updated dependencies [981b776]
122
+ - @zazuko/yasgui-utils@4.3.0
123
+ - @zazuko/yasqe@4.3.0
124
+ - @zazuko/yasr@4.3.0
125
+
126
+ All notable changes to this project will be documented in this file.
127
+ See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
128
+
129
+ ## [4.0.113](https://github.com/TriplyDB/yasgui/compare/v4.0.112...v4.0.113) (2020-04-08)
130
+
131
+ **Note:** Version bump only for package @triply/yasgui
132
+
133
+ ## [4.0.112](https://github.com/TriplyDB/yasgui/compare/v4.0.111...v4.0.112) (2020-04-07)
134
+
135
+ **Note:** Version bump only for package @triply/yasgui
136
+
137
+ ## [4.0.111](https://github.com/TriplyDB/yasgui/compare/v4.0.109...v4.0.111) (2020-03-20)
138
+
139
+ **Note:** Version bump only for package @triply/yasgui
140
+
141
+ ## [4.0.110](https://github.com/TriplyDB/yasgui/compare/v4.0.109...v4.0.110) (2020-03-20)
142
+
143
+ **Note:** Version bump only for package @triply/yasgui
144
+
145
+ ## [4.0.109](https://github.com/TriplyDB/yasgui/compare/v4.0.108...v4.0.109) (2020-03-19)
146
+
147
+ **Note:** Version bump only for package @triply/yasgui
148
+
149
+ ## [4.0.108](https://github.com/TriplyDB/yasgui/compare/v4.0.107...v4.0.108) (2020-03-10)
150
+
151
+ **Note:** Version bump only for package @triply/yasgui
152
+
153
+ ## [4.0.107](https://github.com/TriplyDB/yasgui/compare/v4.0.106...v4.0.107) (2020-03-01)
154
+
155
+ **Note:** Version bump only for package @triply/yasgui
156
+
157
+ ## [4.0.106](https://github.com/TriplyDB/yasgui/compare/v4.0.105...v4.0.106) (2020-02-25)
158
+
159
+ **Note:** Version bump only for package @triply/yasgui
160
+
161
+ ## [4.0.105](https://github.com/TriplyDB/yasgui/compare/v4.0.104...v4.0.105) (2020-02-10)
162
+
163
+ **Note:** Version bump only for package @triply/yasgui
164
+
165
+ ## [4.0.104](https://github.com/TriplyDB/yasgui/compare/v4.0.103...v4.0.104) (2020-02-10)
166
+
167
+ **Note:** Version bump only for package @triply/yasgui
168
+
169
+ ## [4.0.103](https://github.com/TriplyDB/yasgui/compare/v4.0.102...v4.0.103) (2020-02-10)
170
+
171
+ **Note:** Version bump only for package @triply/yasgui
172
+
173
+ ## [4.0.102](https://github.com/TriplyDB/yasgui/compare/v4.0.101...v4.0.102) (2020-02-07)
174
+
175
+ **Note:** Version bump only for package @triply/yasgui
@@ -0,0 +1,49 @@
1
+ import Yasgui from "./";
2
+ import * as Tab from "./Tab";
3
+ export declare var storageNamespace: string;
4
+ export interface PersistedJson {
5
+ endpointHistory: string[];
6
+ tabs: string[];
7
+ active: string | undefined;
8
+ tabConfig: {
9
+ [tabId: string]: Tab.PersistedJson;
10
+ };
11
+ lastClosedTab: {
12
+ index: number;
13
+ tab: Tab.PersistedJson;
14
+ } | undefined;
15
+ prefixes?: string;
16
+ autoCaptureEnabled?: boolean;
17
+ }
18
+ export default class PersistentConfig {
19
+ private persistedJson;
20
+ private storageId;
21
+ private yasgui;
22
+ private storage;
23
+ constructor(yasgui: Yasgui);
24
+ setActive(id: string): void;
25
+ getActiveId(): string | undefined;
26
+ addToTabList(tabId: string, index?: number): void;
27
+ setTabOrder(tabs: string[]): void;
28
+ getEndpointHistory(): string[];
29
+ retrieveLastClosedTab(): {
30
+ index: number;
31
+ tab: Tab.PersistedJson;
32
+ };
33
+ hasLastClosedTab(): boolean;
34
+ deleteTab(tabId: string): void;
35
+ private registerListeners;
36
+ private toStorage;
37
+ private fromStorage;
38
+ private handleLocalStorageQuotaFull;
39
+ getTabs(): string[];
40
+ getTab(tabId: string): Tab.PersistedJson;
41
+ setTab(tabId: string, tabConfig: Tab.PersistedJson): void;
42
+ tabIsActive(tabId: string): boolean;
43
+ currentId(): string;
44
+ getPrefixes(): string;
45
+ setPrefixes(prefixes: string): void;
46
+ getAutoCaptureEnabled(): boolean;
47
+ setAutoCaptureEnabled(enabled: boolean): void;
48
+ static clear(): void;
49
+ }
@@ -0,0 +1,105 @@
1
+ import { EventEmitter } from "events";
2
+ import { default as Yasqe } from "@matdata/yasqe";
3
+ import { default as Yasr, Parser, PersistentConfig as YasrPersistentConfig } from "@matdata/yasr";
4
+ import * as shareLink from "./linkUtils";
5
+ import { default as Yasgui, YasguiRequestConfig } from "./";
6
+ export interface PersistedJsonYasr extends YasrPersistentConfig {
7
+ responseSummary: Parser.ResponseSummary;
8
+ }
9
+ export interface PersistedJson {
10
+ name: string;
11
+ id: string;
12
+ yasqe: {
13
+ value: string;
14
+ editorHeight?: string;
15
+ };
16
+ yasr: {
17
+ settings: YasrPersistentConfig;
18
+ response: Parser.ResponseSummary | undefined;
19
+ };
20
+ requestConfig: YasguiRequestConfig;
21
+ }
22
+ export interface Tab {
23
+ on(event: string | symbol, listener: (...args: any[]) => void): this;
24
+ on(event: "change", listener: (tab: Tab, config: PersistedJson) => void): this;
25
+ emit(event: "change", tab: Tab, config: PersistedJson): boolean;
26
+ on(event: "query", listener: (tab: Tab) => void): this;
27
+ emit(event: "query", tab: Tab): boolean;
28
+ on(event: "queryBefore", listener: (tab: Tab) => void): this;
29
+ emit(event: "queryBefore", tab: Tab): boolean;
30
+ on(event: "queryAbort", listener: (tab: Tab) => void): this;
31
+ emit(event: "queryAbort", tab: Tab): boolean;
32
+ on(event: "queryResponse", listener: (tab: Tab) => void): this;
33
+ emit(event: "queryResponse", tab: Tab): boolean;
34
+ on(event: "close", listener: (tab: Tab) => void): this;
35
+ emit(event: "close", tab: Tab): boolean;
36
+ on(event: "endpointChange", listener: (tab: Tab, endpoint: string) => void): this;
37
+ emit(event: "endpointChange", tab: Tab, endpoint: string): boolean;
38
+ on(event: "autocompletionShown", listener: (tab: Tab, widget: any) => void): this;
39
+ emit(event: "autocompletionShown", tab: Tab, widget: any): boolean;
40
+ on(event: "autocompletionClose", listener: (tab: Tab) => void): this;
41
+ emit(event: "autocompletionClose", tab: Tab): boolean;
42
+ }
43
+ export declare class Tab extends EventEmitter {
44
+ private persistentJson;
45
+ yasgui: Yasgui;
46
+ private yasqe;
47
+ private yasr;
48
+ private rootEl;
49
+ private controlBarEl;
50
+ private yasqeWrapperEl;
51
+ private yasrWrapperEl;
52
+ private endpointSelect;
53
+ private settingsModal?;
54
+ constructor(yasgui: Yasgui, conf: PersistedJson);
55
+ name(): string;
56
+ getPersistedJson(): PersistedJson;
57
+ getId(): string;
58
+ private draw;
59
+ hide(): void;
60
+ show(): void;
61
+ private handleKeyDown;
62
+ private attachKeyboardListeners;
63
+ private detachKeyboardListeners;
64
+ select(): void;
65
+ close(): void;
66
+ getQuery(): string;
67
+ setQuery(query: string): this;
68
+ getRequestConfig(): YasguiRequestConfig;
69
+ private initControlbar;
70
+ getYasqe(): Yasqe;
71
+ getYasr(): Yasr;
72
+ private initTabSettingsMenu;
73
+ private initEndpointSelectField;
74
+ private checkEndpointForCors;
75
+ setEndpoint(endpoint: string, endpointHistory?: string[]): this;
76
+ getEndpoint(): string;
77
+ updateContextMenu(): void;
78
+ getShareableLink(baseURL?: string): string;
79
+ getShareObject(): shareLink.ShareConfigObject;
80
+ private getTabListEl;
81
+ setName(newName: string): this;
82
+ hasResults(): boolean;
83
+ getName(): string;
84
+ query(): Promise<any>;
85
+ setRequestConfig(requestConfig: Partial<YasguiRequestConfig>): void;
86
+ private getStaticRequestConfig;
87
+ private initYasqe;
88
+ private destroyYasqe;
89
+ handleYasqeBlur: (yasqe: Yasqe) => void;
90
+ handleYasqeQuery: (yasqe: Yasqe) => void;
91
+ handleYasqeQueryAbort: () => void;
92
+ handleYasqeQueryBefore: () => void;
93
+ handleYasqeResize: (_yasqe: Yasqe, newSize: string) => void;
94
+ handleAutocompletionShown: (_yasqe: Yasqe, widget: string) => void;
95
+ handleAutocompletionClose: (_yasqe: Yasqe) => void;
96
+ handleQueryResponse: (_yasqe: Yasqe, response: any, duration: number) => void;
97
+ private handleYasqeMouseDown;
98
+ private executeBackgroundQuery;
99
+ private attachYasqeMouseHandler;
100
+ private detachYasqeMouseHandler;
101
+ private initYasr;
102
+ destroy(): void;
103
+ static getDefaults(yasgui?: Yasgui): PersistedJson;
104
+ }
105
+ export default Tab;
@@ -0,0 +1,29 @@
1
+ import { default as Yasgui } from "./";
2
+ import { TabListEl } from "./TabElements";
3
+ export interface TabContextConfig {
4
+ name: string;
5
+ action: (this: HTMLElement, ev: MouseEvent) => any;
6
+ enabled: boolean;
7
+ }
8
+ export default class TabContextMenu {
9
+ private yasgui;
10
+ private contextEl;
11
+ private newTabEl;
12
+ private renameTabEl;
13
+ private copyTabEl;
14
+ private closeTabEl;
15
+ private closeOtherTabsEl;
16
+ private reOpenOldTab;
17
+ private rootEl;
18
+ private tabRef;
19
+ constructor(yasgui: Yasgui, rootEl: HTMLElement);
20
+ private getMenuItemEl;
21
+ private draw;
22
+ redraw(): void;
23
+ handleContextClick: (event: MouseEvent) => void;
24
+ openConfigMenu(currentTabId: string, currentTabEl: TabListEl, event: MouseEvent): void;
25
+ closeConfigMenu: () => void;
26
+ static get(yasgui: Yasgui, rootEl: HTMLElement): TabContextMenu;
27
+ unregisterEventListeners(): void;
28
+ destroy(): void;
29
+ }
@@ -0,0 +1,45 @@
1
+ import Yasgui from "./";
2
+ import TabContextMenu from "./TabContextMenu";
3
+ export interface TabList {
4
+ }
5
+ export declare class TabListEl {
6
+ private tabList;
7
+ private tabId;
8
+ private yasgui;
9
+ private renameEl?;
10
+ private nameEl?;
11
+ tabEl?: HTMLDivElement;
12
+ constructor(yasgui: Yasgui, tabList: TabList, tabId: string);
13
+ delete(): void;
14
+ startRename(): void;
15
+ active(active: boolean): void;
16
+ rename(name: string): void;
17
+ setAsQuerying(querying: boolean): void;
18
+ draw(name: string): HTMLDivElement;
19
+ private openTabConfigMenu;
20
+ redrawContextMenu(): void;
21
+ }
22
+ export declare class TabList {
23
+ yasgui: Yasgui;
24
+ private _selectedTab?;
25
+ private addTabEl?;
26
+ _tabs: {
27
+ [tabId: string]: TabListEl;
28
+ };
29
+ _tabsListEl?: HTMLDivElement;
30
+ tabContextMenu?: TabContextMenu;
31
+ tabEntryIndex: number | undefined;
32
+ constructor(yasgui: Yasgui);
33
+ get(tabId: string): TabListEl;
34
+ private registerListeners;
35
+ private getActiveIndex;
36
+ private handleKeydownArrowKeys;
37
+ drawTabsList(): HTMLDivElement;
38
+ handleAddNewTab: (event: Event) => void;
39
+ addTab(tabId: string, index?: number): void;
40
+ deriveTabOrderFromEls(): string[];
41
+ selectTab(tabId: string): void;
42
+ drawTab(tabId: string, index?: number): void;
43
+ destroy(): void;
44
+ }
45
+ export default TabList;
@@ -0,0 +1,28 @@
1
+ import "./TabSettingsModal.scss";
2
+ import Tab from "./Tab";
3
+ export default class TabSettingsModal {
4
+ private tab;
5
+ private modalOverlay;
6
+ private modalContent;
7
+ private settingsButton;
8
+ private prefixButton;
9
+ private prefixTextarea;
10
+ private autoCaptureCheckbox;
11
+ constructor(tab: Tab, controlBarEl: HTMLElement);
12
+ private init;
13
+ private createModal;
14
+ private switchTab;
15
+ private drawPrefixSettings;
16
+ private drawRequestSettings;
17
+ private createSection;
18
+ private createSelect;
19
+ private createOptionsSelect;
20
+ open(): void;
21
+ close(): void;
22
+ private loadSettings;
23
+ private save;
24
+ private deduplicatePrefixes;
25
+ private insertPrefixesIntoQuery;
26
+ capturePrefixesFromQuery(): void;
27
+ destroy(): void;
28
+ }
@@ -0,0 +1,3 @@
1
+ import { Config } from "./";
2
+ import { CatalogueItem } from "./endpointSelect";
3
+ export default function initialize(): Config<CatalogueItem>;
@@ -0,0 +1,44 @@
1
+ import { EventEmitter } from "events";
2
+ import parse from "autosuggest-highlight/parse";
3
+ interface AutocompleteItem<T> {
4
+ index: number;
5
+ value: T;
6
+ key: keyof T;
7
+ match: string;
8
+ }
9
+ export interface CatalogueItem {
10
+ endpoint: string;
11
+ type?: "history";
12
+ }
13
+ export interface RenderedCatalogueItem<T> {
14
+ matches: {
15
+ [k in keyof T]?: ReturnType<typeof parse>;
16
+ } & {
17
+ endpoint?: ReturnType<typeof parse>;
18
+ };
19
+ }
20
+ export interface EndpointSelectConfig<T = CatalogueItem> {
21
+ keys: (keyof T)[];
22
+ getData: () => T[];
23
+ renderItem: (data: AutocompleteItem<T> & RenderedCatalogueItem<T>, source: HTMLElement) => void;
24
+ }
25
+ export interface EndpointSelect {
26
+ on(event: string | symbol, listener: (...args: any[]) => void): this;
27
+ on(event: "remove", listener: (endpoint: string, history: string[]) => void): this;
28
+ emit(event: "remove", endpoint: string, history: string[]): boolean;
29
+ on(event: "select", listener: (endpoint: string, history: string[]) => void): this;
30
+ emit(event: "select", endpoint: string, history: string[]): boolean;
31
+ }
32
+ export declare class EndpointSelect extends EventEmitter {
33
+ private container;
34
+ private options;
35
+ private value;
36
+ private history;
37
+ private inputField;
38
+ constructor(initialValue: string, container: HTMLDivElement, options: EndpointSelectConfig, history: string[]);
39
+ private draw;
40
+ private clearListSuggestionList;
41
+ setEndpoint(endpoint: string, endpointHistory?: string[]): void;
42
+ destroy(): void;
43
+ }
44
+ export default EndpointSelect;
@@ -0,0 +1,104 @@
1
+ import { EventEmitter } from "events";
2
+ import PersistentConfig from "./PersistentConfig";
3
+ import { default as Tab, PersistedJson as PersistedTabJson } from "./Tab";
4
+ import { EndpointSelectConfig, CatalogueItem } from "./endpointSelect";
5
+ import * as shareLink from "./linkUtils";
6
+ import TabElements from "./TabElements";
7
+ import { default as Yasqe, PartialConfig as YasqeConfig, RequestConfig } from "@matdata/yasqe";
8
+ import { default as Yasr, Config as YasrConfig } from "@matdata/yasr";
9
+ export type YasguiRequestConfig = Omit<RequestConfig<Yasgui>, "adjustQueryBeforeRequest"> & {
10
+ adjustQueryBeforeRequest: RequestConfig<Yasqe>["adjustQueryBeforeRequest"];
11
+ };
12
+ export interface Config<EndpointObject extends CatalogueItem = CatalogueItem> {
13
+ autofocus: boolean;
14
+ endpointInfo: ((tab?: Tab) => Element) | undefined;
15
+ copyEndpointOnNewTab: boolean;
16
+ tabName: string;
17
+ corsProxy: string | undefined;
18
+ endpointCatalogueOptions: EndpointSelectConfig<EndpointObject>;
19
+ populateFromUrl: boolean | ((configFromUrl: PersistedTabJson) => PersistedTabJson);
20
+ autoAddOnInit: boolean;
21
+ persistenceId: ((yasr: Yasgui) => string) | string | null;
22
+ persistenceLabelConfig: string;
23
+ persistenceLabelResponse: string;
24
+ persistencyExpire: number;
25
+ yasqe: Partial<YasqeConfig>;
26
+ yasr: YasrConfig;
27
+ requestConfig: YasguiRequestConfig;
28
+ contextMenuContainer: HTMLElement | undefined;
29
+ nonSslDomain?: string;
30
+ }
31
+ export type PartialConfig = {
32
+ [P in keyof Config]?: Config[P] extends object ? Partial<Config[P]> : Config[P];
33
+ };
34
+ export type TabJson = PersistedTabJson;
35
+ export interface Yasgui {
36
+ on(event: string | symbol, listener: (...args: any[]) => void): this;
37
+ on(event: "tabSelect", listener: (instance: Yasgui, newTabId: string) => void): this;
38
+ emit(event: "tabSelect", instance: Yasgui, newTabId: string): boolean;
39
+ on(event: "tabClose", listener: (instance: Yasgui, tab: Tab) => void): this;
40
+ emit(event: "tabClose", instance: Yasgui, tab: Tab): boolean;
41
+ on(event: "query", listener: (instance: Yasgui, tab: Tab) => void): this;
42
+ emit(event: "query", instance: Yasgui, tab: Tab): boolean;
43
+ on(event: "queryBefore", listener: (instance: Yasgui, tab: Tab) => void): this;
44
+ emit(event: "queryBefore", instance: Yasgui, tab: Tab): boolean;
45
+ on(event: "queryAbort", listener: (instance: Yasgui, tab: Tab) => void): this;
46
+ emit(event: "queryAbort", instance: Yasgui, tab: Tab): boolean;
47
+ on(event: "queryResponse", listener: (instance: Yasgui, tab: Tab) => void): this;
48
+ emit(event: "queryResponse", instance: Yasgui, tab: Tab): boolean;
49
+ on(event: "tabChange", listener: (instance: Yasgui, tab: Tab) => void): this;
50
+ emit(event: "tabChange", instance: Yasgui, tab: Tab): boolean;
51
+ on(event: "tabAdd", listener: (instance: Yasgui, newTabId: string) => void): this;
52
+ emit(event: "tabAdd", instance: Yasgui, newTabId: string): boolean;
53
+ on(event: "tabOrderChanged", listener: (instance: Yasgui, tabList: string[]) => void): this;
54
+ emit(event: "tabOrderChanged", instance: Yasgui, tabList: string[]): boolean;
55
+ on(event: "fullscreen-enter", listener: (instance: Yasgui) => void): this;
56
+ emit(event: "fullscreen-enter", instance: Yasgui): boolean;
57
+ on(event: "fullscreen-leave", listener: (instance: Yasgui) => void): this;
58
+ emit(event: "fullscreen-leave", instance: Yasgui): boolean;
59
+ on(event: "endpointHistoryChange", listener: (instance: Yasgui, history: string[]) => void): this;
60
+ emit(event: "endpointHistoryChange", instance: Yasgui, history: string[]): boolean;
61
+ on(event: "autocompletionShown", listener: (instance: Yasgui, tab: Tab, widget: any) => void): this;
62
+ emit(event: "autocompletionShown", instance: Yasgui, tab: Tab, widget: any): boolean;
63
+ on(event: "autocompletionClose", listener: (instance: Yasgui, tab: Tab) => void): this;
64
+ emit(event: "autocompletionClose", instance: Yasgui, tab: Tab): boolean;
65
+ }
66
+ export declare class Yasgui extends EventEmitter {
67
+ rootEl: HTMLDivElement;
68
+ tabElements: TabElements;
69
+ _tabs: {
70
+ [tabId: string]: Tab;
71
+ };
72
+ tabPanelsEl: HTMLDivElement;
73
+ config: Config;
74
+ persistentConfig: PersistentConfig;
75
+ static Tab: typeof Tab;
76
+ constructor(parent: HTMLElement, config: PartialConfig);
77
+ hasFullscreen(fullscreen: boolean): void;
78
+ getStorageId(label: string, getter?: Config["persistenceId"]): string | undefined;
79
+ createTabName(name?: string, i?: number): string;
80
+ tabNameTaken(name: string): Tab;
81
+ getTab(tabId?: string): Tab | undefined;
82
+ private markTabSelected;
83
+ selectTabId(tabId: string): Tab;
84
+ private tabConfigEquals;
85
+ private findTabIdForConfig;
86
+ private _registerTabListeners;
87
+ _setPanel(panelId: string, panel: HTMLDivElement): void;
88
+ _removePanel(panel: HTMLDivElement | undefined): void;
89
+ addTab(setActive: boolean, partialTabConfig?: Partial<PersistedTabJson>, opts?: {
90
+ atIndex?: number;
91
+ avoidDuplicateTabs?: boolean;
92
+ }): Tab;
93
+ restoreLastTab(): void;
94
+ destroy(): void;
95
+ static linkUtils: typeof shareLink;
96
+ static Yasr: typeof Yasr;
97
+ static Yasqe: typeof Yasqe;
98
+ static defaults: Config<CatalogueItem>;
99
+ static corsEnabled: {
100
+ [endpoint: string]: boolean;
101
+ };
102
+ }
103
+ export declare function getRandomId(): string;
104
+ export default Yasgui;
@@ -0,0 +1,43 @@
1
+ import { default as Tab, PersistedJson } from "./Tab";
2
+ import { PlainRequestConfig } from "@matdata/yasqe";
3
+ export type RequestArgs = {
4
+ [argName: string]: string | string[];
5
+ };
6
+ export declare function appendArgsToUrl(_url: string, args: RequestArgs): string;
7
+ export declare function createShareLink(forUrl: string, tab: Tab): any;
8
+ export type ShareConfigObject = {
9
+ query: string;
10
+ endpoint: string;
11
+ requestMethod: PlainRequestConfig["method"];
12
+ tabTitle: string;
13
+ headers: PlainRequestConfig["headers"];
14
+ contentTypeConstruct: string;
15
+ contentTypeSelect: string;
16
+ args: PlainRequestConfig["args"];
17
+ namedGraphs: PlainRequestConfig["namedGraphs"];
18
+ defaultGraphs: PlainRequestConfig["defaultGraphs"];
19
+ outputFormat?: string;
20
+ outputSettings: any;
21
+ };
22
+ export declare function createShareConfig(tab: Tab): ShareConfigObject;
23
+ export declare function getConfigFromUrl(defaults: PersistedJson, _url?: string): PersistedJson | undefined;
24
+ export declare function queryCatalogConfigToTabConfig<Q extends QueryCatalogConfig>(catalogConfig: Q, defaults?: PersistedJson): PersistedJson;
25
+ export interface QueryCatalogConfig {
26
+ service: string;
27
+ name: string;
28
+ description: string;
29
+ requestConfig?: {
30
+ payload: {
31
+ query: string;
32
+ "default-graph-uri"?: string | string[];
33
+ "named-graph-uri"?: string | string[];
34
+ };
35
+ headers?: {
36
+ [key: string]: string;
37
+ };
38
+ };
39
+ renderConfig?: {
40
+ output: string;
41
+ settings?: any;
42
+ };
43
+ }
@@ -0,0 +1,24 @@
1
+ <!doctype html><html><head><meta charset="UTF-8"><style>body {
2
+ font-family: 'Roboto', sans-serif;
3
+ margin: 0px;
4
+ }
5
+ .navItem a {
6
+ color: #555;
7
+ text-decoration: none;
8
+ padding: 5px;
9
+ padding-right:15px;
10
+ }
11
+ .navItem a:hover {
12
+ color:#222
13
+ }
14
+ .navItem.active a {
15
+ color: black;
16
+ font-size:110%;
17
+ }</style><script src="../../packages/yasgui/static/yasgui.polyfill.min.js"></script><link href="https://fonts.googleapis.com/css?family=Roboto" rel="stylesheet"><title></title><script defer="defer" src="/yasgui.min.js"></script><script defer="defer" src="/yasqe.min.js"></script><script defer="defer" src="/yasr.min.js"></script><link href="/yasgui.min.css" rel="stylesheet"><link href="/yasqe.min.css" rel="stylesheet"><link href="/yasr.min.css" rel="stylesheet"></head><body><div style="background:#eee"><nav style="display: flex"><img src="webpack/yasgui.png" style="max-height:50px;padding:5px;margin-left: 10px" alt="Yasgui Logo"><ul style="display: flex; list-style: none; align-self: center"><li class="navItem active"><a class="nav-link" href="yasgui.html">Yasgui</a></li><li class="navItem false"><a class="nav-link" href="yasqe.html">Yasqe</a></li><li class="navItem false"><a class="nav-link" href="yasr.html">Yasr</a></li></ul></nav></div><div id="yasgui"></div><script>window.onpageshow = function () {
18
+ window.yasgui = new Yasgui(document.getElementById("yasgui"), {
19
+ corsProxy: "",
20
+ requestConfig: {
21
+ endpoint: "https://dbpedia.org/sparql",
22
+ }
23
+ });
24
+ };</script></body></html>