altair-graphql-core 5.0.21 → 5.0.23

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 (96) hide show
  1. package/build/cjs/config.js +1 -0
  2. package/build/cjs/index.js +1 -0
  3. package/build/cjs/plugin/base.js +1 -0
  4. package/build/cjs/plugin/context/context.interface.js +1 -0
  5. package/build/cjs/plugin/event/event.interfaces.js +1 -0
  6. package/build/cjs/plugin/panel.js +1 -0
  7. package/build/cjs/plugin/plugin.interfaces.js +1 -0
  8. package/build/cjs/plugin/ui-action.js +1 -0
  9. package/build/cjs/subscriptions/index.js +1 -0
  10. package/build/cjs/subscriptions/providers/action-cable.js +1 -0
  11. package/build/cjs/subscriptions/providers/app-sync.js +1 -0
  12. package/build/cjs/subscriptions/providers/graphql-sse.js +1 -0
  13. package/build/cjs/subscriptions/providers/graphql-ws.js +1 -0
  14. package/build/cjs/subscriptions/providers/ws.js +1 -0
  15. package/build/cjs/subscriptions/subscription-provider.js +1 -0
  16. package/build/cjs/theme/defaults/dark.js +1 -0
  17. package/build/cjs/theme/defaults/dracula.js +1 -0
  18. package/build/cjs/theme/defaults/light.js +1 -0
  19. package/build/cjs/theme/index.js +1 -0
  20. package/build/cjs/theme/theme.js +20 -32
  21. package/build/cjs/types/shared.js +1 -0
  22. package/build/cjs/types/state/account.interfaces.d.ts +12 -0
  23. package/build/cjs/types/state/account.interfaces.js +1 -0
  24. package/build/cjs/types/state/collection.interfaces.js +1 -0
  25. package/build/cjs/types/state/dialog.interfaces.js +1 -0
  26. package/build/cjs/types/state/docs.interfaces.js +1 -0
  27. package/build/cjs/types/state/donation.interfaces.js +1 -0
  28. package/build/cjs/types/state/environments.interfaces.js +1 -0
  29. package/build/cjs/types/state/gql-schema.interfaces.js +1 -0
  30. package/build/cjs/types/state/header.interfaces.js +1 -0
  31. package/build/cjs/types/state/history.interfaces.js +1 -0
  32. package/build/cjs/types/state/layout.interfaces.js +1 -0
  33. package/build/cjs/types/state/local.interfaces.js +1 -0
  34. package/build/cjs/types/state/per-window.interfaces.js +1 -0
  35. package/build/cjs/types/state/postrequest.interfaces.js +1 -0
  36. package/build/cjs/types/state/prerequest.interfaces.js +1 -0
  37. package/build/cjs/types/state/query.interfaces.js +1 -0
  38. package/build/cjs/types/state/settings.interfaces.js +1 -0
  39. package/build/cjs/types/state/state.interfaces.js +1 -0
  40. package/build/cjs/types/state/stream.interfaces.js +1 -0
  41. package/build/cjs/types/state/variable.interfaces.js +1 -0
  42. package/build/cjs/types/state/window.interfaces.js +1 -0
  43. package/build/cjs/types/state/windows-meta.interfaces.js +1 -0
  44. package/build/cjs/types/state/workspace.interface.js +1 -0
  45. package/build/cjs/utils/is_electron.js +2 -1
  46. package/build/cjs/utils/logger.js +1 -0
  47. package/build/cjs/utils/value-object.js +1 -0
  48. package/build/config.js +1 -0
  49. package/build/index.js +1 -0
  50. package/build/plugin/base.js +1 -0
  51. package/build/plugin/context/context.interface.js +1 -0
  52. package/build/plugin/event/event.interfaces.js +1 -0
  53. package/build/plugin/panel.js +1 -0
  54. package/build/plugin/plugin.interfaces.js +1 -0
  55. package/build/plugin/ui-action.js +1 -0
  56. package/build/subscriptions/index.js +1 -0
  57. package/build/subscriptions/providers/action-cable.js +1 -0
  58. package/build/subscriptions/providers/app-sync.js +1 -0
  59. package/build/subscriptions/providers/graphql-sse.js +1 -0
  60. package/build/subscriptions/providers/graphql-ws.js +1 -0
  61. package/build/subscriptions/providers/ws.js +1 -0
  62. package/build/subscriptions/subscription-provider.js +1 -0
  63. package/build/theme/defaults/dark.js +1 -0
  64. package/build/theme/defaults/dracula.js +1 -0
  65. package/build/theme/defaults/light.js +1 -0
  66. package/build/theme/index.js +1 -0
  67. package/build/theme/theme.js +20 -32
  68. package/build/types/shared.js +1 -0
  69. package/build/types/state/account.interfaces.d.ts +12 -0
  70. package/build/types/state/account.interfaces.js +1 -0
  71. package/build/types/state/collection.interfaces.js +1 -0
  72. package/build/types/state/dialog.interfaces.js +1 -0
  73. package/build/types/state/docs.interfaces.js +1 -0
  74. package/build/types/state/donation.interfaces.js +1 -0
  75. package/build/types/state/environments.interfaces.js +1 -0
  76. package/build/types/state/gql-schema.interfaces.js +1 -0
  77. package/build/types/state/header.interfaces.js +1 -0
  78. package/build/types/state/history.interfaces.js +1 -0
  79. package/build/types/state/layout.interfaces.js +1 -0
  80. package/build/types/state/local.interfaces.js +1 -0
  81. package/build/types/state/per-window.interfaces.js +1 -0
  82. package/build/types/state/postrequest.interfaces.js +1 -0
  83. package/build/types/state/prerequest.interfaces.js +1 -0
  84. package/build/types/state/query.interfaces.js +1 -0
  85. package/build/types/state/settings.interfaces.js +1 -0
  86. package/build/types/state/state.interfaces.js +1 -0
  87. package/build/types/state/stream.interfaces.js +1 -0
  88. package/build/types/state/variable.interfaces.js +1 -0
  89. package/build/types/state/window.interfaces.js +1 -0
  90. package/build/types/state/windows-meta.interfaces.js +1 -0
  91. package/build/types/state/workspace.interface.js +1 -0
  92. package/build/utils/is_electron.js +2 -1
  93. package/build/utils/logger.js +1 -0
  94. package/build/utils/value-object.js +1 -0
  95. package/package.json +36 -41
  96. package/tsconfig.json +1 -0
