@wise/dynamic-flow-client 3.9.0-experimental-90bdf26 → 3.9.1-experimental-152372b
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/legacy/dynamicFlow/DynamicFlow.js +4 -7
- package/build/main.js +47 -62
- package/build/main.min.js +1 -1
- package/build/main.mjs +35 -50
- package/build/revamp/DynamicFlowWise.js +1 -48
- package/package.json +2 -2
|
@@ -47,7 +47,6 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
|
47
47
|
};
|
|
48
48
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
49
49
|
import { useCallback, useEffect, useMemo, useState } from 'react';
|
|
50
|
-
import { useIntl } from 'react-intl';
|
|
51
50
|
import { DynamicFlowProvider, getEventDispatcher, EventsContextProvider, LogProvider, getLogger, } from '../common/contexts';
|
|
52
51
|
import { FeatureContextProvider } from '../common/contexts/featureContext/FeatureContext';
|
|
53
52
|
import { isObjectModel } from '../common/utils';
|
|
@@ -69,7 +68,6 @@ var noop = function () { };
|
|
|
69
68
|
// eslint-disable-next-line react/function-component-definition
|
|
70
69
|
var DynamicFlowComponent = function (_a) {
|
|
71
70
|
var flowId = _a.flowId, httpClient = _a.httpClient, initialAction = _a.initialAction, initialStep = _a.initialStep, loaderConfig = _a.loaderConfig, _b = _a.displayStepTitle, displayStepTitle = _b === void 0 ? true : _b, features = _a.features, onCompletion = _a.onCompletion, onError = _a.onError, _c = _a.onEvent, onEvent = _c === void 0 ? noop : _c, _d = _a.onLog, onLog = _d === void 0 ? noop : _d;
|
|
72
|
-
var locale = useIntl().locale;
|
|
73
71
|
var _e = useDynamicFlowState(initialStep), formErrors = _e.formErrors, globalError = _e.globalError, step = _e.step, models = _e.models, etag = _e.etag, modelIsValid = _e.modelIsValid, setFormErrors = _e.setFormErrors, setGlobalError = _e.setGlobalError, setStepAndEtag = _e.setStepAndEtag, setSchemaModel = _e.setSchemaModel;
|
|
74
72
|
var _f = useState(false), submitted = _f[0], setSubmitted = _f[1];
|
|
75
73
|
var _g = useLoader(loaderConfig, initialStep ? 'idle' : 'initial'), isLoading = _g.isLoading, loader = _g.loader, setLoadingState = _g.setLoadingState;
|
|
@@ -89,11 +87,10 @@ var DynamicFlowComponent = function (_a) {
|
|
|
89
87
|
var url = action.url, _b = action.method, method = _b === void 0 ? 'POST' : _b;
|
|
90
88
|
return httpClient(url !== null && url !== void 0 ? url : '', {
|
|
91
89
|
method: method,
|
|
92
|
-
headers: __assign({ '
|
|
93
|
-
credentials: 'include',
|
|
90
|
+
headers: __assign({ 'Content-Type': 'application/json' }, (etag ? { 'If-None-Match': etag } : {})),
|
|
94
91
|
body: method === 'GET' ? undefined : JSON.stringify(data),
|
|
95
92
|
});
|
|
96
|
-
}, [httpClient
|
|
93
|
+
}, [httpClient]);
|
|
97
94
|
var performAction = function (action, data) {
|
|
98
95
|
if (data === void 0) { data = {}; }
|
|
99
96
|
return __awaiter(void 0, void 0, void 0, function () {
|
|
@@ -182,8 +179,8 @@ var DynamicFlowComponent = function (_a) {
|
|
|
182
179
|
if (initialStep) {
|
|
183
180
|
warnIfNoStepLayout(initialStep);
|
|
184
181
|
}
|
|
185
|
-
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
186
|
-
}, [httpClient,
|
|
182
|
+
// // eslint-disable-next-line react-hooks/exhaustive-deps
|
|
183
|
+
}, [httpClient, JSON.stringify(initialStep), JSON.stringify(initialAction)]);
|
|
187
184
|
var handleResponse = function (response, fetchType) { return __awaiter(void 0, void 0, void 0, function () {
|
|
188
185
|
var errorResponse, result, error_3;
|
|
189
186
|
return __generator(this, function (_a) {
|
package/build/main.js
CHANGED
|
@@ -1154,7 +1154,6 @@ var i18n_default = translations;
|
|
|
1154
1154
|
|
|
1155
1155
|
// src/revamp/DynamicFlowWise.tsx
|
|
1156
1156
|
var import_react19 = require("react");
|
|
1157
|
-
var import_react_intl16 = require("react-intl");
|
|
1158
1157
|
|
|
1159
1158
|
// src/common/httpClientContext/HttpClientContext.tsx
|
|
1160
1159
|
var import_react = require("react");
|
|
@@ -12162,19 +12161,10 @@ var import_jsx_runtime57 = require("react/jsx-runtime");
|
|
|
12162
12161
|
var wiseRenderers = getWiseRenderers();
|
|
12163
12162
|
function DynamicFlowWise(props) {
|
|
12164
12163
|
const { httpClient, renderers } = props;
|
|
12165
|
-
const { locale } = (0, import_react_intl16.useIntl)();
|
|
12166
|
-
const wiseHttpClient = (0, import_react19.useMemo)(
|
|
12167
|
-
() => makeWiseHttpClient(httpClient, locale),
|
|
12168
|
-
[httpClient, locale]
|
|
12169
|
-
);
|
|
12170
12164
|
const mergedRenderers = (0, import_react19.useMemo)(() => [...renderers != null ? renderers : [], ...wiseRenderers], [renderers]);
|
|
12171
|
-
return /* @__PURE__ */ (0, import_jsx_runtime57.jsx)(HttpClientProvider, { httpClient
|
|
12165
|
+
return /* @__PURE__ */ (0, import_jsx_runtime57.jsx)(HttpClientProvider, { httpClient, children: /* @__PURE__ */ (0, import_jsx_runtime57.jsx)(DynamicFlowCore, __spreadProps(__spreadValues({}, props), { renderers: mergedRenderers })) });
|
|
12172
12166
|
}
|
|
12173
12167
|
var DynamicFlowWise_default = DynamicFlowWise;
|
|
12174
|
-
var makeWiseHttpClient = (httpClient, locale) => async (input, init) => httpClient(
|
|
12175
|
-
input,
|
|
12176
|
-
mergeRequestInit(init, { credentials: "include", headers: { "accept-language": locale } })
|
|
12177
|
-
);
|
|
12178
12168
|
|
|
12179
12169
|
// src/revamp/DynamicFragmentWise.tsx
|
|
12180
12170
|
var import_react20 = require("react");
|
|
@@ -12522,7 +12512,6 @@ function isReference(block) {
|
|
|
12522
12512
|
|
|
12523
12513
|
// src/legacy/dynamicFlow/DynamicFlow.tsx
|
|
12524
12514
|
var import_react64 = require("react");
|
|
12525
|
-
var import_react_intl39 = require("react-intl");
|
|
12526
12515
|
|
|
12527
12516
|
// src/legacy/common/contexts/dynamicFlowContexts/DynamicFlowContexts.tsx
|
|
12528
12517
|
var import_react22 = require("react");
|
|
@@ -13443,11 +13432,11 @@ function useExternalStepPolling(polling, onAction) {
|
|
|
13443
13432
|
|
|
13444
13433
|
// src/legacy/common/hooks/usePersistAsync/usePersistAsync.ts
|
|
13445
13434
|
var import_react52 = require("react");
|
|
13446
|
-
var
|
|
13435
|
+
var import_react_intl31 = require("react-intl");
|
|
13447
13436
|
|
|
13448
13437
|
// src/legacy/jsonSchemaForm/persistAsyncSchema/persistAsyncBasicSchema/PersistAsyncBasicSchema.tsx
|
|
13449
13438
|
var import_react51 = require("react");
|
|
13450
|
-
var
|
|
13439
|
+
var import_react_intl30 = require("react-intl");
|
|
13451
13440
|
|
|
13452
13441
|
// src/legacy/common/constants/DateMode.ts
|
|
13453
13442
|
var DateMode = {
|
|
@@ -13843,11 +13832,11 @@ var DynamicDivider_default = DynamicDivider;
|
|
|
13843
13832
|
// src/legacy/layout/external/DynamicExternal.tsx
|
|
13844
13833
|
var import_components41 = require("@transferwise/components");
|
|
13845
13834
|
var import_react29 = require("react");
|
|
13846
|
-
var
|
|
13835
|
+
var import_react_intl17 = require("react-intl");
|
|
13847
13836
|
|
|
13848
13837
|
// src/legacy/layout/external/DynamicExternal.messages.ts
|
|
13849
|
-
var
|
|
13850
|
-
var DynamicExternal_messages_default = (0,
|
|
13838
|
+
var import_react_intl16 = require("react-intl");
|
|
13839
|
+
var DynamicExternal_messages_default = (0, import_react_intl16.defineMessages)({
|
|
13851
13840
|
retryTitle: {
|
|
13852
13841
|
id: "dynamicFlows.DynamicExternal.retryTitle",
|
|
13853
13842
|
defaultMessage: "Reopen window",
|
|
@@ -13859,7 +13848,7 @@ var DynamicExternal_messages_default = (0, import_react_intl17.defineMessages)({
|
|
|
13859
13848
|
var import_jsx_runtime73 = require("react/jsx-runtime");
|
|
13860
13849
|
var DynamicExternal = ({ component, onAction }) => {
|
|
13861
13850
|
const { requestUrl, responseHandlers, polling, retryTitle } = component;
|
|
13862
|
-
const intl = (0,
|
|
13851
|
+
const intl = (0, import_react_intl17.useIntl)();
|
|
13863
13852
|
const openExternalUrl = (0, import_react29.useCallback)(
|
|
13864
13853
|
() => window.open(requestUrl, "df-external-window"),
|
|
13865
13854
|
[requestUrl]
|
|
@@ -13938,7 +13927,7 @@ var import_react31 = require("react");
|
|
|
13938
13927
|
// src/legacy/jsonSchemaForm/controlFeedback/ControlFeedback.tsx
|
|
13939
13928
|
var import_components43 = require("@transferwise/components");
|
|
13940
13929
|
var import_formatting2 = require("@transferwise/formatting");
|
|
13941
|
-
var
|
|
13930
|
+
var import_react_intl18 = require("react-intl");
|
|
13942
13931
|
var import_jsx_runtime75 = require("react/jsx-runtime");
|
|
13943
13932
|
function ControlFeedback(props) {
|
|
13944
13933
|
var _a;
|
|
@@ -13964,7 +13953,7 @@ ControlFeedback.defaultProps = {
|
|
|
13964
13953
|
validationAsyncSuccessMessage: null
|
|
13965
13954
|
};
|
|
13966
13955
|
function useDefaultValidationMessages(schema) {
|
|
13967
|
-
const { formatMessage, locale } = (0,
|
|
13956
|
+
const { formatMessage, locale } = (0, import_react_intl18.useIntl)();
|
|
13968
13957
|
const formattedMessages = {
|
|
13969
13958
|
type: formatMessage(validation_messages_default.type),
|
|
13970
13959
|
minimum: formatMessage(validation_messages_default.minimum, {
|
|
@@ -14051,11 +14040,11 @@ function constructUploadError(response) {
|
|
|
14051
14040
|
}
|
|
14052
14041
|
|
|
14053
14042
|
// src/legacy/jsonSchemaForm/arrayTypeSchema/arrayListSchema/multipleFileUploadSchema/utils/useFormattedDefaultErrorMessages.tsx
|
|
14054
|
-
var
|
|
14043
|
+
var import_react_intl20 = require("react-intl");
|
|
14055
14044
|
|
|
14056
14045
|
// src/legacy/common/messages.ts
|
|
14057
|
-
var
|
|
14058
|
-
var messages_default = (0,
|
|
14046
|
+
var import_react_intl19 = require("react-intl");
|
|
14047
|
+
var messages_default = (0, import_react_intl19.defineMessages)({
|
|
14059
14048
|
required: {
|
|
14060
14049
|
id: "dynamicFlows.DefaultErrorMessages.required",
|
|
14061
14050
|
defaultMessage: "Please fill out this field.",
|
|
@@ -14068,7 +14057,7 @@ function useFormattedDefaultErrorMessages({
|
|
|
14068
14057
|
maxItems,
|
|
14069
14058
|
minItems
|
|
14070
14059
|
}) {
|
|
14071
|
-
const { formatMessage } = (0,
|
|
14060
|
+
const { formatMessage } = (0, import_react_intl20.useIntl)();
|
|
14072
14061
|
const { maxFileSizeError, maxItemsError, minItemsError } = multi_file_upload_messages_default;
|
|
14073
14062
|
return {
|
|
14074
14063
|
maxFileSizeErrorMessage: formatMessage(maxFileSizeError),
|
|
@@ -14188,7 +14177,7 @@ function getValidationMessages(schema, required, defaultErrorMessages) {
|
|
|
14188
14177
|
var import_components46 = require("@transferwise/components");
|
|
14189
14178
|
var import_classnames9 = __toESM(require_classnames());
|
|
14190
14179
|
var import_react32 = require("react");
|
|
14191
|
-
var
|
|
14180
|
+
var import_react_intl22 = require("react-intl");
|
|
14192
14181
|
|
|
14193
14182
|
// src/legacy/jsonSchemaForm/schemaFormControl/utils/mapping-utils.tsx
|
|
14194
14183
|
var import_components45 = require("@transferwise/components");
|
|
@@ -14282,8 +14271,8 @@ var getDisabled = (disabled) => {
|
|
|
14282
14271
|
};
|
|
14283
14272
|
|
|
14284
14273
|
// src/common/messages/multi-select.messages.ts
|
|
14285
|
-
var
|
|
14286
|
-
var multi_select_messages_default = (0,
|
|
14274
|
+
var import_react_intl21 = require("react-intl");
|
|
14275
|
+
var multi_select_messages_default = (0, import_react_intl21.defineMessages)({
|
|
14287
14276
|
summary: {
|
|
14288
14277
|
id: "dynamicFlows.MultiSelect.summary",
|
|
14289
14278
|
defaultMessage: "{first} and {count} more",
|
|
@@ -14301,7 +14290,7 @@ function MultiSelectSchema({
|
|
|
14301
14290
|
errors,
|
|
14302
14291
|
onChange
|
|
14303
14292
|
}) {
|
|
14304
|
-
const { formatMessage, locale } = (0,
|
|
14293
|
+
const { formatMessage, locale } = (0, import_react_intl22.useIntl)();
|
|
14305
14294
|
const { disabled, items, validationMessages, placeholder } = schema;
|
|
14306
14295
|
const options = items.oneOf.map((item) => mapConstSchemaToOption(item, "select"));
|
|
14307
14296
|
const id = (0, import_react32.useMemo)(() => schema.$id || generateRandomId(), [schema.$id]);
|
|
@@ -14397,7 +14386,7 @@ var getInitialModelIndices = (model, options) => {
|
|
|
14397
14386
|
var import_components48 = require("@transferwise/components");
|
|
14398
14387
|
var import_icons4 = require("@transferwise/icons");
|
|
14399
14388
|
var import_react34 = require("react");
|
|
14400
|
-
var
|
|
14389
|
+
var import_react_intl24 = require("react-intl");
|
|
14401
14390
|
|
|
14402
14391
|
// src/legacy/jsonSchemaForm/arrayTypeSchema/arrayListSchema/repeatableSchema/ItemSummary.tsx
|
|
14403
14392
|
var import_components47 = require("@transferwise/components");
|
|
@@ -14417,7 +14406,7 @@ function ItemSummaryOption2({ item, onClick }) {
|
|
|
14417
14406
|
|
|
14418
14407
|
// src/legacy/jsonSchemaForm/arrayTypeSchema/arrayListSchema/repeatableSchema/RepeatableSchemaStep.tsx
|
|
14419
14408
|
var import_react33 = require("react");
|
|
14420
|
-
var
|
|
14409
|
+
var import_react_intl23 = require("react-intl");
|
|
14421
14410
|
var import_jsx_runtime80 = require("react/jsx-runtime");
|
|
14422
14411
|
function RepeatableSchemaStep({
|
|
14423
14412
|
type,
|
|
@@ -14428,7 +14417,7 @@ function RepeatableSchemaStep({
|
|
|
14428
14417
|
onModelChange,
|
|
14429
14418
|
onAction
|
|
14430
14419
|
}) {
|
|
14431
|
-
const { formatMessage } = (0,
|
|
14420
|
+
const { formatMessage } = (0, import_react_intl23.useIntl)();
|
|
14432
14421
|
const [filename, setFilename] = (0, import_react33.useState)(void 0);
|
|
14433
14422
|
const step = {
|
|
14434
14423
|
layout: [
|
|
@@ -14735,7 +14724,7 @@ function RepeatableSchema({
|
|
|
14735
14724
|
setEditableItem({ item: null, model: null });
|
|
14736
14725
|
setOpenModalType(null);
|
|
14737
14726
|
};
|
|
14738
|
-
const { formatMessage } = (0,
|
|
14727
|
+
const { formatMessage } = (0, import_react_intl24.useIntl)();
|
|
14739
14728
|
const validations = getValidationFailures(model, schema, required);
|
|
14740
14729
|
const base64ValidationMessages = useFormattedDefaultErrorMessages({
|
|
14741
14730
|
minItems: schema.minItems,
|
|
@@ -14951,10 +14940,10 @@ var import_react38 = require("react");
|
|
|
14951
14940
|
|
|
14952
14941
|
// src/legacy/jsonSchemaForm/help/Help.tsx
|
|
14953
14942
|
var import_components50 = require("@transferwise/components");
|
|
14954
|
-
var
|
|
14943
|
+
var import_react_intl25 = require("react-intl");
|
|
14955
14944
|
var import_jsx_runtime85 = require("react/jsx-runtime");
|
|
14956
14945
|
function Help2(props) {
|
|
14957
|
-
const intl = (0,
|
|
14946
|
+
const intl = (0, import_react_intl25.useIntl)();
|
|
14958
14947
|
return /* @__PURE__ */ (0, import_jsx_runtime85.jsx)(
|
|
14959
14948
|
import_components50.Info,
|
|
14960
14949
|
{
|
|
@@ -16185,11 +16174,11 @@ var PromotedOneOfSchema_default = PromotedOneOfSchema;
|
|
|
16185
16174
|
|
|
16186
16175
|
// src/legacy/jsonSchemaForm/readOnlySchema/ReadOnlySchema.tsx
|
|
16187
16176
|
var import_components56 = require("@transferwise/components");
|
|
16188
|
-
var
|
|
16177
|
+
var import_react_intl27 = require("react-intl");
|
|
16189
16178
|
|
|
16190
16179
|
// src/legacy/jsonSchemaForm/readOnlySchema/ReadOnlySchema.messages.ts
|
|
16191
|
-
var
|
|
16192
|
-
var ReadOnlySchema_messages_default = (0,
|
|
16180
|
+
var import_react_intl26 = require("react-intl");
|
|
16181
|
+
var ReadOnlySchema_messages_default = (0, import_react_intl26.defineMessages)({
|
|
16193
16182
|
yes: {
|
|
16194
16183
|
id: "dynamicFlows.ReadOnlySchema.yes",
|
|
16195
16184
|
defaultMessage: "Yes",
|
|
@@ -16206,7 +16195,7 @@ var ReadOnlySchema_messages_default = (0, import_react_intl27.defineMessages)({
|
|
|
16206
16195
|
var import_jsx_runtime96 = require("react/jsx-runtime");
|
|
16207
16196
|
function ReadOnlySchema({ schema, model }) {
|
|
16208
16197
|
const { title = "" } = schema;
|
|
16209
|
-
const { formatMessage } = (0,
|
|
16198
|
+
const { formatMessage } = (0, import_react_intl27.useIntl)();
|
|
16210
16199
|
const value = getValueForSchema({ schema, model, formatMessage });
|
|
16211
16200
|
return /* @__PURE__ */ (0, import_jsx_runtime96.jsx)(import_components56.DefinitionList, { layout: import_components56.Layout.VERTICAL_ONE_COLUMN, definitions: [{ title, value, key: "" }] });
|
|
16212
16201
|
}
|
|
@@ -16707,7 +16696,7 @@ var DynamicLoadingIndicator_default = DynamicLoadingIndicator;
|
|
|
16707
16696
|
|
|
16708
16697
|
// src/legacy/layout/paragraph/DynamicParagraph.tsx
|
|
16709
16698
|
var import_components64 = require("@transferwise/components");
|
|
16710
|
-
var
|
|
16699
|
+
var import_react_intl28 = require("react-intl");
|
|
16711
16700
|
|
|
16712
16701
|
// src/legacy/layout/paragraph/useSnackBarIfAvailable.ts
|
|
16713
16702
|
var import_components63 = require("@transferwise/components");
|
|
@@ -16732,7 +16721,7 @@ function BasicDynamicParagraph({ component }) {
|
|
|
16732
16721
|
] });
|
|
16733
16722
|
}
|
|
16734
16723
|
function CopyableDynamicParagraph({ component }) {
|
|
16735
|
-
const { formatMessage } = (0,
|
|
16724
|
+
const { formatMessage } = (0, import_react_intl28.useIntl)();
|
|
16736
16725
|
const createSnackbar = useSnackBarIfAvailable2();
|
|
16737
16726
|
const { text } = component;
|
|
16738
16727
|
const copy = () => {
|
|
@@ -16835,7 +16824,7 @@ var SearchInput = ({ title, value, onFocus, onChange }) => {
|
|
|
16835
16824
|
|
|
16836
16825
|
// src/legacy/layout/search/SearchResults.tsx
|
|
16837
16826
|
var import_components67 = require("@transferwise/components");
|
|
16838
|
-
var
|
|
16827
|
+
var import_react_intl29 = require("react-intl");
|
|
16839
16828
|
var import_jsx_runtime110 = require("react/jsx-runtime");
|
|
16840
16829
|
function SearchResults2({ results, emptyMessage, onSelect }) {
|
|
16841
16830
|
if (results.length === 0) {
|
|
@@ -16855,7 +16844,7 @@ function SearchResults2({ results, emptyMessage, onSelect }) {
|
|
|
16855
16844
|
)) });
|
|
16856
16845
|
}
|
|
16857
16846
|
function ErrorResult2({ onRetrySearch }) {
|
|
16858
|
-
const intl = (0,
|
|
16847
|
+
const intl = (0, import_react_intl29.useIntl)();
|
|
16859
16848
|
return /* @__PURE__ */ (0, import_jsx_runtime110.jsxs)("p", { className: "m-t-2", children: [
|
|
16860
16849
|
intl.formatMessage(generic_error_messages_default.genericError),
|
|
16861
16850
|
"\xA0",
|
|
@@ -17222,7 +17211,7 @@ var controlTypesWithPersistOnChange = /* @__PURE__ */ new Set([
|
|
|
17222
17211
|
]);
|
|
17223
17212
|
function PersistAsyncBasicSchema(props) {
|
|
17224
17213
|
const { schema, required, submitted, errors, onChange, onPersistAsync } = props;
|
|
17225
|
-
const intl = (0,
|
|
17214
|
+
const intl = (0, import_react_intl30.useIntl)();
|
|
17226
17215
|
const httpClient = useHttpClient();
|
|
17227
17216
|
const onEvent = useEventDispatcher();
|
|
17228
17217
|
const [persistAsyncModel, setPersistAsyncModel] = (0, import_react51.useState)(null);
|
|
@@ -17320,7 +17309,7 @@ var PersistAsyncBasicSchema_default = PersistAsyncBasicSchema;
|
|
|
17320
17309
|
var usePersistAsync = (persistAsync) => {
|
|
17321
17310
|
const [abortController, setAbortController] = (0, import_react52.useState)(null);
|
|
17322
17311
|
const httpClient = useHttpClient();
|
|
17323
|
-
const intl = (0,
|
|
17312
|
+
const intl = (0, import_react_intl31.useIntl)();
|
|
17324
17313
|
const { schema } = persistAsync;
|
|
17325
17314
|
async function handlePersistAsync(model) {
|
|
17326
17315
|
const isInvalidSchema = model instanceof Blob ? !isBlobSchema2(schema) : !isValidSchema(model, schema);
|
|
@@ -17551,12 +17540,12 @@ var import_react60 = require("react");
|
|
|
17551
17540
|
|
|
17552
17541
|
// src/legacy/step/cameraStep/cameraCapture/CameraCapture.tsx
|
|
17553
17542
|
var import_react59 = require("react");
|
|
17554
|
-
var
|
|
17543
|
+
var import_react_intl36 = require("react-intl");
|
|
17555
17544
|
var import_react_webcam = __toESM(require("react-webcam"));
|
|
17556
17545
|
|
|
17557
17546
|
// src/legacy/step/cameraStep/cameraCapture/CameraCapture.messages.ts
|
|
17558
|
-
var
|
|
17559
|
-
var CameraCapture_messages_default = (0,
|
|
17547
|
+
var import_react_intl32 = require("react-intl");
|
|
17548
|
+
var CameraCapture_messages_default = (0, import_react_intl32.defineMessages)({
|
|
17560
17549
|
reviewSubmit: {
|
|
17561
17550
|
id: "dynamicFlows.CameraCapture.reviewSubmit",
|
|
17562
17551
|
defaultMessage: "Yes, submit",
|
|
@@ -17616,14 +17605,14 @@ var CameraCapture_messages_default = (0, import_react_intl33.defineMessages)({
|
|
|
17616
17605
|
|
|
17617
17606
|
// src/legacy/step/cameraStep/cameraCapture/components/bottomBar/BottomBar.tsx
|
|
17618
17607
|
var import_components70 = require("@transferwise/components");
|
|
17619
|
-
var
|
|
17608
|
+
var import_react_intl33 = require("react-intl");
|
|
17620
17609
|
var import_jsx_runtime116 = require("react/jsx-runtime");
|
|
17621
17610
|
var CaptureBottomBar = ({ onCapture }) => /* @__PURE__ */ (0, import_jsx_runtime116.jsx)("div", { className: "bottom-bar", children: /* @__PURE__ */ (0, import_jsx_runtime116.jsx)(CaptureButton, { onClick: onCapture }) });
|
|
17622
17611
|
var ReviewBottomBar = ({
|
|
17623
17612
|
onSubmit,
|
|
17624
17613
|
onRetry
|
|
17625
17614
|
}) => {
|
|
17626
|
-
const intl = (0,
|
|
17615
|
+
const intl = (0, import_react_intl33.useIntl)();
|
|
17627
17616
|
return /* @__PURE__ */ (0, import_jsx_runtime116.jsx)("div", { className: "bottom-bar p-x-2", children: /* @__PURE__ */ (0, import_jsx_runtime116.jsx)("div", { className: "row", children: /* @__PURE__ */ (0, import_jsx_runtime116.jsxs)("div", { className: "col-xs-12 col-md-6 col-md-offset-3", children: [
|
|
17628
17617
|
/* @__PURE__ */ (0, import_jsx_runtime116.jsx)(
|
|
17629
17618
|
import_components70.Button,
|
|
@@ -17662,11 +17651,11 @@ var CaptureButton = ({ onClick }) => /* @__PURE__ */ (0, import_jsx_runtime116.j
|
|
|
17662
17651
|
);
|
|
17663
17652
|
|
|
17664
17653
|
// src/legacy/step/cameraStep/cameraCapture/components/orientationLockOverlay/OrientationLockOverlay.tsx
|
|
17665
|
-
var
|
|
17654
|
+
var import_react_intl35 = require("react-intl");
|
|
17666
17655
|
|
|
17667
17656
|
// src/legacy/step/cameraStep/cameraCapture/components/orientationLockOverlay/OrientationLockOverlay.messages.ts
|
|
17668
|
-
var
|
|
17669
|
-
var OrientationLockOverlay_messages_default = (0,
|
|
17657
|
+
var import_react_intl34 = require("react-intl");
|
|
17658
|
+
var OrientationLockOverlay_messages_default = (0, import_react_intl34.defineMessages)({
|
|
17670
17659
|
text: {
|
|
17671
17660
|
id: "dynamicFlows.CameraCapture.rotatePhone.text",
|
|
17672
17661
|
defaultMessage: "Rotate your phone to portrait view to take a photo",
|
|
@@ -17677,7 +17666,7 @@ var OrientationLockOverlay_messages_default = (0, import_react_intl35.defineMess
|
|
|
17677
17666
|
// src/legacy/step/cameraStep/cameraCapture/components/orientationLockOverlay/OrientationLockOverlay.tsx
|
|
17678
17667
|
var import_jsx_runtime117 = require("react/jsx-runtime");
|
|
17679
17668
|
function OrientationLockOverlay() {
|
|
17680
|
-
const intl = (0,
|
|
17669
|
+
const intl = (0, import_react_intl35.useIntl)();
|
|
17681
17670
|
return /* @__PURE__ */ (0, import_jsx_runtime117.jsxs)("div", { className: "orientation-lock-overlay", children: [
|
|
17682
17671
|
/* @__PURE__ */ (0, import_jsx_runtime117.jsx)(
|
|
17683
17672
|
"img",
|
|
@@ -17964,7 +17953,7 @@ function CameraCapture({
|
|
|
17964
17953
|
shouldLockOrientation,
|
|
17965
17954
|
onEvent
|
|
17966
17955
|
);
|
|
17967
|
-
const intl = (0,
|
|
17956
|
+
const intl = (0, import_react_intl36.useIntl)();
|
|
17968
17957
|
const handleCapture = (0, import_react59.useCallback)(async () => {
|
|
17969
17958
|
var _a, _b, _c, _d, _e, _f;
|
|
17970
17959
|
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) {
|
|
@@ -18187,12 +18176,12 @@ function getFirstAction(step) {
|
|
|
18187
18176
|
}
|
|
18188
18177
|
|
|
18189
18178
|
// src/legacy/step/externalConfirmationStep/ExternalConfirmationStep.tsx
|
|
18190
|
-
var
|
|
18179
|
+
var import_react_intl37 = require("react-intl");
|
|
18191
18180
|
var import_jsx_runtime122 = require("react/jsx-runtime");
|
|
18192
18181
|
var noop6 = () => {
|
|
18193
18182
|
};
|
|
18194
18183
|
function ExternalConfirmationStep({ url, onClose }) {
|
|
18195
|
-
const { formatMessage } = (0,
|
|
18184
|
+
const { formatMessage } = (0, import_react_intl37.useIntl)();
|
|
18196
18185
|
return /* @__PURE__ */ (0, import_jsx_runtime122.jsx)(
|
|
18197
18186
|
DynamicLayout_default,
|
|
18198
18187
|
{
|
|
@@ -18581,7 +18570,6 @@ var DynamicFlowComponent = ({
|
|
|
18581
18570
|
onEvent = noop7,
|
|
18582
18571
|
onLog = noop7
|
|
18583
18572
|
}) => {
|
|
18584
|
-
const { locale } = (0, import_react_intl39.useIntl)();
|
|
18585
18573
|
const {
|
|
18586
18574
|
formErrors,
|
|
18587
18575
|
globalError,
|
|
@@ -18633,15 +18621,12 @@ var DynamicFlowComponent = ({
|
|
|
18633
18621
|
return httpClient(url != null ? url : "", {
|
|
18634
18622
|
method,
|
|
18635
18623
|
headers: __spreadValues({
|
|
18636
|
-
"accept-language": locale,
|
|
18637
|
-
// FIXME move this out of the library https://transferwise.atlassian.net/browse/MC-3286
|
|
18638
18624
|
"Content-Type": "application/json"
|
|
18639
18625
|
}, etag2 ? { "If-None-Match": etag2 } : {}),
|
|
18640
|
-
credentials: "include",
|
|
18641
18626
|
body: method === "GET" ? void 0 : JSON.stringify(data)
|
|
18642
18627
|
});
|
|
18643
18628
|
},
|
|
18644
|
-
[httpClient
|
|
18629
|
+
[httpClient]
|
|
18645
18630
|
);
|
|
18646
18631
|
const performAction = async (action, data = {}) => {
|
|
18647
18632
|
cancelPendingRefreshes();
|
|
@@ -18698,7 +18683,7 @@ var DynamicFlowComponent = ({
|
|
|
18698
18683
|
if (initialStep) {
|
|
18699
18684
|
warnIfNoStepLayout(initialStep);
|
|
18700
18685
|
}
|
|
18701
|
-
}, [httpClient,
|
|
18686
|
+
}, [httpClient, JSON.stringify(initialStep), JSON.stringify(initialAction)]);
|
|
18702
18687
|
const handleResponse = async (response, fetchType) => {
|
|
18703
18688
|
try {
|
|
18704
18689
|
if (response.status === 304) {
|