@wise/dynamic-flow-client 0.1.4 → 0.2.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 (53) hide show
  1. package/README.md +2 -0
  2. package/build/flow/DynamicFlow.d.ts +0 -1
  3. package/build/flow/DynamicFlowStep.d.ts +0 -1
  4. package/build/flow/errorBoundary/ErrorBoundaryAlert.d.ts +0 -1
  5. package/build/flow/stories/EditableDynamicFlow.d.ts +0 -1
  6. package/build/jsonSchemaForm/JsonSchemaForm.d.ts +0 -1
  7. package/build/jsonSchemaForm/allOfSchema/AllOfSchema.d.ts +0 -1
  8. package/build/jsonSchemaForm/arrayTypeSchema/ArraySchema.d.ts +0 -1
  9. package/build/jsonSchemaForm/arrayTypeSchema/arrayListSchema/ArrayListSchema.d.ts +0 -1
  10. package/build/jsonSchemaForm/arrayTypeSchema/arrayListSchema/multipleFileUploadSchema/MultipleFileUploadSchema.d.ts +0 -1
  11. package/build/jsonSchemaForm/basicTypeSchema/BasicTypeSchema.d.ts +0 -1
  12. package/build/jsonSchemaForm/controlFeedback/ControlFeedback.d.ts +0 -1
  13. package/build/jsonSchemaForm/genericSchema/GenericSchema.d.ts +0 -1
  14. package/build/jsonSchemaForm/help/Help.d.ts +0 -1
  15. package/build/jsonSchemaForm/objectSchema/ObjectSchema.d.ts +0 -1
  16. package/build/jsonSchemaForm/oneOfSchema/OneOfSchema.d.ts +0 -1
  17. package/build/jsonSchemaForm/persistAsyncSchema/PersistAsyncSchema.d.ts +0 -1
  18. package/build/jsonSchemaForm/persistAsyncSchema/basic/PersistAsyncBasicSchema.d.ts +0 -1
  19. package/build/jsonSchemaForm/persistAsyncSchema/blob/PersistAsyncBlobSchema.d.ts +0 -1
  20. package/build/jsonSchemaForm/persistAsyncSchema/blob/UploadInputAdapter.d.ts +0 -1
  21. package/build/jsonSchemaForm/promotedOneOfSchema/PromotedOneOfSchema.d.ts +0 -1
  22. package/build/jsonSchemaForm/promotedOneOfSchema/control/PromotedOneOfCheckboxControl.d.ts +0 -1
  23. package/build/jsonSchemaForm/promotedOneOfSchema/control/PromotedOneOfRadioControl.d.ts +0 -1
  24. package/build/jsonSchemaForm/readOnlySchema/ReadOnlySchema.d.ts +0 -1
  25. package/build/jsonSchemaForm/schemaFormControl/SchemaFormControl.d.ts +0 -1
  26. package/build/jsonSchemaForm/schemaFormControl/optionMapper.d.ts +0 -1
  27. package/build/jsonSchemaForm/validationAsyncSchema/ValidationAsyncSchema.d.ts +0 -1
  28. package/build/layout/DynamicLayout.d.ts +0 -1
  29. package/build/layout/alert/index.d.ts +0 -1
  30. package/build/layout/box/index.d.ts +0 -1
  31. package/build/layout/button/index.d.ts +0 -1
  32. package/build/layout/columns/index.d.ts +0 -1
  33. package/build/layout/decision/index.d.ts +0 -1
  34. package/build/layout/divider/index.d.ts +0 -1
  35. package/build/layout/external/DynamicExternal.d.ts +0 -1
  36. package/build/layout/form/index.d.ts +0 -1
  37. package/build/layout/heading/index.d.ts +0 -1
  38. package/build/layout/icon/index.d.ts +0 -1
  39. package/build/layout/image/index.d.ts +0 -1
  40. package/build/layout/info/index.d.ts +0 -1
  41. package/build/layout/list/index.d.ts +0 -1
  42. package/build/layout/loading-indicator/index.d.ts +0 -1
  43. package/build/layout/paragraph/DynamicParagraph.d.ts +0 -1
  44. package/build/layout/review/index.d.ts +0 -1
  45. package/build/step/cameraStep/CameraStep.d.ts +0 -1
  46. package/build/step/cameraStep/cameraCapture/CameraCapture.d.ts +0 -1
  47. package/build/step/cameraStep/cameraCapture/components/index.d.ts +0 -1
  48. package/build/step/cameraStep/cameraCapture/overlay/Overlay.d.ts +0 -1
  49. package/build/step/cameraStep/cameraCapture/screens/CameraNotSupported/CameraNotSupported.d.ts +0 -1
  50. package/build/step/cameraStep/cameraCapture/screens/NoCameraAccess/NoCameraAccess.d.ts +0 -1
  51. package/build/step/externalConfirmationStep/ExternalConfirmationStep.d.ts +0 -1
  52. package/build/step/layoutStep/LayoutStep.d.ts +0 -1
  53. package/package.json +28 -25
