ruru-components 2.0.0-beta.32 → 2.0.0-beta.34
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/CHANGELOG.md +116 -0
- package/README.md +36 -2
- package/dist/components/Explain.d.ts +0 -5
- package/dist/components/Explain.d.ts.map +1 -1
- package/dist/components/Explain.js +31 -25
- package/dist/components/Explain.js.map +1 -1
- package/dist/components/Footer.js +1 -1
- package/dist/components/Footer.js.map +1 -1
- package/dist/components/FormatSQL.d.ts.map +1 -1
- package/dist/components/FormatSQL.js +2 -2
- package/dist/components/FormatSQL.js.map +1 -1
- package/dist/components/Mermaid.d.ts +1 -1
- package/dist/components/Mermaid.d.ts.map +1 -1
- package/dist/components/Mermaid.js +3 -25
- package/dist/components/Mermaid.js.map +1 -1
- package/dist/components/MermaidReal.d.ts +7 -0
- package/dist/components/MermaidReal.d.ts.map +1 -0
- package/dist/components/MermaidReal.js +24 -0
- package/dist/components/MermaidReal.js.map +1 -0
- package/dist/hooks/useGraphQLChangeStream.d.ts.map +1 -1
- package/dist/hooks/useGraphQLChangeStream.js +3 -2
- package/dist/hooks/useGraphQLChangeStream.js.map +1 -1
- package/dist/hooks/usePrettify.d.ts +0 -6
- package/dist/hooks/usePrettify.d.ts.map +1 -1
- package/dist/hooks/usePrettify.js +80 -18
- package/dist/hooks/usePrettify.js.map +1 -1
- package/dist/hooks/useStorage.d.ts +1 -1
- package/dist/hooks/useStorage.d.ts.map +1 -1
- package/dist/hooks/useStorage.js +3 -2
- package/dist/hooks/useStorage.js.map +1 -1
- package/dist/interfaces.d.ts +1 -30
- package/dist/interfaces.d.ts.map +1 -1
- package/dist/ruru.d.ts +14 -5
- package/dist/ruru.d.ts.map +1 -1
- package/dist/ruru.js +35 -43
- package/dist/ruru.js.map +1 -1
- package/package.json +11 -7
- package/ruru.css +160 -0
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,121 @@
|
|
|
1
1
|
# ruru-components
|
|
2
2
|
|
|
3
|
+
## 2.0.0-beta.34
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [#2646](https://github.com/graphile/crystal/pull/2646)
|
|
8
|
+
[`59adcd5`](https://github.com/graphile/crystal/commit/59adcd52d3fd465c8d6afdcefaa41c82c9a77319)
|
|
9
|
+
Thanks [@benjie](https://github.com/benjie)! - Add condensed mode for Ruru,
|
|
10
|
+
enabled by default. (To disable, use the settings cog in the editor view and
|
|
11
|
+
uncheck condensed.)
|
|
12
|
+
|
|
13
|
+
- [#2645](https://github.com/graphile/crystal/pull/2645)
|
|
14
|
+
[`f941cfd`](https://github.com/graphile/crystal/commit/f941cfdcc8235e34716d3595745a05e49267de12)
|
|
15
|
+
Thanks [@benjie](https://github.com/benjie)! - Upgrade GraphiQL to latest
|
|
16
|
+
release
|
|
17
|
+
|
|
18
|
+
- Updated dependencies
|
|
19
|
+
[[`2adfd6e`](https://github.com/graphile/crystal/commit/2adfd6efedd1ab6831605526a515c683a7e95c2c),
|
|
20
|
+
[`6113518`](https://github.com/graphile/crystal/commit/61135188900c39d0cb6bd2f9c0033f0954cd0e6a)]:
|
|
21
|
+
- grafast@0.1.1-beta.25
|
|
22
|
+
|
|
23
|
+
## 2.0.0-beta.33
|
|
24
|
+
|
|
25
|
+
### Patch Changes
|
|
26
|
+
|
|
27
|
+
- [#2578](https://github.com/graphile/crystal/pull/2578)
|
|
28
|
+
[`1d76d2f`](https://github.com/graphile/crystal/commit/1d76d2f0d19b4d56895ee9988440a35d2c60f9f9)
|
|
29
|
+
Thanks [@benjie](https://github.com/benjie)! - 🚨 **Ruru has been "rebuilt"!
|
|
30
|
+
The loading methods and APIs have changed!**
|
|
31
|
+
|
|
32
|
+
Ruru is now built on top of GraphiQL v5, which moves to using the Monaco
|
|
33
|
+
editor (the same editor used in VSCode) enabling more familiar keybindings and
|
|
34
|
+
more features (e.g. press F1 in the editor to see the command palette, and you
|
|
35
|
+
can now add comments in the variables JSON). This has required a
|
|
36
|
+
rearchitecture to Ruru's previously "single file" approach since Monaco uses
|
|
37
|
+
workers which require additional files.
|
|
38
|
+
|
|
39
|
+
In this release we have embraced the bundle splitting approach. We now bundle
|
|
40
|
+
both `prettier` and `mermaid`, and they are now loaded on-demand.
|
|
41
|
+
|
|
42
|
+
Usage instructions for all environments have had to change since we can no
|
|
43
|
+
longer serve Ruru as a single HTML file. We now include helpers for serving
|
|
44
|
+
Ruru's static files from whatever JS-based webserver you are using.
|
|
45
|
+
|
|
46
|
+
We've also added some additional improvements:
|
|
47
|
+
- Formatting with prettier now maintains the cursor position
|
|
48
|
+
(`Ctrl-Shift-P`/`Meta-Shift-P`/`Cmd-Shift-P` depending on platform)
|
|
49
|
+
- All editors are now formatted, not just the GraphQL editor
|
|
50
|
+
- Prettier and mermaid should now work offline
|
|
51
|
+
- Even more GraphiQL props are now passed through, including
|
|
52
|
+
`inputValueDeprecation` and `schemaDeprecation` which you can set to false
|
|
53
|
+
if your GraphQL server is, _ahem_, a little behind the GraphQL spec draft.
|
|
54
|
+
|
|
55
|
+
🚨 **Changes you need to make:** 🚨
|
|
56
|
+
- If you are using Ruru directly (i.e. importing from `ruru/server`), please
|
|
57
|
+
see the new Ruru README for setup instructions, you'll want to switch out
|
|
58
|
+
your previous setup. In particular, `ruru/bundle` no longer exists and you
|
|
59
|
+
now need to serve the static files (via `ruru/static`).
|
|
60
|
+
- `defaultHTMLParts` is no more; instead `config.htmlParts` (also
|
|
61
|
+
`preset.ruru.htmlParts` for Graphile Config users) now allows the entries to
|
|
62
|
+
be callback functions reducing boilerplate:
|
|
63
|
+
```diff
|
|
64
|
+
-import { defaultHTMLParts } from "ruru/server";
|
|
65
|
+
const config = {
|
|
66
|
+
htmlParts: {
|
|
67
|
+
- metaTags: defaultHTMLParts.metaTags + "<!-- local override -->",
|
|
68
|
+
+ metaTags: (base) => base + "<!-- local override -->",
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
```
|
|
72
|
+
(alternatively you can use `makeHTMLParts(config)`)
|
|
73
|
+
- Grafserv users: `plugin.grafserv.middleware.ruruHTMLParts` is renamed to
|
|
74
|
+
`ruruHTML` and wraps the generation of the HTML - simply trim `Parts` from
|
|
75
|
+
the name and be sure calling `next()` is the final line of the function
|
|
76
|
+
```diff
|
|
77
|
+
const plugin = {
|
|
78
|
+
grafserv: {
|
|
79
|
+
middleware: {
|
|
80
|
+
- ruruHTMLParts(next, event) {
|
|
81
|
+
+ ruruHTML(next, event) {
|
|
82
|
+
const { htmlParts, request } = event;
|
|
83
|
+
htmlParts.titleTag = `<title>${escapeHTML(
|
|
84
|
+
"Ruru | " + request.getHeader("host"),
|
|
85
|
+
)}</title>`;
|
|
86
|
+
return next();
|
|
87
|
+
},
|
|
88
|
+
},
|
|
89
|
+
},
|
|
90
|
+
};
|
|
91
|
+
```
|
|
92
|
+
|
|
93
|
+
Additional changes:
|
|
94
|
+
- `RuruConfig.clientConfig` has been added for props to explicitly pass to
|
|
95
|
+
Ruru making it explicit that these will be sent to the client
|
|
96
|
+
- `RuruServerConfig` has deprecated the client options `editorTheme`,
|
|
97
|
+
`debugTools` and `eventSourceInit` at the top level; instead these should be
|
|
98
|
+
passed via `RuruServerConfig.clientConfig` making it explicit these will be
|
|
99
|
+
sent to the client and expanding to cover more props
|
|
100
|
+
```diff
|
|
101
|
+
const config = {
|
|
102
|
+
endpoint: "/graphql",
|
|
103
|
+
+ clientConfig: {
|
|
104
|
+
editorTheme: "dark",
|
|
105
|
+
+ },
|
|
106
|
+
}
|
|
107
|
+
```
|
|
108
|
+
|
|
109
|
+
- [#2605](https://github.com/graphile/crystal/pull/2605)
|
|
110
|
+
[`24d379a`](https://github.com/graphile/crystal/commit/24d379ae4b8a3c0afe3f1a309d87806a05e8d00d)
|
|
111
|
+
Thanks [@benjie](https://github.com/benjie)! - Add defaultTheme and
|
|
112
|
+
forcedTheme props to Ruru (passed through to GraphiQL)
|
|
113
|
+
|
|
114
|
+
- Updated dependencies
|
|
115
|
+
[[`c54c6db`](https://github.com/graphile/crystal/commit/c54c6db320b3967ab16784a504770c9b5ef24494),
|
|
116
|
+
[`ad588ec`](https://github.com/graphile/crystal/commit/ad588ecde230359f56800e414b7c5fa1aed14957)]:
|
|
117
|
+
- grafast@0.1.1-beta.24
|
|
118
|
+
|
|
3
119
|
## 2.0.0-beta.32
|
|
4
120
|
|
|
5
121
|
### Patch Changes
|
package/README.md
CHANGED
|
@@ -12,15 +12,49 @@ documentation.
|
|
|
12
12
|
|
|
13
13
|
For other usage patterns, please see the main [ruru][] package.
|
|
14
14
|
|
|
15
|
-
```
|
|
16
|
-
import { Ruru } from "ruru-components";
|
|
15
|
+
```jsx
|
|
17
16
|
import "graphiql/style.css";
|
|
18
17
|
import "@graphiql/plugin-explorer/style.css";
|
|
19
18
|
import "ruru-components/ruru.css";
|
|
20
19
|
|
|
20
|
+
// Have Webpack include the Monaco workers
|
|
21
|
+
import "graphiql/setup-workers/webpack";
|
|
22
|
+
// Or: import "graphiql/setup-workers/vite";
|
|
23
|
+
// Or: see "Monaco workers" below
|
|
24
|
+
|
|
25
|
+
import { Ruru } from "ruru-components";
|
|
26
|
+
|
|
21
27
|
React.render(<Ruru endpoint="/graphql" />);
|
|
22
28
|
```
|
|
23
29
|
|
|
30
|
+
### Monaco workers
|
|
31
|
+
|
|
32
|
+
If you can't use `graphiql/setup-workers/webpack` (or
|
|
33
|
+
`graphiql/setup-workers/vite` for Vite) to set up the Monaco workers for you,
|
|
34
|
+
then instead add this `<script>` block to your HTML above your Ruru import:
|
|
35
|
+
|
|
36
|
+
```html
|
|
37
|
+
<script type="module">
|
|
38
|
+
/* Set up monaco workers */
|
|
39
|
+
import createJSONWorker from "https://esm.sh/monaco-editor/esm/vs/language/json/json.worker.js?worker";
|
|
40
|
+
import createGraphQLWorker from "https://esm.sh/monaco-graphql/esm/graphql.worker.js?worker";
|
|
41
|
+
import createEditorWorker from "https://esm.sh/monaco-editor/esm/vs/editor/editor.worker.js?worker";
|
|
42
|
+
|
|
43
|
+
globalThis.MonacoEnvironment = {
|
|
44
|
+
getWorker(_workerId, label) {
|
|
45
|
+
switch (label) {
|
|
46
|
+
case "json":
|
|
47
|
+
return createJSONWorker();
|
|
48
|
+
case "graphql":
|
|
49
|
+
return createGraphQLWorker();
|
|
50
|
+
default:
|
|
51
|
+
return createEditorWorker();
|
|
52
|
+
}
|
|
53
|
+
},
|
|
54
|
+
};
|
|
55
|
+
</script>
|
|
56
|
+
```
|
|
57
|
+
|
|
24
58
|
[GNU Terry Pratchett](http://www.gnuterrypratchett.com/)
|
|
25
59
|
|
|
26
60
|
[ruru]: https://www.npmjs.com/package/ruru
|
|
@@ -1,11 +1,6 @@
|
|
|
1
1
|
import type { FC } from "react";
|
|
2
2
|
import type { ExplainHelpers } from "../hooks/useExplain.js";
|
|
3
3
|
import type { ExplainResults } from "../hooks/useFetcher.js";
|
|
4
|
-
declare global {
|
|
5
|
-
interface Window {
|
|
6
|
-
mermaid?: any;
|
|
7
|
-
}
|
|
8
|
-
}
|
|
9
4
|
export declare const Explain: FC<{
|
|
10
5
|
explain: boolean;
|
|
11
6
|
setExplain: (newExplain: boolean) => void;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Explain.d.ts","sourceRoot":"","sources":["../../src/components/Explain.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,EAAE,EAAE,MAAM,OAAO,CAAC;AAIhC,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,wBAAwB,CAAC;AAC7D,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,wBAAwB,CAAC;AAK7D,
|
|
1
|
+
{"version":3,"file":"Explain.d.ts","sourceRoot":"","sources":["../../src/components/Explain.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,EAAE,EAAE,MAAM,OAAO,CAAC;AAIhC,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,wBAAwB,CAAC;AAC7D,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,wBAAwB,CAAC;AAK7D,eAAO,MAAM,OAAO,EAAE,EAAE,CAAC;IACvB,OAAO,EAAE,OAAO,CAAC;IACjB,UAAU,EAAE,CAAC,UAAU,EAAE,OAAO,KAAK,IAAI,CAAC;IAC1C,OAAO,EAAE,cAAc,CAAC;IACxB,OAAO,EAAE,cAAc,GAAG,IAAI,CAAC;CAChC,CA6BA,CAAC;AAEF,eAAO,MAAM,WAAW,EAAE,EAAE,CAAC;IAC3B,OAAO,EAAE,cAAc,CAAC;IACxB,OAAO,EAAE,cAAc,CAAC;CACzB,CA4IA,CAAC"}
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import { planToMermaid } from "grafast/mermaid";
|
|
3
2
|
import { useCallback, useEffect, useMemo, useState } from "react";
|
|
4
3
|
import { createPortal } from "react-dom";
|
|
5
4
|
import { Copy } from "./Copy.js";
|
|
@@ -30,30 +29,29 @@ export const ExplainMain = ({ results }) => {
|
|
|
30
29
|
if (!selectedResult || selectedResult.type !== "plan")
|
|
31
30
|
return;
|
|
32
31
|
setSaving(true);
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
});
|
|
52
|
-
}
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
}, 0);
|
|
32
|
+
(async () => {
|
|
33
|
+
const mermaid = await loadMermaid();
|
|
34
|
+
const { planToMermaid } = await loadGrafastMermaid();
|
|
35
|
+
const diagram = planToMermaid(selectedResult.plan);
|
|
36
|
+
mermaid.default
|
|
37
|
+
.render("id1", diagram)
|
|
38
|
+
.then(({ svg }) => {
|
|
39
|
+
const file = new File([svg.replace(/<br>/g, "<br/>")], "grafast-plan.svg");
|
|
40
|
+
const a = document.createElement("a");
|
|
41
|
+
a.href = URL.createObjectURL(file);
|
|
42
|
+
a.download = file.name;
|
|
43
|
+
a.style.display = "none";
|
|
44
|
+
document.body.appendChild(a);
|
|
45
|
+
a.click();
|
|
46
|
+
setSaving(false);
|
|
47
|
+
setTimeout(() => {
|
|
48
|
+
URL.revokeObjectURL(a.href);
|
|
49
|
+
a.parentNode.removeChild(a);
|
|
50
|
+
}, 0);
|
|
51
|
+
});
|
|
52
|
+
})().catch((e) => {
|
|
53
|
+
alert(String(e));
|
|
54
|
+
});
|
|
57
55
|
}, [selectedResult]);
|
|
58
56
|
const component = (() => {
|
|
59
57
|
switch (selectedResult?.type) {
|
|
@@ -75,4 +73,12 @@ export const ExplainMain = ({ results }) => {
|
|
|
75
73
|
})();
|
|
76
74
|
return (_jsxs("div", { children: [_jsx("select", { value: String(selectedIndex), onChange: (e) => setSelectedIndex(parseInt(e.target.value, 10)), children: results.operations.map((o, i) => (_jsx("option", { value: String(i), children: o.title }, i))) }), component] }));
|
|
77
75
|
};
|
|
76
|
+
let _mermaid;
|
|
77
|
+
function loadMermaid() {
|
|
78
|
+
return (_mermaid ??= import("mermaid"));
|
|
79
|
+
}
|
|
80
|
+
let _grafastMermaid;
|
|
81
|
+
function loadGrafastMermaid() {
|
|
82
|
+
return (_grafastMermaid ??= import("grafast/mermaid"));
|
|
83
|
+
}
|
|
78
84
|
//# sourceMappingURL=Explain.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Explain.js","sourceRoot":"","sources":["../../src/components/Explain.tsx"],"names":[],"mappings":";
|
|
1
|
+
{"version":3,"file":"Explain.js","sourceRoot":"","sources":["../../src/components/Explain.tsx"],"names":[],"mappings":";AAGA,OAAO,EAAE,WAAW,EAAE,SAAS,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAClE,OAAO,EAAE,YAAY,EA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AC,EAAE,CAAC,EAAE,EAAE,CAAC,CAChC,iBAAQ,KAAK,EAAE,MAAM,CAAC,CAAC,CAAC,YACrB,CAAC,CAAC,KAAK,IADqB,CAAC,CAEvB,CACV,CAAC,GACK,EACR,SAAS,IACN,CACP,CAAC;AACJ,CAAC,CAAC;AAEF,IAAI,QAAgD,CAAC;AACrD,SAAS,WAAW;IAClB,OAAO,CAAC,QAAQ,KAAK,MAAM,CAAC,SAAS,CAAC,CAAC,CAAC;AAC1C,CAAC;AAED,IAAI,eAA2D,CAAC;AAChE,SAAS,kBAAkB;IACzB,OAAO,CAAC,eAAe,KAAK,MAAM,CAAC,iBAAiB,CAAC,CAAC,CAAC;AACzD,CAAC"}
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
export const RuruFooter = () => (_jsxs("div", {
|
|
2
|
+
export const RuruFooter = () => (_jsxs("div", { className: "ruru-footer", children: ["Community-funded OSS \uD83D\uDE4F", " ", _jsx("a", { title: "All our projects are supported by the community, please sponsor ongoing development", href: "https://graphile.org/sponsor/", target: "new", children: "please sponsor" }), " ", "\uD83D\uDC96"] }));
|
|
3
3
|
//# sourceMappingURL=Footer.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Footer.js","sourceRoot":"","sources":["../../src/components/Footer.tsx"],"names":[],"mappings":";AAEA,MAAM,CAAC,MAAM,UAAU,GAAO,GAAG,EAAE,CAAC,CAClC,eAAK,
|
|
1
|
+
{"version":3,"file":"Footer.js","sourceRoot":"","sources":["../../src/components/Footer.tsx"],"names":[],"mappings":";AAEA,MAAM,CAAC,MAAM,UAAU,GAAO,GAAG,EAAE,CAAC,CAClC,eAAK,SAAS,EAAC,aAAa,kDACF,GAAG,EAC3B,YACE,KAAK,EAAC,qFAAqF,EAC3F,IAAI,EAAC,+BAA+B,EACpC,MAAM,EAAC,KAAK,+BAGV,EAAC,GAAG,oBAEJ,CACP,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FormatSQL.d.ts","sourceRoot":"","sources":["../../src/components/FormatSQL.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,EAAO,MAAM,OAAO,CAAC;AAGrC,eAAO,MAAM,SAAS,EAAE,EAAE,CAAC;IAAE,GAAG,EAAE,MAAM,CAAA;CAAE,
|
|
1
|
+
{"version":3,"file":"FormatSQL.d.ts","sourceRoot":"","sources":["../../src/components/FormatSQL.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,EAAO,MAAM,OAAO,CAAC;AAGrC,eAAO,MAAM,SAAS,EAAE,EAAE,CAAC;IAAE,GAAG,EAAE,MAAM,CAAA;CAAE,CAiEzC,CAAC"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Fragment as _Fragment, jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
-
import { useCallback, useMemo, useState } from "react";
|
|
2
|
+
import { Fragment, useCallback, useMemo, useState } from "react";
|
|
3
3
|
export const FormatSQL = ({ sql }) => {
|
|
4
4
|
const [highlitIndex, setHighlitIndex] = useState(null);
|
|
5
5
|
const formattedSQL = useMemo(() => {
|
|
@@ -43,7 +43,7 @@ export const FormatSQL = ({ sql }) => {
|
|
|
43
43
|
display: "block",
|
|
44
44
|
marginLeft: "1.8rem",
|
|
45
45
|
textIndent: "-1.8rem",
|
|
46
|
-
}, children: parts }, i));
|
|
46
|
+
}, children: parts.map((p, i) => (_jsx(Fragment, { children: p }, i))) }, i));
|
|
47
47
|
}
|
|
48
48
|
return elements;
|
|
49
49
|
}, [sql, highlitIndex]);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FormatSQL.js","sourceRoot":"","sources":["../../src/components/FormatSQL.tsx"],"names":[],"mappings":";AACA,OAAO,EAAE,WAAW,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;
|
|
1
|
+
{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AAE,YAAY,CAAC,CAAC,CAAC;IACxB,OAAO,cAAK,SAAS,EAAC,aAAa,YAAE,YAAY,GAAO,CAAC;AAC3D,CAAC,CAAC;AAEF,MAAM,MAAM,GAAG;IACb,SAAS;IACT,SAAS;IACT,SAAS;IACT,SAAS;IACT,SAAS;IACT,SAAS;IACT,SAAS;IACT,SAAS;IACT,SAAS;IACT,SAAS;IACT,SAAS;CACV,CAAC;AAEF,MAAM,SAAS,GAKV,CAAC,EAAE,CAAC,EAAE,OAAO,EAAE,eAAe,EAAE,QAAQ,EAAE,EAAE,EAAE;IACjD,MAAM,KAAK,GAAG,MAAM,CAAC,CAAC,GAAG,MAAM,CAAC,MAAM,CAAC,CAAC;IACxC,MAAM,KAAK,GAAG,OAAO;QACnB,CAAC,CAAC;YACE,KAAK;YACL,YAAY,EAAE,KAAK;YACnB,UAAU,EAAE,KAAK;YACjB,eAAe,EACb,2DAA2D;SAC9D;QACH,CAAC,CAAC,EAAE,KAAK,EAAE,CAAC;IACd,MAAM,YAAY,GAAG,WAAW,CAAC,GAAG,EAAE;QACpC,eAAe,CAAC,CAAC,CAAC,CAAC;IACrB,CAAC,EAAE,CAAC,eAAe,EAAE,CAAC,CAAC,CAAC,CAAC;IACzB,MAAM,YAAY,GAAG,WAAW,CAAC,GAAG,EAAE;QACpC,eAAe,CAAC,IAAI,CAAC,CAAC;IACxB,CAAC,EAAE,CAAC,eAAe,CAAC,CAAC,CAAC;IACtB,OAAO,CACL,iBACE,KAAK,EAAE,KAAK,EACZ,YAAY,EAAE,YAAY,EAC1B,YAAY,EAAE,YAAY,YAEzB,QAAQ,GACF,CACV,CAAC;AACJ,CAAC,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Mermaid.d.ts","sourceRoot":"","sources":["../../src/components/Mermaid.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"Mermaid.d.ts","sourceRoot":"","sources":["../../src/components/Mermaid.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,SAAS,CAAC;AAC/C,OAAO,KAAK,EAAE,EAAE,EAAE,MAAM,OAAO,CAAC;AAIhC,eAAO,MAAM,OAAO,EAAE,EAAE,CAAC;IAAE,IAAI,EAAE,eAAe,CAAA;CAAE,CAYjD,CAAC"}
|
|
@@ -1,29 +1,7 @@
|
|
|
1
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
-
import {
|
|
3
|
-
|
|
4
|
-
let initialized = false;
|
|
2
|
+
import { lazy, Suspense } from "react";
|
|
3
|
+
const MermaidReal = lazy(() => import("./MermaidReal.js"));
|
|
5
4
|
export const Mermaid = ({ plan }) => {
|
|
6
|
-
|
|
7
|
-
useEffect(() => {
|
|
8
|
-
if (window.mermaid) {
|
|
9
|
-
if (!initialized) {
|
|
10
|
-
initialized = true;
|
|
11
|
-
window.mermaid.initialize({
|
|
12
|
-
startOnLoad: true,
|
|
13
|
-
maxTextSize: 1000000,
|
|
14
|
-
maxEdges: 1000,
|
|
15
|
-
});
|
|
16
|
-
}
|
|
17
|
-
if (diagram) {
|
|
18
|
-
window.mermaid.contentLoaded();
|
|
19
|
-
}
|
|
20
|
-
}
|
|
21
|
-
}, [diagram]);
|
|
22
|
-
if (window.mermaid) {
|
|
23
|
-
return (_jsx("div", { className: "mermaid", children: diagram }, diagram));
|
|
24
|
-
}
|
|
25
|
-
else {
|
|
26
|
-
return (_jsx("div", { children: "Mermaid hasn't (yet) loaded, so we cannot render plan diagrams" }));
|
|
27
|
-
}
|
|
5
|
+
return (_jsx(Suspense, { fallback: _jsx("div", { children: "Mermaid hasn't (yet) loaded, so we cannot render plan diagrams" }), children: _jsx(MermaidReal, { plan: plan }) }));
|
|
28
6
|
};
|
|
29
7
|
//# sourceMappingURL=Mermaid.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Mermaid.js","sourceRoot":"","sources":["../../src/components/Mermaid.tsx"],"names":[],"mappings":";
|
|
1
|
+
{"version":3,"file":"Mermaid.js","sourceRoot":"","sources":["../../src/components/Mermaid.tsx"],"names":[],"mappings":";AAEA,OAAO,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AACvC,MAAM,WAAW,GAAG,IAAI,CAAC,GAAG,EAAE,CAAC,MAAM,CAAC,kBAAkB,CAAC,CAAC,CAAC;AAE3D,MAAM,CAAC,MAAM,OAAO,GAAkC,CAAC,EAAE,IAAI,EAAE,EAAE,EAAE;IACjE,OAAO,CACL,KAAC,QAAQ,IACP,QAAQ,EACN,2FAEM,YAGR,KAAC,WAAW,IAAC,IAAI,EAAE,IAAI,GAAI,GAClB,CACZ,CAAC;AACJ,CAAC,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"MermaidReal.d.ts","sourceRoot":"","sources":["../../src/components/MermaidReal.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAC;AAGvD,OAAO,KAAK,EAAE,EAAE,EAAE,MAAM,OAAO,CAAC;AAKhC,QAAA,MAAM,WAAW,EAAE,EAAE,CAAC;IAAE,IAAI,EAAE,eAAe,CAAA;CAAE,CAoB9C,CAAC;AAEF,eAAe,WAAW,CAAC"}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { planToMermaid } from "grafast/mermaid";
|
|
3
|
+
import mermaid from "mermaid";
|
|
4
|
+
import { useEffect, useMemo } from "react";
|
|
5
|
+
let initialized = false;
|
|
6
|
+
const MermaidReal = ({ plan }) => {
|
|
7
|
+
const diagram = useMemo(() => planToMermaid(plan), [plan]);
|
|
8
|
+
useEffect(() => {
|
|
9
|
+
if (!initialized) {
|
|
10
|
+
initialized = true;
|
|
11
|
+
mermaid.initialize({
|
|
12
|
+
startOnLoad: true,
|
|
13
|
+
maxTextSize: 1000000,
|
|
14
|
+
maxEdges: 1000,
|
|
15
|
+
});
|
|
16
|
+
}
|
|
17
|
+
if (diagram) {
|
|
18
|
+
mermaid.contentLoaded();
|
|
19
|
+
}
|
|
20
|
+
}, [diagram]);
|
|
21
|
+
return (_jsx("div", { className: "mermaid", children: diagram }, diagram));
|
|
22
|
+
};
|
|
23
|
+
export default MermaidReal;
|
|
24
|
+
//# sourceMappingURL=MermaidReal.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"MermaidReal.js","sourceRoot":"","sources":["../../src/components/MermaidReal.tsx"],"names":[],"mappings":";AACA,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAChD,OAAO,OAAO,MAAM,SAAS,CAAC;AAE9B,OAAO,EAAE,SAAS,EAAE,OAAO,EAAE,MAAM,OAAO,CAAC;AAE3C,IAAI,WAAW,GAAG,KAAK,CAAC;AAExB,MAAM,WAAW,GAAkC,CAAC,EAAE,IAAI,EAAE,EAAE,EAAE;IAC9D,MAAM,OAAO,GAAG,OAAO,CAAC,GAAG,EAAE,CAAC,aAAa,CAAC,IAAI,CAAC,EAAE,CAAC,IAAI,CAAC,CAAC,CAAC;IAC3D,SAAS,CAAC,GAAG,EAAE;QACb,IAAI,CAAC,WAAW,EAAE,CAAC;YACjB,WAAW,GAAG,IAAI,CAAC;YACnB,OAAO,CAAC,UAAU,CAAC;gBACjB,WAAW,EAAE,IAAI;gBACjB,WAAW,EAAE,OAAO;gBACpB,QAAQ,EAAE,IAAI;aACf,CAAC,CAAC;QACL,CAAC;QACD,IAAI,OAAO,EAAE,CAAC;YACZ,OAAO,CAAC,aAAa,EAAE,CAAC;QAC1B,CAAC;IACH,CAAC,EAAE,CAAC,OAAO,CAAC,CAAC,CAAC;IACd,OAAO,CACL,cAAK,SAAS,EAAC,SAAS,YACrB,OAAO,IADoB,OAAO,CAE/B,CACP,CAAC;AACJ,CAAC,CAAC;AAEF,eAAe,WAAW,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useGraphQLChangeStream.d.ts","sourceRoot":"","sources":["../../src/hooks/useGraphQLChangeStream.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAElD,eAAO,MAAM,sBAAsB,GACjC,OAAO,SAAS,EAChB,SAAS,MAAM,IAAI,EACnB,gBAAgB,MAAM,GAAG,IAAI;;
|
|
1
|
+
{"version":3,"file":"useGraphQLChangeStream.d.ts","sourceRoot":"","sources":["../../src/hooks/useGraphQLChangeStream.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAElD,eAAO,MAAM,sBAAsB,GACjC,OAAO,SAAS,EAChB,SAAS,MAAM,IAAI,EACnB,gBAAgB,MAAM,GAAG,IAAI;;CA2D9B,CAAC"}
|
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
import { useEffect, useRef, useState } from "react";
|
|
2
2
|
export const useGraphQLChangeStream = (props, refetch, streamEndpoint) => {
|
|
3
|
+
const { eventSourceInit } = props;
|
|
3
4
|
const [error, setError] = useState(null);
|
|
4
5
|
const eventSourceRef = useRef(null);
|
|
5
6
|
// Starts listening to the event stream at the `sourceUrl`.
|
|
6
7
|
useEffect(() => {
|
|
7
8
|
eventSourceRef.current = streamEndpoint
|
|
8
|
-
? new EventSource(streamEndpoint,
|
|
9
|
+
? new EventSource(streamEndpoint, eventSourceInit)
|
|
9
10
|
: null;
|
|
10
11
|
const eventSource = eventSourceRef.current;
|
|
11
12
|
return () => {
|
|
@@ -17,7 +18,7 @@ export const useGraphQLChangeStream = (props, refetch, streamEndpoint) => {
|
|
|
17
18
|
eventSourceRef.current = null;
|
|
18
19
|
}
|
|
19
20
|
};
|
|
20
|
-
}, [streamEndpoint]);
|
|
21
|
+
}, [eventSourceInit, streamEndpoint]);
|
|
21
22
|
const eventSource = eventSourceRef.current;
|
|
22
23
|
useEffect(() => {
|
|
23
24
|
if (eventSource) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useGraphQLChangeStream.js","sourceRoot":"","sources":["../../src/hooks/useGraphQLChangeStream.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAIpD,MAAM,CAAC,MAAM,sBAAsB,GAAG,CACpC,KAAgB,EAChB,OAAmB,EACnB,cAA6B,EAC7B,EAAE;IACF,MAAM,CAAC,KAAK,EAAE,QAAQ,CAAC,GAAG,QAAQ,CAAe,IAAI,CAAC,CAAC;IAEvD,MAAM,cAAc,GAAG,MAAM,CAAqB,IAAI,CAAC,CAAC;IAExD,2DAA2D;IAC3D,SAAS,CAAC,GAAG,EAAE;QACb,cAAc,CAAC,OAAO,GAAG,cAAc;YACrC,CAAC,CAAC,IAAI,WAAW,CAAC,cAAc,EAAE,
|
|
1
|
+
{"version":3,"file":"useGraphQLChangeStream.js","sourceRoot":"","sources":["../../src/hooks/useGraphQLChangeStream.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAIpD,MAAM,CAAC,MAAM,sBAAsB,GAAG,CACpC,KAAgB,EAChB,OAAmB,EACnB,cAA6B,EAC7B,EAAE;IACF,MAAM,EAAE,eAAe,EAAE,GAAG,KAAK,CAAC;IAClC,MAAM,CAAC,KAAK,EAAE,QAAQ,CAAC,GAAG,QAAQ,CAAe,IAAI,CAAC,CAAC;IAEvD,MAAM,cAAc,GAAG,MAAM,CAAqB,IAAI,CAAC,CAAC;IAExD,2DAA2D;IAC3D,SAAS,CAAC,GAAG,EAAE;QACb,cAAc,CAAC,OAAO,GAAG,cAAc;YACrC,CAAC,CAAC,IAAI,WAAW,CAAC,cAAc,EAAE,eAAe,CAAC;YAClD,CAAC,CAAC,IAAI,CAAC;QACT,MAAM,WAAW,GAAG,cAAc,CAA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CAAC,OAAO,EAAE,OAAO,EAAE,KAAK,CAAC,CAAC;YAEtD,2DAA2D;YAC3D,OAAO,GAAG,EAAE;gBACV,WAAW,CAAC,mBAAmB,CAAC,QAAQ,EAAE,OAAO,EAAE,KAAK,CAAC,CAAC;gBAC1D,WAAW,CAAC,mBAAmB,CAAC,MAAM,EAAE,MAAM,EAAE,KAAK,CAAC,CAAC;gBACvD,WAAW,CAAC,mBAAmB,CAAC,OAAO,EAAE,OAAO,EAAE,KAAK,CAAC,CAAC;YAC3D,CAAC,CAAC;QACJ,CAAC;IACH,CAAC,EAAE,CAAC,KAAK,EAAE,WAAW,EAAE,OAAO,EAAE,cAAc,CAAC,CAAC,CAAC;IAClD,OAAO,EAAE,KAAK,EAAE,CAAC;AACnB,CAAC,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"usePrettify.d.ts","sourceRoot":"","sources":["../../src/hooks/usePrettify.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"usePrettify.d.ts","sourceRoot":"","sources":["../../src/hooks/usePrettify.tsx"],"names":[],"mappings":"AAQA;;;GAGG;AACH,eAAO,MAAM,WAAW,kBAsFvB,CAAC"}
|
|
@@ -1,29 +1,91 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { useCallback } from "react";
|
|
1
|
+
import { KEY_MAP, useGraphiQL, useGraphiQLActions } from "@graphiql/react";
|
|
2
|
+
import { useCallback, useEffect, useRef } from "react";
|
|
3
|
+
const sleep = (ms) => new Promise((resolve) => setTimeout(resolve, ms));
|
|
3
4
|
/**
|
|
4
5
|
* Prettifies with 'prettier' if available, otherwise using GraphiQL's built in
|
|
5
6
|
* prettify.
|
|
6
7
|
*/
|
|
7
8
|
export const usePrettify = () => {
|
|
8
|
-
const
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
9
|
+
const { queryEditor, variableEditor, headerEditor } = useGraphiQL(({ queryEditor, variableEditor, headerEditor }) => ({
|
|
10
|
+
queryEditor,
|
|
11
|
+
variableEditor,
|
|
12
|
+
headerEditor,
|
|
13
|
+
}));
|
|
14
|
+
const { prettifyEditors: fallbackPrettify } = useGraphiQLActions();
|
|
15
|
+
const prettierRef = useRef({
|
|
16
|
+
loaded: false,
|
|
17
|
+
prettier: null,
|
|
18
|
+
plugins: [],
|
|
19
|
+
});
|
|
20
|
+
const actualPrettify = useCallback(async () => {
|
|
21
|
+
const { prettier, plugins } = prettierRef.current;
|
|
22
|
+
if (!prettier ||
|
|
23
|
+
!plugins ||
|
|
24
|
+
!queryEditor ||
|
|
25
|
+
!variableEditor ||
|
|
26
|
+
!headerEditor) {
|
|
27
|
+
fallbackPrettify();
|
|
28
|
+
}
|
|
29
|
+
else {
|
|
30
|
+
for (const editor of [queryEditor, variableEditor, headerEditor]) {
|
|
31
|
+
const editorText = editor.getValue();
|
|
32
|
+
if (editorText != null) {
|
|
33
|
+
const position = editor.getPosition();
|
|
34
|
+
const model = editor.getModel();
|
|
35
|
+
const cursorOffset = position && model ? (model.getOffsetAt(position) ?? 0) : 0;
|
|
36
|
+
const parser = editor === queryEditor
|
|
37
|
+
? "graphql"
|
|
38
|
+
: editor === variableEditor || editor === headerEditor
|
|
39
|
+
? "jsonc"
|
|
40
|
+
: "json";
|
|
41
|
+
const result = await prettier.formatWithCursor(editorText, {
|
|
42
|
+
parser,
|
|
43
|
+
plugins,
|
|
44
|
+
cursorOffset,
|
|
45
|
+
});
|
|
46
|
+
editor.setValue(result.formatted);
|
|
47
|
+
if (model && result.cursorOffset > 0) {
|
|
48
|
+
editor.setPosition(model.getPositionAt(result.cursorOffset));
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
}
|
|
14
52
|
}
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
53
|
+
}, [fallbackPrettify, headerEditor, queryEditor, variableEditor]);
|
|
54
|
+
const prettify = useCallback(() => {
|
|
55
|
+
if (prettierRef.current.loaded === false) {
|
|
56
|
+
const promise = (async () => {
|
|
57
|
+
const [prettier, estree, babel, graphql] = await Promise.all([
|
|
58
|
+
import("prettier/standalone"),
|
|
59
|
+
import("prettier/plugins/estree"),
|
|
60
|
+
import("prettier/plugins/babel"),
|
|
61
|
+
import("prettier/plugins/graphql"),
|
|
62
|
+
]);
|
|
63
|
+
prettierRef.current.prettier = prettier;
|
|
64
|
+
prettierRef.current.plugins = [estree.default, babel, graphql];
|
|
65
|
+
prettierRef.current.loaded = true;
|
|
66
|
+
})();
|
|
67
|
+
prettierRef.current.loaded = promise;
|
|
68
|
+
// Wait up to 2 seconds for Prettier to load; failing that fall back to normal prettify
|
|
69
|
+
Promise.race([promise, sleep(2000)])
|
|
70
|
+
.catch(() => { })
|
|
71
|
+
.then(actualPrettify);
|
|
23
72
|
}
|
|
24
73
|
else {
|
|
25
|
-
|
|
74
|
+
actualPrettify();
|
|
26
75
|
}
|
|
27
|
-
}, [
|
|
76
|
+
}, [actualPrettify]);
|
|
77
|
+
useEffect(() => {
|
|
78
|
+
// const action = queryEditor?.getAction('graphql-prettify')
|
|
79
|
+
// Override existing action
|
|
80
|
+
const disposable = queryEditor?.addAction({
|
|
81
|
+
id: "graphql-prettify",
|
|
82
|
+
label: "Prettify Editors",
|
|
83
|
+
contextMenuGroupId: "graphql",
|
|
84
|
+
keybindings: KEY_MAP.prettify.keybindings,
|
|
85
|
+
run: prettify,
|
|
86
|
+
});
|
|
87
|
+
return () => disposable?.dispose();
|
|
88
|
+
}, [prettify, queryEditor]);
|
|
89
|
+
return prettify;
|
|
28
90
|
};
|
|
29
91
|
//# sourceMappingURL=usePrettify.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"usePrettify.js","sourceRoot":"","sources":["../../src/hooks/usePrettify.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"usePrettify.js","sourceRoot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|
|
1
1
|
export interface StoredKeys {
|
|
2
|
-
saveHeaders: "true" | "";
|
|
3
2
|
explain: "true" | "";
|
|
4
3
|
explorerIsOpen: "true" | "";
|
|
5
4
|
explainIsOpen: "true" | "";
|
|
6
5
|
explainAtBottom: "true" | "";
|
|
7
6
|
explainSize: string;
|
|
8
7
|
verbose: "true" | "";
|
|
8
|
+
condensed: "true" | "";
|
|
9
9
|
}
|
|
10
10
|
export interface RuruStorage {
|
|
11
11
|
get<TKey extends keyof StoredKeys>(key: TKey): StoredKeys[TKey] | null;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useStorage.d.ts","sourceRoot":"","sources":["../../src/hooks/useStorage.ts"],"names":[],"mappings":"AAEA,MAAM,WAAW,UAAU;IACzB,
|
|
1
|
+
{"version":3,"file":"useStorage.d.ts","sourceRoot":"","sources":["../../src/hooks/useStorage.ts"],"names":[],"mappings":"AAEA,MAAM,WAAW,UAAU;IACzB,OAAO,EAAE,MAAM,GAAG,EAAE,CAAC;IACrB,cAAc,EAAE,MAAM,GAAG,EAAE,CAAC;IAC5B,aAAa,EAAE,MAAM,GAAG,EAAE,CAAC;IAC3B,eAAe,EAAE,MAAM,GAAG,EAAE,CAAC;IAC7B,WAAW,EAAE,MAAM,CAAC;IACpB,OAAO,EAAE,MAAM,GAAG,EAAE,CAAC;IACrB,SAAS,EAAE,MAAM,GAAG,EAAE,CAAC;CACxB;AAcD,MAAM,WAAW,WAAW;IAC1B,GAAG,CAAC,IAAI,SAAS,MAAM,UAAU,EAAE,GAAG,EAAE,IAAI,GAAG,UAAU,CAAC,IAAI,CAAC,GAAG,IAAI,CAAC;IACvE,GAAG,CAAC,IAAI,SAAS,MAAM,UAAU,EAAE,GAAG,EAAE,IAAI,EAAE,KAAK,EAAE,UAAU,CAAC,IAAI,CAAC,GAAG,IAAI,CAAC;IAC7E,MAAM,CAAC,IAAI,SAAS,MAAM,UAAU,EAAE,GAAG,EAAE,IAAI,GAAG,IAAI,CAAC;CACxD;AAED,eAAO,MAAM,UAAU,QAAO,WA6C7B,CAAC"}
|
package/dist/hooks/useStorage.js
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { useMemo, useState } from "react";
|
|
2
2
|
const KEYS = {
|
|
3
|
-
saveHeaders: "Ruru:saveHeadersText",
|
|
4
3
|
explain: "Ruru:explain",
|
|
5
4
|
explainSize: "Ruru:explainSize",
|
|
6
5
|
explainIsOpen: "Ruru:explainIsOpen",
|
|
7
6
|
explainAtBottom: "Ruru:explainAtBottom",
|
|
8
7
|
explorerIsOpen: "graphiql:explorerIsOpen",
|
|
9
8
|
verbose: "Ruru:verbose",
|
|
9
|
+
condensed: "Ruru:condensed",
|
|
10
10
|
};
|
|
11
11
|
const up = (v) => v + 1;
|
|
12
12
|
export const useStorage = () => {
|
|
@@ -44,7 +44,8 @@ export const useStorage = () => {
|
|
|
44
44
|
bump(up);
|
|
45
45
|
},
|
|
46
46
|
toggle(key) {
|
|
47
|
-
|
|
47
|
+
const val = this.get(key);
|
|
48
|
+
if (val || (val == null && key === "condensed")) {
|
|
48
49
|
this.set(key, "");
|
|
49
50
|
}
|
|
50
51
|
else {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useStorage.js","sourceRoot":"","sources":["../../src/hooks/useStorage.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAY1C,MAAM,IAAI,GAA0C;IAClD,
|
|
1
|
+
{"version":3,"file":"useStorage.js","sourceRoot":"","sources":["../../src/hooks/useStorage.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAY1C,MAAM,IAAI,GAA0C;IAClD,OAAO,EAAE,cAAc;IACvB,WAAW,EAAE,kBAAkB;IAC/B,aAAa,EAAE,oBAAoB;IACnC,eAAe,EAAE,sBAAsB;IACvC,cAAc,EAAE,yBAAyB;IACzC,OAA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,CAAC,CAAC,CAAC;oBAC9B,OAAO,IAAI,CAAC;gBACd,CAAC;gBACD,OAAO,GAAG,IAAI,IAAI,CAAC;YACrB,CAAC;YACD,GAAG,CAAC,GAAG,EAAE,KAAK;gBACZ,OAAO,CAAC,OAAO,CAAC,IAAI,CAAC,GAAG,CAAC,EAAE,KAAK,CAAC,CAAC;gBAClC,IAAI,CAAC,EAAE,CAAC,CAAC;YACX,CAAC;YACD,MAAM,CAAC,GAAG;gBACR,MAAM,GAAG,GAAG,IAAI,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;gBAC1B,IAAI,GAAG,IAAI,CAAC,GAAG,IAAI,IAAI,IAAI,GAAG,KAAK,WAAW,CAAC,EAAE,CAAC;oBAChD,IAAI,CAAC,GAAG,CAAC,GAAG,EAAE,EAAE,CAAC,CAAC;gBACpB,CAAC;qBAAM,CAAC;oBACN,IAAI,CAAC,GAAG,CAAC,GAAG,EAAE,MAAM,CAAC,CAAC;gBACxB,CAAC;YACH,CAAC;SACF,CAAC;IACJ,CAAC,EAAE,CAAC,OAAO,EAAE,QAAQ,EAAE,KAAK,CAAC,CAAC,CAAC;AACjC,CAAC,CAAC"}
|
package/dist/interfaces.d.ts
CHANGED
|
@@ -8,7 +8,7 @@ export { Fetcher };
|
|
|
8
8
|
*/
|
|
9
9
|
interface RuruEventSourceInit extends EventSourceInit, Record<string, any> {
|
|
10
10
|
}
|
|
11
|
-
export interface RuruProps {
|
|
11
|
+
export interface RuruProps extends Pick<GraphiQLProps, "editorTheme" | "defaultTheme" | "maxHistoryLength" | "inputValueDeprecation" | "schemaDescription" | "showPersistHeadersSettings" | "onEditQuery" | "onEditVariables" | "onEditHeaders" | "responseTooltip" | "defaultEditorToolsVisibility" | "isHeadersEditorEnabled" | "forcedTheme" | "confirmCloseTab" | "className" | "initialVariables" | "initialQuery" | "initialHeaders" | "defaultQuery" | "defaultHeaders"> {
|
|
12
12
|
/**
|
|
13
13
|
* Optionally override the fetcher.
|
|
14
14
|
*/
|
|
@@ -21,7 +21,6 @@ export interface RuruProps {
|
|
|
21
21
|
* The URL to the GraphQL subscriptions endpoint. (ws:// or wss://)
|
|
22
22
|
*/
|
|
23
23
|
subscriptionEndpoint?: string;
|
|
24
|
-
editorTheme?: GraphiQLProps["editorTheme"];
|
|
25
24
|
/**
|
|
26
25
|
* The list of debug tools available to the user.
|
|
27
26
|
*
|
|
@@ -29,34 +28,6 @@ export interface RuruProps {
|
|
|
29
28
|
* plan - output the plan executed
|
|
30
29
|
*/
|
|
31
30
|
debugTools?: Array<"explain" | "plan">;
|
|
32
|
-
/**
|
|
33
|
-
* The query to use when the user has never visited the page before (unless `initialQuery` is set).
|
|
34
|
-
*/
|
|
35
|
-
defaultQuery?: string;
|
|
36
|
-
/**
|
|
37
|
-
* @deprecated Use `query` instead
|
|
38
|
-
*/
|
|
39
|
-
initialQuery?: string;
|
|
40
|
-
/**
|
|
41
|
-
* @deprecated Use `variables` instead
|
|
42
|
-
*/
|
|
43
|
-
initialVariables?: string;
|
|
44
|
-
/**
|
|
45
|
-
* The query to prepopulate the editor with.
|
|
46
|
-
*/
|
|
47
|
-
query?: string;
|
|
48
|
-
/**
|
|
49
|
-
* The variables to prepopulate the editor with.
|
|
50
|
-
*/
|
|
51
|
-
variables?: string;
|
|
52
|
-
/**
|
|
53
|
-
* Callback executed when the current query changes.
|
|
54
|
-
*/
|
|
55
|
-
onEditQuery?: GraphiQLProps["onEditQuery"];
|
|
56
|
-
/**
|
|
57
|
-
* Callback executed when the variables change.
|
|
58
|
-
*/
|
|
59
|
-
onEditVariables?: GraphiQLProps["onEditVariables"];
|
|
60
31
|
/**
|
|
61
32
|
* Will be passed to `new EventSource(url, eventSourceInit)`.
|
|
62
33
|
*
|
package/dist/interfaces.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"interfaces.d.ts","sourceRoot":"","sources":["../src/interfaces.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,mBAAmB,CAAC;AACjD,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AAE9C,OAAO,EAAE,OAAO,EAAE,CAAC;AAEnB;;;;GAIG;AACH,UAAU,mBAAoB,SAAQ,eAAe,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC;CAAG;AAE7E,MAAM,WAAW,
|
|
1
|
+
{"version":3,"file":"interfaces.d.ts","sourceRoot":"","sources":["../src/interfaces.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,mBAAmB,CAAC;AACjD,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AAE9C,OAAO,EAAE,OAAO,EAAE,CAAC;AAEnB;;;;GAIG;AACH,UAAU,mBAAoB,SAAQ,eAAe,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC;CAAG;AAE7E,MAAM,WAAW,SACf,SAAQ,IAAI,CACV,aAAa,EACX,aAAa,GACb,cAAc,GACd,kBAAkB,GAClB,uBAAuB,GACvB,mBAAmB,GACnB,4BAA4B,GAC5B,aAAa,GACb,iBAAiB,GACjB,eAAe,GACf,iBAAiB,GACjB,8BAA8B,GAC9B,wBAAwB,GACxB,aAAa,GACb,iBAAiB,GACjB,WAAW,GACX,kBAAkB,GAClB,cAAc,GACd,gBAAgB,GAChB,cAAc,GACd,gBAAgB,CACnB;IACD;;OAEG;IACH,OAAO,CAAC,EAAE,OAAO,CAAC;IAElB;;OAEG;IACH,QAAQ,CAAC,EAAE,MAAM,CAAC;IAElB;;OAEG;IACH,oBAAoB,CAAC,EAAE,MAAM,CAAC;IAE9B;;;;;OAKG;IACH,UAAU,CAAC,EAAE,KAAK,CAAC,SAAS,GAAG,MAAM,CAAC,CAAC;IAEvC;;;;;;;;OAQG;IACH,eAAe,CAAC,EAAE,mBAAmB,CAAC;CACvC"}
|
package/dist/ruru.d.ts
CHANGED
|
@@ -1,15 +1,24 @@
|
|
|
1
|
-
import
|
|
2
|
-
import type { FC } from "react";
|
|
1
|
+
import { GraphiQLInterface } from "graphiql";
|
|
2
|
+
import type { ComponentProps, FC } from "react";
|
|
3
3
|
import type { RuruStorage } from "./hooks/useStorage.js";
|
|
4
4
|
import type { RuruProps } from "./interfaces.js";
|
|
5
|
+
type GraphiQLInterfaceProps = ComponentProps<typeof GraphiQLInterface>;
|
|
5
6
|
export declare const Ruru: FC<RuruProps>;
|
|
6
7
|
export declare const RuruInner: FC<{
|
|
7
|
-
editorTheme?: string;
|
|
8
8
|
storage: RuruStorage;
|
|
9
9
|
error: Error | null;
|
|
10
10
|
setError: React.Dispatch<React.SetStateAction<Error | null>>;
|
|
11
|
-
onEditQuery?: GraphiQLProps["onEditQuery"];
|
|
12
|
-
onEditVariables?: GraphiQLProps["onEditVariables"];
|
|
13
11
|
streamEndpoint: string | null;
|
|
12
|
+
showPersistHeadersSettings?: GraphiQLInterfaceProps["showPersistHeadersSettings"];
|
|
13
|
+
onEditQuery?: GraphiQLInterfaceProps["onEditQuery"];
|
|
14
|
+
onEditVariables?: GraphiQLInterfaceProps["onEditVariables"];
|
|
15
|
+
onEditHeaders?: GraphiQLInterfaceProps["onEditHeaders"];
|
|
16
|
+
responseTooltip?: GraphiQLInterfaceProps["responseTooltip"];
|
|
17
|
+
defaultEditorToolsVisibility?: GraphiQLInterfaceProps["defaultEditorToolsVisibility"];
|
|
18
|
+
isHeadersEditorEnabled?: GraphiQLInterfaceProps["isHeadersEditorEnabled"];
|
|
19
|
+
forcedTheme?: GraphiQLInterfaceProps["forcedTheme"];
|
|
20
|
+
confirmCloseTab?: GraphiQLInterfaceProps["confirmCloseTab"];
|
|
21
|
+
className?: GraphiQLInterfaceProps["className"];
|
|
14
22
|
}>;
|
|
23
|
+
export {};
|
|
15
24
|
//# sourceMappingURL=ruru.d.ts.map
|
package/dist/ruru.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ruru.d.ts","sourceRoot":"","sources":["../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E,sBAAsB,CAAC,iBAAiB,CAAC,CAAC;IAC5D,SAAS,CAAC,EAAE,sBAAsB,CAAC,WAAW,CAAC,CAAC;CACjD,CAiGA,CAAC"}
|
package/dist/ruru.js
CHANGED
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
2
|
+
import { DOC_EXPLORER_PLUGIN, DocExplorerStore, } from "@graphiql/plugin-doc-explorer";
|
|
2
3
|
import { explorerPlugin as makeExplorerPlugin } from "@graphiql/plugin-explorer";
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
4
|
+
import { HISTORY_PLUGIN, HistoryStore } from "@graphiql/plugin-history";
|
|
5
|
+
import { CopyIcon, GraphiQLProvider, MergeIcon, PrettifyIcon, SettingsIcon, ToolbarButton, ToolbarMenu, useGraphiQLActions, } from "@graphiql/react";
|
|
6
|
+
import { GraphiQL, GraphiQLInterface } from "graphiql";
|
|
7
|
+
import { useCallback, useMemo, useState } from "react";
|
|
6
8
|
import { ErrorPopup } from "./components/ErrorPopup.js";
|
|
7
9
|
import { RuruFooter } from "./components/Footer.js";
|
|
8
10
|
import { defaultQuery as DEFAULT_QUERY } from "./defaultQuery.js";
|
|
@@ -12,65 +14,55 @@ import { useGraphQLChangeStream } from "./hooks/useGraphQLChangeStream.js";
|
|
|
12
14
|
import { usePrettify } from "./hooks/usePrettify.js";
|
|
13
15
|
import { useStorage } from "./hooks/useStorage.js";
|
|
14
16
|
import { EXPLAIN_PLUGIN } from "./plugins/explain.js";
|
|
15
|
-
if (GP2 !== GraphiQLProvider) {
|
|
16
|
-
throw new Error("PACKAGE MANAGEMENT ERROR! The providers don't match up!");
|
|
17
|
-
}
|
|
18
17
|
const checkCss = { width: "1.5rem", display: "inline-block" };
|
|
19
18
|
const check = _jsx("span", { style: checkCss, children: "\u2714" });
|
|
20
19
|
const nocheck = _jsx("span", { style: checkCss });
|
|
21
20
|
const explorerPlugin = makeExplorerPlugin({
|
|
22
21
|
showAttribution: false,
|
|
23
22
|
});
|
|
24
|
-
const plugins = [
|
|
23
|
+
const plugins = [
|
|
24
|
+
DOC_EXPLORER_PLUGIN,
|
|
25
|
+
HISTORY_PLUGIN,
|
|
26
|
+
explorerPlugin,
|
|
27
|
+
EXPLAIN_PLUGIN,
|
|
28
|
+
];
|
|
25
29
|
export const Ruru = (props) => {
|
|
30
|
+
const { inputValueDeprecation, schemaDescription, defaultQuery, showPersistHeadersSettings,
|
|
31
|
+
// Things we're handling elsewhere
|
|
32
|
+
fetcher: _fetcher, debugTools: _debugTools,
|
|
33
|
+
// Deprecated stuff
|
|
34
|
+
["query"]: _query, ["variables"]: _variables,
|
|
35
|
+
// Pass everything else through to GraphiQL
|
|
36
|
+
...otherProps } = props;
|
|
26
37
|
const storage = useStorage();
|
|
27
38
|
const explain = storage.get("explain") === "true";
|
|
28
39
|
const verbose = storage.get("verbose") === "true";
|
|
29
|
-
const
|
|
30
|
-
const setExplain = useCallback((newExplain) => {
|
|
31
|
-
storage.set("explain", newExplain ? "true" : "");
|
|
32
|
-
}, [storage]);
|
|
40
|
+
const setExplain = useCallback((newExplain) => void storage.set("explain", newExplain ? "true" : ""), [storage]);
|
|
33
41
|
const { fetcher, explainResults, streamEndpoint } = useFetcher(props, {
|
|
34
42
|
explain,
|
|
35
43
|
verbose,
|
|
36
44
|
});
|
|
37
45
|
const [error, setError] = useState(null);
|
|
38
46
|
const explainHelpers = useExplain(storage);
|
|
39
|
-
const
|
|
40
|
-
return (
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
47
|
+
const explainContextValue = useMemo(() => ({ explain, explainHelpers, explainResults, setExplain }), [explain, explainHelpers, explainResults, setExplain]);
|
|
48
|
+
return (_jsx(GraphiQLProvider, { ...otherProps, inputValueDeprecation: inputValueDeprecation ?? true, schemaDescription: schemaDescription ?? true, fetcher: fetcher, defaultQuery: defaultQuery ?? DEFAULT_QUERY, plugins: plugins, children: _jsx(ExplainContext.Provider, { value: explainContextValue, children: _jsx(HistoryStore, { maxHistoryLength: props.maxHistoryLength, children: _jsx(DocExplorerStore, { children: _jsx(RuruInner, { ...otherProps, showPersistHeadersSettings: showPersistHeadersSettings ?? true,
|
|
49
|
+
// onEditQuery={props.onEditQuery}
|
|
50
|
+
// onEditVariables={props.onEditVariables}
|
|
51
|
+
// onEditHeaders={props.onEditHeaders}
|
|
52
|
+
// responseTooltip={props.responseTooltip}
|
|
53
|
+
// defaultEditorToolsVisibility={props.defaultEditorToolsVisibility}
|
|
54
|
+
// isHeadersEditorEnabled={props.isHeadersEditorEnabled}
|
|
55
|
+
// forcedTheme={props.forcedTheme}
|
|
56
|
+
// confirmCloseTab={props.confirmCloseTab}
|
|
57
|
+
// className={props.className}
|
|
58
|
+
storage: storage, error: error, setError: setError, streamEndpoint: streamEndpoint }) }) }) }) }));
|
|
48
59
|
};
|
|
49
60
|
export const RuruInner = (props) => {
|
|
50
|
-
const { storage,
|
|
61
|
+
const { storage, error, setError, streamEndpoint, ...graphiqlInterfaceProps } = props;
|
|
51
62
|
const prettify = usePrettify();
|
|
52
|
-
const mergeQuery =
|
|
53
|
-
const copyQuery = useCopyQuery();
|
|
54
|
-
const introspect = useSchemaStore((s) => s.introspect);
|
|
63
|
+
const { copyQuery, mergeQuery, introspect } = useGraphiQLActions();
|
|
55
64
|
useGraphQLChangeStream(props, introspect, streamEndpoint);
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
width: "100%",
|
|
59
|
-
height: "100%",
|
|
60
|
-
display: "flex",
|
|
61
|
-
flexDirection: "column",
|
|
62
|
-
overflow: "hidden",
|
|
63
|
-
}, children: [_jsx("div", { style: {
|
|
64
|
-
display: "flex",
|
|
65
|
-
flex: "1 1 100%",
|
|
66
|
-
overflow: "hidden",
|
|
67
|
-
position: "relative",
|
|
68
|
-
}, children: _jsxs(GraphiQLInterface, { editorTheme: editorTheme ?? "graphiql", onEditQuery: onEditQuery, onEditVariables: onEditVariables, children: [_jsx(GraphiQL.Logo, { children: _jsx("a", { href: "https://grafast.org/ruru", style: { textDecoration: "none" }, target: "_blank", rel: "noreferrer", children: "Ruru" }) }), _jsx(GraphiQL.Toolbar, { children: () => (_jsxs(_Fragment, { children: [_jsx(ToolbarButton, { onClick: prettify, label: "Prettify Query (Shift-Ctrl-P)", children: _jsx(PrettifyIcon, { className: "graphiql-toolbar-icon", "aria-hidden": "true" }) }), _jsx(ToolbarButton, { onSelect: mergeQuery, label: "Merge Query (Shift-Ctrl-M)", children: _jsx(MergeIcon, { className: "graphiql-toolbar-icon", "aria-hidden": "true" }) }), _jsx(ToolbarButton, { onClick: copyQuery, label: "Copy query (Shift-Ctrl-C)", children: _jsx(CopyIcon, { className: "graphiql-toolbar-icon", "aria-hidden": "true" }) }), _jsxs(ToolbarMenu, { label: "Options", button: _jsx("div", { style: {
|
|
69
|
-
width: "100%",
|
|
70
|
-
height: "100%",
|
|
71
|
-
display: "flex",
|
|
72
|
-
justifyContent: "center",
|
|
73
|
-
alignItems: "center",
|
|
74
|
-
}, children: _jsx(SettingsIcon, { className: "graphiql-toolbar-icon", "aria-hidden": "true" }) }), children: [_jsx(ToolbarMenu.Item, { title: "View the SQL statements that this query invokes", onSelect: () => storage.toggle("explain"), children: _jsxs("span", { children: [storage.get("explain") === "true" ? check : nocheck, "Explain (if supported)"] }) }), _jsx(ToolbarMenu.Item, { title: "Don't hide explain from results", onSelect: () => storage.toggle("verbose"), children: _jsxs("span", { children: [storage.get("verbose") === "true" ? check : nocheck, "Verbose"] }) }), _jsx(ToolbarMenu.Item, { title: "Should we persist the headers to localStorage? Header editor is next to variable editor at the bottom.", onSelect: () => storage.toggle("saveHeaders"), children: _jsxs("span", { children: [storage.get("saveHeaders") === "true" ? check : nocheck, "Save headers"] }) })] })] })) }), _jsx(GraphiQL.Footer, { children: _jsx(RuruFooter, {}) })] }) }), error ? (_jsx(ErrorPopup, { error: error, onClose: () => setError(null) })) : null] }));
|
|
65
|
+
const condensed = storage.get("condensed") !== "";
|
|
66
|
+
return (_jsxs(_Fragment, { children: [_jsxs(GraphiQLInterface, { ...graphiqlInterfaceProps, className: `${graphiqlInterfaceProps.className ?? ""}${condensed ? " condensed" : ""}`, children: [_jsx(GraphiQL.Logo, { children: _jsx("a", { href: "https://grafast.org/ruru", style: { textDecoration: "none" }, target: "_blank", rel: "noreferrer", children: "Ruru" }) }), _jsxs(GraphiQL.Toolbar, { children: [_jsx(ToolbarButton, { onClick: prettify, label: "Prettify Query (Shift-Ctrl-P)", children: _jsx(PrettifyIcon, { className: "graphiql-toolbar-icon", "aria-hidden": "true" }) }), _jsx(ToolbarButton, { onSelect: mergeQuery, label: "Merge Query (Shift-Ctrl-M)", children: _jsx(MergeIcon, { className: "graphiql-toolbar-icon", "aria-hidden": "true" }) }), _jsx(ToolbarButton, { onClick: copyQuery, label: "Copy query (Shift-Ctrl-C)", children: _jsx(CopyIcon, { className: "graphiql-toolbar-icon", "aria-hidden": "true" }) }), _jsxs(ToolbarMenu, { button: _jsx(ToolbarButton, { label: "Options", children: _jsx(SettingsIcon, { className: "graphiql-toolbar-icon", "aria-hidden": "true" }) }), children: [_jsx(ToolbarMenu.Item, { title: "View the SQL statements that this query invokes", onSelect: () => storage.toggle("explain"), children: _jsxs("span", { children: [storage.get("explain") === "true" ? check : nocheck, "Explain (if supported)"] }) }), _jsx(ToolbarMenu.Item, { title: "Don't hide explain from results", onSelect: () => storage.toggle("verbose"), children: _jsxs("span", { children: [storage.get("verbose") === "true" ? check : nocheck, "Verbose"] }) }), _jsx(ToolbarMenu.Item, { title: "Condensed", onSelect: () => storage.toggle("condensed"), children: _jsxs("span", { children: [storage.get("condensed") !== "" ? check : nocheck, "Condensed"] }) })] })] }), _jsx(GraphiQL.Footer, { children: _jsx(RuruFooter, {}) })] }), error ? (_jsx(ErrorPopup, { error: error, onClose: () => setError(null) })) : null] }));
|
|
75
67
|
};
|
|
76
68
|
//# sourceMappingURL=ruru.js.map
|
package/dist/ruru.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ruru.js","sourceRoot":"","sources":["../src/ruru.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,cAAc,IAAI,kBAAkB,EAAE,MAAM,2BAA2B,CAAC;AACjF,OAAO,EACL,QAAQ,EACR,gBAAgB,
|
|
1
|
+
{"version":3,"file":"ruru.js","sourceRoot":"","sources":["../src/ruru.tsx"],"names":[],"mappings":";AAAA,OAAO,EACL,mBAAmB,EACnB,gBAAgB,GACjB,MAAM,+BAA+B,CAAC;AACvC,OAAO,EAAE,cAAc,IAAI,kBAAkB,EAAE,MAAM,2BAA2B,CAAC;AACjF,OAAO,EAAE,cAAc,EAAE,YAAY,EAAE,MAAM,0BAA0B,CAAC;AACxE,OAAO,EACL,QAAQ,EACR,gBAAgB,EAChB,SAAS,EACT,YAAY,EACZ,YAAY,EACZ,aAAa,EACb,WAAW,EACX,kBAAkB,GACnB,MAAM,iBAAiB,CAAC;AACzB,OAAO,EAAE,QAAQ,EAAE,iBAAiB,EAAE,MAAM,UAAU,CAAC;AAEvD,OAAO,EAAE,WAAW,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAEvD,OAAO,EAAE,UAAU,EAAE,MAAM,4BAA4B,CAAC;AACxD,OAAO,EAAE,UAAU,EAAE,MAAM,wBAAwB,CAAC;AACpD,OAAO,EAAE,YAAY,IAAI,aAAa,EAAE,MAAM,mBAAmB,CAAC;AAClE,OAAO,EAAE,cAAc,EAAE,UAAU,EAAE,MAAM,uBAAuB,CAAC;AACnE,OAAO,EAAE,UAAU,EAAE,MAAM,uBAAuB,CAAC;AACnD,OAAO,EAAE,sBAAsB,EAAE,MAAM,mCAAmC,CAAC;AAC3E,OAAO,EAAE,WAAW,EAAE,MAAM,wBAAwB,CAAC;AAErD,OAAO,EAAE,UAAU,EAAE,MAAM,uBAAuB,CAAC;AAEnD,O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,GACY,aAGlB,KAAC,WAAW,CAAC,IAAI,IACf,KAAK,EAAC,iDAAiD,EACvD,QAAQ,EAAE,GAAG,EAAE,CAAC,OAAO,CAAC,MAAM,CAAC,SAAS,CAAC,YAEzC,2BACG,OAAO,CAAC,GAAG,CAAC,SAAS,CAAC,KAAK,MAAM,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,OAAO,8BAE/C,GACU,EACnB,KAAC,WAAW,CAAC,IAAI,IACf,KAAK,EAAC,iCAAiC,EACvC,QAAQ,EAAE,GAAG,EAAE,CAAC,OAAO,CAAC,MAAM,CAAC,SAAS,CAAC,YAEzC,2BACG,OAAO,CAAC,GAAG,CAAC,SAAS,CAAC,KAAK,MAAM,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,OAAO,eAE/C,GACU,EACnB,KAAC,WAAW,CAAC,IAAI,IACf,KAAK,EAAC,WAAW,EACjB,QAAQ,EAAE,GAAG,EAAE,CAAC,OAAO,CAAC,MAAM,CAAC,WAAW,CAAC,YAE3C,2BACG,OAAO,CAAC,GAAG,CAAC,WAAW,CAAC,KAAK,EAAE,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,OAAO,iBAE7C,GACU,IACP,IACG,EAEnB,KAAC,QAAQ,CAAC,MAAM,cACd,KAAC,UAAU,KAAG,GACE,IACA,EACnB,KAAK,CAAC,CAAC,CAAC,CACP,KAAC,UAAU,IAAC,KAAK,EAAE,KAAK,EAAE,OAAO,EAAE,GAAG,EAAE,CAAC,QAAQ,CAAC,IAAI,CAAC,GAAI,CAC5D,CAAC,CAAC,CAAC,IAAI,IACP,CACJ,CAAC;AACJ,CAAC,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "ruru-components",
|
|
3
|
-
"version": "2.0.0-beta.
|
|
3
|
+
"version": "2.0.0-beta.34",
|
|
4
4
|
"description": "Grafast-flavoured GraphiQL distribution; the underlying React components",
|
|
5
5
|
"main": "./dist/index.js",
|
|
6
6
|
"type": "module",
|
|
@@ -38,13 +38,17 @@
|
|
|
38
38
|
},
|
|
39
39
|
"homepage": "https://grafast.org/ruru/",
|
|
40
40
|
"dependencies": {
|
|
41
|
-
"@graphiql/plugin-explorer": "^4.
|
|
42
|
-
"@graphiql/
|
|
41
|
+
"@graphiql/plugin-doc-explorer": "^0.4.1",
|
|
42
|
+
"@graphiql/plugin-explorer": "^5.1.1",
|
|
43
|
+
"@graphiql/plugin-history": "^0.4.1",
|
|
44
|
+
"@graphiql/react": "^0.37.1",
|
|
43
45
|
"@graphiql/toolkit": "^0.11.3",
|
|
44
|
-
"@types/node": "^22.
|
|
45
|
-
"grafast": "^0.1.1-beta.
|
|
46
|
-
"graphiql": "^
|
|
46
|
+
"@types/node": "^22.16.3",
|
|
47
|
+
"grafast": "^0.1.1-beta.25",
|
|
48
|
+
"graphiql": "^5.2.0",
|
|
47
49
|
"graphql-ws": "^6.0.5",
|
|
50
|
+
"mermaid": "^11.8.1",
|
|
51
|
+
"prettier": "^3.6.2",
|
|
48
52
|
"react": "^19.1.0",
|
|
49
53
|
"react-dom": "^19.1.0",
|
|
50
54
|
"tslib": "^2.8.1"
|
|
@@ -74,7 +78,7 @@
|
|
|
74
78
|
"@types/react": "^19.1.8",
|
|
75
79
|
"@types/react-dom": "^19.1.6",
|
|
76
80
|
"graphql": "16.1.0-experimental-stream-defer.6",
|
|
77
|
-
"jest": "^30.0.
|
|
81
|
+
"jest": "^30.0.4",
|
|
78
82
|
"nodemon": "^3.1.10",
|
|
79
83
|
"typescript": "^5.8.3"
|
|
80
84
|
}
|
package/ruru.css
CHANGED
|
@@ -76,3 +76,163 @@
|
|
|
76
76
|
font-size: 0.75rem;
|
|
77
77
|
white-space: pre-wrap;
|
|
78
78
|
}
|
|
79
|
+
|
|
80
|
+
.ruru-footer {
|
|
81
|
+
padding: var(--px-16) var(--px-8);
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
/* Ruru overrides for GraphiQL styles */
|
|
85
|
+
|
|
86
|
+
.graphiql-explorer-root input {
|
|
87
|
+
/* Fixes 'ch' unit inputs so text isn't truncated */
|
|
88
|
+
font-family: var(--font-family-mono);
|
|
89
|
+
padding: 0;
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
.graphiql-container {
|
|
93
|
+
button,
|
|
94
|
+
button:focus {
|
|
95
|
+
outline: 0;
|
|
96
|
+
}
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
/* condensed layout */
|
|
100
|
+
.graphiql-container.condensed {
|
|
101
|
+
--sidebar-width: 40px;
|
|
102
|
+
--line-height: 1.25;
|
|
103
|
+
--session-header-height: 34.5px;
|
|
104
|
+
--font-size-caption: 1rem;
|
|
105
|
+
--toolbar-width: 30px;
|
|
106
|
+
|
|
107
|
+
button.graphiql-execute-button > svg {
|
|
108
|
+
width: 12px;
|
|
109
|
+
height: 12px;
|
|
110
|
+
}
|
|
111
|
+
.graphiql-toolbar-icon {
|
|
112
|
+
width: calc(var(--toolbar-width) - 10px);
|
|
113
|
+
height: calc(var(--toolbar-width) - 10px);
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
.graphiql-sessions {
|
|
117
|
+
border-radius: 0;
|
|
118
|
+
margin: 0;
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
.graphiql-plugin {
|
|
122
|
+
padding: var(--px-8) var(--px-12);
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
.graphiql-explorer-graphql-arguments > div > span > svg {
|
|
126
|
+
margin-top: 3px;
|
|
127
|
+
margin-bottom: -3px;
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
.graphiql-editor-tools {
|
|
131
|
+
padding: 0;
|
|
132
|
+
}
|
|
133
|
+
.graphiql-tabs {
|
|
134
|
+
border-radius: 0;
|
|
135
|
+
padding: 0;
|
|
136
|
+
}
|
|
137
|
+
.graphiql-editor-tools > button:not(.graphiql-toggle-editor-tools) {
|
|
138
|
+
padding: var(--px-4) var(--px-8);
|
|
139
|
+
}
|
|
140
|
+
.graphiql-editor-tools > button,
|
|
141
|
+
.graphiql-tab {
|
|
142
|
+
outline: 0;
|
|
143
|
+
border-bottom: 3px solid transparent;
|
|
144
|
+
border-top: 3px solid transparent;
|
|
145
|
+
border-radius: 0;
|
|
146
|
+
}
|
|
147
|
+
.graphiql-editor-tools > button.active,
|
|
148
|
+
.graphiql-tab.graphiql-tab-active {
|
|
149
|
+
border-bottom-color: hsl(var(--color-primary));
|
|
150
|
+
}
|
|
151
|
+
.graphiql-tab {
|
|
152
|
+
background: none;
|
|
153
|
+
&:hover {
|
|
154
|
+
background-color: hsla(
|
|
155
|
+
var(--color-neutral),
|
|
156
|
+
var(--alpha-background-light)
|
|
157
|
+
);
|
|
158
|
+
}
|
|
159
|
+
&.graphiql-tab-active {
|
|
160
|
+
background-color: var(--bg);
|
|
161
|
+
}
|
|
162
|
+
}
|
|
163
|
+
.graphiql-query-editor,
|
|
164
|
+
.graphiql-editor-tool {
|
|
165
|
+
padding: var(--px-8);
|
|
166
|
+
}
|
|
167
|
+
.graphiql-query-editor {
|
|
168
|
+
column-gap: var(--px-8);
|
|
169
|
+
}
|
|
170
|
+
|
|
171
|
+
.graphiql-session-header,
|
|
172
|
+
#graphiql-session {
|
|
173
|
+
padding: 0;
|
|
174
|
+
padding-right: var(--px-8);
|
|
175
|
+
height: initial;
|
|
176
|
+
}
|
|
177
|
+
.graphiql-horizontal-drag-bar {
|
|
178
|
+
background-color: hsla(var(--color-neutral), var(--alpha-background-light));
|
|
179
|
+
width: var(--px-8);
|
|
180
|
+
}
|
|
181
|
+
#graphiql-session .graphiql-horizontal-drag-bar {
|
|
182
|
+
background-color: transparent;
|
|
183
|
+
}
|
|
184
|
+
.graphiql-editors {
|
|
185
|
+
box-shadow: none;
|
|
186
|
+
border-radius: 0;
|
|
187
|
+
border-top-right-radius: 13px;
|
|
188
|
+
}
|
|
189
|
+
.graphiql-tab-button {
|
|
190
|
+
border-radius: 0;
|
|
191
|
+
}
|
|
192
|
+
.graphiql-logo {
|
|
193
|
+
padding-right: var(--px-4);
|
|
194
|
+
}
|
|
195
|
+
.graphiql-doc-explorer-content > * {
|
|
196
|
+
margin-top: var(--px-16);
|
|
197
|
+
}
|
|
198
|
+
.graphiql-doc-explorer-section-content > * + *,
|
|
199
|
+
.graphiql-markdown-description {
|
|
200
|
+
margin-top: var(--px-8);
|
|
201
|
+
}
|
|
202
|
+
.graphiql-doc-explorer-title,
|
|
203
|
+
.graphiql-history-header,
|
|
204
|
+
.doc-explorer-title {
|
|
205
|
+
font-size: var(--font-size-h3);
|
|
206
|
+
}
|
|
207
|
+
.graphiql-history-header {
|
|
208
|
+
align-items: flex-start;
|
|
209
|
+
}
|
|
210
|
+
.graphiql-doc-explorer-search-input {
|
|
211
|
+
padding: var(--px-4) var(--px-8);
|
|
212
|
+
}
|
|
213
|
+
.graphiql-doc-explorer-search:not(:focus-within) [role="combobox"] {
|
|
214
|
+
font-size: 1rem;
|
|
215
|
+
width: 5em;
|
|
216
|
+
}
|
|
217
|
+
.graphiql-chevron-icon {
|
|
218
|
+
height: var(--px-12);
|
|
219
|
+
width: var(--px-12);
|
|
220
|
+
margin: var(--px-8);
|
|
221
|
+
}
|
|
222
|
+
.ruru-footer {
|
|
223
|
+
padding: var(--px-8) var(--px-4);
|
|
224
|
+
}
|
|
225
|
+
}
|
|
226
|
+
|
|
227
|
+
.graphiql-dropdown-content {
|
|
228
|
+
padding: 0;
|
|
229
|
+
}
|
|
230
|
+
.graphiql-dropdown-item {
|
|
231
|
+
margin: 0;
|
|
232
|
+
}
|
|
233
|
+
.graphiql-dialog {
|
|
234
|
+
.graphiql-dialog-header,
|
|
235
|
+
.graphiql-dialog-section {
|
|
236
|
+
padding: var(--px-12);
|
|
237
|
+
}
|
|
238
|
+
}
|