@wise/dynamic-flow-client 3.3.2 → 3.4.0-experimental-ed080a1
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/common/httpClientContext/HttpClientContext.js +35 -0
- package/build/common/httpClientContext/index.js +1 -0
- package/build/common/makeHttpClient/index.js +1 -0
- package/build/common/makeHttpClient/makeHttpClient.js +34 -0
- package/build/common/messages/generic-error.messages.js +18 -0
- package/build/common/messages/help.messages.js +8 -0
- package/build/common/messages/multi-file-upload.messages.js +18 -0
- package/build/common/messages/paragraph.messages.js +13 -0
- package/build/common/messages/repeatable.messages.js +23 -0
- package/build/common/messages/validation.array.messages.js +13 -0
- package/build/common/messages/validation.messages.js +53 -0
- package/build/common/utils/api-utils.js +4 -0
- package/build/legacy/common/constants/DateMode.js +4 -0
- package/build/legacy/common/constants/FeatureName.js +4 -0
- package/build/legacy/common/constants/FormControlType.js +21 -0
- package/build/legacy/common/constants/MonthFormat.js +4 -0
- package/build/legacy/common/constants/Size.js +7 -0
- package/build/legacy/common/constants/index.js +4 -0
- package/build/legacy/common/contexts/dynamicFlowContexts/DynamicFlowContexts.js +36 -0
- package/build/legacy/common/contexts/dynamicFlowContexts/usePendingPromiseCounter.js +13 -0
- package/build/legacy/common/contexts/eventsContext/EventsContext.js +38 -0
- package/build/legacy/common/contexts/featureContext/FeatureContext.js +22 -0
- package/build/legacy/common/contexts/index.js +3 -0
- package/build/legacy/common/contexts/logContext/LogContext.js +44 -0
- package/build/legacy/common/hooks/index.js +7 -0
- package/build/legacy/common/hooks/useDebouncedFunction/useDebouncedFunction.js +9 -0
- package/build/legacy/common/hooks/useExternal/useExternal.js +15 -0
- package/build/legacy/common/hooks/useExternalStepPolling/useExternalStepPolling.js +70 -0
- package/build/legacy/common/hooks/usePersistAsync/usePersistAsync.js +172 -0
- package/build/legacy/common/hooks/usePolling/usePolling.js +51 -0
- package/build/legacy/common/hooks/usePrevious/usePrevious.js +8 -0
- package/build/legacy/common/hooks/useStepPolling/useStepPolling.js +43 -0
- package/build/legacy/common/messages.js +8 -0
- package/build/legacy/common/utils/api-utils.js +6 -0
- package/build/legacy/common/utils/date-utils.js +22 -0
- package/build/legacy/common/utils/debounce.js +38 -0
- package/build/legacy/common/utils/file-utils.js +45 -0
- package/build/legacy/common/utils/id-utils.js +5 -0
- package/build/legacy/common/utils/index.js +11 -0
- package/build/legacy/common/utils/is-equal.js +21 -0
- package/build/legacy/common/utils/misc-utils.js +4 -0
- package/build/legacy/common/utils/mobile-utils.js +23 -0
- package/build/legacy/common/utils/model-utils.js +33 -0
- package/build/legacy/common/utils/schema-utils.js +97 -0
- package/build/legacy/common/utils/step-utils.js +32 -0
- package/build/legacy/common/validators/index.js +5 -0
- package/build/legacy/common/validators/models/model-utils.js +119 -0
- package/build/legacy/common/validators/models/model-validators.js +62 -0
- package/build/legacy/common/validators/schemas/schema-validators.js +101 -0
- package/build/legacy/common/validators/types/type-validators.js +14 -0
- package/build/legacy/common/validators/validationFailures/validation-failures.js +139 -0
- package/build/legacy/common/validators/validationFailures/validation-failures.utils.js +40 -0
- package/build/legacy/common/validators/values/value-validators.js +6 -0
- package/build/legacy/dynamic-flow-types.js +1 -0
- package/build/legacy/dynamicFlow/BackButton.js +22 -0
- package/build/legacy/dynamicFlow/DynamicFlowStep.js +37 -0
- package/build/legacy/formControl/FormControl.js +266 -0
- package/build/legacy/formControl/index.js +1 -0
- package/build/legacy/formControl/utils/getAutocompleteString.js +80 -0
- package/build/legacy/formControl/utils/index.js +2 -0
- package/build/legacy/formControl/utils/value-utils.js +108 -0
- package/build/legacy/jsonSchemaForm/allOfSchema/AllOfSchema.js +50 -0
- package/build/legacy/jsonSchemaForm/allOfSchema/index.js +1 -0
- package/build/legacy/jsonSchemaForm/arrayTypeSchema/ArraySchema.js +25 -0
- package/build/legacy/jsonSchemaForm/arrayTypeSchema/arrayListSchema/ArrayListSchema.js +30 -0
- package/build/legacy/jsonSchemaForm/arrayTypeSchema/arrayListSchema/multipleFileUploadSchema/MultipleFileUploadSchema.js +141 -0
- package/build/legacy/jsonSchemaForm/arrayTypeSchema/arrayListSchema/multipleFileUploadSchema/index.js +1 -0
- package/build/legacy/jsonSchemaForm/arrayTypeSchema/arrayListSchema/multipleFileUploadSchema/utils/index.js +2 -0
- package/build/legacy/jsonSchemaForm/arrayTypeSchema/arrayListSchema/multipleFileUploadSchema/utils/upload-utils.js +79 -0
- package/build/legacy/jsonSchemaForm/arrayTypeSchema/arrayListSchema/multipleFileUploadSchema/utils/useFormattedDefaultErrorMessages.js +14 -0
- package/build/legacy/jsonSchemaForm/arrayTypeSchema/arrayListSchema/repeatableSchema/ItemSummary.js +7 -0
- package/build/legacy/jsonSchemaForm/arrayTypeSchema/arrayListSchema/repeatableSchema/RepeatableSchema.js +134 -0
- package/build/legacy/jsonSchemaForm/arrayTypeSchema/arrayListSchema/repeatableSchema/RepeatableSchemaStep.js +85 -0
- package/build/legacy/jsonSchemaForm/arrayTypeSchema/arrayListSchema/repeatableSchema/utils/summary-utils.js +135 -0
- package/build/legacy/jsonSchemaForm/arrayTypeSchema/index.js +1 -0
- package/build/legacy/jsonSchemaForm/basicTypeSchema/BasicTypeSchema.js +111 -0
- package/build/legacy/jsonSchemaForm/basicTypeSchema/index.js +1 -0
- package/build/legacy/jsonSchemaForm/controlFeedback/ControlFeedback.js +86 -0
- package/build/legacy/jsonSchemaForm/controlFeedback/index.js +1 -0
- package/build/legacy/jsonSchemaForm/help/Help.js +20 -0
- package/build/legacy/jsonSchemaForm/help/index.js +1 -0
- package/build/legacy/jsonSchemaForm/objectSchema/ObjectSchema.js +77 -0
- package/build/legacy/jsonSchemaForm/objectSchema/index.js +1 -0
- package/build/legacy/jsonSchemaForm/oneOfSchema/OneOfSchema.js +155 -0
- package/build/legacy/jsonSchemaForm/oneOfSchema/index.js +1 -0
- package/build/legacy/jsonSchemaForm/oneOfSchema/utils.js +68 -0
- package/build/legacy/jsonSchemaForm/persistAsyncSchema/PersistAsyncSchema.js +26 -0
- package/build/legacy/jsonSchemaForm/persistAsyncSchema/index.js +1 -0
- package/build/legacy/jsonSchemaForm/persistAsyncSchema/persistAsyncBasicSchema/PersistAsyncBasicSchema.js +165 -0
- package/build/legacy/jsonSchemaForm/persistAsyncSchema/persistAsyncBasicSchema/index.js +1 -0
- package/build/legacy/jsonSchemaForm/persistAsyncSchema/persistAsyncBlobSchema/PersistAsyncBlobSchema.js +131 -0
- package/build/legacy/jsonSchemaForm/persistAsyncSchema/persistAsyncBlobSchema/UploadInputAdapter.js +31 -0
- package/build/legacy/jsonSchemaForm/persistAsyncSchema/persistAsyncBlobSchema/index.js +1 -0
- package/build/legacy/jsonSchemaForm/promotedOneOfSchema/PromotedOneOfSchema.js +72 -0
- package/build/legacy/jsonSchemaForm/promotedOneOfSchema/index.js +1 -0
- package/build/legacy/jsonSchemaForm/promotedOneOfSchema/promoted-one-of-utils.js +8 -0
- package/build/legacy/jsonSchemaForm/promotedOneOfSchema/promotedOneOfControl/PromotedOneOfCheckboxControl.js +27 -0
- package/build/legacy/jsonSchemaForm/promotedOneOfSchema/promotedOneOfControl/PromotedOneOfControl.js +31 -0
- package/build/legacy/jsonSchemaForm/promotedOneOfSchema/promotedOneOfControl/PromotedOneOfRadioControl.js +32 -0
- package/build/legacy/jsonSchemaForm/readOnlySchema/ReadOnlySchema.js +54 -0
- package/build/legacy/jsonSchemaForm/readOnlySchema/ReadOnlySchema.messages.js +13 -0
- package/build/legacy/jsonSchemaForm/readOnlySchema/index.js +1 -0
- package/build/legacy/jsonSchemaForm/schemaFormControl/SchemaFormControl.js +133 -0
- package/build/legacy/jsonSchemaForm/schemaFormControl/index.js +1 -0
- package/build/legacy/jsonSchemaForm/schemaFormControl/utils/index.js +1 -0
- package/build/legacy/jsonSchemaForm/schemaFormControl/utils/mapping-utils.js +107 -0
- package/build/legacy/layout/DynamicLayout.js +68 -0
- package/build/legacy/layout/alert/DynamicAlert.js +29 -0
- package/build/legacy/layout/box/DynamicBox.js +41 -0
- package/build/legacy/layout/button/DynamicButton.js +27 -0
- package/build/legacy/layout/button/utils.js +45 -0
- package/build/legacy/layout/columns/DynamicColumns.js +38 -0
- package/build/legacy/layout/decision/DynamicDecision.js +21 -0
- package/build/legacy/layout/divider/DynamicDivider.js +9 -0
- package/build/legacy/layout/external/DynamicExternal.js +32 -0
- package/build/legacy/layout/external/DynamicExternal.messages.js +8 -0
- package/build/legacy/layout/form/DynamicForm.js +22 -0
- package/build/legacy/layout/heading/DynamicHeading.js +51 -0
- package/build/legacy/layout/icon/DynamicIcon.js +17 -0
- package/build/legacy/layout/icon/FlagIcon.js +198 -0
- package/build/legacy/layout/icon/NamedIcon.js +19 -0
- package/build/legacy/layout/image/DynamicImage.js +111 -0
- package/build/legacy/layout/index.js +20 -0
- package/build/legacy/layout/instructions/DynamicInstructions.js +30 -0
- package/build/legacy/layout/list/DynamicStatusList.js +37 -0
- package/build/legacy/layout/loadingIndicator/DynamicLoadingIndicator.js +11 -0
- package/build/legacy/layout/markdown/DynamicMarkdown.js +23 -0
- package/build/legacy/layout/modal/DynamicModal.js +26 -0
- package/build/legacy/layout/paragraph/DynamicParagraph.js +46 -0
- package/build/legacy/layout/paragraph/useSnackBarIfAvailable.js +9 -0
- package/build/legacy/layout/review/DynamicReview.js +58 -0
- package/build/legacy/layout/search/DynamicSearch.js +58 -0
- package/build/legacy/layout/search/SearchInput.js +17 -0
- package/build/legacy/layout/search/SearchResults.js +31 -0
- package/build/legacy/layout/search/useSearch.js +137 -0
- package/build/legacy/layout/utils/getNavigationOptionMedia.js +28 -0
- package/build/legacy/layout/utils/index.js +32 -0
- package/build/legacy/step/cameraStep/CameraStep.js +124 -0
- package/build/legacy/step/cameraStep/cameraCapture/CameraCapture.js +161 -0
- package/build/legacy/step/cameraStep/cameraCapture/CameraCapture.messages.js +58 -0
- package/build/legacy/step/cameraStep/cameraCapture/components/bottomBar/BottomBar.js +28 -0
- package/build/legacy/step/cameraStep/cameraCapture/components/index.js +3 -0
- package/build/legacy/step/cameraStep/cameraCapture/components/orientationLockOverlay/OrientationLockOverlay.js +19 -0
- package/build/legacy/step/cameraStep/cameraCapture/components/orientationLockOverlay/OrientationLockOverlay.messages.js +8 -0
- package/build/legacy/step/cameraStep/cameraCapture/hooks/useFullScreenOrientationLock.js +60 -0
- package/build/legacy/step/cameraStep/cameraCapture/hooks/useVideoConstraints.js +80 -0
- package/build/legacy/step/cameraStep/cameraCapture/index.js +1 -0
- package/build/legacy/step/cameraStep/cameraCapture/overlay/Overlay.js +77 -0
- package/build/legacy/step/cameraStep/cameraCapture/screens/cameraErrorScreen/CameraErrorScreen.js +18 -0
- package/build/legacy/step/cameraStep/cameraCapture/screens/index.js +1 -0
- package/build/legacy/step/cameraStep/cameraCapture/tracking/index.js +109 -0
- package/build/legacy/step/cameraStep/cameraCapture/types/index.js +7 -0
- package/build/legacy/step/cameraStep/cameraCapture/utils/index.js +107 -0
- package/build/legacy/step/cameraStep/index.js +1 -0
- package/build/legacy/step/externalConfirmationStep/ExternalConfirmationStep.js +64 -0
- package/build/legacy/step/externalConfirmationStep/ExternalConfirmationStep.messages.js +23 -0
- package/build/legacy/step/externalConfirmationStep/index.js +1 -0
- package/build/legacy/step/index.js +3 -0
- package/build/legacy/step/layoutStep/LayoutStep.js +33 -0
- package/build/legacy/step/layoutStep/index.js +1 -0
- package/build/legacy/step/layoutStep/utils/index.js +2 -0
- package/build/legacy/step/layoutStep/utils/inline-reference-utils.js +105 -0
- package/build/legacy/step/layoutStep/utils/layout-utils.js +212 -0
- package/build/main.js +13 -28
- package/build/main.min.js +1 -1
- package/build/main.mjs +13 -28
- package/build/types/revamp/domain/features/events.d.ts +1 -1
- package/package.json +2 -2
package/build/main.mjs
CHANGED
|
@@ -13973,13 +13973,13 @@ function DynamicFlowCore(props) {
|
|
|
13973
13973
|
return abortControllerRef.current.signal;
|
|
13974
13974
|
};
|
|
13975
13975
|
useEffect23(() => {
|
|
13976
|
-
trackEvent("
|
|
13976
|
+
trackEvent("Initiated");
|
|
13977
13977
|
if (!initialStep && initialAction) {
|
|
13978
13978
|
void onAction(initialAction);
|
|
13979
13979
|
}
|
|
13980
13980
|
if (initialStep && !initialAction) {
|
|
13981
13981
|
initialiseWithStep(initialStep, null);
|
|
13982
|
-
trackEvent("Step Shown");
|
|
13982
|
+
trackEvent("Step Shown", { isFirstStep: true });
|
|
13983
13983
|
}
|
|
13984
13984
|
}, []);
|
|
13985
13985
|
const initialiseWithStep = useCallback11(
|
|
@@ -14051,14 +14051,14 @@ function DynamicFlowCore(props) {
|
|
|
14051
14051
|
);
|
|
14052
14052
|
const closeWithError = useCallback11(
|
|
14053
14053
|
(error, analytics) => {
|
|
14054
|
-
trackEvent("
|
|
14054
|
+
trackEvent("Failed", __spreadValues({}, analytics));
|
|
14055
14055
|
onError(error);
|
|
14056
14056
|
},
|
|
14057
14057
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
14058
14058
|
[]
|
|
14059
14059
|
);
|
|
14060
14060
|
const onAction = useCallback11(async (action) => {
|
|
14061
|
-
var _a2, _b, _c, _d
|
|
14061
|
+
var _a2, _b, _c, _d;
|
|
14062
14062
|
try {
|
|
14063
14063
|
(_a2 = stepComponentRef.current) == null ? void 0 : _a2.setLoadingState("loading");
|
|
14064
14064
|
const model = (_c = await ((_b = stepComponentRef.current) == null ? void 0 : _b.getSubmittableValue())) != null ? _c : null;
|
|
@@ -14073,12 +14073,13 @@ function DynamicFlowCore(props) {
|
|
|
14073
14073
|
switch (command.type) {
|
|
14074
14074
|
case "complete": {
|
|
14075
14075
|
onCompletion(command.result);
|
|
14076
|
-
trackEvent("
|
|
14076
|
+
trackEvent("Succeeded");
|
|
14077
14077
|
break;
|
|
14078
14078
|
}
|
|
14079
14079
|
case "replace-step": {
|
|
14080
|
+
const isFirstStep = stepRef.current === null;
|
|
14080
14081
|
initialiseWithStep(command.step, command.etag);
|
|
14081
|
-
trackEvent("Step Shown");
|
|
14082
|
+
trackEvent("Step Shown", { isFirstStep });
|
|
14082
14083
|
break;
|
|
14083
14084
|
}
|
|
14084
14085
|
case "error": {
|
|
@@ -14093,26 +14094,7 @@ function DynamicFlowCore(props) {
|
|
|
14093
14094
|
}
|
|
14094
14095
|
case "refresh": {
|
|
14095
14096
|
const { refreshUrl, errors = {} } = command.body;
|
|
14096
|
-
|
|
14097
|
-
(_e = stepComponentRef.current) == null ? void 0 : _e.setLoadingState("loading");
|
|
14098
|
-
const refreshCommand = await executeRefresh({
|
|
14099
|
-
abortSignal: abortCurrentAndGetNewAbortSignal(),
|
|
14100
|
-
url: refreshUrl,
|
|
14101
|
-
model,
|
|
14102
|
-
etag: etagRef.current,
|
|
14103
|
-
httpClient,
|
|
14104
|
-
trackEvent
|
|
14105
|
-
});
|
|
14106
|
-
switch (refreshCommand.type) {
|
|
14107
|
-
case "refresh-step":
|
|
14108
|
-
initialiseWithStep(__spreadProps(__spreadValues({}, refreshCommand.step), { errors }), refreshCommand.etag);
|
|
14109
|
-
break;
|
|
14110
|
-
default:
|
|
14111
|
-
throw new Error("Failed to refresh");
|
|
14112
|
-
}
|
|
14113
|
-
} catch (e) {
|
|
14114
|
-
closeWithError(e, {});
|
|
14115
|
-
}
|
|
14097
|
+
void onRefresh(void 0, refreshUrl, errors);
|
|
14116
14098
|
break;
|
|
14117
14099
|
}
|
|
14118
14100
|
}
|
|
@@ -14121,7 +14103,7 @@ function DynamicFlowCore(props) {
|
|
|
14121
14103
|
}
|
|
14122
14104
|
}, []);
|
|
14123
14105
|
const onRefresh = useCallback11(
|
|
14124
|
-
async (schemaId, refreshUrl = "") => {
|
|
14106
|
+
async (schemaId, refreshUrl = "", errorsOverride) => {
|
|
14125
14107
|
var _a2, _b, _c, _d;
|
|
14126
14108
|
try {
|
|
14127
14109
|
(_a2 = stepComponentRef.current) == null ? void 0 : _a2.setLoadingState("loading");
|
|
@@ -14137,7 +14119,10 @@ function DynamicFlowCore(props) {
|
|
|
14137
14119
|
});
|
|
14138
14120
|
switch (command.type) {
|
|
14139
14121
|
case "refresh-step":
|
|
14140
|
-
|
|
14122
|
+
{
|
|
14123
|
+
const errors = errorsOverride != null ? errorsOverride : command.step.errors;
|
|
14124
|
+
initialiseWithStep(__spreadProps(__spreadValues({}, command.step), { errors }), command.etag);
|
|
14125
|
+
}
|
|
14141
14126
|
break;
|
|
14142
14127
|
case "error": {
|
|
14143
14128
|
closeWithError(new Error("Failed to refresh"), command.body.analytics);
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
export type AnalyticsEventHandler = (eventName: string, properties?: Record<string, unknown>) => void;
|
|
2
2
|
export type AnalyticsEventDispatcher = (eventName: EventName, properties?: Record<string, unknown>) => void;
|
|
3
|
-
export type EventName = '
|
|
3
|
+
export type EventName = 'Initiated' | 'Succeeded' | 'Failed' | 'Step Shown' | 'Action Triggered' | 'Action Succeeded' | 'Action Aborted' | 'Action Failed' | 'Refresh Triggered' | 'Refresh Succeeded' | 'Refresh Aborted' | 'Refresh Failed' | 'OneOf Selected' | 'PersistAsync Triggered' | 'PersistAsync Succeeded' | 'PersistAsync Failed' | 'ValidationAsync Triggered' | 'ValidationAsync Succeeded' | 'ValidationAsync Failed' | 'Search Started' | 'Search Result Selected';
|
|
4
4
|
export type LogLevel = 'info' | 'warning' | 'error';
|
|
5
5
|
export type LoggingEventHandler = (level: LogLevel, message: string, extra: Record<string, unknown>) => void;
|
|
6
6
|
export type LoggingEventDispatcher = (level: LogLevel, message: string, extra?: Record<string, unknown>) => void;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@wise/dynamic-flow-client",
|
|
3
|
-
"version": "3.
|
|
3
|
+
"version": "3.4.0-experimental-ed080a1",
|
|
4
4
|
"description": "Dynamic Flow web client",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"main": "./build/main.min.js",
|
|
@@ -92,7 +92,7 @@
|
|
|
92
92
|
"classnames": "2.5.1",
|
|
93
93
|
"react-webcam": "^7.2.0",
|
|
94
94
|
"screenfull": "^5.2.0",
|
|
95
|
-
"@wise/dynamic-flow-types": "2.
|
|
95
|
+
"@wise/dynamic-flow-types": "2.11.0-experimental-ed080a1"
|
|
96
96
|
},
|
|
97
97
|
"scripts": {
|
|
98
98
|
"dev": "storybook dev -p 3003",
|