package/README.md CHANGED
@@ -2,6 +2,8 @@
2
2
 
3
3
  This is the Dynamic Flow web client. It provides a simple way to integrate a Dynamic Flow into your web app.
4
4
 
5
+ ⚡ Access the latest deployed version of the [Dynamic Flow Playground](https://main--641de2ace0e1566a6a450fad.chromatic.com).
6
+
5
7
  ## Integration
6
8
 
7
9
  1. Install `@wise/dynamic-flow-client`.
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  import { DynamicFlowProps } from './types';
3
2
  declare const DynamicFlow: (props: DynamicFlowProps) => JSX.Element;
4
3
  export default DynamicFlow;
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  import { GlobalError, Step } from '../dynamic-flow-types';
3
2
  import { LayoutStepProps } from '../step/layoutStep/LayoutStep';
4
3
  type DynamicFlowStepProps = Omit<LayoutStepProps, 'stepSpecification'> & {
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  type Props = {
3
2
  onDismiss: () => void;
4
3
  };
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  declare const EditableDynamicFlow: ({ initialStepName }: {
3
2
  initialStepName?: string | undefined;
4
3
  }) => JSX.Element;
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  import { LogEventHandler } from '../common/logging';
3
2
  import { TrackableEventHandler } from '../common/tracking';
4
3
  import { FormErrors, Model, Schema } from '../dynamic-flow-types';
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  import { AllOfSchema as AllOfSchemaType, ObjectModel } from '../../dynamic-flow-types';
3
2
  import { GenericSchemaProps } from '../genericSchema/GenericSchema';
4
3
  declare const AllOfSchema: {
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  import { ArrayModel, ArraySchema as ArraySchemaType } from '../../dynamic-flow-types';
3
2
  import { GenericSchemaProps } from '../genericSchema/GenericSchema';
4
3
  declare const ArraySchema: {
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  import { ArrayModel, ArraySchema as ArraySchemaType } from '../../../dynamic-flow-types';
3
2
  import { GenericSchemaProps } from '../../genericSchema/GenericSchema';
4
3
  declare const ArrayListSchema: {
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  import { ArrayModel } from '../../../../dynamic-flow-types';
3
2
  import { MultipleFileUploadSchema as MultipleFileUploadSchemaType } from '../../../../dynamic-flow-types/Schema';
4
3
  import { GenericSchemaProps } from '../../../genericSchema/GenericSchema';
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  import { BasicModel, BasicSchema } from '../../dynamic-flow-types';
3
2
  import { OnChange } from '../JsonSchemaForm';
4
3
  import { GenericSchemaProps } from '../genericSchema/GenericSchema';
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  import { Schema } from '../../dynamic-flow-types';
3
2
  declare const ControlFeedback: {
4
3
  (props: ControlFeedbackProps): JSX.Element;
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  import { FormErrors, Model, Schema } from '../../dynamic-flow-types';
3
2
  import { OnPersistAsync } from '../../schema';
4
3
  import { OnChange } from '../JsonSchemaForm';
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  type Props = {
3
2
  help: {
4
3
  markdown: string;
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  import { ObjectModel, ObjectSchema as ObjectSchemaType } from '../../dynamic-flow-types';
3
2
  import { GenericSchemaProps } from '../genericSchema/GenericSchema';
4
3
  declare const ObjectSchema: {
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  import { OneOfSchema as OneOfSchemaType } from '../../dynamic-flow-types';
3
2
  import { GenericSchemaProps } from '../genericSchema/GenericSchema';
4
3
  declare const OneOfSchema: {
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  import { PersistAsyncSchema as PersistAsyncSchemaType } from '../../dynamic-flow-types';
3
2
  import { GenericSchemaProps } from '../genericSchema/GenericSchema';
4
3
  declare const PersistAsyncSchema: {
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  import { PersistAsync, Schema } from '../../../dynamic-flow-types';
3
2
  import { GenericSchemaProps } from '../../genericSchema/GenericSchema';
4
3
  export declare const getIdFromResponse: (idProperty: string, response: Record<string, unknown>) => string | number;
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  import { BlobSchema, PersistAsync, Schema } from '../../../dynamic-flow-types';
3
2
  import { GenericSchemaProps } from '../../genericSchema/GenericSchema';
4
3
  declare const PersistAsyncBlobSchema: {
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  import { UploadProps } from '@transferwise/components/build/types/upload/Upload';
3
2
  import { PersistAsync } from '../../../dynamic-flow-types';
4
3
  import { Fetcher } from '../../../schema';
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  import { ObjectModel, OneOfObjectSchema } from '../../dynamic-flow-types';
3
2
  import { GenericSchemaProps } from '../genericSchema/GenericSchema';
4
3
  declare const PromotedOneOfSchema: (props: PromotedOneOfSchemaProps) => JSX.Element;
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  import { PromotedOneOfControlProps } from './PromotedOneOfControl';
3
2
  declare const PromotedOneOfCheckboxControl: {
4
3
  (props: PromotedOneOfControlProps): JSX.Element;
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  import { PromotedOneOfControlProps } from './PromotedOneOfControl';
3
2
  declare const PromotedOneOfRadioControl: {
4
3
  (props: PromotedOneOfControlProps): JSX.Element;
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  import { Model, Schema } from '../../dynamic-flow-types';
3
2
  type ReadOnlySchemaProps = {
4
3
  schema: Schema;
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  import { FormControlType } from '../../common';
3
2
  import { BasicModel, Schema } from '../../dynamic-flow-types';
4
3
  export declare const getControlType: (schema: Schema) => (typeof FormControlType)[keyof typeof FormControlType] | undefined;
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  import { Icon, Image, Schema } from '../../dynamic-flow-types';
3
2
  export declare const mapConstSchemaToOption: (schema: Schema, controlType?: string) => {
4
3
  searchStrings: string[];
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  import { BasicModel } from '../../dynamic-flow-types';
3
2
  import { ValidationAsyncSchema as ValidationAsyncSchemaType } from '../../dynamic-flow-types/Schema';
4
3
  import { GenericSchemaProps } from '../genericSchema/GenericSchema';
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  import { FormErrors, LayoutComponent, Model } from '../dynamic-flow-types';
3
2
  import { OnAction, OnModelChange, OnPersistAsync } from '../schema';
4
3
  export type CommonLayoutProps = {
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  import { Alert as AlertType } from '../../dynamic-flow-types';
3
2
  declare const DynamicAlert: (props: {
4
3
  component: AlertType;
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  import { BoxLayout } from '../../dynamic-flow-types';
3
2
  import { CommonLayoutProps } from '../DynamicLayout';
4
3
  type Props = CommonLayoutProps & {
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  import { ButtonLayout } from '../../dynamic-flow-types';
3
2
  import { CommonLayoutProps } from '../DynamicLayout';
4
3
  type Props = Omit<CommonLayoutProps, 'submitted' | 'onModelChange' | 'onPersistAsync'> & {
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  import { ColumnsLayout } from '../../dynamic-flow-types';
3
2
  import { CommonLayoutProps } from '../DynamicLayout';
4
3
  type Props = CommonLayoutProps & {
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  import { DecisionLayout } from '../../dynamic-flow-types';
3
2
  import { OnAction } from '../../schema';
4
3
  type Props = {
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  import { DividerLayout } from '../../dynamic-flow-types';
3
2
  type Props = {
4
3
  component: DividerLayout;
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  import { Action, ExternalLayout } from '../../dynamic-flow-types';
3
2
  type Props = {
4
3
  component: ExternalLayout;
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  import { FormLayout } from '../../dynamic-flow-types';
3
2
  import { CommonLayoutProps } from '../DynamicLayout';
4
3
  type Props = Omit<CommonLayoutProps, 'onAction'> & {
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  import { HeadingLayout } from '../../dynamic-flow-types';
3
2
  declare const DynamicHeading: (props: {
4
3
  component: HeadingLayout;
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  type Props = {
3
2
  type: string;
4
3
  };
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  import { ImageLayout } from '../../dynamic-flow-types';
3
2
  declare const DynamicImage: (props: {
4
3
  component: ImageLayout;
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  import { InfoLayout } from '../../dynamic-flow-types';
3
2
  type Props = {
4
3
  component: InfoLayout;
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  import { Action, ListLayout } from '../../dynamic-flow-types';
3
2
  type Props = {
4
3
  component: ListLayout;
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  import { LoadingIndicatorLayout } from '../../dynamic-flow-types';
3
2
  type Props = {
4
3
  component: LoadingIndicatorLayout;
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  import { ParagraphLayout } from '../../dynamic-flow-types';
3
2
  type Props = {
4
3
  component: ParagraphLayout;
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  import { ReviewLayout } from '../../dynamic-flow-types';
3
2
  import { OnAction } from '../../schema';
4
3
  type Props = {
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  import { Step } from '../../dynamic-flow-types';
3
2
  import { CommonLayoutProps } from '../../layout/DynamicLayout';
4
3
  export type CameraStepProps = Omit<CommonLayoutProps, 'onPersistAsync' | 'baseUrl'> & {
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  import { TrackableEventHandler } from '../../../common/tracking';
3
2
  import { CameraDirection } from '../../../dynamic-flow-types/FileUploadSchema';
4
3
  type Props = {
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  export declare const CaptureBottomBar: ({ onCapture }: {
3
2
  onCapture: () => void;
4
3
  }) => JSX.Element;
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  type Props = {
3
2
  overlay?: string;
4
3
  outline?: string;
@@ -1,3 +1,2 @@
1
- /// <reference types="react" />
2
1
  declare const CameraNotSupported: () => JSX.Element;
3
2
  export default CameraNotSupported;
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  type Props = {
3
2
  onAction: () => void;
4
3
  };
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  type Props = {
3
2
  url: string;
4
3
  onClose: () => void;
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  import { FormErrors, Step } from '../../dynamic-flow-types';
3
2
  import { CommonLayoutProps } from '../../layout/DynamicLayout';
4
3
  import { StepLayoutOptions } from './layoutService/convertStepToLayout';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@wise/dynamic-flow-client",
3
- "version": "0.1.4",
3
+ "version": "0.2.0",
4
4
  "description": "Wise Dynamic Flow web client",
5
5
  "main": "./build/index.js",
6
6
  "types": "./build/index.d.ts",
@@ -18,9 +18,11 @@
18
18
  },
19
19
  "devDependencies": {
20
20
  "@babel/core": "7.20.12",
21
+ "@babel/plugin-syntax-flow": "7.18.6",
22
+ "@babel/plugin-transform-react-jsx": "7.21.0",
21
23
  "@babel/preset-env": "7.20.2",
22
- "@babel/preset-react": "^7.18.6",
23
- "@babel/preset-typescript": "^7.21.0",
24
+ "@babel/preset-react": "7.18.6",
25
+ "@babel/preset-typescript": "7.21.0",
24
26
  "@formatjs/cli": "^4.8.3",
25
27
  "@storybook/addon-a11y": "6.5.16",
26
28
  "@storybook/addon-actions": "6.5.16",
@@ -36,22 +38,22 @@
36
38
  "@testing-library/react-hooks": "^8.0.1",
37
39
  "@testing-library/react": "^12.0.0",
38
40
  "@testing-library/user-event": "13.2.1",
39
- "@transferwise/components": "^43.13.49",
40
- "@transferwise/eslint-config": "^8.0.1",
41
+ "@transferwise/components": "43.13.49",
42
+ "@transferwise/eslint-config": "8.0.1",
41
43
  "@transferwise/formatting": "^2.10.0",
42
- "@transferwise/icons": "^3.2.3",
43
- "@transferwise/neptune-css": "^14.3.45",
44
- "@transferwise/neptune-tokens": "^8.4.0",
44
+ "@transferwise/icons": "3.2.3",
45
+ "@transferwise/neptune-css": "14.3.45",
46
+ "@transferwise/neptune-tokens": "8.4.0",
45
47
  "@types/enzyme": "^3.10.12",
46
48
  "@types/jest": "29.4.0",
47
49
  "@types/lodash.debounce": "^4.0.7",
48
50
  "@types/lodash": "^4.14.167",
49
- "@types/react-dom": "17",
50
- "@types/react": "17",
51
+ "@types/react-dom": "18",
52
+ "@types/react": "18",
51
53
  "@types/testing-library__jest-dom": "5.9.5",
52
54
  "@wise/art": "2.0.1",
53
55
  "@wise/components-theming": "^0.7.4",
54
- "@wojtekmaj/enzyme-adapter-react-17": "^0.8.0",
56
+ "@cfaester/enzyme-adapter-react-18": "0.7.0",
55
57
  "babel-jest": "29.5.0",
56
58
  "cpx": "1.5.0",
57
59
  "currency-flags": "4.0.7",
@@ -65,27 +67,27 @@
65
67
  "postcss-import": "^15.1.0",
66
68
  "postcss": "^8.4.21",
67
69
  "prettier": "2.8.4",
68
- "react-dom": "17",
69
- "react-intl": "5.20.6",
70
- "react": "17",
70
+ "react-dom": "18.2.0",
71
+ "react-intl": "6.2.1",
72
+ "react": "18.2.0",
71
73
  "require-from-string": "2.0.2",
72
- "stylelint-config-standard": "^25.0.0",
73
- "stylelint-no-unsupported-browser-features": "^5.0.3",
74
- "stylelint-value-no-unknown-custom-properties": "^4.0.0",
75
- "stylelint": "^14.7.1",
74
+ "stylelint-config-standard": "25.0.0",
75
+ "stylelint-no-unsupported-browser-features": "5.0.4",
76
+ "stylelint-value-no-unknown-custom-properties": "4.0.0",
77
+ "stylelint": "14.16.1",
76
78
  "typescript": "4.9.5",
77
79
  "webpack": "5.75.0"
78
80
  },
79
81
  "peerDependencies": {
80
82
  "@transferwise/components": "^43",
81
- "@transferwise/formatting": "^2.10.0",
83
+ "@transferwise/formatting": "^2",
82
84
  "@transferwise/icons": "^3",
83
85
  "@transferwise/neptune-css": "^14",
84
86
  "@transferwise/neptune-validation": "^3",
85
- "prop-types": "^15.7.2",
86
- "react-dom": ">=16.14",
87
- "react-intl": "^5.10.0 || ^6",
88
- "react": ">=16.14"
87
+ "prop-types": "^15",
88
+ "react-dom": "^18",
89
+ "react-intl": "^6",
90
+ "react": "^18"
89
91
  },
90
92
  "peerDependenciesMeta": {
91
93
  "prop-types": {
@@ -93,7 +95,7 @@
93
95
  }
94
96
  },
95
97
  "dependencies": {
96
- "classnames": "^2.2.6",
98
+ "classnames": "2.3.2",
97
99
  "lodash.debounce": "^4.0.8",
98
100
  "lodash.isequal": "^4.5.0",
99
101
  "react-use": "^17.4.0",
@@ -114,6 +116,7 @@
114
116
  "test:watch": "pnpm test:once --watch",
115
117
  "lint": "npm-run-all lint:ts lint:css",
116
118
  "lint:ts": "eslint 'src/**/*.{js,jsx,ts,tsx}' --quiet",
117
- "lint:css": "stylelint --allow-empty-input './src/**/*.less'"
119
+ "lint:css": "stylelint --allow-empty-input './src/**/*.less'",
120
+ "build-storybook": "build-storybook -c .storybook"
118
121
  }
119
122
  }