@atlaskit/editor-plugin-extension 1.5.2 → 1.5.3
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/.eslintrc.js +12 -12
- package/CHANGELOG.md +219 -214
- package/LICENSE.md +6 -8
- package/dist/cjs/ui/ConfigPanel/ErrorMessage/ErrorImage.js +12 -4
- package/dist/cjs/ui/ConfigPanel/Fields/ColorPicker.js +1 -1
- package/dist/cjs/ui/ConfigPanel/FormContent.js +4 -1
- package/dist/cjs/ui/ConfigPanel/Header.js +1 -0
- package/dist/cjs/ui/ConfigPanel/NestedForms/RemovableField.js +3 -1
- package/dist/es2019/ui/ConfigPanel/ErrorMessage/ErrorImage.js +12 -4
- package/dist/es2019/ui/ConfigPanel/Fields/ColorPicker.js +1 -1
- package/dist/es2019/ui/ConfigPanel/FormContent.js +4 -1
- package/dist/es2019/ui/ConfigPanel/Header.js +1 -0
- package/dist/es2019/ui/ConfigPanel/NestedForms/RemovableField.js +3 -1
- package/dist/esm/ui/ConfigPanel/ErrorMessage/ErrorImage.js +12 -4
- package/dist/esm/ui/ConfigPanel/Fields/ColorPicker.js +1 -1
- package/dist/esm/ui/ConfigPanel/FormContent.js +4 -1
- package/dist/esm/ui/ConfigPanel/Header.js +1 -0
- package/dist/esm/ui/ConfigPanel/NestedForms/RemovableField.js +3 -1
- package/dist/types/ui/ConfigPanel/Fields/UnhandledType.d.ts +1 -1
- package/dist/types/ui/SaveIndicator/SaveIndicator.d.ts +1 -1
- package/dist/types-ts4.5/ui/ConfigPanel/Fields/UnhandledType.d.ts +1 -1
- package/dist/types-ts4.5/ui/SaveIndicator/SaveIndicator.d.ts +1 -1
- package/example-utils/config-panel/ConfigPanelWithExtensionPicker.tsx +158 -172
- package/example-utils/config-panel/ConfigPanelWithProviders.tsx +37 -37
- package/example-utils/config-panel/ExtensionNodePicker.tsx +110 -121
- package/example-utils/config-panel/FieldTypePicker.tsx +49 -47
- package/example-utils/config-panel/example-manifest-all-fields.ts +63 -63
- package/example-utils/config-panel/example-manifest-individual-fields.ts +64 -64
- package/example-utils/config-panel/fields.ts +617 -619
- package/package.json +8 -10
- package/report.api.md +42 -47
|
@@ -1,626 +1,624 @@
|
|
|
1
1
|
import type { FieldDefinition } from '@atlaskit/editor-common/extensions';
|
|
2
2
|
|
|
3
3
|
export const nativeFields: FieldDefinition[] = [
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
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
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
|
|
513
|
-
|
|
514
|
-
defaultValue: '#7AB2FF',
|
|
515
|
-
},
|
|
4
|
+
{
|
|
5
|
+
type: 'tab-group',
|
|
6
|
+
label: 'Tab type',
|
|
7
|
+
name: 'tabGroup',
|
|
8
|
+
fields: [
|
|
9
|
+
{
|
|
10
|
+
type: 'tab',
|
|
11
|
+
label: 'Tab A',
|
|
12
|
+
name: 'optionA',
|
|
13
|
+
fields: [
|
|
14
|
+
{
|
|
15
|
+
name: 'expandField',
|
|
16
|
+
type: 'expand',
|
|
17
|
+
label: 'awesome expand field',
|
|
18
|
+
isExpanded: true,
|
|
19
|
+
fields: [
|
|
20
|
+
{
|
|
21
|
+
name: 'textFieldOne',
|
|
22
|
+
type: 'string',
|
|
23
|
+
label: 'Free text',
|
|
24
|
+
},
|
|
25
|
+
],
|
|
26
|
+
},
|
|
27
|
+
{
|
|
28
|
+
name: 'textFieldThree',
|
|
29
|
+
type: 'string',
|
|
30
|
+
label: 'Free text',
|
|
31
|
+
},
|
|
32
|
+
],
|
|
33
|
+
},
|
|
34
|
+
{
|
|
35
|
+
type: 'tab',
|
|
36
|
+
label: 'Tab B',
|
|
37
|
+
name: 'optionB',
|
|
38
|
+
fields: [
|
|
39
|
+
{
|
|
40
|
+
name: 'textFieldTwo',
|
|
41
|
+
type: 'string',
|
|
42
|
+
label: 'Free text',
|
|
43
|
+
},
|
|
44
|
+
],
|
|
45
|
+
},
|
|
46
|
+
],
|
|
47
|
+
},
|
|
48
|
+
{
|
|
49
|
+
name: 'text-field',
|
|
50
|
+
type: 'string',
|
|
51
|
+
label: 'Free text',
|
|
52
|
+
isRequired: true,
|
|
53
|
+
description: 'Add any text',
|
|
54
|
+
defaultValue: 'I am the default text',
|
|
55
|
+
},
|
|
56
|
+
{
|
|
57
|
+
name: 'text-field-multiline',
|
|
58
|
+
type: 'string',
|
|
59
|
+
label: 'Free text',
|
|
60
|
+
isRequired: true,
|
|
61
|
+
description: 'Add any text across multiple lines',
|
|
62
|
+
defaultValue: 'I am the default multiline text',
|
|
63
|
+
style: 'multiline',
|
|
64
|
+
},
|
|
65
|
+
{
|
|
66
|
+
name: 'text-field-optional',
|
|
67
|
+
type: 'string',
|
|
68
|
+
label: 'Text',
|
|
69
|
+
isRequired: false,
|
|
70
|
+
description: 'Leave it empty',
|
|
71
|
+
placeholder: 'Text goes here',
|
|
72
|
+
},
|
|
73
|
+
{
|
|
74
|
+
name: 'text-field-hidden',
|
|
75
|
+
type: 'string',
|
|
76
|
+
label: 'Hidden text field',
|
|
77
|
+
defaultValue: 'this is a hidden value passed to the extension',
|
|
78
|
+
isHidden: true,
|
|
79
|
+
},
|
|
80
|
+
{
|
|
81
|
+
name: 'number-field',
|
|
82
|
+
type: 'number',
|
|
83
|
+
label: 'Number',
|
|
84
|
+
isRequired: true,
|
|
85
|
+
placeholder: 'Number goes here',
|
|
86
|
+
},
|
|
87
|
+
{
|
|
88
|
+
name: 'boolean-field-required',
|
|
89
|
+
type: 'boolean',
|
|
90
|
+
label: 'Needs to be checked',
|
|
91
|
+
description:
|
|
92
|
+
'<b>A</b> <i>checkbox</i> that can be <code>true</code> or <strong>false</strong> <em>(by design)</em>',
|
|
93
|
+
isRequired: true,
|
|
94
|
+
},
|
|
95
|
+
{
|
|
96
|
+
name: 'boolean-field-optional',
|
|
97
|
+
type: 'boolean',
|
|
98
|
+
label: 'Do you want free shipping?',
|
|
99
|
+
description: 'True or <b>FALSE</b> (should be bolded)',
|
|
100
|
+
},
|
|
101
|
+
{
|
|
102
|
+
name: 'boolean-field-toggle',
|
|
103
|
+
type: 'boolean',
|
|
104
|
+
label: 'Turn on the Wi-Fi?',
|
|
105
|
+
description: 'On or Off',
|
|
106
|
+
style: 'toggle',
|
|
107
|
+
defaultValue: true,
|
|
108
|
+
},
|
|
109
|
+
{
|
|
110
|
+
name: 'date-start',
|
|
111
|
+
type: 'date',
|
|
112
|
+
label: 'Date',
|
|
113
|
+
description: `Nothing of <a onclick="alert('something is wrong')">interest</a>`,
|
|
114
|
+
placeholder: 'Date goes here',
|
|
115
|
+
},
|
|
116
|
+
{
|
|
117
|
+
name: 'enum-select',
|
|
118
|
+
type: 'enum',
|
|
119
|
+
label: 'Select one',
|
|
120
|
+
isRequired: true,
|
|
121
|
+
description: 'Pick one',
|
|
122
|
+
style: 'select',
|
|
123
|
+
isMultiple: false,
|
|
124
|
+
placeholder: 'Selected option goes here',
|
|
125
|
+
items: [
|
|
126
|
+
{ label: 'Option A', value: 'a' },
|
|
127
|
+
{ label: 'Option B', value: 'b' },
|
|
128
|
+
],
|
|
129
|
+
},
|
|
130
|
+
{
|
|
131
|
+
name: 'enum-select-icon',
|
|
132
|
+
type: 'enum',
|
|
133
|
+
label: 'Select with icons',
|
|
134
|
+
description: 'Pick one',
|
|
135
|
+
style: 'select',
|
|
136
|
+
isMultiple: false,
|
|
137
|
+
items: [
|
|
138
|
+
{
|
|
139
|
+
label: 'Option A',
|
|
140
|
+
value: 'a',
|
|
141
|
+
description: 'Recommended',
|
|
142
|
+
icon: 'https://i.picsum.photos/id/237/24/24.jpg',
|
|
143
|
+
},
|
|
144
|
+
{
|
|
145
|
+
label: 'Option B with a really really really really really really long label',
|
|
146
|
+
value: 'b',
|
|
147
|
+
description: 'One of the best options out there',
|
|
148
|
+
icon: 'https://i.picsum.photos/id/240/24/24.jpg',
|
|
149
|
+
},
|
|
150
|
+
],
|
|
151
|
+
},
|
|
152
|
+
{
|
|
153
|
+
name: 'enum-select-icon-multiple',
|
|
154
|
+
type: 'enum',
|
|
155
|
+
label: 'Select with icons (multiple)',
|
|
156
|
+
description: 'Pick many',
|
|
157
|
+
defaultValue: ['a', 'b', 'long'],
|
|
158
|
+
style: 'select',
|
|
159
|
+
placeholder: 'Selected options go here',
|
|
160
|
+
isMultiple: true,
|
|
161
|
+
items: [
|
|
162
|
+
{
|
|
163
|
+
label: 'Option A',
|
|
164
|
+
value: 'a',
|
|
165
|
+
description: 'Our most popular pick',
|
|
166
|
+
icon: 'https://i.picsum.photos/id/237/24/24.jpg',
|
|
167
|
+
},
|
|
168
|
+
{
|
|
169
|
+
label: 'Option B',
|
|
170
|
+
value: 'b',
|
|
171
|
+
description: 'Many people like this one',
|
|
172
|
+
icon: 'https://i.picsum.photos/id/240/24/24.jpg',
|
|
173
|
+
},
|
|
174
|
+
{
|
|
175
|
+
label: 'Option Long, a really long label (longer than we expected)',
|
|
176
|
+
value: 'long',
|
|
177
|
+
description: 'Many people like this one',
|
|
178
|
+
icon: 'https://i.picsum.photos/id/240/24/24.jpg',
|
|
179
|
+
},
|
|
180
|
+
],
|
|
181
|
+
},
|
|
182
|
+
{
|
|
183
|
+
name: 'enum-select-multiple',
|
|
184
|
+
type: 'enum',
|
|
185
|
+
label: 'Select 1 or many',
|
|
186
|
+
description: '1 required, no default',
|
|
187
|
+
style: 'select',
|
|
188
|
+
isRequired: true,
|
|
189
|
+
isMultiple: true,
|
|
190
|
+
items: [
|
|
191
|
+
{ label: 'Option A', value: 'a' },
|
|
192
|
+
{ label: 'Option B', value: 'b' },
|
|
193
|
+
{ label: 'Option C', value: 'c' },
|
|
194
|
+
{ label: 'Option D', value: 'd' },
|
|
195
|
+
{ label: 'Option E', value: 'e' },
|
|
196
|
+
],
|
|
197
|
+
},
|
|
198
|
+
{
|
|
199
|
+
name: 'enum-radio-required',
|
|
200
|
+
type: 'enum',
|
|
201
|
+
label: 'Select one',
|
|
202
|
+
description: 'One is always required',
|
|
203
|
+
style: 'radio',
|
|
204
|
+
isRequired: true,
|
|
205
|
+
isMultiple: false,
|
|
206
|
+
items: [
|
|
207
|
+
{ label: 'Option A', value: 'a' },
|
|
208
|
+
{ label: 'Option B', value: 'b' },
|
|
209
|
+
{ label: 'Option C', value: 'c' },
|
|
210
|
+
{ label: 'Option D', value: 'd' },
|
|
211
|
+
{ label: 'Option E', value: 'e' },
|
|
212
|
+
],
|
|
213
|
+
},
|
|
214
|
+
{
|
|
215
|
+
name: 'enum-radio-defaulted',
|
|
216
|
+
type: 'enum',
|
|
217
|
+
label: 'Select one (defaulted)',
|
|
218
|
+
description: 'One is always required, but we default it',
|
|
219
|
+
style: 'radio',
|
|
220
|
+
isRequired: false,
|
|
221
|
+
defaultValue: 'a',
|
|
222
|
+
items: [
|
|
223
|
+
{ label: 'Option A', value: 'a' },
|
|
224
|
+
{ label: 'Option B', value: 'b' },
|
|
225
|
+
{ label: 'Option C', value: 'c' },
|
|
226
|
+
{ label: 'Option D', value: 'd' },
|
|
227
|
+
{ label: 'Option E', value: 'e' },
|
|
228
|
+
],
|
|
229
|
+
},
|
|
230
|
+
{
|
|
231
|
+
name: 'enum-checkbox-multiple',
|
|
232
|
+
type: 'enum',
|
|
233
|
+
label: 'Select 1 or many, or none',
|
|
234
|
+
description: 'Nothing required, no default',
|
|
235
|
+
style: 'checkbox',
|
|
236
|
+
isRequired: false,
|
|
237
|
+
isMultiple: true,
|
|
238
|
+
items: [
|
|
239
|
+
{
|
|
240
|
+
label: 'Option A',
|
|
241
|
+
value: 'a',
|
|
242
|
+
description: 'tooltip description for a',
|
|
243
|
+
},
|
|
244
|
+
{
|
|
245
|
+
label: 'Option B',
|
|
246
|
+
value: 'b',
|
|
247
|
+
description: 'tooltip description for b',
|
|
248
|
+
},
|
|
249
|
+
{
|
|
250
|
+
label: 'Option C',
|
|
251
|
+
value: 'c',
|
|
252
|
+
description: 'tooltip description for c',
|
|
253
|
+
},
|
|
254
|
+
{
|
|
255
|
+
label: 'Option D',
|
|
256
|
+
value: 'd',
|
|
257
|
+
description: 'tooltip description for d',
|
|
258
|
+
},
|
|
259
|
+
{
|
|
260
|
+
label: 'Option E',
|
|
261
|
+
value: 'e',
|
|
262
|
+
description: 'tooltip description for e',
|
|
263
|
+
},
|
|
264
|
+
],
|
|
265
|
+
},
|
|
266
|
+
{
|
|
267
|
+
name: 'enum-checkbox-multiple-required',
|
|
268
|
+
type: 'enum',
|
|
269
|
+
label: 'Select 1 or many',
|
|
270
|
+
description: 'Something required',
|
|
271
|
+
style: 'checkbox',
|
|
272
|
+
isRequired: true,
|
|
273
|
+
isMultiple: true,
|
|
274
|
+
items: [
|
|
275
|
+
{
|
|
276
|
+
label: 'Option A',
|
|
277
|
+
value: 'a',
|
|
278
|
+
description: 'tooltip description for a',
|
|
279
|
+
},
|
|
280
|
+
{
|
|
281
|
+
label: 'Option B',
|
|
282
|
+
value: 'b',
|
|
283
|
+
description: 'tooltip description for b',
|
|
284
|
+
},
|
|
285
|
+
{
|
|
286
|
+
label: 'Option C',
|
|
287
|
+
value: 'c',
|
|
288
|
+
description: 'tooltip description for c',
|
|
289
|
+
},
|
|
290
|
+
{
|
|
291
|
+
label: 'Option D',
|
|
292
|
+
value: 'd',
|
|
293
|
+
description: 'tooltip description for d',
|
|
294
|
+
},
|
|
295
|
+
{
|
|
296
|
+
label: 'Option E',
|
|
297
|
+
value: 'e',
|
|
298
|
+
description: 'tooltip description for e',
|
|
299
|
+
},
|
|
300
|
+
],
|
|
301
|
+
},
|
|
302
|
+
{
|
|
303
|
+
name: 'unhandled',
|
|
304
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
305
|
+
type: 'foobar' as any,
|
|
306
|
+
label: 'Unknown type',
|
|
307
|
+
},
|
|
308
|
+
{
|
|
309
|
+
name: 'fieldset-cql',
|
|
310
|
+
type: 'fieldset',
|
|
311
|
+
label: 'CQL',
|
|
312
|
+
options: {
|
|
313
|
+
isDynamic: true,
|
|
314
|
+
transformer: {
|
|
315
|
+
type: 'cql',
|
|
316
|
+
},
|
|
317
|
+
},
|
|
318
|
+
fields: [
|
|
319
|
+
{
|
|
320
|
+
name: 'created-at',
|
|
321
|
+
type: 'date-range',
|
|
322
|
+
label: 'Created at',
|
|
323
|
+
description: `This is how we select date range in the cql component`,
|
|
324
|
+
items: [
|
|
325
|
+
{ label: 'Any date', value: '' },
|
|
326
|
+
{ label: 'Last 24 hours', value: 'now(-1d)' },
|
|
327
|
+
{ label: 'Last week', value: 'now(-1w)' },
|
|
328
|
+
{ label: 'Last month', value: 'now(-1M)' },
|
|
329
|
+
{ label: 'Last year', value: 'now(-1y)' },
|
|
330
|
+
],
|
|
331
|
+
},
|
|
332
|
+
{
|
|
333
|
+
name: 'last-modified',
|
|
334
|
+
type: 'date-range',
|
|
335
|
+
label: 'Last modified',
|
|
336
|
+
items: [
|
|
337
|
+
{ label: 'Today', value: 'now(-1d)' },
|
|
338
|
+
{ label: 'This week', value: 'now(-1w)' },
|
|
339
|
+
{ label: 'This month', value: 'now(-1M)' },
|
|
340
|
+
{ label: 'This year', value: 'now(-1y)' },
|
|
341
|
+
],
|
|
342
|
+
},
|
|
343
|
+
{
|
|
344
|
+
name: 'query',
|
|
345
|
+
type: 'string',
|
|
346
|
+
label: 'Search term',
|
|
347
|
+
},
|
|
348
|
+
{
|
|
349
|
+
name: 'custom',
|
|
350
|
+
type: 'custom',
|
|
351
|
+
label: 'Custom: Select anything',
|
|
352
|
+
isRequired: true,
|
|
353
|
+
options: {
|
|
354
|
+
resolver: {
|
|
355
|
+
type: 'mock-resolver',
|
|
356
|
+
},
|
|
357
|
+
},
|
|
358
|
+
},
|
|
359
|
+
{
|
|
360
|
+
name: 'content',
|
|
361
|
+
type: 'enum',
|
|
362
|
+
label: 'Content Type',
|
|
363
|
+
isRequired: false,
|
|
364
|
+
style: 'checkbox',
|
|
365
|
+
isMultiple: true,
|
|
366
|
+
items: [
|
|
367
|
+
{
|
|
368
|
+
label: 'Page',
|
|
369
|
+
value: 'page',
|
|
370
|
+
},
|
|
371
|
+
{
|
|
372
|
+
label: 'Blogpost',
|
|
373
|
+
value: 'blogpost',
|
|
374
|
+
},
|
|
375
|
+
{
|
|
376
|
+
label: 'Question',
|
|
377
|
+
value: 'question',
|
|
378
|
+
},
|
|
379
|
+
],
|
|
380
|
+
},
|
|
381
|
+
],
|
|
382
|
+
},
|
|
383
|
+
{
|
|
384
|
+
name: 'fieldset-without-label',
|
|
385
|
+
type: 'fieldset',
|
|
386
|
+
label: 'Fieldset without label',
|
|
387
|
+
options: {
|
|
388
|
+
isDynamic: true,
|
|
389
|
+
showTitle: false,
|
|
390
|
+
transformer: {
|
|
391
|
+
type: 'cql',
|
|
392
|
+
},
|
|
393
|
+
},
|
|
394
|
+
fields: [
|
|
395
|
+
{
|
|
396
|
+
name: 'inner-text',
|
|
397
|
+
type: 'string',
|
|
398
|
+
label: 'Search term',
|
|
399
|
+
},
|
|
400
|
+
],
|
|
401
|
+
},
|
|
402
|
+
{
|
|
403
|
+
name: 'fieldset-jira-filter',
|
|
404
|
+
type: 'fieldset',
|
|
405
|
+
label: 'Issues filter',
|
|
406
|
+
options: {
|
|
407
|
+
isDynamic: true,
|
|
408
|
+
transformer: {
|
|
409
|
+
type: 'cql',
|
|
410
|
+
},
|
|
411
|
+
},
|
|
412
|
+
fields: [
|
|
413
|
+
{
|
|
414
|
+
name: 'keywords',
|
|
415
|
+
type: 'string',
|
|
416
|
+
label: 'Keywords',
|
|
417
|
+
},
|
|
418
|
+
{
|
|
419
|
+
name: 'project',
|
|
420
|
+
type: 'enum',
|
|
421
|
+
label: 'Project',
|
|
422
|
+
isRequired: false,
|
|
423
|
+
style: 'select',
|
|
424
|
+
items: [
|
|
425
|
+
{
|
|
426
|
+
label: 'Editor platform',
|
|
427
|
+
value: 'editor-platform',
|
|
428
|
+
},
|
|
429
|
+
{
|
|
430
|
+
label: 'Editor experiences',
|
|
431
|
+
value: 'editor-experiences',
|
|
432
|
+
},
|
|
433
|
+
],
|
|
434
|
+
},
|
|
435
|
+
{
|
|
436
|
+
name: 'status',
|
|
437
|
+
type: 'enum',
|
|
438
|
+
label: 'Status',
|
|
439
|
+
isRequired: false,
|
|
440
|
+
style: 'select',
|
|
441
|
+
items: [
|
|
442
|
+
{
|
|
443
|
+
label: 'To do',
|
|
444
|
+
value: 'to-do',
|
|
445
|
+
},
|
|
446
|
+
{
|
|
447
|
+
label: 'In Progress',
|
|
448
|
+
value: 'in-progress',
|
|
449
|
+
},
|
|
450
|
+
{
|
|
451
|
+
label: 'Done',
|
|
452
|
+
value: 'Done',
|
|
453
|
+
},
|
|
454
|
+
],
|
|
455
|
+
},
|
|
456
|
+
],
|
|
457
|
+
},
|
|
458
|
+
{
|
|
459
|
+
name: 'expand field',
|
|
460
|
+
type: 'expand',
|
|
461
|
+
label: 'awesome expand field',
|
|
462
|
+
fields: [
|
|
463
|
+
{
|
|
464
|
+
name: 'enum-select-expand',
|
|
465
|
+
type: 'enum',
|
|
466
|
+
label: 'Select one',
|
|
467
|
+
isRequired: true,
|
|
468
|
+
description: 'Pick one',
|
|
469
|
+
style: 'select',
|
|
470
|
+
isMultiple: false,
|
|
471
|
+
placeholder: 'Selected option goes here',
|
|
472
|
+
items: [
|
|
473
|
+
{ label: 'Option A', value: 'a' },
|
|
474
|
+
{ label: 'Option B', value: 'b' },
|
|
475
|
+
],
|
|
476
|
+
},
|
|
477
|
+
{
|
|
478
|
+
name: 'enum-select-icon-expand',
|
|
479
|
+
type: 'enum',
|
|
480
|
+
label: 'Select with icons',
|
|
481
|
+
description: 'Pick one',
|
|
482
|
+
style: 'select',
|
|
483
|
+
isMultiple: false,
|
|
484
|
+
items: [
|
|
485
|
+
{
|
|
486
|
+
label: 'Option A',
|
|
487
|
+
value: 'a',
|
|
488
|
+
description: 'Recommended',
|
|
489
|
+
},
|
|
490
|
+
{
|
|
491
|
+
label: 'Option B with a really really really really really really long label',
|
|
492
|
+
value: 'b',
|
|
493
|
+
description: 'One of the best options out there',
|
|
494
|
+
},
|
|
495
|
+
],
|
|
496
|
+
},
|
|
497
|
+
],
|
|
498
|
+
},
|
|
499
|
+
{
|
|
500
|
+
name: 'color-picker',
|
|
501
|
+
label: 'Color Picker',
|
|
502
|
+
type: 'color',
|
|
503
|
+
description: 'Pick your color',
|
|
504
|
+
defaultValue: '#7AB2FF',
|
|
505
|
+
},
|
|
506
|
+
{
|
|
507
|
+
name: 'color-picker-req',
|
|
508
|
+
label: 'Color Picker Required',
|
|
509
|
+
type: 'color',
|
|
510
|
+
isRequired: true,
|
|
511
|
+
description: 'Pick your color',
|
|
512
|
+
defaultValue: '#7AB2FF',
|
|
513
|
+
},
|
|
516
514
|
];
|
|
517
515
|
|
|
518
516
|
export const customFields: FieldDefinition[] = [
|
|
519
|
-
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
|
|
524
|
-
|
|
525
|
-
|
|
526
|
-
|
|
527
|
-
|
|
528
|
-
|
|
529
|
-
|
|
530
|
-
|
|
531
|
-
|
|
532
|
-
|
|
533
|
-
|
|
534
|
-
|
|
535
|
-
|
|
536
|
-
|
|
537
|
-
|
|
538
|
-
|
|
539
|
-
|
|
540
|
-
|
|
541
|
-
|
|
542
|
-
|
|
543
|
-
|
|
544
|
-
|
|
545
|
-
|
|
546
|
-
|
|
547
|
-
|
|
548
|
-
|
|
549
|
-
|
|
550
|
-
|
|
551
|
-
|
|
552
|
-
|
|
553
|
-
|
|
554
|
-
|
|
555
|
-
|
|
556
|
-
|
|
557
|
-
|
|
558
|
-
|
|
559
|
-
|
|
560
|
-
|
|
561
|
-
|
|
562
|
-
|
|
563
|
-
|
|
564
|
-
|
|
565
|
-
|
|
566
|
-
|
|
567
|
-
|
|
568
|
-
|
|
569
|
-
|
|
570
|
-
|
|
571
|
-
|
|
572
|
-
|
|
573
|
-
|
|
574
|
-
|
|
575
|
-
|
|
576
|
-
|
|
577
|
-
|
|
578
|
-
|
|
579
|
-
|
|
580
|
-
|
|
581
|
-
|
|
582
|
-
|
|
583
|
-
|
|
584
|
-
|
|
585
|
-
|
|
586
|
-
|
|
587
|
-
|
|
588
|
-
|
|
589
|
-
|
|
590
|
-
|
|
591
|
-
|
|
592
|
-
|
|
593
|
-
|
|
594
|
-
|
|
595
|
-
|
|
596
|
-
|
|
597
|
-
|
|
598
|
-
|
|
599
|
-
|
|
600
|
-
|
|
601
|
-
|
|
602
|
-
|
|
603
|
-
|
|
604
|
-
|
|
605
|
-
|
|
606
|
-
|
|
607
|
-
|
|
608
|
-
|
|
609
|
-
|
|
610
|
-
|
|
611
|
-
|
|
612
|
-
|
|
613
|
-
|
|
614
|
-
|
|
615
|
-
|
|
616
|
-
|
|
617
|
-
|
|
618
|
-
|
|
619
|
-
|
|
620
|
-
|
|
621
|
-
|
|
622
|
-
|
|
623
|
-
|
|
624
|
-
|
|
625
|
-
|
|
517
|
+
{
|
|
518
|
+
name: 'custom-required',
|
|
519
|
+
type: 'custom',
|
|
520
|
+
label: 'Custom: Required',
|
|
521
|
+
description: 'Select the option',
|
|
522
|
+
isRequired: true,
|
|
523
|
+
options: {
|
|
524
|
+
resolver: {
|
|
525
|
+
type: 'mock-resolver',
|
|
526
|
+
},
|
|
527
|
+
},
|
|
528
|
+
},
|
|
529
|
+
{
|
|
530
|
+
name: 'custom-optional',
|
|
531
|
+
type: 'custom',
|
|
532
|
+
label: 'Custom: Optional',
|
|
533
|
+
description: 'Select the option, maybe',
|
|
534
|
+
options: {
|
|
535
|
+
resolver: {
|
|
536
|
+
type: 'mock-resolver',
|
|
537
|
+
},
|
|
538
|
+
},
|
|
539
|
+
},
|
|
540
|
+
{
|
|
541
|
+
name: 'custom-required-create',
|
|
542
|
+
type: 'custom',
|
|
543
|
+
label: 'Custom: Create an option',
|
|
544
|
+
description: 'Select or create an option',
|
|
545
|
+
isRequired: true,
|
|
546
|
+
options: {
|
|
547
|
+
isCreatable: true,
|
|
548
|
+
resolver: {
|
|
549
|
+
type: 'mock-resolver',
|
|
550
|
+
},
|
|
551
|
+
},
|
|
552
|
+
},
|
|
553
|
+
{
|
|
554
|
+
name: 'custom-create-multiple',
|
|
555
|
+
type: 'custom',
|
|
556
|
+
label: 'Custom: Create option(s)',
|
|
557
|
+
description: 'Select or create option(s)',
|
|
558
|
+
isMultiple: true,
|
|
559
|
+
options: {
|
|
560
|
+
isCreatable: true,
|
|
561
|
+
resolver: {
|
|
562
|
+
type: 'mock-resolver',
|
|
563
|
+
},
|
|
564
|
+
},
|
|
565
|
+
},
|
|
566
|
+
{
|
|
567
|
+
name: 'custom-format-create-label',
|
|
568
|
+
type: 'custom',
|
|
569
|
+
label: 'Custom: Customized create label',
|
|
570
|
+
description: 'Select or create an option with a custom label',
|
|
571
|
+
options: {
|
|
572
|
+
isCreatable: true,
|
|
573
|
+
formatCreateLabel: (value: string) => {
|
|
574
|
+
return `Add "${value}" to the list`;
|
|
575
|
+
},
|
|
576
|
+
resolver: {
|
|
577
|
+
type: 'mock-resolver',
|
|
578
|
+
},
|
|
579
|
+
},
|
|
580
|
+
},
|
|
581
|
+
{
|
|
582
|
+
name: 'unsupported',
|
|
583
|
+
type: 'custom',
|
|
584
|
+
label: 'Custom: Missing provider',
|
|
585
|
+
options: {
|
|
586
|
+
resolver: {
|
|
587
|
+
type: 'missing-type',
|
|
588
|
+
},
|
|
589
|
+
},
|
|
590
|
+
},
|
|
591
|
+
{
|
|
592
|
+
name: 'user-jdog',
|
|
593
|
+
type: 'user',
|
|
594
|
+
label: 'JDog User',
|
|
595
|
+
options: {
|
|
596
|
+
provider: {
|
|
597
|
+
type: 'user-jdog-provider',
|
|
598
|
+
},
|
|
599
|
+
},
|
|
600
|
+
},
|
|
601
|
+
{
|
|
602
|
+
name: 'user-jdog-required',
|
|
603
|
+
type: 'user',
|
|
604
|
+
label: 'JDog User (Required)',
|
|
605
|
+
isRequired: true,
|
|
606
|
+
options: {
|
|
607
|
+
provider: {
|
|
608
|
+
type: 'user-jdog-provider',
|
|
609
|
+
},
|
|
610
|
+
},
|
|
611
|
+
},
|
|
612
|
+
{
|
|
613
|
+
name: 'user-jdog-multiple',
|
|
614
|
+
type: 'user',
|
|
615
|
+
label: 'JDog User (Multiple, Required)',
|
|
616
|
+
isRequired: true,
|
|
617
|
+
isMultiple: true,
|
|
618
|
+
options: {
|
|
619
|
+
provider: {
|
|
620
|
+
type: 'user-jdog-provider',
|
|
621
|
+
},
|
|
622
|
+
},
|
|
623
|
+
},
|
|
626
624
|
];
|