altair-graphql-core 4.6.2 → 5.0.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/config.d.ts +2 -2
- package/build/theme/defaults/dark.d.ts +1 -1
- package/build/theme/defaults/dark.js +8 -8
- package/build/theme/index.d.ts +6 -0
- package/build/theme/theme.d.ts +3 -0
- package/build/theme/theme.js +45 -39
- package/build/types/state/collection.interfaces.d.ts +20 -9
- package/build/types/state/dialog.interfaces.d.ts +0 -1
- package/build/types/state/layout.interfaces.d.ts +1 -1
- package/build/types/state/local.interfaces.d.ts +5 -5
- package/build/types/state/window.interfaces.d.ts +5 -5
- package/build/types/state/windows-meta.interfaces.d.ts +1 -0
- package/build/utils/is_electron.js +4 -1
- package/package.json +3 -3
package/build/config.d.ts
CHANGED
|
@@ -139,14 +139,14 @@ export declare class AltairConfig {
|
|
|
139
139
|
subscriptionsProtocol: string;
|
|
140
140
|
query: string;
|
|
141
141
|
variables: string;
|
|
142
|
-
headers:
|
|
142
|
+
headers: IDictionary<any>;
|
|
143
143
|
environments: IInitialEnvironments;
|
|
144
144
|
preRequestScript: string;
|
|
145
145
|
postRequestScript: string;
|
|
146
146
|
instanceStorageNamespace: string;
|
|
147
147
|
settings: Partial<SettingsState>;
|
|
148
148
|
initialSubscriptionsProvider: SubscriptionProviderIds;
|
|
149
|
-
initialSubscriptionsPayload:
|
|
149
|
+
initialSubscriptionsPayload: IDictionary<any>;
|
|
150
150
|
initialHttpMethod: "POST" | "GET" | "PUT" | "DELETE";
|
|
151
151
|
preserveState: boolean;
|
|
152
152
|
windows: AltairWindowOptions[];
|
|
@@ -1,16 +1,16 @@
|
|
|
1
|
-
import { foundations } from
|
|
1
|
+
import { foundations } from "../theme";
|
|
2
2
|
const theme = {
|
|
3
3
|
colors: {
|
|
4
4
|
bg: foundations.colors.black,
|
|
5
|
-
offBg:
|
|
5
|
+
offBg: "#343233",
|
|
6
6
|
font: foundations.colors.white,
|
|
7
7
|
offFont: foundations.colors.lightGray,
|
|
8
|
-
border:
|
|
9
|
-
offBorder:
|
|
10
|
-
headerBg:
|
|
8
|
+
border: "#565c64",
|
|
9
|
+
offBorder: "#565656",
|
|
10
|
+
headerBg: "#343233"
|
|
11
11
|
},
|
|
12
12
|
shadow: {
|
|
13
|
-
opacity: .3
|
|
13
|
+
opacity: 0.3
|
|
14
14
|
},
|
|
15
15
|
editor: {
|
|
16
16
|
colors: {
|
|
@@ -24,8 +24,8 @@ const theme = {
|
|
|
24
24
|
property: foundations.colors.blue,
|
|
25
25
|
definition: foundations.colors.orange,
|
|
26
26
|
punctuation: foundations.colors.blue,
|
|
27
|
-
cursor: foundations.colors.blue
|
|
27
|
+
cursor: foundations.colors.blue
|
|
28
28
|
}
|
|
29
|
-
}
|
|
29
|
+
}
|
|
30
30
|
};
|
|
31
31
|
export default theme;
|
package/build/theme/index.d.ts
CHANGED
|
@@ -9,6 +9,7 @@ export declare const light: {
|
|
|
9
9
|
white?: string;
|
|
10
10
|
green?: string;
|
|
11
11
|
blue?: string;
|
|
12
|
+
rose?: string;
|
|
12
13
|
cerise?: string;
|
|
13
14
|
red?: string;
|
|
14
15
|
orange?: string;
|
|
@@ -17,6 +18,7 @@ export declare const light: {
|
|
|
17
18
|
darkPurple?: string;
|
|
18
19
|
primary?: string;
|
|
19
20
|
secondary?: string;
|
|
21
|
+
tertiary?: string;
|
|
20
22
|
bg?: string;
|
|
21
23
|
offBg?: string;
|
|
22
24
|
font?: string;
|
|
@@ -72,6 +74,7 @@ export declare const dark: {
|
|
|
72
74
|
white?: string;
|
|
73
75
|
green?: string;
|
|
74
76
|
blue?: string;
|
|
77
|
+
rose?: string;
|
|
75
78
|
cerise?: string;
|
|
76
79
|
red?: string;
|
|
77
80
|
orange?: string;
|
|
@@ -80,6 +83,7 @@ export declare const dark: {
|
|
|
80
83
|
darkPurple?: string;
|
|
81
84
|
primary?: string;
|
|
82
85
|
secondary?: string;
|
|
86
|
+
tertiary?: string;
|
|
83
87
|
bg?: string;
|
|
84
88
|
offBg?: string;
|
|
85
89
|
font?: string;
|
|
@@ -135,6 +139,7 @@ export declare const dracula: {
|
|
|
135
139
|
white?: string;
|
|
136
140
|
green?: string;
|
|
137
141
|
blue?: string;
|
|
142
|
+
rose?: string;
|
|
138
143
|
cerise?: string;
|
|
139
144
|
red?: string;
|
|
140
145
|
orange?: string;
|
|
@@ -143,6 +148,7 @@ export declare const dracula: {
|
|
|
143
148
|
darkPurple?: string;
|
|
144
149
|
primary?: string;
|
|
145
150
|
secondary?: string;
|
|
151
|
+
tertiary?: string;
|
|
146
152
|
bg?: string;
|
|
147
153
|
offBg?: string;
|
|
148
154
|
font?: string;
|
package/build/theme/theme.d.ts
CHANGED
|
@@ -8,6 +8,7 @@ export declare const foundations: {
|
|
|
8
8
|
white: string;
|
|
9
9
|
green: string;
|
|
10
10
|
blue: string;
|
|
11
|
+
rose: string;
|
|
11
12
|
cerise: string;
|
|
12
13
|
red: string;
|
|
13
14
|
orange: string;
|
|
@@ -37,6 +38,7 @@ declare const theme: {
|
|
|
37
38
|
white: string;
|
|
38
39
|
green: string;
|
|
39
40
|
blue: string;
|
|
41
|
+
rose: string;
|
|
40
42
|
cerise: string;
|
|
41
43
|
red: string;
|
|
42
44
|
orange: string;
|
|
@@ -60,6 +62,7 @@ declare const theme: {
|
|
|
60
62
|
colors: {
|
|
61
63
|
primary: string;
|
|
62
64
|
secondary: string;
|
|
65
|
+
tertiary: string;
|
|
63
66
|
bg: string;
|
|
64
67
|
offBg: string;
|
|
65
68
|
font: string;
|
package/build/theme/theme.js
CHANGED
|
@@ -1,54 +1,56 @@
|
|
|
1
|
-
import deepmerge from
|
|
2
|
-
const convertCssColorNameToHex = require(
|
|
1
|
+
import deepmerge from "deepmerge";
|
|
2
|
+
const convertCssColorNameToHex = require("convert-css-color-name-to-hex");
|
|
3
3
|
export const foundations = {
|
|
4
|
-
easing:
|
|
4
|
+
easing: "ease",
|
|
5
5
|
colors: {
|
|
6
|
-
black:
|
|
7
|
-
darkGray:
|
|
8
|
-
gray:
|
|
9
|
-
lightGray:
|
|
10
|
-
white:
|
|
11
|
-
green:
|
|
12
|
-
blue:
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
6
|
+
black: "#201e1f",
|
|
7
|
+
darkGray: "#a6a6a6",
|
|
8
|
+
gray: "#eaeaea",
|
|
9
|
+
lightGray: "#f0f0f0",
|
|
10
|
+
white: "#ffffff",
|
|
11
|
+
green: "#64CB29",
|
|
12
|
+
blue: "#2d9ee0",
|
|
13
|
+
rose: "#f45b69",
|
|
14
|
+
cerise: "#f00faa",
|
|
15
|
+
red: "#ed6a5a",
|
|
16
|
+
orange: "#edae49",
|
|
17
|
+
yellow: "#e4ce44",
|
|
18
|
+
lightRed: "#cc998d",
|
|
19
|
+
darkPurple: "#303965"
|
|
19
20
|
},
|
|
20
21
|
type: {
|
|
21
22
|
fontSize: {
|
|
22
23
|
base: 24,
|
|
23
24
|
remBase: 24,
|
|
24
25
|
body: 13,
|
|
25
|
-
bodySmaller: 12
|
|
26
|
+
bodySmaller: 12
|
|
26
27
|
},
|
|
27
28
|
fontFamily: {
|
|
28
|
-
default: '-apple-system, BlinkMacSystemFont, "Segoe UI", "Helvetica Neue", Roboto, Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol"'
|
|
29
|
-
}
|
|
30
|
-
}
|
|
29
|
+
default: '-apple-system, BlinkMacSystemFont, "Segoe UI", "Helvetica Neue", Roboto, Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol"'
|
|
30
|
+
}
|
|
31
|
+
}
|
|
31
32
|
};
|
|
32
33
|
const theme = deepmerge(foundations, {
|
|
33
34
|
isSystem: false,
|
|
34
35
|
colors: {
|
|
35
36
|
primary: foundations.colors.green,
|
|
36
37
|
secondary: foundations.colors.blue,
|
|
38
|
+
tertiary: foundations.colors.rose,
|
|
37
39
|
bg: foundations.colors.white,
|
|
38
40
|
offBg: foundations.colors.lightGray,
|
|
39
41
|
font: foundations.colors.black,
|
|
40
42
|
offFont: foundations.colors.darkGray,
|
|
41
43
|
border: foundations.colors.gray,
|
|
42
44
|
offBorder: foundations.colors.lightGray,
|
|
43
|
-
headerBg: foundations.colors.white
|
|
45
|
+
headerBg: foundations.colors.white
|
|
44
46
|
},
|
|
45
47
|
shadow: {
|
|
46
48
|
color: foundations.colors.black,
|
|
47
|
-
opacity: .1
|
|
49
|
+
opacity: 0.1
|
|
48
50
|
},
|
|
49
51
|
editor: {
|
|
50
52
|
fontFamily: {
|
|
51
|
-
default:
|
|
53
|
+
default: "JetBrains Mono"
|
|
52
54
|
},
|
|
53
55
|
fontSize: foundations.type.fontSize.bodySmaller,
|
|
54
56
|
colors: {
|
|
@@ -63,8 +65,8 @@ const theme = deepmerge(foundations, {
|
|
|
63
65
|
punctuation: foundations.colors.blue,
|
|
64
66
|
definition: foundations.colors.orange,
|
|
65
67
|
builtin: foundations.colors.orange,
|
|
66
|
-
cursor: foundations.colors.blue
|
|
67
|
-
}
|
|
68
|
+
cursor: foundations.colors.blue
|
|
69
|
+
}
|
|
68
70
|
}
|
|
69
71
|
});
|
|
70
72
|
const colorToRGBA = (color) => {
|
|
@@ -73,35 +75,39 @@ const colorToRGBA = (color) => {
|
|
|
73
75
|
return fromHex;
|
|
74
76
|
}
|
|
75
77
|
// Strip everything except the integers eg. "rgb(" and ")" and " "
|
|
76
|
-
const rgbStr = color.split(/\(([^)]+)\)/)[1].replace(/ /g,
|
|
78
|
+
const rgbStr = color.split(/\(([^)]+)\)/)[1].replace(/ /g, "");
|
|
77
79
|
// map RGB values to variables
|
|
78
|
-
const r = parseInt(rgbStr.split(
|
|
79
|
-
const g = parseInt(rgbStr.split(
|
|
80
|
-
const b = parseInt(rgbStr.split(
|
|
81
|
-
const a = typeof rgbStr.split(
|
|
80
|
+
const r = parseInt(rgbStr.split(",")[0], 10);
|
|
81
|
+
const g = parseInt(rgbStr.split(",")[1], 10);
|
|
82
|
+
const b = parseInt(rgbStr.split(",")[2], 10);
|
|
83
|
+
const a = typeof rgbStr.split(",")[3] !== null
|
|
84
|
+
? parseInt(rgbStr.split(",")[3], 10)
|
|
85
|
+
: undefined;
|
|
82
86
|
return { r, g, b, a };
|
|
83
87
|
};
|
|
84
|
-
const contrast = (color =
|
|
88
|
+
const contrast = (color = "") => {
|
|
85
89
|
// map RGB values to variables
|
|
86
90
|
const { r, g, b } = colorToRGBA(color);
|
|
87
91
|
// calculate contrast of color (standard grayscale algorithmic formula)
|
|
88
|
-
return (Math.round(r * 299) + Math.round(g * 587) + Math.round(b * 114)) / 1000;
|
|
92
|
+
return ((Math.round(r * 299) + Math.round(g * 587) + Math.round(b * 114)) / 1000);
|
|
89
93
|
};
|
|
90
94
|
const hexToRgb = (hex) => {
|
|
91
95
|
const result = /^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(convertCssColorNameToHex(hex));
|
|
92
|
-
return result
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
96
|
+
return result
|
|
97
|
+
? {
|
|
98
|
+
r: parseInt(result[1], 16),
|
|
99
|
+
g: parseInt(result[2], 16),
|
|
100
|
+
b: parseInt(result[3], 16)
|
|
101
|
+
}
|
|
102
|
+
: undefined;
|
|
97
103
|
};
|
|
98
104
|
export const hexToRgbStr = (hex) => {
|
|
99
105
|
if (!hex) {
|
|
100
|
-
return
|
|
106
|
+
return "";
|
|
101
107
|
}
|
|
102
108
|
const rgb = hexToRgb(hex);
|
|
103
109
|
if (!rgb) {
|
|
104
|
-
return
|
|
110
|
+
return "";
|
|
105
111
|
}
|
|
106
112
|
const { r, g, b } = rgb;
|
|
107
113
|
return `${r}, ${g}, ${b}`;
|
|
@@ -1,7 +1,8 @@
|
|
|
1
|
-
import { PostrequestState } from
|
|
2
|
-
import { PrerequestState } from
|
|
3
|
-
import { ExportWindowState } from
|
|
4
|
-
export declare type SortByOptions =
|
|
1
|
+
import { PostrequestState } from "./postrequest.interfaces";
|
|
2
|
+
import { PrerequestState } from "./prerequest.interfaces";
|
|
3
|
+
import { ExportWindowState } from "./window.interfaces";
|
|
4
|
+
export declare type SortByOptions = "a-z" | "z-a" | "newest" | "oldest";
|
|
5
|
+
export declare type EntityStorageType = "local" | "firestore";
|
|
5
6
|
export interface CollectionState {
|
|
6
7
|
list: IQueryCollection[];
|
|
7
8
|
activeCollection: any;
|
|
@@ -9,13 +10,17 @@ export interface CollectionState {
|
|
|
9
10
|
}
|
|
10
11
|
export interface IQuery extends ExportWindowState {
|
|
11
12
|
id?: string;
|
|
12
|
-
|
|
13
|
+
storageType?: EntityStorageType;
|
|
13
14
|
created_at?: number;
|
|
14
15
|
updated_at?: number;
|
|
15
16
|
}
|
|
17
|
+
export interface IRemoteQuery extends IQuery {
|
|
18
|
+
id?: string;
|
|
19
|
+
collectionId: string;
|
|
20
|
+
ownerUid: string;
|
|
21
|
+
}
|
|
16
22
|
export interface IQueryCollection {
|
|
17
|
-
id?:
|
|
18
|
-
serverId?: number;
|
|
23
|
+
id?: string;
|
|
19
24
|
title: string;
|
|
20
25
|
queries: IQuery[];
|
|
21
26
|
description?: string;
|
|
@@ -26,15 +31,21 @@ export interface IQueryCollection {
|
|
|
26
31
|
* e.g. '/123/456'
|
|
27
32
|
*/
|
|
28
33
|
parentPath?: string;
|
|
34
|
+
storageType?: EntityStorageType;
|
|
29
35
|
created_at?: number;
|
|
30
36
|
updated_at?: number;
|
|
31
37
|
}
|
|
38
|
+
export interface IRemoteQueryCollection extends Omit<IQueryCollection, "parentPath" | "queries"> {
|
|
39
|
+
id?: string;
|
|
40
|
+
parentCollectionId?: string;
|
|
41
|
+
ownerUid: string;
|
|
42
|
+
}
|
|
32
43
|
export interface IQueryCollectionTree extends IQueryCollection {
|
|
33
|
-
id:
|
|
44
|
+
id: string;
|
|
34
45
|
collections?: IQueryCollectionTree[];
|
|
35
46
|
}
|
|
36
47
|
export interface ExportCollectionState extends IQueryCollectionTree {
|
|
37
48
|
version: 1;
|
|
38
|
-
type:
|
|
49
|
+
type: "collection";
|
|
39
50
|
}
|
|
40
51
|
//# sourceMappingURL=collection.interfaces.d.ts.map
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { PluginBase } from
|
|
2
|
-
import { AltairPanel } from
|
|
3
|
-
import { AltairPlugin } from
|
|
4
|
-
import { AltairUiAction } from
|
|
5
|
-
import { IDictionary } from
|
|
1
|
+
import { PluginBase } from "../../plugin/base";
|
|
2
|
+
import { AltairPanel } from "../../plugin/panel";
|
|
3
|
+
import { AltairPlugin } from "../../plugin/plugin.interfaces";
|
|
4
|
+
import { AltairUiAction } from "../../plugin/ui-action";
|
|
5
|
+
import { IDictionary } from "../shared";
|
|
6
6
|
export interface PluginStateEntry {
|
|
7
7
|
name: string;
|
|
8
8
|
context: any;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { GraphQLSchema } from
|
|
2
|
-
import { SubscriptionProviderIds } from
|
|
3
|
-
import { PerWindowState } from
|
|
1
|
+
import { GraphQLSchema } from "graphql";
|
|
2
|
+
import { SubscriptionProviderIds } from "../../subscriptions";
|
|
3
|
+
import { PerWindowState } from "./per-window.interfaces";
|
|
4
4
|
export interface WindowState {
|
|
5
5
|
[id: string]: PerWindowState | undefined;
|
|
6
6
|
}
|
|
@@ -9,7 +9,7 @@ export interface WindowState {
|
|
|
9
9
|
*/
|
|
10
10
|
export interface ExportWindowState {
|
|
11
11
|
version: 1;
|
|
12
|
-
type:
|
|
12
|
+
type: "window";
|
|
13
13
|
windowName: string;
|
|
14
14
|
apiUrl: string;
|
|
15
15
|
query: string;
|
|
@@ -28,7 +28,7 @@ export interface ExportWindowState {
|
|
|
28
28
|
/**
|
|
29
29
|
* ID of the collection this query belongs to
|
|
30
30
|
*/
|
|
31
|
-
collectionId?:
|
|
31
|
+
collectionId?: string;
|
|
32
32
|
/**
|
|
33
33
|
* ID for window in collection
|
|
34
34
|
*/
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "altair-graphql-core",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "5.0.0",
|
|
4
4
|
"description": "Several of the core logic for altair graphql client",
|
|
5
5
|
"main": "./build/index.js",
|
|
6
6
|
"types": "./build/index.d.ts",
|
|
@@ -38,7 +38,7 @@
|
|
|
38
38
|
"ajv-cli": "5.0.0",
|
|
39
39
|
"react": "17.0.2",
|
|
40
40
|
"ts-node": "9.1.1",
|
|
41
|
-
"typescript": "4.
|
|
41
|
+
"typescript": "4.7.4",
|
|
42
42
|
"typescript-json-schema": "0.50.1"
|
|
43
43
|
},
|
|
44
44
|
"dependencies": {
|
|
@@ -61,5 +61,5 @@
|
|
|
61
61
|
"util": "0.12.4",
|
|
62
62
|
"uuid": "8.3.2"
|
|
63
63
|
},
|
|
64
|
-
"gitHead": "
|
|
64
|
+
"gitHead": "458bbd59bcc282d74d1508e9ef4ec3820acb074b"
|
|
65
65
|
}
|