@wise/dynamic-flow-types 3.1.3 → 3.2.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/build/main.js +205 -151
- package/build/main.mjs +205 -151
- package/build/next/feature/Behavior.d.ts +3 -1
- package/build/next/feature/DismissBehavior.d.ts +9 -0
- package/build/next/feature/ModalBehavior.d.ts +20 -0
- package/build/next/feature/SuggestionsValue.d.ts +1 -1
- package/build/next/index.d.ts +6 -0
- package/build/next/responses/modal/ModalResponseBody.d.ts +18 -0
- package/build/renderers/AlertRendererProps.d.ts +8 -10
- package/build/renderers/ListRendererProps.d.ts +7 -11
- package/build/renderers/ModalContentRendererProps.d.ts +10 -0
- package/build/renderers/RendererProps.d.ts +3 -2
- package/build/renderers/index.d.ts +2 -1
- package/build/zod/schemas.d.ts +402 -7676
- package/build/zod/schemas.ts +480 -403
- package/package.json +5 -5
package/build/main.mjs
CHANGED
|
@@ -260,11 +260,14 @@ var summaryProviderSchema = z.object({
|
|
|
260
260
|
var uploadSourceSchema = z.union([z.literal("camera"), z.literal("file")]);
|
|
261
261
|
var suggestionsValueSchema = z.object({
|
|
262
262
|
label: z.string(),
|
|
263
|
-
value: jsonElementSchema
|
|
263
|
+
value: jsonElementSchema,
|
|
264
264
|
icon: iconSchema.optional(),
|
|
265
265
|
image: imageSchema.optional(),
|
|
266
266
|
tag: z.string().optional()
|
|
267
267
|
});
|
|
268
|
+
var dismissBehaviorSchema = z.object({
|
|
269
|
+
type: z.literal("dismiss")
|
|
270
|
+
});
|
|
268
271
|
var navigationStackBehaviorSchema = z.union([
|
|
269
272
|
z.literal("default"),
|
|
270
273
|
z.literal("remove-previous"),
|
|
@@ -367,165 +370,113 @@ var containerBehaviorSchema = z.object({
|
|
|
367
370
|
action: actionSchema.optional(),
|
|
368
371
|
link: linkSchema.optional()
|
|
369
372
|
});
|
|
370
|
-
var behaviorSchema = z.union([
|
|
371
|
-
actionBehaviorSchema,
|
|
372
|
-
containerBehaviorSchema,
|
|
373
|
-
linkBehaviorSchema
|
|
374
|
-
]);
|
|
375
|
-
var alertLayoutCallToActionSchema = z.object({
|
|
376
|
-
title: z.string(),
|
|
377
|
-
accessibilityDescription: z.string().optional(),
|
|
378
|
-
behavior: behaviorSchema
|
|
379
|
-
});
|
|
380
|
-
var listLayoutCallToActionSchema = z.object({
|
|
381
|
-
title: z.string(),
|
|
382
|
-
accessibilityDescription: z.string().optional(),
|
|
383
|
-
behavior: behaviorSchema
|
|
384
|
-
});
|
|
385
|
-
var decisionLayoutOptionSchema = z.object({
|
|
386
|
-
action: actionSchema.optional(),
|
|
387
|
-
title: z.string(),
|
|
388
|
-
description: z.string().optional(),
|
|
389
|
-
disabled: z.boolean().optional(),
|
|
390
|
-
icon: iconSchema.optional(),
|
|
391
|
-
image: imageSchema.optional(),
|
|
392
|
-
behavior: behaviorSchema.optional(),
|
|
393
|
-
tag: z.string().optional()
|
|
394
|
-
});
|
|
395
|
-
var itemCallToActionSchema = z.object({
|
|
396
|
-
title: z.string(),
|
|
397
|
-
accessibilityDescription: z.string().optional(),
|
|
398
|
-
behavior: behaviorSchema
|
|
399
|
-
});
|
|
400
|
-
var buttonLayoutSchema = z.object({
|
|
401
|
-
type: z.literal("button"),
|
|
402
|
-
action: actionSchema.optional(),
|
|
403
|
-
size: sizeSchema.optional(),
|
|
404
|
-
title: z.string().optional(),
|
|
405
|
-
behavior: behaviorSchema.optional(),
|
|
406
|
-
context: contextSchema.optional(),
|
|
407
|
-
disabled: z.boolean().optional(),
|
|
408
|
-
pinOrder: z.number().optional(),
|
|
409
|
-
control: z.string().optional(),
|
|
410
|
-
margin: sizeSchema.optional()
|
|
411
|
-
});
|
|
412
373
|
var searchResultSchema = z.union([searchResultActionSchema, searchResultSearchSchema]);
|
|
413
|
-
var linkHandlerSchema = z.object({
|
|
414
|
-
regexPattern: z.string(),
|
|
415
|
-
behavior: behaviorSchema.optional()
|
|
416
|
-
});
|
|
417
374
|
var navigationSchema = z.object({
|
|
418
375
|
backButton: navigationBackBehaviorSchema.optional(),
|
|
419
376
|
back: navigationBackBehaviorSchema.optional(),
|
|
420
377
|
stackBehavior: navigationStackBehaviorSchema.optional()
|
|
421
378
|
});
|
|
422
|
-
var pollingOnErrorSchema = z.object({
|
|
423
|
-
action: actionSchema.optional(),
|
|
424
|
-
behavior: behaviorSchema.optional()
|
|
425
|
-
});
|
|
426
|
-
var reviewLayoutCallToActionSchema = z.object({
|
|
427
|
-
action: actionSchema.optional(),
|
|
428
|
-
title: z.string(),
|
|
429
|
-
accessibilityDescription: z.string().optional(),
|
|
430
|
-
behavior: behaviorSchema.optional()
|
|
431
|
-
});
|
|
432
|
-
var alertLayoutSchema = z.object({
|
|
433
|
-
type: z.literal("alert"),
|
|
434
|
-
markdown: z.string(),
|
|
435
|
-
context: contextSchema.optional(),
|
|
436
|
-
control: z.string().optional(),
|
|
437
|
-
margin: sizeSchema.optional(),
|
|
438
|
-
callToAction: alertLayoutCallToActionSchema.optional()
|
|
439
|
-
});
|
|
440
|
-
var listLayoutSchema = z.object({
|
|
441
|
-
type: z.literal("list"),
|
|
442
|
-
title: z.string().optional(),
|
|
443
|
-
callToAction: listLayoutCallToActionSchema.optional(),
|
|
444
|
-
items: z.array(listLayoutItemSchema),
|
|
445
|
-
control: z.string().optional(),
|
|
446
|
-
margin: sizeSchema.optional()
|
|
447
|
-
});
|
|
448
|
-
var decisionLayoutSchema = z.object({
|
|
449
|
-
type: z.literal("decision"),
|
|
450
|
-
title: z.string().optional(),
|
|
451
|
-
options: z.array(decisionLayoutOptionSchema),
|
|
452
|
-
control: z.string().optional(),
|
|
453
|
-
margin: sizeSchema.optional()
|
|
454
|
-
});
|
|
455
|
-
var statusListLayoutItemSchema = z.object({
|
|
456
|
-
title: z.string(),
|
|
457
|
-
description: z.string().optional(),
|
|
458
|
-
icon: iconSchema,
|
|
459
|
-
status: statusListLayoutStatusSchema.optional(),
|
|
460
|
-
callToAction: itemCallToActionSchema.optional(),
|
|
461
|
-
tag: z.string().optional()
|
|
462
|
-
});
|
|
463
|
-
var reviewLayoutSchema = z.object({
|
|
464
|
-
type: z.literal("review"),
|
|
465
|
-
orientation: z.string().optional(),
|
|
466
|
-
action: actionSchema.optional(),
|
|
467
|
-
fields: z.array(reviewLayoutFieldSchema),
|
|
468
|
-
title: z.string().optional(),
|
|
469
|
-
callToAction: reviewLayoutCallToActionSchema.optional(),
|
|
470
|
-
control: z.string().optional(),
|
|
471
|
-
margin: sizeSchema.optional()
|
|
472
|
-
});
|
|
473
379
|
var searchResponseBodySchema = z.object({
|
|
474
380
|
results: z.array(searchResultSchema)
|
|
475
381
|
});
|
|
476
|
-
var
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
var
|
|
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
|
-
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
|
|
518
|
-
|
|
519
|
-
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
|
|
524
|
-
|
|
525
|
-
|
|
526
|
-
|
|
527
|
-
|
|
528
|
-
|
|
382
|
+
var reviewLayoutCallToActionSchema = z.lazy(
|
|
383
|
+
() => z.object({
|
|
384
|
+
action: actionSchema.optional(),
|
|
385
|
+
title: z.string(),
|
|
386
|
+
accessibilityDescription: z.string().optional(),
|
|
387
|
+
behavior: behaviorSchema.optional()
|
|
388
|
+
})
|
|
389
|
+
);
|
|
390
|
+
var behaviorSchema = z.lazy(
|
|
391
|
+
() => z.union([
|
|
392
|
+
actionBehaviorSchema,
|
|
393
|
+
containerBehaviorSchema,
|
|
394
|
+
dismissBehaviorSchema,
|
|
395
|
+
linkBehaviorSchema,
|
|
396
|
+
modalBehaviorSchema
|
|
397
|
+
])
|
|
398
|
+
);
|
|
399
|
+
var alertLayoutSchema = z.lazy(
|
|
400
|
+
() => z.object({
|
|
401
|
+
type: z.literal("alert"),
|
|
402
|
+
markdown: z.string(),
|
|
403
|
+
context: contextSchema.optional(),
|
|
404
|
+
control: z.string().optional(),
|
|
405
|
+
margin: sizeSchema.optional(),
|
|
406
|
+
callToAction: alertLayoutCallToActionSchema.optional()
|
|
407
|
+
})
|
|
408
|
+
);
|
|
409
|
+
var alertLayoutCallToActionSchema = z.lazy(
|
|
410
|
+
() => z.object({
|
|
411
|
+
title: z.string(),
|
|
412
|
+
accessibilityDescription: z.string().optional(),
|
|
413
|
+
behavior: behaviorSchema
|
|
414
|
+
})
|
|
415
|
+
);
|
|
416
|
+
var listLayoutSchema = z.lazy(
|
|
417
|
+
() => z.object({
|
|
418
|
+
type: z.literal("list"),
|
|
419
|
+
title: z.string().optional(),
|
|
420
|
+
callToAction: listLayoutCallToActionSchema.optional(),
|
|
421
|
+
items: z.array(listLayoutItemSchema),
|
|
422
|
+
control: z.string().optional(),
|
|
423
|
+
margin: sizeSchema.optional()
|
|
424
|
+
})
|
|
425
|
+
);
|
|
426
|
+
var listLayoutCallToActionSchema = z.lazy(
|
|
427
|
+
() => z.object({
|
|
428
|
+
title: z.string(),
|
|
429
|
+
accessibilityDescription: z.string().optional(),
|
|
430
|
+
behavior: behaviorSchema
|
|
431
|
+
})
|
|
432
|
+
);
|
|
433
|
+
var decisionLayoutSchema = z.lazy(
|
|
434
|
+
() => z.object({
|
|
435
|
+
type: z.literal("decision"),
|
|
436
|
+
title: z.string().optional(),
|
|
437
|
+
options: z.array(decisionLayoutOptionSchema),
|
|
438
|
+
control: z.string().optional(),
|
|
439
|
+
margin: sizeSchema.optional()
|
|
440
|
+
})
|
|
441
|
+
);
|
|
442
|
+
var decisionLayoutOptionSchema = z.lazy(
|
|
443
|
+
() => z.object({
|
|
444
|
+
action: actionSchema.optional(),
|
|
445
|
+
title: z.string(),
|
|
446
|
+
description: z.string().optional(),
|
|
447
|
+
disabled: z.boolean().optional(),
|
|
448
|
+
icon: iconSchema.optional(),
|
|
449
|
+
image: imageSchema.optional(),
|
|
450
|
+
behavior: behaviorSchema.optional(),
|
|
451
|
+
tag: z.string().optional()
|
|
452
|
+
})
|
|
453
|
+
);
|
|
454
|
+
var statusListLayoutSchema = z.lazy(
|
|
455
|
+
() => z.object({
|
|
456
|
+
type: z.literal("status-list"),
|
|
457
|
+
items: z.array(statusListLayoutItemSchema),
|
|
458
|
+
title: z.string().optional(),
|
|
459
|
+
control: z.string().optional(),
|
|
460
|
+
margin: sizeSchema.optional()
|
|
461
|
+
})
|
|
462
|
+
);
|
|
463
|
+
var statusListLayoutItemSchema = z.lazy(
|
|
464
|
+
() => z.object({
|
|
465
|
+
title: z.string(),
|
|
466
|
+
description: z.string().optional(),
|
|
467
|
+
icon: iconSchema,
|
|
468
|
+
status: statusListLayoutStatusSchema.optional(),
|
|
469
|
+
callToAction: itemCallToActionSchema.optional(),
|
|
470
|
+
tag: z.string().optional()
|
|
471
|
+
})
|
|
472
|
+
);
|
|
473
|
+
var itemCallToActionSchema = z.lazy(
|
|
474
|
+
() => z.object({
|
|
475
|
+
title: z.string(),
|
|
476
|
+
accessibilityDescription: z.string().optional(),
|
|
477
|
+
behavior: behaviorSchema
|
|
478
|
+
})
|
|
479
|
+
);
|
|
529
480
|
var layoutSchema = z.lazy(
|
|
530
481
|
() => z.union([
|
|
531
482
|
alertLayoutSchema,
|
|
@@ -559,6 +510,20 @@ var boxLayoutSchema = z.lazy(
|
|
|
559
510
|
margin: sizeSchema.optional()
|
|
560
511
|
})
|
|
561
512
|
);
|
|
513
|
+
var buttonLayoutSchema = z.lazy(
|
|
514
|
+
() => z.object({
|
|
515
|
+
type: z.literal("button"),
|
|
516
|
+
action: actionSchema.optional(),
|
|
517
|
+
size: sizeSchema.optional(),
|
|
518
|
+
title: z.string().optional(),
|
|
519
|
+
behavior: behaviorSchema.optional(),
|
|
520
|
+
context: contextSchema.optional(),
|
|
521
|
+
disabled: z.boolean().optional(),
|
|
522
|
+
pinOrder: z.number().optional(),
|
|
523
|
+
control: z.string().optional(),
|
|
524
|
+
margin: sizeSchema.optional()
|
|
525
|
+
})
|
|
526
|
+
);
|
|
562
527
|
var columnsLayoutSchema = z.lazy(
|
|
563
528
|
() => z.object({
|
|
564
529
|
type: z.literal("columns"),
|
|
@@ -578,12 +543,30 @@ var modalLayoutSchema = z.lazy(
|
|
|
578
543
|
content: modalLayoutContentSchema
|
|
579
544
|
})
|
|
580
545
|
);
|
|
546
|
+
var reviewLayoutSchema = z.lazy(
|
|
547
|
+
() => z.object({
|
|
548
|
+
type: z.literal("review"),
|
|
549
|
+
orientation: z.string().optional(),
|
|
550
|
+
action: actionSchema.optional(),
|
|
551
|
+
fields: z.array(reviewLayoutFieldSchema),
|
|
552
|
+
title: z.string().optional(),
|
|
553
|
+
callToAction: reviewLayoutCallToActionSchema.optional(),
|
|
554
|
+
control: z.string().optional(),
|
|
555
|
+
margin: sizeSchema.optional()
|
|
556
|
+
})
|
|
557
|
+
);
|
|
581
558
|
var modalLayoutContentSchema = z.lazy(
|
|
582
559
|
() => z.object({
|
|
583
560
|
title: z.string().optional(),
|
|
584
561
|
components: z.array(layoutSchema)
|
|
585
562
|
})
|
|
586
563
|
);
|
|
564
|
+
var modalResponseBodySchema = z.lazy(
|
|
565
|
+
() => z.object({
|
|
566
|
+
title: z.string().optional(),
|
|
567
|
+
content: z.array(layoutSchema)
|
|
568
|
+
})
|
|
569
|
+
);
|
|
587
570
|
var stepSchema = z.lazy(
|
|
588
571
|
() => z.object({
|
|
589
572
|
key: z.string().optional(),
|
|
@@ -621,6 +604,22 @@ var schemaSchema = z.lazy(
|
|
|
621
604
|
stringSchemaSchema
|
|
622
605
|
])
|
|
623
606
|
);
|
|
607
|
+
var pollingSchema = z.lazy(
|
|
608
|
+
() => z.object({
|
|
609
|
+
interval: z.number().optional(),
|
|
610
|
+
url: z.string(),
|
|
611
|
+
delay: z.number().optional(),
|
|
612
|
+
timeout: z.number().optional(),
|
|
613
|
+
maxAttempts: z.number(),
|
|
614
|
+
onError: pollingOnErrorSchema
|
|
615
|
+
})
|
|
616
|
+
);
|
|
617
|
+
var linkHandlerSchema = z.lazy(
|
|
618
|
+
() => z.object({
|
|
619
|
+
regexPattern: z.string(),
|
|
620
|
+
behavior: behaviorSchema.optional()
|
|
621
|
+
})
|
|
622
|
+
);
|
|
624
623
|
var allOfSchemaSchema = z.lazy(
|
|
625
624
|
() => z.object({
|
|
626
625
|
disabled: z.boolean().optional(),
|
|
@@ -642,6 +641,30 @@ var allOfSchemaSchema = z.lazy(
|
|
|
642
641
|
var arraySchemaSchema = z.lazy(
|
|
643
642
|
() => z.union([arraySchemaListSchema, arraySchemaTupleSchema])
|
|
644
643
|
);
|
|
644
|
+
var blobSchemaSchema = z.lazy(
|
|
645
|
+
() => z.object({
|
|
646
|
+
type: z.literal("blob"),
|
|
647
|
+
promoted: z.boolean().optional(),
|
|
648
|
+
$id: z.string().optional(),
|
|
649
|
+
title: z.string().optional(),
|
|
650
|
+
description: z.string().optional(),
|
|
651
|
+
control: z.string().optional(),
|
|
652
|
+
hidden: z.boolean().optional(),
|
|
653
|
+
icon: iconSchema.optional(),
|
|
654
|
+
image: imageSchema.optional(),
|
|
655
|
+
keywords: z.array(z.string()).optional(),
|
|
656
|
+
summary: summaryProviderSchema.optional(),
|
|
657
|
+
analyticsId: z.string().optional(),
|
|
658
|
+
validationAsync: validateAsyncSchema.optional(),
|
|
659
|
+
validationMessages: z.record(z.string()).optional(),
|
|
660
|
+
alert: alertLayoutSchema.optional(),
|
|
661
|
+
cameraConfig: jsonElementSchema.optional(),
|
|
662
|
+
accepts: z.array(z.string()).optional(),
|
|
663
|
+
maxSize: z.number().optional(),
|
|
664
|
+
source: uploadSourceSchema.optional(),
|
|
665
|
+
disabled: z.boolean().optional()
|
|
666
|
+
})
|
|
667
|
+
);
|
|
645
668
|
var booleanSchemaSchema = z.lazy(
|
|
646
669
|
() => z.object({
|
|
647
670
|
type: z.literal("boolean"),
|
|
@@ -670,6 +693,24 @@ var booleanSchemaSchema = z.lazy(
|
|
|
670
693
|
help: helpSchema.optional()
|
|
671
694
|
})
|
|
672
695
|
);
|
|
696
|
+
var constSchemaSchema = z.lazy(
|
|
697
|
+
() => z.object({
|
|
698
|
+
hidden: z.boolean().optional(),
|
|
699
|
+
alert: alertLayoutSchema.optional(),
|
|
700
|
+
control: z.string().optional(),
|
|
701
|
+
promoted: z.boolean().optional(),
|
|
702
|
+
$id: z.string().optional(),
|
|
703
|
+
const: jsonElementSchema,
|
|
704
|
+
title: z.string().optional(),
|
|
705
|
+
description: z.string().optional(),
|
|
706
|
+
icon: iconSchema.optional(),
|
|
707
|
+
image: imageSchema.optional(),
|
|
708
|
+
keywords: z.array(z.string()).optional(),
|
|
709
|
+
summary: summaryProviderSchema.optional(),
|
|
710
|
+
analyticsId: z.string().optional(),
|
|
711
|
+
disabled: z.boolean().optional()
|
|
712
|
+
})
|
|
713
|
+
);
|
|
673
714
|
var integerSchemaSchema = z.lazy(
|
|
674
715
|
() => z.object({
|
|
675
716
|
type: z.literal("integer"),
|
|
@@ -889,6 +930,19 @@ var arraySchemaTupleSchema = z.lazy(
|
|
|
889
930
|
alert: alertLayoutSchema.optional()
|
|
890
931
|
})
|
|
891
932
|
);
|
|
933
|
+
var pollingOnErrorSchema = z.lazy(
|
|
934
|
+
() => z.object({
|
|
935
|
+
action: actionSchema.optional(),
|
|
936
|
+
behavior: behaviorSchema.optional()
|
|
937
|
+
})
|
|
938
|
+
);
|
|
939
|
+
var modalBehaviorSchema = z.lazy(
|
|
940
|
+
() => z.object({
|
|
941
|
+
type: z.literal("modal"),
|
|
942
|
+
title: z.string().optional(),
|
|
943
|
+
content: z.array(layoutSchema)
|
|
944
|
+
})
|
|
945
|
+
);
|
|
892
946
|
|
|
893
947
|
// src/zod/validators.ts
|
|
894
948
|
var validateStep = (step) => validate(step, stepSchema);
|
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
import type { ActionBehavior } from './ActionBehavior';
|
|
2
2
|
import type { ContainerBehavior } from './ContainerBehavior';
|
|
3
|
+
import type { DismissBehavior } from './DismissBehavior';
|
|
3
4
|
import type { LinkBehavior } from './LinkBehavior';
|
|
5
|
+
import type { ModalBehavior } from './ModalBehavior';
|
|
4
6
|
/**
|
|
5
7
|
* Describes the result of performing some interaction.
|
|
6
8
|
*/
|
|
7
|
-
export type Behavior = ActionBehavior | ContainerBehavior | LinkBehavior;
|
|
9
|
+
export type Behavior = ActionBehavior | ContainerBehavior | DismissBehavior | LinkBehavior | ModalBehavior;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import type { Layout } from '../layout/Layout';
|
|
2
|
+
/**
|
|
3
|
+
* Opens a modal when the behavior is triggered.
|
|
4
|
+
*/
|
|
5
|
+
export type ModalBehavior = {
|
|
6
|
+
/**
|
|
7
|
+
* It must be `modal`.
|
|
8
|
+
*/
|
|
9
|
+
type: 'modal';
|
|
10
|
+
/**
|
|
11
|
+
* The user-facing title of the modal.
|
|
12
|
+
*/
|
|
13
|
+
title?: string;
|
|
14
|
+
/**
|
|
15
|
+
* The content which should be displayed within the modal.
|
|
16
|
+
* Please note that we discourage the use of form components within modals as
|
|
17
|
+
* this can lead to an undesirable user experience with validation.
|
|
18
|
+
*/
|
|
19
|
+
content: Layout[];
|
|
20
|
+
};
|
package/build/next/index.d.ts
CHANGED
|
@@ -7,6 +7,11 @@ export type { Polling } from './feature/Polling';
|
|
|
7
7
|
export type { PollingOnError } from './feature/PollingOnError';
|
|
8
8
|
export type { ValidateAsync } from './feature/ValidateAsync';
|
|
9
9
|
export type { Behavior } from './feature/Behavior';
|
|
10
|
+
export type { ActionBehavior } from './feature/ActionBehavior';
|
|
11
|
+
export type { LinkBehavior } from './feature/LinkBehavior';
|
|
12
|
+
export type { ModalBehavior } from './feature/ModalBehavior';
|
|
13
|
+
export type { DismissBehavior } from './feature/DismissBehavior';
|
|
14
|
+
export type { LinkHandler } from './feature/LinkHandler';
|
|
10
15
|
export type { Align } from './misc/Align';
|
|
11
16
|
export type { AutocapitalizationType } from './misc/AutocapitalizationType';
|
|
12
17
|
export type { Context } from './misc/Context';
|
|
@@ -67,6 +72,7 @@ export type { ArraySchemaTuple } from './schema/ArraySchemaTuple';
|
|
|
67
72
|
export type { StringSchemaFormat } from './schema/StringSchemaFormat';
|
|
68
73
|
export type { ActionResponseBody } from './responses/action/ActionResponseBody';
|
|
69
74
|
export type { ErrorResponseBody } from './responses/error/ErrorResponseBody';
|
|
75
|
+
export type { ModalResponseBody } from './responses/modal/ModalResponseBody';
|
|
70
76
|
export type { Step } from './step/Step';
|
|
71
77
|
export type { JsonElement, JsonPrimitive, JsonArray, JsonObject } from './JsonElement';
|
|
72
78
|
export type Model = JsonElement;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import type { Layout } from '../../layout/Layout';
|
|
2
|
+
/**
|
|
3
|
+
* Represents a Modal response body.
|
|
4
|
+
* A response is determined to be a Modal when the status code is in the 200-299 range,
|
|
5
|
+
* and the `X-DF-Response-Type: modal` header is provided.
|
|
6
|
+
* When this response is received, the client opens the provided modal as if it was included as
|
|
7
|
+
* a ModalBehavior on the Step being presented.
|
|
8
|
+
*/
|
|
9
|
+
export type ModalResponseBody = {
|
|
10
|
+
/**
|
|
11
|
+
* A user-facing title for the modal content block
|
|
12
|
+
*/
|
|
13
|
+
title?: string;
|
|
14
|
+
/**
|
|
15
|
+
* The layout components to appear inside the modal when presented
|
|
16
|
+
*/
|
|
17
|
+
content: Layout[];
|
|
18
|
+
};
|
|
@@ -6,17 +6,15 @@ export type AlertRendererProps = BaseRendererProps & {
|
|
|
6
6
|
context: Context;
|
|
7
7
|
margin: Margin;
|
|
8
8
|
markdown: string;
|
|
9
|
-
callToAction?: AlertCallToAction
|
|
10
|
-
};
|
|
11
|
-
export type AlertCallToActionLink = {
|
|
12
|
-
type: 'link';
|
|
13
|
-
accessibilityDescription?: string;
|
|
14
|
-
href: string;
|
|
15
|
-
title: string;
|
|
9
|
+
callToAction?: AlertCallToAction;
|
|
16
10
|
};
|
|
17
11
|
export type AlertCallToAction = {
|
|
18
|
-
type: 'action';
|
|
19
|
-
accessibilityDescription?: string;
|
|
20
12
|
title: string;
|
|
13
|
+
accessibilityDescription?: string;
|
|
14
|
+
} & ({
|
|
15
|
+
type: 'link';
|
|
16
|
+
href: string;
|
|
17
|
+
} | {
|
|
18
|
+
type: 'action' | 'dismiss' | 'modal';
|
|
21
19
|
onClick: () => void;
|
|
22
|
-
};
|
|
20
|
+
});
|
|
@@ -19,17 +19,13 @@ export type ListItem = {
|
|
|
19
19
|
subvalue?: string;
|
|
20
20
|
tag?: string;
|
|
21
21
|
};
|
|
22
|
-
export type ListCallToAction =
|
|
23
|
-
export type ListCallToActionLink = {
|
|
24
|
-
type: 'link';
|
|
22
|
+
export type ListCallToAction = {
|
|
25
23
|
accessibilityDescription?: string;
|
|
26
|
-
href: string;
|
|
27
24
|
title: string;
|
|
28
25
|
onClick: () => void;
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
};
|
|
26
|
+
} & ({
|
|
27
|
+
type: 'action' | 'modal' | 'dismiss';
|
|
28
|
+
} | {
|
|
29
|
+
type: 'link';
|
|
30
|
+
href: string;
|
|
31
|
+
});
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { ReactNode } from 'react';
|
|
2
|
+
import { BaseRendererProps, RendererProps } from './RendererProps';
|
|
3
|
+
export type ModalContentRendererProps = BaseRendererProps & {
|
|
4
|
+
type: 'modal-content';
|
|
5
|
+
children: ReactNode;
|
|
6
|
+
childrenProps: RendererProps[];
|
|
7
|
+
open: boolean;
|
|
8
|
+
title?: string;
|
|
9
|
+
onClose: () => void;
|
|
10
|
+
};
|
|
@@ -16,6 +16,7 @@ import { IntegerInputRendererProps } from './IntegerInputRendererProps';
|
|
|
16
16
|
import { ListRendererProps } from './ListRendererProps';
|
|
17
17
|
import { LoadingIndicatorRendererProps } from './LoadingIndicatorRendererProps';
|
|
18
18
|
import { MarkdownRendererProps } from './MarkdownRendererProps';
|
|
19
|
+
import { ModalContentRendererProps } from './ModalContentRendererProps';
|
|
19
20
|
import { ModalRendererProps } from './ModalRendererProps';
|
|
20
21
|
import { MultiSelectInputRendererProps } from './MultiSelectInputRendererProps';
|
|
21
22
|
import { MultiUploadInputRendererProps } from './MultiUploadInputRendererProps';
|
|
@@ -31,7 +32,7 @@ import { StatusListRendererProps } from './StatusListRendererProps';
|
|
|
31
32
|
import { AnalyticsEventDispatcher, LoadingState, StepRendererProps } from './StepRendererProps';
|
|
32
33
|
import { TextInputRendererProps } from './TextInputRendererProps';
|
|
33
34
|
import { UploadInputRendererProps } from './UploadInputRendererProps';
|
|
34
|
-
export type RendererProps = AlertRendererProps | CheckboxInputRendererProps | BoxRendererProps | ButtonRendererProps | ColumnsRendererProps | CoreContainerRendererProps | DateInputRendererProps | DecisionRendererProps | DividerRendererProps | FormRendererProps | HeadingRendererProps | HiddenRendererProps | ImageRendererProps | InstructionsRendererProps | IntegerInputRendererProps | ListRendererProps | LoadingIndicatorRendererProps | MarkdownRendererProps | ModalRendererProps | MultiSelectInputRendererProps | MultiUploadInputRendererProps | NumberInputRendererProps | ParagraphRendererProps | RepeatableRendererProps | ReviewRendererProps | RootRendererProps | SearchRendererProps | SectionRendererProps | SelectInputRendererProps | StatusListRendererProps | StepRendererProps | TextInputRendererProps | UploadInputRendererProps;
|
|
35
|
+
export type RendererProps = AlertRendererProps | CheckboxInputRendererProps | BoxRendererProps | ButtonRendererProps | ColumnsRendererProps | CoreContainerRendererProps | DateInputRendererProps | DecisionRendererProps | DividerRendererProps | FormRendererProps | HeadingRendererProps | HiddenRendererProps | ImageRendererProps | InstructionsRendererProps | IntegerInputRendererProps | ListRendererProps | LoadingIndicatorRendererProps | MarkdownRendererProps | ModalRendererProps | ModalContentRendererProps | MultiSelectInputRendererProps | MultiUploadInputRendererProps | NumberInputRendererProps | ParagraphRendererProps | RepeatableRendererProps | ReviewRendererProps | RootRendererProps | SearchRendererProps | SectionRendererProps | SelectInputRendererProps | StatusListRendererProps | StepRendererProps | TextInputRendererProps | UploadInputRendererProps;
|
|
35
36
|
export type Renderer<P extends RendererProps> = {
|
|
36
37
|
canRenderType: P['type'];
|
|
37
38
|
canRender?: (props: P) => boolean;
|
|
@@ -41,7 +42,7 @@ export type RendererContext = {
|
|
|
41
42
|
render: RenderFunction;
|
|
42
43
|
};
|
|
43
44
|
export type RenderFunction = (props: RendererProps | null) => JSX.Element | null;
|
|
44
|
-
export type Renderers = readonly (Renderer<StepRendererProps> | Renderer<CoreContainerRendererProps> | Renderer<AlertRendererProps> | Renderer<BoxRendererProps> | Renderer<ColumnsRendererProps> | Renderer<DecisionRendererProps> | Renderer<DividerRendererProps> | Renderer<FormRendererProps> | Renderer<HeadingRendererProps> | Renderer<InstructionsRendererProps> | Renderer<ListRendererProps> | Renderer<LoadingIndicatorRendererProps> | Renderer<MarkdownRendererProps> | Renderer<ImageRendererProps> | Renderer<ModalRendererProps> | Renderer<ParagraphRendererProps> | Renderer<ReviewRendererProps> | Renderer<SearchRendererProps> | Renderer<StatusListRendererProps> | Renderer<CheckboxInputRendererProps> | Renderer<ButtonRendererProps> | Renderer<DateInputRendererProps> | Renderer<HiddenRendererProps> | Renderer<IntegerInputRendererProps> | Renderer<NumberInputRendererProps> | Renderer<RepeatableRendererProps> | Renderer<RootRendererProps> | Renderer<SectionRendererProps> | Renderer<SelectInputRendererProps> | Renderer<MultiSelectInputRendererProps> | Renderer<TextInputRendererProps> | Renderer<UploadInputRendererProps> | Renderer<MultiUploadInputRendererProps>)[];
|
|
45
|
+
export type Renderers = readonly (Renderer<StepRendererProps> | Renderer<CoreContainerRendererProps> | Renderer<AlertRendererProps> | Renderer<BoxRendererProps> | Renderer<ColumnsRendererProps> | Renderer<DecisionRendererProps> | Renderer<DividerRendererProps> | Renderer<FormRendererProps> | Renderer<HeadingRendererProps> | Renderer<InstructionsRendererProps> | Renderer<ListRendererProps> | Renderer<LoadingIndicatorRendererProps> | Renderer<MarkdownRendererProps> | Renderer<ImageRendererProps> | Renderer<ModalRendererProps> | Renderer<ModalContentRendererProps> | Renderer<ParagraphRendererProps> | Renderer<ReviewRendererProps> | Renderer<SearchRendererProps> | Renderer<StatusListRendererProps> | Renderer<CheckboxInputRendererProps> | Renderer<ButtonRendererProps> | Renderer<DateInputRendererProps> | Renderer<HiddenRendererProps> | Renderer<IntegerInputRendererProps> | Renderer<NumberInputRendererProps> | Renderer<RepeatableRendererProps> | Renderer<RootRendererProps> | Renderer<SectionRendererProps> | Renderer<SelectInputRendererProps> | Renderer<MultiSelectInputRendererProps> | Renderer<TextInputRendererProps> | Renderer<UploadInputRendererProps> | Renderer<MultiUploadInputRendererProps>)[];
|
|
45
46
|
export type BaseRendererProps = {
|
|
46
47
|
uid: string;
|
|
47
48
|
render: RenderFunction;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export type { AlertRendererProps, AlertCallToAction
|
|
1
|
+
export type { AlertRendererProps, AlertCallToAction } from './AlertRendererProps';
|
|
2
2
|
export type { CheckboxInputRendererProps } from './CheckboxInputRendererProps';
|
|
3
3
|
export type { BoxRendererProps } from './BoxRendererProps';
|
|
4
4
|
export type { ButtonRendererProps } from './ButtonRendererProps';
|
|
@@ -17,6 +17,7 @@ export type { IntegerInputRendererProps } from './IntegerInputRendererProps';
|
|
|
17
17
|
export type { ListRendererProps } from './ListRendererProps';
|
|
18
18
|
export type { LoadingIndicatorRendererProps } from './LoadingIndicatorRendererProps';
|
|
19
19
|
export type { MarkdownRendererProps } from './MarkdownRendererProps';
|
|
20
|
+
export type { ModalContentRendererProps } from './ModalContentRendererProps';
|
|
20
21
|
export type { ModalRendererProps } from './ModalRendererProps';
|
|
21
22
|
export type { MultiSelectInputRendererProps } from './MultiSelectInputRendererProps';
|
|
22
23
|
export type { MultiUploadInputRendererProps } from './MultiUploadInputRendererProps';
|