@wise/dynamic-flow-client-internal 3.13.2-experimental-translations-refactored-c00940d → 3.14.0-export-map-experimental-58f00fb
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/dynamicFlow/DynamicFlow.js +12 -8
- package/build/i18n/index.js +27 -1
- package/build/index.js +2 -14
- package/build/main.js +2340 -22
- package/build/main.min.js +10 -1
- package/build/main.mjs +2354 -20
- package/build/types/dynamicFlow/DynamicFlow.d.ts +2 -3
- package/build/types/i18n/index.d.ts +1 -1
- package/build/types/index.d.ts +1 -3
- package/package.json +12 -4
|
@@ -55,19 +55,22 @@ var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {
|
|
|
55
55
|
return to.concat(ar || Array.prototype.slice.call(from));
|
|
56
56
|
};
|
|
57
57
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
58
|
-
import { forwardRef, useCallback } from 'react';
|
|
58
|
+
import { forwardRef, useCallback, useMemo } from 'react';
|
|
59
59
|
import { useIntl } from 'react-intl';
|
|
60
|
-
import { DynamicFlow as DynamicFlowCoreLegacy,
|
|
60
|
+
import { DynamicFlow as DynamicFlowCoreLegacy, DynamicFlowCoreRevamp, DynamicFragmentCore, } from '@wise/dynamic-flow-client';
|
|
61
|
+
import { RendererHttpClientProvider, getWiseRenderers } from '@wise/dynamic-flow-renderers';
|
|
62
|
+
var wiseRenderers = getWiseRenderers();
|
|
61
63
|
export function DynamicFlowLegacy(props) {
|
|
62
64
|
var _a = props.customFetch, customFetch = _a === void 0 ? globalThis.fetch : _a;
|
|
63
65
|
var coreProps = __assign(__assign({}, props), { httpClient: customFetch });
|
|
64
66
|
return _jsx(DynamicFlowCoreLegacy, __assign({}, coreProps));
|
|
65
67
|
}
|
|
66
68
|
export function DynamicFlowRevamp(props) {
|
|
67
|
-
var _a = props.customFetch, customFetch = _a === void 0 ? globalThis.fetch : _a;
|
|
69
|
+
var _a = props.customFetch, customFetch = _a === void 0 ? globalThis.fetch : _a, renderers = props.renderers;
|
|
68
70
|
var httpClient = useWiseHttpClient(customFetch);
|
|
69
|
-
var
|
|
70
|
-
|
|
71
|
+
var mergedRenderers = useMemo(function () { return __spreadArray(__spreadArray([], (renderers !== null && renderers !== void 0 ? renderers : []), true), wiseRenderers, true); }, [renderers]);
|
|
72
|
+
var coreProps = __assign(__assign({}, props), { httpClient: httpClient, renderers: mergedRenderers });
|
|
73
|
+
return (_jsx(RendererHttpClientProvider, { httpClient: httpClient, children: _jsx(DynamicFlowCoreRevamp, __assign({}, coreProps)) }));
|
|
71
74
|
}
|
|
72
75
|
/**
|
|
73
76
|
* DynamicFragment is like DynamicFlowRevamp, but it also accepts a ForwardedRef.
|
|
@@ -75,10 +78,11 @@ export function DynamicFlowRevamp(props) {
|
|
|
75
78
|
* @experimental This component may be changed in the future without notice.
|
|
76
79
|
*/
|
|
77
80
|
export var DynamicFragment = forwardRef(function DynamicFragment(props, ref) {
|
|
78
|
-
var _a = props.customFetch, customFetch = _a === void 0 ? globalThis.fetch : _a;
|
|
81
|
+
var _a = props.customFetch, customFetch = _a === void 0 ? globalThis.fetch : _a, renderers = props.renderers;
|
|
79
82
|
var httpClient = useWiseHttpClient(customFetch);
|
|
80
|
-
var
|
|
81
|
-
|
|
83
|
+
var mergedRenderers = useMemo(function () { return __spreadArray(__spreadArray([], (renderers !== null && renderers !== void 0 ? renderers : []), true), wiseRenderers, true); }, [renderers]);
|
|
84
|
+
var coreProps = __assign(__assign({}, props), { httpClient: httpClient, renderers: mergedRenderers });
|
|
85
|
+
return (_jsx(RendererHttpClientProvider, { httpClient: httpClient, children: _jsx(DynamicFragmentCore, __assign({}, coreProps, { ref: ref })) }));
|
|
82
86
|
});
|
|
83
87
|
var useWiseHttpClient = function (httpClient) {
|
|
84
88
|
var locale = useIntl().locale;
|
package/build/i18n/index.js
CHANGED
|
@@ -1,3 +1,24 @@
|
|
|
1
|
+
var __assign = (this && this.__assign) || function () {
|
|
2
|
+
__assign = Object.assign || function(t) {
|
|
3
|
+
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
4
|
+
s = arguments[i];
|
|
5
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
6
|
+
t[p] = s[p];
|
|
7
|
+
}
|
|
8
|
+
return t;
|
|
9
|
+
};
|
|
10
|
+
return __assign.apply(this, arguments);
|
|
11
|
+
};
|
|
12
|
+
var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {
|
|
13
|
+
if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
|
|
14
|
+
if (ar || !(i in from)) {
|
|
15
|
+
if (!ar) ar = Array.prototype.slice.call(from, 0, i);
|
|
16
|
+
ar[i] = from[i];
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
return to.concat(ar || Array.prototype.slice.call(from));
|
|
20
|
+
};
|
|
21
|
+
import { translations as coreTranslations } from '@wise/dynamic-flow-client';
|
|
1
22
|
import de from './de.json';
|
|
2
23
|
import en from './en.json';
|
|
3
24
|
import es from './es.json';
|
|
@@ -14,7 +35,7 @@ import th from './th.json';
|
|
|
14
35
|
import tr from './tr.json';
|
|
15
36
|
import zhCN from './zh_CN.json';
|
|
16
37
|
import zhHK from './zh_HK.json';
|
|
17
|
-
var
|
|
38
|
+
var wiseTranslations = {
|
|
18
39
|
en: en,
|
|
19
40
|
de: de,
|
|
20
41
|
es: es,
|
|
@@ -33,4 +54,9 @@ var translations = {
|
|
|
33
54
|
'zh-CN': zhCN,
|
|
34
55
|
'zh-HK': zhHK,
|
|
35
56
|
};
|
|
57
|
+
var languages = Array.from(new Set(__spreadArray(__spreadArray([], Object.keys(coreTranslations), true), Object.keys(wiseTranslations), true)));
|
|
58
|
+
var translations = languages.reduce(function (acc, lang) {
|
|
59
|
+
var _a;
|
|
60
|
+
return (__assign(__assign({}, acc), (_a = {}, _a[lang] = __assign(__assign({}, coreTranslations[lang]), wiseTranslations[lang]), _a)));
|
|
61
|
+
}, {});
|
|
36
62
|
export default translations;
|
package/build/index.js
CHANGED
|
@@ -1,17 +1,5 @@
|
|
|
1
|
-
|
|
2
|
-
__assign = Object.assign || function(t) {
|
|
3
|
-
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
4
|
-
s = arguments[i];
|
|
5
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
6
|
-
t[p] = s[p];
|
|
7
|
-
}
|
|
8
|
-
return t;
|
|
9
|
-
};
|
|
10
|
-
return __assign.apply(this, arguments);
|
|
11
|
-
};
|
|
12
|
-
import { makeHttpClient, translations as coreTranslations } from '@wise/dynamic-flow-client';
|
|
13
|
-
import wiseTranslations from './i18n';
|
|
14
|
-
export var translations = __assign(__assign({}, coreTranslations), wiseTranslations);
|
|
1
|
+
import { makeHttpClient } from '@wise/dynamic-flow-client';
|
|
15
2
|
export { JsonSchemaForm, isValidSchema } from '@wise/dynamic-flow-client';
|
|
3
|
+
export { default as translations } from './i18n';
|
|
16
4
|
export { DynamicFlowLegacy as DynamicFlow, DynamicFlowLegacy, DynamicFlowRevamp, DynamicFragment, } from './dynamicFlow/DynamicFlow';
|
|
17
5
|
export var makeCustomFetch = makeHttpClient;
|