@atlaskit/adf-utils 19.2.2 → 19.4.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/docs/0-intro.tsx CHANGED
@@ -13,120 +13,120 @@ export default md`
13
13
  an ADF document.
14
14
 
15
15
  ${(
16
- <Props
17
- heading={'Traverse#traverse'}
18
- props={{
19
- kind: 'program',
20
- classes: [
21
- {
22
- kind: 'generic',
23
- name: {
24
- kind: 'id',
25
- name: 'Traverse API',
26
- type: null,
27
- },
28
- value: {
29
- kind: 'object',
30
- members: [
31
- {
32
- key: {
33
- kind: 'id',
34
- name: 'traverse',
35
- },
36
- kind: 'property',
37
- optional: true,
38
- value: {
39
- kind: 'generic',
40
- value: {
41
- kind: 'function',
42
- returnType: {
43
- kind: 'generic',
44
- value: {
45
- kind: 'id',
46
- name: 'ADFEntity',
47
- },
48
- },
49
- parameters: [
50
- {
51
- kind: 'param',
52
- type: null,
53
- value: {
54
- kind: 'generic',
55
- value: {
56
- kind: 'id',
57
- name: 'ADFEntity',
58
- },
59
- },
60
- },
61
- {
62
- kind: 'param',
63
- type: null,
64
- value: {
65
- kind: 'object',
66
- members: [
67
- {
68
- key: {
69
- kind: 'id',
70
- name: 'node_type',
71
- },
72
- kind: 'property',
73
- optional: true,
74
- value: {
75
- kind: 'function',
76
- returnType: {
77
- kind: 'generic',
78
- value: {
79
- kind: 'id',
80
- name: 'ADFEntity | false | undefined',
81
- },
82
- },
83
- parameters: [
84
- {
85
- kind: 'param',
86
- type: null,
87
- value: {
88
- kind: 'generic',
89
- value: {
90
- kind: 'id',
91
- name: 'ADFEntity',
92
- },
93
- },
94
- },
95
- {
96
- kind: 'param',
97
- type: null,
98
- value: {
99
- kind: 'generic',
100
- value: {
101
- kind: 'id',
102
- name: 'ParentRef',
103
- },
104
- },
105
- },
106
- ],
107
- },
108
- },
109
- ],
110
- },
111
- },
112
- ],
113
- },
114
- },
115
- leadingComments: [
116
- {
117
- type: 'commentBlock',
118
- value:
119
- 'An implementation of the [visitor pattern](https://en.wikipedia.org/wiki/Visitor_pattern) for traversing ADF documents.',
120
- },
121
- ],
122
- },
123
- ],
124
- },
125
- },
126
- ],
127
- }}
128
- />
129
- )}
16
+ <Props
17
+ heading={'Traverse#traverse'}
18
+ props={{
19
+ kind: 'program',
20
+ classes: [
21
+ {
22
+ kind: 'generic',
23
+ name: {
24
+ kind: 'id',
25
+ name: 'Traverse API',
26
+ type: null,
27
+ },
28
+ value: {
29
+ kind: 'object',
30
+ members: [
31
+ {
32
+ key: {
33
+ kind: 'id',
34
+ name: 'traverse',
35
+ },
36
+ kind: 'property',
37
+ optional: true,
38
+ value: {
39
+ kind: 'generic',
40
+ value: {
41
+ kind: 'function',
42
+ returnType: {
43
+ kind: 'generic',
44
+ value: {
45
+ kind: 'id',
46
+ name: 'ADFEntity',
47
+ },
48
+ },
49
+ parameters: [
50
+ {
51
+ kind: 'param',
52
+ type: null,
53
+ value: {
54
+ kind: 'generic',
55
+ value: {
56
+ kind: 'id',
57
+ name: 'ADFEntity',
58
+ },
59
+ },
60
+ },
61
+ {
62
+ kind: 'param',
63
+ type: null,
64
+ value: {
65
+ kind: 'object',
66
+ members: [
67
+ {
68
+ key: {
69
+ kind: 'id',
70
+ name: 'node_type',
71
+ },
72
+ kind: 'property',
73
+ optional: true,
74
+ value: {
75
+ kind: 'function',
76
+ returnType: {
77
+ kind: 'generic',
78
+ value: {
79
+ kind: 'id',
80
+ name: 'ADFEntity | false | undefined',
81
+ },
82
+ },
83
+ parameters: [
84
+ {
85
+ kind: 'param',
86
+ type: null,
87
+ value: {
88
+ kind: 'generic',
89
+ value: {
90
+ kind: 'id',
91
+ name: 'ADFEntity',
92
+ },
93
+ },
94
+ },
95
+ {
96
+ kind: 'param',
97
+ type: null,
98
+ value: {
99
+ kind: 'generic',
100
+ value: {
101
+ kind: 'id',
102
+ name: 'ParentRef',
103
+ },
104
+ },
105
+ },
106
+ ],
107
+ },
108
+ },
109
+ ],
110
+ },
111
+ },
112
+ ],
113
+ },
114
+ },
115
+ leadingComments: [
116
+ {
117
+ type: 'commentBlock',
118
+ value:
119
+ 'An implementation of the [visitor pattern](https://en.wikipedia.org/wiki/Visitor_pattern) for traversing ADF documents.',
120
+ },
121
+ ],
122
+ },
123
+ ],
124
+ },
125
+ },
126
+ ],
127
+ }}
128
+ />
129
+ )}
130
130
 
131
131
  ### Example:
132
132
 
@@ -152,96 +152,96 @@ export default md`
152
152
  `}
153
153
 
154
154
  ${(
155
- <Props
156
- heading={'Traverse#map'}
157
- props={{
158
- kind: 'program',
159
- classes: [
160
- {
161
- kind: 'generic',
162
- name: {
163
- kind: 'id',
164
- name: 'Traverse#map',
165
- type: null,
166
- },
167
- value: {
168
- kind: 'object',
169
- members: [
170
- {
171
- key: {
172
- kind: 'id',
173
- name: 'map',
174
- },
175
- kind: 'property',
176
- optional: true,
177
- value: {
178
- kind: 'generic',
179
- value: {
180
- kind: 'function',
181
- returnType: {
182
- kind: 'generic',
183
- value: {
184
- kind: 'id',
185
- name: 'Array<any>',
186
- },
187
- },
188
- parameters: [
189
- {
190
- kind: 'param',
191
- type: null,
192
- value: {
193
- kind: 'generic',
194
- value: {
195
- kind: 'id',
196
- name: 'ADFEntity',
197
- },
198
- },
199
- },
200
- {
201
- kind: 'param',
202
- type: null,
203
- value: {
204
- kind: 'function',
205
- returnType: {
206
- kind: 'generic',
207
- value: {
208
- kind: 'id',
209
- name: 'any',
210
- },
211
- },
212
- parameters: [
213
- {
214
- kind: 'param',
215
- type: null,
216
- value: {
217
- kind: 'generic',
218
- value: {
219
- kind: 'id',
220
- name: 'ADFEntity',
221
- },
222
- },
223
- },
224
- ],
225
- },
226
- },
227
- ],
228
- },
229
- },
230
- leadingComments: [
231
- {
232
- type: 'commentBlock',
233
- value:
234
- "[Array like](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/map) method to map over ADF nodes. Non-destructive – meaning that ADF can't be changed from the callback.",
235
- },
236
- ],
237
- },
238
- ],
239
- },
240
- },
241
- ],
242
- }}
243
- />
244
- )}
155
+ <Props
156
+ heading={'Traverse#map'}
157
+ props={{
158
+ kind: 'program',
159
+ classes: [
160
+ {
161
+ kind: 'generic',
162
+ name: {
163
+ kind: 'id',
164
+ name: 'Traverse#map',
165
+ type: null,
166
+ },
167
+ value: {
168
+ kind: 'object',
169
+ members: [
170
+ {
171
+ key: {
172
+ kind: 'id',
173
+ name: 'map',
174
+ },
175
+ kind: 'property',
176
+ optional: true,
177
+ value: {
178
+ kind: 'generic',
179
+ value: {
180
+ kind: 'function',
181
+ returnType: {
182
+ kind: 'generic',
183
+ value: {
184
+ kind: 'id',
185
+ name: 'Array<any>',
186
+ },
187
+ },
188
+ parameters: [
189
+ {
190
+ kind: 'param',
191
+ type: null,
192
+ value: {
193
+ kind: 'generic',
194
+ value: {
195
+ kind: 'id',
196
+ name: 'ADFEntity',
197
+ },
198
+ },
199
+ },
200
+ {
201
+ kind: 'param',
202
+ type: null,
203
+ value: {
204
+ kind: 'function',
205
+ returnType: {
206
+ kind: 'generic',
207
+ value: {
208
+ kind: 'id',
209
+ name: 'any',
210
+ },
211
+ },
212
+ parameters: [
213
+ {
214
+ kind: 'param',
215
+ type: null,
216
+ value: {
217
+ kind: 'generic',
218
+ value: {
219
+ kind: 'id',
220
+ name: 'ADFEntity',
221
+ },
222
+ },
223
+ },
224
+ ],
225
+ },
226
+ },
227
+ ],
228
+ },
229
+ },
230
+ leadingComments: [
231
+ {
232
+ type: 'commentBlock',
233
+ value:
234
+ "[Array like](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/map) method to map over ADF nodes. Non-destructive – meaning that ADF can't be changed from the callback.",
235
+ },
236
+ ],
237
+ },
238
+ ],
239
+ },
240
+ },
241
+ ],
242
+ }}
243
+ />
244
+ )}
245
245
 
246
246
  ### Example:
247
247
 
@@ -254,96 +254,96 @@ export default md`
254
254
  `}
255
255
 
256
256
  ${(
257
- <Props
258
- heading={'Traverse#filter'}
259
- props={{
260
- kind: 'program',
261
- classes: [
262
- {
263
- kind: 'generic',
264
- name: {
265
- kind: 'id',
266
- name: 'Traverse#filter',
267
- type: null,
268
- },
269
- value: {
270
- kind: 'object',
271
- members: [
272
- {
273
- key: {
274
- kind: 'id',
275
- name: 'filter',
276
- },
277
- kind: 'property',
278
- optional: true,
279
- value: {
280
- kind: 'generic',
281
- value: {
282
- kind: 'function',
283
- returnType: {
284
- kind: 'generic',
285
- value: {
286
- kind: 'id',
287
- name: 'Array<ADFEntity>',
288
- },
289
- },
290
- parameters: [
291
- {
292
- kind: 'param',
293
- type: null,
294
- value: {
295
- kind: 'generic',
296
- value: {
297
- kind: 'id',
298
- name: 'ADFEntity',
299
- },
300
- },
301
- },
302
- {
303
- kind: 'param',
304
- type: null,
305
- value: {
306
- kind: 'function',
307
- returnType: {
308
- kind: 'generic',
309
- value: {
310
- kind: 'id',
311
- name: 'boolean',
312
- },
313
- },
314
- parameters: [
315
- {
316
- kind: 'param',
317
- type: null,
318
- value: {
319
- kind: 'generic',
320
- value: {
321
- kind: 'id',
322
- name: 'ADFEntity',
323
- },
324
- },
325
- },
326
- ],
327
- },
328
- },
329
- ],
330
- },
331
- },
332
- leadingComments: [
333
- {
334
- type: 'commentBlock',
335
- value:
336
- "[Array like](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/filter) method to filter out nodes that don't match a predicate. Non-destructive – meaning that ADF can't be changed from the callback.",
337
- },
338
- ],
339
- },
340
- ],
341
- },
342
- },
343
- ],
344
- }}
345
- />
346
- )}
257
+ <Props
258
+ heading={'Traverse#filter'}
259
+ props={{
260
+ kind: 'program',
261
+ classes: [
262
+ {
263
+ kind: 'generic',
264
+ name: {
265
+ kind: 'id',
266
+ name: 'Traverse#filter',
267
+ type: null,
268
+ },
269
+ value: {
270
+ kind: 'object',
271
+ members: [
272
+ {
273
+ key: {
274
+ kind: 'id',
275
+ name: 'filter',
276
+ },
277
+ kind: 'property',
278
+ optional: true,
279
+ value: {
280
+ kind: 'generic',
281
+ value: {
282
+ kind: 'function',
283
+ returnType: {
284
+ kind: 'generic',
285
+ value: {
286
+ kind: 'id',
287
+ name: 'Array<ADFEntity>',
288
+ },
289
+ },
290
+ parameters: [
291
+ {
292
+ kind: 'param',
293
+ type: null,
294
+ value: {
295
+ kind: 'generic',
296
+ value: {
297
+ kind: 'id',
298
+ name: 'ADFEntity',
299
+ },
300
+ },
301
+ },
302
+ {
303
+ kind: 'param',
304
+ type: null,
305
+ value: {
306
+ kind: 'function',
307
+ returnType: {
308
+ kind: 'generic',
309
+ value: {
310
+ kind: 'id',
311
+ name: 'boolean',
312
+ },
313
+ },
314
+ parameters: [
315
+ {
316
+ kind: 'param',
317
+ type: null,
318
+ value: {
319
+ kind: 'generic',
320
+ value: {
321
+ kind: 'id',
322
+ name: 'ADFEntity',
323
+ },
324
+ },
325
+ },
326
+ ],
327
+ },
328
+ },
329
+ ],
330
+ },
331
+ },
332
+ leadingComments: [
333
+ {
334
+ type: 'commentBlock',
335
+ value:
336
+ "[Array like](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/filter) method to filter out nodes that don't match a predicate. Non-destructive – meaning that ADF can't be changed from the callback.",
337
+ },
338
+ ],
339
+ },
340
+ ],
341
+ },
342
+ },
343
+ ],
344
+ }}
345
+ />
346
+ )}
347
347
 
348
348
  ### Example:
349
349
 
@@ -360,118 +360,118 @@ export default md`
360
360
  `}
361
361
 
362
362
  ${(
363
- <Props
364
- heading={'Traverse#reduce'}
365
- props={{
366
- kind: 'program',
367
- classes: [
368
- {
369
- kind: 'generic',
370
- name: {
371
- kind: 'id',
372
- name: 'Traverse#reduce',
373
- type: null,
374
- },
375
- value: {
376
- kind: 'object',
377
- members: [
378
- {
379
- key: {
380
- kind: 'id',
381
- name: 'reduce',
382
- },
383
- kind: 'property',
384
- optional: true,
385
- value: {
386
- kind: 'generic',
387
- value: {
388
- kind: 'function',
389
- returnType: {
390
- kind: 'generic',
391
- value: {
392
- kind: 'id',
393
- name: 'accumulator',
394
- },
395
- },
396
- parameters: [
397
- {
398
- kind: 'param',
399
- type: null,
400
- value: {
401
- kind: 'generic',
402
- value: {
403
- kind: 'id',
404
- name: 'ADFEntity',
405
- },
406
- },
407
- },
408
- {
409
- kind: 'param',
410
- type: null,
411
- value: {
412
- kind: 'function',
413
- returnType: {
414
- kind: 'generic',
415
- value: {
416
- kind: 'id',
417
- name: 'accumulator',
418
- },
419
- },
420
- parameters: [
421
- {
422
- kind: 'param',
423
- type: null,
424
- value: {
425
- kind: 'generic',
426
- value: {
427
- kind: 'id',
428
- name: 'accumulator',
429
- },
430
- },
431
- },
432
- {
433
- kind: 'param',
434
- type: null,
435
- value: {
436
- kind: 'generic',
437
- value: {
438
- kind: 'id',
439
- name: 'ADFEntity',
440
- },
441
- },
442
- },
443
- ],
444
- },
445
- },
446
- {
447
- kind: 'param',
448
- type: null,
449
- value: {
450
- kind: 'generic',
451
- value: {
452
- kind: 'id',
453
- name: 'initial',
454
- },
455
- },
456
- },
457
- ],
458
- },
459
- },
460
- leadingComments: [
461
- {
462
- type: 'commentBlock',
463
- value:
464
- "[Array like](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/reduce) redcue method – applies a function against an accumulator and each node in the ADF (from left to right) to reduce it to a single value. Non-destructive – meaning that ADF can't be changed from the callback.",
465
- },
466
- ],
467
- },
468
- ],
469
- },
470
- },
471
- ],
472
- }}
473
- />
474
- )}
363
+ <Props
364
+ heading={'Traverse#reduce'}
365
+ props={{
366
+ kind: 'program',
367
+ classes: [
368
+ {
369
+ kind: 'generic',
370
+ name: {
371
+ kind: 'id',
372
+ name: 'Traverse#reduce',
373
+ type: null,
374
+ },
375
+ value: {
376
+ kind: 'object',
377
+ members: [
378
+ {
379
+ key: {
380
+ kind: 'id',
381
+ name: 'reduce',
382
+ },
383
+ kind: 'property',
384
+ optional: true,
385
+ value: {
386
+ kind: 'generic',
387
+ value: {
388
+ kind: 'function',
389
+ returnType: {
390
+ kind: 'generic',
391
+ value: {
392
+ kind: 'id',
393
+ name: 'accumulator',
394
+ },
395
+ },
396
+ parameters: [
397
+ {
398
+ kind: 'param',
399
+ type: null,
400
+ value: {
401
+ kind: 'generic',
402
+ value: {
403
+ kind: 'id',
404
+ name: 'ADFEntity',
405
+ },
406
+ },
407
+ },
408
+ {
409
+ kind: 'param',
410
+ type: null,
411
+ value: {
412
+ kind: 'function',
413
+ returnType: {
414
+ kind: 'generic',
415
+ value: {
416
+ kind: 'id',
417
+ name: 'accumulator',
418
+ },
419
+ },
420
+ parameters: [
421
+ {
422
+ kind: 'param',
423
+ type: null,
424
+ value: {
425
+ kind: 'generic',
426
+ value: {
427
+ kind: 'id',
428
+ name: 'accumulator',
429
+ },
430
+ },
431
+ },
432
+ {
433
+ kind: 'param',
434
+ type: null,
435
+ value: {
436
+ kind: 'generic',
437
+ value: {
438
+ kind: 'id',
439
+ name: 'ADFEntity',
440
+ },
441
+ },
442
+ },
443
+ ],
444
+ },
445
+ },
446
+ {
447
+ kind: 'param',
448
+ type: null,
449
+ value: {
450
+ kind: 'generic',
451
+ value: {
452
+ kind: 'id',
453
+ name: 'initial',
454
+ },
455
+ },
456
+ },
457
+ ],
458
+ },
459
+ },
460
+ leadingComments: [
461
+ {
462
+ type: 'commentBlock',
463
+ value:
464
+ "[Array like](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/reduce) redcue method – applies a function against an accumulator and each node in the ADF (from left to right) to reduce it to a single value. Non-destructive – meaning that ADF can't be changed from the callback.",
465
+ },
466
+ ],
467
+ },
468
+ ],
469
+ },
470
+ },
471
+ ],
472
+ }}
473
+ />
474
+ )}
475
475
 
476
476
  ### Example:
477
477