@wise/dynamic-flow-client 2.7.1 → 2.8.1
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/README.md +42 -13
- package/build/i18n/en.json +4 -0
- package/build/i18n/pt.json +2 -2
- package/build/i18n/zh_CN.json +20 -20
- package/build/main.css +0 -20
- package/build/main.js +333 -296
- package/build/main.min.js +1 -1
- package/build/types/dynamic-flow-types.d.ts +1 -1
- package/build/types/legacy/common/constants/FeatureName.d.ts +1 -1
- package/build/types/legacy/common/hooks/useDebouncedFunction/useDebouncedFunction.d.ts +1 -1
- package/build/types/legacy/common/utils/debounce.d.ts +2 -2
- package/build/types/legacy/jsonSchemaForm/controlFeedback/ControlFeedback.d.ts +5 -5
- package/build/types/legacy/step/cameraStep/cameraCapture/CameraCapture.messages.d.ts +40 -0
- package/build/types/legacy/step/cameraStep/cameraCapture/components/orientationLockOverlay/OrientationLockOverlay.d.ts +1 -1
- package/build/types/legacy/step/cameraStep/cameraCapture/hooks/useFullScreenOrientationLock.d.ts +2 -1
- package/build/types/legacy/step/cameraStep/cameraCapture/overlay/Overlay.d.ts +1 -1
- package/build/types/legacy/step/cameraStep/cameraCapture/screens/cameraErrorScreen/CameraErrorScreen.d.ts +3 -0
- package/build/types/legacy/step/cameraStep/cameraCapture/screens/index.d.ts +1 -2
- package/build/types/legacy/step/cameraStep/cameraCapture/tracking/index.d.ts +4 -3
- package/build/types/legacy/step/cameraStep/cameraCapture/types/index.d.ts +11 -0
- package/build/types/revamp/DynamicFlowRevamp.d.ts +5 -1
- package/build/types/revamp/domain/components/AlertComponent.d.ts +2 -3
- package/build/types/revamp/domain/components/BoxComponent.d.ts +3 -4
- package/build/types/revamp/domain/components/ButtonComponent.d.ts +2 -4
- package/build/types/revamp/domain/components/ColumnsComponent.d.ts +19 -0
- package/build/types/revamp/domain/components/HeadingComponent.d.ts +2 -3
- package/build/types/revamp/domain/components/ObjectComponent.d.ts +3 -4
- package/build/types/revamp/domain/components/ParagraphComponent.d.ts +2 -3
- package/build/types/revamp/domain/components/TextInputComponent.d.ts +7 -8
- package/build/types/revamp/domain/mappers/layout/alertLayoutToComponent.d.ts +1 -1
- package/build/types/revamp/domain/mappers/layout/boxLayoutToComponents.d.ts +3 -3
- package/build/types/revamp/domain/mappers/layout/buttonLayoutToComponent.d.ts +1 -1
- package/build/types/revamp/domain/mappers/layout/columnsLayoutToComponent.d.ts +4 -0
- package/build/types/revamp/domain/mappers/layout/formLayoutToComponent.d.ts +1 -1
- package/build/types/revamp/domain/mappers/layout/headingLayoutToComponent.d.ts +1 -1
- package/build/types/revamp/domain/mappers/layout/paragraphLayoutToComponent.d.ts +1 -1
- package/build/types/revamp/domain/mappers/mapLayoutToComponent.d.ts +2 -2
- package/build/types/revamp/domain/mappers/mapStepToComponents.d.ts +2 -9
- package/build/types/revamp/domain/mappers/schema/objectSchemaToComponent.d.ts +1 -1
- package/build/types/revamp/domain/mappers/schema/stringSchemaToComponent.d.ts +9 -2
- package/build/types/revamp/domain/mappers/schema/types.d.ts +4 -1
- package/build/types/revamp/domain/mappers/types.d.ts +11 -0
- package/build/types/revamp/domain/mappers/utils/legacy-utils.d.ts +5 -2
- package/build/types/revamp/domain/mappers/utils/type-validators.d.ts +9 -0
- package/build/types/revamp/domain/mappers/utils/value-checks.d.ts +10 -0
- package/build/types/revamp/domain/types.d.ts +13 -10
- package/build/types/revamp/renderers/mappers/alertComponentToProps.d.ts +1 -1
- package/build/types/revamp/renderers/mappers/boxComponentToProps.d.ts +1 -1
- package/build/types/revamp/renderers/mappers/columnsComponentToProps.d.ts +4 -0
- package/build/types/revamp/renderers/mappers/componentToRendererProps.d.ts +5 -1
- package/build/types/revamp/renderers/mappers/headingComponentToProps.d.ts +1 -1
- package/build/types/revamp/renderers/mappers/objectComponentToProps.d.ts +1 -1
- package/build/types/revamp/renderers/mappers/paragraphComponentToProps.d.ts +1 -1
- package/build/types/revamp/renderers/mappers/textInputComponentToProps.d.ts +1 -1
- package/build/types/revamp/renderers/types.d.ts +19 -10
- package/build/types/revamp/step/Step.d.ts +1 -1
- package/build/types/revamp/step/utils/getRenderFunction.d.ts +3 -0
- package/build/types/revamp/step/utils/getSchemaErrorMessageFunction.d.ts +3 -0
- package/build/types/revamp/utils/getSubmittableData.d.ts +1 -1
- package/build/types/revamp/utils/type-utils.d.ts +7 -1
- package/build/types/revamp/utils/validateComponents.d.ts +2 -0
- package/build/types/revamp/wise/renderers/ColumnsRenderer.d.ts +3 -0
- package/package.json +4 -3
- package/build/types/legacy/step/cameraStep/cameraCapture/screens/CameraNotSupported/CameraNotSupported.d.ts +0 -2
- package/build/types/legacy/step/cameraStep/cameraCapture/screens/CameraNotSupported/CameraNotSupported.messages.d.ts +0 -13
- package/build/types/legacy/step/cameraStep/cameraCapture/screens/NoCameraAccess/NoCameraAccess.d.ts +0 -5
- package/build/types/legacy/step/cameraStep/cameraCapture/screens/NoCameraAccess/NoCameraAccess.messages.d.ts +0 -18
- package/build/types/revamp/renderers/utils/mapping-utils.d.ts +0 -3
- package/build/types/revamp/step/utils/render-utils.d.ts +0 -5
- /package/build/types/{legacy/jsonSchemaForm/controlFeedback/ControlFeedback.messages.d.ts → common/validationMessages/validation.messages.d.ts} +0 -0
package/build/main.js
CHANGED
|
@@ -1013,7 +1013,7 @@ function isReference(block) {
|
|
|
1013
1013
|
|
|
1014
1014
|
// src/legacy/dynamicFlow/DynamicFlow.tsx
|
|
1015
1015
|
var import_react44 = require("react");
|
|
1016
|
-
var
|
|
1016
|
+
var import_react_intl30 = require("react-intl");
|
|
1017
1017
|
|
|
1018
1018
|
// src/legacy/common/contexts/dynamicFlowContexts/DynamicFlowContexts.tsx
|
|
1019
1019
|
var import_react2 = require("react");
|
|
@@ -1174,10 +1174,6 @@ var FeatureContext = (0, import_react6.createContext)([]);
|
|
|
1174
1174
|
function FeatureContextProvider({ features, children }) {
|
|
1175
1175
|
return /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(FeatureContext.Provider, { value: features, children });
|
|
1176
1176
|
}
|
|
1177
|
-
var useFeatureFlag = (featureName) => {
|
|
1178
|
-
const features = (0, import_react6.useContext)(FeatureContext);
|
|
1179
|
-
return features == null ? void 0 : features.find((feature) => feature.featureName === featureName);
|
|
1180
|
-
};
|
|
1181
1177
|
|
|
1182
1178
|
// src/legacy/common/utils/api-utils.ts
|
|
1183
1179
|
function isStatus2xx(status) {
|
|
@@ -2668,9 +2664,9 @@ var import_components7 = require("@transferwise/components");
|
|
|
2668
2664
|
var import_formatting = require("@transferwise/formatting");
|
|
2669
2665
|
var import_react_intl5 = require("react-intl");
|
|
2670
2666
|
|
|
2671
|
-
// src/
|
|
2667
|
+
// src/common/validationMessages/validation.messages.ts
|
|
2672
2668
|
var import_react_intl4 = require("react-intl");
|
|
2673
|
-
var
|
|
2669
|
+
var validation_messages_default = (0, import_react_intl4.defineMessages)({
|
|
2674
2670
|
type: {
|
|
2675
2671
|
id: "dynamicFlows.ControlFeedback.type",
|
|
2676
2672
|
defaultMessage: "Incorrect type",
|
|
@@ -2725,14 +2721,14 @@ var ControlFeedback_messages_default = (0, import_react_intl4.defineMessages)({
|
|
|
2725
2721
|
|
|
2726
2722
|
// src/legacy/jsonSchemaForm/controlFeedback/ControlFeedback.tsx
|
|
2727
2723
|
var import_jsx_runtime18 = require("react/jsx-runtime");
|
|
2728
|
-
|
|
2724
|
+
function ControlFeedback(props) {
|
|
2729
2725
|
var _a;
|
|
2730
2726
|
const defaultValidationMessages = useDefaultValidationMessages(props.schema);
|
|
2731
2727
|
const validationMessages = __spreadValues(__spreadValues(__spreadValues({}, defaultValidationMessages), props.validationMessages), props.schema.validationMessages);
|
|
2732
|
-
const isErrorVisible = (props.submitted || !props.changed) &&
|
|
2733
|
-
const isValidationVisible = !isErrorVisible && (props.submitted || props.changed && props.blurred) &&
|
|
2728
|
+
const isErrorVisible = (props.submitted || !props.changed) && Boolean(props.errors);
|
|
2729
|
+
const isValidationVisible = !isErrorVisible && (props.submitted || props.changed && props.blurred) && Boolean((_a = props.validations) == null ? void 0 : _a.length);
|
|
2734
2730
|
const isDescriptionVisible = props.schema.description && !isErrorVisible && !isValidationVisible;
|
|
2735
|
-
const hasInfoMessage =
|
|
2731
|
+
const hasInfoMessage = Boolean(props.infoMessage);
|
|
2736
2732
|
return /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)("div", { id: props.id, children: [
|
|
2737
2733
|
isErrorVisible ? /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(import_components7.InlineAlert, { type: "error", children: props.errors }) : null,
|
|
2738
2734
|
isValidationVisible ? /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(import_components7.InlineAlert, { type: "error", children: props.validations.map((validation) => /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("div", { children: validationMessages[validation] }, validation)) }) : null,
|
|
@@ -2741,7 +2737,7 @@ var ControlFeedback = (props) => {
|
|
|
2741
2737
|
hasInfoMessage && /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("div", { children: props.infoMessage })
|
|
2742
2738
|
] })
|
|
2743
2739
|
] });
|
|
2744
|
-
}
|
|
2740
|
+
}
|
|
2745
2741
|
ControlFeedback.defaultProps = {
|
|
2746
2742
|
errors: "",
|
|
2747
2743
|
validations: [],
|
|
@@ -2751,26 +2747,26 @@ ControlFeedback.defaultProps = {
|
|
|
2751
2747
|
function useDefaultValidationMessages(schema) {
|
|
2752
2748
|
const { formatMessage, locale } = (0, import_react_intl5.useIntl)();
|
|
2753
2749
|
const formattedMessages = {
|
|
2754
|
-
type: formatMessage(
|
|
2755
|
-
minimum: formatMessage(
|
|
2750
|
+
type: formatMessage(validation_messages_default.type),
|
|
2751
|
+
minimum: formatMessage(validation_messages_default.minimum, {
|
|
2756
2752
|
minimum: schema.minimum
|
|
2757
2753
|
}),
|
|
2758
|
-
maximum: formatMessage(
|
|
2754
|
+
maximum: formatMessage(validation_messages_default.maximum, {
|
|
2759
2755
|
maximum: schema.maximum
|
|
2760
2756
|
}),
|
|
2761
|
-
minLength: formatMessage(
|
|
2757
|
+
minLength: formatMessage(validation_messages_default.minLength, {
|
|
2762
2758
|
minLength: schema.minLength
|
|
2763
2759
|
}),
|
|
2764
|
-
maxLength: formatMessage(
|
|
2760
|
+
maxLength: formatMessage(validation_messages_default.maxLength, {
|
|
2765
2761
|
maxLength: schema.maxLength
|
|
2766
2762
|
}),
|
|
2767
|
-
pattern: formatMessage(
|
|
2768
|
-
required: formatMessage(
|
|
2763
|
+
pattern: formatMessage(validation_messages_default.pattern),
|
|
2764
|
+
required: formatMessage(validation_messages_default.required)
|
|
2769
2765
|
};
|
|
2770
2766
|
if (schema.format === "date") {
|
|
2771
2767
|
const dateOverrides = {
|
|
2772
|
-
pattern: formatMessage(
|
|
2773
|
-
minimum: schema.minimum ? formatMessage(
|
|
2768
|
+
pattern: formatMessage(validation_messages_default.patternDate),
|
|
2769
|
+
minimum: schema.minimum ? formatMessage(validation_messages_default.minimumDate, {
|
|
2774
2770
|
minimum: (0, import_formatting.formatDate)(
|
|
2775
2771
|
new Date(schema.minimum),
|
|
2776
2772
|
locale,
|
|
@@ -2780,7 +2776,7 @@ function useDefaultValidationMessages(schema) {
|
|
|
2780
2776
|
}
|
|
2781
2777
|
)
|
|
2782
2778
|
}) : void 0,
|
|
2783
|
-
maximum: schema.maximum ? formatMessage(
|
|
2779
|
+
maximum: schema.maximum ? formatMessage(validation_messages_default.maximumDate, {
|
|
2784
2780
|
maximum: (0, import_formatting.formatDate)(
|
|
2785
2781
|
new Date(schema.maximum),
|
|
2786
2782
|
locale,
|
|
@@ -3466,40 +3462,42 @@ function ObjectSchema(props) {
|
|
|
3466
3462
|
const isPropertyDefined = (propertyName) => typeof props.schema.properties[propertyName] !== "undefined";
|
|
3467
3463
|
const orderedPropertyNames = Array.from(allorderedPropertiesSet).filter(isPropertyDefined);
|
|
3468
3464
|
const propsErrors = props.errors;
|
|
3469
|
-
return /* @__PURE__ */ (0, import_jsx_runtime25.jsxs)(
|
|
3470
|
-
props.schema.title && !props.hideTitle && /* @__PURE__ */ (0, import_jsx_runtime25.jsxs)("legend", { children: [
|
|
3471
|
-
" ",
|
|
3472
|
-
props.schema.title,
|
|
3473
|
-
" "
|
|
3474
|
-
] }),
|
|
3475
|
-
props.schema.description && !props.hideTitle && /* @__PURE__ */ (0, import_jsx_runtime25.jsxs)("p", { children: [
|
|
3476
|
-
" ",
|
|
3477
|
-
props.schema.description,
|
|
3478
|
-
" "
|
|
3479
|
-
] }),
|
|
3465
|
+
return /* @__PURE__ */ (0, import_jsx_runtime25.jsxs)(import_jsx_runtime25.Fragment, { children: [
|
|
3480
3466
|
props.schema.alert && /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(DynamicAlert_default, { component: props.schema.alert }),
|
|
3481
|
-
/* @__PURE__ */ (0, import_jsx_runtime25.
|
|
3482
|
-
"
|
|
3483
|
-
|
|
3484
|
-
|
|
3485
|
-
|
|
3486
|
-
|
|
3487
|
-
|
|
3488
|
-
|
|
3489
|
-
|
|
3490
|
-
|
|
3491
|
-
|
|
3492
|
-
|
|
3493
|
-
|
|
3494
|
-
|
|
3495
|
-
|
|
3496
|
-
|
|
3497
|
-
|
|
3498
|
-
|
|
3499
|
-
|
|
3500
|
-
|
|
3501
|
-
|
|
3502
|
-
|
|
3467
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsxs)("fieldset", { children: [
|
|
3468
|
+
props.schema.title && !props.hideTitle && /* @__PURE__ */ (0, import_jsx_runtime25.jsxs)("legend", { children: [
|
|
3469
|
+
" ",
|
|
3470
|
+
props.schema.title,
|
|
3471
|
+
" "
|
|
3472
|
+
] }),
|
|
3473
|
+
props.schema.description && !props.hideTitle && /* @__PURE__ */ (0, import_jsx_runtime25.jsxs)("p", { children: [
|
|
3474
|
+
" ",
|
|
3475
|
+
props.schema.description,
|
|
3476
|
+
" "
|
|
3477
|
+
] }),
|
|
3478
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsx)("div", { className: "row", children: orderedPropertyNames.map((propertyName) => /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(
|
|
3479
|
+
"div",
|
|
3480
|
+
{
|
|
3481
|
+
className: (0, import_classnames3.default)(
|
|
3482
|
+
getSchemaColumnClasses2(props.schema.properties[propertyName].width)
|
|
3483
|
+
),
|
|
3484
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(
|
|
3485
|
+
GenericSchema_default,
|
|
3486
|
+
{
|
|
3487
|
+
schema: props.schema.properties[propertyName],
|
|
3488
|
+
model: props.model && props.model[propertyName],
|
|
3489
|
+
errors: propsErrors == null ? void 0 : propsErrors[propertyName],
|
|
3490
|
+
submitted: props.submitted,
|
|
3491
|
+
required: isRequired(propertyName),
|
|
3492
|
+
disabled: props.disabled,
|
|
3493
|
+
onChange: (onChangeProps) => onChangeProperty(propertyName, onChangeProps),
|
|
3494
|
+
onPersistAsync: props.onPersistAsync
|
|
3495
|
+
}
|
|
3496
|
+
)
|
|
3497
|
+
},
|
|
3498
|
+
propertyName
|
|
3499
|
+
)) })
|
|
3500
|
+
] })
|
|
3503
3501
|
] });
|
|
3504
3502
|
}
|
|
3505
3503
|
ObjectSchema.defaultProps = {
|
|
@@ -5329,7 +5327,7 @@ var DynamicStatusList_default = DynamicStatusList;
|
|
|
5329
5327
|
var import_components24 = require("@transferwise/components");
|
|
5330
5328
|
var import_jsx_runtime48 = require("react/jsx-runtime");
|
|
5331
5329
|
var DynamicLoadingIndicator = ({ component }) => {
|
|
5332
|
-
const { margin, size = "md" } = component;
|
|
5330
|
+
const { margin = "md", size = "md" } = component;
|
|
5333
5331
|
return /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(
|
|
5334
5332
|
import_components24.Loader,
|
|
5335
5333
|
{
|
|
@@ -6136,7 +6134,7 @@ var import_react39 = require("react");
|
|
|
6136
6134
|
|
|
6137
6135
|
// src/legacy/step/cameraStep/cameraCapture/CameraCapture.tsx
|
|
6138
6136
|
var import_react38 = require("react");
|
|
6139
|
-
var
|
|
6137
|
+
var import_react_intl26 = require("react-intl");
|
|
6140
6138
|
var import_react_webcam = __toESM(require_react_webcam());
|
|
6141
6139
|
|
|
6142
6140
|
// src/legacy/step/cameraStep/cameraCapture/CameraCapture.messages.ts
|
|
@@ -6156,6 +6154,46 @@ var CameraCapture_messages_default = (0, import_react_intl22.defineMessages)({
|
|
|
6156
6154
|
id: "dynamicFlows.CameraCapture.reviewInstructions",
|
|
6157
6155
|
defaultMessage: "Is your picture clear, readable and complete?",
|
|
6158
6156
|
description: "After taking an image with the camera, prompt user to review the image"
|
|
6157
|
+
},
|
|
6158
|
+
cameraNotSupportedTitle: {
|
|
6159
|
+
id: "dynamicFlows.CameraCapture.CameraNotSupported.title",
|
|
6160
|
+
defaultMessage: "Camera not supported",
|
|
6161
|
+
description: "Title of standalone page prompting that camera is not available on users browser"
|
|
6162
|
+
},
|
|
6163
|
+
cameraNotSupportedParagraph: {
|
|
6164
|
+
id: "dynamicFlows.CameraCapture.CameraNotSupported.paragraph",
|
|
6165
|
+
defaultMessage: "The browser you're using doesn't have support for a camera. Try a different browser, device, or download our mobile app.",
|
|
6166
|
+
description: "Further text of standalone page prompting that camera is not available on user's browser"
|
|
6167
|
+
},
|
|
6168
|
+
noCameraAccessTitle: {
|
|
6169
|
+
id: "dynamicFlows.CameraCapture.NoCameraAccess.title",
|
|
6170
|
+
defaultMessage: "We can't access your camera",
|
|
6171
|
+
description: "Title of standalone page prompting missing camera permissions"
|
|
6172
|
+
},
|
|
6173
|
+
noCameraAccessParagraph: {
|
|
6174
|
+
id: "dynamicFlows.CameraCapture.NoCameraAccess.paragraph",
|
|
6175
|
+
defaultMessage: "Enable camera access in your browser's settings to get going again.",
|
|
6176
|
+
description: "Further text of standalone page prompting missing camera permissions"
|
|
6177
|
+
},
|
|
6178
|
+
noCameraAccessAction: {
|
|
6179
|
+
id: "dynamicFlows.CameraCapture.NoCameraAccess.action",
|
|
6180
|
+
defaultMessage: "Enable camera access",
|
|
6181
|
+
description: "Action to ask for camera permissions again"
|
|
6182
|
+
},
|
|
6183
|
+
cameraConnectionIssueTitle: {
|
|
6184
|
+
id: "dynamicFlows.CameraCapture.CameraConnectionIssue.title",
|
|
6185
|
+
defaultMessage: "We can't access your camera",
|
|
6186
|
+
description: "Title of standalone page prompting that there was an issue connecting to a camera"
|
|
6187
|
+
},
|
|
6188
|
+
cameraConnectionIssueParagraph: {
|
|
6189
|
+
id: "dynamicFlows.CameraCapture.CameraConnectionIssue.paragraph",
|
|
6190
|
+
defaultMessage: "Please check if it is connected and try again.",
|
|
6191
|
+
description: "Further text of standalone page prompting that there was an issue connecting to a camera"
|
|
6192
|
+
},
|
|
6193
|
+
cameraConnectionIssueAction: {
|
|
6194
|
+
id: "dynamicFlows.CameraCapture.CameraConnectionIssue.action",
|
|
6195
|
+
defaultMessage: "Try again",
|
|
6196
|
+
description: "Action to try using camera again"
|
|
6159
6197
|
}
|
|
6160
6198
|
});
|
|
6161
6199
|
|
|
@@ -6221,7 +6259,7 @@ var OrientationLockOverlay_messages_default = (0, import_react_intl24.defineMess
|
|
|
6221
6259
|
|
|
6222
6260
|
// src/legacy/step/cameraStep/cameraCapture/components/orientationLockOverlay/OrientationLockOverlay.tsx
|
|
6223
6261
|
var import_jsx_runtime59 = require("react/jsx-runtime");
|
|
6224
|
-
|
|
6262
|
+
function OrientationLockOverlay() {
|
|
6225
6263
|
const intl = (0, import_react_intl25.useIntl)();
|
|
6226
6264
|
return /* @__PURE__ */ (0, import_jsx_runtime59.jsxs)("div", { className: "orientation-lock-overlay", children: [
|
|
6227
6265
|
/* @__PURE__ */ (0, import_jsx_runtime59.jsx)(
|
|
@@ -6236,52 +6274,24 @@ var OrientationLockOverlay = () => {
|
|
|
6236
6274
|
),
|
|
6237
6275
|
/* @__PURE__ */ (0, import_jsx_runtime59.jsx)("p", { className: "text-center m-b-0", children: intl.formatMessage(OrientationLockOverlay_messages_default.text) })
|
|
6238
6276
|
] });
|
|
6239
|
-
}
|
|
6277
|
+
}
|
|
6240
6278
|
var OrientationLockOverlay_default = OrientationLockOverlay;
|
|
6241
6279
|
|
|
6280
|
+
// src/legacy/step/cameraStep/cameraCapture/screens/cameraErrorScreen/CameraErrorScreen.tsx
|
|
6281
|
+
var import_components32 = require("@transferwise/components");
|
|
6282
|
+
var import_jsx_runtime60 = require("react/jsx-runtime");
|
|
6283
|
+
function CameraErrorScreen({ title, description, actionButton, onAction }) {
|
|
6284
|
+
return /* @__PURE__ */ (0, import_jsx_runtime60.jsx)("div", { className: "container p-t-5", children: /* @__PURE__ */ (0, import_jsx_runtime60.jsx)("div", { className: "row", children: /* @__PURE__ */ (0, import_jsx_runtime60.jsxs)("div", { className: "col-md-6 col-md-offset-3", children: [
|
|
6285
|
+
/* @__PURE__ */ (0, import_jsx_runtime60.jsx)("h2", { className: "text-xs-center m-b-3", children: title }),
|
|
6286
|
+
/* @__PURE__ */ (0, import_jsx_runtime60.jsx)("p", { className: "text-xs-center m-b-5", children: description }),
|
|
6287
|
+
onAction && actionButton && /* @__PURE__ */ (0, import_jsx_runtime60.jsx)(import_components32.Button, { block: true, onClick: onAction, children: actionButton })
|
|
6288
|
+
] }) }) });
|
|
6289
|
+
}
|
|
6290
|
+
var CameraErrorScreen_default = CameraErrorScreen;
|
|
6291
|
+
|
|
6242
6292
|
// src/legacy/step/cameraStep/cameraCapture/hooks/useFullScreenOrientationLock.ts
|
|
6243
6293
|
var import_react35 = require("react");
|
|
6244
6294
|
var import_screenfull = __toESM(require_screenfull());
|
|
6245
|
-
var useFullScreenOrientationLock = (shouldLockOrientation) => {
|
|
6246
|
-
const lockOrientation = (0, import_react35.useCallback)(() => {
|
|
6247
|
-
if (window.screen.orientation && "lock" in window.screen.orientation && typeof window.screen.orientation.lock === "function") {
|
|
6248
|
-
window.screen.orientation.lock("portrait").catch(noop4);
|
|
6249
|
-
}
|
|
6250
|
-
}, []);
|
|
6251
|
-
const unlockOrientation = (0, import_react35.useCallback)(() => {
|
|
6252
|
-
var _a, _b, _c;
|
|
6253
|
-
return (_c = (_b = (_a = window == null ? void 0 : window.screen) == null ? void 0 : _a.orientation) == null ? void 0 : _b.unlock) == null ? void 0 : _c.call(_b);
|
|
6254
|
-
}, []);
|
|
6255
|
-
const enterFullScreen = (0, import_react35.useCallback)(() => {
|
|
6256
|
-
setTimeout(() => {
|
|
6257
|
-
if (shouldLockOrientation && !import_screenfull.default.isFullscreen && import_screenfull.default.isEnabled) {
|
|
6258
|
-
import_screenfull.default.request(document.documentElement, { navigationUI: "show" }).then(() => {
|
|
6259
|
-
lockOrientation();
|
|
6260
|
-
}).catch(noop4);
|
|
6261
|
-
}
|
|
6262
|
-
}, 100);
|
|
6263
|
-
}, [shouldLockOrientation, lockOrientation]);
|
|
6264
|
-
const exitFullScreen = (0, import_react35.useCallback)(() => {
|
|
6265
|
-
if (import_screenfull.default.isFullscreen) {
|
|
6266
|
-
import_screenfull.default.exit().catch(noop4);
|
|
6267
|
-
}
|
|
6268
|
-
unlockOrientation();
|
|
6269
|
-
}, [unlockOrientation]);
|
|
6270
|
-
(0, import_react35.useEffect)(() => {
|
|
6271
|
-
return () => {
|
|
6272
|
-
exitFullScreen();
|
|
6273
|
-
};
|
|
6274
|
-
}, [exitFullScreen]);
|
|
6275
|
-
return {
|
|
6276
|
-
enterFullScreen,
|
|
6277
|
-
exitFullScreen
|
|
6278
|
-
};
|
|
6279
|
-
};
|
|
6280
|
-
var noop4 = () => {
|
|
6281
|
-
};
|
|
6282
|
-
|
|
6283
|
-
// src/legacy/step/cameraStep/cameraCapture/hooks/useVideoConstraints.ts
|
|
6284
|
-
var import_react36 = require("react");
|
|
6285
6295
|
|
|
6286
6296
|
// src/legacy/step/cameraStep/cameraCapture/utils/index.ts
|
|
6287
6297
|
var isSelfieCamera = (stream) => {
|
|
@@ -6329,7 +6339,95 @@ var getVideoCapabilities = (videoStream) => {
|
|
|
6329
6339
|
return (_b = (_a = getVideoTrack(videoStream)) == null ? void 0 : _a.getCapabilities) == null ? void 0 : _b.call(_a);
|
|
6330
6340
|
};
|
|
6331
6341
|
|
|
6342
|
+
// src/legacy/step/cameraStep/cameraCapture/tracking/index.ts
|
|
6343
|
+
var trackCameraError = (message, onEvent, error) => onEvent == null ? void 0 : onEvent(message, { Error: getSerializedError(error) });
|
|
6344
|
+
var getSerializedError = (error) => error instanceof DOMException ? JSON.stringify({
|
|
6345
|
+
name: error == null ? void 0 : error.name,
|
|
6346
|
+
message: error == null ? void 0 : error.message
|
|
6347
|
+
}) : error;
|
|
6348
|
+
var trackCameraFeedStarted = async (onEvent, props, stream) => onEvent == null ? void 0 : onEvent("Dynamic Flow - Camera Feed Started", await getCameraStartedProperties(props, stream));
|
|
6349
|
+
var getCameraStartedProperties = async (props, videoStream) => {
|
|
6350
|
+
var _a;
|
|
6351
|
+
const videoTrack = getVideoTrack(videoStream);
|
|
6352
|
+
const capabilities = getVideoCapabilities(videoStream);
|
|
6353
|
+
const settings = (_a = videoTrack == null ? void 0 : videoTrack.getSettings) == null ? void 0 : _a.call(videoTrack);
|
|
6354
|
+
return __spreadProps(__spreadValues({}, videoTrack && {
|
|
6355
|
+
"Available Video Devices (by label)": await getAvailableVideoDeviceLabels(),
|
|
6356
|
+
"Active Video Device (by label)": await getActiveVideoDeviceLabel(videoStream),
|
|
6357
|
+
"Camera Capabilities": capabilities,
|
|
6358
|
+
"Camera Settings": settings
|
|
6359
|
+
}), {
|
|
6360
|
+
"Camera Direction (Asked)": props == null ? void 0 : props.direction
|
|
6361
|
+
});
|
|
6362
|
+
};
|
|
6363
|
+
var trackCameraOrientationLandscape = (onEvent) => {
|
|
6364
|
+
onEvent == null ? void 0 : onEvent("Dynamic Flow - Camera Orientation Lock Overlay Shown", {});
|
|
6365
|
+
};
|
|
6366
|
+
var trackCameraOrientationLocked = (onEvent) => {
|
|
6367
|
+
onEvent == null ? void 0 : onEvent("Dynamic Flow - Camera Orientation Locked", {});
|
|
6368
|
+
};
|
|
6369
|
+
|
|
6370
|
+
// src/legacy/step/cameraStep/cameraCapture/hooks/useFullScreenOrientationLock.ts
|
|
6371
|
+
var useFullScreenOrientationLock = (shouldLockOrientation, onEvent) => {
|
|
6372
|
+
const lockOrientation = (0, import_react35.useCallback)(() => {
|
|
6373
|
+
if (window.screen.orientation && "lock" in window.screen.orientation && typeof window.screen.orientation.lock === "function") {
|
|
6374
|
+
window.screen.orientation.lock("portrait").then(() => trackCameraOrientationLocked(onEvent)).catch(noop4);
|
|
6375
|
+
}
|
|
6376
|
+
}, [onEvent]);
|
|
6377
|
+
const unlockOrientation = (0, import_react35.useCallback)(() => {
|
|
6378
|
+
var _a, _b, _c;
|
|
6379
|
+
return (_c = (_b = (_a = window == null ? void 0 : window.screen) == null ? void 0 : _a.orientation) == null ? void 0 : _b.unlock) == null ? void 0 : _c.call(_b);
|
|
6380
|
+
}, []);
|
|
6381
|
+
const enterFullScreen = (0, import_react35.useCallback)(() => {
|
|
6382
|
+
setTimeout(() => {
|
|
6383
|
+
if (shouldLockOrientation && !import_screenfull.default.isFullscreen && import_screenfull.default.isEnabled) {
|
|
6384
|
+
import_screenfull.default.request(document.documentElement, { navigationUI: "show" }).then(() => {
|
|
6385
|
+
lockOrientation();
|
|
6386
|
+
}).catch(noop4);
|
|
6387
|
+
}
|
|
6388
|
+
}, 100);
|
|
6389
|
+
}, [shouldLockOrientation, lockOrientation]);
|
|
6390
|
+
const exitFullScreen = (0, import_react35.useCallback)(() => {
|
|
6391
|
+
if (import_screenfull.default.isFullscreen) {
|
|
6392
|
+
import_screenfull.default.exit().catch(noop4);
|
|
6393
|
+
}
|
|
6394
|
+
unlockOrientation();
|
|
6395
|
+
}, [unlockOrientation]);
|
|
6396
|
+
const handleOrientationChange = (0, import_react35.useCallback)(
|
|
6397
|
+
(event) => {
|
|
6398
|
+
var _a, _b;
|
|
6399
|
+
if ((_a = event == null ? void 0 : event.target) == null ? void 0 : _a.type.includes("landscape")) {
|
|
6400
|
+
if ((_b = window.screen) == null ? void 0 : _b.orientation) {
|
|
6401
|
+
trackCameraOrientationLandscape(onEvent);
|
|
6402
|
+
}
|
|
6403
|
+
}
|
|
6404
|
+
},
|
|
6405
|
+
[onEvent]
|
|
6406
|
+
);
|
|
6407
|
+
(0, import_react35.useEffect)(() => {
|
|
6408
|
+
var _a, _b;
|
|
6409
|
+
if (shouldLockOrientation) {
|
|
6410
|
+
(_b = (_a = window.screen) == null ? void 0 : _a.orientation) == null ? void 0 : _b.addEventListener(
|
|
6411
|
+
"change",
|
|
6412
|
+
(event) => handleOrientationChange(event)
|
|
6413
|
+
);
|
|
6414
|
+
}
|
|
6415
|
+
return () => {
|
|
6416
|
+
var _a2, _b2;
|
|
6417
|
+
(_b2 = (_a2 = window.screen) == null ? void 0 : _a2.orientation) == null ? void 0 : _b2.removeEventListener("change", handleOrientationChange);
|
|
6418
|
+
exitFullScreen();
|
|
6419
|
+
};
|
|
6420
|
+
}, [exitFullScreen, handleOrientationChange, shouldLockOrientation]);
|
|
6421
|
+
return {
|
|
6422
|
+
enterFullScreen,
|
|
6423
|
+
exitFullScreen
|
|
6424
|
+
};
|
|
6425
|
+
};
|
|
6426
|
+
var noop4 = () => {
|
|
6427
|
+
};
|
|
6428
|
+
|
|
6332
6429
|
// src/legacy/step/cameraStep/cameraCapture/hooks/useVideoConstraints.ts
|
|
6430
|
+
var import_react36 = require("react");
|
|
6333
6431
|
var useVideoConstraints = (direction) => {
|
|
6334
6432
|
const [videoConstraints, setVideoConstraints] = (0, import_react36.useState)();
|
|
6335
6433
|
const defaultVideoConstraints = {
|
|
@@ -6358,7 +6456,7 @@ var useVideoConstraints = (direction) => {
|
|
|
6358
6456
|
|
|
6359
6457
|
// src/legacy/step/cameraStep/cameraCapture/overlay/Overlay.tsx
|
|
6360
6458
|
var import_react37 = require("react");
|
|
6361
|
-
var
|
|
6459
|
+
var import_jsx_runtime61 = require("react/jsx-runtime");
|
|
6362
6460
|
var captureButtonHeight = 92;
|
|
6363
6461
|
var reviewButtonsHeight = 120;
|
|
6364
6462
|
var imageHeight = 40;
|
|
@@ -6366,39 +6464,32 @@ var titleHeight = 32;
|
|
|
6366
6464
|
var instructionsHeight = 48;
|
|
6367
6465
|
var reviewInstructionsHeight = 40;
|
|
6368
6466
|
var overlayMaxWidth = 800;
|
|
6369
|
-
function Overlay({
|
|
6370
|
-
overlay,
|
|
6371
|
-
outline,
|
|
6372
|
-
imageUrl,
|
|
6373
|
-
title,
|
|
6374
|
-
instructions,
|
|
6375
|
-
reviewInstructions
|
|
6376
|
-
}) {
|
|
6467
|
+
function Overlay({ overlay, outline, imageUrl, title, instructions, reviewInstructions }) {
|
|
6377
6468
|
const svgReference = (0, import_react37.useRef)(null);
|
|
6378
6469
|
(0, import_react37.useEffect)(() => {
|
|
6379
6470
|
const listener = debounce(() => {
|
|
6380
6471
|
var _a;
|
|
6381
6472
|
if ((_a = svgReference.current) == null ? void 0 : _a.innerHTML) {
|
|
6382
6473
|
const reference = svgReference.current;
|
|
6383
|
-
reference.innerHTML
|
|
6474
|
+
reference.innerHTML = String(reference.innerHTML);
|
|
6384
6475
|
}
|
|
6385
6476
|
}, 100);
|
|
6386
6477
|
window.addEventListener("resize", listener);
|
|
6387
6478
|
return () => window.removeEventListener("resize", listener);
|
|
6388
6479
|
});
|
|
6389
6480
|
let helperBoxHeight = (imageUrl ? imageHeight : 0) + (title ? titleHeight : 0) + (instructions ? instructionsHeight : 0);
|
|
6390
|
-
let helperBox = /* @__PURE__ */ (0,
|
|
6391
|
-
imageUrl && /* @__PURE__ */ (0,
|
|
6392
|
-
title && /* @__PURE__ */ (0,
|
|
6393
|
-
instructions && /* @__PURE__ */ (0,
|
|
6481
|
+
let helperBox = /* @__PURE__ */ (0, import_jsx_runtime61.jsxs)(import_jsx_runtime61.Fragment, { children: [
|
|
6482
|
+
imageUrl && /* @__PURE__ */ (0, import_jsx_runtime61.jsx)("img", { className: "camera-capture-img", src: imageUrl, alt: "" }),
|
|
6483
|
+
title && /* @__PURE__ */ (0, import_jsx_runtime61.jsx)("h4", { className: "camera-capture-title", children: title }),
|
|
6484
|
+
instructions && /* @__PURE__ */ (0, import_jsx_runtime61.jsx)("small", { className: "camera-capture-instructions", children: instructions })
|
|
6394
6485
|
] });
|
|
6395
6486
|
const frameBottomMargin = captureButtonHeight + helperBoxHeight;
|
|
6396
6487
|
if (reviewInstructions) {
|
|
6397
6488
|
helperBoxHeight = frameBottomMargin - reviewButtonsHeight;
|
|
6398
|
-
helperBox = /* @__PURE__ */ (0,
|
|
6489
|
+
helperBox = /* @__PURE__ */ (0, import_jsx_runtime61.jsx)("small", { className: "camera-capture-instructions", children: reviewInstructions });
|
|
6399
6490
|
const frameWithReviewInstructionsMinBottomMargin = reviewButtonsHeight + reviewInstructionsHeight;
|
|
6400
6491
|
if (frameBottomMargin < frameWithReviewInstructionsMinBottomMargin) {
|
|
6401
|
-
helperBox = /* @__PURE__ */ (0,
|
|
6492
|
+
helperBox = /* @__PURE__ */ (0, import_jsx_runtime61.jsx)(import_jsx_runtime61.Fragment, {});
|
|
6402
6493
|
}
|
|
6403
6494
|
}
|
|
6404
6495
|
const framePosition = {
|
|
@@ -6416,104 +6507,20 @@ function Overlay({
|
|
|
6416
6507
|
width: "90%"
|
|
6417
6508
|
}
|
|
6418
6509
|
};
|
|
6419
|
-
return /* @__PURE__ */ (0,
|
|
6420
|
-
/* @__PURE__ */ (0,
|
|
6421
|
-
/* @__PURE__ */ (0,
|
|
6422
|
-
/* @__PURE__ */ (0,
|
|
6510
|
+
return /* @__PURE__ */ (0, import_jsx_runtime61.jsxs)("svg", { ref: svgReference, xmlns: "http://www.w3.org/2000/svg", children: [
|
|
6511
|
+
/* @__PURE__ */ (0, import_jsx_runtime61.jsx)("defs", { children: /* @__PURE__ */ (0, import_jsx_runtime61.jsxs)("mask", { id: "mask", children: [
|
|
6512
|
+
/* @__PURE__ */ (0, import_jsx_runtime61.jsx)("rect", { width: "100%", height: "100%", fill: "#fff" }),
|
|
6513
|
+
/* @__PURE__ */ (0, import_jsx_runtime61.jsx)("image", __spreadValues({ href: overlay }, framePosition))
|
|
6423
6514
|
] }) }),
|
|
6424
|
-
overlay && /* @__PURE__ */ (0,
|
|
6425
|
-
outline && /* @__PURE__ */ (0,
|
|
6426
|
-
/* @__PURE__ */ (0,
|
|
6515
|
+
overlay && /* @__PURE__ */ (0, import_jsx_runtime61.jsx)("rect", { width: "100%", height: "100%", mask: "url(#mask)", fillOpacity: "0.72" }),
|
|
6516
|
+
outline && /* @__PURE__ */ (0, import_jsx_runtime61.jsx)("image", __spreadValues({ href: outline }, framePosition)),
|
|
6517
|
+
/* @__PURE__ */ (0, import_jsx_runtime61.jsx)("foreignObject", { width: "100%", height: "100%", children: /* @__PURE__ */ (0, import_jsx_runtime61.jsx)("div", __spreadProps(__spreadValues({ className: "camera-capture-text-and-image-container" }, helperBoxPosition), { children: helperBox })) })
|
|
6427
6518
|
] });
|
|
6428
6519
|
}
|
|
6429
6520
|
var Overlay_default = Overlay;
|
|
6430
6521
|
|
|
6431
|
-
// src/legacy/step/cameraStep/cameraCapture/screens/NoCameraAccess/NoCameraAccess.tsx
|
|
6432
|
-
var import_components32 = require("@transferwise/components");
|
|
6433
|
-
var import_react_intl27 = require("react-intl");
|
|
6434
|
-
|
|
6435
|
-
// src/legacy/step/cameraStep/cameraCapture/screens/NoCameraAccess/NoCameraAccess.messages.ts
|
|
6436
|
-
var import_react_intl26 = require("react-intl");
|
|
6437
|
-
var NoCameraAccess_messages_default = (0, import_react_intl26.defineMessages)({
|
|
6438
|
-
title: {
|
|
6439
|
-
id: "dynamicFlows.CameraCapture.NoCameraAccess.title",
|
|
6440
|
-
defaultMessage: "We can't access your camera",
|
|
6441
|
-
description: "Title of standalone page prompting missing camera permissions"
|
|
6442
|
-
},
|
|
6443
|
-
paragraph: {
|
|
6444
|
-
id: "dynamicFlows.CameraCapture.NoCameraAccess.paragraph",
|
|
6445
|
-
defaultMessage: "Enable camera access in your browser's settings to get going again.",
|
|
6446
|
-
description: "Further text of standalone page prompting missing camera permissions"
|
|
6447
|
-
},
|
|
6448
|
-
action: {
|
|
6449
|
-
id: "dynamicFlows.CameraCapture.NoCameraAccess.action",
|
|
6450
|
-
defaultMessage: "Enable camera access",
|
|
6451
|
-
description: "Action to ask for camera permissions again"
|
|
6452
|
-
}
|
|
6453
|
-
});
|
|
6454
|
-
|
|
6455
|
-
// src/legacy/step/cameraStep/cameraCapture/screens/NoCameraAccess/NoCameraAccess.tsx
|
|
6456
|
-
var import_jsx_runtime61 = require("react/jsx-runtime");
|
|
6457
|
-
function NoCameraAccess({ onAction }) {
|
|
6458
|
-
const intl = (0, import_react_intl27.useIntl)();
|
|
6459
|
-
return /* @__PURE__ */ (0, import_jsx_runtime61.jsx)("div", { id: "no-camera-access", children: /* @__PURE__ */ (0, import_jsx_runtime61.jsx)("div", { className: "container p-t-5", children: /* @__PURE__ */ (0, import_jsx_runtime61.jsx)("div", { className: "row", children: /* @__PURE__ */ (0, import_jsx_runtime61.jsxs)("div", { className: "col-md-6 col-md-offset-3", children: [
|
|
6460
|
-
/* @__PURE__ */ (0, import_jsx_runtime61.jsx)("h2", { className: "text-xs-center m-b-3", children: intl.formatMessage(NoCameraAccess_messages_default.title) }),
|
|
6461
|
-
/* @__PURE__ */ (0, import_jsx_runtime61.jsx)("p", { className: "text-xs-center m-b-5", children: intl.formatMessage(NoCameraAccess_messages_default.paragraph) }),
|
|
6462
|
-
/* @__PURE__ */ (0, import_jsx_runtime61.jsx)(import_components32.Button, { block: true, onClick: onAction, children: intl.formatMessage(NoCameraAccess_messages_default.action) })
|
|
6463
|
-
] }) }) }) });
|
|
6464
|
-
}
|
|
6465
|
-
var NoCameraAccess_default = NoCameraAccess;
|
|
6466
|
-
|
|
6467
|
-
// src/legacy/step/cameraStep/cameraCapture/screens/CameraNotSupported/CameraNotSupported.tsx
|
|
6468
|
-
var import_react_intl29 = require("react-intl");
|
|
6469
|
-
|
|
6470
|
-
// src/legacy/step/cameraStep/cameraCapture/screens/CameraNotSupported/CameraNotSupported.messages.ts
|
|
6471
|
-
var import_react_intl28 = require("react-intl");
|
|
6472
|
-
var CameraNotSupported_messages_default = (0, import_react_intl28.defineMessages)({
|
|
6473
|
-
title: {
|
|
6474
|
-
id: "dynamicFlows.CameraCapture.CameraNotSupported.title",
|
|
6475
|
-
defaultMessage: "Camera not supported",
|
|
6476
|
-
description: "Title of standalone page prompting that camera is not available on users browser"
|
|
6477
|
-
},
|
|
6478
|
-
paragraph: {
|
|
6479
|
-
id: "dynamicFlows.CameraCapture.CameraNotSupported.paragraph",
|
|
6480
|
-
defaultMessage: "The browser you're using doesn't have support for a camera. Try a different browser, device, or download our mobile app.",
|
|
6481
|
-
description: "Further text of standalone page prompting that camera is not available on user's browser"
|
|
6482
|
-
}
|
|
6483
|
-
});
|
|
6484
|
-
|
|
6485
|
-
// src/legacy/step/cameraStep/cameraCapture/screens/CameraNotSupported/CameraNotSupported.tsx
|
|
6486
|
-
var import_jsx_runtime62 = require("react/jsx-runtime");
|
|
6487
|
-
var CameraNotSupported = () => {
|
|
6488
|
-
const intl = (0, import_react_intl29.useIntl)();
|
|
6489
|
-
return /* @__PURE__ */ (0, import_jsx_runtime62.jsx)("div", { id: "camera-not-supported", children: /* @__PURE__ */ (0, import_jsx_runtime62.jsx)("div", { className: "container p-t-5", children: /* @__PURE__ */ (0, import_jsx_runtime62.jsx)("div", { className: "row", children: /* @__PURE__ */ (0, import_jsx_runtime62.jsxs)("div", { className: "col-md-6 col-md-offset-3", children: [
|
|
6490
|
-
/* @__PURE__ */ (0, import_jsx_runtime62.jsx)("h2", { className: "text-xs-center m-b-3", children: intl.formatMessage(CameraNotSupported_messages_default.title) }),
|
|
6491
|
-
/* @__PURE__ */ (0, import_jsx_runtime62.jsx)("p", { className: "text-xs-center m-b-5", children: intl.formatMessage(CameraNotSupported_messages_default.paragraph) })
|
|
6492
|
-
] }) }) }) });
|
|
6493
|
-
};
|
|
6494
|
-
var CameraNotSupported_default = CameraNotSupported;
|
|
6495
|
-
|
|
6496
|
-
// src/legacy/step/cameraStep/cameraCapture/tracking/index.ts
|
|
6497
|
-
var trackCameraPermissionDenied = (onEvent) => onEvent == null ? void 0 : onEvent("Dynamic Flow - Camera Permission Denied", {});
|
|
6498
|
-
var trackCameraFeedStarted = async (onEvent, props, stream) => onEvent == null ? void 0 : onEvent("Dynamic Flow - Camera Feed Started", await getCameraStartedProperties(props, stream));
|
|
6499
|
-
var trackCameraNotSupported = (onEvent, error) => onEvent == null ? void 0 : onEvent("Dynamic Flow - Camera Not Supported", { Error: error });
|
|
6500
|
-
var getCameraStartedProperties = async (props, videoStream) => {
|
|
6501
|
-
var _a;
|
|
6502
|
-
const videoTrack = getVideoTrack(videoStream);
|
|
6503
|
-
const capabilities = getVideoCapabilities(videoStream);
|
|
6504
|
-
const settings = (_a = videoTrack == null ? void 0 : videoTrack.getSettings) == null ? void 0 : _a.call(videoTrack);
|
|
6505
|
-
return __spreadProps(__spreadValues({}, videoTrack && {
|
|
6506
|
-
"Available Video Devices (by label)": await getAvailableVideoDeviceLabels(),
|
|
6507
|
-
"Active Video Device (by label)": await getActiveVideoDeviceLabel(videoStream),
|
|
6508
|
-
"Camera Capabilities": capabilities,
|
|
6509
|
-
"Camera Settings": settings
|
|
6510
|
-
}), {
|
|
6511
|
-
"Camera Direction (Asked)": props == null ? void 0 : props.direction
|
|
6512
|
-
});
|
|
6513
|
-
};
|
|
6514
|
-
|
|
6515
6522
|
// src/legacy/step/cameraStep/cameraCapture/CameraCapture.tsx
|
|
6516
|
-
var
|
|
6523
|
+
var import_jsx_runtime62 = require("react/jsx-runtime");
|
|
6517
6524
|
function CameraCapture({
|
|
6518
6525
|
direction = "back",
|
|
6519
6526
|
overlay = "",
|
|
@@ -6525,19 +6532,22 @@ function CameraCapture({
|
|
|
6525
6532
|
onCapture,
|
|
6526
6533
|
onEvent
|
|
6527
6534
|
}) {
|
|
6528
|
-
const [mode, setMode] = (0, import_react38.useState)("CAPTURE");
|
|
6535
|
+
const [mode, setMode] = (0, import_react38.useState)("CAPTURE" /* CAPTURE */);
|
|
6536
|
+
const [cameraError, setCameraError] = (0, import_react38.useState)();
|
|
6529
6537
|
const [isVideoMirrored, setIsVideoMirrored] = (0, import_react38.useState)(false);
|
|
6530
6538
|
const [ready, setReady] = (0, import_react38.useState)(false);
|
|
6531
6539
|
const [reviewImage, setReviewImage] = (0, import_react38.useState)();
|
|
6532
6540
|
const webcamReference = (0, import_react38.useRef)(null);
|
|
6533
6541
|
const { videoConstraints } = useVideoConstraints(direction);
|
|
6534
|
-
const orientationLockFeature = useFeatureFlag("camera-orientation-lock" /* CAMERA_ORIENTATION_LOCK */);
|
|
6535
6542
|
const shouldLockOrientation = (0, import_react38.useMemo)(
|
|
6536
|
-
() => !!((
|
|
6537
|
-
[
|
|
6543
|
+
() => !!(isMobile() && mode === "CAPTURE" /* CAPTURE */),
|
|
6544
|
+
[mode]
|
|
6538
6545
|
);
|
|
6539
|
-
const { enterFullScreen, exitFullScreen } = useFullScreenOrientationLock(
|
|
6540
|
-
|
|
6546
|
+
const { enterFullScreen, exitFullScreen } = useFullScreenOrientationLock(
|
|
6547
|
+
shouldLockOrientation,
|
|
6548
|
+
onEvent
|
|
6549
|
+
);
|
|
6550
|
+
const intl = (0, import_react_intl26.useIntl)();
|
|
6541
6551
|
const handleCapture = (0, import_react38.useCallback)(async () => {
|
|
6542
6552
|
var _a, _b, _c, _d, _e, _f;
|
|
6543
6553
|
if (((_a = webcamReference == null ? void 0 : webcamReference.current) == null ? void 0 : _a.video) && ((_c = (_b = webcamReference == null ? void 0 : webcamReference.current) == null ? void 0 : _b.video) == null ? void 0 : _c.readyState) >= 3) {
|
|
@@ -6549,7 +6559,7 @@ function CameraCapture({
|
|
|
6549
6559
|
if (showReview) {
|
|
6550
6560
|
const source = window.URL.createObjectURL(blob);
|
|
6551
6561
|
setReviewImage({ source, blob });
|
|
6552
|
-
setMode("REVIEW");
|
|
6562
|
+
setMode("REVIEW" /* REVIEW */);
|
|
6553
6563
|
} else {
|
|
6554
6564
|
onCapture(blob);
|
|
6555
6565
|
}
|
|
@@ -6562,15 +6572,39 @@ function CameraCapture({
|
|
|
6562
6572
|
}, [webcamReference, showReview, setReviewImage, setMode, onCapture, isVideoMirrored]);
|
|
6563
6573
|
const handleUserMediaError = (0, import_react38.useCallback)(
|
|
6564
6574
|
(error) => {
|
|
6565
|
-
|
|
6566
|
-
|
|
6567
|
-
|
|
6568
|
-
|
|
6575
|
+
setMode("ERROR" /* ERROR */);
|
|
6576
|
+
if (error instanceof DOMException) {
|
|
6577
|
+
switch (error == null ? void 0 : error.name) {
|
|
6578
|
+
case "NotAllowedError":
|
|
6579
|
+
setCameraError({
|
|
6580
|
+
title: intl.formatMessage(CameraCapture_messages_default.noCameraAccessTitle),
|
|
6581
|
+
description: intl.formatMessage(CameraCapture_messages_default.noCameraAccessParagraph),
|
|
6582
|
+
actionButton: intl.formatMessage(CameraCapture_messages_default.noCameraAccessAction),
|
|
6583
|
+
onAction: handleRetryCameraAccess
|
|
6584
|
+
});
|
|
6585
|
+
trackCameraError("Dynamic Flow - Camera Permission Denied", onEvent, error);
|
|
6586
|
+
return;
|
|
6587
|
+
case "NotFoundError":
|
|
6588
|
+
case "OverconstrainedError":
|
|
6589
|
+
case "AbortError":
|
|
6590
|
+
case "NotReadableError":
|
|
6591
|
+
setCameraError({
|
|
6592
|
+
title: intl.formatMessage(CameraCapture_messages_default.cameraConnectionIssueTitle),
|
|
6593
|
+
description: intl.formatMessage(CameraCapture_messages_default.cameraConnectionIssueParagraph),
|
|
6594
|
+
actionButton: intl.formatMessage(CameraCapture_messages_default.cameraConnectionIssueAction),
|
|
6595
|
+
onAction: handleRetryCameraAccess
|
|
6596
|
+
});
|
|
6597
|
+
trackCameraError("Dynamic Flow - Camera Not Accessible", onEvent, error);
|
|
6598
|
+
return;
|
|
6599
|
+
}
|
|
6569
6600
|
}
|
|
6570
|
-
|
|
6571
|
-
|
|
6601
|
+
setCameraError({
|
|
6602
|
+
title: intl.formatMessage(CameraCapture_messages_default.cameraNotSupportedTitle),
|
|
6603
|
+
description: intl.formatMessage(CameraCapture_messages_default.cameraNotSupportedParagraph)
|
|
6604
|
+
});
|
|
6605
|
+
trackCameraError("Dynamic Flow - Camera Not Supported", onEvent, error);
|
|
6572
6606
|
},
|
|
6573
|
-
[
|
|
6607
|
+
[intl, onEvent]
|
|
6574
6608
|
);
|
|
6575
6609
|
const handleUserMedia = (0, import_react38.useCallback)(
|
|
6576
6610
|
(stream) => {
|
|
@@ -6585,17 +6619,17 @@ function CameraCapture({
|
|
|
6585
6619
|
onCapture((reviewImage == null ? void 0 : reviewImage.blob) || null);
|
|
6586
6620
|
};
|
|
6587
6621
|
const handleReviewRetry = () => {
|
|
6588
|
-
setMode("CAPTURE");
|
|
6622
|
+
setMode("CAPTURE" /* CAPTURE */);
|
|
6589
6623
|
setReviewImage(void 0);
|
|
6590
6624
|
};
|
|
6591
|
-
const handleRetryCameraAccess = () => setMode("CAPTURE");
|
|
6625
|
+
const handleRetryCameraAccess = () => setMode("CAPTURE" /* CAPTURE */);
|
|
6592
6626
|
(0, import_react38.useEffect)(() => {
|
|
6593
|
-
if (mode !== "CAPTURE") {
|
|
6627
|
+
if (mode !== "CAPTURE" /* CAPTURE */) {
|
|
6594
6628
|
exitFullScreen();
|
|
6595
6629
|
}
|
|
6596
6630
|
}, [mode, exitFullScreen]);
|
|
6597
|
-
const captureScreen = /* @__PURE__ */ (0,
|
|
6598
|
-
videoConstraints && /* @__PURE__ */ (0,
|
|
6631
|
+
const captureScreen = /* @__PURE__ */ (0, import_jsx_runtime62.jsxs)("div", { className: "camera-capture", children: [
|
|
6632
|
+
videoConstraints && /* @__PURE__ */ (0, import_jsx_runtime62.jsx)(
|
|
6599
6633
|
import_react_webcam.default,
|
|
6600
6634
|
{
|
|
6601
6635
|
ref: webcamReference,
|
|
@@ -6606,7 +6640,7 @@ function CameraCapture({
|
|
|
6606
6640
|
onUserMedia: handleUserMedia
|
|
6607
6641
|
}
|
|
6608
6642
|
),
|
|
6609
|
-
/* @__PURE__ */ (0,
|
|
6643
|
+
/* @__PURE__ */ (0, import_jsx_runtime62.jsx)(
|
|
6610
6644
|
Overlay_default,
|
|
6611
6645
|
{
|
|
6612
6646
|
overlay,
|
|
@@ -6616,8 +6650,8 @@ function CameraCapture({
|
|
|
6616
6650
|
instructions
|
|
6617
6651
|
}
|
|
6618
6652
|
),
|
|
6619
|
-
shouldLockOrientation && /* @__PURE__ */ (0,
|
|
6620
|
-
ready && /* @__PURE__ */ (0,
|
|
6653
|
+
shouldLockOrientation && /* @__PURE__ */ (0, import_jsx_runtime62.jsx)(OrientationLockOverlay_default, {}),
|
|
6654
|
+
ready && /* @__PURE__ */ (0, import_jsx_runtime62.jsx)(
|
|
6621
6655
|
CaptureBottomBar,
|
|
6622
6656
|
{
|
|
6623
6657
|
onCapture: () => {
|
|
@@ -6626,9 +6660,9 @@ function CameraCapture({
|
|
|
6626
6660
|
}
|
|
6627
6661
|
)
|
|
6628
6662
|
] });
|
|
6629
|
-
const reviewScreen = /* @__PURE__ */ (0,
|
|
6630
|
-
/* @__PURE__ */ (0,
|
|
6631
|
-
/* @__PURE__ */ (0,
|
|
6663
|
+
const reviewScreen = /* @__PURE__ */ (0, import_jsx_runtime62.jsxs)("div", { className: "camera-capture", children: [
|
|
6664
|
+
/* @__PURE__ */ (0, import_jsx_runtime62.jsx)("img", { className: "review-image", src: reviewImage == null ? void 0 : reviewImage.source, alt: "" }),
|
|
6665
|
+
/* @__PURE__ */ (0, import_jsx_runtime62.jsx)(
|
|
6632
6666
|
Overlay_default,
|
|
6633
6667
|
{
|
|
6634
6668
|
overlay,
|
|
@@ -6638,19 +6672,18 @@ function CameraCapture({
|
|
|
6638
6672
|
reviewInstructions: intl.formatMessage(CameraCapture_messages_default.reviewInstructions)
|
|
6639
6673
|
}
|
|
6640
6674
|
),
|
|
6641
|
-
/* @__PURE__ */ (0,
|
|
6675
|
+
/* @__PURE__ */ (0, import_jsx_runtime62.jsx)(ReviewBottomBar, { onSubmit: handleReviewSubmit, onRetry: handleReviewRetry })
|
|
6642
6676
|
] });
|
|
6643
|
-
return /* @__PURE__ */ (0,
|
|
6644
|
-
mode === "CAPTURE" && captureScreen,
|
|
6645
|
-
mode === "REVIEW" && reviewScreen,
|
|
6646
|
-
mode === "
|
|
6647
|
-
mode === "CAMERA_NOT_SUPPORTED" && /* @__PURE__ */ (0, import_jsx_runtime63.jsx)(CameraNotSupported_default, {})
|
|
6677
|
+
return /* @__PURE__ */ (0, import_jsx_runtime62.jsxs)("section", { children: [
|
|
6678
|
+
mode === "CAPTURE" /* CAPTURE */ && captureScreen,
|
|
6679
|
+
mode === "REVIEW" /* REVIEW */ && reviewScreen,
|
|
6680
|
+
mode === "ERROR" /* ERROR */ && cameraError && /* @__PURE__ */ (0, import_jsx_runtime62.jsx)(CameraErrorScreen_default, __spreadValues({}, cameraError))
|
|
6648
6681
|
] });
|
|
6649
6682
|
}
|
|
6650
6683
|
var CameraCapture_default = CameraCapture;
|
|
6651
6684
|
|
|
6652
6685
|
// src/legacy/step/cameraStep/CameraStep.tsx
|
|
6653
|
-
var
|
|
6686
|
+
var import_jsx_runtime63 = require("react/jsx-runtime");
|
|
6654
6687
|
function blobToBase64(blob) {
|
|
6655
6688
|
return new Promise((resolve, _) => {
|
|
6656
6689
|
const reader = new FileReader();
|
|
@@ -6688,7 +6721,7 @@ function CameraStep(props) {
|
|
|
6688
6721
|
});
|
|
6689
6722
|
}
|
|
6690
6723
|
};
|
|
6691
|
-
return /* @__PURE__ */ (0,
|
|
6724
|
+
return /* @__PURE__ */ (0, import_jsx_runtime63.jsx)(
|
|
6692
6725
|
CameraCapture_default,
|
|
6693
6726
|
{
|
|
6694
6727
|
overlay,
|
|
@@ -6737,11 +6770,11 @@ function getFirstAction(step) {
|
|
|
6737
6770
|
}
|
|
6738
6771
|
|
|
6739
6772
|
// src/legacy/step/externalConfirmationStep/ExternalConfirmationStep.tsx
|
|
6740
|
-
var
|
|
6773
|
+
var import_react_intl28 = require("react-intl");
|
|
6741
6774
|
|
|
6742
6775
|
// src/legacy/step/externalConfirmationStep/ExternalConfirmationStep.messages.ts
|
|
6743
|
-
var
|
|
6744
|
-
var ExternalConfirmationStep_messages_default = (0,
|
|
6776
|
+
var import_react_intl27 = require("react-intl");
|
|
6777
|
+
var ExternalConfirmationStep_messages_default = (0, import_react_intl27.defineMessages)({
|
|
6745
6778
|
title: {
|
|
6746
6779
|
id: "dynamicFlows.ExternalConfirmation.title",
|
|
6747
6780
|
defaultMessage: "Please confirm",
|
|
@@ -6765,12 +6798,12 @@ var ExternalConfirmationStep_messages_default = (0, import_react_intl31.defineMe
|
|
|
6765
6798
|
});
|
|
6766
6799
|
|
|
6767
6800
|
// src/legacy/step/externalConfirmationStep/ExternalConfirmationStep.tsx
|
|
6768
|
-
var
|
|
6801
|
+
var import_jsx_runtime64 = require("react/jsx-runtime");
|
|
6769
6802
|
var noop5 = () => {
|
|
6770
6803
|
};
|
|
6771
6804
|
var ExternalConfirmationStep = ({ url, onClose }) => {
|
|
6772
|
-
const { formatMessage } = (0,
|
|
6773
|
-
return /* @__PURE__ */ (0,
|
|
6805
|
+
const { formatMessage } = (0, import_react_intl28.useIntl)();
|
|
6806
|
+
return /* @__PURE__ */ (0, import_jsx_runtime64.jsx)(
|
|
6774
6807
|
DynamicLayout_default,
|
|
6775
6808
|
{
|
|
6776
6809
|
components: [
|
|
@@ -6837,9 +6870,9 @@ function getOrigin(url) {
|
|
|
6837
6870
|
// src/legacy/dynamicFlow/BackButton.tsx
|
|
6838
6871
|
var import_components34 = require("@transferwise/components");
|
|
6839
6872
|
var import_icons2 = require("@transferwise/icons");
|
|
6840
|
-
var
|
|
6873
|
+
var import_jsx_runtime65 = require("react/jsx-runtime");
|
|
6841
6874
|
function BackButton({ title, action, onAction }) {
|
|
6842
|
-
return /* @__PURE__ */ (0,
|
|
6875
|
+
return /* @__PURE__ */ (0, import_jsx_runtime65.jsxs)(
|
|
6843
6876
|
"a",
|
|
6844
6877
|
{
|
|
6845
6878
|
href: "/",
|
|
@@ -6850,8 +6883,8 @@ function BackButton({ title, action, onAction }) {
|
|
|
6850
6883
|
onAction(__spreadProps(__spreadValues({}, action), { skipValidation: true }));
|
|
6851
6884
|
},
|
|
6852
6885
|
children: [
|
|
6853
|
-
/* @__PURE__ */ (0,
|
|
6854
|
-
/* @__PURE__ */ (0,
|
|
6886
|
+
/* @__PURE__ */ (0, import_jsx_runtime65.jsx)("span", { className: "sr-only", children: title }),
|
|
6887
|
+
/* @__PURE__ */ (0, import_jsx_runtime65.jsx)(import_components34.Avatar, { type: "icon", children: /* @__PURE__ */ (0, import_jsx_runtime65.jsx)(import_icons2.ArrowLeft, { size: "24" }) })
|
|
6855
6888
|
]
|
|
6856
6889
|
}
|
|
6857
6890
|
);
|
|
@@ -6859,7 +6892,7 @@ function BackButton({ title, action, onAction }) {
|
|
|
6859
6892
|
var BackButton_default = BackButton;
|
|
6860
6893
|
|
|
6861
6894
|
// src/legacy/dynamicFlow/DynamicFlowStep.tsx
|
|
6862
|
-
var
|
|
6895
|
+
var import_jsx_runtime66 = require("react/jsx-runtime");
|
|
6863
6896
|
function DynamicFlowStep(props) {
|
|
6864
6897
|
var _a, _b, _c;
|
|
6865
6898
|
const { step, globalError, onAction } = props;
|
|
@@ -6868,20 +6901,20 @@ function DynamicFlowStep(props) {
|
|
|
6868
6901
|
const { requiresManualTrigger, dismissConfirmation } = useExternal(externalUrl);
|
|
6869
6902
|
if (step === void 0) {
|
|
6870
6903
|
if (globalError) {
|
|
6871
|
-
return /* @__PURE__ */ (0,
|
|
6904
|
+
return /* @__PURE__ */ (0, import_jsx_runtime66.jsx)(DynamicAlert_default, { component: { context: "negative", markdown: globalError, margin: "lg" } });
|
|
6872
6905
|
}
|
|
6873
6906
|
return null;
|
|
6874
6907
|
}
|
|
6875
6908
|
if (externalUrl && requiresManualTrigger) {
|
|
6876
|
-
return /* @__PURE__ */ (0,
|
|
6909
|
+
return /* @__PURE__ */ (0, import_jsx_runtime66.jsx)(ExternalConfirmationStep_default, { url: externalUrl, onClose: dismissConfirmation });
|
|
6877
6910
|
}
|
|
6878
6911
|
if (isCameraStep(step)) {
|
|
6879
|
-
return /* @__PURE__ */ (0,
|
|
6912
|
+
return /* @__PURE__ */ (0, import_jsx_runtime66.jsx)(CameraStep_default, __spreadProps(__spreadValues({}, props), { step }));
|
|
6880
6913
|
}
|
|
6881
|
-
return /* @__PURE__ */ (0,
|
|
6882
|
-
backButton && /* @__PURE__ */ (0,
|
|
6883
|
-
globalError ? /* @__PURE__ */ (0,
|
|
6884
|
-
/* @__PURE__ */ (0,
|
|
6914
|
+
return /* @__PURE__ */ (0, import_jsx_runtime66.jsxs)(import_jsx_runtime66.Fragment, { children: [
|
|
6915
|
+
backButton && /* @__PURE__ */ (0, import_jsx_runtime66.jsx)(BackButton_default, __spreadProps(__spreadValues({}, backButton), { onAction })),
|
|
6916
|
+
globalError ? /* @__PURE__ */ (0, import_jsx_runtime66.jsx)(DynamicAlert_default, { component: { context: "negative", markdown: globalError, margin: "lg" } }) : null,
|
|
6917
|
+
/* @__PURE__ */ (0, import_jsx_runtime66.jsx)(LayoutStep_default, __spreadProps(__spreadValues({}, props), { stepSpecification: step }))
|
|
6885
6918
|
] });
|
|
6886
6919
|
}
|
|
6887
6920
|
|
|
@@ -7021,7 +7054,7 @@ var isInlineSchema = (schema) => schema !== void 0 && typeof schema === "object"
|
|
|
7021
7054
|
// src/legacy/dynamicFlow/utils/useLoader.tsx
|
|
7022
7055
|
var import_components35 = require("@transferwise/components");
|
|
7023
7056
|
var import_react42 = require("react");
|
|
7024
|
-
var
|
|
7057
|
+
var import_jsx_runtime67 = require("react/jsx-runtime");
|
|
7025
7058
|
function useLoader(loaderConfig, initialState) {
|
|
7026
7059
|
const config = __spreadValues({
|
|
7027
7060
|
size: import_components35.Size.EXTRA_LARGE,
|
|
@@ -7030,7 +7063,7 @@ function useLoader(loaderConfig, initialState) {
|
|
|
7030
7063
|
}, loaderConfig);
|
|
7031
7064
|
const [loadingState, setLoadingState] = (0, import_react42.useState)(initialState);
|
|
7032
7065
|
const shouldDisplayLoader = config.initial && loadingState === "initial" || config.submission && loadingState === "submission";
|
|
7033
|
-
const loader = shouldDisplayLoader ? /* @__PURE__ */ (0,
|
|
7066
|
+
const loader = shouldDisplayLoader ? /* @__PURE__ */ (0, import_jsx_runtime67.jsx)(
|
|
7034
7067
|
import_components35.Loader,
|
|
7035
7068
|
{
|
|
7036
7069
|
size: config.size,
|
|
@@ -7046,11 +7079,11 @@ var import_react43 = require("react");
|
|
|
7046
7079
|
|
|
7047
7080
|
// src/common/errorBoundary/ErrorBoundaryAlert.tsx
|
|
7048
7081
|
var import_components36 = require("@transferwise/components");
|
|
7049
|
-
var
|
|
7050
|
-
var
|
|
7082
|
+
var import_react_intl29 = require("react-intl");
|
|
7083
|
+
var import_jsx_runtime68 = require("react/jsx-runtime");
|
|
7051
7084
|
function ErrorBoundaryAlert({ onDismiss }) {
|
|
7052
|
-
const { formatMessage } = (0,
|
|
7053
|
-
return /* @__PURE__ */ (0,
|
|
7085
|
+
const { formatMessage } = (0, import_react_intl29.useIntl)();
|
|
7086
|
+
return /* @__PURE__ */ (0, import_jsx_runtime68.jsx)(
|
|
7054
7087
|
import_components36.Alert,
|
|
7055
7088
|
{
|
|
7056
7089
|
action: {
|
|
@@ -7066,7 +7099,7 @@ function ErrorBoundaryAlert({ onDismiss }) {
|
|
|
7066
7099
|
}
|
|
7067
7100
|
|
|
7068
7101
|
// src/common/errorBoundary/ErrorBoundary.tsx
|
|
7069
|
-
var
|
|
7102
|
+
var import_jsx_runtime69 = require("react/jsx-runtime");
|
|
7070
7103
|
var noop6 = () => {
|
|
7071
7104
|
};
|
|
7072
7105
|
var ErrorBoundary = class extends import_react43.Component {
|
|
@@ -7087,8 +7120,8 @@ var ErrorBoundary = class extends import_react43.Component {
|
|
|
7087
7120
|
render() {
|
|
7088
7121
|
const { children } = this.props;
|
|
7089
7122
|
const { hasError, isFatalError } = this.state;
|
|
7090
|
-
return /* @__PURE__ */ (0,
|
|
7091
|
-
hasError && /* @__PURE__ */ (0,
|
|
7123
|
+
return /* @__PURE__ */ (0, import_jsx_runtime69.jsxs)(import_jsx_runtime69.Fragment, { children: [
|
|
7124
|
+
hasError && /* @__PURE__ */ (0, import_jsx_runtime69.jsx)(ErrorBoundaryAlert, { onDismiss: this.handleErrorReset }),
|
|
7092
7125
|
!isFatalError && children
|
|
7093
7126
|
] });
|
|
7094
7127
|
}
|
|
@@ -7191,7 +7224,7 @@ var assertResponseIsValid = (response) => {
|
|
|
7191
7224
|
var isResponse = (response) => typeof response === "object" && response !== null && "clone" in response && "bodyUsed" in response;
|
|
7192
7225
|
|
|
7193
7226
|
// src/legacy/dynamicFlow/DynamicFlow.tsx
|
|
7194
|
-
var
|
|
7227
|
+
var import_jsx_runtime70 = require("react/jsx-runtime");
|
|
7195
7228
|
var noop7 = () => {
|
|
7196
7229
|
};
|
|
7197
7230
|
var DynamicFlowComponent = ({
|
|
@@ -7207,7 +7240,7 @@ var DynamicFlowComponent = ({
|
|
|
7207
7240
|
onEvent = noop7,
|
|
7208
7241
|
onLog = noop7
|
|
7209
7242
|
}) => {
|
|
7210
|
-
const { locale } = (0,
|
|
7243
|
+
const { locale } = (0, import_react_intl30.useIntl)();
|
|
7211
7244
|
const {
|
|
7212
7245
|
formErrors,
|
|
7213
7246
|
globalError,
|
|
@@ -7416,7 +7449,7 @@ var DynamicFlowComponent = ({
|
|
|
7416
7449
|
await actionHandler(action);
|
|
7417
7450
|
}
|
|
7418
7451
|
};
|
|
7419
|
-
return /* @__PURE__ */ (0,
|
|
7452
|
+
return /* @__PURE__ */ (0, import_jsx_runtime70.jsx)(LogProvider, { flowId, stepId: (step == null ? void 0 : step.id) || (step == null ? void 0 : step.key), onLog, children: /* @__PURE__ */ (0, import_jsx_runtime70.jsx)(EventsContextProvider, { metadata: analyticsMetadata, onEvent, children: /* @__PURE__ */ (0, import_jsx_runtime70.jsx)(DynamicFlowProvider, { loading: isLoading, children: /* @__PURE__ */ (0, import_jsx_runtime70.jsx)(HttpClientProvider, { httpClient, children: /* @__PURE__ */ (0, import_jsx_runtime70.jsx)(FeatureContextProvider, { features, children: loader !== null ? loader : /* @__PURE__ */ (0, import_jsx_runtime70.jsx)(
|
|
7420
7453
|
DynamicFlowStep,
|
|
7421
7454
|
{
|
|
7422
7455
|
step,
|
|
@@ -7433,7 +7466,7 @@ var DynamicFlowComponent = ({
|
|
|
7433
7466
|
) }) }) }) }) });
|
|
7434
7467
|
};
|
|
7435
7468
|
function DynamicFlow(props) {
|
|
7436
|
-
return /* @__PURE__ */ (0,
|
|
7469
|
+
return /* @__PURE__ */ (0, import_jsx_runtime70.jsx)(ErrorBoundary_default, { onError: props.onError, children: /* @__PURE__ */ (0, import_jsx_runtime70.jsx)(DynamicFlowComponent, __spreadValues({}, props)) });
|
|
7437
7470
|
}
|
|
7438
7471
|
var DynamicFlow_default = DynamicFlow;
|
|
7439
7472
|
var combineModels2 = (formModels) => Object.values(formModels).reduce((previous, model) => __spreadValues(__spreadValues({}, previous), model), {});
|
|
@@ -7450,19 +7483,19 @@ var shouldTriggerRefresh = (props) => {
|
|
|
7450
7483
|
};
|
|
7451
7484
|
|
|
7452
7485
|
// src/legacy/jsonSchemaForm/JsonSchemaForm.tsx
|
|
7453
|
-
var
|
|
7486
|
+
var import_jsx_runtime71 = require("react/jsx-runtime");
|
|
7454
7487
|
function JsonSchemaForm(props) {
|
|
7455
7488
|
const schemaProps = __spreadValues({
|
|
7456
7489
|
model: null,
|
|
7457
7490
|
errors: null
|
|
7458
7491
|
}, props);
|
|
7459
7492
|
const { baseUrl = "", onEvent = noop8, onLog = noop8 } = props;
|
|
7460
|
-
return /* @__PURE__ */ (0,
|
|
7493
|
+
return /* @__PURE__ */ (0, import_jsx_runtime71.jsx)(LogProvider, { flowId: "JsonSchemaForm", stepId: "JsonSchemaForm", onLog, children: /* @__PURE__ */ (0, import_jsx_runtime71.jsx)(
|
|
7461
7494
|
EventsContextProvider,
|
|
7462
7495
|
{
|
|
7463
7496
|
metadata: { flowId: "JsonSchemaForm", stepId: "JsonSchemaForm" },
|
|
7464
7497
|
onEvent,
|
|
7465
|
-
children: /* @__PURE__ */ (0,
|
|
7498
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime71.jsx)(HttpClientProviderFromBaseUrl, { baseUrl, children: /* @__PURE__ */ (0, import_jsx_runtime71.jsx)(GenericSchema_default, __spreadValues({}, schemaProps)) })
|
|
7466
7499
|
}
|
|
7467
7500
|
) });
|
|
7468
7501
|
}
|
|
@@ -7523,6 +7556,9 @@ var en_default = {
|
|
|
7523
7556
|
"dynamicFlows.ArraySchema.maxItemsError": "Please add {maxItems} or fewer.",
|
|
7524
7557
|
"dynamicFlows.ArraySchema.minItemsError": "Please add at least {minItems}.",
|
|
7525
7558
|
"dynamicFlows.ArraySchema.removeItem": "Remove",
|
|
7559
|
+
"dynamicFlows.CameraCapture.CameraConnectionIssue.action": "Try again",
|
|
7560
|
+
"dynamicFlows.CameraCapture.CameraConnectionIssue.paragraph": "Please check if it is connected and try again.",
|
|
7561
|
+
"dynamicFlows.CameraCapture.CameraConnectionIssue.title": "We can't access your camera",
|
|
7526
7562
|
"dynamicFlows.CameraCapture.CameraNotSupported.paragraph": "The browser you're using doesn't have support for a camera. Try a different browser, device, or download our mobile app.",
|
|
7527
7563
|
"dynamicFlows.CameraCapture.CameraNotSupported.title": "Camera not supported",
|
|
7528
7564
|
"dynamicFlows.CameraCapture.NoCameraAccess.action": "Enable camera access",
|
|
@@ -7542,6 +7578,7 @@ var en_default = {
|
|
|
7542
7578
|
"dynamicFlows.ControlFeedback.patternDate": "Please enter a date in the corrrect format.",
|
|
7543
7579
|
"dynamicFlows.ControlFeedback.required": "Please fill out this field.",
|
|
7544
7580
|
"dynamicFlows.ControlFeedback.type": "Incorrect type",
|
|
7581
|
+
"dynamicFlows.DefaultErrorMessages.required": "Please fill out this field.",
|
|
7545
7582
|
"dynamicFlows.DynamicExternal.retryTitle": "Reopen window",
|
|
7546
7583
|
"dynamicFlows.DynamicParagraph.copied": "Copied to clipboard",
|
|
7547
7584
|
"dynamicFlows.DynamicParagraph.copy": "Copy",
|
|
@@ -7878,7 +7915,7 @@ var pl_default = {
|
|
|
7878
7915
|
// src/i18n/pt.json
|
|
7879
7916
|
var pt_default = {
|
|
7880
7917
|
"dynamicFlows.ArraySchema.addItem": "Salvar",
|
|
7881
|
-
"dynamicFlows.ArraySchema.addItemTitle": "
|
|
7918
|
+
"dynamicFlows.ArraySchema.addItemTitle": "Adicionar item",
|
|
7882
7919
|
"dynamicFlows.ArraySchema.editItem": "Salvar",
|
|
7883
7920
|
"dynamicFlows.ArraySchema.maxItemsError": "Adicione {maxItems} ou menos.",
|
|
7884
7921
|
"dynamicFlows.ArraySchema.minItemsError": "Adicione pelo menos {minItems}.",
|
|
@@ -7891,7 +7928,7 @@ var pt_default = {
|
|
|
7891
7928
|
"dynamicFlows.CameraCapture.reviewInstructions": "A sua foto est\xE1 clara, leg\xEDvel e aparece por inteiro?",
|
|
7892
7929
|
"dynamicFlows.CameraCapture.reviewRetry": "N\xE3o, tentar novamente",
|
|
7893
7930
|
"dynamicFlows.CameraCapture.reviewSubmit": "Sim, enviar",
|
|
7894
|
-
"dynamicFlows.CameraCapture.rotatePhone.text": "
|
|
7931
|
+
"dynamicFlows.CameraCapture.rotatePhone.text": "Gire o telefone para o modo retrato para tirar uma foto",
|
|
7895
7932
|
"dynamicFlows.ControlFeedback.maxLength": "Por favor, insira {maxLength} caracteres ou menos.",
|
|
7896
7933
|
"dynamicFlows.ControlFeedback.maximum": "Por favor, insira um n\xFAmero que seja {maximum} ou menos.",
|
|
7897
7934
|
"dynamicFlows.ControlFeedback.maximumDate": "Por favor, insira uma data que seja em ou antes de {maximum}.",
|
|
@@ -8103,22 +8140,22 @@ var tr_default = {
|
|
|
8103
8140
|
// src/i18n/zh_CN.json
|
|
8104
8141
|
var zh_CN_default = {
|
|
8105
8142
|
"dynamicFlows.ArraySchema.addItem": "\u4FDD\u5B58",
|
|
8106
|
-
"dynamicFlows.ArraySchema.addItemTitle": "
|
|
8143
|
+
"dynamicFlows.ArraySchema.addItemTitle": "\u6DFB\u52A0\u9879\u76EE",
|
|
8107
8144
|
"dynamicFlows.ArraySchema.editItem": "\u4FDD\u5B58",
|
|
8108
|
-
"dynamicFlows.ArraySchema.maxItemsError": "\u8BF7\u6DFB\u52A0 {maxItems} \
|
|
8109
|
-
"dynamicFlows.ArraySchema.minItemsError": "\u8BF7\u81F3\u5C11\u6DFB\u52A0 {minItems}\u3002",
|
|
8110
|
-
"dynamicFlows.ArraySchema.removeItem": "\
|
|
8111
|
-
"dynamicFlows.CameraCapture.CameraNotSupported.paragraph": "
|
|
8145
|
+
"dynamicFlows.ArraySchema.maxItemsError": "\u8BF7\u6DFB\u52A0\u4E0D\u8D85\u8FC7 {maxItems} \u9879\u3002",
|
|
8146
|
+
"dynamicFlows.ArraySchema.minItemsError": "\u8BF7\u81F3\u5C11\u6DFB\u52A0 {minItems} \u9879\u3002",
|
|
8147
|
+
"dynamicFlows.ArraySchema.removeItem": "\u79FB\u9664",
|
|
8148
|
+
"dynamicFlows.CameraCapture.CameraNotSupported.paragraph": "\u60A8\u76EE\u524D\u4F7F\u7528\u7684\u6D4F\u89C8\u5668\u4E0D\u652F\u6301\u6444\u50CF\u5934\u3002\u8BF7\u5C1D\u8BD5\u5176\u4ED6\u6D4F\u89C8\u5668\u3001\u8BBE\u5907\u6216\u4E0B\u8F7D\u6211\u4EEC\u7684\u5E94\u7528\u3002",
|
|
8112
8149
|
"dynamicFlows.CameraCapture.CameraNotSupported.title": "\u4E0D\u652F\u6301\u6444\u50CF\u5934",
|
|
8113
|
-
"dynamicFlows.CameraCapture.NoCameraAccess.action": "
|
|
8114
|
-
"dynamicFlows.CameraCapture.NoCameraAccess.paragraph": "
|
|
8115
|
-
"dynamicFlows.CameraCapture.NoCameraAccess.title": "
|
|
8150
|
+
"dynamicFlows.CameraCapture.NoCameraAccess.action": "\u5141\u8BB8\u8BBF\u95EE\u6444\u50CF\u5934",
|
|
8151
|
+
"dynamicFlows.CameraCapture.NoCameraAccess.paragraph": "\u5728\u6D4F\u89C8\u5668\u8BBE\u7F6E\u4E2D\u542F\u7528\u76F8\u673A\u8BBF\u95EE\u6743\u9650\uFF0C\u518D\u91CD\u65B0\u5C1D\u8BD5\u3002",
|
|
8152
|
+
"dynamicFlows.CameraCapture.NoCameraAccess.title": "\u6211\u4EEC\u65E0\u6CD5\u8BBF\u95EE\u60A8\u7684\u6444\u50CF\u5934",
|
|
8116
8153
|
"dynamicFlows.CameraCapture.reviewInstructions": "\u60A8\u7684\u56FE\u7247\u662F\u5426\u6E05\u6670\u3001\u53EF\u8BFB\u548C\u5B8C\u6574\uFF1F",
|
|
8117
|
-
"dynamicFlows.CameraCapture.reviewRetry": "\u5426\uFF0C\
|
|
8154
|
+
"dynamicFlows.CameraCapture.reviewRetry": "\u5426\uFF0C\u518D\u8BD5\u4E00\u6B21",
|
|
8118
8155
|
"dynamicFlows.CameraCapture.reviewSubmit": "\u662F\uFF0C\u63D0\u4EA4",
|
|
8119
|
-
"dynamicFlows.CameraCapture.rotatePhone.text": "
|
|
8120
|
-
"dynamicFlows.ControlFeedback.maxLength": "\u8BF7\u8F93\u5165 {maxLength} \u4E2A\
|
|
8121
|
-
"dynamicFlows.ControlFeedback.maximum": "\u8BF7\u8F93\u5165\u4E00\u4E2A\u5C0F\u4E8E\u6216\u7B49\u4E8E {maximum} \u7684\u6570\u5B57",
|
|
8156
|
+
"dynamicFlows.CameraCapture.rotatePhone.text": "\u5C06\u624B\u673A\u65CB\u8F6C\u5230\u7EB5\u5411\u89C6\u56FE\u4EE5\u62CD\u7167",
|
|
8157
|
+
"dynamicFlows.ControlFeedback.maxLength": "\u8BF7\u8F93\u5165\u4E0D\u8D85\u8FC7 {maxLength} \u4E2A\u5B57\u7B26\u3002",
|
|
8158
|
+
"dynamicFlows.ControlFeedback.maximum": "\u8BF7\u8F93\u5165\u4E00\u4E2A\u5C0F\u4E8E\u6216\u7B49\u4E8E {maximum} \u7684\u6570\u5B57\u3002",
|
|
8122
8159
|
"dynamicFlows.ControlFeedback.maximumDate": "\u8BF7\u8F93\u5165 {maximum} \u6216\u4E4B\u524D\u7684\u65E5\u671F",
|
|
8123
8160
|
"dynamicFlows.ControlFeedback.minLength": "\u8BF7\u81F3\u5C11\u8F93\u5165 {minLength} \u4E2A\u5B57\u7B26",
|
|
8124
8161
|
"dynamicFlows.ControlFeedback.minimum": "\u8BF7\u8F93\u5165\u4E00\u4E2A\u5927\u4E8E\u6216\u7B49\u4E8E {minimum} \u7684\u6570\u5B57",
|
|
@@ -8126,21 +8163,21 @@ var zh_CN_default = {
|
|
|
8126
8163
|
"dynamicFlows.ControlFeedback.pattern": "\u8BF7\u4EE5\u6B63\u786E\u7684\u683C\u5F0F\u8F93\u5165",
|
|
8127
8164
|
"dynamicFlows.ControlFeedback.patternDate": "\u8BF7\u4EE5\u6B63\u786E\u7684\u683C\u5F0F\u8F93\u5165\u65E5\u671F",
|
|
8128
8165
|
"dynamicFlows.ControlFeedback.required": "\u8BF7\u586B\u5199\u6B64\u5B57\u6BB5\u3002",
|
|
8129
|
-
"dynamicFlows.ControlFeedback.type": "\u7C7B\u578B\
|
|
8166
|
+
"dynamicFlows.ControlFeedback.type": "\u7C7B\u578B\u9519\u8BEF",
|
|
8130
8167
|
"dynamicFlows.DynamicExternal.retryTitle": "\u91CD\u65B0\u6253\u5F00\u7A97\u53E3",
|
|
8131
8168
|
"dynamicFlows.DynamicParagraph.copied": "\u5DF2\u590D\u5236\u5230\u526A\u8D34\u677F",
|
|
8132
8169
|
"dynamicFlows.DynamicParagraph.copy": "\u590D\u5236",
|
|
8133
|
-
"dynamicFlows.ErrorBoundary.errorAlert": "\u7CDF\u7CD5\u3002\u51FA\
|
|
8170
|
+
"dynamicFlows.ErrorBoundary.errorAlert": "\u7CDF\u7CD5\u3002\u51FA\u9519\u4E86\u2026",
|
|
8134
8171
|
"dynamicFlows.ErrorBoundary.retry": "\u91CD\u8BD5",
|
|
8135
8172
|
"dynamicFlows.ExternalConfirmation.cancel": "\u53D6\u6D88",
|
|
8136
|
-
"dynamicFlows.ExternalConfirmation.description": "
|
|
8137
|
-
"dynamicFlows.ExternalConfirmation.open": "
|
|
8138
|
-
"dynamicFlows.ExternalConfirmation.title": "
|
|
8173
|
+
"dynamicFlows.ExternalConfirmation.description": "\u8BF7\u786E\u8BA4\u60A8\u662F\u5426\u8981\u5728\u65B0\u6807\u7B7E\u9875\u4E2D\u6253\u5F00**{origin}**\u3002",
|
|
8174
|
+
"dynamicFlows.ExternalConfirmation.open": "\u5728\u65B0\u6807\u7B7E\u9875\u4E2D\u6253\u5F00",
|
|
8175
|
+
"dynamicFlows.ExternalConfirmation.title": "\u8BF7\u786E\u8BA4",
|
|
8139
8176
|
"dynamicFlows.Help.ariaLabel": "\u70B9\u51FB\u6B64\u5904\u83B7\u53D6\u66F4\u591A\u4FE1\u606F\u3002",
|
|
8140
8177
|
"dynamicFlows.MultipleFileUploadSchema.maxFileSizeError": "\u62B1\u6B49\uFF0C\u8BE5\u6587\u4EF6\u592A\u5927\u3002\u8BF7\u4E0A\u4F20\u4E00\u4E2A\u66F4\u5C0F\u7684\u6587\u4EF6\u3002",
|
|
8141
|
-
"dynamicFlows.MultipleFileUploadSchema.maxItemsError": "\u8BF7\u4E0A\u4F20 {maxItems} \u4E2A\
|
|
8142
|
-
"dynamicFlows.MultipleFileUploadSchema.minItemsError": "\u8BF7\u81F3\u5C11
|
|
8143
|
-
"dynamicFlows.PersistAsyncSchema.genericError": "\u51FA\
|
|
8178
|
+
"dynamicFlows.MultipleFileUploadSchema.maxItemsError": "\u8BF7\u4E0A\u4F20\u4E0D\u8D85\u8FC7 {maxItems} \u4E2A\u6587\u4EF6\u3002",
|
|
8179
|
+
"dynamicFlows.MultipleFileUploadSchema.minItemsError": "\u8BF7\u4E0A\u4F20\u81F3\u5C11 {minItems} \u4E2A\u6587\u4EF6\u3002",
|
|
8180
|
+
"dynamicFlows.PersistAsyncSchema.genericError": "\u51FA\u9519\u4E86\uFF0C\u8BF7\u7A0D\u540E\u518D\u8BD5\uFF01",
|
|
8144
8181
|
"dynamicFlows.ReadOnlySchema.no": "\u5426",
|
|
8145
8182
|
"dynamicFlows.ReadOnlySchema.yes": "\u662F"
|
|
8146
8183
|
};
|