@wise/dynamic-flow-client 4.8.7 → 4.9.0-exp-modal-renderer-8e5c27a

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 (53) hide show
  1. package/build/main.js +103 -60
  2. package/build/main.mjs +103 -60
  3. package/build/types/revamp/domain/components/AlertComponent.d.ts +1 -0
  4. package/build/types/revamp/domain/components/AllOfComponent.d.ts +2 -1
  5. package/build/types/revamp/domain/components/BooleanInputComponent.d.ts +1 -0
  6. package/build/types/revamp/domain/components/BoxComponent.d.ts +1 -0
  7. package/build/types/revamp/domain/components/ButtonComponent.d.ts +1 -0
  8. package/build/types/revamp/domain/components/ColumnsComponent.d.ts +1 -0
  9. package/build/types/revamp/domain/components/ConstComponent.d.ts +1 -0
  10. package/build/types/revamp/domain/components/ContainerComponent.d.ts +1 -0
  11. package/build/types/revamp/domain/components/DateInputComponent.d.ts +1 -0
  12. package/build/types/revamp/domain/components/DecisionComponent.d.ts +1 -0
  13. package/build/types/revamp/domain/components/DividerComponent.d.ts +1 -0
  14. package/build/types/revamp/domain/components/FormComponent.d.ts +1 -0
  15. package/build/types/revamp/domain/components/HeadingComponent.d.ts +1 -0
  16. package/build/types/revamp/domain/components/ImageComponent.d.ts +1 -0
  17. package/build/types/revamp/domain/components/InstructionsComponent.d.ts +1 -0
  18. package/build/types/revamp/domain/components/IntegerInputComponent.d.ts +1 -0
  19. package/build/types/revamp/domain/components/ListComponent.d.ts +1 -0
  20. package/build/types/revamp/domain/components/LoadingIndicatorComponent.d.ts +1 -0
  21. package/build/types/revamp/domain/components/MarkdownComponent.d.ts +1 -0
  22. package/build/types/revamp/domain/components/ModalComponent.d.ts +7 -9
  23. package/build/types/revamp/domain/components/ModalLayoutComponent.d.ts +14 -0
  24. package/build/types/revamp/domain/components/MultiSelectInputComponent.d.ts +1 -0
  25. package/build/types/revamp/domain/components/MultiUploadInputComponent.d.ts +1 -0
  26. package/build/types/revamp/domain/components/NumberInputComponent.d.ts +1 -0
  27. package/build/types/revamp/domain/components/ObjectComponent.d.ts +2 -1
  28. package/build/types/revamp/domain/components/ParagraphComponent.d.ts +1 -0
  29. package/build/types/revamp/domain/components/PersistAsyncComponent.d.ts +1 -0
  30. package/build/types/revamp/domain/components/RepeatableComponent.d.ts +1 -0
  31. package/build/types/revamp/domain/components/ReviewComponent.d.ts +1 -0
  32. package/build/types/revamp/domain/components/RootDomainComponent.d.ts +4 -3
  33. package/build/types/revamp/domain/components/SectionComponent.d.ts +1 -0
  34. package/build/types/revamp/domain/components/SelectInputComponent.d.ts +1 -0
  35. package/build/types/revamp/domain/components/StatusListComponent.d.ts +1 -0
  36. package/build/types/revamp/domain/components/TabsComponent.d.ts +1 -0
  37. package/build/types/revamp/domain/components/TextInputComponent.d.ts +1 -0
  38. package/build/types/revamp/domain/components/TupleComponent.d.ts +2 -1
  39. package/build/types/revamp/domain/components/UploadInputComponent.d.ts +1 -0
  40. package/build/types/revamp/domain/components/searchComponent/SearchComponent.d.ts +1 -0
  41. package/build/types/revamp/domain/components/step/ExternalConfirmationComponent.d.ts +1 -0
  42. package/build/types/revamp/domain/components/step/StepDomainComponent.d.ts +6 -5
  43. package/build/types/revamp/domain/mappers/layout/modalLayoutToComponent.d.ts +1 -1
  44. package/build/types/revamp/domain/mappers/layout/modalToContent.d.ts +2 -2
  45. package/build/types/revamp/domain/mappers/schema/oneOfSchemaToComponent/oneOfSchemaToComponent.d.ts +464 -1
  46. package/build/types/revamp/domain/mappers/schema/persistAsyncSchemaToComponent.d.ts +476 -1
  47. package/build/types/revamp/domain/types.d.ts +9 -4
  48. package/build/types/revamp/renderers/mappers/componentToRendererProps.d.ts +3 -3
  49. package/build/types/revamp/renderers/mappers/modalContentComponentToProps.d.ts +2 -2
  50. package/build/types/revamp/renderers/mappers/modalLayoutComponentToProps.d.ts +4 -0
  51. package/package.json +2 -2
  52. package/build/types/revamp/domain/components/ModalContentComponent.d.ts +0 -10
  53. package/build/types/revamp/renderers/mappers/modalComponentToProps.d.ts +0 -4
