@wise/dynamic-flow-client 2.2.2 → 2.2.3

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 (25) hide show
  1. package/build/i18n/hu.json +1 -1
  2. package/build/main.js +4 -1
  3. package/build/main.min.js +1 -1
  4. package/build/types/revamp/DynamicFlowRevamp.d.ts +3 -0
  5. package/build/types/revamp/domain/AlertComponent.d.ts +14 -0
  6. package/build/types/revamp/domain/HeadingComponent.d.ts +16 -0
  7. package/build/types/revamp/domain/ParagraphComponent.d.ts +16 -0
  8. package/build/types/revamp/domain/Step.d.ts +9 -0
  9. package/build/types/revamp/domain/types.d.ts +8 -0
  10. package/build/types/revamp/mappers/componentToProps/alertComponentToProps.d.ts +3 -0
  11. package/build/types/revamp/mappers/componentToProps/headingComponentToProps.d.ts +3 -0
  12. package/build/types/revamp/mappers/componentToProps/paragraphComponentToProps.d.ts +3 -0
  13. package/build/types/revamp/mappers/specToDomain/alertLayoutToDomain.d.ts +2 -0
  14. package/build/types/revamp/mappers/specToDomain/headingLayoutToDomain.d.ts +2 -0
  15. package/build/types/revamp/mappers/specToDomain/mapStepToDomain.d.ts +4 -0
  16. package/build/types/revamp/mappers/specToDomain/paragraphLayoutToDomain.d.ts +2 -0
  17. package/build/types/revamp/renderers/neptune/AlertRenderer.d.ts +3 -0
  18. package/build/types/revamp/renderers/neptune/HeadingRenderer.d.ts +3 -0
  19. package/build/types/revamp/renderers/neptune/ParagraphRenderer.d.ts +3 -0
  20. package/build/types/revamp/renderers/neptune/utils/layout-utils.d.ts +7 -0
  21. package/build/types/revamp/renderers/types.d.ts +31 -0
  22. package/build/types/revamp/renderers/utils/renderComponent.d.ts +7 -0
  23. package/build/types/revamp/step/Step.d.ts +8 -0
  24. package/build/types/revamp/stories/utils/fixtureHttpClient.d.ts +2 -0
  25. package/package.json +1 -1
