@wise/dynamic-flow-client 2.3.0-beta-c55f65.18 → 2.3.0-beta-7d9b21.21
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/i18n/en.json +0 -1
- package/build/main.css +1 -1
- package/build/main.js +58 -72
- package/build/main.min.js +1 -1
- package/build/types/step/cameraStep/cameraCapture/components/bottomBar/BottomBar.d.ts +7 -0
- package/build/types/step/cameraStep/cameraCapture/components/index.d.ts +2 -7
- package/build/types/step/cameraStep/cameraCapture/components/orientationLockOverlay/OrientationLockOverlay.messages.d.ts +0 -5
- package/package.json +1 -1
package/build/i18n/en.json
CHANGED
|
@@ -13,7 +13,6 @@
|
|
|
13
13
|
"dynamicFlows.CameraCapture.reviewInstructions": "Is your picture clear, readable and complete?",
|
|
14
14
|
"dynamicFlows.CameraCapture.reviewRetry": "No, try again",
|
|
15
15
|
"dynamicFlows.CameraCapture.reviewSubmit": "Yes, submit",
|
|
16
|
-
"dynamicFlows.CameraCapture.rotatePhone.imgAlt": "Rotate your phone icon",
|
|
17
16
|
"dynamicFlows.CameraCapture.rotatePhone.text": "Rotate your phone to portrait view to take a photo",
|
|
18
17
|
"dynamicFlows.ControlFeedback.maxLength": "Please enter {maxLength} or fewer characters.",
|
|
19
18
|
"dynamicFlows.ControlFeedback.maximum": "Please enter a number that's {maximum} or less.",
|
package/build/main.css
CHANGED
|
@@ -155,13 +155,13 @@
|
|
|
155
155
|
inset: 0;
|
|
156
156
|
background-color: var(--color-dark);
|
|
157
157
|
color: var(--color-white);
|
|
158
|
-
text-align: center;
|
|
159
158
|
font-size: var(--font-size-16);
|
|
160
159
|
font-weight: var(--font-weight-semi-bold);
|
|
161
160
|
flex-direction: column;
|
|
162
161
|
justify-content: center;
|
|
163
162
|
align-items: center;
|
|
164
163
|
z-index: 1000;
|
|
164
|
+
padding: 24px;
|
|
165
165
|
}
|
|
166
166
|
@media screen and (orientation: landscape) and (max-height: 767px) {
|
|
167
167
|
.orientation-lock-overlay {
|
package/build/main.js
CHANGED
|
@@ -1890,9 +1890,6 @@ var isTouchScreen = (navigator2 = window.navigator, matchMedia = window.matchMed
|
|
|
1890
1890
|
if ("maxTouchPoints" in navigator2) {
|
|
1891
1891
|
return navigator2.maxTouchPoints > 0;
|
|
1892
1892
|
}
|
|
1893
|
-
if ("msMaxTouchPoints" in navigator2) {
|
|
1894
|
-
return navigator2["msMaxTouchPoints"] > 0;
|
|
1895
|
-
}
|
|
1896
1893
|
const mQ = matchMedia == null ? void 0 : matchMedia("(pointer:coarse)");
|
|
1897
1894
|
if ((mQ == null ? void 0 : mQ.media) === "(pointer:coarse)") {
|
|
1898
1895
|
return !!mQ.matches;
|
|
@@ -6026,58 +6023,18 @@ var CameraCapture_messages_default = (0, import_react_intl22.defineMessages)({
|
|
|
6026
6023
|
}
|
|
6027
6024
|
});
|
|
6028
6025
|
|
|
6029
|
-
// src/step/cameraStep/cameraCapture/components/
|
|
6026
|
+
// src/step/cameraStep/cameraCapture/components/bottomBar/BottomBar.tsx
|
|
6030
6027
|
var import_components27 = require("@transferwise/components");
|
|
6031
|
-
var import_react_intl25 = require("react-intl");
|
|
6032
|
-
|
|
6033
|
-
// src/step/cameraStep/cameraCapture/components/orientationLockOverlay/OrientationLockOverlay.tsx
|
|
6034
|
-
var import_react_intl24 = require("react-intl");
|
|
6035
|
-
|
|
6036
|
-
// src/step/cameraStep/cameraCapture/components/orientationLockOverlay/OrientationLockOverlay.messages.ts
|
|
6037
6028
|
var import_react_intl23 = require("react-intl");
|
|
6038
|
-
var OrientationLockOverlay_messages_default = (0, import_react_intl23.defineMessages)({
|
|
6039
|
-
text: {
|
|
6040
|
-
id: "dynamicFlows.CameraCapture.rotatePhone.text",
|
|
6041
|
-
defaultMessage: "Rotate your phone to portrait view to take a photo",
|
|
6042
|
-
description: "Prompt the user to rotate their phone from landscape to portrait mode when attempting to take a photo"
|
|
6043
|
-
},
|
|
6044
|
-
imgAlt: {
|
|
6045
|
-
id: "dynamicFlows.CameraCapture.rotatePhone.imgAlt",
|
|
6046
|
-
defaultMessage: "Rotate your phone icon",
|
|
6047
|
-
description: "Rotate phone icon alt text"
|
|
6048
|
-
}
|
|
6049
|
-
});
|
|
6050
|
-
|
|
6051
|
-
// src/step/cameraStep/cameraCapture/components/orientationLockOverlay/OrientationLockOverlay.tsx
|
|
6052
6029
|
var import_jsx_runtime56 = require("react/jsx-runtime");
|
|
6053
|
-
var
|
|
6054
|
-
const intl = (0, import_react_intl24.useIntl)();
|
|
6055
|
-
return /* @__PURE__ */ (0, import_jsx_runtime56.jsxs)("div", { className: "orientation-lock-overlay p-x-3 p-y-3", "data-testid": "orientation-lock", children: [
|
|
6056
|
-
/* @__PURE__ */ (0, import_jsx_runtime56.jsx)(
|
|
6057
|
-
"img",
|
|
6058
|
-
{
|
|
6059
|
-
className: "m-b-3",
|
|
6060
|
-
src: "https://wise.com/public-resources/assets/camera-guidelines/icon-rotate-phone.svg",
|
|
6061
|
-
width: "96",
|
|
6062
|
-
height: "96",
|
|
6063
|
-
alt: intl.formatMessage(OrientationLockOverlay_messages_default.imgAlt)
|
|
6064
|
-
}
|
|
6065
|
-
),
|
|
6066
|
-
/* @__PURE__ */ (0, import_jsx_runtime56.jsx)("p", { className: "text-center m-b-0", children: intl.formatMessage(OrientationLockOverlay_messages_default.text) })
|
|
6067
|
-
] });
|
|
6068
|
-
};
|
|
6069
|
-
var OrientationLockOverlay_default = OrientationLockOverlay;
|
|
6070
|
-
|
|
6071
|
-
// src/step/cameraStep/cameraCapture/components/index.tsx
|
|
6072
|
-
var import_jsx_runtime57 = require("react/jsx-runtime");
|
|
6073
|
-
var CaptureBottomBar = ({ onCapture }) => /* @__PURE__ */ (0, import_jsx_runtime57.jsx)("div", { className: "bottom-bar", children: /* @__PURE__ */ (0, import_jsx_runtime57.jsx)(CaptureButton, { onClick: onCapture }) });
|
|
6030
|
+
var CaptureBottomBar = ({ onCapture }) => /* @__PURE__ */ (0, import_jsx_runtime56.jsx)("div", { className: "bottom-bar", children: /* @__PURE__ */ (0, import_jsx_runtime56.jsx)(CaptureButton, { onClick: onCapture }) });
|
|
6074
6031
|
var ReviewBottomBar = ({
|
|
6075
6032
|
onSubmit,
|
|
6076
6033
|
onRetry
|
|
6077
6034
|
}) => {
|
|
6078
|
-
const intl = (0,
|
|
6079
|
-
return /* @__PURE__ */ (0,
|
|
6080
|
-
/* @__PURE__ */ (0,
|
|
6035
|
+
const intl = (0, import_react_intl23.useIntl)();
|
|
6036
|
+
return /* @__PURE__ */ (0, import_jsx_runtime56.jsx)("div", { className: "bottom-bar p-x-2", children: /* @__PURE__ */ (0, import_jsx_runtime56.jsx)("div", { className: "row", children: /* @__PURE__ */ (0, import_jsx_runtime56.jsxs)("div", { className: "col-xs-12 col-md-6 col-md-offset-3", children: [
|
|
6037
|
+
/* @__PURE__ */ (0, import_jsx_runtime56.jsx)(
|
|
6081
6038
|
import_components27.Button,
|
|
6082
6039
|
{
|
|
6083
6040
|
className: "m-b-1",
|
|
@@ -6088,7 +6045,7 @@ var ReviewBottomBar = ({
|
|
|
6088
6045
|
children: intl.formatMessage(CameraCapture_messages_default.reviewSubmit)
|
|
6089
6046
|
}
|
|
6090
6047
|
),
|
|
6091
|
-
/* @__PURE__ */ (0,
|
|
6048
|
+
/* @__PURE__ */ (0, import_jsx_runtime56.jsx)(
|
|
6092
6049
|
import_components27.Button,
|
|
6093
6050
|
{
|
|
6094
6051
|
className: "m-b-2",
|
|
@@ -6102,47 +6059,75 @@ var ReviewBottomBar = ({
|
|
|
6102
6059
|
)
|
|
6103
6060
|
] }) }) });
|
|
6104
6061
|
};
|
|
6105
|
-
var CaptureButton = ({ onClick }) => /* @__PURE__ */ (0,
|
|
6062
|
+
var CaptureButton = ({ onClick }) => /* @__PURE__ */ (0, import_jsx_runtime56.jsx)(
|
|
6106
6063
|
"button",
|
|
6107
6064
|
{
|
|
6108
6065
|
type: "button",
|
|
6109
6066
|
className: "camera-capture-btn m-b-2",
|
|
6110
6067
|
"data-testid": "camera-capture-button",
|
|
6111
6068
|
onClick,
|
|
6112
|
-
children: /* @__PURE__ */ (0,
|
|
6069
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime56.jsx)("span", { className: "camera-capture-btn-inner" })
|
|
6113
6070
|
}
|
|
6114
6071
|
);
|
|
6115
6072
|
|
|
6073
|
+
// src/step/cameraStep/cameraCapture/components/orientationLockOverlay/OrientationLockOverlay.tsx
|
|
6074
|
+
var import_react_intl25 = require("react-intl");
|
|
6075
|
+
|
|
6076
|
+
// src/step/cameraStep/cameraCapture/components/orientationLockOverlay/OrientationLockOverlay.messages.ts
|
|
6077
|
+
var import_react_intl24 = require("react-intl");
|
|
6078
|
+
var OrientationLockOverlay_messages_default = (0, import_react_intl24.defineMessages)({
|
|
6079
|
+
text: {
|
|
6080
|
+
id: "dynamicFlows.CameraCapture.rotatePhone.text",
|
|
6081
|
+
defaultMessage: "Rotate your phone to portrait view to take a photo",
|
|
6082
|
+
description: "Prompt the user to rotate their phone from landscape to portrait mode when attempting to take a photo"
|
|
6083
|
+
}
|
|
6084
|
+
});
|
|
6085
|
+
|
|
6086
|
+
// src/step/cameraStep/cameraCapture/components/orientationLockOverlay/OrientationLockOverlay.tsx
|
|
6087
|
+
var import_jsx_runtime57 = require("react/jsx-runtime");
|
|
6088
|
+
var OrientationLockOverlay = () => {
|
|
6089
|
+
const intl = (0, import_react_intl25.useIntl)();
|
|
6090
|
+
return /* @__PURE__ */ (0, import_jsx_runtime57.jsxs)("div", { className: "orientation-lock-overlay", "data-testid": "orientation-lock", children: [
|
|
6091
|
+
/* @__PURE__ */ (0, import_jsx_runtime57.jsx)(
|
|
6092
|
+
"img",
|
|
6093
|
+
{
|
|
6094
|
+
className: "m-b-3",
|
|
6095
|
+
src: "https://wise.com/public-resources/assets/camera-guidelines/icon-rotate-phone.svg",
|
|
6096
|
+
width: "96",
|
|
6097
|
+
height: "96",
|
|
6098
|
+
alt: ""
|
|
6099
|
+
}
|
|
6100
|
+
),
|
|
6101
|
+
/* @__PURE__ */ (0, import_jsx_runtime57.jsx)("p", { className: "text-center m-b-0", children: intl.formatMessage(OrientationLockOverlay_messages_default.text) })
|
|
6102
|
+
] });
|
|
6103
|
+
};
|
|
6104
|
+
var OrientationLockOverlay_default = OrientationLockOverlay;
|
|
6105
|
+
|
|
6116
6106
|
// src/step/cameraStep/cameraCapture/hooks/useFullScreenOrientationLock.ts
|
|
6117
6107
|
var import_react33 = require("react");
|
|
6118
6108
|
var import_screenfull = __toESM(require_screenfull());
|
|
6119
6109
|
var useFullScreenOrientationLock = (isMobile2) => {
|
|
6120
6110
|
const lockOrientation = (0, import_react33.useCallback)(() => {
|
|
6121
6111
|
if (window.screen.orientation && "lock" in window.screen.orientation && typeof window.screen.orientation.lock === "function") {
|
|
6122
|
-
window.screen.orientation.lock("portrait").catch(
|
|
6123
|
-
});
|
|
6112
|
+
window.screen.orientation.lock("portrait").catch(noop4);
|
|
6124
6113
|
}
|
|
6125
6114
|
}, []);
|
|
6126
6115
|
const unlockOrientation = (0, import_react33.useCallback)(() => {
|
|
6127
|
-
var _a, _b;
|
|
6128
|
-
|
|
6129
|
-
window.screen.orientation.unlock();
|
|
6130
|
-
}
|
|
6116
|
+
var _a, _b, _c;
|
|
6117
|
+
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);
|
|
6131
6118
|
}, []);
|
|
6132
6119
|
const enterFullScreen = (0, import_react33.useCallback)(() => {
|
|
6133
6120
|
setTimeout(() => {
|
|
6134
6121
|
if (isMobile2 && !import_screenfull.default.isFullscreen && import_screenfull.default.isEnabled) {
|
|
6135
6122
|
import_screenfull.default.request(document.documentElement, { navigationUI: "show" }).then(() => {
|
|
6136
6123
|
lockOrientation();
|
|
6137
|
-
}).catch(
|
|
6138
|
-
});
|
|
6124
|
+
}).catch(noop4);
|
|
6139
6125
|
}
|
|
6140
6126
|
}, 100);
|
|
6141
6127
|
}, [isMobile2, lockOrientation]);
|
|
6142
6128
|
const exitFullScreen = (0, import_react33.useCallback)(() => {
|
|
6143
6129
|
if (import_screenfull.default.isFullscreen) {
|
|
6144
|
-
import_screenfull.default.exit().catch(
|
|
6145
|
-
});
|
|
6130
|
+
import_screenfull.default.exit().catch(noop4);
|
|
6146
6131
|
}
|
|
6147
6132
|
unlockOrientation();
|
|
6148
6133
|
}, [unlockOrientation]);
|
|
@@ -6156,6 +6141,8 @@ var useFullScreenOrientationLock = (isMobile2) => {
|
|
|
6156
6141
|
exitFullScreen
|
|
6157
6142
|
};
|
|
6158
6143
|
};
|
|
6144
|
+
var noop4 = () => {
|
|
6145
|
+
};
|
|
6159
6146
|
|
|
6160
6147
|
// src/step/cameraStep/cameraCapture/hooks/useVideoConstraints.ts
|
|
6161
6148
|
var import_react34 = require("react");
|
|
@@ -6630,7 +6617,7 @@ var ExternalConfirmationStep_messages_default = (0, import_react_intl31.defineMe
|
|
|
6630
6617
|
|
|
6631
6618
|
// src/step/externalConfirmationStep/ExternalConfirmationStep.tsx
|
|
6632
6619
|
var import_jsx_runtime63 = require("react/jsx-runtime");
|
|
6633
|
-
var
|
|
6620
|
+
var noop5 = () => {
|
|
6634
6621
|
};
|
|
6635
6622
|
var ExternalConfirmationStep = ({ url, onClose }) => {
|
|
6636
6623
|
const { formatMessage } = (0, import_react_intl32.useIntl)();
|
|
@@ -6684,8 +6671,8 @@ var ExternalConfirmationStep = ({ url, onClose }) => {
|
|
|
6684
6671
|
}
|
|
6685
6672
|
onClose();
|
|
6686
6673
|
},
|
|
6687
|
-
onModelChange:
|
|
6688
|
-
onPersistAsync:
|
|
6674
|
+
onModelChange: noop5,
|
|
6675
|
+
onPersistAsync: noop5
|
|
6689
6676
|
}
|
|
6690
6677
|
);
|
|
6691
6678
|
};
|
|
@@ -6934,7 +6921,7 @@ var ErrorBoundaryAlert = ({ onDismiss }) => {
|
|
|
6934
6921
|
|
|
6935
6922
|
// src/dynamicFlow/utils/errorBoundary/ErrorBoundary.tsx
|
|
6936
6923
|
var import_jsx_runtime68 = require("react/jsx-runtime");
|
|
6937
|
-
var
|
|
6924
|
+
var noop6 = () => {
|
|
6938
6925
|
};
|
|
6939
6926
|
var ErrorBoundary = class extends import_react41.Component {
|
|
6940
6927
|
constructor(props) {
|
|
@@ -6948,7 +6935,7 @@ var ErrorBoundary = class extends import_react41.Component {
|
|
|
6948
6935
|
return { hasError: true, isFatalError: true };
|
|
6949
6936
|
}
|
|
6950
6937
|
componentDidCatch(error) {
|
|
6951
|
-
const { onError =
|
|
6938
|
+
const { onError = noop6 } = this.props;
|
|
6952
6939
|
onError(error);
|
|
6953
6940
|
}
|
|
6954
6941
|
render() {
|
|
@@ -7061,7 +7048,7 @@ var isResponse = (response) => typeof response === "object" && response !== null
|
|
|
7061
7048
|
|
|
7062
7049
|
// src/dynamicFlow/DynamicFlow.tsx
|
|
7063
7050
|
var import_jsx_runtime69 = require("react/jsx-runtime");
|
|
7064
|
-
var
|
|
7051
|
+
var noop7 = () => {
|
|
7065
7052
|
};
|
|
7066
7053
|
var DynamicFlowComponent = ({
|
|
7067
7054
|
flowId,
|
|
@@ -7072,8 +7059,8 @@ var DynamicFlowComponent = ({
|
|
|
7072
7059
|
displayStepTitle = true,
|
|
7073
7060
|
onCompletion,
|
|
7074
7061
|
onError,
|
|
7075
|
-
onEvent =
|
|
7076
|
-
onLog =
|
|
7062
|
+
onEvent = noop7,
|
|
7063
|
+
onLog = noop7
|
|
7077
7064
|
}) => {
|
|
7078
7065
|
const { locale } = (0, import_react_intl34.useIntl)();
|
|
7079
7066
|
const {
|
|
@@ -7320,7 +7307,7 @@ var JsonSchemaForm = (props) => {
|
|
|
7320
7307
|
model: null,
|
|
7321
7308
|
errors: null
|
|
7322
7309
|
}, props);
|
|
7323
|
-
const { baseUrl = "", onEvent =
|
|
7310
|
+
const { baseUrl = "", onEvent = noop8, onLog = noop8 } = props;
|
|
7324
7311
|
return /* @__PURE__ */ (0, import_jsx_runtime70.jsx)(LogProvider, { flowId: "JsonSchemaForm", stepId: "JsonSchemaForm", onLog, children: /* @__PURE__ */ (0, import_jsx_runtime70.jsx)(
|
|
7325
7312
|
EventsContextProvider,
|
|
7326
7313
|
{
|
|
@@ -7331,7 +7318,7 @@ var JsonSchemaForm = (props) => {
|
|
|
7331
7318
|
) });
|
|
7332
7319
|
};
|
|
7333
7320
|
var JsonSchemaForm_default = JsonSchemaForm;
|
|
7334
|
-
var
|
|
7321
|
+
var noop8 = () => {
|
|
7335
7322
|
};
|
|
7336
7323
|
|
|
7337
7324
|
// src/i18n/de.json
|
|
@@ -7394,7 +7381,6 @@ var en_default = {
|
|
|
7394
7381
|
"dynamicFlows.CameraCapture.reviewInstructions": "Is your picture clear, readable and complete?",
|
|
7395
7382
|
"dynamicFlows.CameraCapture.reviewRetry": "No, try again",
|
|
7396
7383
|
"dynamicFlows.CameraCapture.reviewSubmit": "Yes, submit",
|
|
7397
|
-
"dynamicFlows.CameraCapture.rotatePhone.imgAlt": "Rotate your phone icon",
|
|
7398
7384
|
"dynamicFlows.CameraCapture.rotatePhone.text": "Rotate your phone to portrait view to take a photo",
|
|
7399
7385
|
"dynamicFlows.ControlFeedback.maxLength": "Please enter {maxLength} or fewer characters.",
|
|
7400
7386
|
"dynamicFlows.ControlFeedback.maximum": "Please enter a number that's {maximum} or less.",
|