@@ -1,13 +1,11 @@
1
- import type { ModalLayoutTrigger } from '@wise/dynamic-flow-types/build/next/layout/ModalLayoutTrigger';
2
- import type { BaseLayoutComponent, DomainComponent } from '../types';
3
- export type ModalComponent = BaseLayoutComponent & {
1
+ import type { BaseComponent, DomainComponent, UpdateComponent } from '../types';
2
+ export type ModalComponent = BaseComponent & {
4
3
  type: 'modal';
5
- content: ModalContent;
6
- trigger: ModalLayoutTrigger;
7
- getChildren: () => DomainComponent[];
8
- };
9
- export type ModalContent = {
4
+ kind: 'layout';
10
5
  components: DomainComponent[];
6
+ open: boolean;
11
7
  title?: string;
8
+ getChildren: () => DomainComponent[];
9
+ close: () => void;
12
10
  };
13
- export declare const createModalComponent: (modalProps: Pick<ModalComponent, "uid" | "analyticsId" | "content" | "control" | "margin" | "trigger">) => ModalComponent;
11
+ export declare const createModalContentComponent: (modalProps: Pick<ModalComponent, "uid" | "analyticsId" | "components" | "title">, updateComponent: UpdateComponent) => ModalComponent;
@@ -0,0 +1,14 @@
1
+ import type { ModalLayoutTrigger } from '@wise/dynamic-flow-types/build/next/layout/ModalLayoutTrigger';
2
+ import type { BaseLayoutComponent, DomainComponent } from '../types';
3
+ export type ModalLayoutComponent = BaseLayoutComponent & {
4
+ type: 'modal-layout';
5
+ kind: 'layout';
6
+ content: ModalContent;
7
+ trigger: ModalLayoutTrigger;
8
+ getChildren: () => DomainComponent[];
9
+ };
10
+ export type ModalContent = {
11
+ components: DomainComponent[];
12
+ title?: string;
13
+ };
14
+ export declare const createModalComponent: (modalProps: Pick<ModalLayoutComponent, "uid" | "analyticsId" | "content" | "control" | "margin" | "trigger">) => ModalLayoutComponent;
@@ -5,6 +5,7 @@ import type { BaseInputComponent, LocalValue, LocalValueArray, OnValueChange, Sc
5
5
  import type { SelectInputOption } from './SelectInputComponent';
6
6
  export type MultiSelectComponent = BaseInputComponent<LocalValueArray | null> & {
7
7
  type: 'multi-select';
8
+ kind: 'input';
8
9
  children: SchemaComponent[];
9
10
  maxItems?: number;
10
11
  minItems?: number;
@@ -4,6 +4,7 @@ import type { IsInvalidCheck } from '../features/validation/value-checks';
4
4
  import type { BaseInputComponent, OnValueChange, PersistedState, RepeatableSummary, UpdateComponent, UploadSource } from '../types';
5
5
  export type MultiUploadInputComponent = BaseInputComponent<File[]> & {
6
6
  type: 'multi-upload';
7
+ kind: 'input';
7
8
  accepts?: string[];
8
9
  cameraConfig?: JsonElement;
9
10
  files: {
@@ -4,6 +4,7 @@ import type { PerformValidationAsync } from '../features/validationAsync/getPerf
4
4
  import type { BaseInputComponent, OnPersistAsync, OnValueChange, RepeatableSummary, UpdateComponent, ValidationAsyncState } from '../types';
5
5
  export type NumberInputComponent = BaseInputComponent<number | null> & {
6
6
  type: 'number';
7
+ kind: 'input';
7
8
  maximum?: number;
8
9
  minimum?: number;
9
10
  validationAsyncState: ValidationAsyncState;
@@ -1,6 +1,7 @@
1
- import type { BaseSchemaComponent, InlineAlert, SchemaComponent, LocalValue, LocalValueObject, RepeatableSummary } from '../types';
1
+ import type { BaseSchemaComponent, InlineAlert, LocalValue, LocalValueObject, RepeatableSummary, SchemaComponent } from '../types';
2
2
  export type ObjectComponent = BaseSchemaComponent<LocalValueObject> & {
3
3
  type: 'object';
4
+ kind: 'input';
4
5
  componentMap: Record<string, SchemaComponent>;
5
6
  alert?: InlineAlert;
6
7
  getChildren: () => SchemaComponent[];
@@ -1,6 +1,7 @@
1
1
  import type { Align, BaseLayoutComponent } from '../types';
2
2
  export type ParagraphComponent = BaseLayoutComponent & {
3
3
  type: 'paragraph';
4
+ kind: 'layout';
4
5
  align: Align;
5
6
  text: string;
6
7
  };
@@ -4,6 +4,7 @@ import { SchemaOnChange } from '../features/schema-on-change/getSchemaOnChange';
4
4
  import type { BaseSchemaComponent, LocalValue, SchemaComponent, UpdateComponent } from '../types';
5
5
  export type PersistAsyncComponent = BaseSchemaComponent<LocalValue> & {
6
6
  type: 'persist-async';
7
+ kind: 'input';
7
8
  component: SchemaComponent;
8
9
  abortController: AbortController;
9
10
  submission: Promise<JsonElement>;
@@ -3,6 +3,7 @@ import type { IsInvalidCheck } from '../features/validation/value-checks';
3
3
  import type { BaseSchemaComponent, Image, InlineAlert, LocalValue, LocalValueArray, OnValueChange, RepeatableSummary, SchemaComponent, UpdateComponent } from '../types';
4
4
  export type RepeatableComponent = BaseSchemaComponent<LocalValueArray> & {
5
5
  type: 'repeatable';
6
+ kind: 'input';
6
7
  id?: string;
7
8
  components: SchemaComponent[];
8
9
  addItemTitle: string;
@@ -2,6 +2,7 @@ import { Icon } from '@wise/dynamic-flow-types/build/next';
2
2
  import type { AdditionalInfo, BaseLayoutComponent, CallToAction, Image, InlineAlert } from '../types';
3
3
  export type ReviewComponent = BaseLayoutComponent & {
4
4
  type: 'review';
5
+ kind: 'layout';
5
6
  fields: ReviewField[];
6
7
  title?: string;
7
8
  callToAction?: CallToAction;
@@ -1,14 +1,15 @@
1
1
  import { Model } from '@wise/dynamic-flow-types';
2
2
  import { AnalyticsEventDispatcher } from '../features/events';
3
- import { BaseComponent, DomainComponent, SchemaComponent, LoadingState, LocalValue, UpdateComponent } from '../types';
4
- import { ModalContentComponent } from './ModalContentComponent';
3
+ import { BaseComponent, DomainComponent, LoadingState, LocalValue, SchemaComponent, UpdateComponent } from '../types';
4
+ import { ModalComponent } from './ModalComponent';
5
5
  import { StepDomainComponent } from './step/StepDomainComponent';
6
6
  export type RootDomainComponent = BaseComponent & {
7
7
  type: 'root';
8
+ kind: 'step';
8
9
  stepComponent: StepDomainComponent | null;
9
10
  dismissAllModals: () => void;
10
11
  dismissModal: () => void;
11
- showModal: (modal: ModalContentComponent) => void;
12
+ showModal: (modal: ModalComponent) => void;
12
13
  getChildren: () => DomainComponent[];
13
14
  getLocalValue: () => LocalValue;
14
15
  getLoadingState: () => LoadingState;
@@ -1,6 +1,7 @@
1
1
  import { BaseLayoutComponent, CallToAction, DomainComponent } from '../types';
2
2
  export type SectionComponent = BaseLayoutComponent & {
3
3
  type: 'section';
4
+ kind: 'layout';
4
5
  title: string;
5
6
  components: DomainComponent[];
6
7
  callToAction?: CallToAction;
@@ -5,6 +5,7 @@ import type { IsInvalidCheck } from '../features/validation/value-checks';
5
5
  import type { BaseInputComponent, Image, LocalValue, OnValueChange, RepeatableSummary, SchemaComponent, UpdateComponent } from '../types';
6
6
  export type SelectInputComponent = BaseInputComponent<LocalValue | null> & {
7
7
  type: 'select';
8
+ kind: 'input';
8
9
  selectedIndex: number | null;
9
10
  options: SelectInputOption[];
10
11
  children: SchemaComponent[];
@@ -1,6 +1,7 @@
1
1
  import type { BaseLayoutComponent, CallToAction } from '../types';
2
2
  export type StatusListComponent = BaseLayoutComponent & {
3
3
  type: 'status-list';
4
+ kind: 'layout';
4
5
  items: StatusListItem[];
5
6
  title?: string;
6
7
  };
@@ -1,6 +1,7 @@
1
1
  import { BaseLayoutComponent, DomainComponent } from '../types';
2
2
  export type TabsComponent = BaseLayoutComponent & {
3
3
  type: 'tabs';
4
+ kind: 'layout';
4
5
  tabs: Tab[];
5
6
  };
6
7
  export type Tab = {
@@ -4,6 +4,7 @@ import type { PerformValidationAsync } from '../features/validationAsync/getPerf
4
4
  import type { Autocapitalization, BaseInputComponent, OnPersistAsync, OnValueChange, RepeatableSummary, Suggestions, UpdateComponent, ValidationAsyncState } from '../types';
5
5
  export type TextInputComponent = BaseInputComponent<string | null> & {
6
6
  type: 'text';
7
+ kind: 'input';
7
8
  autocapitalization?: Autocapitalization;
8
9
  displayFormat?: string;
9
10
  maxLength?: number;
@@ -1,6 +1,7 @@
1
- import { BaseSchemaComponent, InlineAlert, SchemaComponent, LocalValue, LocalValueArray, RepeatableSummary } from '../types';
1
+ import { BaseSchemaComponent, InlineAlert, LocalValue, LocalValueArray, RepeatableSummary, SchemaComponent } from '../types';
2
2
  export type TupleComponent = BaseSchemaComponent<LocalValueArray> & {
3
3
  type: 'tuple';
4
+ kind: 'input';
4
5
  components: SchemaComponent[];
5
6
  alert?: InlineAlert;
6
7
  getChildren: () => SchemaComponent[];
@@ -4,6 +4,7 @@ import type { IsInvalidCheck } from '../features/validation/value-checks';
4
4
  import type { BaseInputComponent, OnPersistAsync, OnValueChange, RepeatableSummary, UpdateComponent, UploadSource } from '../types';
5
5
  export type UploadInputComponent = BaseInputComponent<File | null> & {
6
6
  type: 'upload';
7
+ kind: 'input';
7
8
  format: 'blob' | 'base64';
8
9
  cameraConfig?: JsonElement;
9
10
  maxSize?: number;
@@ -13,6 +13,7 @@ export type SearchProps = {
13
13
  export type PerformSearch = (props: SearchProps) => Promise<SearchResult[]>;
14
14
  export type SearchComponent = BaseLayoutComponent & {
15
15
  type: 'search';
16
+ kind: 'layout';
16
17
  emptyMessage: string;
17
18
  isLoading: boolean;
18
19
  query: string;
@@ -1,6 +1,7 @@
1
1
  import { BaseComponent, UpdateComponent } from '../../types';
2
2
  export type ExternalConfirmationComponent = BaseComponent & {
3
3
  type: 'external-confirmation';
4
+ kind: 'layout';
4
5
  uid: string;
5
6
  status: 'initial' | 'success' | 'failure' | 'dismissed';
6
7
  url: string;
@@ -1,13 +1,14 @@
1
- import type { BaseComponent, DomainComponent, SchemaComponent, LayoutComponent, LoadingState, LocalValue, OnBehavior, UpdateComponent } from '../../types';
1
+ import type { BaseComponent, DomainComponent, LayoutComponent, LoadingState, LocalValue, OnBehavior, SchemaComponent, UpdateComponent } from '../../types';
2
2
  import { Model } from '@wise/dynamic-flow-types';
3
3
  import type { Step } from '@wise/dynamic-flow-types/build/next';
4
4
  import type { AnalyticsEventDispatcher } from '../../features/events';
5
5
  import type { StepPolling } from '../../features/polling/getStepPolling';
6
6
  import { StepRefreshAfter } from '../../features/refreshAfter/getStepRefreshAfter';
7
- import { ModalContentComponent } from '../ModalContentComponent';
7
+ import { ModalComponent } from '../ModalComponent';
8
8
  import { ExternalConfirmationComponent } from './ExternalConfirmationComponent';
9
9
  export type StepDomainComponent = BaseComponent & {
10
10
  type: 'step';
11
+ kind: 'step';
11
12
  back?: BackNavigation;
12
13
  layoutComponents: LayoutComponent[];
13
14
  schemaComponents: SchemaComponent[];
@@ -18,12 +19,12 @@ export type StepDomainComponent = BaseComponent & {
18
19
  loadingState: LoadingState;
19
20
  step: Step;
20
21
  title?: string;
21
- modals: ModalContentComponent[];
22
+ modals: ModalComponent[];
22
23
  dismissModal: () => void;
23
24
  dismissAllModals: () => void;
24
- showModal: (modal: ModalContentComponent) => void;
25
+ showModal: (modal: ModalComponent) => void;
25
26
  getChildren: () => DomainComponent[];
26
- getModals: () => ModalContentComponent[];
27
+ getModals: () => ModalComponent[];
27
28
  getLocalValue: () => LocalValue;
28
29
  getSubmittableValue: () => Promise<Model>;
29
30
  validate: () => boolean;
@@ -1,4 +1,4 @@
1
1
  import type { ModalLayout } from '@wise/dynamic-flow-types/build/next';
2
2
  import type { SchemaComponent } from '../../types';
3
3
  import type { MapperProps } from '../schema/types';
4
- export declare const modalLayoutToComponent: (uid: string, { analyticsId, content, control, margin, trigger }: ModalLayout, mapperProps: MapperProps, schemaComponents: SchemaComponent[]) => import("../../components/ModalComponent").ModalComponent;
4
+ export declare const modalLayoutToComponent: (uid: string, { analyticsId, content, control, margin, trigger }: ModalLayout, mapperProps: MapperProps, schemaComponents: SchemaComponent[]) => import("../../components/ModalLayoutComponent").ModalLayoutComponent;
@@ -1,5 +1,5 @@
1
1
  import { ModalBehavior } from '@wise/dynamic-flow-types/build/next';
2
- import { ModalContentComponent } from '../../components/ModalContentComponent';
2
+ import { ModalComponent } from '../../components/ModalComponent';
3
3
  import type { SchemaComponent } from '../../types';
4
4
  import type { MapperProps } from '../schema/types';
5
- export declare const modalToContent: (uid: string, { content, title }: ModalBehavior, mapperProps: MapperProps, schemaComponents: SchemaComponent[]) => ModalContentComponent;
5
+ export declare const modalToContent: (uid: string, { content, title }: ModalBehavior, mapperProps: MapperProps, schemaComponents: SchemaComponent[]) => ModalComponent;