@wise/dynamic-flow-types 4.7.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({
@@ -649,6 +663,7 @@ export const layoutSchema: z.ZodSchema<Layout> = z.lazy(() =>
649
663
  listLayoutSchema,
650
664
  loadingIndicatorLayoutSchema,
651
665
  markdownLayoutSchema,
666
+ mediaLayoutSchema,
652
667
  modalLayoutSchema,
653
668
  paragraphLayoutSchema,
654
669
  progressLayoutSchema,
@@ -657,6 +672,7 @@ export const layoutSchema: z.ZodSchema<Layout> = z.lazy(() =>
657
672
  sectionLayoutSchema,
658
673
  statusListLayoutSchema,
659
674
  tabsLayoutSchema,
675
+ upsellLayoutSchema,
660
676
  ]),
661
677
  );
662
678
 
@@ -712,6 +728,7 @@ export const sectionLayoutCallToActionSchema: z.ZodSchema<SectionLayoutCallToAct
712
728
  title: z.string(),
713
729
  accessibilityDescription: z.string().optional(),
714
730
  behavior: behaviorSchema,
731
+ context: contextSchema.optional(),
715
732
  }),
716
733
  );
717
734
 
@@ -741,6 +758,7 @@ export const listLayoutCallToActionSchema: z.ZodSchema<ListLayoutCallToAction> =
741
758
  title: z.string(),
742
759
  accessibilityDescription: z.string().optional(),
743
760
  behavior: behaviorSchema,
761
+ context: contextSchema.optional(),
744
762
  }),
745
763
  );
746
764
 
@@ -775,6 +793,7 @@ export const itemCallToActionSchema: z.ZodSchema<ItemCallToAction> = z.lazy(() =
775
793
  title: z.string(),
776
794
  accessibilityDescription: z.string().optional(),
777
795
  behavior: behaviorSchema,
796
+ context: contextSchema.optional(),
778
797
  }),
779
798
  );
780
799
 
@@ -910,6 +929,21 @@ export const tabsLayoutSchema: z.ZodSchema<TabsLayout> = z.lazy(() =>
910
929
  }),
911
930
  );
912
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
+
913
947
  export const tabsLayoutTabSchema: z.ZodSchema<TabsLayoutTab> = z.lazy(() =>
914
948
  z.object({
915
949
  title: z.string(),
@@ -947,12 +981,22 @@ export const decisionLayoutOptionSchema: z.ZodSchema<DecisionLayoutOption> = z.l
947
981
  }),
948
982
  );
949
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
+
950
993
  export const reviewLayoutCallToActionSchema: z.ZodSchema<ReviewLayoutCallToAction> = z.lazy(() =>
951
994
  z.object({
952
995
  action: actionSchema.optional(),
953
996
  title: z.string(),
954
997
  accessibilityDescription: z.string().optional(),
955
998
  behavior: behaviorSchema.optional(),
999
+ context: contextSchema.optional(),
956
1000
  }),
957
1001
  );
958
1002
 
@@ -979,6 +1023,7 @@ export const alertLayoutCallToActionSchema: z.ZodSchema<AlertLayoutCallToAction>
979
1023
  title: z.string(),
980
1024
  accessibilityDescription: z.string().optional(),
981
1025
  behavior: behaviorSchema,
1026
+ context: contextSchema.optional(),
982
1027
  }),
983
1028
  );
984
1029
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@wise/dynamic-flow-types",
3
- "version": "4.7.0",
3
+ "version": "4.8.0",
4
4
  "description": "Dynamic Flow TypeScript Types",
5
5
  "license": "Apache-2.0",
6
6
  "repository": {