@@ -104,3 +104,4 @@ const getAltairConfig = () => {
104
104
  };
105
105
  exports.getAltairConfig = getAltairConfig;
106
106
  window.getAltairConfig = exports.getAltairConfig;
107
+ //# sourceMappingURL=config.js.map
@@ -5,3 +5,4 @@ const registerPluginClass = (pluginClassName, pluginClass) => {
5
5
  window['AltairGraphQL'].plugins[pluginClassName] = pluginClass;
6
6
  };
7
7
  exports.registerPluginClass = registerPluginClass;
8
+ //# sourceMappingURL=index.js.map
@@ -7,3 +7,4 @@ class PluginBase {
7
7
  }
8
8
  }
9
9
  exports.PluginBase = PluginBase;
10
+ //# sourceMappingURL=base.js.map
@@ -1,2 +1,3 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
+ //# sourceMappingURL=context.interface.js.map
@@ -1,2 +1,3 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
+ //# sourceMappingURL=event.interfaces.js.map
@@ -24,3 +24,4 @@ class AltairPanel {
24
24
  }
25
25
  }
26
26
  exports.AltairPanel = AltairPanel;
27
+ //# sourceMappingURL=panel.js.map
@@ -35,3 +35,4 @@ const createPlugin = (name, manifest) => {
35
35
  };
36
36
  };
37
37
  exports.createPlugin = createPlugin;
38
+ //# sourceMappingURL=plugin.interfaces.js.map
@@ -18,3 +18,4 @@ class AltairUiAction {
18
18
  }
19
19
  }
20
20
  exports.AltairUiAction = AltairUiAction;
21
+ //# sourceMappingURL=ui-action.js.map
@@ -13,3 +13,4 @@ exports.SUBSCRIPTION_PROVIDER_IDS = {
13
13
  ACTION_CABLE: exports.ACTION_CABLE_PROVIDER_ID,
14
14
  GRAPHQL_SSE: exports.GRAPHQL_SSE_ID,
15
15
  };
16
+ //# sourceMappingURL=index.js.map
@@ -34,3 +34,4 @@ class ActionCableSubscriptionProvider extends subscription_provider_1.Subscripti
34
34
  }
35
35
  }
36
36
  exports.ActionCableSubscriptionProvider = ActionCableSubscriptionProvider;
