mirror of
https://github.com/graphql-hive/console
synced 2026-04-21 22:47:17 +00:00
80 lines
4.9 KiB
Diff
80 lines
4.9 KiB
Diff
diff --git a/dist/index.d.ts b/dist/index.d.ts
|
|
index d0d893ea0caffb6c1c70c5f95aed8ca49bc74701..738c53fe71b5cde39d288b11481da83eef380f04 100644
|
|
--- a/dist/index.d.ts
|
|
+++ b/dist/index.d.ts
|
|
@@ -14,7 +14,7 @@ declare type AddSuffix<Obj extends Record<string, any>, Suffix extends string> =
|
|
[Key in keyof Obj as `${string & Key}${Suffix}`]: Obj[Key];
|
|
};
|
|
|
|
-export declare function GraphiQL({ dangerouslyAssumeSchemaIsValid, confirmCloseTab, defaultQuery, defaultTabs, externalFragments, fetcher, getDefaultFieldNames, headers, inputValueDeprecation, introspectionQueryName, maxHistoryLength, onEditOperationName, onSchemaChange, onTabChange, onTogglePluginVisibility, operationName, plugins, query, response, schema, schemaDescription, shouldPersistHeaders, storage, validationRules, variables, visiblePlugin, defaultHeaders, ...props }: GraphiQLProps): JSX_2.Element;
|
|
+export declare function GraphiQL({ dangerouslyAssumeSchemaIsValid, confirmCloseTab, defaultQuery, defaultTabs, externalFragments, fetcher, getDefaultFieldNames, headers, inputValueDeprecation, introspectionQueryName, maxHistoryLength, onEditOperationName, onSchemaChange, onTabChange, onTogglePluginVisibility, operationName, plugins, query, response, schema, schemaDescription, shouldPersistHeaders, storage, validationRules, variables, visiblePlugin, defaultHeaders, onModifyHeaders, ...props }: GraphiQLProps): JSX_2.Element;
|
|
|
|
export declare namespace GraphiQL {
|
|
var Logo: typeof GraphiQLLogo;
|
|
diff --git a/dist/index.js b/dist/index.js
|
|
index 8658855e3697ce1f5e8bd83afc2beecade922288..d94624983c04ef8efccf5b7fe0dd436ad5762136 100644
|
|
--- a/dist/index.js
|
|
+++ b/dist/index.js
|
|
@@ -392,7 +392,7 @@ function GraphiQLInterface(props) {
|
|
},
|
|
tab.title
|
|
),
|
|
- tabs.length > 1 && /* @__PURE__ */ React.createElement(react.Tab.Close, { onClick: handleTabClose })
|
|
+ /* @__PURE__ */ React.createElement(react.Tab.Close, { onClick: handleTabClose })
|
|
))
|
|
), /* @__PURE__ */ React.createElement(react.Tooltip, { label: "New tab" }, /* @__PURE__ */ React.createElement(
|
|
react.UnStyledButton,
|
|
diff --git a/dist/index.mjs b/dist/index.mjs
|
|
index cf1a9036b4b35b7918da09ead6977e1e77724b8a..970cc4cda25ff74c49e542db51af558d7e0d277a 100644
|
|
--- a/dist/index.mjs
|
|
+++ b/dist/index.mjs
|
|
@@ -1,4 +1,4 @@
|
|
-import { GraphiQLProvider, useEditorContext, useExecutionContext, useSchemaContext, useStorageContext, usePluginContext, useTheme, useDragResize, Tooltip, UnStyledButton, ReloadIcon, KeyboardShortcutIcon, SettingsIcon, Tabs, Tab, PlusIcon, QueryEditor, ExecuteButton, ChevronUpIcon, ChevronDownIcon, VariableEditor, HeaderEditor, Spinner, ResponseEditor, Dialog, ButtonGroup, Button, useCopyQuery, useMergeQuery, usePrettifyEditors, ToolbarButton, PrettifyIcon, MergeIcon, CopyIcon } from "@graphiql/react";
|
|
+import { GraphiQLProvider, useEditorContext, useExecutionContext, useSchemaContext, useStorageContext, usePluginContext, useTheme, useDragResize, Tooltip, UnStyledButton, ReloadIcon, KeyboardShortcutIcon, SettingsIcon, Tabs, Tab, PlusIcon, QueryEditor, ExecuteButton, ChevronUpIcon, ChevronDownIcon, VariableEditor, HeaderEditor, Spinner, ResponseEditor, Dialog, ButtonGroup, Button, useCopyQuery, useMergeQuery, usePrettifyEditors, ToolbarButton, PrettifyIcon, MergeIcon, CopyIcon, isMacOs } from "@graphiql/react";
|
|
import { GraphiQLProvider as GraphiQLProvider2 } from "@graphiql/react";
|
|
import React, { version, useMemo, useEffect, useState, Children, cloneElement, useCallback, Fragment } from "react";
|
|
const majorVersion = parseInt(version.slice(0, 2), 10);
|
|
@@ -39,6 +39,7 @@ function GraphiQL({
|
|
variables,
|
|
visiblePlugin,
|
|
defaultHeaders,
|
|
+ onModifyHeaders,
|
|
...props
|
|
}) {
|
|
var _a, _b;
|
|
@@ -85,7 +86,8 @@ function GraphiQL({
|
|
shouldPersistHeaders,
|
|
storage,
|
|
validationRules,
|
|
- variables
|
|
+ variables,
|
|
+ onModifyHeaders
|
|
},
|
|
/* @__PURE__ */ React.createElement(
|
|
GraphiQLInterface,
|
|
@@ -391,14 +393,14 @@ function GraphiQLInterface(props) {
|
|
},
|
|
tab.title
|
|
),
|
|
- tabs.length > 1 && /* @__PURE__ */ React.createElement(Tab.Close, { onClick: handleTabClose })
|
|
+ /* @__PURE__ */ React.createElement(Tab.Close, { onClick: handleTabClose })
|
|
))
|
|
), /* @__PURE__ */ React.createElement(Tooltip, { label: "New tab" }, /* @__PURE__ */ React.createElement(
|
|
UnStyledButton,
|
|
{
|
|
type: "button",
|
|
className: "graphiql-tab-add",
|
|
- onClick: handleAddTab,
|
|
+ onClick: () => handleAddTab(),
|
|
"aria-label": "New tab"
|
|
},
|
|
/* @__PURE__ */ React.createElement(PlusIcon, { "aria-hidden": "true" })
|
|
@@ -602,7 +604,7 @@ function GraphiQLInterface(props) {
|
|
)) : null
|
|
)));
|
|
}
|
|
-const modifier = typeof navigator !== "undefined" && navigator.platform.toLowerCase().indexOf("mac") === 0 ? "Cmd" : "Ctrl";
|
|
+const modifier = isMacOs ? "⌘" : "Ctrl";
|
|
const SHORT_KEYS = Object.entries({
|
|
"Search in editor": [modifier, "F"],
|
|
"Search in documentation": [modifier, "K"],
|