@wise/dynamic-flow-client 2.7.1 → 2.8.1

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 (70) hide show
  1. package/README.md +42 -13
  2. package/build/i18n/en.json +4 -0
  3. package/build/i18n/pt.json +2 -2
  4. package/build/i18n/zh_CN.json +20 -20
  5. package/build/main.css +0 -20
  6. package/build/main.js +333 -296
  7. package/build/main.min.js +1 -1
  8. package/build/types/dynamic-flow-types.d.ts +1 -1
  9. package/build/types/legacy/common/constants/FeatureName.d.ts +1 -1
  10. package/build/types/legacy/common/hooks/useDebouncedFunction/useDebouncedFunction.d.ts +1 -1
  11. package/build/types/legacy/common/utils/debounce.d.ts +2 -2
  12. package/build/types/legacy/jsonSchemaForm/controlFeedback/ControlFeedback.d.ts +5 -5
  13. package/build/types/legacy/step/cameraStep/cameraCapture/CameraCapture.messages.d.ts +40 -0
  14. package/build/types/legacy/step/cameraStep/cameraCapture/components/orientationLockOverlay/OrientationLockOverlay.d.ts +1 -1
  15. package/build/types/legacy/step/cameraStep/cameraCapture/hooks/useFullScreenOrientationLock.d.ts +2 -1
  16. package/build/types/legacy/step/cameraStep/cameraCapture/overlay/Overlay.d.ts +1 -1
  17. package/build/types/legacy/step/cameraStep/cameraCapture/screens/cameraErrorScreen/CameraErrorScreen.d.ts +3 -0
  18. package/build/types/legacy/step/cameraStep/cameraCapture/screens/index.d.ts +1 -2
  19. package/build/types/legacy/step/cameraStep/cameraCapture/tracking/index.d.ts +4 -3
  20. package/build/types/legacy/step/cameraStep/cameraCapture/types/index.d.ts +11 -0
  21. package/build/types/revamp/DynamicFlowRevamp.d.ts +5 -1
  22. package/build/types/revamp/domain/components/AlertComponent.d.ts +2 -3
  23. package/build/types/revamp/domain/components/BoxComponent.d.ts +3 -4
  24. package/build/types/revamp/domain/components/ButtonComponent.d.ts +2 -4
  25. package/build/types/revamp/domain/components/ColumnsComponent.d.ts +19 -0
  26. package/build/types/revamp/domain/components/HeadingComponent.d.ts +2 -3
  27. package/build/types/revamp/domain/components/ObjectComponent.d.ts +3 -4
  28. package/build/types/revamp/domain/components/ParagraphComponent.d.ts +2 -3
  29. package/build/types/revamp/domain/components/TextInputComponent.d.ts +7 -8
  30. package/build/types/revamp/domain/mappers/layout/alertLayoutToComponent.d.ts +1 -1
  31. package/build/types/revamp/domain/mappers/layout/boxLayoutToComponents.d.ts +3 -3
  32. package/build/types/revamp/domain/mappers/layout/buttonLayoutToComponent.d.ts +1 -1
  33. package/build/types/revamp/domain/mappers/layout/columnsLayoutToComponent.d.ts +4 -0
  34. package/build/types/revamp/domain/mappers/layout/formLayoutToComponent.d.ts +1 -1
  35. package/build/types/revamp/domain/mappers/layout/headingLayoutToComponent.d.ts +1 -1
  36. package/build/types/revamp/domain/mappers/layout/paragraphLayoutToComponent.d.ts +1 -1
  37. package/build/types/revamp/domain/mappers/mapLayoutToComponent.d.ts +2 -2
  38. package/build/types/revamp/domain/mappers/mapStepToComponents.d.ts +2 -9
  39. package/build/types/revamp/domain/mappers/schema/objectSchemaToComponent.d.ts +1 -1
  40. package/build/types/revamp/domain/mappers/schema/stringSchemaToComponent.d.ts +9 -2
  41. package/build/types/revamp/domain/mappers/schema/types.d.ts +4 -1
  42. package/build/types/revamp/domain/mappers/types.d.ts +11 -0
  43. package/build/types/revamp/domain/mappers/utils/legacy-utils.d.ts +5 -2
  44. package/build/types/revamp/domain/mappers/utils/type-validators.d.ts +9 -0
  45. package/build/types/revamp/domain/mappers/utils/value-checks.d.ts +10 -0
  46. package/build/types/revamp/domain/types.d.ts +13 -10
  47. package/build/types/revamp/renderers/mappers/alertComponentToProps.d.ts +1 -1
  48. package/build/types/revamp/renderers/mappers/boxComponentToProps.d.ts +1 -1
  49. package/build/types/revamp/renderers/mappers/columnsComponentToProps.d.ts +4 -0
  50. package/build/types/revamp/renderers/mappers/componentToRendererProps.d.ts +5 -1
  51. package/build/types/revamp/renderers/mappers/headingComponentToProps.d.ts +1 -1
  52. package/build/types/revamp/renderers/mappers/objectComponentToProps.d.ts +1 -1
  53. package/build/types/revamp/renderers/mappers/paragraphComponentToProps.d.ts +1 -1
  54. package/build/types/revamp/renderers/mappers/textInputComponentToProps.d.ts +1 -1
  55. package/build/types/revamp/renderers/types.d.ts +19 -10
  56. package/build/types/revamp/step/Step.d.ts +1 -1
  57. package/build/types/revamp/step/utils/getRenderFunction.d.ts +3 -0
  58. package/build/types/revamp/step/utils/getSchemaErrorMessageFunction.d.ts +3 -0
  59. package/build/types/revamp/utils/getSubmittableData.d.ts +1 -1
  60. package/build/types/revamp/utils/type-utils.d.ts +7 -1
  61. package/build/types/revamp/utils/validateComponents.d.ts +2 -0
  62. package/build/types/revamp/wise/renderers/ColumnsRenderer.d.ts +3 -0
  63. package/package.json +4 -3
  64. package/build/types/legacy/step/cameraStep/cameraCapture/screens/CameraNotSupported/CameraNotSupported.d.ts +0 -2
  65. package/build/types/legacy/step/cameraStep/cameraCapture/screens/CameraNotSupported/CameraNotSupported.messages.d.ts +0 -13
  66. package/build/types/legacy/step/cameraStep/cameraCapture/screens/NoCameraAccess/NoCameraAccess.d.ts +0 -5
  67. package/build/types/legacy/step/cameraStep/cameraCapture/screens/NoCameraAccess/NoCameraAccess.messages.d.ts +0 -18
  68. package/build/types/revamp/renderers/utils/mapping-utils.d.ts +0 -3
  69. package/build/types/revamp/step/utils/render-utils.d.ts +0 -5
  70. /package/build/types/{legacy/jsonSchemaForm/controlFeedback/ControlFeedback.messages.d.ts → common/validationMessages/validation.messages.d.ts} +0 -0