37
+ //# sourceMappingURL=action-cable.js.map
@@ -53,3 +53,4 @@ class AppSyncSubscriptionProvider extends subscription_provider_1.SubscriptionPr
53
53
  }
54
54
  }
55
55
  exports.AppSyncSubscriptionProvider = AppSyncSubscriptionProvider;
56
+ //# sourceMappingURL=app-sync.js.map
@@ -41,3 +41,4 @@ class GraphQLSSESubscriptionProvider extends subscription_provider_1.Subscriptio
41
41
  }
42
42
  }
43
43
  exports.GraphQLSSESubscriptionProvider = GraphQLSSESubscriptionProvider;
44
+ //# sourceMappingURL=graphql-sse.js.map
@@ -54,3 +54,4 @@ class GraphQLWsSubscriptionProvider extends subscription_provider_1.Subscription
54
54
  }
55
55
  }
56
56
  exports.GraphQLWsSubscriptionProvider = GraphQLWsSubscriptionProvider;
57
+ //# sourceMappingURL=graphql-ws.js.map
@@ -39,3 +39,4 @@ class WebsocketSubscriptionProvider extends subscription_provider_1.Subscription
39
39
  }
40
40
  }
41
41
  exports.WebsocketSubscriptionProvider = WebsocketSubscriptionProvider;
42
+ //# sourceMappingURL=ws.js.map
@@ -9,3 +9,4 @@ class SubscriptionProvider {
9
9
  }
10
10
  }
11
11
  exports.SubscriptionProvider = SubscriptionProvider;
12
+ //# sourceMappingURL=subscription-provider.js.map
@@ -31,3 +31,4 @@ const theme = {
31
31
  },
32
32
  };
33
33
  exports.default = theme;
34
+ //# sourceMappingURL=dark.js.map
@@ -26,3 +26,4 @@ const theme = {
26
26
  },
27
27
  };
28
28
  exports.default = theme;
29
+ //# sourceMappingURL=dracula.js.map
@@ -2,3 +2,4 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  const theme = {};
4
4
  exports.default = theme;
5
+ //# sourceMappingURL=light.js.map
@@ -25,3 +25,4 @@ __exportStar(require("./theme"), exports);
25
25
  exports.light = light_1.default;
26
26
  exports.dark = dark_1.default;
27
27
  exports.dracula = dracula_1.default;
28
+ //# sourceMappingURL=index.js.map
@@ -5,7 +5,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
6
  exports.createTheme = exports.mergeThemes = exports.hexToRgbStr = exports.foundations = void 0;
7
7
  const deepmerge_1 = __importDefault(require("deepmerge"));
8
- const convertCssColorNameToHex = require('convert-css-color-name-to-hex');
8
+ const color_name_1 = __importDefault(require("color-name"));
9
9
  exports.foundations = {
10
10
  easing: 'ease',
11
11
  colors: {
@@ -75,43 +75,30 @@ const theme = (0, deepmerge_1.default)(exports.foundations, {
75
75
  },
76
76
  },
77
77
  });
