@wise/dynamic-flow-client 2.8.6 → 2.8.8

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.
@@ -1,4 +1,4 @@
1
- import { Icon, Image, Schema } from '@wise/dynamic-flow-types';
1
+ import type { Icon, Image, Schema } from '@wise/dynamic-flow-types';
2
2
  declare const mapConstSchemaToOption: <ControlType extends string>(schema: Schema, controlType?: ControlType | undefined) => ControlType extends "select" ? SelectOption : RadioOption;
3
3
  type RadioOption = {
4
4
  disabled?: boolean | undefined;
@@ -1,4 +1,4 @@
1
- import { ButtonLayout, Size } from '@wise/dynamic-flow-types';
1
+ import type { ButtonLayout, Size } from '@wise/dynamic-flow-types';
2
2
  export declare const getButtonPriority: (component: ButtonLayout) => "primary" | "secondary" | "tertiary";
3
3
  export declare const getButtonType: (component: ButtonLayout) => "positive" | "negative" | "accent";
4
4
  export declare const getButtonSize: (size: Size | undefined) => "sm" | "md" | "lg";
@@ -0,0 +1,7 @@
1
+ import type { LayoutComponent, StepComponent } from '../types';
2
+ export type FormComponent = LayoutComponent & {
3
+ type: 'form';
4
+ components: StepComponent[];
5
+ getChildren: () => StepComponent[];
6
+ };
7
+ export declare const createFormComponent: (formProps: Pick<FormComponent, 'uid' | 'components' | 'control' | 'margin'>) => FormComponent;
@@ -0,0 +1,11 @@
1
+ import type { Model } from '@wise/dynamic-flow-types/build/next';
2
+ import type { BaseComponent } from '../types';
3
+ export type HiddenComponent = BaseComponent<Model> & {
4
+ type: 'hidden';
5
+ };
6
+ type HiddenProps = {
7
+ uid: string;
8
+ value: Model;
9
+ };
10
+ export declare const createHiddenComponent: ({ uid, value }: HiddenProps) => HiddenComponent;
11
+ export {};
@@ -1,3 +1,3 @@
1
1
  import type { ButtonLayout } from '@wise/dynamic-flow-types/build/next';
2
2
  import type { MapperProps } from '../schema/types';
3
- export declare const buttonLayoutToComponent: (uid: string, { action, context, control, disabled, margin, pinOrder, size, title, }: ButtonLayout, { onAction }: MapperProps) => import("../../components/ButtonComponent").ButtonComponent;
3
+ export declare const buttonLayoutToComponent: (uid: string, { action, context, control, disabled, margin, pinOrder, size, title }: ButtonLayout, { onAction }: MapperProps) => import("../../components/ButtonComponent").ButtonComponent;
@@ -1,4 +1,4 @@
1
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
- export declare const formLayoutToComponent: (uid: string, { schemaId }: FormLayout, mapperProps: MapperProps) => StepComponent;
4
+ export declare const formLayoutToComponent: (uid: string, { schemaId, control, margin }: FormLayout, mapperProps: MapperProps) => StepComponent;
@@ -0,0 +1,5 @@
1
+ import type { SchemaMapperProps } from './types';
2
+ import type { ConstSchema } from '@wise/dynamic-flow-types/build/next';
3
+ export declare const constSchemaToComponent: (uid: string, schemaMapperProps: SchemaMapperProps & {
4
+ schema: ConstSchema;
5
+ }) => import("../../components/HiddenComponent").HiddenComponent;
@@ -1,5 +1,7 @@
1
- import type { Context as DFContext, Align as DFAlign } from '@wise/dynamic-flow-types/build/next';
1
+ import type { Context as DFContext, Align as DFAlign, Action } from '@wise/dynamic-flow-types/build/next';
2
2
  import type { Align, Bias, Context } from '../../types';
3
3
  export declare const mapLegacyContext: (context: DFContext) => Context;
4
4
  export declare const mapLegacyBias: (bias: 'left' | 'right' | 'none') => Bias;
5
5
  export declare const mapLegacyAlign: (align: DFAlign) => Align;
6
+ export declare const mapLegacyActionTypeToContext: (type: Action['type']) => Context;
7
+ export declare const mapLegacyActionTypeToControl: (type: Action['type']) => 'primary' | 'secondary' | 'tertiary';
@@ -1,4 +1,5 @@
1
1
  import type { Action, Margin, Model } from '@wise/dynamic-flow-types/build/next';
2
+ import type { HiddenComponent } from './components/HiddenComponent';
2
3
  import type { AlertComponent } from './components/AlertComponent';
3
4
  import type { BoxComponent } from './components/BoxComponent';
4
5
  import type { ButtonComponent } from './components/ButtonComponent';
@@ -12,8 +13,9 @@ import type { IntegerInputComponent } from './components/IntegerInputComponent';
12
13
  import type { DateInputComponent } from './components/DateInputComponent';
13
14
  import type { UploadInputComponent } from './components/UploadInputComponent';
14
15
  import type { ContainerComponent } from './components/ContainerComponent';
15
- export type StepComponent = AlertComponent | BoxComponent | ButtonComponent | ColumnsComponent | DateInputComponent | ContainerComponent | HeadingComponent | IntegerInputComponent | NumberInputComponent | ObjectComponent | ParagraphComponent | TextInputComponent | UploadInputComponent;
16
- export type HasChildren = ObjectComponent | BoxComponent | ColumnsComponent | ContainerComponent;
16
+ import type { FormComponent } from './components/FormComponent';
17
+ export type StepComponent = AlertComponent | BoxComponent | ButtonComponent | ColumnsComponent | ContainerComponent | DateInputComponent | FormComponent | HeadingComponent | HiddenComponent | IntegerInputComponent | NumberInputComponent | ObjectComponent | ParagraphComponent | TextInputComponent | UploadInputComponent;
18
+ export type HasChildren = BoxComponent | ColumnsComponent | ContainerComponent | FormComponent | ObjectComponent;
17
19
  export type BaseComponent<M extends Model> = {
18
20
  type: string;
19
21
  uid: string;
@@ -0,0 +1,4 @@
1
+ import type { ReactNode } from 'react';
2
+ import type { FormComponent } from '../../domain/components/FormComponent';
3
+ import type { FormRendererProps } from '../types';
4
+ export declare const formComponentToProps: ({ control, margin }: FormComponent, children: ReactNode) => FormRendererProps;
@@ -0,0 +1,2 @@
1
+ import type { HiddenRendererProps } from '../types';
2
+ export declare const hiddenComponentToProps: () => HiddenRendererProps;
@@ -35,6 +35,12 @@ export interface ColumnsRendererProps extends RendererProps {
35
35
  startChildren: ReactNode;
36
36
  endChildren: ReactNode;
37
37
  }
38
+ export interface FormRendererProps extends RendererProps {
39
+ type: 'form';
40
+ children: ReactNode;
41
+ control?: string;
42
+ margin: Margin;
43
+ }
38
44
  export interface HeadingRendererProps extends RendererProps {
39
45
  type: 'heading';
40
46
  text: string;
@@ -107,4 +113,7 @@ export interface ButtonRendererProps extends RendererProps {
107
113
  title: string;
108
114
  onClick: () => void;
109
115
  }
116
+ export interface HiddenRendererProps extends RendererProps {
117
+ type: 'hidden';
118
+ }
110
119
  export {};
@@ -1,4 +1,4 @@
1
- import type { AllOfSchema, IntegerSchema, Model, NumberSchema, ObjectSchema, OneOfSchema, Schema, StringSchema } from '@wise/dynamic-flow-types/build/next';
1
+ import type { AllOfSchema, ConstSchema, IntegerSchema, Model, NumberSchema, ObjectSchema, OneOfSchema, Schema, StringSchema } from '@wise/dynamic-flow-types/build/next';
2
2
  import type { HasChildren, StepComponent } from '../domain/types';
3
3
  import type { ColumnsComponent } from '../domain/components/ColumnsComponent';
4
4
  export declare const hasChildren: (component: StepComponent) => component is HasChildren;
@@ -10,3 +10,4 @@ export declare const isObjectSchema: (schema: Schema) => schema is ObjectSchema;
10
10
  export declare const isStringSchema: (schema: Schema) => schema is StringSchema;
11
11
  export declare const isNumberSchema: (schema: Schema) => schema is NumberSchema;
12
12
  export declare const isIntegerSchema: (schema: Schema) => schema is IntegerSchema;
13
+ export declare const isConstSchema: (schema: Schema) => schema is ConstSchema;
@@ -0,0 +1,3 @@
1
+ import type { FormRendererProps, Renderer } from '../../renderers/types';
2
+ declare const FormRenderer: Renderer<FormRendererProps>;
3
+ export default FormRenderer;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@wise/dynamic-flow-client",
3
- "version": "2.8.6",
3
+ "version": "2.8.8",
4
4
  "description": "Dynamic Flow web client",
5
5
  "license": "Apache-2.0",
6
6
  "main": "./build/main.min.js",
@@ -91,7 +91,7 @@
91
91
  "classnames": "2.3.2",
92
92
  "react-webcam": "^7.2.0",
93
93
  "screenfull": "^5.2.0",
94
- "@wise/dynamic-flow-types": "2.4.1"
94
+ "@wise/dynamic-flow-types": "2.5.0"
95
95
  },
96
96
  "scripts": {
97
97
  "dev": "storybook dev -p 3003",