@@ -0,0 +1,3 @@
1
+ import { DynamicFlowProps } from '../dynamicFlow/DynamicFlowTypes';
2
+ declare const DynamicFlowRevamp: ({ flowId, httpClient, initialStep, onError, onLog, }: DynamicFlowProps) => JSX.Element;
3
+ export default DynamicFlowRevamp;
@@ -0,0 +1,14 @@
1
+ import { Context, Margin } from '@wise/dynamic-flow-types';
2
+ import { LayoutComponent } from './types';
3
+ export type AlertComponent = LayoutComponent & {
4
+ type: 'alert';
5
+ markdown: string;
6
+ context: Context;
7
+ margin: Margin;
8
+ };
9
+ export declare const createAlertComponent: (alertProps: {
10
+ uid: string;
11
+ markdown: string;
12
+ context: Context;
13
+ margin: Margin;
14
+ }) => AlertComponent;
@@ -0,0 +1,16 @@
1
+ import { Align, Margin, Size } from '@wise/dynamic-flow-types';
2
+ import { LayoutComponent } from './types';
3
+ export type HeadingComponent = LayoutComponent & {
4
+ type: 'heading';
5
+ text: string;
6
+ align: Align;
7
+ margin: Margin;
8
+ size: Size;
9
+ };
10
+ export declare const createHeadingComponent: (headingProps: {
11
+ uid: string;
12
+ text: string;
13
+ align: Align;
14
+ margin: Margin;
15
+ size: Size;
16
+ }) => HeadingComponent;
@@ -0,0 +1,16 @@
1
+ import { Align, Margin } from '@wise/dynamic-flow-types';
2
+ import { LayoutComponent } from './types';
3
+ export type ParagraphComponent = LayoutComponent & {
4
+ type: 'paragraph';
5
+ text: string;
6
+ control?: 'copyable' | string;
7
+ margin: Margin;
8
+ align: Align;
9
+ };
10
+ export declare const createParagraphComponent: (paragraphProps: {
11
+ uid: string;
12
+ text: string;
13
+ control?: 'copyable' | string;
14
+ margin: Margin;
15
+ align: Align;
16
+ }) => ParagraphComponent;
@@ -0,0 +1,9 @@
1
+ import { StepComponent } from './types';
2
+ export type Step = {
3
+ id: string;
4
+ components: StepComponent[];
5
+ };
6
+ export declare const createStep: ({ id, components, }: {
7
+ id: string;
8
+ components: StepComponent[];
9
+ }) => Step;
@@ -0,0 +1,8 @@
1
+ import { AlertComponent } from './AlertComponent';
2
+ import { HeadingComponent } from './HeadingComponent';
3
+ import { ParagraphComponent } from './ParagraphComponent';
4
+ export type StepComponent = AlertComponent | HeadingComponent | ParagraphComponent;
5
+ export type LayoutComponent = {
6
+ type: string;
7
+ uid: string;
8
+ };
@@ -0,0 +1,3 @@
1
+ import { AlertComponent } from '../../domain/AlertComponent';
2
+ import { AlertRendererProps } from '../../renderers/types';
3
+ export declare const alertComponentToProps: ({ uid, markdown, margin, context, }: AlertComponent) => AlertRendererProps;
@@ -0,0 +1,3 @@
1
+ import { HeadingComponent } from '../../domain/HeadingComponent';
2
+ import { HeadingRendererProps } from '../../renderers/types';
3
+ export declare const headingComponentToProps: ({ uid, text, align, margin, size, }: HeadingComponent) => HeadingRendererProps;
@@ -0,0 +1,3 @@
1
+ import { ParagraphComponent } from '../../domain/ParagraphComponent';
2
+ import { ParagraphRendererProps } from '../../renderers/types';
3
+ export declare const paragraphComponentToProps: ({ uid, text, control, align, margin, }: ParagraphComponent) => ParagraphRendererProps;
@@ -0,0 +1,2 @@
1
+ import { AlertLayout } from '@wise/dynamic-flow-types';
2
+ export declare const alertLayoutToDomain: ({ markdown, margin, context }: AlertLayout, uid: string) => import("../../domain/AlertComponent").AlertComponent;
@@ -0,0 +1,2 @@
1
+ import { HeadingLayout } from '@wise/dynamic-flow-types';
2
+ export declare const headingLayoutToDomain: ({ text, size, margin, align }: HeadingLayout, uid: string) => import("../../domain/HeadingComponent").HeadingComponent;
@@ -0,0 +1,4 @@
1
+ import { Step as DFStep } from '@wise/dynamic-flow-types';
2
+ export declare const mapStepToDomain: ({ step }: {
3
+ step: DFStep;
4
+ }) => import("../../domain/Step").Step;
@@ -0,0 +1,2 @@
1
+ import { ParagraphLayout } from '@wise/dynamic-flow-types';
2
+ export declare const paragraphLayoutToDomain: ({ text, control, align, margin }: ParagraphLayout, uid: string) => import("../../domain/ParagraphComponent").ParagraphComponent;
@@ -0,0 +1,3 @@
1
+ import { AlertRendererProps, Renderer } from '../types';
2
+ declare const AlertRenderer: Renderer<AlertRendererProps>;
3
+ export default AlertRenderer;
@@ -0,0 +1,3 @@
1
+ import { HeadingRendererProps, Renderer } from '../types';
2
+ declare const HeadingRenderer: Renderer<HeadingRendererProps>;
3
+ export default HeadingRenderer;
@@ -0,0 +1,3 @@
1
+ import { ParagraphRendererProps, Renderer } from '../types';
2
+ declare const ParagraphRenderer: Renderer<ParagraphRendererProps>;
3
+ export default ParagraphRenderer;
@@ -0,0 +1,7 @@
1
+ import { Align, Size } from '@wise/dynamic-flow-types';
2
+ declare const getTopMargin: (size: Size) => "" | "m-t-0" | "m-t-1" | "m-t-2" | "m-t-3" | "m-t-5";
3
+ declare const getTextAlignmentAndTopMargin: (component: {
4
+ align: Align;
5
+ margin: Size;
6
+ }) => string;
7
+ export { getTopMargin, getTextAlignmentAndTopMargin };
@@ -0,0 +1,31 @@
1
+ import { Align, Context, Margin, Size } from '@wise/dynamic-flow-types';
2
+ import { ReactNode } from 'react';
3
+ export type Renderer<P extends RendererProps> = {
4
+ canRender: (props: RendererProps) => boolean;
5
+ render: (props: P) => ReactNode;
6
+ };
7
+ export interface RendererProps {
8
+ type: string;
9
+ id: string;
10
+ }
11
+ export interface AlertRendererProps extends RendererProps {
12
+ type: 'alert';
13
+ markdown: string;
14
+ context: Context;
15
+ margin: Margin;
16
+ }
17
+ export interface HeadingRendererProps extends RendererProps {
18
+ type: 'heading';
19
+ text: string;
20
+ control?: string;
21
+ align: Align;
22
+ margin: Margin;
23
+ size: Size;
24
+ }
25
+ export interface ParagraphRendererProps extends RendererProps {
26
+ type: 'paragraph';
27
+ text: string;
28
+ control?: 'copyable' | string;
29
+ margin: Margin;
30
+ align: Align;
31
+ }
@@ -0,0 +1,7 @@
1
+ import { ReactNode } from 'react';
2
+ import { StepComponent } from '../../domain/types';
3
+ import { Renderer, RendererProps } from '../types';
4
+ export declare const renderComponent: ({ component, renderers, }: {
5
+ component: StepComponent;
6
+ renderers: Renderer<RendererProps>[];
7
+ }) => ReactNode | ReactNode[];
@@ -0,0 +1,8 @@
1
+ import { Step as DFStep } from '@wise/dynamic-flow-types';
2
+ import { Renderer, RendererProps } from '../renderers/types';
3
+ type StepProps = {
4
+ step: DFStep;
5
+ renderers: Renderer<RendererProps>[];
6
+ };
7
+ declare const Step: ({ step: dfStep, renderers }: StepProps) => JSX.Element;
8
+ export default Step;
@@ -0,0 +1,2 @@
1
+ export declare const getObjectKeys: <T>(object: T) => (keyof T)[];
2
+ export declare const fixtureHttpClient: typeof fetch;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@wise/dynamic-flow-client",
3
- "version": "2.2.2",
3
+ "version": "2.2.3",
4
4
  "description": "Dynamic Flow web client",
5
5
  "license": "Apache-2.0",
6
6
  "main": "./build/main.min.js",