78
- const colorToRGBA = (color) => {
79
- const fromHex = hexToRgb(color);
80
- if (fromHex) {
81
- return fromHex;
78
+ const colorOrHexToRgb = (hex) => {
79
+ const rgb = color_name_1.default[hex];
80
+ if (rgb) {
81
+ return {
82
+ r: rgb[0],
83
+ g: rgb[1],
84
+ b: rgb[2],
85
+ };
82
86
  }
83
- // Strip everything except the integers eg. "rgb(" and ")" and " "
84
- const rgbStr = color.split(/\(([^)]+)\)/)[1].replace(/ /g, '');
85
- // map RGB values to variables
86
- const r = parseInt(rgbStr.split(',')[0], 10);
87
- const g = parseInt(rgbStr.split(',')[1], 10);
88
- const b = parseInt(rgbStr.split(',')[2], 10);
89
- const a = typeof rgbStr.split(',')[3] !== null
90
- ? parseInt(rgbStr.split(',')[3], 10)
91
- : undefined;
92
- return { r, g, b, a };
93
- };
94
- const contrast = (color = '') => {
95
- // map RGB values to variables
96
- const { r, g, b } = colorToRGBA(color);
97
- // calculate contrast of color (standard grayscale algorithmic formula)
98
- return ((Math.round(r * 299) + Math.round(g * 587) + Math.round(b * 114)) / 1000);
99
- };
100
- const hexToRgb = (hex) => {
101
- const result = /^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(convertCssColorNameToHex(hex));
102
- return result
103
- ? {
104
- r: parseInt(result[1], 16),
105
- g: parseInt(result[2], 16),
106
- b: parseInt(result[3], 16),
107
- }
108
- : undefined;
87
+ const result = /^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(hex);
88
+ if (!result || result.length < 4) {
89
+ return;
90
+ }
91
+ return {
92
+ r: parseInt(result[1] ?? '', 16),
93
+ g: parseInt(result[2] ?? '', 16),
94
+ b: parseInt(result[3] ?? '', 16),
95
+ };
109
96
  };
110
97
  const hexToRgbStr = (hex) => {
111
98
  if (!hex) {
112
99
  return '';
113
100
  }
114
- const rgb = hexToRgb(hex);
101
+ const rgb = colorOrHexToRgb(hex);
115
102
  if (!rgb) {
116
103
  return '';
117
104
  }
@@ -145,3 +132,4 @@ const createTheme = (customTheme, extraTheme = {}) => {
145
132
  return deepmerge_1.default.all([theme, customTheme, extraTheme]);
146
133
  };
147
134
  exports.createTheme = createTheme;
135
+ //# sourceMappingURL=theme.js.map
@@ -1,2 +1,3 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
+ //# sourceMappingURL=shared.js.map
@@ -4,6 +4,15 @@ export interface Team {
4
4
  name: string;
5
5
  description?: string;
6
6
  }
7
+ interface Stats {
8
+ queriesCount: number;
9
+ queryCollectionsCount: number;
10
+ teamsCount: number;
11
+ }
12
+ interface Plan {
13
+ maxQueriesCount: number;
14
+ maxTeamsCount: number;
15
+ }
7
16
  export interface AccountState {
8
17
  loggedIn: boolean;
9
18
  accessToken: string;
@@ -12,7 +21,10 @@ export interface AccountState {
12
21
  email: string;
13
22
  picture: string;
14
23
  teams: Team[];
24
+ stats?: Stats;
25
+ plan?: Plan;
15
26
  }
16
27
  export declare class TeamId extends ValueObject<string> {
17
28
  }
29
+ export {};
18
30
  //# sourceMappingURL=account.interfaces.d.ts.map
@@ -5,3 +5,4 @@ const value_object_1 = require("../../utils/value-object");
5
5
  class TeamId extends value_object_1.ValueObject {
6
6
  }
7
7
  exports.TeamId = TeamId;
8
+ //# sourceMappingURL=account.interfaces.js.map
@@ -1,2 +1,3 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
+ //# sourceMappingURL=collection.interfaces.js.map
@@ -1,2 +1,3 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
+ //# sourceMappingURL=dialog.interfaces.js.map
@@ -1,2 +1,3 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
+ //# sourceMappingURL=docs.interfaces.js.map
@@ -1,2 +1,3 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
+ //# sourceMappingURL=donation.interfaces.js.map
@@ -1,2 +1,3 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
+ //# sourceMappingURL=environments.interfaces.js.map
@@ -1,2 +1,3 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
+ //# sourceMappingURL=gql-schema.interfaces.js.map
@@ -1,2 +1,3 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
+ //# sourceMappingURL=header.interfaces.js.map
@@ -1,2 +1,3 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
+ //# sourceMappingURL=history.interfaces.js.map
@@ -1,2 +1,3 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
+ //# sourceMappingURL=layout.interfaces.js.map
@@ -1,2 +1,3 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
+ //# sourceMappingURL=local.interfaces.js.map
@@ -1,2 +1,3 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
+ //# sourceMappingURL=per-window.interfaces.js.map
@@ -1,2 +1,3 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
+ //# sourceMappingURL=postrequest.interfaces.js.map
@@ -1,2 +1,3 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
+ //# sourceMappingURL=prerequest.interfaces.js.map
@@ -2,3 +2,4 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.HTTP_VERBS = void 0;
4
4
  exports.HTTP_VERBS = ['POST', 'GET', 'PUT', 'DELETE'];
5
+ //# sourceMappingURL=query.interfaces.js.map
@@ -2,3 +2,4 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  const config_1 = require("../../config");
4
4
  const config = (0, config_1.getAltairConfig)();
5
+ //# sourceMappingURL=settings.interfaces.js.map
@@ -1,2 +1,3 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
+ //# sourceMappingURL=state.interfaces.js.map
@@ -1,2 +1,3 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
+ //# sourceMappingURL=stream.interfaces.js.map
@@ -1,2 +1,3 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
+ //# sourceMappingURL=variable.interfaces.js.map
@@ -1,2 +1,3 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
+ //# sourceMappingURL=window.interfaces.js.map
@@ -1,2 +1,3 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
+ //# sourceMappingURL=windows-meta.interfaces.js.map
@@ -12,3 +12,4 @@ class WorkspaceId extends value_object_1.ValueObject {
12
12
  }
13
13
  }
14
14
  exports.WorkspaceId = WorkspaceId;
15
+ //# sourceMappingURL=workspace.interface.js.map
@@ -3,4 +3,5 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.default = !!((window &&
4
4
  window.process &&
5
5
  window.process.versions.electron) ||
6
- window.ipc);
6
+ !!window.navigator.userAgent.match(/Electron/));
7
+ //# sourceMappingURL=is_electron.js.map
@@ -44,3 +44,4 @@ const createLogger = (environment) => {
44
44
  return loglevel_1.default;
45
45
  };
46
46
  exports.createLogger = createLogger;
47
+ //# sourceMappingURL=logger.js.map
@@ -20,3 +20,4 @@ class ValueObject {
20
20
  }
21
21
  }
