@sanity/code-input 2.29.5-get-started-template.13 → 2.29.5-purple-unicorn.779

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/src/types.ts ADDED
@@ -0,0 +1,26 @@
1
+ export interface CodeInputLanguage {
2
+ title: string
3
+ value: string
4
+ mode?: string
5
+ }
6
+
7
+ export interface CodeInputType {
8
+ name?: string
9
+ title?: string
10
+ description?: string
11
+ fields: {name: string; title?: string; placeholder?: string}[]
12
+ options?: {
13
+ theme?: string
14
+ languageAlternatives: CodeInputLanguage[]
15
+ language: string
16
+ withFilename?: boolean
17
+ }
18
+ }
19
+
20
+ export interface CodeInputValue {
21
+ _type?: 'code'
22
+ code?: string
23
+ filename?: string
24
+ language?: string
25
+ highlightedLines?: number[]
26
+ }
@@ -1,23 +0,0 @@
1
- import React from 'react';
2
- import { FormFieldPresence } from '@sanity/base/presence';
3
- import { Path, Marker } from '@sanity/types';
4
- import { CodeInputType, CodeInputValue } from './types';
5
- import './editorSupport';
6
- export interface CodeInputProps {
7
- compareValue?: CodeInputValue;
8
- focusPath: Path;
9
- level: number;
10
- markers: Marker[];
11
- onBlur: () => void;
12
- onChange: (...args: any[]) => void;
13
- onFocus: (path: Path) => void;
14
- presence: FormFieldPresence[];
15
- readOnly?: boolean;
16
- type: CodeInputType;
17
- value?: CodeInputValue;
18
- }
19
- declare const CodeInput: React.ForwardRefExoticComponent<CodeInputProps & React.RefAttributes<{
20
- focus: () => void;
21
- }>>;
22
- export default CodeInput;
23
- //# sourceMappingURL=CodeInput.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"CodeInput.d.ts","sourceRoot":"","sources":["../../src/CodeInput.tsx"],"names":[],"mappings":"AAGA,OAAO,KAA4D,MAAM,OAAO,CAAA;AAChF,OAAO,EAAC,iBAAiB,EAAC,MAAM,uBAAuB,CAAA;AAEvD,OAAO,EAAC,IAAI,EAAE,MAAM,EAAC,MAAM,eAAe,CAAA;AAS1C,OAAO,EAAoB,aAAa,EAAE,cAAc,EAAC,MAAM,SAAS,CAAA;AAExE,OAAO,iBAAiB,CAAA;AAsCxB,MAAM,WAAW,cAAc;IAC7B,YAAY,CAAC,EAAE,cAAc,CAAA;IAC7B,SAAS,EAAE,IAAI,CAAA;IACf,KAAK,EAAE,MAAM,CAAA;IACb,OAAO,EAAE,MAAM,EAAE,CAAA;IACjB,MAAM,EAAE,MAAM,IAAI,CAAA;IAClB,QAAQ,EAAE,CAAC,GAAG,IAAI,EAAE,GAAG,EAAE,KAAK,IAAI,CAAA;IAClC,OAAO,EAAE,CAAC,IAAI,EAAE,IAAI,KAAK,IAAI,CAAA;IAC7B,QAAQ,EAAE,iBAAiB,EAAE,CAAA;IAC7B,QAAQ,CAAC,EAAE,OAAO,CAAA;IAClB,IAAI,EAAE,aAAa,CAAA;IACnB,KAAK,CAAC,EAAE,cAAc,CAAA;CACvB;AAkBD,QAAA,MAAM,SAAS;WAC2C,MAAM,IAAI;GAmVnE,CAAA;AAID,eAAe,SAAS,CAAA"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"PreviewCode.d.ts","sourceRoot":"","sources":["../../src/PreviewCode.tsx"],"names":[],"mappings":";AAMA,OAAO,EAAC,aAAa,EAAE,cAAc,EAAC,MAAM,SAAS,CAAA;AAErD,OAAO,iBAAiB,CAAA;AAqBxB,MAAM,WAAW,gBAAgB;IAC/B,IAAI,CAAC,EAAE,aAAa,CAAA;IACpB,KAAK,CAAC,EAAE,cAAc,CAAA;CACvB;AAED,MAAM,CAAC,OAAO,UAAU,WAAW,CAAC,KAAK,EAAE,gBAAgB,eAsD1D"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../../src/config.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,iBAAiB,EAAC,MAAM,SAAS,CAAA;AAGzC,eAAO,MAAM,mBAAmB,EAAE,iBAAiB,EAwBlD,CAAA;AAED,eAAO,MAAM,gBAAgB,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,SAAS,CAAsB,CAAA;AAEtF,eAAO,MAAM,gBAAgB,UAAgD,CAAA;AAE7E,eAAO,MAAM,aAAa,aAAa,CAAA;AAEvC,eAAO,MAAM,eAAe;;;CAG3B,CAAA;AAED,eAAO,MAAM,gBAAgB;;CAA0B,CAAA;AAEvD,eAAO,MAAM,aAAa,UAAe,CAAA;AACzC,eAAO,MAAM,SAAS,UAAW,CAAA;AACjC,eAAO,MAAM,aAAa,UAAe,CAAA"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"createHighlightMarkers.d.ts","sourceRoot":"","sources":["../../src/createHighlightMarkers.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,OAAO,EAAC,MAAM,WAAW,CAAA;AAGjC,eAAO,MAAM,mBAAmB,+FAQ/B,CAAA;AAED,MAAM,CAAC,OAAO,UAAU,sBAAsB,CAAC,IAAI,EAAE,MAAM,EAAE,GAAG,OAAO,EAAE,CAUxE"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"deprecatedSchema.d.ts","sourceRoot":"","sources":["../../src/deprecatedSchema.ts"],"names":[],"mappings":";;;;;;;;;;AAAA,wBAkBI"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"editorSupport.d.ts","sourceRoot":"","sources":["../../src/editorSupport.ts"],"names":[],"mappings":"AAEA,OAAO,QAAQ,CAAA;AAEf,OAAO,0CAA0C,CAAA;AACjD,OAAO,uCAAuC,CAAA;AAC9C,OAAO,oCAAoC,CAAA;AAC3C,OAAO,uCAAuC,CAAA;AAC9C,OAAO,qCAAqC,CAAA;AAC5C,OAAO,qCAAqC,CAAA;AAC5C,OAAO,2CAA2C,CAAA;AAClD,OAAO,qCAAqC,CAAA;AAC5C,OAAO,oCAAoC,CAAA;AAC3C,OAAO,yCAAyC,CAAA;AAChD,OAAO,sCAAsC,CAAA;AAC7C,OAAO,oCAAoC,CAAA;AAC3C,OAAO,uCAAuC,CAAA;AAC9C,OAAO,qCAAqC,CAAA;AAC5C,OAAO,qCAAqC,CAAA;AAC5C,OAAO,qCAAqC,CAAA;AAC5C,OAAO,mCAAmC,CAAA;AAC1C,OAAO,qCAAqC,CAAA;AAC5C,OAAO,oCAAoC,CAAA;AAC3C,OAAO,2CAA2C,CAAA;AAClD,OAAO,oCAAoC,CAAA;AAC3C,OAAO,qCAAqC,CAAA;AAG5C,OAAO,wCAAwC,CAAA;AAC/C,OAAO,yCAAyC,CAAA;AAChD,OAAO,0CAA0C,CAAA;AACjD,OAAO,0CAA0C,CAAA"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"getMedia.d.ts","sourceRoot":"","sources":["../../src/getMedia.tsx"],"names":[],"mappings":";AAEA,wBAAgB,QAAQ,CAAC,QAAQ,CAAC,EAAE,MAAM,2BA4FzC"}
@@ -1,376 +0,0 @@
1
- declare const rules: {
2
- start: {
3
- include: string;
4
- }[];
5
- '#query': {
6
- include: string;
7
- }[];
8
- '#variable': {
9
- token: string;
10
- regex: RegExp;
11
- }[];
12
- '#keyword': {
13
- token: string;
14
- regex: RegExp;
15
- }[];
16
- '#comparison': {
17
- token: string;
18
- regex: RegExp;
19
- }[];
20
- '#operator': {
21
- token: string;
22
- regex: RegExp;
23
- }[];
24
- '#pipe': {
25
- token: string;
26
- regex: RegExp;
27
- }[];
28
- '#logical': {
29
- token: string;
30
- regex: RegExp;
31
- }[];
32
- '#reference': {
33
- token: string;
34
- regex: RegExp;
35
- }[];
36
- '#pair': ({
37
- include: string;
38
- token?: undefined;
39
- regex?: undefined;
40
- } | {
41
- token: string;
42
- regex: RegExp;
43
- include?: undefined;
44
- })[];
45
- '#arraylike': {
46
- token: string;
47
- regex: RegExp;
48
- push: ({
49
- token: string[];
50
- regex: RegExp;
51
- next: string;
52
- include?: undefined;
53
- } | {
54
- include: string;
55
- token?: undefined;
56
- regex?: undefined;
57
- next?: undefined;
58
- })[];
59
- }[];
60
- '#array': {
61
- token: string;
62
- regex: RegExp;
63
- push: ({
64
- token: string;
65
- regex: RegExp;
66
- next: string;
67
- include?: undefined;
68
- defaultToken?: undefined;
69
- } | {
70
- include: string;
71
- token?: undefined;
72
- regex?: undefined;
73
- next?: undefined;
74
- defaultToken?: undefined;
75
- } | {
76
- defaultToken: string;
77
- token?: undefined;
78
- regex?: undefined;
79
- next?: undefined;
80
- include?: undefined;
81
- })[];
82
- }[];
83
- '#range': {
84
- token: string[];
85
- regex: RegExp;
86
- }[];
87
- '#spread': {
88
- token: string;
89
- regex: RegExp;
90
- push: ({
91
- include: string;
92
- token?: undefined;
93
- regex?: undefined;
94
- next?: undefined;
95
- defaultToken?: undefined;
96
- } | {
97
- token: string;
98
- regex: RegExp;
99
- next: string;
100
- include?: undefined;
101
- defaultToken?: undefined;
102
- } | {
103
- defaultToken: string;
104
- include?: undefined;
105
- token?: undefined;
106
- regex?: undefined;
107
- next?: undefined;
108
- })[];
109
- }[];
110
- '#array-values': ({
111
- include: string;
112
- token?: undefined;
113
- regex?: undefined;
114
- } | {
115
- token: string;
116
- regex: RegExp;
117
- include?: undefined;
118
- })[];
119
- '#filter': {
120
- include: string;
121
- }[];
122
- '#comments': {
123
- token: string[];
124
- regex: RegExp;
125
- }[];
126
- '#nullary-access-operator': {
127
- token: string;
128
- regex: RegExp;
129
- }[];
130
- '#constant': {
131
- token: string;
132
- regex: RegExp;
133
- }[];
134
- '#number': {
135
- token: string;
136
- regex: RegExp;
137
- }[];
138
- '#named-projection': {
139
- include: string;
140
- }[];
141
- '#projection': {
142
- token: string;
143
- regex: RegExp;
144
- push: ({
145
- token: string;
146
- regex: RegExp;
147
- next: string;
148
- include?: undefined;
149
- push?: undefined;
150
- defaultToken?: undefined;
151
- } | {
152
- include: string;
153
- token?: undefined;
154
- regex?: undefined;
155
- next?: undefined;
156
- push?: undefined;
157
- defaultToken?: undefined;
158
- } | {
159
- token: string;
160
- regex: RegExp;
161
- push: ({
162
- token: string;
163
- regex: RegExp;
164
- next: string;
165
- include?: undefined;
166
- defaultToken?: undefined;
167
- } | {
168
- include: string;
169
- token?: undefined;
170
- regex?: undefined;
171
- next?: undefined;
172
- defaultToken?: undefined;
173
- } | {
174
- token: string;
175
- regex: RegExp;
176
- next?: undefined;
177
- include?: undefined;
178
- defaultToken?: undefined;
179
- } | {
180
- defaultToken: string;
181
- token?: undefined;
182
- regex?: undefined;
183
- next?: undefined;
184
- include?: undefined;
185
- })[];
186
- next?: undefined;
187
- include?: undefined;
188
- defaultToken?: undefined;
189
- } | {
190
- token: string;
191
- regex: RegExp;
192
- next?: undefined;
193
- include?: undefined;
194
- push?: undefined;
195
- defaultToken?: undefined;
196
- } | {
197
- defaultToken: string;
198
- token?: undefined;
199
- regex?: undefined;
200
- next?: undefined;
201
- include?: undefined;
202
- push?: undefined;
203
- })[];
204
- }[];
205
- '#string': {
206
- include: string;
207
- }[];
208
- '#double-string': {
209
- token: string;
210
- regex: RegExp;
211
- push: ({
212
- token: string;
213
- regex: RegExp;
214
- next: string;
215
- include?: undefined;
216
- defaultToken?: undefined;
217
- } | {
218
- include: string;
219
- token?: undefined;
220
- regex?: undefined;
221
- next?: undefined;
222
- defaultToken?: undefined;
223
- } | {
224
- defaultToken: string;
225
- token?: undefined;
226
- regex?: undefined;
227
- next?: undefined;
228
- include?: undefined;
229
- })[];
230
- }[];
231
- '#single-string': {
232
- token: string;
233
- regex: RegExp;
234
- push: ({
235
- token: string;
236
- regex: RegExp;
237
- next: string;
238
- include?: undefined;
239
- defaultToken?: undefined;
240
- } | {
241
- include: string;
242
- token?: undefined;
243
- regex?: undefined;
244
- next?: undefined;
245
- defaultToken?: undefined;
246
- } | {
247
- defaultToken: string;
248
- token?: undefined;
249
- regex?: undefined;
250
- next?: undefined;
251
- include?: undefined;
252
- })[];
253
- }[];
254
- '#objectkey': {
255
- include: string;
256
- }[];
257
- '#stringcontent': {
258
- token: string;
259
- regex: RegExp;
260
- }[];
261
- '#sort-pair': ({
262
- token: string[];
263
- regex: RegExp;
264
- push?: undefined;
265
- } | {
266
- token: string[];
267
- regex: RegExp;
268
- push: ({
269
- token: string[];
270
- regex: RegExp;
271
- next: string;
272
- include?: undefined;
273
- } | {
274
- include: string;
275
- token?: undefined;
276
- regex?: undefined;
277
- next?: undefined;
278
- })[];
279
- })[];
280
- '#sort-order': {
281
- token: string;
282
- regex: RegExp;
283
- push: ({
284
- token: string;
285
- regex: RegExp;
286
- next: string;
287
- include?: undefined;
288
- defaultToken?: undefined;
289
- } | {
290
- include: string;
291
- token?: undefined;
292
- regex?: undefined;
293
- next?: undefined;
294
- defaultToken?: undefined;
295
- } | {
296
- token: string;
297
- regex: RegExp;
298
- next?: undefined;
299
- include?: undefined;
300
- defaultToken?: undefined;
301
- } | {
302
- defaultToken: string;
303
- token?: undefined;
304
- regex?: undefined;
305
- next?: undefined;
306
- include?: undefined;
307
- })[];
308
- }[];
309
- '#function-call': {
310
- include: string;
311
- }[];
312
- '#function-var-arg': {
313
- token: string;
314
- regex: RegExp;
315
- push: ({
316
- token: string;
317
- regex: RegExp;
318
- next: string;
319
- include?: undefined;
320
- defaultToken?: undefined;
321
- } | {
322
- include: string;
323
- token?: undefined;
324
- regex?: undefined;
325
- next?: undefined;
326
- defaultToken?: undefined;
327
- } | {
328
- token: string;
329
- regex: RegExp;
330
- next?: undefined;
331
- include?: undefined;
332
- defaultToken?: undefined;
333
- } | {
334
- defaultToken: string;
335
- token?: undefined;
336
- regex?: undefined;
337
- next?: undefined;
338
- include?: undefined;
339
- })[];
340
- }[];
341
- '#function-single-arg': {
342
- token: string;
343
- regex: RegExp;
344
- push: ({
345
- token: string;
346
- regex: RegExp;
347
- next: string;
348
- include?: undefined;
349
- defaultToken?: undefined;
350
- } | {
351
- include: string;
352
- token?: undefined;
353
- regex?: undefined;
354
- next?: undefined;
355
- defaultToken?: undefined;
356
- } | {
357
- defaultToken: string;
358
- token?: undefined;
359
- regex?: undefined;
360
- next?: undefined;
361
- include?: undefined;
362
- })[];
363
- }[];
364
- '#identifier': ({
365
- token: string[];
366
- regex: RegExp;
367
- } | {
368
- token: string;
369
- regex: RegExp;
370
- })[];
371
- '#value': {
372
- include: string;
373
- }[];
374
- };
375
- declare let ace: any;
376
- //# sourceMappingURL=groq.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"groq.d.ts","sourceRoot":"","sources":["../../src/groq.ts"],"names":[],"mappings":"AAEA,QAAA,MAAM,KAAK;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA4iBV,CAAA;AAED,OAAO,CAAC,IAAI,GAAG,EAAE,GAAG,CAAA"}
@@ -1,44 +0,0 @@
1
- import React from 'react';
2
- declare const _default: {
3
- name: string;
4
- type: string;
5
- title: string;
6
- inputComponent: React.ForwardRefExoticComponent<import("./CodeInput").CodeInputProps & React.RefAttributes<{
7
- focus: () => void;
8
- }>>;
9
- icon: React.ForwardRefExoticComponent<Pick<React.SVGProps<SVGSVGElement>, "string" | "style" | "clipPath" | "filter" | "mask" | "path" | "height" | "crossOrigin" | "href" | "max" | "media" | "method" | "min" | "name" | "target" | "type" | "width" | "className" | "id" | "lang" | "tabIndex" | "role" | "color" | "aria-activedescendant" | "aria-atomic" | "aria-autocomplete" | "aria-busy" | "aria-checked" | "aria-colcount" | "aria-colindex" | "aria-colspan" | "aria-controls" | "aria-current" | "aria-describedby" | "aria-details" | "aria-disabled" | "aria-dropeffect" | "aria-errormessage" | "aria-expanded" | "aria-flowto" | "aria-grabbed" | "aria-haspopup" | "aria-hidden" | "aria-invalid" | "aria-keyshortcuts" | "aria-label" | "aria-labelledby" | "aria-level" | "aria-live" | "aria-modal" | "aria-multiline" | "aria-multiselectable" | "aria-orientation" | "aria-owns" | "aria-placeholder" | "aria-posinset" | "aria-pressed" | "aria-readonly" | "aria-relevant" | "aria-required" | "aria-roledescription" | "aria-rowcount" | "aria-rowindex" | "aria-rowspan" | "aria-selected" | "aria-setsize" | "aria-sort" | "aria-valuemax" | "aria-valuemin" | "aria-valuenow" | "aria-valuetext" | "children" | "dangerouslySetInnerHTML" | "onCopy" | "onCopyCapture" | "onCut" | "onCutCapture" | "onPaste" | "onPasteCapture" | "onCompositionEnd" | "onCompositionEndCapture" | "onCompositionStart" | "onCompositionStartCapture" | "onCompositionUpdate" | "onCompositionUpdateCapture" | "onFocus" | "onFocusCapture" | "onBlur" | "onBlurCapture" | "onChange" | "onChangeCapture" | "onBeforeInput" | "onBeforeInputCapture" | "onInput" | "onInputCapture" | "onReset" | "onResetCapture" | "onSubmit" | "onSubmitCapture" | "onInvalid" | "onInvalidCapture" | "onLoad" | "onLoadCapture" | "onError" | "onErrorCapture" | "onKeyDown" | "onKeyDownCapture" | "onKeyPress" | "onKeyPressCapture" | "onKeyUp" | "onKeyUpCapture" | "onAbort" | "onAbortCapture" | "onCanPlay" | "onCanPlayCapture" | "onCanPlayThrough" | "onCanPlayThroughCapture" | "onDurationChange" | "onDurationChangeCapture" | "onEmptied" | "onEmptiedCapture" | "onEncrypted" | "onEncryptedCapture" | "onEnded" | "onEndedCapture" | "onLoadedData" | "onLoadedDataCapture" | "onLoadedMetadata" | "onLoadedMetadataCapture" | "onLoadStart" | "onLoadStartCapture" | "onPause" | "onPauseCapture" | "onPlay" | "onPlayCapture" | "onPlaying" | "onPlayingCapture" | "onProgress" | "onProgressCapture" | "onRateChange" | "onRateChangeCapture" | "onSeeked" | "onSeekedCapture" | "onSeeking" | "onSeekingCapture" | "onStalled" | "onStalledCapture" | "onSuspend" | "onSuspendCapture" | "onTimeUpdate" | "onTimeUpdateCapture" | "onVolumeChange" | "onVolumeChangeCapture" | "onWaiting" | "onWaitingCapture" | "onAuxClick" | "onAuxClickCapture" | "onClick" | "onClickCapture" | "onContextMenu" | "onContextMenuCapture" | "onDoubleClick" | "onDoubleClickCapture" | "onDrag" | "onDragCapture" | "onDragEnd" | "onDragEndCapture" | "onDragEnter" | "onDragEnterCapture" | "onDragExit" | "onDragExitCapture" | "onDragLeave" | "onDragLeaveCapture" | "onDragOver" | "onDragOverCapture" | "onDragStart" | "onDragStartCapture" | "onDrop" | "onDropCapture" | "onMouseDown" | "onMouseDownCapture" | "onMouseEnter" | "onMouseLeave" | "onMouseMove" | "onMouseMoveCapture" | "onMouseOut" | "onMouseOutCapture" | "onMouseOver" | "onMouseOverCapture" | "onMouseUp" | "onMouseUpCapture" | "onSelect" | "onSelectCapture" | "onTouchCancel" | "onTouchCancelCapture" | "onTouchEnd" | "onTouchEndCapture" | "onTouchMove" | "onTouchMoveCapture" | "onTouchStart" | "onTouchStartCapture" | "onPointerDown" | "onPointerDownCapture" | "onPointerMove" | "onPointerMoveCapture" | "onPointerUp" | "onPointerUpCapture" | "onPointerCancel" | "onPointerCancelCapture" | "onPointerEnter" | "onPointerEnterCapture" | "onPointerLeave" | "onPointerLeaveCapture" | "onPointerOver" | "onPointerOverCapture" | "onPointerOut" | "onPointerOutCapture" | "onGotPointerCapture" | "onGotPointerCaptureCapture" | "onLostPointerCapture" | "onLostPointerCaptureCapture" | "onScroll" | "onScrollCapture" | "onWheel" | "onWheelCapture" | "onAnimationStart" | "onAnimationStartCapture" | "onAnimationEnd" | "onAnimationEndCapture" | "onAnimationIteration" | "onAnimationIterationCapture" | "onTransitionEnd" | "onTransitionEndCapture" | "key" | "display" | "overflow" | "radius" | "mode" | "fontSize" | "ideographic" | "alphabetic" | "hanging" | "mathematical" | "accentHeight" | "accumulate" | "additive" | "alignmentBaseline" | "allowReorder" | "amplitude" | "arabicForm" | "ascent" | "attributeName" | "attributeType" | "autoReverse" | "azimuth" | "baseFrequency" | "baselineShift" | "baseProfile" | "bbox" | "begin" | "bias" | "by" | "calcMode" | "capHeight" | "clip" | "clipPathUnits" | "clipRule" | "colorInterpolation" | "colorInterpolationFilters" | "colorProfile" | "colorRendering" | "contentScriptType" | "contentStyleType" | "cursor" | "cx" | "cy" | "d" | "decelerate" | "descent" | "diffuseConstant" | "direction" | "divisor" | "dominantBaseline" | "dur" | "dx" | "dy" | "edgeMode" | "elevation" | "enableBackground" | "end" | "exponent" | "externalResourcesRequired" | "fill" | "fillOpacity" | "fillRule" | "filterRes" | "filterUnits" | "floodColor" | "floodOpacity" | "focusable" | "fontFamily" | "fontSizeAdjust" | "fontStretch" | "fontStyle" | "fontVariant" | "fontWeight" | "format" | "fr" | "from" | "fx" | "fy" | "g1" | "g2" | "glyphName" | "glyphOrientationHorizontal" | "glyphOrientationVertical" | "glyphRef" | "gradientTransform" | "gradientUnits" | "horizAdvX" | "horizOriginX" | "imageRendering" | "in2" | "in" | "intercept" | "k1" | "k2" | "k3" | "k4" | "k" | "kernelMatrix" | "kernelUnitLength" | "kerning" | "keyPoints" | "keySplines" | "keyTimes" | "lengthAdjust" | "letterSpacing" | "lightingColor" | "limitingConeAngle" | "local" | "markerEnd" | "markerHeight" | "markerMid" | "markerStart" | "markerUnits" | "markerWidth" | "maskContentUnits" | "maskUnits" | "numOctaves" | "offset" | "opacity" | "operator" | "order" | "orient" | "orientation" | "origin" | "overlinePosition" | "overlineThickness" | "paintOrder" | "panose1" | "pathLength" | "patternContentUnits" | "patternTransform" | "patternUnits" | "pointerEvents" | "points" | "pointsAtX" | "pointsAtY" | "pointsAtZ" | "preserveAlpha" | "preserveAspectRatio" | "primitiveUnits" | "r" | "refX" | "refY" | "renderingIntent" | "repeatCount" | "repeatDur" | "requiredExtensions" | "requiredFeatures" | "restart" | "result" | "rotate" | "rx" | "ry" | "scale" | "seed" | "shapeRendering" | "slope" | "spacing" | "specularConstant" | "specularExponent" | "speed" | "spreadMethod" | "startOffset" | "stdDeviation" | "stemh" | "stemv" | "stitchTiles" | "stopColor" | "stopOpacity" | "strikethroughPosition" | "strikethroughThickness" | "stroke" | "strokeDasharray" | "strokeDashoffset" | "strokeLinecap" | "strokeLinejoin" | "strokeMiterlimit" | "strokeOpacity" | "strokeWidth" | "surfaceScale" | "systemLanguage" | "tableValues" | "targetX" | "targetY" | "textAnchor" | "textDecoration" | "textLength" | "textRendering" | "to" | "transform" | "u1" | "u2" | "underlinePosition" | "underlineThickness" | "unicode" | "unicodeBidi" | "unicodeRange" | "unitsPerEm" | "vAlphabetic" | "values" | "vectorEffect" | "version" | "vertAdvY" | "vertOriginX" | "vertOriginY" | "vHanging" | "vIdeographic" | "viewBox" | "viewTarget" | "visibility" | "vMathematical" | "widths" | "wordSpacing" | "writingMode" | "x1" | "x2" | "x" | "xChannelSelector" | "xHeight" | "xlinkActuate" | "xlinkArcrole" | "xlinkHref" | "xlinkRole" | "xlinkShow" | "xlinkTitle" | "xlinkType" | "xmlBase" | "xmlLang" | "xmlns" | "xmlnsXlink" | "xmlSpace" | "y1" | "y2" | "y" | "yChannelSelector" | "z" | "zoomAndPan"> & React.RefAttributes<SVGSVGElement>>;
10
- fields: ({
11
- name: string;
12
- title: string;
13
- type: string;
14
- of?: undefined;
15
- } | {
16
- title: string;
17
- name: string;
18
- type: string;
19
- of: {
20
- type: string;
21
- title: string;
22
- }[];
23
- })[];
24
- preview: {
25
- select: {
26
- language: string;
27
- code: string;
28
- filename: string;
29
- highlightedLines: string;
30
- };
31
- prepare: (value: {
32
- language?: string;
33
- code?: string;
34
- filename?: string;
35
- highlightedLines?: number[];
36
- }) => {
37
- title: string;
38
- media: JSX.Element | undefined;
39
- extendedPreview: JSX.Element;
40
- };
41
- };
42
- };
43
- export default _default;
44
- //# sourceMappingURL=schema.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"schema.d.ts","sourceRoot":"","sources":["../../src/schema.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;yBAmDJ;YACf,QAAQ,CAAC,EAAE,MAAM,CAAA;YACjB,IAAI,CAAC,EAAE,MAAM,CAAA;YACb,QAAQ,CAAC,EAAE,MAAM,CAAA;YACjB,gBAAgB,CAAC,EAAE,MAAM,EAAE,CAAA;SAC5B;;;;;;;AA9CL,wBAsDC"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/types.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,iBAAiB;IAChC,KAAK,EAAE,MAAM,CAAA;IACb,KAAK,EAAE,MAAM,CAAA;IACb,IAAI,CAAC,EAAE,MAAM,CAAA;CACd;AAED,MAAM,WAAW,aAAa;IAC5B,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB,MAAM,EAAE;QAAC,IAAI,EAAE,MAAM,CAAC;QAAC,KAAK,CAAC,EAAE,MAAM,CAAC;QAAC,WAAW,CAAC,EAAE,MAAM,CAAA;KAAC,EAAE,CAAA;IAC9D,OAAO,CAAC,EAAE;QACR,KAAK,CAAC,EAAE,MAAM,CAAA;QACd,oBAAoB,EAAE,iBAAiB,EAAE,CAAA;QACzC,QAAQ,EAAE,MAAM,CAAA;QAChB,YAAY,CAAC,EAAE,OAAO,CAAA;KACvB,CAAA;CACF;AAED,MAAM,WAAW,cAAc;IAC7B,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,QAAQ,CAAC,EAAE,MAAM,CAAA;IACjB,QAAQ,CAAC,EAAE,MAAM,CAAA;IACjB,gBAAgB,CAAC,EAAE,MAAM,EAAE,CAAA;CAC5B"}
@@ -1 +0,0 @@
1
- "use strict";
@@ -1,79 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.default = PreviewCode;
7
-
8
- var _react = _interopRequireWildcard(require("react"));
9
-
10
- var _reactAce = _interopRequireDefault(require("react-ace"));
11
-
12
- var _styledComponents = _interopRequireDefault(require("styled-components"));
13
-
14
- var _ui = require("@sanity/ui");
15
-
16
- var _config = require("./config");
17
-
18
- var _createHighlightMarkers = _interopRequireDefault(require("./createHighlightMarkers"));
19
-
20
- require("./editorSupport");
21
-
22
- var _templateObject, _templateObject2;
23
-
24
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
25
-
26
- function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
27
-
28
- function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
29
-
30
- function _taggedTemplateLiteral(strings, raw) { if (!raw) { raw = strings.slice(0); } return Object.freeze(Object.defineProperties(strings, { raw: { value: Object.freeze(raw) } })); }
31
-
32
- var PreviewContainer = (0, _styledComponents.default)(_ui.Box)(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n position: relative;\n"])));
33
- var PreviewInner = (0, _styledComponents.default)(_ui.Box)(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n background-color: #272822;\n\n .ace_editor {\n box-sizing: border-box;\n cursor: default;\n pointer-events: none;\n }\n\n .ace_content {\n box-sizing: border-box;\n overflow: hidden;\n }\n"])));
34
-
35
- function PreviewCode(props) {
36
- var _type$options;
37
-
38
- var aceEditorRef = (0, _react.useRef)();
39
- (0, _react.useEffect)(() => {
40
- var _aceEditorRef$current;
41
-
42
- if (!(aceEditorRef !== null && aceEditorRef !== void 0 && aceEditorRef.current)) return;
43
- var editor = (_aceEditorRef$current = aceEditorRef.current) === null || _aceEditorRef$current === void 0 ? void 0 : _aceEditorRef$current.editor;
44
-
45
- if (editor) {
46
- // Avoid cursor and focus tracking by Ace
47
- editor.renderer.$cursorLayer.element.style.opacity = 0;
48
- editor.textInput.getElement().disabled = true;
49
- }
50
- }, []);
51
- var handleEditorChange = (0, _react.useCallback)(() => {// do nothing when the editor changes
52
- }, []);
53
- var value = props.value,
54
- type = props.type;
55
- var fixedLanguage = type === null || type === void 0 ? void 0 : (_type$options = type.options) === null || _type$options === void 0 ? void 0 : _type$options.language;
56
- var mode = (value === null || value === void 0 ? void 0 : value.language) || fixedLanguage || 'text';
57
- return /*#__PURE__*/_react.default.createElement(PreviewContainer, null, /*#__PURE__*/_react.default.createElement(PreviewInner, {
58
- padding: 4
59
- }, /*#__PURE__*/_react.default.createElement(_reactAce.default, {
60
- ref: aceEditorRef,
61
- focus: false,
62
- mode: mode,
63
- theme: "monokai",
64
- width: "100%",
65
- onChange: handleEditorChange,
66
- maxLines: 200,
67
- readOnly: true,
68
- wrapEnabled: true,
69
- showPrintMargin: false,
70
- highlightActiveLine: false,
71
- cursorStart: -1,
72
- value: value && value.code || '',
73
- markers: value && value.highlightedLines ? (0, _createHighlightMarkers.default)(value.highlightedLines) : undefined,
74
- tabSize: 2,
75
- showGutter: false,
76
- setOptions: _config.ACE_SET_OPTIONS,
77
- editorProps: _config.ACE_EDITOR_PROPS
78
- })));
79
- }