@wise/dynamic-flow-types 3.0.0-experimental-dde19b5 → 3.0.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.
Files changed (57) hide show
  1. package/build/main.js +414 -394
  2. package/build/main.min.js +1 -1
  3. package/build/main.mjs +414 -394
  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 +0 -3
  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 +0 -3
  26. package/build/renderers/CoreContainerRendererProps.d.ts +2 -5
  27. package/build/renderers/DateInputRendererProps.d.ts +0 -3
  28. package/build/renderers/DecisionRendererProps.d.ts +0 -3
  29. package/build/renderers/DividerRendererProps.d.ts +0 -3
  30. package/build/renderers/FormRendererProps.d.ts +0 -3
  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 +0 -3
  36. package/build/renderers/IntegerInputRendererProps.d.ts +0 -5
  37. package/build/renderers/ListRendererProps.d.ts +4 -7
  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 +0 -3
  41. package/build/renderers/MultiSelectInputRendererProps.d.ts +0 -5
  42. package/build/renderers/MultiUploadInputRendererProps.d.ts +0 -4
  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 +0 -6
  47. package/build/renderers/ReviewRendererProps.d.ts +0 -3
  48. package/build/renderers/SearchRendererProps.d.ts +3 -7
  49. package/build/renderers/SectionRendererProps.d.ts +0 -3
  50. package/build/renderers/SelectInputRendererProps.d.ts +0 -3
  51. package/build/renderers/StatusListRendererProps.d.ts +0 -3
  52. package/build/renderers/StepRendererProps.d.ts +13 -1
  53. package/build/renderers/TextInputRendererProps.d.ts +0 -3
  54. package/build/renderers/UploadInputRendererProps.d.ts +0 -3
  55. package/build/zod/schemas.d.ts +6628 -2724
  56. package/build/zod/schemas.ts +534 -511
  57. package/package.json +1 -1
@@ -1,15 +1,10 @@
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
9
  selectedIndices: number[];
15
10
  options: SelectInputRendererOption[];
@@ -1,9 +1,6 @@
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;
@@ -20,7 +17,6 @@ export type MultiUploadInputRendererProps = BaseInputRendererProps & {
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,9 +3,6 @@ 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;
@@ -16,13 +13,10 @@ export type RepeatableRendererProps = BaseRendererProps & {
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,8 +1,5 @@
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;
@@ -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;
@@ -33,8 +31,6 @@ export type ResultsSearchState = {
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;
@@ -3,9 +3,6 @@ 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;
@@ -1,9 +1,6 @@
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;
@@ -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
38
  childrenProps: 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,9 +1,6 @@
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;