22
22
  exports.ValueObject = ValueObject;
23
+ //# sourceMappingURL=value-object.js.map
package/build/config.js CHANGED
@@ -95,3 +95,4 @@ export const getAltairConfig = () => {
95
95
  return config;
96
96
  };
97
97
  window.getAltairConfig = getAltairConfig;
98
+ //# sourceMappingURL=config.js.map
package/build/index.js CHANGED
@@ -1,3 +1,4 @@
1
1
  export const registerPluginClass = (pluginClassName, pluginClass) => {
2
2
  window['AltairGraphQL'].plugins[pluginClassName] = pluginClass;
3
3
  };
4
+ //# sourceMappingURL=index.js.map
@@ -3,3 +3,4 @@ export class PluginBase {
3
3
  this.ctx = ctx;
4
4
  }
5
5
  }
6
+ //# sourceMappingURL=base.js.map
@@ -1 +1,2 @@
1
1
  export {};
2
+ //# sourceMappingURL=context.interface.js.map
@@ -1 +1,2 @@
1
1
  export {};
2
+ //# sourceMappingURL=event.interfaces.js.map
@@ -20,3 +20,4 @@ export class AltairPanel {
20
20
  this.element = null;
21
21
  }
22
22
  }
23
+ //# sourceMappingURL=panel.js.map
@@ -31,3 +31,4 @@ export const createPlugin = (name, manifest) => {
31
31
  ])),
32
32
  };
33
33
  };
34
+ //# sourceMappingURL=plugin.interfaces.js.map
@@ -14,3 +14,4 @@ export class AltairUiAction {
14
14
  this.callback();
15
15
  }
16
16
  }
17
+ //# sourceMappingURL=ui-action.js.map
@@ -10,3 +10,4 @@ export const SUBSCRIPTION_PROVIDER_IDS = {
10
10
  ACTION_CABLE: ACTION_CABLE_PROVIDER_ID,
11
11
  GRAPHQL_SSE: GRAPHQL_SSE_ID,
12
12
  };
13
+ //# sourceMappingURL=index.js.map
@@ -27,3 +27,4 @@ export class ActionCableSubscriptionProvider extends SubscriptionProvider {
27
27
  this.subscription?.unsubscribe();
28
28
  }
29
29
  }
30
+ //# sourceMappingURL=action-cable.js.map
@@ -49,3 +49,4 @@ export class AppSyncSubscriptionProvider extends SubscriptionProvider {
49
49
  }
50
50
  }
51
51
  }
52
+ //# sourceMappingURL=app-sync.js.map
@@ -37,3 +37,4 @@ export class GraphQLSSESubscriptionProvider extends SubscriptionProvider {
37
37
  }
38
38
  }
39
39
  }
40
+ //# sourceMappingURL=graphql-sse.js.map
@@ -50,3 +50,4 @@ export class GraphQLWsSubscriptionProvider extends SubscriptionProvider {
50
50
  }
