ruru-components 2.0.0-beta.2 → 2.0.0-beta.20
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 +257 -0
- package/dist/components/Copy.d.ts +2 -1
- package/dist/components/Copy.d.ts.map +1 -1
- package/dist/components/Copy.js +8 -11
- package/dist/components/Copy.js.map +1 -1
- package/dist/components/ErrorPopup.js +2 -6
- package/dist/components/ErrorPopup.js.map +1 -1
- package/dist/components/Explain.d.ts +5 -0
- package/dist/components/Explain.d.ts.map +1 -1
- package/dist/components/Explain.js +46 -46
- package/dist/components/Explain.js.map +1 -1
- package/dist/components/Footer.js +2 -6
- package/dist/components/Footer.js.map +1 -1
- package/dist/components/FormatSQL.js +13 -17
- package/dist/components/FormatSQL.js.map +1 -1
- package/dist/components/Mermaid.d.ts +2 -1
- package/dist/components/Mermaid.d.ts.map +1 -1
- package/dist/components/Mermaid.js +24 -17
- package/dist/components/Mermaid.js.map +1 -1
- package/dist/defaultQuery.js +1 -4
- package/dist/defaultQuery.js.map +1 -1
- package/dist/hooks/useExplain.d.ts +1 -1
- package/dist/hooks/useExplain.js +9 -13
- package/dist/hooks/useExplain.js.map +1 -1
- package/dist/hooks/useFetcher.d.ts +5 -4
- package/dist/hooks/useFetcher.d.ts.map +1 -1
- package/dist/hooks/useFetcher.js +26 -36
- package/dist/hooks/useFetcher.js.map +1 -1
- package/dist/hooks/useGraphQLChangeStream.js +6 -10
- package/dist/hooks/useGraphQLChangeStream.js.map +1 -1
- package/dist/hooks/usePrettify.js +6 -10
- package/dist/hooks/usePrettify.js.map +1 -1
- package/dist/hooks/useStorage.d.ts +0 -2
- package/dist/hooks/useStorage.d.ts.map +1 -1
- package/dist/hooks/useStorage.js +5 -11
- package/dist/hooks/useStorage.js.map +1 -1
- package/dist/index.js +1 -5
- package/dist/index.js.map +1 -1
- package/dist/interfaces.d.ts +27 -0
- package/dist/interfaces.d.ts.map +1 -1
- package/dist/interfaces.js +1 -2
- package/dist/plugins/explain.js +9 -12
- package/dist/plugins/explain.js.map +1 -1
- package/dist/ruru.d.ts +3 -1
- package/dist/ruru.d.ts.map +1 -1
- package/dist/ruru.js +44 -48
- package/dist/ruru.js.map +1 -1
- package/package.json +30 -23
- package/dist/hooks/useSchema.d.ts +0 -8
- package/dist/hooks/useSchema.d.ts.map +0 -1
- package/dist/hooks/useSchema.js +0 -74
- package/dist/hooks/useSchema.js.map +0 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,262 @@
|
|
|
1
1
|
# ruru-components
|
|
2
2
|
|
|
3
|
+
## 2.0.0-beta.20
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [#2125](https://github.com/graphile/crystal/pull/2125)
|
|
8
|
+
[`18addb385`](https://github.com/graphile/crystal/commit/18addb3852525aa91019a36d58fa2fecd8b5b443)
|
|
9
|
+
Thanks [@benjie](https://github.com/benjie)! - Change how unary steps are
|
|
10
|
+
rendered to plan diagrams, fixing the rendering of side-effect steps.
|
|
11
|
+
|
|
12
|
+
- [#2124](https://github.com/graphile/crystal/pull/2124)
|
|
13
|
+
[`cf535c210`](https://github.com/graphile/crystal/commit/cf535c21078da06c14dd12f30e9b4378da4ded03)
|
|
14
|
+
Thanks [@benjie](https://github.com/benjie)! - Render implicit side effects as
|
|
15
|
+
dependencies on plan diagram
|
|
16
|
+
|
|
17
|
+
- Updated dependencies
|
|
18
|
+
[[`1bd50b61e`](https://github.com/graphile/crystal/commit/1bd50b61ebb10b7d09b3612c2e2767c41cca3b78),
|
|
19
|
+
[`4e102b1a1`](https://github.com/graphile/crystal/commit/4e102b1a1cd232e6f6703df0706415f01831dab2),
|
|
20
|
+
[`7bb1573ba`](https://github.com/graphile/crystal/commit/7bb1573ba45a4d8b7fa9ad53cdd79686d2641383),
|
|
21
|
+
[`18addb385`](https://github.com/graphile/crystal/commit/18addb3852525aa91019a36d58fa2fecd8b5b443),
|
|
22
|
+
[`6ed615e55`](https://github.com/graphile/crystal/commit/6ed615e557b2ab1fb57f1e68c06730a8e3da7175),
|
|
23
|
+
[`b25cc539c`](https://github.com/graphile/crystal/commit/b25cc539c00aeda7a943c37509aaae4dc7812317),
|
|
24
|
+
[`867f33136`](https://github.com/graphile/crystal/commit/867f331365346fc46ed1e0d23c79719846e398f4),
|
|
25
|
+
[`cf535c210`](https://github.com/graphile/crystal/commit/cf535c21078da06c14dd12f30e9b4378da4ded03),
|
|
26
|
+
[`acf99b190`](https://github.com/graphile/crystal/commit/acf99b190954e3c5926e820daed68dfe8eb3ee1f),
|
|
27
|
+
[`4967a197f`](https://github.com/graphile/crystal/commit/4967a197fd2c71ee2a581fe29470ee9f30e74de5),
|
|
28
|
+
[`1908e1ba1`](https://github.com/graphile/crystal/commit/1908e1ba11883a34dac66f985fc20ab160e572b1),
|
|
29
|
+
[`084d80be6`](https://github.com/graphile/crystal/commit/084d80be6e17187c9a9932bcf079e3f460368782)]:
|
|
30
|
+
- grafast@0.1.1-beta.12
|
|
31
|
+
|
|
32
|
+
## 2.0.0-beta.19
|
|
33
|
+
|
|
34
|
+
### Patch Changes
|
|
35
|
+
|
|
36
|
+
- Updated dependencies
|
|
37
|
+
[[`582bd768f`](https://github.com/graphile/crystal/commit/582bd768fec403ce3284f293b85b9fd86e4d3f40)]:
|
|
38
|
+
- grafast@0.1.1-beta.11
|
|
39
|
+
|
|
40
|
+
## 2.0.0-beta.18
|
|
41
|
+
|
|
42
|
+
### Patch Changes
|
|
43
|
+
|
|
44
|
+
- Updated dependencies
|
|
45
|
+
[[`3c161f7e1`](https://github.com/graphile/crystal/commit/3c161f7e13375105b1035a7d5d1c0f2b507ca5c7),
|
|
46
|
+
[`a674a9923`](https://github.com/graphile/crystal/commit/a674a9923bc908c9315afa40e0cb256ee0953d16),
|
|
47
|
+
[`b7cfeffd1`](https://github.com/graphile/crystal/commit/b7cfeffd1019d61c713a5054c4f5929960a2a6ab)]:
|
|
48
|
+
- grafast@0.1.1-beta.10
|
|
49
|
+
|
|
50
|
+
## 2.0.0-beta.17
|
|
51
|
+
|
|
52
|
+
### Patch Changes
|
|
53
|
+
|
|
54
|
+
- Updated dependencies
|
|
55
|
+
[[`437570f97`](https://github.com/graphile/crystal/commit/437570f97e8520afaf3d0d0b514d1f4c31546b76)]:
|
|
56
|
+
- grafast@0.1.1-beta.9
|
|
57
|
+
|
|
58
|
+
## 2.0.0-beta.16
|
|
59
|
+
|
|
60
|
+
### Patch Changes
|
|
61
|
+
|
|
62
|
+
- Updated dependencies
|
|
63
|
+
[[`bd5a908a4`](https://github.com/graphile/crystal/commit/bd5a908a4d04310f90dfb46ad87398ffa993af3b)]:
|
|
64
|
+
- grafast@0.1.1-beta.8
|
|
65
|
+
|
|
66
|
+
## 2.0.0-beta.15
|
|
67
|
+
|
|
68
|
+
### Patch Changes
|
|
69
|
+
|
|
70
|
+
- Updated dependencies
|
|
71
|
+
[[`357d475f5`](https://github.com/graphile/crystal/commit/357d475f54fecc8c51892e0346d6872b34132430),
|
|
72
|
+
[`3551725e7`](https://github.com/graphile/crystal/commit/3551725e71c3ed876554e19e5ab2c1dcb0fb1143),
|
|
73
|
+
[`80836471e`](https://github.com/graphile/crystal/commit/80836471e5cedb29dee63bc5002550c4f1713cfd),
|
|
74
|
+
[`b788dd868`](https://github.com/graphile/crystal/commit/b788dd86849e703cc3aa863fd9190c36a087b865),
|
|
75
|
+
[`a5c20fefb`](https://github.com/graphile/crystal/commit/a5c20fefb571dea6d1187515dc48dd547e9e6204),
|
|
76
|
+
[`1ce08980e`](https://github.com/graphile/crystal/commit/1ce08980e2a52ed9bc81564d248c19648ecd3616),
|
|
77
|
+
[`dff4f2535`](https://github.com/graphile/crystal/commit/dff4f2535ac6ce893089b312fcd5fffcd98573a5),
|
|
78
|
+
[`a287a57c2`](https://github.com/graphile/crystal/commit/a287a57c2765da0fb6a132ea0953f64453210ceb),
|
|
79
|
+
[`2fe56f9a6`](https://github.com/graphile/crystal/commit/2fe56f9a6dac03484ace45c29c2223a65f9ca1db),
|
|
80
|
+
[`fed603d71`](https://github.com/graphile/crystal/commit/fed603d719c02f33e12190f925c9e3b06c581fac),
|
|
81
|
+
[`ed6e0d278`](https://github.com/graphile/crystal/commit/ed6e0d2788217a1c419634837f4208013eaf2923),
|
|
82
|
+
[`e82e4911e`](https://github.com/graphile/crystal/commit/e82e4911e32138df1b90ec0fde555ea963018d21),
|
|
83
|
+
[`42ece5aa6`](https://github.com/graphile/crystal/commit/42ece5aa6ca05345ebc17fb5c7d55df3b79b7612),
|
|
84
|
+
[`e0d69e518`](https://github.com/graphile/crystal/commit/e0d69e518a98c70f9b90f59d243ce33978c1b5a1),
|
|
85
|
+
[`6699388ec`](https://github.com/graphile/crystal/commit/6699388ec167d35c71220ce5d9113cac578da6cb),
|
|
86
|
+
[`966203504`](https://github.com/graphile/crystal/commit/96620350467ab8c65b56adf2f055e19450f8e772),
|
|
87
|
+
[`c1645b249`](https://github.com/graphile/crystal/commit/c1645b249aae949a548cd916e536ccfb63e5ab35),
|
|
88
|
+
[`ed8bbaa3c`](https://github.com/graphile/crystal/commit/ed8bbaa3cd1563a7601ca8c6b0412633b0ea4ce9),
|
|
89
|
+
[`a0e82b9c5`](https://github.com/graphile/crystal/commit/a0e82b9c5f4e585f1af1e147299cd07944ece6f8),
|
|
90
|
+
[`14e2412ee`](https://github.com/graphile/crystal/commit/14e2412ee368e8d53abf6774c7f0069f32d4e8a3),
|
|
91
|
+
[`57ab0e1e7`](https://github.com/graphile/crystal/commit/57ab0e1e72c01213b21d3efc539cd655d83d993a),
|
|
92
|
+
[`8442242e4`](https://github.com/graphile/crystal/commit/8442242e43cac7d89ca0c413cf42c9fabf6f247f),
|
|
93
|
+
[`64ce7b765`](https://github.com/graphile/crystal/commit/64ce7b7650530251aec38a51089da66f914c19b4),
|
|
94
|
+
[`cba842357`](https://github.com/graphile/crystal/commit/cba84235786acbd77ade53bae7a3fba4a9be1eb7),
|
|
95
|
+
[`2fa77d0f2`](https://github.com/graphile/crystal/commit/2fa77d0f237cdb98d3dafb6b5e4083a2c6c38673)]:
|
|
96
|
+
- grafast@0.1.1-beta.7
|
|
97
|
+
- tamedevil@0.0.0-beta.7
|
|
98
|
+
|
|
99
|
+
## 2.0.0-beta.14
|
|
100
|
+
|
|
101
|
+
### Patch Changes
|
|
102
|
+
|
|
103
|
+
- Updated dependencies
|
|
104
|
+
[[`9f85c614d`](https://github.com/graphile/crystal/commit/9f85c614d48dc745c5fed15333dbb75af7fddc88),
|
|
105
|
+
[`6c6be29f1`](https://github.com/graphile/crystal/commit/6c6be29f12b24782c926b2bc62ed2ede09ac05de),
|
|
106
|
+
[`8315e8d01`](https://github.com/graphile/crystal/commit/8315e8d01c118cebc4ebbc53a2f264b958b252ad)]:
|
|
107
|
+
- grafast@0.1.1-beta.6
|
|
108
|
+
- tamedevil@0.0.0-beta.6
|
|
109
|
+
|
|
110
|
+
## 2.0.0-beta.13
|
|
111
|
+
|
|
112
|
+
### Patch Changes
|
|
113
|
+
|
|
114
|
+
- [#1931](https://github.com/graphile/crystal/pull/1931)
|
|
115
|
+
[`dfac3f790`](https://github.com/graphile/crystal/commit/dfac3f790ec5c446c132202dde624aeeb75b5a6d)
|
|
116
|
+
Thanks [@benjie](https://github.com/benjie)! - Fix issue where headers weren't
|
|
117
|
+
sent via websocket connectionParams
|
|
118
|
+
|
|
119
|
+
- [#1931](https://github.com/graphile/crystal/pull/1931)
|
|
120
|
+
[`941e28003`](https://github.com/graphile/crystal/commit/941e280038a735014a9fe4e24fc534a197fac0f2)
|
|
121
|
+
Thanks [@benjie](https://github.com/benjie)! - Add support for deprecated
|
|
122
|
+
arguments to Ruru.
|
|
123
|
+
|
|
124
|
+
- [#1931](https://github.com/graphile/crystal/pull/1931)
|
|
125
|
+
[`068be2f51`](https://github.com/graphile/crystal/commit/068be2f51d7a9c17311f26c6c9451985397c9e1f)
|
|
126
|
+
Thanks [@benjie](https://github.com/benjie)! - Fix issue typing into Ruru
|
|
127
|
+
explorer plugin - characters no longer overwritten.
|
|
128
|
+
|
|
129
|
+
- Updated dependencies
|
|
130
|
+
[[`49fd8afed`](https://github.com/graphile/crystal/commit/49fd8afed1afe573ea76a2a7a821dfa5d6288e2d),
|
|
131
|
+
[`63dd7ea99`](https://github.com/graphile/crystal/commit/63dd7ea992d30ad711dd85a73a127484a0e35479),
|
|
132
|
+
[`d801c9778`](https://github.com/graphile/crystal/commit/d801c9778a86d61e060896460af9fe62a733534a),
|
|
133
|
+
[`ef44c29b2`](https://github.com/graphile/crystal/commit/ef44c29b24a1ad5a042ae1536a4546dd64b17195),
|
|
134
|
+
[`8ea67f891`](https://github.com/graphile/crystal/commit/8ea67f8910693edaf70daa9952e35d8396166f38)]:
|
|
135
|
+
- tamedevil@0.0.0-beta.5
|
|
136
|
+
- grafast@0.1.1-beta.5
|
|
137
|
+
|
|
138
|
+
## 2.0.0-beta.12
|
|
139
|
+
|
|
140
|
+
### Patch Changes
|
|
141
|
+
|
|
142
|
+
- Updated dependencies
|
|
143
|
+
[[`1b6c2f636`](https://github.com/graphile/crystal/commit/1b6c2f6360a316a8dc550c60e28c61deea538f19),
|
|
144
|
+
[`a2176ea32`](https://github.com/graphile/crystal/commit/a2176ea324db0801249661b30e9c9d314c6fb159),
|
|
145
|
+
[`886833e2e`](https://github.com/graphile/crystal/commit/886833e2e319f23d905d7184ca88fca701b94044)]:
|
|
146
|
+
- tamedevil@0.0.0-beta.4
|
|
147
|
+
- grafast@0.1.1-beta.4
|
|
148
|
+
|
|
149
|
+
## 2.0.0-beta.11
|
|
150
|
+
|
|
151
|
+
### Patch Changes
|
|
152
|
+
|
|
153
|
+
- Updated dependencies []:
|
|
154
|
+
- grafast@0.1.1-beta.3
|
|
155
|
+
|
|
156
|
+
## 2.0.0-beta.10
|
|
157
|
+
|
|
158
|
+
### Patch Changes
|
|
159
|
+
|
|
160
|
+
- Updated dependencies
|
|
161
|
+
[[`3fdc2bce4`](https://github.com/graphile/crystal/commit/3fdc2bce42418773f808c5b8309dfb361cd95ce9),
|
|
162
|
+
[`aeef362b5`](https://github.com/graphile/crystal/commit/aeef362b5744816f01e4a6f714bbd77f92332bc5),
|
|
163
|
+
[`8a76db07f`](https://github.com/graphile/crystal/commit/8a76db07f4c110cecc6225504f9a05ccbcbc7b92),
|
|
164
|
+
[`8a0cdb95f`](https://github.com/graphile/crystal/commit/8a0cdb95f200b28b0ea1ab5caa12b23dce5f374f),
|
|
165
|
+
[`1c9f1c0ed`](https://github.com/graphile/crystal/commit/1c9f1c0edf4e621a5b6345d3a41527a18143c6ae)]:
|
|
166
|
+
- grafast@0.1.1-beta.2
|
|
167
|
+
|
|
168
|
+
## 2.0.0-beta.9
|
|
169
|
+
|
|
170
|
+
### Patch Changes
|
|
171
|
+
|
|
172
|
+
- [#1833](https://github.com/graphile/crystal/pull/1833)
|
|
173
|
+
[`11ceb1753`](https://github.com/graphile/crystal/commit/11ceb1753ee42ee6d991e618dedc670a6f238fab)
|
|
174
|
+
Thanks [@benjie](https://github.com/benjie)! - Rework how schema fetching
|
|
175
|
+
works to solve issue with headers not being sent. Thanks @JoviDeCroock for the
|
|
176
|
+
inspiration.
|
|
177
|
+
- Updated dependencies
|
|
178
|
+
[[`49fcb0d58`](https://github.com/graphile/crystal/commit/49fcb0d585b31b291c9072c339d6f5b550eefc9f)]:
|
|
179
|
+
- grafast@0.1.1-beta.1
|
|
180
|
+
|
|
181
|
+
## 2.0.0-beta.8
|
|
182
|
+
|
|
183
|
+
### Patch Changes
|
|
184
|
+
|
|
185
|
+
- [#1799](https://github.com/graphile/crystal/pull/1799)
|
|
186
|
+
[`3dd5d86d6`](https://github.com/graphile/crystal/commit/3dd5d86d6c1ea7ba106c08e8a315ec47ed6cfa2d)
|
|
187
|
+
Thanks [@jvandermey](https://github.com/jvandermey)! - Can now pass onEdit
|
|
188
|
+
callbacks through the Ruru config via the plugin system; e.g. to update the
|
|
189
|
+
URL search params with the current editor state.
|
|
190
|
+
|
|
191
|
+
## 2.0.0-beta.7
|
|
192
|
+
|
|
193
|
+
### Patch Changes
|
|
194
|
+
|
|
195
|
+
- [#1796](https://github.com/graphile/crystal/pull/1796)
|
|
196
|
+
[`ebb0b817e`](https://github.com/graphile/crystal/commit/ebb0b817e3efe210445d3f3396ff4bc53ebab3e7)
|
|
197
|
+
Thanks [@benjie](https://github.com/benjie)! - Can now set initial query and
|
|
198
|
+
variables in Ruru via the plugin system; e.g. to set query/variables based on
|
|
199
|
+
query string.
|
|
200
|
+
|
|
201
|
+
## 2.0.0-beta.6
|
|
202
|
+
|
|
203
|
+
### Patch Changes
|
|
204
|
+
|
|
205
|
+
- Updated dependencies
|
|
206
|
+
[[`4a4d26d87`](https://github.com/graphile/crystal/commit/4a4d26d87ce74589429b8ca5126a7bfdf30351b8),
|
|
207
|
+
[`b2bce88da`](https://github.com/graphile/crystal/commit/b2bce88da26c7a8965468be16fc2d935eadd3434),
|
|
208
|
+
[`861a8a306`](https://github.com/graphile/crystal/commit/861a8a306ef42a821da19e77903ddd7e8130bfb3)]:
|
|
209
|
+
- grafast@0.1.1-beta.0
|
|
210
|
+
|
|
211
|
+
## 2.0.0-beta.5
|
|
212
|
+
|
|
213
|
+
### Patch Changes
|
|
214
|
+
|
|
215
|
+
- [#514](https://github.com/graphile/crystal-pre-merge/pull/514)
|
|
216
|
+
[`c9848f693`](https://github.com/graphile/crystal-pre-merge/commit/c9848f6936a5abd7740c0638bfb458fb5551f03b)
|
|
217
|
+
Thanks [@benjie](https://github.com/benjie)! - Update package.json repository
|
|
218
|
+
information
|
|
219
|
+
|
|
220
|
+
- Updated dependencies
|
|
221
|
+
[[`c9848f693`](https://github.com/graphile/crystal-pre-merge/commit/c9848f6936a5abd7740c0638bfb458fb5551f03b),
|
|
222
|
+
[`ede1092fe`](https://github.com/graphile/crystal-pre-merge/commit/ede1092fe197719b6fa786f4cfa75f6a1f4c56c1),
|
|
223
|
+
[`566983fbd`](https://github.com/graphile/crystal-pre-merge/commit/566983fbd99c4b2df8c4ebd6260521670a2b7dfc),
|
|
224
|
+
[`409bf6071`](https://github.com/graphile/crystal-pre-merge/commit/409bf607180d4d8faec658c803e5ec4d1a00c451)]:
|
|
225
|
+
- grafast@0.0.1-beta.8
|
|
226
|
+
- tamedevil@0.0.0-beta.3
|
|
227
|
+
|
|
228
|
+
## 2.0.0-beta.4
|
|
229
|
+
|
|
230
|
+
### Patch Changes
|
|
231
|
+
|
|
232
|
+
- Updated dependencies
|
|
233
|
+
[[`3700e204f`](https://github.com/benjie/crystal/commit/3700e204f430db182c92ca7abc82017c81fa1f9b)]:
|
|
234
|
+
- grafast@0.0.1-beta.7
|
|
235
|
+
|
|
236
|
+
## 2.0.0-beta.3
|
|
237
|
+
|
|
238
|
+
### Patch Changes
|
|
239
|
+
|
|
240
|
+
- [#496](https://github.com/benjie/crystal/pull/496)
|
|
241
|
+
[`c9bfd9892`](https://github.com/benjie/crystal/commit/c9bfd989247f9433fb5b18c5175c9d8d64cd21a1)
|
|
242
|
+
Thanks [@benjie](https://github.com/benjie)! - Update dependencies (sometimes
|
|
243
|
+
through major versions).
|
|
244
|
+
|
|
245
|
+
- [#496](https://github.com/benjie/crystal/pull/496)
|
|
246
|
+
[`1867d365f`](https://github.com/benjie/crystal/commit/1867d365f360ac8411f622b0813ca76a19ab4013)
|
|
247
|
+
Thanks [@benjie](https://github.com/benjie)! - Ruru now runs on React 18
|
|
248
|
+
|
|
249
|
+
- [#496](https://github.com/benjie/crystal/pull/496)
|
|
250
|
+
[`c747d91e9`](https://github.com/benjie/crystal/commit/c747d91e9646409c66e73c12195dbf6cbd97b211)
|
|
251
|
+
Thanks [@benjie](https://github.com/benjie)! - Modules converted to ESM to fix
|
|
252
|
+
compatibility with GraphiQL.
|
|
253
|
+
|
|
254
|
+
- Updated dependencies
|
|
255
|
+
[[`c9bfd9892`](https://github.com/benjie/crystal/commit/c9bfd989247f9433fb5b18c5175c9d8d64cd21a1),
|
|
256
|
+
[`e613b476d`](https://github.com/benjie/crystal/commit/e613b476d6ee867d1f7509c895dabee40e7f9a31)]:
|
|
257
|
+
- grafast@0.0.1-beta.6
|
|
258
|
+
- tamedevil@0.0.0-beta.2
|
|
259
|
+
|
|
3
260
|
## 2.0.0-beta.2
|
|
4
261
|
|
|
5
262
|
### Patch Changes
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Copy.d.ts","sourceRoot":"","sources":["../../src/components/Copy.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,EAAE,MAAM,OAAO,CAAC;AAGhC,eAAO,MAAM,IAAI,EAAE,EAAE,CAAC;IACpB,IAAI,EAAE,MAAM,CAAC;
|
|
1
|
+
{"version":3,"file":"Copy.d.ts","sourceRoot":"","sources":["../../src/components/Copy.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,EAAE,MAAM,OAAO,CAAC;AAGhC,eAAO,MAAM,IAAI,EAAE,EAAE,CAAC;IACpB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,IAAI,CAAC,EAAE,GAAG,CAAC;IACX,QAAQ,EAAE,MAAM,GAAG,GAAG,CAAC,OAAO,GAAG,GAAG,CAAC,OAAO,EAAE,CAAC;CAChD,CA8BA,CAAC"}
|
package/dist/components/Copy.js
CHANGED
|
@@ -1,11 +1,9 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
const
|
|
5
|
-
const
|
|
6
|
-
const
|
|
7
|
-
const ref = (0, react_1.useRef)(null);
|
|
8
|
-
const copy = (0, react_1.useCallback)(() => {
|
|
1
|
+
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { useCallback, useMemo, useRef } from "react";
|
|
3
|
+
export const Copy = ({ text: rawText, json, children }) => {
|
|
4
|
+
const text = useMemo(() => rawText ?? (json !== undefined ? JSON.stringify(json) : undefined), [rawText, json]);
|
|
5
|
+
const ref = useRef(null);
|
|
6
|
+
const copy = useCallback(() => {
|
|
9
7
|
const el = ref.current;
|
|
10
8
|
if (el) {
|
|
11
9
|
/* Select the text field */
|
|
@@ -15,9 +13,8 @@ const Copy = ({ text, children }) => {
|
|
|
15
13
|
navigator.clipboard.writeText(el.value);
|
|
16
14
|
}
|
|
17
15
|
}, []);
|
|
18
|
-
return ((
|
|
16
|
+
return (_jsxs(_Fragment, { children: [_jsx("textarea", { ref: (el) => {
|
|
19
17
|
ref.current = el;
|
|
20
|
-
}, value: text, readOnly: true, style: { display: "none" } }), (
|
|
18
|
+
}, value: text, readOnly: true, style: { display: "none" } }), _jsx("button", { onClick: copy, children: children })] }));
|
|
21
19
|
};
|
|
22
|
-
exports.Copy = Copy;
|
|
23
20
|
//# sourceMappingURL=Copy.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Copy.js","sourceRoot":"","sources":["../../src/components/Copy.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"Copy.js","sourceRoot":"","sources":["../../src/components/Copy.tsx"],"names":[],"mappings":";AACA,OAAO,EAAE,WAAW,EAAE,OAAO,EAAE,MAAM,EAAE,MAAM,OAAO,CAAC;AAErD,MAAM,CAAC,MAAM,IAAI,GAIZ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,IAAI,EAAE,QAAQ,EAAE,EAAE,EAAE;IACzC,MAAM,IAAI,GAAG,OAAO,CAClB,GAAG,EAAE,CAAC,OAAO,IAAI,CAAC,IAAI,KAAK,SAAS,CAAC,CAAC,CAAC,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC,EACxE,CAAC,OAAO,EAAE,IAAI,CAAC,CAChB,CAAC;IACF,MAAM,GAAG,GAAG,MAAM,CAA6B,IAAI,CAAC,CAAC;IACrD,MAAM,IAAI,GAAG,WAAW,CAAC,GAAG,EAAE;QAC5B,MAAM,EAAE,GAAG,GAAG,CAAC,OAAO,CAAC;QACvB,IAAI,EAAE,EAAE;YACN,2BAA2B;YAC3B,EAAE,CAAC,MAAM,EAAE,CAAC;YACZ,EAAE,CAAC,iBAAiB,CAAC,CAAC,EAAE,KAAK,CAAC,CAAC,CAAC,wBAAwB;YAExD,yCAAyC;YACzC,SAAS,CAAC,SAAS,CAAC,SAAS,CAAC,EAAE,CAAC,KAAK,CAAC,CAAC;SACzC;IACH,CAAC,EAAE,EAAE,CAAC,CAAC;IACP,OAAO,CACL,8BACE,mBACE,GAAG,EAAE,CAAC,EAAE,EAAE,EAAE;oBACV,GAAG,CAAC,OAAO,GAAG,EAAE,CAAC;gBACnB,CAAC,EACD,KAAK,EAAE,IAAI,EACX,QAAQ,QACR,KAAK,EAAE,EAAE,OAAO,EAAE,MAAM,EAAE,GAC1B,EACF,iBAAQ,OAAO,EAAE,IAAI,YAAG,QAAQ,GAAU,IACzC,CACJ,CAAC;AACJ,CAAC,CAAC"}
|
|
@@ -1,8 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.ErrorPopup = void 0;
|
|
4
|
-
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
5
2
|
// TODO: this needs proper design and accessibility considerations
|
|
6
|
-
const ErrorPopup = ({ error, onClose, }) => ((
|
|
7
|
-
exports.ErrorPopup = ErrorPopup;
|
|
3
|
+
export const ErrorPopup = ({ error, onClose, }) => (_jsxs("div", { className: "errorPopup", children: [_jsx("button", { className: "errorPopupClose", onClick: onClose, children: "\uD83D\uDDD9" }), _jsx("div", { className: "errorPopupError", children: String(error) })] }));
|
|
8
4
|
//# sourceMappingURL=ErrorPopup.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ErrorPopup.js","sourceRoot":"","sources":["../../src/components/ErrorPopup.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"ErrorPopup.js","sourceRoot":"","sources":["../../src/components/ErrorPopup.tsx"],"names":[],"mappings":";AAEA,kEAAkE;AAElE,MAAM,CAAC,MAAM,UAAU,GAA8C,CAAC,EACpE,KAAK,EACL,OAAO,GACR,EAAE,EAAE,CAAC,CACJ,eAAK,SAAS,EAAC,YAAY,aACzB,iBAAQ,SAAS,EAAC,iBAAiB,EAAC,OAAO,EAAE,OAAO,6BAE3C,EACT,cAAK,SAAS,EAAC,iBAAiB,YAAE,MAAM,CAAC,KAAK,CAAC,GAAO,IAClD,CACP,CAAC"}
|
|
@@ -1,6 +1,11 @@
|
|
|
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
|
+
}
|
|
4
9
|
export declare const Explain: FC<{
|
|
5
10
|
explain: boolean;
|
|
6
11
|
setExplain: (newExplain: boolean) => void;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Explain.d.ts","sourceRoot":"","sources":["../../src/components/Explain.tsx"],"names":[],"mappings":"AACA,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,
|
|
1
|
+
{"version":3,"file":"Explain.d.ts","sourceRoot":"","sources":["../../src/components/Explain.tsx"],"names":[],"mappings":"AACA,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,OAAO,CAAC,MAAM,CAAC;IACb,UAAU,MAAM;QACd,OAAO,CAAC,EAAE,GAAG,CAAC;KACf;CACF;AAED,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,CA8IA,CAAC"}
|
|
@@ -1,80 +1,80 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
const
|
|
9
|
-
|
|
10
|
-
const FormatSQL_js_1 = require("./FormatSQL.js");
|
|
11
|
-
const Mermaid_js_1 = require("./Mermaid.js");
|
|
12
|
-
const Explain = ({ explain, setExplain, helpers, results }) => {
|
|
13
|
-
return ((0, jsx_runtime_1.jsx)(jsx_runtime_1.Fragment, { children: !results ? (!explain ? ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)("p", { children: "WARNING: you've not enabled the 'explain' functionality" }), (0, jsx_runtime_1.jsx)("p", { children: (0, jsx_runtime_1.jsx)("button", { onClick: () => setExplain(true), children: "Enable explain" }) })] })) : ((0, jsx_runtime_1.jsx)("p", { children: "There are no explain results to display - perhaps you have not yet ran an operation against a server that supports this feature?" }))) : results.operations.length === 0 ? ((0, jsx_runtime_1.jsx)("p", { children: "Empty explain results" })) : ((0, jsx_runtime_1.jsx)("div", { children: (0, jsx_runtime_1.jsx)(exports.ExplainMain, { helpers: helpers, results: results }) })) }));
|
|
1
|
+
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { planToMermaid } from "grafast/mermaid";
|
|
3
|
+
import { useCallback, useEffect, useRef, useState } from "react";
|
|
4
|
+
import { createPortal } from "react-dom";
|
|
5
|
+
import { Copy } from "./Copy.js";
|
|
6
|
+
import { FormatSQL } from "./FormatSQL.js";
|
|
7
|
+
import { Mermaid } from "./Mermaid.js";
|
|
8
|
+
export const Explain = ({ explain, setExplain, helpers, results }) => {
|
|
9
|
+
return (_jsx(_Fragment, { children: !results ? (!explain ? (_jsxs(_Fragment, { children: [_jsx("p", { children: "WARNING: you've not enabled the 'explain' functionality" }), _jsx("p", { children: _jsx("button", { onClick: () => setExplain(true), children: "Enable explain" }) })] })) : (_jsx("p", { children: "There are no explain results to display - perhaps you have not yet ran an operation against a server that supports this feature?" }))) : results.operations.length === 0 ? (_jsx("p", { children: "Empty explain results" })) : (_jsx("div", { children: _jsx(ExplainMain, { helpers: helpers, results: results }) })) }));
|
|
14
10
|
};
|
|
15
|
-
|
|
16
|
-
const
|
|
17
|
-
|
|
18
|
-
(0, react_1.useEffect)(() => {
|
|
11
|
+
export const ExplainMain = ({ results }) => {
|
|
12
|
+
const [selectedIndex, setSelectedIndex] = useState(0);
|
|
13
|
+
useEffect(() => {
|
|
19
14
|
setSelectedIndex(0);
|
|
20
15
|
}, [results]);
|
|
21
16
|
const selectedResult = results.operations[selectedIndex];
|
|
22
|
-
const [expanded, setExpanded] =
|
|
23
|
-
const expand =
|
|
17
|
+
const [expanded, setExpanded] = useState(false);
|
|
18
|
+
const expand = useCallback(() => {
|
|
24
19
|
setExpanded(true);
|
|
25
20
|
}, []);
|
|
26
|
-
const nodeRef =
|
|
21
|
+
const nodeRef = useRef();
|
|
27
22
|
if (!nodeRef.current) {
|
|
28
23
|
nodeRef.current = document.createElement("div");
|
|
29
24
|
}
|
|
30
25
|
const node = nodeRef.current;
|
|
31
|
-
|
|
26
|
+
useEffect(() => {
|
|
32
27
|
document.body.appendChild(node);
|
|
33
28
|
return () => {
|
|
34
29
|
document.body.removeChild(node);
|
|
35
30
|
};
|
|
36
31
|
}, [node]);
|
|
37
|
-
const [saving, setSaving] =
|
|
38
|
-
const saveSVG =
|
|
39
|
-
if (!selectedResult || selectedResult.type !== "
|
|
32
|
+
const [saving, setSaving] = useState(false);
|
|
33
|
+
const saveSVG = useCallback(() => {
|
|
34
|
+
if (!selectedResult || selectedResult.type !== "plan")
|
|
40
35
|
return;
|
|
41
36
|
setSaving(true);
|
|
42
37
|
setTimeout(() => {
|
|
43
|
-
|
|
44
|
-
const
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
38
|
+
if (window.mermaid) {
|
|
39
|
+
const diagram = planToMermaid(selectedResult.plan);
|
|
40
|
+
window.mermaid.mermaidAPI.render("id1", diagram, (svg) => {
|
|
41
|
+
const file = new File([svg.replace(/<br>/g, "<br/>")], "grafast-plan.svg");
|
|
42
|
+
const a = document.createElement("a");
|
|
43
|
+
a.href = URL.createObjectURL(file);
|
|
44
|
+
a.download = file.name;
|
|
45
|
+
a.style.display = "none";
|
|
46
|
+
document.body.appendChild(a);
|
|
47
|
+
a.click();
|
|
48
|
+
setSaving(false);
|
|
49
|
+
setTimeout(() => {
|
|
50
|
+
URL.revokeObjectURL(a.href);
|
|
51
|
+
a.parentNode.removeChild(a);
|
|
52
|
+
}, 0);
|
|
53
|
+
});
|
|
54
|
+
}
|
|
55
|
+
else {
|
|
56
|
+
alert("Mermaid hasn't loaded (yet)");
|
|
57
|
+
}
|
|
57
58
|
}, 0);
|
|
58
59
|
}, [selectedResult]);
|
|
59
60
|
const component = (() => {
|
|
60
61
|
switch (selectedResult?.type) {
|
|
61
62
|
case "sql": {
|
|
62
|
-
return ((
|
|
63
|
+
return (_jsxs("div", { children: [selectedResult.explain ? (_jsxs(_Fragment, { children: [_jsxs("h4", { children: ["Result from SQL", " ", _jsx("a", { href: "https://www.postgresql.org/docs/current/sql-explain.html", children: "EXPLAIN" }), " ", "on executed query:"] }), _jsx("pre", { className: "explain-plan", children: _jsx("code", { children: selectedResult.explain }) }), _jsx(Copy, { text: selectedResult.explain, children: "Copy plan" })] })) : null, _jsx("h4", { children: "Executed SQL query:" }), _jsx(FormatSQL, { sql: selectedResult.query }), _jsx(Copy, { text: selectedResult.query, children: "Copy SQL" })] }));
|
|
63
64
|
}
|
|
64
|
-
case "
|
|
65
|
-
return ((
|
|
66
|
-
?
|
|
65
|
+
case "plan": {
|
|
66
|
+
return (_jsxs(_Fragment, { children: [_jsx(Copy, { json: selectedResult.plan, children: "Copy plan JSON" }), _jsx("button", { onClick: saveSVG, disabled: saving, children: "Save Mermaid Diagram" }), _jsx("div", { onClick: expand, children: _jsx(Mermaid, { plan: selectedResult.plan }) }), expanded
|
|
67
|
+
? createPortal(_jsxs("div", { className: "explainExpandedContainer", children: [_jsx("div", { className: "explainExpandedTitle", children: "Operation Plan" }), _jsx("div", { className: "explainExpandedCloseContainer", children: _jsx("button", { className: "explainExpandedCloseButton", onClick: () => setExpanded(false), children: "\u00D7" }) }), _jsx("div", { className: "explainExpandedMain", children: _jsx(Mermaid, { plan: selectedResult.plan }) })] }), node)
|
|
67
68
|
: null] }));
|
|
68
69
|
}
|
|
69
70
|
case undefined: {
|
|
70
|
-
return ((
|
|
71
|
+
return (_jsxs("div", { children: ["Explain result type '$", selectedResult.type, "' not yet supported."] }));
|
|
71
72
|
}
|
|
72
73
|
default: {
|
|
73
|
-
return (
|
|
74
|
+
return _jsx("div", {});
|
|
74
75
|
}
|
|
75
76
|
}
|
|
76
77
|
})();
|
|
77
|
-
return ((
|
|
78
|
+
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] }));
|
|
78
79
|
};
|
|
79
|
-
exports.ExplainMain = ExplainMain;
|
|
80
80
|
//# 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":";AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAEhD,OAAO,EAAE,WAAW,EAAE,SAAS,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AACjE,OAAO,EAAE,YAAY,EAAE,MAAM,WAAW,CAAC;AAIzC,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AACjC,OAAO,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAC3C,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AAQvC,MAAM,CAAC,MAAM,OAAO,GAKf,CAAC,EAAE,OAAO,EAAE,UAAU,EAAE,OAAO,EAAE,OAAO,EAAE,EAAE,EAAE;IACjD,OAAO,CACL,4BACG,CAAC,OAAO,CAAC,CAAC,CAAC,CACV,CAAC,OAAO,CAAC,CAAC,CAAC,CACT,8BACE,kFAGI,EACJ,sBACE,iBAAQ,OAAO,EAAE,GAAG,EAAE,CAAC,UAAU,CAAC,IAAI,CAAC,+BAAyB,GAC9D,IACH,CACJ,CAAC,CAAC,CAAC,CACF,2JAGI,CACL,CACF,CAAC,CAAC,CAAC,OAAO,CAAC,UAAU,CAAC,MAAM,KAAK,CAAC,CAAC,CAAC,C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CAAC,IAAI,GAAI,GAClC,IACF,EAEN,IAAI,CACL;4BACH,CAAC,CAAC,IAAI,IACP,CACJ,CAAC;aACH;YACD,KAAK,SAAS,CAAC,CAAC;gBACd,OAAO,CACL,oDAC+B,cAAsB,CAAC,IAAI,4BAEpD,CACP,CAAC;aACH;YACD,OAAO,CAAC,CAAC;gBACP,OAAO,eAAW,CAAC;aACpB;SACF;IACH,CAAC,CAAC,EAAE,CAAC;IACL,OAAO,CACL,0BACE,iBACE,KAAK,EAAE,MAAM,CAAC,aAAa,CAAC,EAC5B,QAAQ,EAAE,CAAC,CAAC,EAAE,EAAE,CAAC,gBAAgB,CAAC,QAAQ,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,EAAE,EAAE,CAAC,CAAC,YAE9D,OAAO,CAAC,UAAU,CAAC,GAAG,CAAC,CAAC,CAAC,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"}
|
|
@@ -1,7 +1,3 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
exports.RuruFooter = void 0;
|
|
4
|
-
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
|
-
const RuruFooter = () => ((0, jsx_runtime_1.jsxs)("div", { style: { padding: 7 }, children: ["Community-funded OSS \uD83D\uDE4F", " ", (0, jsx_runtime_1.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"] }));
|
|
6
|
-
exports.RuruFooter = RuruFooter;
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
export const RuruFooter = () => (_jsxs("div", { style: { padding: 7 }, 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"] }));
|
|
7
3
|
//# sourceMappingURL=Footer.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Footer.js","sourceRoot":"","sources":["../../src/components/Footer.tsx"],"names":[],"mappings":"
|
|
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,KAAK,EAAE,EAAE,OAAO,EAAE,CAAC,EAAE,kDACA,GAAG,EAC3B,YACE,KAAK,EAAC,qFAAqF,EAC3F,IAAI,EAAC,+BAA+B,EACpC,MAAM,EAAC,KAAK,+BAGV,EAAC,GAAG,oBAEJ,CACP,CAAC"}
|
|
@@ -1,11 +1,8 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
const
|
|
5
|
-
const
|
|
6
|
-
const FormatSQL = ({ sql }) => {
|
|
7
|
-
const [highlitIndex, setHighlitIndex] = (0, react_1.useState)(null);
|
|
8
|
-
const formattedSQL = (0, react_1.useMemo)(() => {
|
|
1
|
+
import { Fragment as _Fragment, jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { useCallback, useMemo, useState } from "react";
|
|
3
|
+
export const FormatSQL = ({ sql }) => {
|
|
4
|
+
const [highlitIndex, setHighlitIndex] = useState(null);
|
|
5
|
+
const formattedSQL = useMemo(() => {
|
|
9
6
|
const lines = sql.split("\n");
|
|
10
7
|
const elements = [];
|
|
11
8
|
const knownIdentifiers = new Map();
|
|
@@ -19,7 +16,7 @@ const FormatSQL = ({ sql }) => {
|
|
|
19
16
|
const start = matches.index;
|
|
20
17
|
const fin = re.lastIndex;
|
|
21
18
|
if (start > idx) {
|
|
22
|
-
parts.push((
|
|
19
|
+
parts.push(_jsx(_Fragment, { children: line.substring(idx, start) }));
|
|
23
20
|
}
|
|
24
21
|
idx = fin;
|
|
25
22
|
const [full] = matches;
|
|
@@ -29,20 +26,20 @@ const FormatSQL = ({ sql }) => {
|
|
|
29
26
|
}
|
|
30
27
|
else {
|
|
31
28
|
const index = identifierCount++;
|
|
32
|
-
const sub = ((
|
|
29
|
+
const sub = (_jsx(Highlight, { n: index, highlit: index === highlitIndex, setHighlitIndex: setHighlitIndex, children: full }));
|
|
33
30
|
knownIdentifiers.set(full, sub);
|
|
34
31
|
parts.push(sub);
|
|
35
32
|
}
|
|
36
33
|
}
|
|
37
34
|
if (idx < line.length) {
|
|
38
|
-
parts.push((
|
|
35
|
+
parts.push(_jsx(_Fragment, { children: line.substring(idx) }));
|
|
39
36
|
}
|
|
40
37
|
return parts;
|
|
41
38
|
};
|
|
42
39
|
for (let i = 0, l = lines.length; i < l; i++) {
|
|
43
40
|
const line = lines[i];
|
|
44
41
|
const parts = makeParts(line);
|
|
45
|
-
elements.push((
|
|
42
|
+
elements.push(_jsx("code", { style: {
|
|
46
43
|
display: "block",
|
|
47
44
|
marginLeft: "1.8rem",
|
|
48
45
|
textIndent: "-1.8rem",
|
|
@@ -50,9 +47,8 @@ const FormatSQL = ({ sql }) => {
|
|
|
50
47
|
}
|
|
51
48
|
return elements;
|
|
52
49
|
}, [sql, highlitIndex]);
|
|
53
|
-
return (
|
|
50
|
+
return _jsx("pre", { className: "explain-sql", children: formattedSQL });
|
|
54
51
|
};
|
|
55
|
-
exports.FormatSQL = FormatSQL;
|
|
56
52
|
const COLORS = [
|
|
57
53
|
"#00bfff",
|
|
58
54
|
"#ffa500",
|
|
@@ -76,12 +72,12 @@ const Highlight = ({ n, highlit, setHighlitIndex, children }) => {
|
|
|
76
72
|
backgroundColor: "hsla(var(--color-primary),var(--alpha-background-medium))",
|
|
77
73
|
}
|
|
78
74
|
: { color };
|
|
79
|
-
const onMouseEnter =
|
|
75
|
+
const onMouseEnter = useCallback(() => {
|
|
80
76
|
setHighlitIndex(n);
|
|
81
77
|
}, [setHighlitIndex, n]);
|
|
82
|
-
const onMouseLeave =
|
|
78
|
+
const onMouseLeave = useCallback(() => {
|
|
83
79
|
setHighlitIndex(null);
|
|
84
80
|
}, [setHighlitIndex]);
|
|
85
|
-
return ((
|
|
81
|
+
return (_jsx("strong", { style: style, onMouseEnter: onMouseEnter, onMouseLeave: onMouseLeave, children: children }));
|
|
86
82
|
};
|
|
87
83
|
//# sourceMappingURL=FormatSQL.js.map
|