@graphiql/plugin-doc-explorer 0.4.2-canary-67317292.0 → 0.4.2
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/dist/components/argument.d.ts +1 -1
- package/dist/components/default-value.d.ts +1 -1
- package/dist/components/deprecation-reason.d.ts +1 -1
- package/dist/components/directive.d.ts +1 -1
- package/dist/components/field-documentation.d.ts +1 -1
- package/dist/components/field-link.d.ts +1 -1
- package/dist/components/schema-documentation.d.ts +1 -1
- package/dist/components/search.d.ts +2 -2
- package/dist/components/section.d.ts +1 -1
- package/dist/components/type-documentation.d.ts +1 -1
- package/dist/components/type-link.d.ts +1 -1
- package/dist/context.d.ts +26 -6
- package/dist/deprecated.d.ts +8 -1
- package/dist/schema-reference.d.ts +5 -5
- package/package.json +8 -5
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { GraphQLArgument, GraphQLField, GraphQLInputField, GraphQLNamedType } from 'graphql';
|
|
2
2
|
import { FC } from 'react';
|
|
3
3
|
export declare const Search: FC;
|
|
4
|
-
|
|
4
|
+
type TypeMatch = {
|
|
5
5
|
type: GraphQLNamedType;
|
|
6
6
|
};
|
|
7
|
-
|
|
7
|
+
type FieldMatch = {
|
|
8
8
|
type: GraphQLNamedType;
|
|
9
9
|
field: GraphQLField<unknown, unknown> | GraphQLInputField;
|
|
10
10
|
argument?: GraphQLArgument;
|
package/dist/context.d.ts
CHANGED
|
@@ -2,8 +2,8 @@ import { GraphQLArgument, GraphQLField, GraphQLInputField, GraphQLNamedType, Gra
|
|
|
2
2
|
import { FC, ReactNode } from 'react';
|
|
3
3
|
import { SchemaReference, GraphiQLPlugin } from '@graphiql/react';
|
|
4
4
|
export declare const DOC_EXPLORER_PLUGIN: GraphiQLPlugin;
|
|
5
|
-
export
|
|
6
|
-
export
|
|
5
|
+
export type DocExplorerFieldDef = GraphQLField<unknown, unknown> | GraphQLInputField | GraphQLArgument;
|
|
6
|
+
export type DocExplorerNavStackItem = {
|
|
7
7
|
/**
|
|
8
8
|
* The name of the item.
|
|
9
9
|
*/
|
|
@@ -14,11 +14,11 @@ export declare type DocExplorerNavStackItem = {
|
|
|
14
14
|
*/
|
|
15
15
|
def?: GraphQLNamedType | DocExplorerFieldDef;
|
|
16
16
|
};
|
|
17
|
-
export
|
|
17
|
+
export type DocExplorerNavStack = [
|
|
18
18
|
DocExplorerNavStackItem,
|
|
19
19
|
...DocExplorerNavStackItem[]
|
|
20
20
|
];
|
|
21
|
-
export
|
|
21
|
+
export type DocExplorerStoreType = {
|
|
22
22
|
/**
|
|
23
23
|
* A stack of navigation items. The last item in the list is the current one.
|
|
24
24
|
* This list always contains at least one item.
|
|
@@ -50,9 +50,29 @@ export declare const docExplorerStore: import('zustand').StoreApi<DocExplorerSto
|
|
|
50
50
|
export declare const DocExplorerStore: FC<{
|
|
51
51
|
children: ReactNode;
|
|
52
52
|
}>;
|
|
53
|
-
export declare const useDocExplorer: () =>
|
|
53
|
+
export declare const useDocExplorer: () => DocExplorerNavStack;
|
|
54
54
|
/**
|
|
55
55
|
* Actions are functions used to update values in your store. They are static and never change.
|
|
56
56
|
* @see https://tkdodo.eu/blog/working-with-zustand#separate-actions-from-state
|
|
57
57
|
*/
|
|
58
|
-
export declare const useDocExplorerActions: () =>
|
|
58
|
+
export declare const useDocExplorerActions: () => {
|
|
59
|
+
/**
|
|
60
|
+
* Push an item to the navigation stack.
|
|
61
|
+
* @param item The item that should be pushed to the stack.
|
|
62
|
+
*/
|
|
63
|
+
push(item: DocExplorerNavStackItem): void;
|
|
64
|
+
/**
|
|
65
|
+
* Pop the last item from the navigation stack.
|
|
66
|
+
*/
|
|
67
|
+
pop(): void;
|
|
68
|
+
/**
|
|
69
|
+
* Reset the navigation stack to its initial state, this will remove all but
|
|
70
|
+
* the initial stack item.
|
|
71
|
+
*/
|
|
72
|
+
reset(): void;
|
|
73
|
+
resolveSchemaReferenceToNavItem(schemaReference: SchemaReference | null): void;
|
|
74
|
+
/**
|
|
75
|
+
* Replace the nav stack with an updated version using the new schema.
|
|
76
|
+
*/
|
|
77
|
+
rebuildNavStackWithSchema(schema: GraphQLSchema): void;
|
|
78
|
+
};
|
package/dist/deprecated.d.ts
CHANGED
|
@@ -1,4 +1,11 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @deprecated Use `useDocExplorerActions` and `useDocExplorer` hooks instead.
|
|
3
3
|
*/
|
|
4
|
-
export declare function useExplorerContext():
|
|
4
|
+
export declare function useExplorerContext(): {
|
|
5
|
+
explorerNavStack: import('./context').DocExplorerNavStack;
|
|
6
|
+
push(item: import('./context').DocExplorerNavStackItem): void;
|
|
7
|
+
pop(): void;
|
|
8
|
+
reset(): void;
|
|
9
|
+
resolveSchemaReferenceToNavItem(schemaReference: import('@graphiql/react').SchemaReference | null): void;
|
|
10
|
+
rebuildNavStackWithSchema(schema: import('graphql').GraphQLSchema): void;
|
|
11
|
+
};
|
|
@@ -4,7 +4,7 @@ import { Maybe } from 'graphql/jsutils/Maybe';
|
|
|
4
4
|
* Copied from packages/codemirror-graphql/src/jump.ts
|
|
5
5
|
*/
|
|
6
6
|
export declare function getSchemaReference(kind: string, typeInfo: any): FieldReference | DirectiveReference | ArgumentReference | EnumValueReference | TypeReference | undefined;
|
|
7
|
-
|
|
7
|
+
type ArgumentReference = {
|
|
8
8
|
kind: 'Argument';
|
|
9
9
|
argument: GraphQLArgument;
|
|
10
10
|
field?: GraphQLField<unknown, unknown>;
|
|
@@ -12,24 +12,24 @@ declare type ArgumentReference = {
|
|
|
12
12
|
directive?: GraphQLDirective;
|
|
13
13
|
schema?: GraphQLSchema;
|
|
14
14
|
};
|
|
15
|
-
|
|
15
|
+
type DirectiveReference = {
|
|
16
16
|
kind: 'Directive';
|
|
17
17
|
directive: GraphQLDirective;
|
|
18
18
|
schema?: GraphQLSchema;
|
|
19
19
|
};
|
|
20
|
-
|
|
20
|
+
type EnumValueReference = {
|
|
21
21
|
kind: 'EnumValue';
|
|
22
22
|
value?: GraphQLEnumValue;
|
|
23
23
|
type?: GraphQLEnumType;
|
|
24
24
|
schema?: GraphQLSchema;
|
|
25
25
|
};
|
|
26
|
-
|
|
26
|
+
type FieldReference = {
|
|
27
27
|
kind: 'Field';
|
|
28
28
|
field: GraphQLField<unknown, unknown>;
|
|
29
29
|
type: Maybe<GraphQLNamedType>;
|
|
30
30
|
schema?: GraphQLSchema;
|
|
31
31
|
};
|
|
32
|
-
|
|
32
|
+
type TypeReference = {
|
|
33
33
|
kind: 'Type';
|
|
34
34
|
type: GraphQLNamedType;
|
|
35
35
|
schema?: GraphQLSchema;
|
package/package.json
CHANGED
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@graphiql/plugin-doc-explorer",
|
|
3
|
-
"version": "0.4.2
|
|
4
|
-
"sideEffects":
|
|
3
|
+
"version": "0.4.2",
|
|
4
|
+
"sideEffects": [
|
|
5
|
+
"*.css"
|
|
6
|
+
],
|
|
5
7
|
"repository": {
|
|
6
8
|
"type": "git",
|
|
7
9
|
"url": "https://github.com/graphql/graphiql",
|
|
@@ -33,20 +35,21 @@
|
|
|
33
35
|
"types:check": "tsc --noEmit",
|
|
34
36
|
"dev": "vite build --watch --emptyOutDir=false",
|
|
35
37
|
"build": "vite build",
|
|
36
|
-
"test": "vitest"
|
|
38
|
+
"test": "vitest run"
|
|
37
39
|
},
|
|
38
40
|
"peerDependencies": {
|
|
39
|
-
"@graphiql/react": "^0.37.
|
|
41
|
+
"@graphiql/react": "^0.37.0",
|
|
40
42
|
"graphql": "^15.5.0 || ^16.0.0 || ^17.0.0",
|
|
41
43
|
"react": "^18 || ^19",
|
|
42
|
-
"react-compiler-runtime": "19.1.0-rc.1",
|
|
43
44
|
"react-dom": "^18 || ^19"
|
|
44
45
|
},
|
|
45
46
|
"dependencies": {
|
|
46
47
|
"@headlessui/react": "^2.2",
|
|
48
|
+
"react-compiler-runtime": "19.1.0-rc.1",
|
|
47
49
|
"zustand": "^5"
|
|
48
50
|
},
|
|
49
51
|
"devDependencies": {
|
|
52
|
+
"@graphiql/react": "^0.37.4",
|
|
50
53
|
"@testing-library/dom": "^10.4.0",
|
|
51
54
|
"@testing-library/jest-dom": "^6.6.3",
|
|
52
55
|
"@testing-library/react": "^16.3.0",
|