@sanity/code-input 3.0.0-v3-studio.6 → 3.0.0-v3-studio-async-test.0
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/lib/cjs/editorSupport.bbd31eae.js +717 -0
- package/lib/cjs/editorSupport.bbd31eae.js.map +1 -0
- package/lib/cjs/index.js +50 -741
- package/lib/cjs/index.js.map +1 -1
- package/lib/esm/editorSupport.739e7d0c.js +714 -0
- package/lib/esm/editorSupport.739e7d0c.js.map +1 -0
- package/lib/esm/index.js +47 -741
- package/lib/esm/index.js.map +1 -1
- package/lib/types/index.d.ts.map +1 -1
- package/package.json +1 -1
- package/src/CodeInput.tsx +0 -2
- package/src/PreviewCode.tsx +31 -27
- package/src/config.ts +1 -1
- package/src/createHighlightMarkers.ts +1 -1
package/lib/esm/index.js
CHANGED
|
@@ -1,30 +1,3 @@
|
|
|
1
|
-
import $gGrEF$reactace from "react-ace";
|
|
2
|
-
import "ace-builds/src-noconflict/mode-batchfile";
|
|
3
|
-
import "ace-builds/src-noconflict/mode-csharp";
|
|
4
|
-
import "ace-builds/src-noconflict/mode-css";
|
|
5
|
-
import "ace-builds/src-noconflict/mode-golang";
|
|
6
|
-
import "ace-builds/src-noconflict/mode-html";
|
|
7
|
-
import "ace-builds/src-noconflict/mode-java";
|
|
8
|
-
import "ace-builds/src-noconflict/mode-javascript";
|
|
9
|
-
import "ace-builds/src-noconflict/mode-json";
|
|
10
|
-
import "ace-builds/src-noconflict/mode-jsx";
|
|
11
|
-
import "ace-builds/src-noconflict/mode-markdown";
|
|
12
|
-
import "ace-builds/src-noconflict/mode-mysql";
|
|
13
|
-
import "ace-builds/src-noconflict/mode-php";
|
|
14
|
-
import "ace-builds/src-noconflict/mode-python";
|
|
15
|
-
import "ace-builds/src-noconflict/mode-ruby";
|
|
16
|
-
import "ace-builds/src-noconflict/mode-sass";
|
|
17
|
-
import "ace-builds/src-noconflict/mode-scss";
|
|
18
|
-
import "ace-builds/src-noconflict/mode-sh";
|
|
19
|
-
import "ace-builds/src-noconflict/mode-text";
|
|
20
|
-
import "ace-builds/src-noconflict/mode-tsx";
|
|
21
|
-
import "ace-builds/src-noconflict/mode-typescript";
|
|
22
|
-
import "ace-builds/src-noconflict/mode-xml";
|
|
23
|
-
import "ace-builds/src-noconflict/mode-yaml";
|
|
24
|
-
import "ace-builds/src-noconflict/theme-github";
|
|
25
|
-
import "ace-builds/src-noconflict/theme-monokai";
|
|
26
|
-
import "ace-builds/src-noconflict/theme-terminal";
|
|
27
|
-
import "ace-builds/src-noconflict/theme-tomorrow";
|
|
28
1
|
import {createPlugin as $gGrEF$createPlugin, defineType as $gGrEF$defineType, useColorScheme as $gGrEF$useColorScheme} from "sanity";
|
|
29
2
|
import {CodeBlockIcon as $gGrEF$CodeBlockIcon} from "@sanity/icons";
|
|
30
3
|
import {jsx as $gGrEF$jsx, jsxs as $gGrEF$jsxs} from "react/jsx-runtime";
|
|
@@ -33,12 +6,6 @@ import {set as $gGrEF$set, setIfMissing as $gGrEF$setIfMissing, unset as $gGrEF$
|
|
|
33
6
|
import {Card as $gGrEF$Card, Select as $gGrEF$Select, Stack as $gGrEF$Stack, Box as $gGrEF$Box} from "@sanity/ui";
|
|
34
7
|
import $gGrEF$styledcomponents, {css as $gGrEF$css} from "styled-components";
|
|
35
8
|
|
|
36
|
-
function $parcel$defineInteropFlag(a) {
|
|
37
|
-
Object.defineProperty(a, '__esModule', {value: true, configurable: true});
|
|
38
|
-
}
|
|
39
|
-
function $parcel$export(e, n, v, s) {
|
|
40
|
-
Object.defineProperty(e, n, {get: v, set: s, enumerable: true, configurable: true});
|
|
41
|
-
}
|
|
42
9
|
var $parcel$global =
|
|
43
10
|
typeof globalThis !== 'undefined'
|
|
44
11
|
? globalThis
|
|
@@ -77,669 +44,8 @@ if (parcelRequire == null) {
|
|
|
77
44
|
|
|
78
45
|
$parcel$global["parcelRequire07ce"] = parcelRequire;
|
|
79
46
|
}
|
|
80
|
-
parcelRequire.register("
|
|
81
|
-
|
|
82
|
-
$parcel$defineInteropFlag(module.exports);
|
|
83
|
-
|
|
84
|
-
$parcel$export(module.exports, "default", () => $1e18485111e06c65$export$2e2bcd8739ae039);
|
|
85
|
-
|
|
86
|
-
parcelRequire("5F5Py");
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
var $1e18485111e06c65$export$2e2bcd8739ae039 = (0, $gGrEF$reactace);
|
|
114
|
-
|
|
115
|
-
});
|
|
116
|
-
parcelRequire.register("5F5Py", function(module, exports) {
|
|
117
|
-
// Grammar from https://github.com/sanity-io/vscode-sanity
|
|
118
|
-
const $25b57fb107cb438e$var$rules = {
|
|
119
|
-
start: [
|
|
120
|
-
{
|
|
121
|
-
include: "#query"
|
|
122
|
-
},
|
|
123
|
-
{
|
|
124
|
-
include: "#value"
|
|
125
|
-
},
|
|
126
|
-
{
|
|
127
|
-
include: "#pair"
|
|
128
|
-
},
|
|
129
|
-
],
|
|
130
|
-
"#query": [
|
|
131
|
-
{
|
|
132
|
-
include: "#nullary-access-operator"
|
|
133
|
-
},
|
|
134
|
-
{
|
|
135
|
-
include: "#arraylike"
|
|
136
|
-
},
|
|
137
|
-
{
|
|
138
|
-
include: "#pipe"
|
|
139
|
-
},
|
|
140
|
-
{
|
|
141
|
-
include: "#sort-order"
|
|
142
|
-
},
|
|
143
|
-
{
|
|
144
|
-
include: "#filter"
|
|
145
|
-
},
|
|
146
|
-
],
|
|
147
|
-
"#variable": [
|
|
148
|
-
{
|
|
149
|
-
token: "variable.other.groq",
|
|
150
|
-
regex: /\$[_A-Za-z][_0-9A-Za-z]*/
|
|
151
|
-
},
|
|
152
|
-
],
|
|
153
|
-
"#keyword": [
|
|
154
|
-
{
|
|
155
|
-
token: "keyword.other.groq",
|
|
156
|
-
regex: /\b(?:asc|desc|in|match)\b/
|
|
157
|
-
},
|
|
158
|
-
],
|
|
159
|
-
"#comparison": [
|
|
160
|
-
{
|
|
161
|
-
token: "keyword.operator.comparison.groq",
|
|
162
|
-
// eslint-disable-next-line no-div-regex
|
|
163
|
-
regex: /==|!=|>=|<=|<!=>|<|>/
|
|
164
|
-
},
|
|
165
|
-
],
|
|
166
|
-
"#operator": [
|
|
167
|
-
{
|
|
168
|
-
token: "keyword.operator.arithmetic.groq",
|
|
169
|
-
regex: /\+|-|\*{1,2}|\/|%/
|
|
170
|
-
},
|
|
171
|
-
],
|
|
172
|
-
"#pipe": [
|
|
173
|
-
{
|
|
174
|
-
token: "keyword.operator.pipe.groq",
|
|
175
|
-
regex: /\|/
|
|
176
|
-
},
|
|
177
|
-
],
|
|
178
|
-
"#logical": [
|
|
179
|
-
{
|
|
180
|
-
token: "keyword.operator.logical.groq",
|
|
181
|
-
regex: /!|&&|\|\|/
|
|
182
|
-
},
|
|
183
|
-
],
|
|
184
|
-
"#reference": [
|
|
185
|
-
{
|
|
186
|
-
token: "keyword.operator.reference.groq",
|
|
187
|
-
regex: /->/
|
|
188
|
-
},
|
|
189
|
-
],
|
|
190
|
-
"#pair": [
|
|
191
|
-
{
|
|
192
|
-
include: "#identifier"
|
|
193
|
-
},
|
|
194
|
-
{
|
|
195
|
-
include: "#value"
|
|
196
|
-
},
|
|
197
|
-
{
|
|
198
|
-
include: "#filter"
|
|
199
|
-
},
|
|
200
|
-
{
|
|
201
|
-
token: "keyword.operator.pair.groq",
|
|
202
|
-
regex: /[=]>/
|
|
203
|
-
},
|
|
204
|
-
],
|
|
205
|
-
"#arraylike": [
|
|
206
|
-
{
|
|
207
|
-
token: "punctuation.definition.bracket.begin.groq",
|
|
208
|
-
regex: /\[/,
|
|
209
|
-
push: [
|
|
210
|
-
{
|
|
211
|
-
token: [
|
|
212
|
-
"text",
|
|
213
|
-
"keyword.operator.descendant.groq"
|
|
214
|
-
],
|
|
215
|
-
regex: /(\])((?:\s*\.)?)/,
|
|
216
|
-
next: "pop"
|
|
217
|
-
},
|
|
218
|
-
{
|
|
219
|
-
include: "#range"
|
|
220
|
-
},
|
|
221
|
-
{
|
|
222
|
-
include: "#filter"
|
|
223
|
-
},
|
|
224
|
-
{
|
|
225
|
-
include: "#array-values"
|
|
226
|
-
},
|
|
227
|
-
]
|
|
228
|
-
},
|
|
229
|
-
],
|
|
230
|
-
"#array": [
|
|
231
|
-
{
|
|
232
|
-
token: "punctuation.definition.bracket.begin.groq",
|
|
233
|
-
regex: /\[/,
|
|
234
|
-
push: [
|
|
235
|
-
{
|
|
236
|
-
token: "punctuation.definition.bracket.end.groq",
|
|
237
|
-
regex: /\]/,
|
|
238
|
-
next: "pop"
|
|
239
|
-
},
|
|
240
|
-
{
|
|
241
|
-
include: "#array-values"
|
|
242
|
-
},
|
|
243
|
-
{
|
|
244
|
-
defaultToken: "meta.structure.array.groq"
|
|
245
|
-
},
|
|
246
|
-
]
|
|
247
|
-
},
|
|
248
|
-
],
|
|
249
|
-
"#range": [
|
|
250
|
-
{
|
|
251
|
-
token: [
|
|
252
|
-
"meta.structure.range.groq",
|
|
253
|
-
"constant.numeric.groq",
|
|
254
|
-
"meta.structure.range.groq",
|
|
255
|
-
"keyword.operator.range.groq",
|
|
256
|
-
"meta.structure.range.groq",
|
|
257
|
-
"constant.numeric.groq",
|
|
258
|
-
"meta.structure.range.groq",
|
|
259
|
-
],
|
|
260
|
-
regex: /(\s*)(\d+)(\s*)(\.{2,3})(\s*)(\d+)(\s*)/
|
|
261
|
-
},
|
|
262
|
-
],
|
|
263
|
-
"#spread": [
|
|
264
|
-
{
|
|
265
|
-
token: "punctuation.definition.spread.begin.groq",
|
|
266
|
-
regex: /\.\.\./,
|
|
267
|
-
push: [
|
|
268
|
-
{
|
|
269
|
-
include: "#array"
|
|
270
|
-
},
|
|
271
|
-
{
|
|
272
|
-
include: "#function-call"
|
|
273
|
-
},
|
|
274
|
-
{
|
|
275
|
-
include: "#projection"
|
|
276
|
-
},
|
|
277
|
-
{
|
|
278
|
-
token: "punctuation.definition.spread.end.groq",
|
|
279
|
-
regex: /(?=.)/,
|
|
280
|
-
next: "pop"
|
|
281
|
-
},
|
|
282
|
-
{
|
|
283
|
-
defaultToken: "meta.structure.spread.groq"
|
|
284
|
-
},
|
|
285
|
-
]
|
|
286
|
-
},
|
|
287
|
-
],
|
|
288
|
-
"#array-values": [
|
|
289
|
-
{
|
|
290
|
-
include: "#value"
|
|
291
|
-
},
|
|
292
|
-
{
|
|
293
|
-
include: "#spread"
|
|
294
|
-
},
|
|
295
|
-
{
|
|
296
|
-
token: "punctuation.separator.array.groq",
|
|
297
|
-
regex: /,/
|
|
298
|
-
},
|
|
299
|
-
{
|
|
300
|
-
token: "invalid.illegal.expected-array-separator.groq",
|
|
301
|
-
regex: /[^\s\]]/
|
|
302
|
-
},
|
|
303
|
-
],
|
|
304
|
-
"#filter": [
|
|
305
|
-
{
|
|
306
|
-
include: "#function-call"
|
|
307
|
-
},
|
|
308
|
-
{
|
|
309
|
-
include: "#keyword"
|
|
310
|
-
},
|
|
311
|
-
{
|
|
312
|
-
include: "#constant"
|
|
313
|
-
},
|
|
314
|
-
{
|
|
315
|
-
include: "#identifier"
|
|
316
|
-
},
|
|
317
|
-
{
|
|
318
|
-
include: "#value"
|
|
319
|
-
},
|
|
320
|
-
{
|
|
321
|
-
include: "#comparison"
|
|
322
|
-
},
|
|
323
|
-
{
|
|
324
|
-
include: "#operator"
|
|
325
|
-
},
|
|
326
|
-
{
|
|
327
|
-
include: "#logical"
|
|
328
|
-
},
|
|
329
|
-
],
|
|
330
|
-
"#comments": [
|
|
331
|
-
{
|
|
332
|
-
token: [
|
|
333
|
-
"punctuation.definition.comment.groq",
|
|
334
|
-
"comment.line.double-slash.js"
|
|
335
|
-
],
|
|
336
|
-
regex: /(\/\/)(.*$)/
|
|
337
|
-
},
|
|
338
|
-
],
|
|
339
|
-
"#nullary-access-operator": [
|
|
340
|
-
{
|
|
341
|
-
token: "constant.language.groq",
|
|
342
|
-
regex: /[*@^]/
|
|
343
|
-
},
|
|
344
|
-
],
|
|
345
|
-
"#constant": [
|
|
346
|
-
{
|
|
347
|
-
token: "constant.language.groq",
|
|
348
|
-
regex: /\b(?:true|false|null)\b/
|
|
349
|
-
},
|
|
350
|
-
],
|
|
351
|
-
"#number": [
|
|
352
|
-
{
|
|
353
|
-
token: "constant.numeric.groq",
|
|
354
|
-
regex: /-?(?:0|[1-9]\d*)(?:(?:\.\d+)?(?:[eE][+-]?\d+)?)?/
|
|
355
|
-
},
|
|
356
|
-
],
|
|
357
|
-
"#named-projection": [
|
|
358
|
-
{
|
|
359
|
-
include: "#identifier"
|
|
360
|
-
},
|
|
361
|
-
{
|
|
362
|
-
include: "#objectkey"
|
|
363
|
-
},
|
|
364
|
-
{
|
|
365
|
-
include: "#projection"
|
|
366
|
-
},
|
|
367
|
-
],
|
|
368
|
-
"#projection": [
|
|
369
|
-
{
|
|
370
|
-
token: "punctuation.definition.projection.begin.groq",
|
|
371
|
-
regex: /\{/,
|
|
372
|
-
push: [
|
|
373
|
-
{
|
|
374
|
-
token: "punctuation.definition.projection.end.groq",
|
|
375
|
-
regex: /\}/,
|
|
376
|
-
next: "pop"
|
|
377
|
-
},
|
|
378
|
-
{
|
|
379
|
-
include: "#identifier"
|
|
380
|
-
},
|
|
381
|
-
{
|
|
382
|
-
include: "#objectkey"
|
|
383
|
-
},
|
|
384
|
-
{
|
|
385
|
-
include: "#named-projection"
|
|
386
|
-
},
|
|
387
|
-
{
|
|
388
|
-
include: "#comments"
|
|
389
|
-
},
|
|
390
|
-
{
|
|
391
|
-
include: "#spread"
|
|
392
|
-
},
|
|
393
|
-
{
|
|
394
|
-
include: "#pair"
|
|
395
|
-
},
|
|
396
|
-
{
|
|
397
|
-
token: "punctuation.separator.projection.key-value.groq",
|
|
398
|
-
regex: /:/,
|
|
399
|
-
push: [
|
|
400
|
-
{
|
|
401
|
-
token: "punctuation.separator.projection.pair.groq",
|
|
402
|
-
regex: /,|(?=\})/,
|
|
403
|
-
next: "pop"
|
|
404
|
-
},
|
|
405
|
-
{
|
|
406
|
-
include: "#nullary-access-operator"
|
|
407
|
-
},
|
|
408
|
-
{
|
|
409
|
-
include: "#arraylike"
|
|
410
|
-
},
|
|
411
|
-
{
|
|
412
|
-
include: "#value"
|
|
413
|
-
},
|
|
414
|
-
{
|
|
415
|
-
include: "#spread"
|
|
416
|
-
},
|
|
417
|
-
{
|
|
418
|
-
include: "#identifier"
|
|
419
|
-
},
|
|
420
|
-
{
|
|
421
|
-
include: "#operator"
|
|
422
|
-
},
|
|
423
|
-
{
|
|
424
|
-
include: "#comparison"
|
|
425
|
-
},
|
|
426
|
-
{
|
|
427
|
-
include: "#pair"
|
|
428
|
-
},
|
|
429
|
-
{
|
|
430
|
-
token: "invalid.illegal.expected-projection-separator.groq",
|
|
431
|
-
regex: /[^\s,]/
|
|
432
|
-
},
|
|
433
|
-
{
|
|
434
|
-
defaultToken: "meta.structure.projection.value.groq"
|
|
435
|
-
},
|
|
436
|
-
]
|
|
437
|
-
},
|
|
438
|
-
{
|
|
439
|
-
token: "invalid.illegal.expected-projection-separator.groq",
|
|
440
|
-
regex: /[^\s},]/
|
|
441
|
-
},
|
|
442
|
-
{
|
|
443
|
-
defaultToken: "meta.structure.projection.groq"
|
|
444
|
-
},
|
|
445
|
-
]
|
|
446
|
-
},
|
|
447
|
-
],
|
|
448
|
-
"#string": [
|
|
449
|
-
{
|
|
450
|
-
include: "#single-string"
|
|
451
|
-
},
|
|
452
|
-
{
|
|
453
|
-
include: "#double-string"
|
|
454
|
-
},
|
|
455
|
-
],
|
|
456
|
-
"#double-string": [
|
|
457
|
-
{
|
|
458
|
-
token: "punctuation.definition.string.begin.groq",
|
|
459
|
-
regex: /"/,
|
|
460
|
-
push: [
|
|
461
|
-
{
|
|
462
|
-
token: "punctuation.definition.string.end.groq",
|
|
463
|
-
regex: /"/,
|
|
464
|
-
next: "pop"
|
|
465
|
-
},
|
|
466
|
-
{
|
|
467
|
-
include: "#stringcontent"
|
|
468
|
-
},
|
|
469
|
-
{
|
|
470
|
-
defaultToken: "string.quoted.double.groq"
|
|
471
|
-
},
|
|
472
|
-
]
|
|
473
|
-
},
|
|
474
|
-
],
|
|
475
|
-
"#single-string": [
|
|
476
|
-
{
|
|
477
|
-
token: "punctuation.definition.string.single.begin.groq",
|
|
478
|
-
regex: /'/,
|
|
479
|
-
push: [
|
|
480
|
-
{
|
|
481
|
-
token: "punctuation.definition.string.single.end.groq",
|
|
482
|
-
regex: /'/,
|
|
483
|
-
next: "pop"
|
|
484
|
-
},
|
|
485
|
-
{
|
|
486
|
-
include: "#stringcontent"
|
|
487
|
-
},
|
|
488
|
-
{
|
|
489
|
-
defaultToken: "string.quoted.single.groq"
|
|
490
|
-
},
|
|
491
|
-
]
|
|
492
|
-
},
|
|
493
|
-
],
|
|
494
|
-
"#objectkey": [
|
|
495
|
-
{
|
|
496
|
-
include: "#string"
|
|
497
|
-
},
|
|
498
|
-
],
|
|
499
|
-
"#stringcontent": [
|
|
500
|
-
{
|
|
501
|
-
token: "constant.character.escape.groq",
|
|
502
|
-
regex: /\\(?:["\\/bfnrt]|u[0-9a-fA-F]{4})/
|
|
503
|
-
},
|
|
504
|
-
{
|
|
505
|
-
token: "invalid.illegal.unrecognized-string-escape.groq",
|
|
506
|
-
regex: /\\./
|
|
507
|
-
},
|
|
508
|
-
],
|
|
509
|
-
"#sort-pair": [
|
|
510
|
-
{
|
|
511
|
-
token: [
|
|
512
|
-
"variable.other.readwrite.groq",
|
|
513
|
-
"text",
|
|
514
|
-
"keyword.other.groq"
|
|
515
|
-
],
|
|
516
|
-
regex: /([_A-Za-z][_0-9A-Za-z]*)(?:(\s*)(asc|desc))?/
|
|
517
|
-
},
|
|
518
|
-
{
|
|
519
|
-
token: [
|
|
520
|
-
"constant.language.groq",
|
|
521
|
-
"punctuation.definition.bracket.begin.groq"
|
|
522
|
-
],
|
|
523
|
-
regex: /(@)(\[)/,
|
|
524
|
-
push: [
|
|
525
|
-
{
|
|
526
|
-
token: [
|
|
527
|
-
"punctuation.definition.bracket.begin.groq",
|
|
528
|
-
"text",
|
|
529
|
-
"keyword.other.groq"
|
|
530
|
-
],
|
|
531
|
-
regex: /(\])(?:(\s*)(asc|desc))?/,
|
|
532
|
-
next: "pop"
|
|
533
|
-
},
|
|
534
|
-
{
|
|
535
|
-
include: "#string"
|
|
536
|
-
},
|
|
537
|
-
]
|
|
538
|
-
},
|
|
539
|
-
],
|
|
540
|
-
"#sort-order": [
|
|
541
|
-
{
|
|
542
|
-
token: "support.function.sortorder.begin.groq",
|
|
543
|
-
regex: /\border\s*\(/,
|
|
544
|
-
push: [
|
|
545
|
-
{
|
|
546
|
-
token: "support.function.sortorder.end.groq",
|
|
547
|
-
regex: /\)/,
|
|
548
|
-
next: "pop"
|
|
549
|
-
},
|
|
550
|
-
{
|
|
551
|
-
include: "#sort-pair"
|
|
552
|
-
},
|
|
553
|
-
{
|
|
554
|
-
token: "punctuation.separator.array.groq",
|
|
555
|
-
regex: /,/
|
|
556
|
-
},
|
|
557
|
-
{
|
|
558
|
-
token: "invalid.illegal.expected-sort-separator.groq",
|
|
559
|
-
regex: /[^\s\]]/
|
|
560
|
-
},
|
|
561
|
-
{
|
|
562
|
-
defaultToken: "support.function.sortorder.groq"
|
|
563
|
-
},
|
|
564
|
-
]
|
|
565
|
-
},
|
|
566
|
-
],
|
|
567
|
-
"#function-call": [
|
|
568
|
-
{
|
|
569
|
-
include: "#function-var-arg"
|
|
570
|
-
},
|
|
571
|
-
{
|
|
572
|
-
include: "#function-single-arg"
|
|
573
|
-
},
|
|
574
|
-
{
|
|
575
|
-
include: "#function-round"
|
|
576
|
-
},
|
|
577
|
-
],
|
|
578
|
-
"#function-var-arg": [
|
|
579
|
-
{
|
|
580
|
-
token: "support.function.vararg.begin.groq",
|
|
581
|
-
regex: /\b(?:coalesce|select)\s*\(/,
|
|
582
|
-
push: [
|
|
583
|
-
{
|
|
584
|
-
token: "support.function.vararg.end.groq",
|
|
585
|
-
regex: /\)/,
|
|
586
|
-
next: "pop"
|
|
587
|
-
},
|
|
588
|
-
{
|
|
589
|
-
include: "#value"
|
|
590
|
-
},
|
|
591
|
-
{
|
|
592
|
-
include: "#identifier"
|
|
593
|
-
},
|
|
594
|
-
{
|
|
595
|
-
include: "#filter"
|
|
596
|
-
},
|
|
597
|
-
{
|
|
598
|
-
include: "#pair"
|
|
599
|
-
},
|
|
600
|
-
{
|
|
601
|
-
token: "punctuation.separator.array.groq",
|
|
602
|
-
regex: /,/
|
|
603
|
-
},
|
|
604
|
-
{
|
|
605
|
-
defaultToken: "support.function.vararg.groq"
|
|
606
|
-
},
|
|
607
|
-
]
|
|
608
|
-
},
|
|
609
|
-
],
|
|
610
|
-
"#function-single-arg": [
|
|
611
|
-
{
|
|
612
|
-
token: "support.function.singlearg.begin.groq",
|
|
613
|
-
regex: /\b(?:count|defined|length|path|references)\s*\(/,
|
|
614
|
-
push: [
|
|
615
|
-
{
|
|
616
|
-
token: "support.function.singlearg.end.groq",
|
|
617
|
-
regex: /\)/,
|
|
618
|
-
next: "pop"
|
|
619
|
-
},
|
|
620
|
-
{
|
|
621
|
-
include: "#query"
|
|
622
|
-
},
|
|
623
|
-
{
|
|
624
|
-
include: "#identifier"
|
|
625
|
-
},
|
|
626
|
-
{
|
|
627
|
-
include: "#value"
|
|
628
|
-
},
|
|
629
|
-
{
|
|
630
|
-
include: "#pair"
|
|
631
|
-
},
|
|
632
|
-
{
|
|
633
|
-
defaultToken: "support.function.singlearg.groq"
|
|
634
|
-
},
|
|
635
|
-
]
|
|
636
|
-
},
|
|
637
|
-
],
|
|
638
|
-
"#identifier": [
|
|
639
|
-
{
|
|
640
|
-
token: [
|
|
641
|
-
"variable.other.readwrite.groq",
|
|
642
|
-
"text",
|
|
643
|
-
"punctuation.definition.block.js",
|
|
644
|
-
"text",
|
|
645
|
-
"keyword.operator.reference.groq",
|
|
646
|
-
],
|
|
647
|
-
regex: /([_A-Za-z][_0-9A-Za-z]*)(\s*)((?:\[\s*\])?)(\s*)(->)/
|
|
648
|
-
},
|
|
649
|
-
{
|
|
650
|
-
token: [
|
|
651
|
-
"variable.other.readwrite.groq",
|
|
652
|
-
"constant.language.groq",
|
|
653
|
-
"text",
|
|
654
|
-
"punctuation.definition.block.js",
|
|
655
|
-
"text",
|
|
656
|
-
"keyword.operator.descendant.groq",
|
|
657
|
-
],
|
|
658
|
-
regex: /(?:([_A-Za-z][_0-9A-Za-z]*)|([@^]))(\s*)((?:\[\s*\])?)(\s*)(\.)/
|
|
659
|
-
},
|
|
660
|
-
{
|
|
661
|
-
token: "variable.other.readwrite.groq",
|
|
662
|
-
regex: /[_A-Za-z][_0-9A-Za-z]*/
|
|
663
|
-
},
|
|
664
|
-
],
|
|
665
|
-
"#value": [
|
|
666
|
-
{
|
|
667
|
-
include: "#constant"
|
|
668
|
-
},
|
|
669
|
-
{
|
|
670
|
-
include: "#number"
|
|
671
|
-
},
|
|
672
|
-
{
|
|
673
|
-
include: "#string"
|
|
674
|
-
},
|
|
675
|
-
{
|
|
676
|
-
include: "#array"
|
|
677
|
-
},
|
|
678
|
-
{
|
|
679
|
-
include: "#variable"
|
|
680
|
-
},
|
|
681
|
-
{
|
|
682
|
-
include: "#projection"
|
|
683
|
-
},
|
|
684
|
-
{
|
|
685
|
-
include: "#comments"
|
|
686
|
-
},
|
|
687
|
-
{
|
|
688
|
-
include: "#function-call"
|
|
689
|
-
},
|
|
690
|
-
]
|
|
691
|
-
};
|
|
692
|
-
ace.define("ace/mode/groq_highlight_rules", [
|
|
693
|
-
"require",
|
|
694
|
-
"exports",
|
|
695
|
-
"module",
|
|
696
|
-
"ace/lib/oop",
|
|
697
|
-
"ace/mode/text_highlight_rules"
|
|
698
|
-
], (acequire, exports, _module)=>{
|
|
699
|
-
const oop = acequire("../lib/oop");
|
|
700
|
-
const TextHighlightRules = acequire("./text_highlight_rules").TextHighlightRules;
|
|
701
|
-
const GroqHighlightRules = function() {
|
|
702
|
-
/* eslint-disable @typescript-eslint/ban-ts-comment */ // @ts-ignore
|
|
703
|
-
this.$rules = $25b57fb107cb438e$var$rules;
|
|
704
|
-
// @ts-ignore
|
|
705
|
-
this.normalizeRules();
|
|
706
|
-
/* eslint-enable @typescript-eslint/ban-ts-comment */ };
|
|
707
|
-
oop.inherits(GroqHighlightRules, TextHighlightRules);
|
|
708
|
-
exports.GroqHighlightRules = GroqHighlightRules;
|
|
709
|
-
});
|
|
710
|
-
ace.define("ace/mode/groq", [
|
|
711
|
-
"require",
|
|
712
|
-
"exports",
|
|
713
|
-
"module",
|
|
714
|
-
"ace/lib/oop",
|
|
715
|
-
"ace/mode/text",
|
|
716
|
-
"ace/tokenizer",
|
|
717
|
-
"ace/mode/groq_highlight_rules",
|
|
718
|
-
"ace/mode/folding/cstyle",
|
|
719
|
-
], (acequire, exports, _module)=>{
|
|
720
|
-
// eslint-disable-next-line strict
|
|
721
|
-
"use strict";
|
|
722
|
-
const oop = acequire("../lib/oop");
|
|
723
|
-
const TextMode = acequire("./text").Mode;
|
|
724
|
-
const Tokenizer = acequire("../tokenizer").Tokenizer;
|
|
725
|
-
const GroqHighlightRules = acequire("./groq_highlight_rules").GroqHighlightRules;
|
|
726
|
-
const FoldMode = acequire("./folding/cstyle").FoldMode;
|
|
727
|
-
const Mode = function() {
|
|
728
|
-
/* eslint-disable @typescript-eslint/ban-ts-comment */ const highlighter = new GroqHighlightRules();
|
|
729
|
-
// @ts-ignore
|
|
730
|
-
this.foldingRules = new FoldMode();
|
|
731
|
-
// @ts-ignore
|
|
732
|
-
this.$tokenizer = new Tokenizer(highlighter.getRules());
|
|
733
|
-
// @ts-ignore
|
|
734
|
-
this.$keywordList = highlighter.$keywordList;
|
|
735
|
-
/* eslint-enable @typescript-eslint/ban-ts-comment */ };
|
|
736
|
-
oop.inherits(Mode, TextMode);
|
|
737
|
-
(function() {
|
|
738
|
-
/* eslint-disable @typescript-eslint/ban-ts-comment */ // @ts-ignore
|
|
739
|
-
this.lineCommentStart = "'";
|
|
740
|
-
/* eslint-enable @typescript-eslint/ban-ts-comment */ }).call(Mode.prototype);
|
|
741
|
-
exports.Mode = Mode;
|
|
742
|
-
});
|
|
47
|
+
parcelRequire.register("2G5mr", function(module, exports) {
|
|
48
|
+
module.exports = import("./editorSupport.739e7d0c.js").then(()=>parcelRequire("f97Qe"));
|
|
743
49
|
|
|
744
50
|
});
|
|
745
51
|
|
|
@@ -752,7 +58,6 @@ ace.define("ace/mode/groq", [
|
|
|
752
58
|
|
|
753
59
|
|
|
754
60
|
|
|
755
|
-
|
|
756
61
|
const $b67a72b22aed35f4$export$ac98e174937d3154 = (0, $gGrEF$css)`
|
|
757
62
|
.ace_editor_markers_highlight {
|
|
758
63
|
position: absolute;
|
|
@@ -900,7 +205,7 @@ const $513a6452b1f07fd5$export$4f74600301fa25db = [
|
|
|
900
205
|
|
|
901
206
|
|
|
902
207
|
|
|
903
|
-
const $7a6230964e09fbf7$export$476686f2cdb5577f = /*#__PURE__*/ (0, $gGrEF$react).lazy(()=>
|
|
208
|
+
const $7a6230964e09fbf7$export$476686f2cdb5577f = /*#__PURE__*/ (0, $gGrEF$react).lazy(()=>(parcelRequire("2G5mr")));
|
|
904
209
|
function $7a6230964e09fbf7$export$99999bc9085b44fd() {
|
|
905
210
|
const [mounted, setMounted] = (0, $gGrEF$useState)(false);
|
|
906
211
|
(0, $gGrEF$useEffect)(()=>{
|
|
@@ -1082,32 +387,28 @@ function $a1d4bfd2763f687f$export$20d4ca75cb144ab0(props) {
|
|
|
1082
387
|
radius: 1,
|
|
1083
388
|
shadow: 1,
|
|
1084
389
|
readOnly: readOnly,
|
|
1085
|
-
children: AceEditor && /*#__PURE__*/ (0, $gGrEF$
|
|
390
|
+
children: AceEditor && /*#__PURE__*/ (0, $gGrEF$jsx)((0, $gGrEF$Suspense), {
|
|
1086
391
|
fallback: /*#__PURE__*/ (0, $gGrEF$jsx)("div", {
|
|
1087
392
|
children: "Loading code editor..."
|
|
1088
393
|
}),
|
|
1089
|
-
children:
|
|
1090
|
-
|
|
1091
|
-
|
|
1092
|
-
|
|
1093
|
-
|
|
1094
|
-
|
|
1095
|
-
|
|
1096
|
-
|
|
1097
|
-
|
|
1098
|
-
|
|
1099
|
-
|
|
1100
|
-
|
|
1101
|
-
|
|
1102
|
-
|
|
1103
|
-
|
|
1104
|
-
|
|
1105
|
-
|
|
1106
|
-
|
|
1107
|
-
onBlur: onBlur
|
|
1108
|
-
}),
|
|
1109
|
-
")"
|
|
1110
|
-
]
|
|
394
|
+
children: /*#__PURE__*/ (0, $gGrEF$jsx)(AceEditor, {
|
|
395
|
+
ref: aceEditorRef,
|
|
396
|
+
mode: mode1,
|
|
397
|
+
theme: theme,
|
|
398
|
+
width: "100%",
|
|
399
|
+
onChange: handleCodeChange,
|
|
400
|
+
name: inputProps.id,
|
|
401
|
+
value: inputProps.value,
|
|
402
|
+
markers: value && value.highlightedLines ? (0, $b67a72b22aed35f4$export$2e2bcd8739ae039)(value.highlightedLines) : undefined,
|
|
403
|
+
onLoad: handleEditorLoad,
|
|
404
|
+
readOnly: readOnly,
|
|
405
|
+
tabSize: 2,
|
|
406
|
+
wrapEnabled: true,
|
|
407
|
+
setOptions: (0, $513a6452b1f07fd5$export$1d910bb34606e145),
|
|
408
|
+
editorProps: (0, $513a6452b1f07fd5$export$24aa1be5d8c3cd08),
|
|
409
|
+
onFocus: handleCodeFocus,
|
|
410
|
+
onBlur: onBlur
|
|
411
|
+
})
|
|
1111
412
|
})
|
|
1112
413
|
});
|
|
1113
414
|
}, [
|
|
@@ -1157,7 +458,6 @@ function $a1d4bfd2763f687f$export$20d4ca75cb144ab0(props) {
|
|
|
1157
458
|
|
|
1158
459
|
|
|
1159
460
|
|
|
1160
|
-
parcelRequire("f97Qe");
|
|
1161
461
|
const $0fe3fd43374a598c$var$PreviewContainer = (0, $gGrEF$styledcomponents)((0, $gGrEF$Box))`
|
|
1162
462
|
position: relative;
|
|
1163
463
|
`;
|
|
@@ -1192,28 +492,34 @@ function $0fe3fd43374a598c$export$2e2bcd8739ae039(props) {
|
|
|
1192
492
|
const { value: value , type: type } = props;
|
|
1193
493
|
const fixedLanguage = type?.options?.language;
|
|
1194
494
|
const mode = value?.language || fixedLanguage || "text";
|
|
495
|
+
const AceEditor = (0, $7a6230964e09fbf7$export$99999bc9085b44fd)();
|
|
1195
496
|
return /*#__PURE__*/ (0, $gGrEF$jsx)($0fe3fd43374a598c$var$PreviewContainer, {
|
|
1196
497
|
children: /*#__PURE__*/ (0, $gGrEF$jsx)($0fe3fd43374a598c$var$PreviewInner, {
|
|
1197
498
|
padding: 4,
|
|
1198
|
-
children: /*#__PURE__*/ (0, $gGrEF$jsx)((0, $gGrEF$
|
|
1199
|
-
|
|
1200
|
-
|
|
1201
|
-
|
|
1202
|
-
|
|
1203
|
-
|
|
1204
|
-
|
|
1205
|
-
|
|
1206
|
-
|
|
1207
|
-
|
|
1208
|
-
|
|
1209
|
-
|
|
1210
|
-
|
|
1211
|
-
|
|
1212
|
-
|
|
1213
|
-
|
|
1214
|
-
|
|
1215
|
-
|
|
1216
|
-
|
|
499
|
+
children: AceEditor && /*#__PURE__*/ (0, $gGrEF$jsx)((0, $gGrEF$Suspense), {
|
|
500
|
+
fallback: /*#__PURE__*/ (0, $gGrEF$jsx)("div", {
|
|
501
|
+
children: "Loading code editor..."
|
|
502
|
+
}),
|
|
503
|
+
children: /*#__PURE__*/ (0, $gGrEF$jsx)(AceEditor, {
|
|
504
|
+
ref: aceEditorRef,
|
|
505
|
+
focus: false,
|
|
506
|
+
mode: mode,
|
|
507
|
+
theme: "monokai",
|
|
508
|
+
width: "100%",
|
|
509
|
+
onChange: handleEditorChange,
|
|
510
|
+
maxLines: 200,
|
|
511
|
+
readOnly: true,
|
|
512
|
+
wrapEnabled: true,
|
|
513
|
+
showPrintMargin: false,
|
|
514
|
+
highlightActiveLine: false,
|
|
515
|
+
cursorStart: -1,
|
|
516
|
+
value: value && value.code || "",
|
|
517
|
+
markers: value && value.highlightedLines ? (0, $b67a72b22aed35f4$export$2e2bcd8739ae039)(value.highlightedLines) : undefined,
|
|
518
|
+
tabSize: 2,
|
|
519
|
+
showGutter: false,
|
|
520
|
+
setOptions: (0, $513a6452b1f07fd5$export$1d910bb34606e145),
|
|
521
|
+
editorProps: (0, $513a6452b1f07fd5$export$24aa1be5d8c3cd08)
|
|
522
|
+
})
|
|
1217
523
|
})
|
|
1218
524
|
})
|
|
1219
525
|
});
|