@sanity/code-input 2.29.5-get-started-template.14 → 2.29.5-purple-unicorn.806

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.
Files changed (113) hide show
  1. package/CodeInput.js +7 -0
  2. package/deprecatedSchema.js +7 -0
  3. package/lib/CodeInput.cjs +39 -0
  4. package/lib/CodeInput.cjs.map +1 -0
  5. package/lib/CodeInput.js +33 -333
  6. package/lib/CodeInput.js.map +1 -0
  7. package/lib/_CodeInput-d6f5810b.js +846 -0
  8. package/lib/_CodeInput-d6f5810b.js.map +1 -0
  9. package/lib/_CodeInput-f70e9606.cjs +857 -0
  10. package/lib/_CodeInput-f70e9606.cjs.map +1 -0
  11. package/lib/_reExport.js +19 -0
  12. package/lib/deprecatedSchema.cjs +23 -0
  13. package/lib/deprecatedSchema.cjs.map +1 -0
  14. package/lib/deprecatedSchema.js +19 -24
  15. package/lib/deprecatedSchema.js.map +1 -0
  16. package/lib/dts/src/CodeInput.d.ts +17 -0
  17. package/lib/dts/src/CodeInput.d.ts.map +1 -0
  18. package/lib/dts/src/CodeInput.js +155 -0
  19. package/lib/dts/src/CodeInput.js.map +1 -0
  20. package/{dist/dts → lib/dts/src}/PreviewCode.d.ts +8 -8
  21. package/lib/dts/src/PreviewCode.d.ts.map +1 -0
  22. package/lib/dts/src/PreviewCode.js +50 -0
  23. package/lib/dts/src/PreviewCode.js.map +1 -0
  24. package/lib/dts/src/__workshop__/dev.d.ts +3 -0
  25. package/lib/dts/src/__workshop__/dev.d.ts.map +1 -0
  26. package/lib/dts/src/__workshop__/dev.js +18 -0
  27. package/lib/dts/src/__workshop__/dev.js.map +1 -0
  28. package/lib/dts/src/__workshop__/index.d.ts +3 -0
  29. package/lib/dts/src/__workshop__/index.d.ts.map +1 -0
  30. package/lib/dts/src/__workshop__/index.js +10 -0
  31. package/lib/dts/src/__workshop__/index.js.map +1 -0
  32. package/{dist/dts → lib/dts/src}/config.d.ts +15 -15
  33. package/lib/dts/src/config.d.ts.map +1 -0
  34. package/lib/dts/src/config.js +38 -0
  35. package/lib/dts/src/config.js.map +1 -0
  36. package/{dist/dts → lib/dts/src}/createHighlightMarkers.d.ts +3 -3
  37. package/lib/dts/src/createHighlightMarkers.d.ts.map +1 -0
  38. package/lib/dts/src/createHighlightMarkers.js +22 -0
  39. package/lib/dts/src/createHighlightMarkers.js.map +1 -0
  40. package/{dist/dts → lib/dts/src}/deprecatedSchema.d.ts +11 -11
  41. package/lib/dts/src/deprecatedSchema.d.ts.map +1 -0
  42. package/lib/dts/src/deprecatedSchema.js +19 -0
  43. package/lib/dts/src/deprecatedSchema.js.map +1 -0
  44. package/{dist/dts → lib/dts/src}/editorSupport.d.ts +27 -27
  45. package/lib/dts/src/editorSupport.d.ts.map +1 -0
  46. package/lib/dts/src/editorSupport.js +32 -0
  47. package/lib/dts/src/editorSupport.js.map +1 -0
  48. package/{dist/dts → lib/dts/src}/getMedia.d.ts +2 -2
  49. package/lib/dts/src/getMedia.d.ts.map +1 -0
  50. package/lib/dts/src/getMedia.js +35 -0
  51. package/lib/dts/src/getMedia.js.map +1 -0
  52. package/lib/dts/src/groq.d.ts +2 -0
  53. package/lib/dts/src/groq.d.ts.map +1 -0
  54. package/lib/dts/src/groq.js +612 -0
  55. package/lib/dts/src/groq.js.map +1 -0
  56. package/lib/dts/src/index.d.ts +4 -0
  57. package/lib/dts/src/index.d.ts.map +1 -0
  58. package/lib/dts/src/index.js +7 -0
  59. package/lib/dts/src/index.js.map +1 -0
  60. package/lib/dts/src/schema.d.ts +47 -0
  61. package/lib/dts/src/schema.d.ts.map +1 -0
  62. package/lib/dts/src/schema.js +59 -0
  63. package/lib/dts/src/schema.js.map +1 -0
  64. package/{dist/dts → lib/dts/src}/types.d.ts +28 -28
  65. package/lib/dts/src/types.d.ts.map +1 -0
  66. package/lib/dts/src/types.js +2 -0
  67. package/lib/dts/src/types.js.map +1 -0
  68. package/lib/dts/tsconfig.tsbuildinfo +1 -0
  69. package/lib/index.cjs +45 -0
  70. package/lib/index.cjs.map +1 -0
  71. package/lib/index.js +43 -0
  72. package/lib/index.js.map +1 -0
  73. package/lib/schema.cjs +174 -0
  74. package/lib/schema.cjs.map +1 -0
  75. package/lib/schema.js +159 -62
  76. package/lib/schema.js.map +1 -0
  77. package/package.json +63 -12
  78. package/schema.js +7 -0
  79. package/src/CodeInput.tsx +327 -0
  80. package/src/PreviewCode.tsx +89 -0
  81. package/src/__workshop__/dev.tsx +35 -0
  82. package/src/__workshop__/index.ts +10 -0
  83. package/src/config.ts +45 -0
  84. package/src/createHighlightMarkers.ts +24 -0
  85. package/src/deprecatedSchema.ts +19 -0
  86. package/src/editorSupport.ts +33 -0
  87. package/src/getMedia.tsx +95 -0
  88. package/src/groq.ts +630 -0
  89. package/src/index.ts +11 -0
  90. package/src/schema.tsx +69 -0
  91. package/src/types.ts +26 -0
  92. package/dist/dts/CodeInput.d.ts +0 -23
  93. package/dist/dts/CodeInput.d.ts.map +0 -1
  94. package/dist/dts/PreviewCode.d.ts.map +0 -1
  95. package/dist/dts/config.d.ts.map +0 -1
  96. package/dist/dts/createHighlightMarkers.d.ts.map +0 -1
  97. package/dist/dts/deprecatedSchema.d.ts.map +0 -1
  98. package/dist/dts/editorSupport.d.ts.map +0 -1
  99. package/dist/dts/getMedia.d.ts.map +0 -1
  100. package/dist/dts/groq.d.ts +0 -376
  101. package/dist/dts/groq.d.ts.map +0 -1
  102. package/dist/dts/schema.d.ts +0 -44
  103. package/dist/dts/schema.d.ts.map +0 -1
  104. package/dist/dts/types.d.ts.map +0 -1
  105. package/lib/@types/css.d.js +0 -1
  106. package/lib/PreviewCode.js +0 -79
  107. package/lib/config.js +0 -103
  108. package/lib/createHighlightMarkers.js +0 -31
  109. package/lib/editorSupport.js +0 -55
  110. package/lib/getMedia.js +0 -110
  111. package/lib/groq.js +0 -414
  112. package/lib/types.js +0 -5
  113. package/tsconfig.json +0 -26