51
51
  }
52
52
  }
53
+ //# sourceMappingURL=graphql-ws.js.map
@@ -35,3 +35,4 @@ export class WebsocketSubscriptionProvider extends SubscriptionProvider {
35
35
  this.client = undefined;
36
36
  }
37
37
  }
38
+ //# sourceMappingURL=ws.js.map
@@ -5,3 +5,4 @@ export class SubscriptionProvider {
5
5
  this.extraOptions = extraOptions;
6
6
  }
7
7
  }
8
+ //# sourceMappingURL=subscription-provider.js.map
@@ -29,3 +29,4 @@ const theme = {
29
29
  },
30
30
  };
31
31
  export default theme;
32
+ //# sourceMappingURL=dark.js.map
@@ -24,3 +24,4 @@ const theme = {
24
24
  },
25
25
  };
26
26
  export default theme;
27
+ //# sourceMappingURL=dracula.js.map
@@ -1,2 +1,3 @@
1
1
  const theme = {};
2
2
  export default theme;
3
+ //# sourceMappingURL=light.js.map
@@ -5,3 +5,4 @@ export * from './theme';
5
5
  export const light = lightTheme;
6
6
  export const dark = darkTheme;
7
7
  export const dracula = draculaTheme;
8
+ //# sourceMappingURL=index.js.map
@@ -1,5 +1,5 @@
1
1
  import deepmerge from 'deepmerge';
2
- const convertCssColorNameToHex = require('convert-css-color-name-to-hex');
2
+ import colors from 'color-name';
3
3
  export const foundations = {
4
4
  easing: 'ease',
5
5
  colors: {
@@ -69,43 +69,30 @@ const theme = deepmerge(foundations, {
69
69
  },
70
70
  },
71
71
  });
