@wise/dynamic-flow-client 4.3.2 → 4.3.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.
- package/build/main.js +7 -0
- package/build/main.mjs +52 -45
- package/package.json +1 -1
package/build/main.js
CHANGED
|
@@ -6624,6 +6624,7 @@ function useDynamicFlowCore(props) {
|
|
|
6624
6624
|
);
|
|
6625
6625
|
const closeWithError = (0, import_react3.useCallback)(
|
|
6626
6626
|
(error, analytics, statusCode) => {
|
|
6627
|
+
rootComponentRef.current.stop();
|
|
6627
6628
|
trackCoreEvent("Failed", __spreadValues({}, analytics));
|
|
6628
6629
|
onError(error, statusCode);
|
|
6629
6630
|
},
|
|
@@ -6645,6 +6646,7 @@ function useDynamicFlowCore(props) {
|
|
|
6645
6646
|
switch (command.type) {
|
|
6646
6647
|
case "complete": {
|
|
6647
6648
|
onCompletion(command.result);
|
|
6649
|
+
rootComponentRef.current.stop();
|
|
6648
6650
|
trackCoreEvent("Succeeded");
|
|
6649
6651
|
break;
|
|
6650
6652
|
}
|
|
@@ -6774,6 +6776,11 @@ function DynamicFlowCore(props) {
|
|
|
6774
6776
|
},
|
|
6775
6777
|
stepLoadingState: rootComponent.getLoadingState()
|
|
6776
6778
|
});
|
|
6779
|
+
(0, import_react4.useEffect)(() => {
|
|
6780
|
+
return () => {
|
|
6781
|
+
rootComponent.stop();
|
|
6782
|
+
};
|
|
6783
|
+
}, []);
|
|
6777
6784
|
return /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
|
|
6778
6785
|
ErrorBoundary_default,
|
|
6779
6786
|
{
|
package/build/main.mjs
CHANGED
|
@@ -925,7 +925,7 @@ var translations = {
|
|
|
925
925
|
var i18n_default = translations;
|
|
926
926
|
|
|
927
927
|
// src/revamp/DynamicFlowCore.tsx
|
|
928
|
-
import { useMemo as useMemo2 } from "react";
|
|
928
|
+
import { useEffect as useEffect2, useMemo as useMemo2 } from "react";
|
|
929
929
|
|
|
930
930
|
// src/common/errorBoundary/ErrorBoundary.tsx
|
|
931
931
|
import { Component } from "react";
|
|
@@ -6581,6 +6581,7 @@ function useDynamicFlowCore(props) {
|
|
|
6581
6581
|
);
|
|
6582
6582
|
const closeWithError = useCallback2(
|
|
6583
6583
|
(error, analytics, statusCode) => {
|
|
6584
|
+
rootComponentRef.current.stop();
|
|
6584
6585
|
trackCoreEvent("Failed", __spreadValues({}, analytics));
|
|
6585
6586
|
onError(error, statusCode);
|
|
6586
6587
|
},
|
|
@@ -6602,6 +6603,7 @@ function useDynamicFlowCore(props) {
|
|
|
6602
6603
|
switch (command.type) {
|
|
6603
6604
|
case "complete": {
|
|
6604
6605
|
onCompletion(command.result);
|
|
6606
|
+
rootComponentRef.current.stop();
|
|
6605
6607
|
trackCoreEvent("Succeeded");
|
|
6606
6608
|
break;
|
|
6607
6609
|
}
|
|
@@ -6731,6 +6733,11 @@ function DynamicFlowCore(props) {
|
|
|
6731
6733
|
},
|
|
6732
6734
|
stepLoadingState: rootComponent.getLoadingState()
|
|
6733
6735
|
});
|
|
6736
|
+
useEffect2(() => {
|
|
6737
|
+
return () => {
|
|
6738
|
+
rootComponent.stop();
|
|
6739
|
+
};
|
|
6740
|
+
}, []);
|
|
6734
6741
|
return /* @__PURE__ */ jsx6(
|
|
6735
6742
|
ErrorBoundary_default,
|
|
6736
6743
|
{
|
|
@@ -7111,7 +7118,7 @@ function isReference(block) {
|
|
|
7111
7118
|
}
|
|
7112
7119
|
|
|
7113
7120
|
// src/legacy/dynamicFlow/DynamicFlow.tsx
|
|
7114
|
-
import { useCallback as useCallback11, useEffect as
|
|
7121
|
+
import { useCallback as useCallback11, useEffect as useEffect22, useMemo as useMemo21, useState as useState26 } from "react";
|
|
7115
7122
|
import { useIntl as useIntl23 } from "react-intl";
|
|
7116
7123
|
|
|
7117
7124
|
// src/legacy/common/contexts/dynamicFlowContexts/DynamicFlowContexts.tsx
|
|
@@ -7968,12 +7975,12 @@ function useDebouncedFunction(callback, waitMs) {
|
|
|
7968
7975
|
}
|
|
7969
7976
|
|
|
7970
7977
|
// src/legacy/common/hooks/useExternal/useExternal.tsx
|
|
7971
|
-
import { useEffect as
|
|
7978
|
+
import { useEffect as useEffect3, useState as useState3 } from "react";
|
|
7972
7979
|
function useExternal(url) {
|
|
7973
7980
|
const [externalWindow, setExternalWindow] = useState3(null);
|
|
7974
7981
|
const [hasManuallyTriggered, setHasManuallyTriggered] = useState3(false);
|
|
7975
7982
|
const dismissConfirmation = () => setHasManuallyTriggered(true);
|
|
7976
|
-
|
|
7983
|
+
useEffect3(() => {
|
|
7977
7984
|
if (url) {
|
|
7978
7985
|
setHasManuallyTriggered(false);
|
|
7979
7986
|
setExternalWindow(window.open(url, "_blank"));
|
|
@@ -8046,7 +8053,7 @@ import { useState as useState20 } from "react";
|
|
|
8046
8053
|
import { useIntl as useIntl17 } from "react-intl";
|
|
8047
8054
|
|
|
8048
8055
|
// src/legacy/jsonSchemaForm/persistAsyncSchema/persistAsyncBasicSchema/PersistAsyncBasicSchema.tsx
|
|
8049
|
-
import { useEffect as
|
|
8056
|
+
import { useEffect as useEffect14, useState as useState19 } from "react";
|
|
8050
8057
|
import { useIntl as useIntl16 } from "react-intl";
|
|
8051
8058
|
|
|
8052
8059
|
// src/legacy/common/constants/DateMode.ts
|
|
@@ -8095,7 +8102,7 @@ var Size = {
|
|
|
8095
8102
|
|
|
8096
8103
|
// src/legacy/jsonSchemaForm/basicTypeSchema/BasicTypeSchema.tsx
|
|
8097
8104
|
import classNames10 from "classnames";
|
|
8098
|
-
import { useEffect as
|
|
8105
|
+
import { useEffect as useEffect13, useMemo as useMemo16, useState as useState18 } from "react";
|
|
8099
8106
|
|
|
8100
8107
|
// src/legacy/layout/alert/DynamicAlert.tsx
|
|
8101
8108
|
import { Alert as Alert2 } from "@transferwise/components";
|
|
@@ -8562,7 +8569,7 @@ var DynamicDivider_default = DynamicDivider;
|
|
|
8562
8569
|
|
|
8563
8570
|
// src/legacy/layout/external/DynamicExternal.tsx
|
|
8564
8571
|
import { Button as Button2, Loader, Size as Size2 } from "@transferwise/components";
|
|
8565
|
-
import { useCallback as useCallback6, useEffect as
|
|
8572
|
+
import { useCallback as useCallback6, useEffect as useEffect4, useMemo as useMemo9 } from "react";
|
|
8566
8573
|
import { useIntl as useIntl3 } from "react-intl";
|
|
8567
8574
|
|
|
8568
8575
|
// src/legacy/layout/external/DynamicExternal.messages.ts
|
|
@@ -8584,7 +8591,7 @@ var DynamicExternal = ({ component, onAction }) => {
|
|
|
8584
8591
|
() => window.open(requestUrl, "df-external-window"),
|
|
8585
8592
|
[requestUrl]
|
|
8586
8593
|
);
|
|
8587
|
-
|
|
8594
|
+
useEffect4(() => {
|
|
8588
8595
|
openExternalUrl();
|
|
8589
8596
|
}, [openExternalUrl]);
|
|
8590
8597
|
const pollingConfiguration = useMemo9(() => {
|
|
@@ -8602,7 +8609,7 @@ var DynamicExternal = ({ component, onAction }) => {
|
|
|
8602
8609
|
var DynamicExternal_default = DynamicExternal;
|
|
8603
8610
|
|
|
8604
8611
|
// src/legacy/jsonSchemaForm/genericSchema/GenericSchema.tsx
|
|
8605
|
-
import { useEffect as
|
|
8612
|
+
import { useEffect as useEffect11 } from "react";
|
|
8606
8613
|
|
|
8607
8614
|
// src/legacy/jsonSchemaForm/allOfSchema/AllOfSchema.tsx
|
|
8608
8615
|
import { Header as Header2 } from "@transferwise/components";
|
|
@@ -8895,7 +8902,7 @@ function getValidationMessages(schema, required, defaultErrorMessages) {
|
|
|
8895
8902
|
// src/legacy/jsonSchemaForm/arrayTypeSchema/arrayListSchema/multiSelectSchema/MultiSelectSchema.tsx
|
|
8896
8903
|
import { SelectInput, SelectInputOptionContent } from "@transferwise/components";
|
|
8897
8904
|
import classNames3 from "classnames";
|
|
8898
|
-
import { useEffect as
|
|
8905
|
+
import { useEffect as useEffect5, useMemo as useMemo11, useState as useState6 } from "react";
|
|
8899
8906
|
import { useIntl as useIntl6 } from "react-intl";
|
|
8900
8907
|
|
|
8901
8908
|
// src/legacy/jsonSchemaForm/schemaFormControl/utils/mapping-utils.tsx
|
|
@@ -9016,7 +9023,7 @@ function MultiSelectSchema({
|
|
|
9016
9023
|
const id = useMemo11(() => schema.$id || generateRandomId(), [schema.$id]);
|
|
9017
9024
|
const [changed, setChanged] = useState6(false);
|
|
9018
9025
|
const [selected, setSelected] = useState6(getInitialModelIndices2(model, options));
|
|
9019
|
-
|
|
9026
|
+
useEffect5(
|
|
9020
9027
|
() => {
|
|
9021
9028
|
if (selected) {
|
|
9022
9029
|
broadcastModelChange(selected);
|
|
@@ -9604,7 +9611,7 @@ var ArraySchema_default = ArraySchema;
|
|
|
9604
9611
|
// src/legacy/jsonSchemaForm/objectSchema/ObjectSchema.tsx
|
|
9605
9612
|
import { Header as Header4 } from "@transferwise/components";
|
|
9606
9613
|
import classNames5 from "classnames";
|
|
9607
|
-
import { useState as useState9, useEffect as
|
|
9614
|
+
import { useState as useState9, useEffect as useEffect6 } from "react";
|
|
9608
9615
|
import { Fragment as Fragment6, jsx as jsx33, jsxs as jsxs10 } from "react/jsx-runtime";
|
|
9609
9616
|
var getSchemaColumnClasses2 = (width) => ({
|
|
9610
9617
|
"col-xs-12": true,
|
|
@@ -9624,7 +9631,7 @@ function ObjectSchema(props) {
|
|
|
9624
9631
|
props.onChange(__spreadProps(__spreadValues({}, onChangeProps), { model }));
|
|
9625
9632
|
};
|
|
9626
9633
|
const isRequired = (propertyName) => props.schema.required && props.schema.required.includes(propertyName);
|
|
9627
|
-
|
|
9634
|
+
useEffect6(() => {
|
|
9628
9635
|
const newModel = getValidObjectModelParts(model, props.schema) || {};
|
|
9629
9636
|
setModel(newModel);
|
|
9630
9637
|
if (!isEqual(newModel, model)) {
|
|
@@ -9681,7 +9688,7 @@ var ObjectSchema_default = ObjectSchema;
|
|
|
9681
9688
|
// src/legacy/jsonSchemaForm/oneOfSchema/OneOfSchema.tsx
|
|
9682
9689
|
import { Header as Header5 } from "@transferwise/components";
|
|
9683
9690
|
import classNames6 from "classnames";
|
|
9684
|
-
import { useEffect as
|
|
9691
|
+
import { useEffect as useEffect8, useMemo as useMemo13, useState as useState10 } from "react";
|
|
9685
9692
|
|
|
9686
9693
|
// src/legacy/jsonSchemaForm/help/Help.tsx
|
|
9687
9694
|
import { Markdown, Info } from "@transferwise/components";
|
|
@@ -9715,7 +9722,7 @@ function Help(props) {
|
|
|
9715
9722
|
var Help_default = Help;
|
|
9716
9723
|
|
|
9717
9724
|
// src/legacy/jsonSchemaForm/schemaFormControl/SchemaFormControl.tsx
|
|
9718
|
-
import { useEffect as
|
|
9725
|
+
import { useEffect as useEffect7 } from "react";
|
|
9719
9726
|
import { useIntl as useIntl10 } from "react-intl";
|
|
9720
9727
|
|
|
9721
9728
|
// src/legacy/formControl/FormControl.tsx
|
|
@@ -10437,7 +10444,7 @@ function SchemaFormControl(props) {
|
|
|
10437
10444
|
onChange(getValidBasicModelOrNull(value2, schema), type, metadata);
|
|
10438
10445
|
};
|
|
10439
10446
|
const controlType = getControlType(schema);
|
|
10440
|
-
|
|
10447
|
+
useEffect7(() => {
|
|
10441
10448
|
warnIfInvalidSchema(schema, log, controlType);
|
|
10442
10449
|
}, [JSON.stringify(schema), log, controlType]);
|
|
10443
10450
|
const options = schema.values || getOptions(schema, controlType);
|
|
@@ -10509,7 +10516,7 @@ function OneOfSchema(props) {
|
|
|
10509
10516
|
searchValueLength: searchValue.length
|
|
10510
10517
|
});
|
|
10511
10518
|
};
|
|
10512
|
-
|
|
10519
|
+
useEffect8(() => {
|
|
10513
10520
|
const modelIndex = getValidIndexFromValue(props.schema, props.model);
|
|
10514
10521
|
const defaultIndex = getValidIndexFromValue(props.schema, props.schema.default);
|
|
10515
10522
|
if (modelIndex === -1 && defaultIndex >= 0) {
|
|
@@ -10667,7 +10674,7 @@ var OneOfSchema_default = OneOfSchema;
|
|
|
10667
10674
|
|
|
10668
10675
|
// src/legacy/jsonSchemaForm/persistAsyncSchema/persistAsyncBlobSchema/PersistAsyncBlobSchema.tsx
|
|
10669
10676
|
import classNames7 from "classnames";
|
|
10670
|
-
import { useEffect as
|
|
10677
|
+
import { useEffect as useEffect9, useState as useState11 } from "react";
|
|
10671
10678
|
import { useIntl as useIntl11 } from "react-intl";
|
|
10672
10679
|
|
|
10673
10680
|
// src/legacy/jsonSchemaForm/persistAsyncSchema/persistAsyncBlobSchema/UploadInputAdapter.tsx
|
|
@@ -10738,7 +10745,7 @@ function PersistAsyncBlobSchema(props) {
|
|
|
10738
10745
|
const intl = useIntl11();
|
|
10739
10746
|
const httpClient = useHttpClient();
|
|
10740
10747
|
const onEvent = useEventDispatcher();
|
|
10741
|
-
|
|
10748
|
+
useEffect9(() => {
|
|
10742
10749
|
if (submitted) {
|
|
10743
10750
|
setValidations(getValidationFailures(model, schema, Boolean(required)));
|
|
10744
10751
|
} else {
|
|
@@ -11042,7 +11049,7 @@ function getValueFromOption(option) {
|
|
|
11042
11049
|
}
|
|
11043
11050
|
|
|
11044
11051
|
// src/legacy/jsonSchemaForm/validationAsyncSchema/ValidationAsyncSchema.tsx
|
|
11045
|
-
import { useEffect as
|
|
11052
|
+
import { useEffect as useEffect10, useRef as useRef3, useState as useState13 } from "react";
|
|
11046
11053
|
import { jsx as jsx46 } from "react/jsx-runtime";
|
|
11047
11054
|
function ValidationAsyncSchema(props) {
|
|
11048
11055
|
const { schema, model, required = false, submitted, errors, onChange } = props;
|
|
@@ -11057,7 +11064,7 @@ function ValidationAsyncSchema(props) {
|
|
|
11057
11064
|
const httpClient = useHttpClient();
|
|
11058
11065
|
const onEvent = useEventDispatcher();
|
|
11059
11066
|
const log = useLogger();
|
|
11060
|
-
|
|
11067
|
+
useEffect10(() => {
|
|
11061
11068
|
if (!schema.validationAsync.method) {
|
|
11062
11069
|
log.warning(
|
|
11063
11070
|
"Invalid schema or model",
|
|
@@ -11139,7 +11146,7 @@ function GenericSchemaForm(props) {
|
|
|
11139
11146
|
const schemaProps = __spreadProps(__spreadValues({}, props), { model, errors, hideTitle, disabled });
|
|
11140
11147
|
const type = getSchemaType(schema);
|
|
11141
11148
|
const log = useLogger();
|
|
11142
|
-
|
|
11149
|
+
useEffect11(() => {
|
|
11143
11150
|
if (!isValidGenericSchema(schema, model, errors)) {
|
|
11144
11151
|
log.error(
|
|
11145
11152
|
"Invalid schema or model",
|
|
@@ -11276,14 +11283,14 @@ var DynamicInfo = ({ component }) => {
|
|
|
11276
11283
|
|
|
11277
11284
|
// src/legacy/layout/image/DynamicImage.tsx
|
|
11278
11285
|
import { Image } from "@transferwise/components";
|
|
11279
|
-
import { useEffect as
|
|
11286
|
+
import { useEffect as useEffect12, useState as useState14 } from "react";
|
|
11280
11287
|
import { jsx as jsx51 } from "react/jsx-runtime";
|
|
11281
11288
|
function DynamicImage({ component: image }) {
|
|
11282
11289
|
var _a, _b, _c;
|
|
11283
11290
|
const { content, url, size, text, margin, accessibilityDescription } = image;
|
|
11284
11291
|
const httpClient = useHttpClient();
|
|
11285
11292
|
const [imageSource, setImageSource] = useState14("");
|
|
11286
|
-
|
|
11293
|
+
useEffect12(() => {
|
|
11287
11294
|
if (content) {
|
|
11288
11295
|
const { uri, url: contentUrl } = content;
|
|
11289
11296
|
if (uri && !uri.startsWith("urn:")) {
|
|
@@ -12084,9 +12091,9 @@ var BasicTypeSchema = (props) => {
|
|
|
12084
12091
|
};
|
|
12085
12092
|
const isConst = props.schema.const;
|
|
12086
12093
|
const isHidden = props.schema.hidden || isConst;
|
|
12087
|
-
|
|
12088
|
-
|
|
12089
|
-
|
|
12094
|
+
useEffect13(refreshValidations, [props.model, props.submitted]);
|
|
12095
|
+
useEffect13(onSchemaChange, [props.schema]);
|
|
12096
|
+
useEffect13(() => {
|
|
12090
12097
|
var _a2;
|
|
12091
12098
|
const newModel = (_a2 = props.model) != null ? _a2 : null;
|
|
12092
12099
|
if (newModel !== model) {
|
|
@@ -12167,7 +12174,7 @@ function PersistAsyncBasicSchema(props) {
|
|
|
12167
12174
|
const [persistAsyncError, setPersistAsyncError] = useState19(null);
|
|
12168
12175
|
const [fieldSubmitted, setFieldSubmitted] = useState19(false);
|
|
12169
12176
|
const [abortController, setAbortController] = useState19(null);
|
|
12170
|
-
|
|
12177
|
+
useEffect14(() => {
|
|
12171
12178
|
if (controlTypesWithPersistOnChange.has(
|
|
12172
12179
|
// TODO: LOW avoid type assertion below -- control type may be nullish. consider ?? ''
|
|
12173
12180
|
getControlType(schema.persistAsync.schema)
|
|
@@ -12329,7 +12336,7 @@ function hasStringMessage(value) {
|
|
|
12329
12336
|
}
|
|
12330
12337
|
|
|
12331
12338
|
// src/legacy/common/hooks/usePolling/usePolling.tsx
|
|
12332
|
-
import { useEffect as
|
|
12339
|
+
import { useEffect as useEffect15, useMemo as useMemo17, useRef as useRef5 } from "react";
|
|
12333
12340
|
function usePolling({
|
|
12334
12341
|
asyncFn,
|
|
12335
12342
|
delay,
|
|
@@ -12350,7 +12357,7 @@ function usePolling({
|
|
|
12350
12357
|
),
|
|
12351
12358
|
[asyncFn, maxAttempts, maxConsecutiveFails]
|
|
12352
12359
|
);
|
|
12353
|
-
|
|
12360
|
+
useEffect15(() => {
|
|
12354
12361
|
if (delay > 0) {
|
|
12355
12362
|
poll();
|
|
12356
12363
|
const intervalReference = setInterval(() => {
|
|
@@ -12359,7 +12366,7 @@ function usePolling({
|
|
|
12359
12366
|
return () => clearInterval(intervalReference);
|
|
12360
12367
|
}
|
|
12361
12368
|
}, [poll, delay]);
|
|
12362
|
-
|
|
12369
|
+
useEffect15(() => {
|
|
12363
12370
|
onPollingResponseReference.current = onPollingResponse;
|
|
12364
12371
|
onFailureReference.current = onFailure;
|
|
12365
12372
|
}, [onPollingResponse, onFailure]);
|
|
@@ -12390,10 +12397,10 @@ function createPollingClosure(asyncFn, maxAttempts, maxConsecutiveFails, onPolli
|
|
|
12390
12397
|
}
|
|
12391
12398
|
|
|
12392
12399
|
// src/legacy/common/hooks/usePrevious/usePrevious.js
|
|
12393
|
-
import { useEffect as
|
|
12400
|
+
import { useEffect as useEffect16, useRef as useRef6 } from "react";
|
|
12394
12401
|
var usePrevious = (value) => {
|
|
12395
12402
|
const reference = useRef6();
|
|
12396
|
-
|
|
12403
|
+
useEffect16(() => {
|
|
12397
12404
|
reference.current = value;
|
|
12398
12405
|
}, [value]);
|
|
12399
12406
|
return reference.current;
|
|
@@ -12487,10 +12494,10 @@ var LayoutStep = (props) => {
|
|
|
12487
12494
|
var LayoutStep_default = LayoutStep;
|
|
12488
12495
|
|
|
12489
12496
|
// src/legacy/step/cameraStep/CameraStep.tsx
|
|
12490
|
-
import { useEffect as
|
|
12497
|
+
import { useEffect as useEffect21, useState as useState23 } from "react";
|
|
12491
12498
|
|
|
12492
12499
|
// src/common/cameraCapture/CameraCapture.tsx
|
|
12493
|
-
import { useCallback as useCallback10, useEffect as
|
|
12500
|
+
import { useCallback as useCallback10, useEffect as useEffect20, useMemo as useMemo19, useRef as useRef8, useState as useState22 } from "react";
|
|
12494
12501
|
import { useIntl as useIntl20 } from "react-intl";
|
|
12495
12502
|
import Webcam from "react-webcam";
|
|
12496
12503
|
|
|
@@ -12635,7 +12642,7 @@ function OrientationLockOverlay() {
|
|
|
12635
12642
|
var OrientationLockOverlay_default = OrientationLockOverlay;
|
|
12636
12643
|
|
|
12637
12644
|
// src/common/cameraCapture/hooks/useFullScreenOrientationLock.ts
|
|
12638
|
-
import { useCallback as useCallback9, useEffect as
|
|
12645
|
+
import { useCallback as useCallback9, useEffect as useEffect17 } from "react";
|
|
12639
12646
|
import screenfull from "screenfull";
|
|
12640
12647
|
|
|
12641
12648
|
// src/common/cameraCapture/utils/index.ts
|
|
@@ -12752,7 +12759,7 @@ var useFullScreenOrientationLock = (shouldLockOrientation, onEvent) => {
|
|
|
12752
12759
|
},
|
|
12753
12760
|
[onEvent]
|
|
12754
12761
|
);
|
|
12755
|
-
|
|
12762
|
+
useEffect17(() => {
|
|
12756
12763
|
var _a, _b;
|
|
12757
12764
|
if (shouldLockOrientation) {
|
|
12758
12765
|
(_b = (_a = window.screen) == null ? void 0 : _a.orientation) == null ? void 0 : _b.addEventListener(
|
|
@@ -12775,10 +12782,10 @@ var noop5 = () => {
|
|
|
12775
12782
|
};
|
|
12776
12783
|
|
|
12777
12784
|
// src/common/cameraCapture/hooks/useVideoConstraints.ts
|
|
12778
|
-
import { useEffect as
|
|
12785
|
+
import { useEffect as useEffect18, useState as useState21 } from "react";
|
|
12779
12786
|
var useVideoConstraints = (direction) => {
|
|
12780
12787
|
const [videoConstraints, setVideoConstraints] = useState21();
|
|
12781
|
-
|
|
12788
|
+
useEffect18(() => {
|
|
12782
12789
|
void getVideoConstraints(direction).then(setVideoConstraints);
|
|
12783
12790
|
}, [direction]);
|
|
12784
12791
|
return { videoConstraints };
|
|
@@ -12803,7 +12810,7 @@ var getVideoConstraints = async (dir) => {
|
|
|
12803
12810
|
};
|
|
12804
12811
|
|
|
12805
12812
|
// src/common/cameraCapture/overlay/Overlay.tsx
|
|
12806
|
-
import { useEffect as
|
|
12813
|
+
import { useEffect as useEffect19, useRef as useRef7 } from "react";
|
|
12807
12814
|
import { Fragment as Fragment16, jsx as jsx67, jsxs as jsxs27 } from "react/jsx-runtime";
|
|
12808
12815
|
var captureButtonHeight = 92;
|
|
12809
12816
|
var reviewButtonsHeight = 120;
|
|
@@ -12814,7 +12821,7 @@ var reviewInstructionsHeight = 40;
|
|
|
12814
12821
|
var overlayMaxWidth = 800;
|
|
12815
12822
|
function Overlay({ overlay, outline, imageUrl, title, instructions, reviewInstructions }) {
|
|
12816
12823
|
const svgReference = useRef7(null);
|
|
12817
|
-
|
|
12824
|
+
useEffect19(() => {
|
|
12818
12825
|
const listener = debounce2(() => {
|
|
12819
12826
|
var _a;
|
|
12820
12827
|
if ((_a = svgReference.current) == null ? void 0 : _a.innerHTML) {
|
|
@@ -12983,7 +12990,7 @@ function CameraCapture({
|
|
|
12983
12990
|
setReviewImage(void 0);
|
|
12984
12991
|
};
|
|
12985
12992
|
const handleRetryCameraAccess = () => setMode("CAPTURE" /* CAPTURE */);
|
|
12986
|
-
|
|
12993
|
+
useEffect20(() => {
|
|
12987
12994
|
if (mode !== "CAPTURE" /* CAPTURE */) {
|
|
12988
12995
|
exitFullScreen();
|
|
12989
12996
|
}
|
|
@@ -13062,7 +13069,7 @@ function CameraStep(props) {
|
|
|
13062
13069
|
const { overlay, outline } = assets || {};
|
|
13063
13070
|
const { url: imageUrl } = image || {};
|
|
13064
13071
|
const [captureClicked, setCaptureClicked] = useState23(false);
|
|
13065
|
-
|
|
13072
|
+
useEffect21(() => {
|
|
13066
13073
|
if (captureClicked) {
|
|
13067
13074
|
onAction(action);
|
|
13068
13075
|
}
|
|
@@ -13669,10 +13676,10 @@ var DynamicFlowComponent = ({
|
|
|
13669
13676
|
},
|
|
13670
13677
|
[onCompletion, dispatchEvent]
|
|
13671
13678
|
);
|
|
13672
|
-
|
|
13679
|
+
useEffect22(() => {
|
|
13673
13680
|
dispatchEvent("Dynamic Flow - Flow Started", {});
|
|
13674
13681
|
}, []);
|
|
13675
|
-
|
|
13682
|
+
useEffect22(() => {
|
|
13676
13683
|
if (!initialStep) {
|
|
13677
13684
|
const action = __spreadValues({
|
|
13678
13685
|
id: "#initial-step-request",
|