@@ -10,7 +10,7 @@ export type DynamicFlowPropsWithInitialStep = DynamicFlowPropsBasic & {
10
10
  };
11
11
  export type HttpClient = typeof fetch;
12
12
  export type EventHandler = (eventName: EventName, properties: Record<string, unknown>) => void;
13
- export type EventName = 'Dynamic Flow - Flow Started' | 'Dynamic Flow - Flow Finished' | 'Dynamic Flow - Step Started' | 'Dynamic Flow - Step Submitted' | 'Dynamic Flow - Step Refreshed' | 'Dynamic Flow - OneOf Selected' | 'Dynamic Flow - PersistAsync' | 'Dynamic Flow - ValidationAsync' | 'Dynamic Flow - Camera Permission Denied' | 'Dynamic Flow - Camera Feed Started' | 'Dynamic Flow - Camera Not Supported' | 'Dynamic Flow - Search Started' | 'Dynamic Flow - Search Result Selected' | 'Dynamic Flow - invalid submission response' | 'Dynamic Flow - onAction supressed' | 'Dynamic Flow - OneOf Searched';
13
+ export type EventName = 'Dynamic Flow - Flow Started' | 'Dynamic Flow - Flow Finished' | 'Dynamic Flow - Step Started' | 'Dynamic Flow - Step Submitted' | 'Dynamic Flow - Step Refreshed' | 'Dynamic Flow - OneOf Selected' | 'Dynamic Flow - PersistAsync' | 'Dynamic Flow - ValidationAsync' | 'Dynamic Flow - Camera Permission Denied' | 'Dynamic Flow - Camera Feed Started' | 'Dynamic Flow - Camera Not Supported' | 'Dynamic Flow - Camera Not Accessible' | 'Dynamic Flow - Camera Orientation Locked' | 'Dynamic Flow - Camera Orientation Lock Overlay Shown' | 'Dynamic Flow - Search Started' | 'Dynamic Flow - Search Result Selected' | 'Dynamic Flow - invalid submission response' | 'Dynamic Flow - onAction supressed' | 'Dynamic Flow - OneOf Searched';
14
14
  export type LogLevel = 'debug' | 'info' | 'warning' | 'error' | 'critical';
15
15
  export type LogEventHandler = (level: LogLevel, message: string, extra: Record<string, unknown>) => void;