72
- const colorToRGBA = (color) => {
73
- const fromHex = hexToRgb(color);
74
- if (fromHex) {
75
- return fromHex;
72
+ const colorOrHexToRgb = (hex) => {
73
+ const rgb = colors[hex];
74
+ if (rgb) {
75
+ return {
76
+ r: rgb[0],
77
+ g: rgb[1],
78
+ b: rgb[2],
79
+ };
76
80
  }
77
- // Strip everything except the integers eg. "rgb(" and ")" and " "
78
- const rgbStr = color.split(/\(([^)]+)\)/)[1].replace(/ /g, '');
79
- // map RGB values to variables
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;
86
- return { r, g, b, a };
87
- };
88
- const contrast = (color = '') => {
89
- // map RGB values to variables
90
- const { r, g, b } = colorToRGBA(color);
91
- // calculate contrast of color (standard grayscale algorithmic formula)
92
- return ((Math.round(r * 299) + Math.round(g * 587) + Math.round(b * 114)) / 1000);
93
- };
94
- const hexToRgb = (hex) => {
95
- const result = /^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(convertCssColorNameToHex(hex));
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;
81
+ const result = /^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(hex);
82
+ if (!result || result.length < 4) {
83
+ return;
84
+ }
85
+ return {
86
+ r: parseInt(result[1] ?? '', 16),
87
+ g: parseInt(result[2] ?? '', 16),
88
+ b: parseInt(result[3] ?? '', 16),
89
+ };
103
90
  };
104
91
  export const hexToRgbStr = (hex) => {
105
92
  if (!hex) {
106
93
  return '';
107
94
  }
108
- const rgb = hexToRgb(hex);
95
+ const rgb = colorOrHexToRgb(hex);
109
96
  if (!rgb) {
110
97
  return '';
111
98
  }
@@ -136,3 +123,4 @@ export const mergeThemes = (...customThemes) => {
136
123
  export const createTheme = (customTheme, extraTheme = {}) => {
137
124
  return deepmerge.all([theme, customTheme, extraTheme]);
138
125
  };
126
+ //# sourceMappingURL=theme.js.map
@@ -1 +1,2 @@
1
1
  export {};
2
+ //# sourceMappingURL=shared.js.map
@@ -4,6 +4,15 @@ export interface Team {
4
4
  name: string;
5
5
  description?: string;
6
6
  }
7
+ interface Stats {
8
+ queriesCount: number;
9
+ queryCollectionsCount: number;
10
+ teamsCount: number;
11
+ }
12
+ interface Plan {
13
+ maxQueriesCount: number;
14
+ maxTeamsCount: number;
15
+ }
7
16
  export interface AccountState {
8
17
  loggedIn: boolean;
9
18
  accessToken: string;
@@ -12,7 +21,10 @@ export interface AccountState {
12
21
  email: string;
13
22
  picture: string;
14
23
  teams: Team[];
24
+ stats?: Stats;
25
+ plan?: Plan;
15
26
  }
16
27
  export declare class TeamId extends ValueObject<string> {
17
28
  }
29
+ export {};
18
30
  //# sourceMappingURL=account.interfaces.d.ts.map
@@ -1,3 +1,4 @@
1
1
  import { ValueObject } from '../../utils/value-object';
2
2
  export class TeamId extends ValueObject {
3
3
  }
4
+ //# sourceMappingURL=account.interfaces.js.map
@@ -1 +1,2 @@
1
1
  export {};
2
+ //# sourceMappingURL=collection.interfaces.js.map
@@ -1 +1,2 @@
1
1
  export {};
2
+ //# sourceMappingURL=dialog.interfaces.js.map
@@ -1 +1,2 @@
1
1
  export {};
2
+ //# sourceMappingURL=docs.interfaces.js.map
@@ -1 +1,2 @@
1
1
  export {};
2
+ //# sourceMappingURL=donation.interfaces.js.map
@@ -1 +1,2 @@
1
1
  export {};
2
+ //# sourceMappingURL=environments.interfaces.js.map
@@ -1 +1,2 @@
1
1
  export {};
2
+ //# sourceMappingURL=gql-schema.interfaces.js.map
@@ -1 +1,2 @@
1
1
  export {};
2
+ //# sourceMappingURL=header.interfaces.js.map
@@ -1 +1,2 @@
1
1
  export {};
2
+ //# sourceMappingURL=history.interfaces.js.map
@@ -1 +1,2 @@
1
1
  export {};
2
+ //# sourceMappingURL=layout.interfaces.js.map
@@ -1 +1,2 @@
1
1
  export {};
2
+ //# sourceMappingURL=local.interfaces.js.map
@@ -1 +1,2 @@
1
1
  export {};
2
+ //# sourceMappingURL=per-window.interfaces.js.map
@@ -1 +1,2 @@
1
1
  export {};
2
+ //# sourceMappingURL=postrequest.interfaces.js.map
@@ -1 +1,2 @@
1
1
  export {};
2
+ //# sourceMappingURL=prerequest.interfaces.js.map
@@ -1 +1,2 @@
1
1
  export const HTTP_VERBS = ['POST', 'GET', 'PUT', 'DELETE'];
2
+ //# sourceMappingURL=query.interfaces.js.map
@@ -1,2 +1,3 @@
1
1
  import { getAltairConfig } from '../../config';
2
2
  const config = getAltairConfig();
3
+ //# sourceMappingURL=settings.interfaces.js.map
@@ -1 +1,2 @@
1
1
  export {};
2
+ //# sourceMappingURL=state.interfaces.js.map
@@ -1 +1,2 @@
1
1
  export {};
2
+ //# sourceMappingURL=stream.interfaces.js.map
@@ -1 +1,2 @@
1
1
  export {};
2
+ //# sourceMappingURL=variable.interfaces.js.map
@@ -1 +1,2 @@
1
1
  export {};
2
+ //# sourceMappingURL=window.interfaces.js.map
@@ -1 +1,2 @@
1
1
  export {};
2
+ //# sourceMappingURL=windows-meta.interfaces.js.map
@@ -8,3 +8,4 @@ export class WorkspaceId extends ValueObject {
8
8
  super(props);
9
9
  }
10
10
  }
11
+ //# sourceMappingURL=workspace.interface.js.map
@@ -1,4 +1,5 @@
1
1
  export default !!((window &&
2
2
  window.process &&
3
3
  window.process.versions.electron) ||
4
- window.ipc);
4
+ !!window.navigator.userAgent.match(/Electron/));
5
+ //# sourceMappingURL=is_electron.js.map
@@ -37,3 +37,4 @@ export const createLogger = (environment) => {
37
37
  });
38
38
  return loglevel;
39
39
  };
40
+ //# sourceMappingURL=logger.js.map
@@ -16,3 +16,4 @@ export class ValueObject {
16
16
  return this.props === vo.props;
17
17
  }
18
18
  }
