@wise/dynamic-flow-client 2.3.0-beta-7d9b21.21 → 2.3.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.
- package/build/main.js +492 -472
- package/build/main.min.js +1 -1
- package/build/types/common/constants/FeatureName.d.ts +3 -0
- package/build/types/common/contexts/featureContext/FeatureContext.d.ts +10 -0
- package/build/types/dynamicFlow/DynamicFlowTypes.d.ts +15 -0
- package/build/types/step/cameraStep/cameraCapture/hooks/useFullScreenOrientationLock.d.ts +1 -1
- package/package.json +26 -26
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { Feature } from '../../../dynamicFlow/DynamicFlowTypes';
|
|
3
|
+
import { FeatureName } from '../../constants/FeatureName';
|
|
4
|
+
type FeatureContextProviderProps = {
|
|
5
|
+
features: Feature[] | undefined;
|
|
6
|
+
children: React.ReactNode;
|
|
7
|
+
};
|
|
8
|
+
export declare const FeatureContextProvider: ({ features, children }: FeatureContextProviderProps) => JSX.Element;
|
|
9
|
+
export declare const useFeatureFlag: (featureName: FeatureName) => Feature | undefined;
|
|
10
|
+
export {};
|
|
@@ -5,6 +5,7 @@ export type DynamicFlowPropsBasic = {
|
|
|
5
5
|
flowId: string;
|
|
6
6
|
loaderConfig?: LoaderConfig;
|
|
7
7
|
displayStepTitle?: boolean;
|
|
8
|
+
features?: Feature[];
|
|
8
9
|
httpClient: HttpClient;
|
|
9
10
|
onCompletion: (result: Record<string, unknown> | undefined | null) => void;
|
|
10
11
|
onError: (error: unknown, status?: number) => void;
|
|
@@ -44,3 +45,17 @@ export type InitialAction = {
|
|
|
44
45
|
method: 'POST';
|
|
45
46
|
data: Record<string, unknown>;
|
|
46
47
|
};
|
|
48
|
+
export type Feature = {
|
|
49
|
+
featureName: string;
|
|
50
|
+
/**
|
|
51
|
+
* The variant of the feature active for the user/profile.
|
|
52
|
+
* 0 is usually the control, and > 0 are variants.
|
|
53
|
+
*/
|
|
54
|
+
variant: number | null;
|
|
55
|
+
/**
|
|
56
|
+
* If the feature is enabled for the user/profile.
|
|
57
|
+
* This is the same as checking if `variant > 0`.
|
|
58
|
+
*/
|
|
59
|
+
enabled: boolean;
|
|
60
|
+
initiation: 'MISSING' | 'SKIPPED' | 'DEFAULT' | 'INITIATED';
|
|
61
|
+
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@wise/dynamic-flow-client",
|
|
3
|
-
"version": "2.3.0
|
|
3
|
+
"version": "2.3.0",
|
|
4
4
|
"description": "Dynamic Flow web client",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"main": "./build/main.min.js",
|
|
@@ -17,25 +17,6 @@
|
|
|
17
17
|
"fullname": "transferwise/dynamic-flow",
|
|
18
18
|
"url": "git+https://github.com/transferwise/dynamic-flow.git"
|
|
19
19
|
},
|
|
20
|
-
"scripts": {
|
|
21
|
-
"dev": "storybook dev -p 3003",
|
|
22
|
-
"build": "rm -rf build && npm-run-all build:*",
|
|
23
|
-
"build:types": "tsc --project ./tsconfig.types.json",
|
|
24
|
-
"build:js": "node ./scripts/build.mjs",
|
|
25
|
-
"build:css": "postcss src/main.css -o build/main.css",
|
|
26
|
-
"build:messages-source": "formatjs extract 'src/**/*.messages.{js,ts}' --out-file src/i18n/en.json --format simple && prettier --find-config-path --write src/i18n/*.json",
|
|
27
|
-
"build:compiled-messages": "mkdir -p build/i18n && cp src/i18n/*.json build/i18n",
|
|
28
|
-
"test": "npm-run-all test:once test:tz",
|
|
29
|
-
"test:once": "jest --config jest.config.js --env=jsdom -w 2",
|
|
30
|
-
"test:coverage": "jest --config jest.config.js --env=jsdom --coverage",
|
|
31
|
-
"test:tz": "TZ=US/Pacific jest ./src/jsonSchemaForm/basicTypeSchema/BasicTypeSchema.errors.spec.js ./src/formControl/FormControl.spec.js",
|
|
32
|
-
"test:watch": "pnpm test:once --watch",
|
|
33
|
-
"types": "pnpm tsc",
|
|
34
|
-
"lint": "npm-run-all lint:ts lint:css",
|
|
35
|
-
"lint:ts": "eslint 'src/**/*.{js,jsx,ts,tsx}' --quiet",
|
|
36
|
-
"lint:css": "stylelint './src/**/*.css'",
|
|
37
|
-
"build-storybook": "storybook build -c .storybook"
|
|
38
|
-
},
|
|
39
20
|
"devDependencies": {
|
|
40
21
|
"@babel/core": "7.23.2",
|
|
41
22
|
"@babel/plugin-syntax-flow": "7.22.5",
|
|
@@ -71,7 +52,6 @@
|
|
|
71
52
|
"@types/testing-library__jest-dom": "5.14.9",
|
|
72
53
|
"@wise/art": "2.8.4",
|
|
73
54
|
"@wise/components-theming": "^0.8.4",
|
|
74
|
-
"@wise/dynamic-flow-fixtures": "workspace:*",
|
|
75
55
|
"babel-jest": "29.7.0",
|
|
76
56
|
"currency-flags": "4.0.7",
|
|
77
57
|
"enzyme": "^3.11.0",
|
|
@@ -96,7 +76,8 @@
|
|
|
96
76
|
"stylelint-no-unsupported-browser-features": "5.0.4",
|
|
97
77
|
"stylelint-value-no-unknown-custom-properties": "4.0.0",
|
|
98
78
|
"typescript": "4.9.5",
|
|
99
|
-
"webpack": "5.89.0"
|
|
79
|
+
"webpack": "5.89.0",
|
|
80
|
+
"@wise/dynamic-flow-fixtures": "0.0.1"
|
|
100
81
|
},
|
|
101
82
|
"peerDependencies": {
|
|
102
83
|
"@transferwise/components": "^43",
|
|
@@ -108,10 +89,29 @@
|
|
|
108
89
|
"react-intl": "^6"
|
|
109
90
|
},
|
|
110
91
|
"dependencies": {
|
|
111
|
-
"@wise/dynamic-flow-types": "workspace:*",
|
|
112
92
|
"classnames": "2.3.2",
|
|
113
93
|
"react-webcam": "^7.1.1",
|
|
114
|
-
"screenfull": "^5.2.0"
|
|
94
|
+
"screenfull": "^5.2.0",
|
|
95
|
+
"@wise/dynamic-flow-types": "2.0.1"
|
|
115
96
|
},
|
|
116
|
-
"prettier": "@transferwise/eslint-config/.prettierrc.js"
|
|
117
|
-
|
|
97
|
+
"prettier": "@transferwise/eslint-config/.prettierrc.js",
|
|
98
|
+
"scripts": {
|
|
99
|
+
"dev": "storybook dev -p 3003",
|
|
100
|
+
"build": "rm -rf build && npm-run-all build:*",
|
|
101
|
+
"build:types": "tsc --project ./tsconfig.types.json",
|
|
102
|
+
"build:js": "node ./scripts/build.mjs",
|
|
103
|
+
"build:css": "postcss src/main.css -o build/main.css",
|
|
104
|
+
"build:messages-source": "formatjs extract 'src/**/*.messages.{js,ts}' --out-file src/i18n/en.json --format simple && prettier --find-config-path --write src/i18n/*.json",
|
|
105
|
+
"build:compiled-messages": "mkdir -p build/i18n && cp src/i18n/*.json build/i18n",
|
|
106
|
+
"test": "npm-run-all test:once test:tz",
|
|
107
|
+
"test:once": "jest --config jest.config.js --env=jsdom -w 2",
|
|
108
|
+
"test:coverage": "jest --config jest.config.js --env=jsdom --coverage",
|
|
109
|
+
"test:tz": "TZ=US/Pacific jest ./src/jsonSchemaForm/basicTypeSchema/BasicTypeSchema.errors.spec.js ./src/formControl/FormControl.spec.js",
|
|
110
|
+
"test:watch": "pnpm test:once --watch",
|
|
111
|
+
"types": "pnpm tsc",
|
|
112
|
+
"lint": "npm-run-all lint:ts lint:css",
|
|
113
|
+
"lint:ts": "eslint 'src/**/*.{js,jsx,ts,tsx}' --quiet",
|
|
114
|
+
"lint:css": "stylelint './src/**/*.css'",
|
|
115
|
+
"build-storybook": "storybook build -c .storybook"
|
|
116
|
+
}
|
|
117
|
+
}
|