@wise/dynamic-flow-types 4.6.0 → 4.8.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.
@@ -26,9 +26,11 @@ import {
26
26
  type ReviewLayout,
27
27
  type SectionLayout,
28
28
  type TabsLayout,
29
+ type UpsellLayout,
29
30
  type TabsLayoutTab,
30
31
  type ModalLayoutContent,
31
32
  type DecisionLayoutOption,
33
+ type UpsellLayoutCallToAction,
32
34
  type ReviewLayoutCallToAction,
33
35
  type ReviewLayoutField,
34
36
  type AlertLayoutCallToAction,
@@ -270,6 +272,7 @@ export const searchLayoutSchema = z.object({
270
272
  margin: sizeSchema.optional(),
271
273
  analyticsId: z.string().optional(),
272
274
  tags: z.array(z.string()).optional(),
275
+ hint: z.string().optional(),
273
276
  });
274
277
 
275
278
  export const instructionsLayoutItemSchema = z.object({
@@ -344,6 +347,17 @@ export const markdownLayoutSchema = z.object({
344
347
  size: sizeSchema.optional(),
345
348
  });
346
349
 
350
+ export const mediaLayoutSchema = z.object({
351
+ type: z.literal('media'),
352
+ media: mediaSchema,
353
+ align: alignSchema.optional(),
354
+ size: sizeSchema.optional(),
355
+ analyticsId: z.string().optional(),
356
+ control: z.string().optional(),
357
+ margin: sizeSchema.optional(),
358
+ tags: z.array(z.string()).optional(),
359
+ });
360
+
347
361
  export const paragraphLayoutSchema = z.object({
348
362
  type: z.literal('paragraph'),
349
363
  text: z.string(),
@@ -359,6 +373,13 @@ export const modalLayoutTriggerSchema = z.object({
359
373
  title: z.string(),
360
374
  });
361
375
 
376
+ export const requestSchema = z.object({
377
+ url: z.string(),
378
+ method: httpMethodSchema,
379
+ body: jsonElementSchema.optional(),
380
+ prefetch: z.boolean().optional(),
381
+ });
382
+
362
383
  export const formLayoutSchemaReferenceSchema = z.object({
363
384
  $ref: z.string(),
364
385
  });
@@ -452,13 +473,6 @@ export const modalPresentationSchema = z.object({
452
473
  type: z.literal('modal'),
453
474
  });
454
475
 
455
- export const requestSchema = z.object({
456
- url: z.string(),
457
- method: httpMethodSchema,
458
- body: jsonElementSchema.optional(),
459
- prefetch: z.boolean().optional(),
460
- });
461
-
462
476
  export const presentationSchema = z.union([modalPresentationSchema, pushPresentationSchema]);
463
477
 
464
478
  export const dismissBehaviorSchema = z.object({
@@ -614,6 +628,7 @@ export const stepSchema: z.ZodSchema<Step> = z.lazy(() =>
614
628
  refreshAfter: z.string().optional(),
615
629
  toolbar: toolbarSchema.optional(),
616
630
  tags: z.array(z.string()).optional(),
631
+ footer: z.array(layoutSchema).optional(),
617
632
  }),
618
633
  );
619
634
 
@@ -648,6 +663,7 @@ export const layoutSchema: z.ZodSchema<Layout> = z.lazy(() =>
648
663
  listLayoutSchema,
649
664
  loadingIndicatorLayoutSchema,
650
665
  markdownLayoutSchema,
666
+ mediaLayoutSchema,
651
667
  modalLayoutSchema,
652
668
  paragraphLayoutSchema,
653
669
  progressLayoutSchema,
@@ -656,6 +672,7 @@ export const layoutSchema: z.ZodSchema<Layout> = z.lazy(() =>
656
672
  sectionLayoutSchema,
657
673
  statusListLayoutSchema,
658
674
  tabsLayoutSchema,
675
+ upsellLayoutSchema,
659
676
  ]),
660
677
  );
661
678
 
@@ -711,6 +728,7 @@ export const sectionLayoutCallToActionSchema: z.ZodSchema<SectionLayoutCallToAct
711
728
  title: z.string(),
712
729
  accessibilityDescription: z.string().optional(),
713
730
  behavior: behaviorSchema,
731
+ context: contextSchema.optional(),
714
732
  }),
715
733
  );
716
734
 
@@ -740,6 +758,7 @@ export const listLayoutCallToActionSchema: z.ZodSchema<ListLayoutCallToAction> =
740
758
  title: z.string(),
741
759
  accessibilityDescription: z.string().optional(),
742
760
  behavior: behaviorSchema,
761
+ context: contextSchema.optional(),
743
762
  }),