16
16
  export type Feature = {
@@ -1,3 +1,3 @@
1
1
  export declare enum FeatureName {
2
- CAMERA_ORIENTATION_LOCK = "camera-orientation-lock"
2
+ SAMPLE_FEATURE = "sample-feature"
3
3
  }
@@ -1,2 +1,2 @@
1
1
  import { type DebouncedFunc } from '../../utils';
2
- export declare function useDebouncedFunction<T extends (...args: any[]) => any>(callback: T, waitMs: number): DebouncedFunc<T>;
2
+ export declare function useDebouncedFunction<T extends (...args: Parameters<T>) => ReturnType<T>>(callback: T, waitMs: number): DebouncedFunc<T>;
@@ -1,6 +1,6 @@
1
- export interface DebouncedFunc<T extends (...args: any[]) => any> {
1
+ export interface DebouncedFunc<T extends (...args: Parameters<T>) => ReturnType<T>> {
2
2
  (...args: Parameters<T>): void;
3
3
  cancel: () => void;
4
4
  flush: () => void;
5
5
  }
6
- export declare const debounce: <T extends (...args: any[]) => any>(callback: T, waitMs: number) => DebouncedFunc<T>;
6
+ export declare const debounce: <T extends (...args: Parameters<T>) => ReturnType<T>>(callback: T, waitMs: number) => DebouncedFunc<T>;
@@ -1,13 +1,13 @@
1
- import { Schema } from '@wise/dynamic-flow-types';
2
- declare const ControlFeedback: {
3
- (props: ControlFeedbackProps): JSX.Element;
4
- defaultProps: {
1
+ import type { Schema } from '@wise/dynamic-flow-types';
2
+ declare function ControlFeedback(props: ControlFeedbackProps): JSX.Element;
3
+ declare namespace ControlFeedback {
4
+ var defaultProps: {
5
5
  errors: string;
6
6
  validations: never[];
7
7
  validationMessages: {};
8
8
  validationAsyncSuccessMessage: null;
9
9
  };
10
- };
10
+ }
11
11
  type ValidationMessages = {
12
12
  minimum?: string;
13
13
  maximum?: string;
@@ -14,5 +14,45 @@ declare const _default: {
14
14
  defaultMessage: string;
15
15
  description: string;
16
16
  };
17
+ cameraNotSupportedTitle: {
18
+ id: string;
19
+ defaultMessage: string;
20
+ description: string;
21
+ };
22
+ cameraNotSupportedParagraph: {
23
+ id: string;
24
+ defaultMessage: string;
25
+ description: string;
26
+ };
27
+ noCameraAccessTitle: {
28
+ id: string;
29
+ defaultMessage: string;
30
+ description: string;
31
+ };
32
+ noCameraAccessParagraph: {
33
+ id: string;
34
+ defaultMessage: string;
35
+ description: string;
36
+ };
37
+ noCameraAccessAction: {
38
+ id: string;
39
+ defaultMessage: string;
40
+ description: string;
41
+ };
42
+ cameraConnectionIssueTitle: {
43
+ id: string;
44
+ defaultMessage: string;
45
+ description: string;
46
+ };
47
+ cameraConnectionIssueParagraph: {
48
+ id: string;
49
+ defaultMessage: string;
50
+ description: string;
51
+ };
52
+ cameraConnectionIssueAction: {
53
+ id: string;
54
+ defaultMessage: string;
55
+ description: string;
56
+ };
17
57
  };
18
58
  export default _default;
@@ -1,2 +1,2 @@
1
- declare const OrientationLockOverlay: () => JSX.Element;
1
+ declare function OrientationLockOverlay(): JSX.Element;
2
2
  export default OrientationLockOverlay;
@@ -1,4 +1,5 @@
1
- export declare const useFullScreenOrientationLock: (shouldLockOrientation: boolean) => {
1
+ import type { EventHandler } from '../../../../../dynamic-flow-types';
2
+ export declare const useFullScreenOrientationLock: (shouldLockOrientation: boolean, onEvent: EventHandler | undefined) => {
2
3
  enterFullScreen: () => void;
3
4
  exitFullScreen: () => void;
4
5
  };
@@ -6,5 +6,5 @@ type Props = {
6
6
  instructions?: string;
7
7
  reviewInstructions?: string;
8
8
  };
9
- declare function Overlay({ overlay, outline, imageUrl, title, instructions, reviewInstructions, }: Props): JSX.Element;
9
+ declare function Overlay({ overlay, outline, imageUrl, title, instructions, reviewInstructions }: Props): JSX.Element;
10
10
  export default Overlay;
@@ -0,0 +1,3 @@
1
+ import type { CameraError } from '../../types';
2
+ declare function CameraErrorScreen({ title, description, actionButton, onAction }: CameraError): JSX.Element;
3
+ export default CameraErrorScreen;
@@ -1,2 +1 @@
1
- export { default as NoCameraAccess } from './NoCameraAccess/NoCameraAccess';
2
- export { default as CameraNotSupported } from './CameraNotSupported/CameraNotSupported';
1
+ export { default as CameraErrorScreen } from "./cameraErrorScreen/CameraErrorScreen";
@@ -1,7 +1,8 @@
1
1
  import type { CameraDirection } from '@wise/dynamic-flow-types';
2
- import type { EventHandler } from '../../../../../dynamic-flow-types';
3
- export declare const trackCameraPermissionDenied: (onEvent: EventHandler | undefined) => void | undefined;
2
+ import type { EventHandler, EventName } from '../../../../../dynamic-flow-types';
3
+ export declare const trackCameraError: (message: EventName, onEvent: EventHandler | undefined, error: string | DOMException) => void | undefined;
4
4
  export declare const trackCameraFeedStarted: (onEvent: EventHandler | undefined, props: {
5
5
  direction?: CameraDirection;
6
6
  }, stream: MediaStream) => Promise<void | undefined>;
7
- export declare const trackCameraNotSupported: (onEvent: EventHandler | undefined, error: string | DOMException) => void | undefined;
7
+ export declare const trackCameraOrientationLandscape: (onEvent: EventHandler | undefined) => void;
8
+ export declare const trackCameraOrientationLocked: (onEvent: EventHandler | undefined) => void;
@@ -0,0 +1,11 @@
1
+ export declare enum CameraMode {
2
+ CAPTURE = "CAPTURE",
3
+ REVIEW = "REVIEW",
4
+ ERROR = "ERROR"
5
+ }
6
+ export type CameraError = {
7
+ title: string;
8
+ description: string;
9
+ actionButton?: string;
10
+ onAction?: () => void;
11
+ };
@@ -1,3 +1,7 @@
1
+ import type { Step as DFStep } from '@wise/dynamic-flow-types/build/next';
1
2
  import type { DynamicFlowProps } from '../dynamic-flow-types';
2
- declare function DynamicFlowRevamp({ initialStep, onError }: DynamicFlowProps): JSX.Element;
3
+ type Props = Omit<DynamicFlowProps, 'initialStep'> & {
4
+ initialStep?: DFStep;
5
+ };
6
+ declare function DynamicFlowRevamp({ initialStep, onError }: Props): JSX.Element;
3
7
  export default DynamicFlowRevamp;
@@ -1,10 +1,9 @@
1
- import type { Context, Margin } from '@wise/dynamic-flow-types';
2
- import type { LayoutComponent } from '../types';
1
+ import type { Margin } from '@wise/dynamic-flow-types/build/next';
2
+ import type { Context, LayoutComponent } from '../types';
3
3
  export type AlertComponent = LayoutComponent & {
4
4
  type: 'alert';
5
5
  markdown: string;
6
6
  context: Context;
7
- getValue: () => null;
8
7
  };
9
8
  export declare const createAlertComponent: (alertProps: {
10
9
  uid: string;
@@ -1,13 +1,12 @@
1
- import type { Margin, Model, Size } from '@wise/dynamic-flow-types';
2
- import type { RenderableComponent, StepComponent } from '../types';
3
- export type BoxComponent = RenderableComponent & {
1
+ import type { Margin, Model, Size } from '@wise/dynamic-flow-types/build/next';
2
+ import type { BaseComponent, StepComponent } from '../types';
3
+ export type BoxComponent = BaseComponent<Model> & {
4
4
  type: 'box';
5
5
  border: boolean;
6
6
  width: Size;
7
7
  margin: Margin;
8
8
  components: StepComponent[];
9
9
  getChildren: () => StepComponent[];
10
- getValue: () => Model;
11
10
  };
12
11
  export declare const createBoxComponent: (boxProps: {
13
12
  uid: string;
@@ -1,15 +1,13 @@
1
- import type { Context, Margin } from '@wise/dynamic-flow-types';
2
- import type { LayoutComponent } from '../types';
1
+ import type { Margin } from '@wise/dynamic-flow-types/build/next';
2
+ import type { LayoutComponent, Context } from '../types';
3
3
  export type ButtonComponent = LayoutComponent & {
4
4
  type: 'button';
5
5
  title: string;
6
6
  context: Context;
7
7
  control?: string;
8
8
  disabled: boolean;
9
- margin: Margin;
10
9
  pinOrder?: number;
11
10
  onClick: () => void;
12
- getValue: () => null;
13
11
  };
14
12
  export declare const createButtonComponent: (buttonProps: {
15
13
  uid: string;
@@ -0,0 +1,19 @@
1
+ import type { Margin, Model } from '@wise/dynamic-flow-types/build/next';
2
+ import type { BaseComponent, Bias, StepComponent } from '../types';
3
+ export type ColumnsComponent = BaseComponent<Model> & {
4
+ type: 'columns';
5
+ bias: Bias;
6
+ control?: string;
7
+ margin: Margin;
8
+ startComponents: StepComponent[];
9
+ endComponents: StepComponent[];
10
+ getChildren: () => StepComponent[];
11
+ };
12
+ export declare const createColumnsComponent: (columnsProps: {
13
+ uid: string;
14
+ bias: Bias;
15
+ control?: string;
16
+ margin: Margin;
17
+ startComponents: StepComponent[];
18
+ endComponents: StepComponent[];
19
+ }) => ColumnsComponent;
@@ -1,11 +1,10 @@
1
- import type { Align, Margin, Size } from '@wise/dynamic-flow-types';
2
- import type { LayoutComponent } from '../types';
1
+ import type { Margin, Size } from '@wise/dynamic-flow-types/build/next';
2
+ import type { Align, LayoutComponent } from '../types';
3
3
  export type HeadingComponent = LayoutComponent & {
4
4
  type: 'heading';
5
5
  text: string;
6
6
  align: Align;
7
7
  size: Size;
8
- getValue: () => null;
9
8
  };
10
9
  export declare const createHeadingComponent: (headingProps: {
11
10
  uid: string;
@@ -1,12 +1,11 @@
1
- import type { ObjectModel } from '@wise/dynamic-flow-types';
2
- import type { RenderableComponent, StepComponent } from '../types';
3
- export type ObjectComponent = RenderableComponent & {
1
+ import type { Model } from '@wise/dynamic-flow-types/build/next';
2
+ import type { BaseComponent, StepComponent } from '../types';
3
+ export type ObjectComponent = BaseComponent<Record<string, Model>> & {
4
4
  type: 'object';
5
5
  title?: string;
6
6
  description?: string;
7
7
  componentMap: Record<string, StepComponent>;
8
8
  getChildren: () => StepComponent[];
9
- getValue: () => ObjectModel;
10
9
  };
11
10
  export declare const createObjectComponent: (objectProps: {
12
11
  uid: string;
@@ -1,11 +1,10 @@
1
- import type { Align, Margin } from '@wise/dynamic-flow-types';
2
- import type { LayoutComponent } from '../types';
1
+ import type { Margin } from '@wise/dynamic-flow-types/build/next';
2
+ import type { Align, LayoutComponent } from '../types';
3
3
  export type ParagraphComponent = LayoutComponent & {
4
4
  type: 'paragraph';
5
5
  text: string;
6
6
  control?: string;
7
7
  align: Align;
8
- getValue: () => null;
9
8
  };
10
9
  export declare const createParagraphComponent: (paragraphProps: {
11
10
  uid: string;
@@ -1,16 +1,15 @@
1
- import type { StringSchema } from '@wise/dynamic-flow-types';
1
+ import type { StringSchemaFormat } from '@wise/dynamic-flow-types/build/next';
2
2
  import type { InputComponent, UpdateComponent } from '../types';
3
- type TextInputFormat = 'text' | 'date';
4
- export type TextInputComponent = InputComponent & {
3
+ export type TextInputComponent = InputComponent<string | null> & {
5
4
  type: 'text';
6
5
  title?: string;
7
6
  description?: string;
8
7
  placeholder?: string;
9
8
  control?: string;
10
- format: TextInputFormat;
9
+ format?: 'date';
11
10
  value: string | null;
11
+ errors: string[];
12
12
  onChange: (value: string | null) => void;
13
- getValue: () => string | null;
14
13
  };
15
14
  export declare const createTextInputComponent: (textInputProps: {
16
15
  uid: string;
@@ -18,8 +17,8 @@ export declare const createTextInputComponent: (textInputProps: {
18
17
  title?: string | undefined;
19
18
  description?: string | undefined;
20
19
  placeholder?: string | undefined;
21
- control?: StringSchema['control'];
22
- format: StringSchema['format'];
20
+ control?: string | undefined;
21
+ format?: StringSchemaFormat | undefined;
23
22
  value: string | null;
23
+ validate: (value: string | null) => string[];
24
24
  }, updateComponent: UpdateComponent) => TextInputComponent;
25
- export {};
@@ -1,3 +1,3 @@
1
- import type { AlertLayout } from '@wise/dynamic-flow-types';
1
+ import type { AlertLayout } from '@wise/dynamic-flow-types/build/next';
2
2
  import type { MapperProps } from '../schema/types';
3
3
  export declare const alertLayoutToComponent: (uid: string, { markdown, margin, context }: AlertLayout, mapperProps: MapperProps) => import("../../components/AlertComponent").AlertComponent;
@@ -1,4 +1,4 @@
1
- import type { BoxLayout } from '@wise/dynamic-flow-types';
2
- import type { StepComponent } from '../../types';
1
+ import type { BoxLayout } from '@wise/dynamic-flow-types/build/next';
2
+ import { type BoxComponent } from '../../components/BoxComponent';
3
3
  import type { MapperProps } from '../schema/types';
4
- export declare const boxLayoutToComponent: (uid: string, { components, width, margin, border }: BoxLayout, mapperProps: MapperProps) => StepComponent;
4
+ export declare const boxLayoutToComponent: (uid: string, { components, width, margin, border }: BoxLayout, mapperProps: MapperProps) => BoxComponent;
@@ -1,3 +1,3 @@
1
- import type { ButtonLayout } from '@wise/dynamic-flow-types';
1
+ import type { ButtonLayout } from '@wise/dynamic-flow-types/build/next';
2
2
  import type { MapperProps } from '../schema/types';
3
3
  export declare const buttonLayoutToComponent: (uid: string, { title, action, context, disabled, control, margin }: ButtonLayout, { onAction }: MapperProps) => import("../../components/ButtonComponent").ButtonComponent;
@@ -0,0 +1,4 @@
1
+ import type { ColumnsLayout } from '@wise/dynamic-flow-types/build/next';
2
+ import type { MapperProps } from '../schema/types';
3
+ import { type ColumnsComponent } from '../../components/ColumnsComponent';
4
+ export declare const columnsLayoutToComponent: (uid: string, { left, right, bias, margin }: ColumnsLayout, mapperProps: MapperProps) => ColumnsComponent;
@@ -1,4 +1,4 @@
1
- import type { FormLayout } from '@wise/dynamic-flow-types';
1
+ import type { FormLayout } from '@wise/dynamic-flow-types/build/next';
2
2
  import type { StepComponent } from '../../types';
3
3
  import type { MapperProps } from '../schema/types';
4
4
  export declare const formLayoutToComponent: (uid: string, { schemaId }: FormLayout, mapperProps: MapperProps) => StepComponent;
@@ -1,3 +1,3 @@
1
- import type { HeadingLayout } from '@wise/dynamic-flow-types';
1
+ import type { HeadingLayout } from '@wise/dynamic-flow-types/build/next';
2
2
  import type { MapperProps } from '../schema/types';
3
3
  export declare const headingLayoutToComponent: (uid: string, { text, size, margin, align }: HeadingLayout, mapperProps: MapperProps) => import("../../components/HeadingComponent").HeadingComponent;
@@ -1,3 +1,3 @@
1
- import type { ParagraphLayout } from '@wise/dynamic-flow-types';
1
+ import type { ParagraphLayout } from '@wise/dynamic-flow-types/build/next';
2
2
  import type { MapperProps } from '../schema/types';
3
3
  export declare const paragraphLayoutToComponent: (uid: string, { text, control, align, margin }: ParagraphLayout, mapperProps: MapperProps) => import("../../components/ParagraphComponent").ParagraphComponent;
@@ -1,4 +1,4 @@
1
- import type { LayoutComponent } from '@wise/dynamic-flow-types';
1
+ import type { Layout } from '@wise/dynamic-flow-types/build/next';
2
2
  import type { StepComponent } from '../types';
3
3
  import type { MapperProps } from './schema/types';
4
- export declare const mapLayoutToComponent: (uid: string, layout: LayoutComponent, mapperProps: MapperProps) => StepComponent;
4
+ export declare const mapLayoutToComponent: (uid: string, layout: Layout, mapperProps: MapperProps) => StepComponent;
@@ -1,9 +1,2 @@
1
- import type { Step as DFStep } from '@wise/dynamic-flow-types';
2
- import type { OnAction, UpdateComponent } from '../types';
3
- type MapStepToComponentsProps = {
4
- step: DFStep;
5
- updateComponent: UpdateComponent;
6
- onAction: OnAction;
7
- };
8
- export declare const mapStepToComponents: (mapperProps: MapStepToComponentsProps) => import("../types").StepComponent[];
9
- export {};
1
+ import type { MapperProps } from './schema/types';
2
+ export declare const mapStepToComponents: (mapperProps: MapperProps) => import("../types").StepComponent[];
@@ -1,4 +1,4 @@
1
- import type { ObjectSchema } from '@wise/dynamic-flow-types';
1
+ import type { ObjectSchema } from '@wise/dynamic-flow-types/build/next';
2
2
  import type { MapperProps, SchemaMapperProps } from './types';
3
3
  export declare const objectSchemaToComponent: (uid: string, { schema, model }: SchemaMapperProps & {
4
4
  schema: ObjectSchema;
@@ -1,5 +1,12 @@
1
- import type { StringSchema } from '@wise/dynamic-flow-types';
1
+ import type { StringSchema } from '@wise/dynamic-flow-types/build/next';
2
2
  import type { MapperProps, SchemaMapperProps } from './types';
3
- export declare const stringSchemaToComponent: (uid: string, { schema, model }: SchemaMapperProps & {
3
+ import type { GetErrorMessageFunctions } from '../types';
4
+ export declare const stringSchemaToComponent: (uid: string, { schema, model, required }: SchemaMapperProps & {
4
5
  schema: StringSchema;
5
6
  }, mapperProps: MapperProps) => import("../../components/TextInputComponent").TextInputComponent;
7
+ export declare const getStringValidationErrors: ({ schema, model, required, getErrorMessageFunctions, }: {
8
+ schema: StringSchema;
9
+ model: string | null;
10
+ required: boolean;
11
+ getErrorMessageFunctions: GetErrorMessageFunctions;
12
+ }) => string[];
@@ -1,11 +1,14 @@
1
- import type { Step as DFStep, Model, Schema } from '@wise/dynamic-flow-types';
1
+ import type { Step as DFStep, Model, Schema } from '@wise/dynamic-flow-types/build/next';
2
2
  import type { OnAction, UpdateComponent } from '../../types';
3
+ import type { GetErrorMessageFunctions } from '../types';
3
4
  export type MapperProps = {
4
5
  step: DFStep;
6
+ getErrorMessageFunctions: GetErrorMessageFunctions;
5
7
  onAction: OnAction;
6
8
  updateComponent: UpdateComponent;
7
9
  };
8
10
  export type SchemaMapperProps = {
9
11
  schema: Schema;
10
12
  model: Model;
13
+ required?: boolean;
11
14
  };
@@ -0,0 +1,11 @@
1
+ export type GetErrorMessageFunctions = (validationMessages?: ValidationMessages) => ErrorMessageFunctions;
2
+ export type ValidationMessages = Record<string, string | undefined>;
3
+ export type ErrorMessageFunctions = {
4
+ minimumDate: (minDate: string) => string;
5
+ maximumDate: (maxDate: string) => string;
6
+ minLength: (minLength: number) => string;
7
+ maxLength: (maxLength: number) => string;
8
+ pattern: () => string;
9
+ required: () => string;
10
+ type: () => string;
11
+ };
@@ -1,2 +1,5 @@
1
- import type { Context, LegacyContext } from '@wise/dynamic-flow-types';
2
- export declare const mapLegacyContext: (context: Context | LegacyContext) => "warning" | "positive" | "negative" | "neutral";
1
+ import type { Context as DFContext, Align as DFAlign } from '@wise/dynamic-flow-types/build/next';
2
+ import type { Align, Bias, Context } from '../../types';
3
+ export declare const mapLegacyContext: (context: DFContext) => Context;
4
+ export declare const mapLegacyBias: (bias: 'left' | 'right' | 'none') => Bias;
5
+ export declare const mapLegacyAlign: (align: DFAlign) => Align;
@@ -0,0 +1,9 @@
1
+ export declare const isString: (value: unknown) => value is string;
2
+ export declare const isNumber: (value: unknown) => value is number;
3
+ export declare const isInteger: (value: unknown) => value is number;
4
+ export declare const isBoolean: (value: unknown) => value is boolean;
5
+ export declare const isObject: (value: unknown) => value is Record<string, unknown>;
6
+ export declare const isArray: (value: unknown) => value is unknown[];
7
+ export declare const isNull: (value: unknown) => value is null;
8
+ export declare const isUndefined: (value: unknown) => value is undefined;
9
+ export declare const isNullish: (v: unknown) => v is null | undefined;
@@ -0,0 +1,10 @@
1
+ import type { StringSchema } from '@wise/dynamic-flow-types/build/next';
2
+ type IsInvalidCheck = (schema: StringSchema, model: string | null) => boolean;
3
+ export declare const isAboveMaximum: IsInvalidCheck;
4
+ export declare const isAboveMaxLength: IsInvalidCheck;
5
+ export declare const isBelowMinimum: IsInvalidCheck;
6
+ export declare const isBelowMinLength: IsInvalidCheck;
7
+ export declare const isNotAdheringToPattern: IsInvalidCheck;
8
+ export declare const isNotCorrectType: IsInvalidCheck;
9
+ export declare const isNotProvided: IsInvalidCheck;
10
+ export {};
@@ -1,4 +1,4 @@
1
- import type { Action, Margin, Model } from '@wise/dynamic-flow-types';
1
+ import type { Action, Margin, Model } from '@wise/dynamic-flow-types/build/next';
2
2
  import type { AlertComponent } from './components/AlertComponent';
3
3
  import type { BoxComponent } from './components/BoxComponent';
4
4
  import type { ButtonComponent } from './components/ButtonComponent';
@@ -6,21 +6,24 @@ import type { HeadingComponent } from './components/HeadingComponent';
6
6
  import type { ObjectComponent } from './components/ObjectComponent';
7
7
  import type { ParagraphComponent } from './components/ParagraphComponent';
8
8
  import type { TextInputComponent } from './components/TextInputComponent';
9
- export type StepComponent = AlertComponent | BoxComponent | ButtonComponent | HeadingComponent | ObjectComponent | ParagraphComponent | TextInputComponent;
10
- export type ContainerComponent = ObjectComponent | BoxComponent;
11
- export type BaseComponent = {
9
+ import type { ColumnsComponent } from './components/ColumnsComponent';
10
+ export type StepComponent = AlertComponent | BoxComponent | ButtonComponent | ColumnsComponent | HeadingComponent | ObjectComponent | ParagraphComponent | TextInputComponent;
11
+ export type ContainerComponent = ObjectComponent | BoxComponent | ColumnsComponent;
12
+ export type BaseComponent<M extends Model> = {
12
13
  type: string;
13
14
  uid: string;
14
- getValue: () => Model;
15
+ validate: () => boolean;
16
+ getValue: () => M;
15
17
  };
16
- export type RenderableComponent = BaseComponent & {
17
- keyProp: string;
18
- };
19
- export type LayoutComponent = RenderableComponent & {
18
+ export type LayoutComponent = BaseComponent<Model> & {
20
19
  margin: Margin;
20
+ getValue: () => null;
21
21
  };
22
- export type InputComponent = RenderableComponent & {
22
+ export type InputComponent<M extends Model> = BaseComponent<M> & {
23
23
  id: string;
24
24
  };
25
25
  export type UpdateComponent = (id: string, update: (component: StepComponent) => void) => void;
26
26
  export type OnAction = (action: Action) => void;
27
+ export type Align = 'start' | 'center' | 'end';
28
+ export type Bias = 'none' | 'start' | 'end';
29
+ export type Context = 'positive' | 'negative' | 'warning' | 'neutral';
@@ -1,3 +1,3 @@
1
1
  import type { AlertComponent } from '../../domain/components/AlertComponent';
2
2
  import type { AlertRendererProps } from '../types';
3
- export declare const alertComponentToProps: ({ keyProp, markdown, margin, context, }: AlertComponent) => AlertRendererProps;
3
+ export declare const alertComponentToProps: ({ markdown, margin, context, }: AlertComponent) => AlertRendererProps;
@@ -1,4 +1,4 @@
1
1
  import type { ReactNode } from 'react';
2
2
  import type { BoxComponent } from '../../domain/components/BoxComponent';
3
3
  import type { BoxRendererProps } from '../types';
4
- export declare const boxComponentToProps: ({ keyProp, border, width, margin }: BoxComponent, children: ReactNode) => BoxRendererProps;
4
+ export declare const boxComponentToProps: ({ border, width, margin }: BoxComponent, children: ReactNode) => BoxRendererProps;
@@ -0,0 +1,4 @@
1
+ import type { ReactNode } from 'react';
2
+ import type { ColumnsRendererProps } from '../types';
3
+ import type { ColumnsComponent } from '../../domain/components/ColumnsComponent';
4
+ export declare const columnsComponentToProps: ({ bias, control, margin }: ColumnsComponent, startChildren: ReactNode, endChildren: ReactNode) => ColumnsRendererProps;
@@ -1,4 +1,8 @@
1
1
  import type { ReactNode } from 'react';
2
2
  import type { StepComponent } from '../../domain/types';
3
3
  import type { RendererProps } from '../types';
4
- export declare const componentToRendererProps: (component: StepComponent, children?: ReactNode) => RendererProps;
4
+ export declare const componentToRendererProps: (component: StepComponent, nestedContent: {
5
+ children?: ReactNode;
6
+ startChildren?: ReactNode;
7
+ endChildren?: ReactNode;
8
+ }) => RendererProps;
@@ -1,3 +1,3 @@
1
1
  import type { HeadingComponent } from '../../domain/components/HeadingComponent';
2
2
  import type { HeadingRendererProps } from '../types';
3
- export declare const headingComponentToProps: ({ keyProp, text, align, margin, size, }: HeadingComponent) => HeadingRendererProps;
3
+ export declare const headingComponentToProps: ({ text, align, margin, size, }: HeadingComponent) => HeadingRendererProps;
@@ -1,4 +1,4 @@
1
1
  import type { ReactNode } from 'react';
2
2
  import type { ObjectComponent } from '../../domain/components/ObjectComponent';
3
3
  import type { ObjectRendererProps } from '../types';
4
- export declare const objectComponentToProps: ({ keyProp, title, description }: ObjectComponent, children: ReactNode) => ObjectRendererProps;
4
+ export declare const objectComponentToProps: ({ title, description }: ObjectComponent, children: ReactNode) => ObjectRendererProps;
@@ -1,3 +1,3 @@
1
1
  import type { ParagraphComponent } from '../../domain/components/ParagraphComponent';
2
2
  import type { ParagraphRendererProps } from '../types';
3
- export declare const paragraphComponentToProps: ({ keyProp, text, control, align, margin, }: ParagraphComponent) => ParagraphRendererProps;
3
+ export declare const paragraphComponentToProps: ({ text, control, align, margin, }: ParagraphComponent) => ParagraphRendererProps;
@@ -1,3 +1,3 @@
1
1
  import type { TextInputComponent } from '../../domain/components/TextInputComponent';
2
2
  import type { TextInputRendererProps } from '../types';
3
- export declare const textComponentToProps: ({ keyProp, format, id, title, description, placeholder, value, onChange, }: TextInputComponent) => TextInputRendererProps;
3
+ export declare const textComponentToProps: ({ format, errors, id, title, description, placeholder, value, onChange, }: TextInputComponent) => TextInputRendererProps;