@wise/dynamic-flow-types 3.0.0-experimental-af37aae → 3.0.0-experimental-9cbdd3f

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.
Files changed (57) hide show
  1. package/build/main.js +488 -468
  2. package/build/main.min.js +1 -1
  3. package/build/main.mjs +488 -468
  4. package/build/next/feature/ActionBehavior.d.ts +14 -0
  5. package/build/next/feature/Behavior.d.ts +5 -15
  6. package/build/next/feature/ContainerBehavior.d.ts +9 -0
  7. package/build/next/feature/LinkBehavior.d.ts +13 -0
  8. package/build/next/feature/LinkHandler.d.ts +21 -17
  9. package/build/next/feature/Polling.d.ts +4 -5
  10. package/build/next/feature/PollingOnError.d.ts +7 -1
  11. package/build/next/feature/SummarySummariser.d.ts +2 -2
  12. package/build/next/index.d.ts +1 -0
  13. package/build/next/layout/ButtonLayout.d.ts +10 -4
  14. package/build/next/layout/DecisionLayoutOption.d.ts +9 -3
  15. package/build/next/layout/ImageLayout.d.ts +13 -7
  16. package/build/next/layout/ReviewLayoutCallToAction.d.ts +12 -2
  17. package/build/next/misc/Image.d.ts +8 -3
  18. package/build/next/responses/search/SearchResultAction.d.ts +2 -2
  19. package/build/next/responses/search/SearchResultSearch.d.ts +2 -2
  20. package/build/renderers/AlertRendererProps.d.ts +0 -3
  21. package/build/renderers/BaseInputRendererProps.d.ts +2 -3
  22. package/build/renderers/BoxRendererProps.d.ts +1 -4
  23. package/build/renderers/ButtonRendererProps.d.ts +0 -1
  24. package/build/renderers/CheckboxInputRendererProps.d.ts +2 -5
  25. package/build/renderers/ColumnsRendererProps.d.ts +2 -5
  26. package/build/renderers/CoreContainerRendererProps.d.ts +3 -6
  27. package/build/renderers/DateInputRendererProps.d.ts +0 -3
  28. package/build/renderers/DecisionRendererProps.d.ts +1 -4
  29. package/build/renderers/DividerRendererProps.d.ts +0 -3
  30. package/build/renderers/FormRendererProps.d.ts +1 -4
  31. package/build/renderers/HeadingRendererProps.d.ts +0 -1
  32. package/build/renderers/HiddenRendererProps.d.ts +0 -3
  33. package/build/renderers/Image.d.ts +3 -13
  34. package/build/renderers/ImageRendererProps.d.ts +1 -8
  35. package/build/renderers/InstructionsRendererProps.d.ts +1 -4
  36. package/build/renderers/IntegerInputRendererProps.d.ts +0 -5
  37. package/build/renderers/ListRendererProps.d.ts +5 -8
  38. package/build/renderers/LoadingIndicatorRendererProps.d.ts +0 -3
  39. package/build/renderers/MarkdownRendererProps.d.ts +0 -3
  40. package/build/renderers/ModalRendererProps.d.ts +1 -4
  41. package/build/renderers/MultiSelectInputRendererProps.d.ts +2 -7
  42. package/build/renderers/MultiUploadInputRendererProps.d.ts +2 -6
  43. package/build/renderers/NumberInputRendererProps.d.ts +0 -5
  44. package/build/renderers/ParagraphRendererProps.d.ts +0 -1
  45. package/build/renderers/RendererProps.d.ts +0 -3
  46. package/build/renderers/RepeatableRendererProps.d.ts +1 -7
  47. package/build/renderers/ReviewRendererProps.d.ts +1 -4
  48. package/build/renderers/SearchRendererProps.d.ts +4 -8
  49. package/build/renderers/SectionRendererProps.d.ts +1 -4
  50. package/build/renderers/SelectInputRendererProps.d.ts +2 -5
  51. package/build/renderers/StatusListRendererProps.d.ts +1 -4
  52. package/build/renderers/StepRendererProps.d.ts +14 -2
  53. package/build/renderers/TextInputRendererProps.d.ts +0 -3
  54. package/build/renderers/UploadInputRendererProps.d.ts +1 -4
  55. package/build/zod/schemas.d.ts +7511 -3607
  56. package/build/zod/schemas.ts +534 -511
  57. package/package.json +1 -1
@@ -1,8 +1,5 @@
1
1
  import { Margin, Size } from './constants';
2
2
  import { BaseRendererProps } from './RendererProps';