19
+ //# sourceMappingURL=value-object.js.map
package/package.json CHANGED
@@ -1,46 +1,9 @@
1
1
  {
2
2
  "name": "altair-graphql-core",
3
- "version": "5.0.21",
4
3
  "description": "Several of the core logic for altair graphql client",
5
- "main": "./build/index.js",
6
- "types": "./build/index.d.ts",
7
- "scripts": {
8
- "test": "echo \"Error: no test specified\" && exit 0",
9
- "build": "tsc -p tsconfig.json && tsc -p tsconfig.cjs.json",
10
- "prepare": "npm run build"
11
- },
12
- "engines": {
13
- "node": ">= 12"
14
- },
15
- "repository": {
16
- "type": "git",
17
- "url": "git+https://github.com/altair-graphql/altair.git"
18
- },
19
- "keywords": [
20
- "altair",
21
- "graphql"
22
- ],
4
+ "version": "5.0.23",
23
5
  "author": "Samuel Imolorhe <altair@sirmuel.design> (https://sirmuel.design)",
24
- "license": "MIT",
25
- "bugs": {
26
- "url": "https://github.com/altair-graphql/altair/issues"
27
- },
28
- "homepage": "https://github.com/altair-graphql/altair#readme",
29
- "funding": {
30
- "type": "opencollective",
31
- "url": "https://opencollective.com/altair"
32
- },
33
- "devDependencies": {
34
- "@types/actioncable": "^5.2.5",
35
- "@types/node": "^14.14.41",
36
- "@types/uuid": "^8.3.0",
37
- "ajv": "^8.11.2",
38
- "ajv-cli": "5.0.0",
39
- "react": "17.0.2",
40
- "ts-node": "9.1.1",
41
- "typescript": "^4.9.4",
42
- "typescript-json-schema": "0.50.1"
43
- },
6
+ "bugs": "https://github.com/altair-graphql/altair/issues",
44
7
  "dependencies": {
45
8
  "@apollo/client": "3.3.20",
46
9
  "actioncable": "5.2.6",
@@ -49,7 +12,7 @@
49
12
  "apollo-link-http": "1.5.17",
50
13
  "aws-appsync-auth-link": "3.0.4",
51
14
  "aws-appsync-subscription-link": "3.0.6",
52
- "convert-css-color-name-to-hex": "0.1.1",
15
+ "color-name": "^2.0.0",
53
16
  "deepmerge": "4.2.2",
54
17
  "graphql": "15.5.1",
55
18
  "graphql-sse": "1.2.2",
@@ -61,5 +24,37 @@
61
24
  "util": "0.12.4",
62
25
  "uuid": "8.3.2"
63
26
  },
64
- "gitHead": "79bc1fd66ff05ad7976ad9fa37b6a482e2d9fef0"
27
+ "devDependencies": {
28
+ "@types/actioncable": "^5.2.5",
29
+ "@types/node": "^14.14.41",
30
+ "@types/uuid": "^8.3.0",
31
+ "ajv": "^8.11.2",
32
+ "ajv-cli": "5.0.0",
33
+ "react": "17.0.2",
34
+ "ts-node": "9.1.1",
35
+ "typescript": "4.9.5",
36
+ "typescript-json-schema": "0.50.1"
37
+ },
38
+ "engines": {
39
+ "node": ">= 12"
40
+ },
41
+ "funding": {
42
+ "type": "opencollective",
43
+ "url": "https://opencollective.com/altair"
44
+ },
45
+ "homepage": "https://github.com/altair-graphql/altair#readme",
46
+ "keywords": [
47
+ "altair",
48
+ "graphql"
49
+ ],
50
+ "license": "MIT",
51
+ "main": "./build/index.js",
52
+ "repository": "altair-graphql/altair.git",
53
+ "scripts": {
54
+ "build": "tsc -p tsconfig.json && tsc -p tsconfig.cjs.json",
55
+ "prepare": "npm run build",
56
+ "test": "echo \"Error: no test specified\" && exit 0"
57
+ },
58
+ "types": "./build/index.d.ts",
59
+ "gitHead": "3d5b694bb3f4f69589f6009bc37d1a03479d32ae"
65
60
  }
package/tsconfig.json CHANGED
@@ -1,4 +1,5 @@
1
1
  {
2
+ "extends": "../../tsconfig.json",
2
3
  "compilerOptions": {
3
4
  "outDir": "build/",
4
5
  "rootDir": "./src",