polen 0.10.0-next.12 → 0.10.0-next.13
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/lib/graphql-document/components/CopyButton.d.ts +19 -0
- package/build/lib/graphql-document/components/CopyButton.d.ts.map +1 -0
- package/build/lib/graphql-document/components/CopyButton.js +43 -0
- package/build/lib/graphql-document/components/CopyButton.js.map +1 -0
- package/build/lib/graphql-document/components/GraphQLDocument.d.ts +0 -4
- package/build/lib/graphql-document/components/GraphQLDocument.d.ts.map +1 -1
- package/build/lib/graphql-document/components/GraphQLDocument.js +31 -74
- package/build/lib/graphql-document/components/GraphQLDocument.js.map +1 -1
- package/build/lib/graphql-document/components/GraphQLIdentifierPopover.d.ts +33 -0
- package/build/lib/graphql-document/components/GraphQLIdentifierPopover.d.ts.map +1 -0
- package/build/lib/graphql-document/components/GraphQLIdentifierPopover.js +48 -0
- package/build/lib/graphql-document/components/GraphQLIdentifierPopover.js.map +1 -0
- package/build/lib/graphql-document/components/IdentifierLink.d.ts +15 -13
- package/build/lib/graphql-document/components/IdentifierLink.d.ts.map +1 -1
- package/build/lib/graphql-document/components/IdentifierLink.js +51 -117
- package/build/lib/graphql-document/components/IdentifierLink.js.map +1 -1
- package/build/lib/graphql-document/components/graphql-document-styles.d.ts +5 -0
- package/build/lib/graphql-document/components/graphql-document-styles.d.ts.map +1 -0
- package/build/lib/graphql-document/components/graphql-document-styles.js +167 -0
- package/build/lib/graphql-document/components/graphql-document-styles.js.map +1 -0
- package/build/lib/graphql-document/components/index.d.ts +2 -1
- package/build/lib/graphql-document/components/index.d.ts.map +1 -1
- package/build/lib/graphql-document/components/index.js +2 -1
- package/build/lib/graphql-document/components/index.js.map +1 -1
- package/build/lib/graphql-document/hooks/use-tooltip-state.d.ts +43 -0
- package/build/lib/graphql-document/hooks/use-tooltip-state.d.ts.map +1 -0
- package/build/lib/graphql-document/hooks/use-tooltip-state.js +132 -0
- package/build/lib/graphql-document/hooks/use-tooltip-state.js.map +1 -0
- package/package.json +2 -1
- package/src/lib/graphql-document/components/CopyButton.tsx +76 -0
- package/src/lib/graphql-document/components/GraphQLDocument.tsx +52 -86
- package/src/lib/graphql-document/components/GraphQLIdentifierPopover.tsx +197 -0
- package/src/lib/graphql-document/components/IdentifierLink.tsx +105 -166
- package/src/lib/graphql-document/components/graphql-document-styles.ts +167 -0
- package/src/lib/graphql-document/components/index.ts +2 -1
- package/src/lib/graphql-document/hooks/use-tooltip-state.test.ts +76 -0
- package/src/lib/graphql-document/hooks/use-tooltip-state.ts +191 -0
- package/build/lib/graphql-document/components/HoverTooltip.d.ts +0 -35
- package/build/lib/graphql-document/components/HoverTooltip.d.ts.map +0 -1
- package/build/lib/graphql-document/components/HoverTooltip.js +0 -132
- package/build/lib/graphql-document/components/HoverTooltip.js.map +0 -1
- package/src/lib/graphql-document/components/HoverTooltip.tsx +0 -282
@@ -0,0 +1,19 @@
|
|
1
|
+
/**
|
2
|
+
* Copy button component for GraphQL documents
|
3
|
+
*/
|
4
|
+
import type { React } from '#dep/react/index';
|
5
|
+
export interface CopyButtonProps {
|
6
|
+
/** The text to copy */
|
7
|
+
text: string;
|
8
|
+
/** Optional className */
|
9
|
+
className?: string;
|
10
|
+
/** Size variant */
|
11
|
+
size?: '1' | '2' | '3';
|
12
|
+
}
|
13
|
+
/**
|
14
|
+
* Copy button for GraphQL code blocks
|
15
|
+
*
|
16
|
+
* Shows a copy icon that changes to a checkmark when clicked
|
17
|
+
*/
|
18
|
+
export declare const CopyButton: React.FC<CopyButtonProps>;
|
19
|
+
//# sourceMappingURL=CopyButton.d.ts.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"CopyButton.d.ts","sourceRoot":"","sources":["../../../../src/lib/graphql-document/components/CopyButton.tsx"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,kBAAkB,CAAA;AAK7C,MAAM,WAAW,eAAe;IAC9B,uBAAuB;IACvB,IAAI,EAAE,MAAM,CAAA;IACZ,yBAAyB;IACzB,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,mBAAmB;IACnB,IAAI,CAAC,EAAE,GAAG,GAAG,GAAG,GAAG,GAAG,CAAA;CACvB;AAED;;;;GAIG;AACH,eAAO,MAAM,UAAU,EAAE,KAAK,CAAC,EAAE,CAAC,eAAe,CAoDhD,CAAA"}
|
@@ -0,0 +1,43 @@
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
2
|
+
import { React as ReactHooks } from '#dep/react/index';
|
3
|
+
import { CheckIcon, CopyIcon } from '@radix-ui/react-icons';
|
4
|
+
import { Button } from '@radix-ui/themes';
|
5
|
+
/**
|
6
|
+
* Copy button for GraphQL code blocks
|
7
|
+
*
|
8
|
+
* Shows a copy icon that changes to a checkmark when clicked
|
9
|
+
*/
|
10
|
+
export const CopyButton = ({ text, className = '', size = '1', }) => {
|
11
|
+
const [copied, setCopied] = ReactHooks.useState(false);
|
12
|
+
const timeoutRef = ReactHooks.useRef(null);
|
13
|
+
const handleCopy = ReactHooks.useCallback(async (e) => {
|
14
|
+
e.preventDefault();
|
15
|
+
e.stopPropagation();
|
16
|
+
try {
|
17
|
+
await navigator.clipboard.writeText(text);
|
18
|
+
setCopied(true);
|
19
|
+
// Clear any existing timeout
|
20
|
+
if (timeoutRef.current) {
|
21
|
+
clearTimeout(timeoutRef.current);
|
22
|
+
}
|
23
|
+
// Reset after 2 seconds
|
24
|
+
timeoutRef.current = setTimeout(() => {
|
25
|
+
setCopied(false);
|
26
|
+
timeoutRef.current = null;
|
27
|
+
}, 2000);
|
28
|
+
}
|
29
|
+
catch (err) {
|
30
|
+
console.error('Failed to copy text:', err);
|
31
|
+
}
|
32
|
+
}, [text]);
|
33
|
+
// Cleanup timeout on unmount
|
34
|
+
ReactHooks.useEffect(() => {
|
35
|
+
return () => {
|
36
|
+
if (timeoutRef.current) {
|
37
|
+
clearTimeout(timeoutRef.current);
|
38
|
+
}
|
39
|
+
};
|
40
|
+
}, []);
|
41
|
+
return (_jsx(Button, { size: size, variant: 'ghost', className: `graphql-copy-button ${className}`, onClick: handleCopy, "aria-label": copied ? 'Copied!' : 'Copy code', "data-copied": copied, children: copied ? _jsx(CheckIcon, { width: '16', height: '16' }) : _jsx(CopyIcon, { width: '16', height: '16' }) }));
|
42
|
+
};
|
43
|
+
//# sourceMappingURL=CopyButton.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"CopyButton.js","sourceRoot":"","sources":["../../../../src/lib/graphql-document/components/CopyButton.tsx"],"names":[],"mappings":";AAKA,OAAO,EAAE,KAAK,IAAI,UAAU,EAAE,MAAM,kBAAkB,CAAA;AACtD,OAAO,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAA;AAC3D,OAAO,EAAE,MAAM,EAAE,MAAM,kBAAkB,CAAA;AAWzC;;;;GAIG;AACH,MAAM,CAAC,MAAM,UAAU,GAA8B,CAAC,EACpD,IAAI,EACJ,SAAS,GAAG,EAAE,EACd,IAAI,GAAG,GAAG,GACX,EAAE,EAAE;IACH,MAAM,CAAC,MAAM,EAAE,SAAS,CAAC,GAAG,UAAU,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAA;IACtD,MAAM,UAAU,GAAG,UAAU,CAAC,MAAM,CAAwB,IAAI,CAAC,CAAA;IAEjE,MAAM,UAAU,GAAG,UAAU,CAAC,WAAW,CAAC,KAAK,EAAE,CAAmB,EAAE,EAAE;QACtE,CAAC,CAAC,cAAc,EAAE,CAAA;QAClB,CAAC,CAAC,eAAe,EAAE,CAAA;QAEnB,IAAI,CAAC;YACH,MAAM,SAAS,CAAC,SAAS,CAAC,SAAS,CAAC,IAAI,CAAC,CAAA;YACzC,SAAS,CAAC,IAAI,CAAC,CAAA;YAEf,6BAA6B;YAC7B,IAAI,UAAU,CAAC,OAAO,EAAE,CAAC;gBACvB,YAAY,CAAC,UAAU,CAAC,OAAO,CAAC,CAAA;YAClC,CAAC;YAED,wBAAwB;YACxB,UAAU,CAAC,OAAO,GAAG,UAAU,CAAC,GAAG,EAAE;gBACnC,SAAS,CAAC,KAAK,CAAC,CAAA;gBAChB,UAAU,CAAC,OAAO,GAAG,IAAI,CAAA;YAC3B,CAAC,EAAE,IAAI,CAAC,CAAA;QACV,CAAC;QAAC,OAAO,GAAG,EAAE,CAAC;YACb,OAAO,CAAC,KAAK,CAAC,sBAAsB,EAAE,GAAG,CAAC,CAAA;QAC5C,CAAC;IACH,CAAC,EAAE,CAAC,IAAI,CAAC,CAAC,CAAA;IAEV,6BAA6B;IAC7B,UAAU,CAAC,SAAS,CAAC,GAAG,EAAE;QACxB,OAAO,GAAG,EAAE;YACV,IAAI,UAAU,CAAC,OAAO,EAAE,CAAC;gBACvB,YAAY,CAAC,UAAU,CAAC,OAAO,CAAC,CAAA;YAClC,CAAC;QACH,CAAC,CAAA;IACH,CAAC,EAAE,EAAE,CAAC,CAAA;IAEN,OAAO,CACL,KAAC,MAAM,IACL,IAAI,EAAE,IAAI,EACV,OAAO,EAAC,OAAO,EACf,SAAS,EAAE,uBAAuB,SAAS,EAAE,EAC7C,OAAO,EAAE,UAAU,gBACP,MAAM,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,WAAW,iBAC/B,MAAM,YAElB,MAAM,CAAC,CAAC,CAAC,KAAC,SAAS,IAAC,KAAK,EAAC,IAAI,EAAC,MAAM,EAAC,IAAI,GAAG,CAAC,CAAC,CAAC,KAAC,QAAQ,IAAC,KAAK,EAAC,IAAI,EAAC,MAAM,EAAC,IAAI,GAAG,GAC7E,CACV,CAAA;AACH,CAAC,CAAA"}
|
@@ -35,8 +35,4 @@ export interface GraphQLDocumentProps {
|
|
35
35
|
* with hyperlinks, tooltips, and schema validation.
|
36
36
|
*/
|
37
37
|
export declare const GraphQLDocument: React.FC<GraphQLDocumentProps>;
|
38
|
-
/**
|
39
|
-
* Default styles for the GraphQL document component
|
40
|
-
*/
|
41
|
-
export declare const graphqlDocumentStyles = "\n.graphql-document {\n position: relative;\n}\n\n.graphql-interaction-layer {\n position: absolute;\n top: 0;\n left: 0;\n right: 0;\n bottom: 0;\n pointer-events: none;\n}\n\n.graphql-interaction-layer > * {\n pointer-events: auto;\n}\n\n.graphql-validation-errors {\n margin-top: 1rem;\n padding: 0.5rem;\n background-color: var(--red-2);\n border: 1px solid var(--red-6);\n border-radius: 4px;\n}\n\n.graphql-error {\n color: var(--red-11);\n font-size: 0.875rem;\n margin: 0.25rem 0;\n}\n\n.graphql-debug-mode [data-graphql-id] {\n background-color: rgba(59, 130, 246, 0.1);\n outline: 1px solid rgba(59, 130, 246, 0.3);\n}\n";
|
42
38
|
//# sourceMappingURL=GraphQLDocument.d.ts.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"GraphQLDocument.d.ts","sourceRoot":"","sources":["../../../../src/lib/graphql-document/components/GraphQLDocument.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,kBAAkB,CAAA;
|
1
|
+
{"version":3,"file":"GraphQLDocument.d.ts","sourceRoot":"","sources":["../../../../src/lib/graphql-document/components/GraphQLDocument.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,kBAAkB,CAAA;AAE7C,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,SAAS,CAAA;AAW5C;;GAEG;AACH,MAAM,WAAW,sBAAsB;IACrC,qCAAqC;IACrC,KAAK,CAAC,EAAE,OAAO,CAAA;IACf,8CAA8C;IAC9C,KAAK,CAAC,EAAE,OAAO,CAAA;IACf,gCAAgC;IAChC,UAAU,CAAC,EAAE,CAAC,GAAG,EAAE,MAAM,KAAK,IAAI,CAAA;IAClC,yCAAyC;IACzC,QAAQ,CAAC,EAAE,OAAO,CAAA;IAClB,0CAA0C;IAC1C,SAAS,CAAC,EAAE,MAAM,CAAA;CACnB;AAED;;GAEG;AACH,MAAM,WAAW,oBAAoB;IACnC,uCAAuC;IACvC,QAAQ,EAAE,MAAM,CAAA;IAChB,gDAAgD;IAChD,MAAM,CAAC,EAAE,aAAa,CAAA;IACtB,wBAAwB;IACxB,OAAO,CAAC,EAAE,sBAAsB,CAAA;IAChC,gDAAgD;IAChD,eAAe,CAAC,EAAE,MAAM,CAAA;CACzB;AAED;;;;;GAKG;AACH,eAAO,MAAM,eAAe,EAAE,KAAK,CAAC,EAAE,CAAC,oBAAoB,CAwM1D,CAAA"}
|
@@ -1,12 +1,13 @@
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
2
|
-
import {
|
2
|
+
import { React as ReactHooks } from '#dep/react/index';
|
3
3
|
import { useNavigate } from 'react-router';
|
4
4
|
import { analyze } from "../analysis.js";
|
5
|
+
import { useTooltipState } from "../hooks/use-tooltip-state.js";
|
5
6
|
import { createSimplePositionCalculator } from "../positioning-simple.js";
|
6
7
|
import { createPolenSchemaResolver } from "../schema-integration.js";
|
7
|
-
import {
|
8
|
+
import { CopyButton } from "./CopyButton.js";
|
9
|
+
import { graphqlDocumentStyles } from "./graphql-document-styles.js";
|
8
10
|
import { IdentifierLink } from "./IdentifierLink.js";
|
9
|
-
import { identifierLinkStyles } from "./IdentifierLink.js";
|
10
11
|
/**
|
11
12
|
* Interactive GraphQL document component
|
12
13
|
*
|
@@ -14,48 +15,44 @@ import { identifierLinkStyles } from "./IdentifierLink.js";
|
|
14
15
|
* with hyperlinks, tooltips, and schema validation.
|
15
16
|
*/
|
16
17
|
export const GraphQLDocument = ({ children, schema, options = {}, highlightedHtml, }) => {
|
17
|
-
const { debug = false, plain = false, onNavigate, validate = true, className = '', } = options;
|
18
|
+
const { debug = false, plain = false, onNavigate, validate = true, className = '', } = options || {};
|
18
19
|
const navigate = useNavigate();
|
19
20
|
const handleNavigate = onNavigate || ((url) => navigate(url));
|
20
21
|
// Container ref for positioning calculations
|
21
|
-
const containerRef = useRef(null);
|
22
|
-
const [isReady, setIsReady] = useState(false);
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
if (
|
33
|
-
|
34
|
-
return;
|
22
|
+
const containerRef = ReactHooks.useRef(null);
|
23
|
+
const [isReady, setIsReady] = ReactHooks.useState(false);
|
24
|
+
// Use tooltip state management
|
25
|
+
const tooltipState = useTooltipState({
|
26
|
+
showDelay: 300,
|
27
|
+
hideDelay: 200, // Increased for smoother experience
|
28
|
+
allowMultiplePins: true,
|
29
|
+
});
|
30
|
+
// Handle escape key to unpin all
|
31
|
+
ReactHooks.useEffect(() => {
|
32
|
+
const handleKeyDown = (event) => {
|
33
|
+
if (event.key === 'Escape') {
|
34
|
+
tooltipState.unpinAll();
|
35
35
|
}
|
36
|
-
// Close the tooltip
|
37
|
-
setOpenTooltipId(null);
|
38
36
|
};
|
39
|
-
|
40
|
-
document.addEventListener('mousedown', handleClickOutside);
|
37
|
+
document.addEventListener('keydown', handleKeyDown);
|
41
38
|
return () => {
|
42
|
-
document.removeEventListener('
|
39
|
+
document.removeEventListener('keydown', handleKeyDown);
|
43
40
|
};
|
44
|
-
}, [
|
41
|
+
}, [tooltipState]);
|
45
42
|
// Layer 1: Parse and analyze
|
46
|
-
const analysisResult = useMemo(() => {
|
43
|
+
const analysisResult = ReactHooks.useMemo(() => {
|
47
44
|
if (plain)
|
48
45
|
return null;
|
49
46
|
const result = analyze(children, { schema });
|
50
47
|
return result;
|
51
48
|
}, [children, plain, schema]);
|
52
49
|
// Layer 2: Schema resolution
|
53
|
-
const resolver = useMemo(() => {
|
50
|
+
const resolver = ReactHooks.useMemo(() => {
|
54
51
|
if (!schema || plain)
|
55
52
|
return null;
|
56
53
|
return createPolenSchemaResolver(schema);
|
57
54
|
}, [schema, plain]);
|
58
|
-
const resolutions = useMemo(() => {
|
55
|
+
const resolutions = ReactHooks.useMemo(() => {
|
59
56
|
if (!analysisResult || !resolver) {
|
60
57
|
return new Map();
|
61
58
|
}
|
@@ -69,14 +66,14 @@ export const GraphQLDocument = ({ children, schema, options = {}, highlightedHtm
|
|
69
66
|
return results;
|
70
67
|
}, [analysisResult, resolver]);
|
71
68
|
// Layer 3: Position calculation
|
72
|
-
const positionCalculator = useMemo(() => {
|
69
|
+
const positionCalculator = ReactHooks.useMemo(() => {
|
73
70
|
if (plain)
|
74
71
|
return null;
|
75
72
|
return createSimplePositionCalculator();
|
76
73
|
}, [plain]);
|
77
|
-
const [positions, setPositions] = useState(new Map());
|
74
|
+
const [positions, setPositions] = ReactHooks.useState(new Map());
|
78
75
|
// Prepare code block and calculate positions after render
|
79
|
-
useEffect(() => {
|
76
|
+
ReactHooks.useEffect(() => {
|
80
77
|
if (!containerRef.current || !analysisResult || !positionCalculator || plain) {
|
81
78
|
return;
|
82
79
|
}
|
@@ -101,7 +98,7 @@ export const GraphQLDocument = ({ children, schema, options = {}, highlightedHtm
|
|
101
98
|
});
|
102
99
|
}, [analysisResult, positionCalculator, plain, highlightedHtml]);
|
103
100
|
// Handle resize events
|
104
|
-
useEffect(() => {
|
101
|
+
ReactHooks.useEffect(() => {
|
105
102
|
if (!containerRef.current || !positionCalculator || plain)
|
106
103
|
return;
|
107
104
|
const handleResize = () => {
|
@@ -117,57 +114,17 @@ export const GraphQLDocument = ({ children, schema, options = {}, highlightedHtm
|
|
117
114
|
return () => window.removeEventListener('resize', handleResize);
|
118
115
|
}, [positionCalculator, plain]);
|
119
116
|
// Validation errors
|
120
|
-
const validationErrors = useMemo(() => {
|
117
|
+
const validationErrors = ReactHooks.useMemo(() => {
|
121
118
|
if (!validate || !analysisResult || !schema)
|
122
119
|
return [];
|
123
120
|
return analysisResult.errors;
|
124
121
|
}, [validate, analysisResult, schema]);
|
125
|
-
return (_jsxs(_Fragment, { children: [_jsx("style", { dangerouslySetInnerHTML: { __html:
|
122
|
+
return (_jsxs(_Fragment, { children: [_jsx("style", { dangerouslySetInnerHTML: { __html: graphqlDocumentStyles } }), _jsxs("div", { ref: containerRef, className: `graphql-document ${className} ${debug ? 'graphql-debug-mode' : ''} ${!isReady && !plain ? 'graphql-loading' : ''}`, children: [highlightedHtml ? _jsx("div", { dangerouslySetInnerHTML: { __html: highlightedHtml } }) : (_jsx("pre", { className: 'shiki', children: _jsx("code", { children: children }) })), !plain && (_jsx(CopyButton, { text: children, className: 'graphql-document-copy', size: '2' })), !plain && isReady && (_jsx("div", { className: 'graphql-interaction-layer', style: { pointerEvents: 'none' }, children: Array.from(positions.entries()).map(([id, { position, identifier }]) => {
|
126
123
|
const startPos = identifier.position.start;
|
127
124
|
const resolution = resolutions.get(startPos);
|
128
125
|
if (!resolution)
|
129
126
|
return null;
|
130
|
-
return (_jsx(IdentifierLink, { identifier: identifier, resolution: resolution, position: position, onNavigate: handleNavigate, debug: debug, isOpen:
|
127
|
+
return (_jsx(IdentifierLink, { identifier: identifier, resolution: resolution, position: position, onNavigate: handleNavigate, debug: debug, isOpen: tooltipState.isOpen(id), isPinned: tooltipState.isPinned(id), onHoverStart: () => tooltipState.onHoverStart(id), onHoverEnd: () => tooltipState.onHoverEnd(id), onTogglePin: () => tooltipState.onTogglePin(id), onTooltipHover: () => tooltipState.onTooltipHover(id) }, id));
|
131
128
|
}) })), validationErrors.length > 0 && (_jsx("div", { className: 'graphql-validation-errors', children: validationErrors.map((error, index) => (_jsx("div", { className: 'graphql-error', children: error.message }, index))) }))] })] }));
|
132
129
|
};
|
133
|
-
/**
|
134
|
-
* Default styles for the GraphQL document component
|
135
|
-
*/
|
136
|
-
export const graphqlDocumentStyles = `
|
137
|
-
.graphql-document {
|
138
|
-
position: relative;
|
139
|
-
}
|
140
|
-
|
141
|
-
.graphql-interaction-layer {
|
142
|
-
position: absolute;
|
143
|
-
top: 0;
|
144
|
-
left: 0;
|
145
|
-
right: 0;
|
146
|
-
bottom: 0;
|
147
|
-
pointer-events: none;
|
148
|
-
}
|
149
|
-
|
150
|
-
.graphql-interaction-layer > * {
|
151
|
-
pointer-events: auto;
|
152
|
-
}
|
153
|
-
|
154
|
-
.graphql-validation-errors {
|
155
|
-
margin-top: 1rem;
|
156
|
-
padding: 0.5rem;
|
157
|
-
background-color: var(--red-2);
|
158
|
-
border: 1px solid var(--red-6);
|
159
|
-
border-radius: 4px;
|
160
|
-
}
|
161
|
-
|
162
|
-
.graphql-error {
|
163
|
-
color: var(--red-11);
|
164
|
-
font-size: 0.875rem;
|
165
|
-
margin: 0.25rem 0;
|
166
|
-
}
|
167
|
-
|
168
|
-
.graphql-debug-mode [data-graphql-id] {
|
169
|
-
background-color: rgba(59, 130, 246, 0.1);
|
170
|
-
outline: 1px solid rgba(59, 130, 246, 0.3);
|
171
|
-
}
|
172
|
-
`;
|
173
130
|
//# sourceMappingURL=GraphQLDocument.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"GraphQLDocument.js","sourceRoot":"","sources":["../../../../src/lib/graphql-document/components/GraphQLDocument.tsx"],"names":[],"mappings":";
|
1
|
+
{"version":3,"file":"GraphQLDocument.js","sourceRoot":"","sources":["../../../../src/lib/graphql-document/components/GraphQLDocument.tsx"],"names":[],"mappings":";AACA,OAAO,EAAE,KAAK,IAAI,UAAU,EAAE,MAAM,kBAAkB,CAAA;AAEtD,OAAO,EAAE,WAAW,EAAE,MAAM,cAAc,CAAA;AAC1C,OAAO,EAAE,OAAO,EAAE,MAAM,gBAAgB,CAAA;AACxC,OAAO,EAAE,eAAe,EAAE,MAAM,+BAA+B,CAAA;AAC/D,OAAO,EAAE,8BAA8B,EAAE,MAAM,0BAA0B,CAAA;AACzE,OAAO,EAAE,yBAAyB,EAAE,MAAM,0BAA0B,CAAA;AAEpE,OAAO,EAAE,UAAU,EAAE,MAAM,iBAAkB,CAAA;AAC7C,OAAO,EAAE,qBAAqB,EAAE,MAAM,8BAA8B,CAAA;AACpE,OAAO,EAAE,cAAc,EAAE,MAAM,qBAAsB,CAAA;AAgCrD;;;;;GAKG;AACH,MAAM,CAAC,MAAM,eAAe,GAAmC,CAAC,EAC9D,QAAQ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AW,EAAE,GAAG,EAAE,CAAC,YAAY,CAAC,WAAW,CAAC,EAAE,CAAC,EAC/C,cAAc,EAAE,GAAG,EAAE,CAAC,YAAY,CAAC,cAAc,CAAC,EAAE,CAAC,IAXhD,EAAE,CAYP,CACH,CAAA;wBACH,CAAC,CAAC,GACE,CACP,EAGA,gBAAgB,CAAC,MAAM,GAAG,CAAC,IAAI,CAC9B,cAAK,SAAS,EAAC,2BAA2B,YACvC,gBAAgB,CAAC,GAAG,CAAC,CAAC,KAAU,EAAE,KAAa,EAAE,EAAE,CAAC,CACnD,cAAiB,SAAS,EAAC,eAAe,YACvC,KAAK,CAAC,OAAO,IADN,KAAK,CAET,CACP,CAAC,GACE,CACP,IACG,IACL,CACJ,CAAA;AACH,CAAC,CAAA"}
|
@@ -0,0 +1,33 @@
|
|
1
|
+
/**
|
2
|
+
* GraphQL Identifier Popover using Radix Themes
|
3
|
+
*
|
4
|
+
* Displays rich information about GraphQL identifiers on hover/click
|
5
|
+
*/
|
6
|
+
import type { React } from '#dep/react/index';
|
7
|
+
import type { Documentation } from '../schema-integration.ts';
|
8
|
+
import type { Identifier } from '../types.ts';
|
9
|
+
export interface GraphQLIdentifierPopoverProps {
|
10
|
+
/** The identifier being shown */
|
11
|
+
identifier: Identifier;
|
12
|
+
/** Documentation from schema */
|
13
|
+
documentation: Documentation;
|
14
|
+
/** Whether this identifier has an error */
|
15
|
+
hasError?: boolean;
|
16
|
+
/** Reference URL for "View docs" link */
|
17
|
+
referenceUrl: string;
|
18
|
+
/** Whether popover is open */
|
19
|
+
open: boolean;
|
20
|
+
/** Whether popover is pinned */
|
21
|
+
isPinned: boolean;
|
22
|
+
/** Callback when open state changes */
|
23
|
+
onOpenChange: (open: boolean) => void;
|
24
|
+
/** Callback to navigate to docs */
|
25
|
+
onNavigate?: (url: string) => void;
|
26
|
+
/** The trigger element */
|
27
|
+
children: React.ReactNode;
|
28
|
+
}
|
29
|
+
/**
|
30
|
+
* Popover content for GraphQL identifiers
|
31
|
+
*/
|
32
|
+
export declare const GraphQLIdentifierPopover: React.FC<GraphQLIdentifierPopoverProps>;
|
33
|
+
//# sourceMappingURL=GraphQLIdentifierPopover.d.ts.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"GraphQLIdentifierPopover.d.ts","sourceRoot":"","sources":["../../../../src/lib/graphql-document/components/GraphQLIdentifierPopover.tsx"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,kBAAkB,CAAA;AAG7C,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,0BAA0B,CAAA;AAC7D,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,aAAa,CAAA;AAE7C,MAAM,WAAW,6BAA6B;IAC5C,iCAAiC;IACjC,UAAU,EAAE,UAAU,CAAA;IACtB,gCAAgC;IAChC,aAAa,EAAE,aAAa,CAAA;IAC5B,2CAA2C;IAC3C,QAAQ,CAAC,EAAE,OAAO,CAAA;IAClB,yCAAyC;IACzC,YAAY,EAAE,MAAM,CAAA;IACpB,8BAA8B;IAC9B,IAAI,EAAE,OAAO,CAAA;IACb,gCAAgC;IAChC,QAAQ,EAAE,OAAO,CAAA;IACjB,uCAAuC;IACvC,YAAY,EAAE,CAAC,IAAI,EAAE,OAAO,KAAK,IAAI,CAAA;IACrC,mCAAmC;IACnC,UAAU,CAAC,EAAE,CAAC,GAAG,EAAE,MAAM,KAAK,IAAI,CAAA;IAClC,0BAA0B;IAC1B,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAA;CAC1B;AAED;;GAEG;AACH,eAAO,MAAM,wBAAwB,EAAE,KAAK,CAAC,EAAE,CAAC,6BAA6B,CAgK5E,CAAA"}
|
@@ -0,0 +1,48 @@
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
2
|
+
import { Cross2Icon } from '@radix-ui/react-icons';
|
3
|
+
import { Badge, Box, Card, Flex, IconButton, Link, Popover, Text } from '@radix-ui/themes';
|
4
|
+
/**
|
5
|
+
* Popover content for GraphQL identifiers
|
6
|
+
*/
|
7
|
+
export const GraphQLIdentifierPopover = ({ identifier, documentation, hasError = false, referenceUrl, open, isPinned, onOpenChange, onNavigate, children, }) => {
|
8
|
+
// Determine badge color based on identifier kind
|
9
|
+
const getBadgeColor = () => {
|
10
|
+
switch (identifier.kind) {
|
11
|
+
case 'Type':
|
12
|
+
return 'blue';
|
13
|
+
case 'Field':
|
14
|
+
return 'green';
|
15
|
+
case 'Argument':
|
16
|
+
return 'orange';
|
17
|
+
case 'Variable':
|
18
|
+
return 'purple';
|
19
|
+
case 'Directive':
|
20
|
+
return 'amber';
|
21
|
+
case 'Fragment':
|
22
|
+
return 'cyan';
|
23
|
+
default:
|
24
|
+
return 'gray';
|
25
|
+
}
|
26
|
+
};
|
27
|
+
return (_jsxs(Popover.Root, { open: open, onOpenChange: onOpenChange, children: [_jsx(Popover.Trigger, { children: children }), _jsx(Popover.Content, { className: 'graphql-identifier-popover', style: { maxWidth: 400 }, onInteractOutside: (e) => {
|
28
|
+
// Prevent closing when clicking inside popover if pinned
|
29
|
+
if (isPinned) {
|
30
|
+
e.preventDefault();
|
31
|
+
}
|
32
|
+
}, children: _jsxs(Flex, { direction: 'column', gap: '2', children: [_jsxs(Flex, { justify: 'between', align: 'center', children: [_jsxs(Flex, { align: 'center', gap: '2', children: [_jsx(Text, { size: '2', weight: 'bold', children: identifier.name }), _jsx(Badge, { color: getBadgeColor(), size: '1', children: identifier.kind })] }), isPinned && (_jsx(IconButton, { size: '1', variant: 'ghost', onClick: () => onOpenChange(false), "aria-label": 'Close popover', children: _jsx(Cross2Icon, {}) }))] }), _jsx(Box, { children: _jsxs(Text, { size: '1', color: 'gray', children: ["Type: ", _jsx(Text, { as: 'span', size: '1', style: { fontFamily: 'monospace' }, children: documentation.typeInfo })] }) }), documentation.description && (_jsx(Box, { children: _jsx(Text, { size: '1', children: documentation.description }) })), documentation.defaultValue && (_jsx(Box, { children: _jsxs(Text, { size: '1', color: 'gray', children: ["Default:", ' ', _jsx(Text, { as: 'span', size: '1', style: { fontFamily: 'monospace' }, children: documentation.defaultValue })] }) })), documentation.deprecated && (_jsxs(Box, { style: {
|
33
|
+
padding: '8px',
|
34
|
+
backgroundColor: 'var(--amber-2)',
|
35
|
+
borderRadius: '4px',
|
36
|
+
border: '1px solid var(--amber-6)',
|
37
|
+
}, children: [_jsxs(Text, { size: '1', color: 'amber', children: ["\u26A0\uFE0F Deprecated: ", documentation.deprecated.reason] }), documentation.deprecated.replacement && (_jsxs(Text, { size: '1', color: 'amber', children: ["Use ", documentation.deprecated.replacement, " instead."] }))] })), hasError && (_jsx(Box, { style: {
|
38
|
+
padding: '8px',
|
39
|
+
backgroundColor: 'var(--red-2)',
|
40
|
+
borderRadius: '4px',
|
41
|
+
border: '1px solid var(--red-6)',
|
42
|
+
}, children: _jsxs(Text, { size: '1', color: 'red', children: ["\u274C ", identifier.kind, " not found in schema"] }) })), _jsx(Box, { children: _jsxs(Text, { size: '1', color: 'gray', children: ["Path: ", identifier.schemaPath.join(' → ')] }) }), onNavigate && !hasError && (_jsx(Box, { children: _jsx(Link, { size: '1', href: referenceUrl, onClick: (e) => {
|
43
|
+
e.preventDefault();
|
44
|
+
onNavigate(referenceUrl);
|
45
|
+
onOpenChange(false);
|
46
|
+
}, children: "View full documentation \u2192" }) }))] }) })] }));
|
47
|
+
};
|
48
|
+
//# sourceMappingURL=GraphQLIdentifierPopover.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"GraphQLIdentifierPopover.js","sourceRoot":"","sources":["../../../../src/lib/graphql-document/components/GraphQLIdentifierPopover.tsx"],"names":[],"mappings":";AAOA,OAAO,EAAE,UAAU,EAAE,MAAM,uBAAuB,CAAA;AAClD,OAAO,EAAE,KAAK,EAAE,GAAG,EAAE,IAAI,EAAE,IAAI,EAAE,UAAU,EAAE,IAAI,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,kBAAkB,CAAA;AA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G,EAAC,KAAK,EAAC,OAAO,0CACV,aAAa,CAAC,UAAU,CAAC,MAAM,IAC1C,EACN,aAAa,CAAC,UAAU,CAAC,WAAW,IAAI,CACvC,MAAC,IAAI,IAAC,IAAI,EAAC,GAAG,EAAC,KAAK,EAAC,OAAO,qBACrB,aAAa,CAAC,UAAU,CAAC,WAAW,iBACpC,CACR,IACG,CACP,EAGA,QAAQ,IAAI,CACX,KAAC,GAAG,IACF,KAAK,EAAE;gCACL,OAAO,EAAE,KAAK;gCACd,eAAe,EAAE,cAAc;gCAC/B,YAAY,EAAE,KAAK;gCACnB,MAAM,EAAE,wBAAwB;6BACjC,YAED,MAAC,IAAI,IAAC,IAAI,EAAC,GAAG,EAAC,KAAK,EAAC,KAAK,wBACrB,UAAU,CAAC,IAAI,4BACb,GACH,CACP,EAGD,KAAC,GAAG,cACF,MAAC,IAAI,IAAC,IAAI,EAAC,GAAG,EAAC,KAAK,EAAC,MAAM,uBAClB,UAAU,CAAC,UAAU,CAAC,IAAI,CAAC,KAAK,CAAC,IACnC,GACH,EAGL,UAAU,IAAI,CAAC,QAAQ,IAAI,CAC1B,KAAC,GAAG,cACF,KAAC,IAAI,IACH,IAAI,EAAC,GAAG,EACR,IAAI,EAAE,YAAY,EAClB,OAAO,EAAE,CAAC,CAAmB,EAAE,EAAE;oCAC/B,CAAC,CAAC,cAAc,EAAE,CAAA;oCAClB,UAAU,CAAC,YAAY,CAAC,CAAA;oCACxB,YAAY,CAAC,KAAK,CAAC,CAAA;gCACrB,CAAC,+CAGI,GACH,CACP,IACI,GACS,IACL,CAChB,CAAA;AACH,CAAC,CAAA"}
|
@@ -1,10 +1,10 @@
|
|
1
|
+
/**
|
2
|
+
* Interactive overlay for GraphQL identifiers
|
3
|
+
*/
|
1
4
|
import type { React } from '#dep/react/index';
|
2
5
|
import type { DOMPosition } from '../positioning-simple.ts';
|
3
6
|
import type { SchemaResolution } from '../schema-integration.ts';
|
4
7
|
import type { Identifier } from '../types.ts';
|
5
|
-
/**
|
6
|
-
* Props for the IdentifierLink component
|
7
|
-
*/
|
8
8
|
export interface IdentifierLinkProps {
|
9
9
|
/** The GraphQL identifier */
|
10
10
|
identifier: Identifier;
|
@@ -17,21 +17,23 @@ export interface IdentifierLinkProps {
|
|
17
17
|
/** Whether to show debug visuals */
|
18
18
|
debug?: boolean;
|
19
19
|
/** Whether this tooltip is open */
|
20
|
-
isOpen
|
21
|
-
/**
|
22
|
-
|
20
|
+
isOpen: boolean;
|
21
|
+
/** Whether this tooltip is pinned */
|
22
|
+
isPinned: boolean;
|
23
|
+
/** Handle hover start */
|
24
|
+
onHoverStart: () => void;
|
25
|
+
/** Handle hover end */
|
26
|
+
onHoverEnd: () => void;
|
27
|
+
/** Toggle pin state */
|
28
|
+
onTogglePin: () => void;
|
29
|
+
/** Handle tooltip hover */
|
30
|
+
onTooltipHover: () => void;
|
23
31
|
}
|
24
32
|
/**
|
25
33
|
* Interactive overlay for a GraphQL identifier
|
26
34
|
*
|
27
35
|
* Renders an invisible clickable area over the identifier text
|
28
|
-
* with hover
|
36
|
+
* with hover popovers and navigation to schema reference pages.
|
29
37
|
*/
|
30
38
|
export declare const IdentifierLink: React.FC<IdentifierLinkProps>;
|
31
|
-
/**
|
32
|
-
* Default styles for identifier overlays
|
33
|
-
*
|
34
|
-
* These can be included in the document or overridden by custom styles.
|
35
|
-
*/
|
36
|
-
export declare const identifierLinkStyles = "\n.graphql-identifier-overlay {\n /* Base styles for all overlays */\n transition: background-color 0.2s ease;\n}\n\n.graphql-identifier-overlay.graphql-clickable:hover {\n /* Subtle highlight on hover for clickable identifiers */\n background-color: rgba(59, 130, 246, 0.05);\n}\n\n.graphql-identifier-overlay.graphql-error {\n /* Error indicator */\n border-bottom: 2px wavy red;\n}\n\n.graphql-identifier-overlay.graphql-deprecated {\n /* Deprecated indicator */\n text-decoration: line-through;\n opacity: 0.7;\n}\n\n.graphql-identifier-overlay.graphql-debug {\n /* Debug mode makes overlays visible */\n background-color: rgba(59, 130, 246, 0.1) !important;\n border: 1px solid rgba(59, 130, 246, 0.3) !important;\n}\n\n/* Kind-specific styles */\n.graphql-identifier-overlay.graphql-type {\n /* Type identifiers */\n}\n\n.graphql-identifier-overlay.graphql-field {\n /* Field identifiers */\n}\n\n.graphql-identifier-overlay.graphql-argument {\n /* Argument identifiers */\n font-style: italic;\n}\n\n.graphql-identifier-overlay.graphql-variable {\n /* Variable identifiers */\n color: var(--purple-11);\n}\n\n.graphql-identifier-overlay.graphql-directive {\n /* Directive identifiers */\n color: var(--amber-11);\n}\n";
|
37
39
|
//# sourceMappingURL=IdentifierLink.d.ts.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"IdentifierLink.d.ts","sourceRoot":"","sources":["../../../../src/lib/graphql-document/components/IdentifierLink.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,kBAAkB,CAAA;
|
1
|
+
{"version":3,"file":"IdentifierLink.d.ts","sourceRoot":"","sources":["../../../../src/lib/graphql-document/components/IdentifierLink.tsx"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,kBAAkB,CAAA;AAC7C,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,0BAA0B,CAAA;AAC3D,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,0BAA0B,CAAA;AAChE,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,aAAa,CAAA;AAG7C,MAAM,WAAW,mBAAmB;IAClC,6BAA6B;IAC7B,UAAU,EAAE,UAAU,CAAA;IACtB,oCAAoC;IACpC,UAAU,EAAE,gBAAgB,CAAA;IAC5B,yCAAyC;IACzC,QAAQ,EAAE,WAAW,CAAA;IACrB,yBAAyB;IACzB,UAAU,EAAE,CAAC,GAAG,EAAE,MAAM,KAAK,IAAI,CAAA;IACjC,oCAAoC;IACpC,KAAK,CAAC,EAAE,OAAO,CAAA;IACf,mCAAmC;IACnC,MAAM,EAAE,OAAO,CAAA;IACf,qCAAqC;IACrC,QAAQ,EAAE,OAAO,CAAA;IACjB,yBAAyB;IACzB,YAAY,EAAE,MAAM,IAAI,CAAA;IACxB,uBAAuB;IACvB,UAAU,EAAE,MAAM,IAAI,CAAA;IACtB,uBAAuB;IACvB,WAAW,EAAE,MAAM,IAAI,CAAA;IACvB,2BAA2B;IAC3B,cAAc,EAAE,MAAM,IAAI,CAAA;CAC3B;AAED;;;;;GAKG;AACH,eAAO,MAAM,cAAc,EAAE,KAAK,CAAC,EAAE,CAAC,mBAAmB,CAsHxD,CAAA"}
|