744
763
  );
745
764
 
@@ -774,6 +793,7 @@ export const itemCallToActionSchema: z.ZodSchema<ItemCallToAction> = z.lazy(() =
774
793
  title: z.string(),
775
794
  accessibilityDescription: z.string().optional(),
776
795
  behavior: behaviorSchema,
796
+ context: contextSchema.optional(),
777
797
  }),
778
798
  );
779
799
 
@@ -909,6 +929,21 @@ export const tabsLayoutSchema: z.ZodSchema<TabsLayout> = z.lazy(() =>
909
929
  }),
910
930
  );
911
931
 
932
+ export const upsellLayoutSchema: z.ZodSchema<UpsellLayout> = z.lazy(() =>
933
+ z.object({
934
+ type: z.literal('upsell'),
935
+ text: z.string(),
936
+ callToAction: upsellLayoutCallToActionSchema,
937
+ media: mediaSchema.optional(),
938
+ onDismiss: requestSchema.optional(),
939
+ context: contextSchema.optional(),
940
+ control: z.string().optional(),
941
+ margin: sizeSchema.optional(),
942
+ analyticsId: z.string().optional(),
943
+ tags: z.array(z.string()).optional(),
944
+ }),
945
+ );
946
+
912
947
  export const tabsLayoutTabSchema: z.ZodSchema<TabsLayoutTab> = z.lazy(() =>
913
948
  z.object({
914
949
  title: z.string(),
@@ -946,12 +981,22 @@ export const decisionLayoutOptionSchema: z.ZodSchema<DecisionLayoutOption> = z.l
946
981
  }),
947
982
  );
948
983
 
984
+ export const upsellLayoutCallToActionSchema: z.ZodSchema<UpsellLayoutCallToAction> = z.lazy(() =>
985
+ z.object({
986
+ title: z.string(),
987
+ accessibilityDescription: z.string().optional(),
988
+ behavior: behaviorSchema,
989
+ context: contextSchema.optional(),
990
+ }),
991
+ );
992
+
949
993
  export const reviewLayoutCallToActionSchema: z.ZodSchema<ReviewLayoutCallToAction> = z.lazy(() =>
950
994
  z.object({
951
995
  action: actionSchema.optional(),
952
996
  title: z.string(),
953
997
  accessibilityDescription: z.string().optional(),
954
998
  behavior: behaviorSchema.optional(),
999
+ context: contextSchema.optional(),
955
1000
  }),
956
1001
  );
957
1002
 
@@ -978,6 +1023,7 @@ export const alertLayoutCallToActionSchema: z.ZodSchema<AlertLayoutCallToAction>
978
1023
  title: z.string(),
979
1024
  accessibilityDescription: z.string().optional(),
980
1025
  behavior: behaviorSchema,
1026
+ context: contextSchema.optional(),
981
1027
  }),
982
1028
  );
983
1029
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@wise/dynamic-flow-types",
3
- "version": "4.6.0",
3
+ "version": "4.8.0",
4
4
  "description": "Dynamic Flow TypeScript Types",
5
5
  "license": "Apache-2.0",
6
6
  "repository": {