package/lib/groq.js DELETED
@@ -1,414 +0,0 @@
1
- "use strict";
2
-
3
- /* eslint-disable no-undef */
4
- // Grammar from https://github.com/sanity-io/vscode-sanity
5
- var rules = {
6
- start: [{
7
- include: '#query'
8
- }, {
9
- include: '#value'
10
- }, {
11
- include: '#pair'
12
- }],
13
- '#query': [{
14
- include: '#nullary-access-operator'
15
- }, {
16
- include: '#arraylike'
17
- }, {
18
- include: '#pipe'
19
- }, {
20
- include: '#sort-order'
21
- }, {
22
- include: '#filter'
23
- }],
24
- '#variable': [{
25
- token: 'variable.other.groq',
26
- regex: /\$[_A-Za-z][_0-9A-Za-z]*/
27
- }],
28
- '#keyword': [{
29
- token: 'keyword.other.groq',
30
- regex: /\b(?:asc|desc|in|match)\b/
31
- }],
32
- '#comparison': [{
33
- token: 'keyword.operator.comparison.groq',
34
- // eslint-disable-next-line no-div-regex
35
- regex: /==|!=|>=|<=|<!=>|<|>/
36
- }],
37
- '#operator': [{
38
- token: 'keyword.operator.arithmetic.groq',
39
- regex: /\+|-|\*{1,2}|\/|%/
40
- }],
41
- '#pipe': [{
42
- token: 'keyword.operator.pipe.groq',
43
- regex: /\|/
44
- }],
45
- '#logical': [{
46
- token: 'keyword.operator.logical.groq',
47
- regex: /!|&&|\|\|/
48
- }],
49
- '#reference': [{
50
- token: 'keyword.operator.reference.groq',
51
- regex: /->/
52
- }],
53
- '#pair': [{
54
- include: '#identifier'
55
- }, {
56
- include: '#value'
57
- }, {
58
- include: '#filter'
59
- }, {
60
- token: 'keyword.operator.pair.groq',
61
- regex: /[=]>/
62
- }],
63
- '#arraylike': [{
64
- token: 'punctuation.definition.bracket.begin.groq',
65
- regex: /\[/,
66
- push: [{
67
- token: ['text', 'keyword.operator.descendant.groq'],
68
- regex: /(\])((?:\s*\.)?)/,
69
- next: 'pop'
70
- }, {
71
- include: '#range'
72
- }, {
73
- include: '#filter'
74
- }, {
75
- include: '#array-values'
76
- }]
77
- }],
78
- '#array': [{
79
- token: 'punctuation.definition.bracket.begin.groq',
80
- regex: /\[/,
81
- push: [{
82
- token: 'punctuation.definition.bracket.end.groq',
83
- regex: /\]/,
84
- next: 'pop'
85
- }, {
86
- include: '#array-values'
87
- }, {
88
- defaultToken: 'meta.structure.array.groq'
89
- }]
90
- }],
91
- '#range': [{
92
- token: ['meta.structure.range.groq', 'constant.numeric.groq', 'meta.structure.range.groq', 'keyword.operator.range.groq', 'meta.structure.range.groq', 'constant.numeric.groq', 'meta.structure.range.groq'],
93
- regex: /(\s*)(\d+)(\s*)(\.{2,3})(\s*)(\d+)(\s*)/
94
- }],
95
- '#spread': [{
96
- token: 'punctuation.definition.spread.begin.groq',
97
- regex: /\.\.\./,
98
- push: [{
99
- include: '#array'
100
- }, {
101
- include: '#function-call'
102
- }, {
103
- include: '#projection'
104
- }, {
105
- token: 'punctuation.definition.spread.end.groq',
106
- regex: /(?=.)/,
107
- next: 'pop'
108
- }, {
109
- defaultToken: 'meta.structure.spread.groq'
110
- }]
111
- }],
112
- '#array-values': [{
113
- include: '#value'
114
- }, {
115
- include: '#spread'
116
- }, {
117
- token: 'punctuation.separator.array.groq',
118
- regex: /,/
119
- }, {
120
- token: 'invalid.illegal.expected-array-separator.groq',
121
- regex: /[^\s\]]/
122
- }],
123
- '#filter': [{
124
- include: '#function-call'
125
- }, {
126
- include: '#keyword'
127
- }, {
128
- include: '#constant'
129
- }, {
130
- include: '#identifier'
131
- }, {
132
- include: '#value'
133
- }, {
134
- include: '#comparison'
135
- }, {
136
- include: '#operator'
137
- }, {
138
- include: '#logical'
139
- }],
140
- '#comments': [{
141
- token: ['punctuation.definition.comment.groq', 'comment.line.double-slash.js'],
142
- regex: /(\/\/)(.*$)/
143
- }],
144
- '#nullary-access-operator': [{
145
- token: 'constant.language.groq',
146
- regex: /[*@^]/
147
- }],
148
- '#constant': [{
149
- token: 'constant.language.groq',
150
- regex: /\b(?:true|false|null)\b/
151
- }],
152
- '#number': [{
153
- token: 'constant.numeric.groq',
154
- regex: /-?(?:0|[1-9]\d*)(?:(?:\.\d+)?(?:[eE][+-]?\d+)?)?/
155
- }],
156
- '#named-projection': [{
157
- include: '#identifier'
158
- }, {
159
- include: '#objectkey'
160
- }, {
161
- include: '#projection'
162
- }],
163
- '#projection': [{
164
- token: 'punctuation.definition.projection.begin.groq',
165
- regex: /\{/,
166
- push: [{
167
- token: 'punctuation.definition.projection.end.groq',
168
- regex: /\}/,
169
- next: 'pop'
170
- }, {
171
- include: '#identifier'
172
- }, {
173
- include: '#objectkey'
174
- }, {
175
- include: '#named-projection'
176
- }, {
177
- include: '#comments'
178
- }, {
179
- include: '#spread'
180
- }, {
181
- include: '#pair'
182
- }, {
183
- token: 'punctuation.separator.projection.key-value.groq',
184
- regex: /:/,
185
- push: [{
186
- token: 'punctuation.separator.projection.pair.groq',
187
- regex: /,|(?=\})/,
188
- next: 'pop'
189
- }, {
190
- include: '#nullary-access-operator'
191
- }, {
192
- include: '#arraylike'
193
- }, {
194
- include: '#value'
195
- }, {
196
- include: '#spread'
197
- }, {
198
- include: '#identifier'
199
- }, {
200
- include: '#operator'
201
- }, {
202
- include: '#comparison'
203
- }, {
204
- include: '#pair'
205
- }, {
206
- token: 'invalid.illegal.expected-projection-separator.groq',
207
- regex: /[^\s,]/
208
- }, {
209
- defaultToken: 'meta.structure.projection.value.groq'
210
- }]
211
- }, {
212
- token: 'invalid.illegal.expected-projection-separator.groq',
213
- regex: /[^\s},]/
214
- }, {
215
- defaultToken: 'meta.structure.projection.groq'
216
- }]
217
- }],
218
- '#string': [{
219
- include: '#single-string'
220
- }, {
221
- include: '#double-string'
222
- }],
223
- '#double-string': [{
224
- token: 'punctuation.definition.string.begin.groq',
225
- regex: /"/,
226
- push: [{
227
- token: 'punctuation.definition.string.end.groq',
228
- regex: /"/,
229
- next: 'pop'
230
- }, {
231
- include: '#stringcontent'
232
- }, {
233
- defaultToken: 'string.quoted.double.groq'
234
- }]
235
- }],
236
- '#single-string': [{
237
- token: 'punctuation.definition.string.single.begin.groq',
238
- regex: /'/,
239
- push: [{
240
- token: 'punctuation.definition.string.single.end.groq',
241
- regex: /'/,
242
- next: 'pop'
243
- }, {
244
- include: '#stringcontent'
245
- }, {
246
- defaultToken: 'string.quoted.single.groq'
247
- }]
248
- }],
249
- '#objectkey': [{
250
- include: '#string'
251
- }],
252
- '#stringcontent': [{
253
- token: 'constant.character.escape.groq',
254
- regex: /\\(?:["\\/bfnrt]|u[0-9a-fA-F]{4})/
255
- }, {
256
- token: 'invalid.illegal.unrecognized-string-escape.groq',
257
- regex: /\\./
258
- }],
259
- '#sort-pair': [{
260
- token: ['variable.other.readwrite.groq', 'text', 'keyword.other.groq'],
261
- regex: /([_A-Za-z][_0-9A-Za-z]*)(?:(\s*)(asc|desc))?/
262
- }, {
263
- token: ['constant.language.groq', 'punctuation.definition.bracket.begin.groq'],
264
- regex: /(@)(\[)/,
265
- push: [{
266
- token: ['punctuation.definition.bracket.begin.groq', 'text', 'keyword.other.groq'],
267
- regex: /(\])(?:(\s*)(asc|desc))?/,
268
- next: 'pop'
269
- }, {
270
- include: '#string'
271
- }]
272
- }],
273
- '#sort-order': [{
274
- token: 'support.function.sortorder.begin.groq',
275
- regex: /\border\s*\(/,
276
- push: [{
277
- token: 'support.function.sortorder.end.groq',
278
- regex: /\)/,
279
- next: 'pop'
280
- }, {
281
- include: '#sort-pair'
282
- }, {
283
- token: 'punctuation.separator.array.groq',
284
- regex: /,/
285
- }, {
286
- token: 'invalid.illegal.expected-sort-separator.groq',
287
- regex: /[^\s\]]/
288
- }, {
289
- defaultToken: 'support.function.sortorder.groq'
290
- }]
291
- }],
292
- '#function-call': [{
293
- include: '#function-var-arg'
294
- }, {
295
- include: '#function-single-arg'
296
- }, {
297
- include: '#function-round'
298
- }],
299
- '#function-var-arg': [{
300
- token: 'support.function.vararg.begin.groq',
301
- regex: /\b(?:coalesce|select)\s*\(/,
302
- push: [{
303
- token: 'support.function.vararg.end.groq',
304
- regex: /\)/,
305
- next: 'pop'
306
- }, {
307
- include: '#value'
308
- }, {
309
- include: '#identifier'
310
- }, {
311
- include: '#filter'
312
- }, {
313
- include: '#pair'
314
- }, {
315
- token: 'punctuation.separator.array.groq',
316
- regex: /,/
317
- }, {
318
- defaultToken: 'support.function.vararg.groq'
319
- }]
320
- }],
321
- '#function-single-arg': [{
322
- token: 'support.function.singlearg.begin.groq',
323
- regex: /\b(?:count|defined|length|path|references)\s*\(/,
324
- push: [{
325
- token: 'support.function.singlearg.end.groq',
326
- regex: /\)/,
327
- next: 'pop'
328
- }, {
329
- include: '#query'
330
- }, {
331
- include: '#identifier'
332
- }, {
333
- include: '#value'
334
- }, {
335
- include: '#pair'
336
- }, {
337
- defaultToken: 'support.function.singlearg.groq'
338
- }]
339
- }],
340
- '#identifier': [{
341
- token: ['variable.other.readwrite.groq', 'text', 'punctuation.definition.block.js', 'text', 'keyword.operator.reference.groq'],
342
- regex: /([_A-Za-z][_0-9A-Za-z]*)(\s*)((?:\[\s*\])?)(\s*)(->)/
343
- }, {
344
- token: ['variable.other.readwrite.groq', 'constant.language.groq', 'text', 'punctuation.definition.block.js', 'text', 'keyword.operator.descendant.groq'],
345
- regex: /(?:([_A-Za-z][_0-9A-Za-z]*)|([@^]))(\s*)((?:\[\s*\])?)(\s*)(\.)/
346
- }, {
347
- token: 'variable.other.readwrite.groq',
348
- regex: /[_A-Za-z][_0-9A-Za-z]*/
349
- }],
350
- '#value': [{
351
- include: '#constant'
352
- }, {
353
- include: '#number'
354
- }, {
355
- include: '#string'
356
- }, {
357
- include: '#array'
358
- }, {
359
- include: '#variable'
360
- }, {
361
- include: '#projection'
362
- }, {
363
- include: '#comments'
364
- }, {
365
- include: '#function-call'
366
- }]
367
- };
368
- ace.define('ace/mode/groq_highlight_rules', ['require', 'exports', 'module', 'ace/lib/oop', 'ace/mode/text_highlight_rules'], function (acequire, exports, _module) {
369
- var oop = acequire('../lib/oop');
370
- var TextHighlightRules = acequire('./text_highlight_rules').TextHighlightRules;
371
-
372
- var GroqHighlightRules = function GroqHighlightRules() {
373
- /* eslint-disable @typescript-eslint/ban-ts-comment */
374
- // @ts-ignore
375
- this.$rules = rules; // @ts-ignore
376
-
377
- this.normalizeRules();
378
- /* eslint-enable @typescript-eslint/ban-ts-comment */
379
- };
380
-
381
- oop.inherits(GroqHighlightRules, TextHighlightRules);
382
- exports.GroqHighlightRules = GroqHighlightRules;
383
- });
384
- ace.define('ace/mode/groq', ['require', 'exports', 'module', 'ace/lib/oop', 'ace/mode/text', 'ace/tokenizer', 'ace/mode/groq_highlight_rules', 'ace/mode/folding/cstyle'], function (acequire, exports, _module) {
385
- // eslint-disable-next-line strict
386
- 'use strict';
387
-
388
- var oop = acequire('../lib/oop');
389
- var TextMode = acequire('./text').Mode;
390
- var Tokenizer = acequire('../tokenizer').Tokenizer;
391
- var GroqHighlightRules = acequire('./groq_highlight_rules').GroqHighlightRules;
392
- var FoldMode = acequire('./folding/cstyle').FoldMode;
393
-
394
- var Mode = function Mode() {
395
- /* eslint-disable @typescript-eslint/ban-ts-comment */
396
- var highlighter = new GroqHighlightRules(); // @ts-ignore
397
-
398
- this.foldingRules = new FoldMode(); // @ts-ignore
399
-
400
- this.$tokenizer = new Tokenizer(highlighter.getRules()); // @ts-ignore
401
-
402
- this.$keywordList = highlighter.$keywordList;
403
- /* eslint-enable @typescript-eslint/ban-ts-comment */
404
- };
405
-
406
- oop.inherits(Mode, TextMode);
407
- (function () {
408
- /* eslint-disable @typescript-eslint/ban-ts-comment */
409
- // @ts-ignore
410
- this.lineCommentStart = "'";
411
- /* eslint-enable @typescript-eslint/ban-ts-comment */
412
- }).call(Mode.prototype);
413
- exports.Mode = Mode;
414
- });
package/lib/types.js DELETED
@@ -1,5 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
package/tsconfig.json DELETED
@@ -1,26 +0,0 @@
1
- {
2
- "extends": "../../../tsconfig",
3
- "include": ["src"],
4
- "compilerOptions": {
5
- "composite": true,
6
- "outDir": "./dist/dts",
7
- "rootDir": "./src",
8
- "checkJs": true,
9
- "allowJs": true,
10
- "jsx": "react"
11
- },
12
- "references": [
13
- {
14
- "path": "../base"
15
- },
16
- {
17
- "path": "../form-builder"
18
- },
19
- {
20
- "path": "../types"
21
- },
22
- {
23
- "path": "../util"
24
- }
25
- ]
26
- }