3
- /**
4
- * @experimental Expect RendererProps to change as we align them across platform
5
- */
6
3
  export type LoadingIndicatorRendererProps = BaseRendererProps & {
7
4
  type: 'loading-indicator';
8
5
  control?: string;
@@ -1,8 +1,5 @@
1
1
  import { Align, Margin } from './constants';
2
2
  import { BaseRendererProps } from './RendererProps';
3
- /**
4
- * @experimental Expect RendererProps to change as we align them across platform
5
- */
6
3
  export type MarkdownRendererProps = BaseRendererProps & {
7
4
  type: 'markdown';
8
5
  control?: string;
@@ -1,15 +1,12 @@
1
1
  import { ReactNode } from 'react';
2
2
  import { Margin } from './constants';
3
3
  import { BaseRendererProps, RendererProps } from './RendererProps';
4
- /**
5
- * @experimental Expect RendererProps to change as we align them across platform
6
- */
7
4
  export type ModalRendererProps = BaseRendererProps & {
8
5
  type: 'modal';
9
6
  control?: string;
10
7
  content: {
11
8
  children: ReactNode;
12
- childrenProps: RendererProps[];
9
+ childrenProps: readonly RendererProps[];
13
10
  title?: string;
14
11
  };
15
12
  margin: Margin;
@@ -1,17 +1,12 @@
1
1
  import { BaseInputRendererProps } from './BaseInputRendererProps';
2
2
  import { SelectInputRendererOption } from './SelectInputRendererProps';
3
- /**
4
- * @experimental Expect RendererProps to change as we align them across platform
5
- */
6
3
  export type MultiSelectInputRendererProps = Omit<BaseInputRendererProps, 'required'> & {
7
4
  type: 'input-multi-select';
8
5
  autoComplete: string;
9
6
  description?: string;
10
- /** @experimental */
11
7
  maxItems?: number;
12
- /** @experimental */
13
8
  minItems?: number;
14
- selectedIndices: number[];
15
- options: SelectInputRendererOption[];
9
+ selectedIndices: readonly number[];
10
+ options: readonly SelectInputRendererOption[];
16
11
  onSelect: (indices: number[]) => void;
17
12
  };
@@ -1,26 +1,22 @@
1
1
  import { JsonElement } from '../next';
2
2
  import { UploadSource } from '../next/feature/UploadSource';
3
3
  import { BaseInputRendererProps, ValidationResult } from './BaseInputRendererProps';
4
- /**
5
- * @experimental Expect RendererProps to change as we align them across platform
6
- */
7
4
  export type MultiUploadInputRendererProps = BaseInputRendererProps & {
8
5
  type: 'input-upload-multi';
9
6
  cameraConfig?: JsonElement;
10
7
  maxSize?: number;
11
8
  minItems?: number;
12
9
  maxItems?: number;
13
- accepts?: string[];
10
+ accepts?: readonly string[];
14
11
  source?: UploadSource;
15
12
  uploadLabel?: string;
16
- value: FileWithId[];
13
+ value: readonly FileWithId[];
17
14
  onInsertFile: (index: number, file: File) => Promise<string>;
18
15
  onRemoveFile: (index: number) => Promise<void>;
19
16
  };
20
17
  type FileWithId = {
21
18
  id: string;
22
19
  file: File;
23
- /** @experimental */
24
20
  validationState?: ValidationResult;
25
21
  };
26
22
  export {};
@@ -1,13 +1,8 @@
1
1
  import { BaseInputRendererProps } from './BaseInputRendererProps';
2
- /**
3
- * @experimental Expect RendererProps to change as we align them across platform
4
- */
5
2
  export type NumberInputRendererProps = BaseInputRendererProps & {
6
3
  type: 'input-number';
7
4
  value: number | null;
8
- /** @experimental */
9
5
  maximum?: number;
10
- /** @experimental */
11
6
  minimum?: number;
12
7
  onChange: (value: number | null) => void;
13
8
  };
@@ -1,7 +1,6 @@
1
1
  import { Align, Margin } from './constants';
2
2
  import { BaseRendererProps } from './RendererProps';
3
3
  /**
4
- * @experimental Expect RendererProps to change as we align them across platform
5
4
  * Known values for "control" are: 'copyable'.
6
5
  */
7
6
  export type ParagraphRendererProps = BaseRendererProps & {
@@ -30,9 +30,6 @@ import { StatusListRendererProps } from './StatusListRendererProps';
30
30
  import { AnalyticsEventDispatcher, LoadingState, StepRendererProps } from './StepRendererProps';
31
31
  import { TextInputRendererProps } from './TextInputRendererProps';
32
32
  import { UploadInputRendererProps } from './UploadInputRendererProps';
33
- /**
34
- * @experimental Expect RendererProps to change as we align them across platform
35
- */
36
33
  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 | SearchRendererProps | SectionRendererProps | SelectInputRendererProps | StatusListRendererProps | StepRendererProps | TextInputRendererProps | UploadInputRendererProps;
37
34
  export type Renderer<P extends RendererProps> = {
38
35
  canRenderType: P['type'];
@@ -3,26 +3,20 @@ import { Icon } from './Icon';
3
3
  import { Image } from './Image';
4
4
  import { ValidationResult } from './BaseInputRendererProps';
5
5
  import { BaseRendererProps, RendererProps } from './RendererProps';
6
- /**
7
- * @experimental Expect RendererProps to change as we align them across platform
8
- */
9
6
  export type RepeatableRendererProps = BaseRendererProps & {
10
7
  type: 'repeatable';
11
8
  control?: string;
12
9
  addItemTitle: string;
13
10
  description?: string;
14
11
  children: ReactNode;
15
- childrenProps: RendererProps[];
12
+ childrenProps: readonly RendererProps[];
16
13
  editableItem: ReactNode;
17
14
  editableItemProps: RendererProps | null;
18
15
  editItemTitle: string;
19
- /** @experimental */
20
16
  validationState: ValidationResult | undefined;
21
17
  items: RepeatableItemRendererProps[];
22
18
  title: string;
23
- /** @experimental */
24
19
  maxItems?: number;
25
- /** @experimental */
26
20
  minItems?: number;
27
21
  icon?: Icon;
28
22
  image?: Image;
@@ -1,12 +1,9 @@
1
1
  import { Margin } from './constants';
2
2
  import { BaseRendererProps } from './RendererProps';
3
- /**
4
- * @experimental Expect RendererProps to change as we align them across platform
5
- */
6
3
  export type ReviewRendererProps = BaseRendererProps & {
7
4
  type: 'review';
8
5
  control?: string;
9
- fields: ReviewField[];
6
+ fields: readonly ReviewField[];
10
7
  margin: Margin;
11
8
  title?: string;
12
9
  callToAction?: ReviewCallToAction;
@@ -1,9 +1,7 @@
1
- import type { ImageLayout, SearchResult as SearchResultSpec } from '../next';
1
+ import type { SearchResult as SearchResultSpec } from '../next';
2
2
  import { Margin } from './constants';
3
+ import { Image } from './Image';
3
4
  import { BaseRendererProps } from './RendererProps';
4
- /**
5
- * @experimental Expect RendererProps to change as we align them across platform
6
- */
7
5
  export type SearchRendererProps = BaseRendererProps & {
8
6
  type: 'search';
9
7
  control?: string;
@@ -29,12 +27,10 @@ export type ErrorSearchState = {
29
27
  };
30
28
  export type ResultsSearchState = {
31
29
  type: 'results';
32
- results: SearchResult[];
30
+ results: readonly SearchResult[];
33
31
  };
34
32
  export type SearchResult = Pick<SearchResultSpec, 'description' | 'icon' | 'title' | 'type'> & {
35
33
  id?: string;
36
- image?: ImageLayout & {
37
- uri?: string;
38
- };
34
+ image?: Image;
39
35
  onClick: () => void;
40
36
  };
@@ -2,9 +2,6 @@ import { ReactNode } from 'react';
2
2
  import { Icon } from './Icon';
3
3
  import { Image } from './Image';
4
4
  import { BaseRendererProps, RendererProps } from './RendererProps';
5
- /**
6
- * @experimental Expect RendererProps to change as we align them across platform
7
- */
8
5
  export type SectionRendererProps = BaseRendererProps & {
9
6
  type: 'section';
10
7
  control?: string;
@@ -12,7 +9,7 @@ export type SectionRendererProps = BaseRendererProps & {
12
9
  description?: string;
13
10
  help?: string;
14
11
  children: ReactNode;
15
- childrenProps: RendererProps[];
12
+ childrenProps: readonly RendererProps[];
16
13
  icon?: Icon;
17
14
  image?: Image;
18
15
  };
@@ -3,15 +3,12 @@ import { BaseInputRendererProps } from './BaseInputRendererProps';
3
3
  import { Icon } from './Icon';
4
4
  import { Image } from './Image';
5
5
  import { RendererProps } from './RendererProps';
6
- /**
7
- * @experimental Expect RendererProps to change as we align them across platform
8
- */
9
6
  export type SelectInputRendererProps = BaseInputRendererProps & {
10
7
  type: 'input-select';
11
8
  autoComplete: string;
12
9
  children: ReactNode;
13
10
  childrenProps: RendererProps | null;
14
- options: SelectInputRendererOption[];
11
+ options: readonly SelectInputRendererOption[];
15
12
  selectedIndex: number | null;
16
13
  onSelect: (index: number | null) => void;
17
14
  };
@@ -20,6 +17,6 @@ export type SelectInputRendererOption = {
20
17
  disabled: boolean;
21
18
  icon?: Icon;
22
19
  image?: Image;
23
- keywords: string[];
20
+ keywords: readonly string[];
24
21
  title: string;
25
22
  };
@@ -1,13 +1,10 @@
1
1
  import { Icon } from './Icon';
2
2
  import { BaseRendererProps } from './RendererProps';
3
3
  import { Margin } from './constants';
4
- /**
5
- * @experimental Expect RendererProps to change as we align them across platform
6
- */
7
4
  export type StatusListRendererProps = BaseRendererProps & {
8
5
  type: 'status-list';
9
6
  control?: string;
10
- items: StatusListItem[];
7
+ items: readonly StatusListItem[];
11
8
  margin: Margin;
12
9
  title?: string;
13
10
  };
@@ -1,9 +1,11 @@
1
+ import type { Action, Step } from '../next';
1
2
  import type { ReactNode } from 'react';
2
3
  import { BaseRendererProps, RendererProps } from './RendererProps';
3
4
  export type AnalyticsEventDispatcher = (eventName: string, properties?: Record<string, unknown>) => void;
4
5
  export type LoadingState = 'idle' | 'submitting' | 'refreshing';
5
6
  /**
6
- * @experimental Expect RendererProps to change as we align them across platform
7
+ * @experimental Likely to change as we align across platform. Consider this before
8
+ * implementing a cusotm Step Renderer.
7
9
  */
8
10
  export type StepRendererProps = BaseRendererProps & {
9
11
  type: 'step';
@@ -22,6 +24,16 @@ export type StepRendererProps = BaseRendererProps & {
22
24
  */
23
25
  loadingState: LoadingState;
24
26
  title?: string;
27
+ /**
28
+ * @experimental Please do not use this property. It is only here to support a legacy camera step.
29
+ * @deprecated Please use childrenProps instead.
30
+ */
31
+ step?: Step;
32
+ /**
33
+ * @experimental Please do not use this function. Calling onAction from a step renderer completely bypasses the core logic and may result in unexpected behavior. It is only here to support a legacy camera step.
34
+ * @deprecated Please use childrenProps instead.
35
+ */
36
+ onAction?: (action: Action) => void | Promise<void>;
25
37
  children: ReactNode;
26
- childrenProps: RendererProps[];
38
+ childrenProps: readonly RendererProps[];
27
39
  };
@@ -1,7 +1,6 @@
1
1
  import { BaseInputRendererProps } from './BaseInputRendererProps';
2
2
  import { Autocapitalization } from './constants';
3
3
  /**
4
- * @experimental Expect RendererProps to change as we align them across platform
5
4
  * Known values for "control" are: 'password' | 'textarea' | 'email' | 'numeric' | 'phone-number'.
6
5
  */
7
6
  export type TextInputRendererProps = BaseInputRendererProps & {
@@ -10,9 +9,7 @@ export type TextInputRendererProps = BaseInputRendererProps & {
10
9
  autoCapitalize?: Autocapitalization;
11
10
  displayFormat?: string;
12
11
  value: string | null;
13
- /** @experimental */
14
12
  maxLength?: number;
15
- /** @experimental */
16
13
  minLength?: number;
17
14
  onChange: (value: string | null) => void;
18
15
  };
@@ -1,14 +1,11 @@
1
1
  import { JsonElement } from '../next';
2
2
  import { UploadSource } from '../next/feature/UploadSource';
3
3
  import { BaseInputRendererProps } from './BaseInputRendererProps';
4
- /**
5
- * @experimental Expect RendererProps to change as we align them across platform
6
- */
7
4
  export type UploadInputRendererProps = BaseInputRendererProps & {
8
5
  type: 'input-upload';
9
6
  cameraConfig?: JsonElement;
10
7
  maxSize?: number;
11
- accepts?: string[];
8
+ accepts?: readonly string[];
12
9
  source?: UploadSource;
13
10
  value: File | null;
14
11
  onUpload: (file: File | null) => Promise<void>;