@next-core/brick-kit 2.190.0 → 2.191.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/dist/index.bundle.js +23 -19
- package/dist/index.bundle.js.map +1 -1
- package/dist/index.esm.js +23 -19
- package/dist/index.esm.js.map +1 -1
- package/dist/types/core/Router.d.ts.map +1 -1
- package/dist/types/core/processors.d.ts.map +1 -1
- package/dist/types/core/setAppLocales.d.ts +3 -0
- package/dist/types/core/setAppLocales.d.ts.map +1 -0
- package/package.json +3 -3
package/dist/index.esm.js
CHANGED
|
@@ -7056,25 +7056,6 @@ function processBootstrapResponse(bootstrapResponse) {
|
|
|
7056
7056
|
var app = storyboard.app;
|
|
7057
7057
|
if (app) {
|
|
7058
7058
|
app.config = deepFreeze(merge({}, app.defaultConfig, app.userConfig));
|
|
7059
|
-
if (app.locales) {
|
|
7060
|
-
(function () {
|
|
7061
|
-
// Prefix to avoid conflict between brick package's i18n namespace.
|
|
7062
|
-
var ns = "$tmp-".concat(app.id);
|
|
7063
|
-
// Support any languages in `app.locales`.
|
|
7064
|
-
Object.entries(app.locales).forEach(_ref => {
|
|
7065
|
-
var [lang, resources] = _ref;
|
|
7066
|
-
i18next.addResourceBundle(lang, ns, resources);
|
|
7067
|
-
});
|
|
7068
|
-
// Use `app.name` as the fallback `app.localeName`.
|
|
7069
|
-
app.localeName = i18next.getFixedT(null, ns)("name", app.name);
|
|
7070
|
-
// Remove the temporary i18n resource bundles.
|
|
7071
|
-
Object.keys(app.locales).forEach(lang => {
|
|
7072
|
-
i18next.removeResourceBundle(lang, ns);
|
|
7073
|
-
});
|
|
7074
|
-
})();
|
|
7075
|
-
} else {
|
|
7076
|
-
app.localeName = app.name;
|
|
7077
|
-
}
|
|
7078
7059
|
}
|
|
7079
7060
|
}
|
|
7080
7061
|
if (bootstrapResponse.settings) {
|
|
@@ -11826,6 +11807,28 @@ function setWatermark() {
|
|
|
11826
11807
|
}
|
|
11827
11808
|
}
|
|
11828
11809
|
|
|
11810
|
+
function setAppLocales(app) {
|
|
11811
|
+
var _locales, _app$config, _app$config$settings;
|
|
11812
|
+
var locales = (_locales = (_app$config = app.config) === null || _app$config === void 0 ? void 0 : (_app$config$settings = _app$config.settings) === null || _app$config$settings === void 0 ? void 0 : _app$config$settings.locales) !== null && _locales !== void 0 ? _locales : app.locales;
|
|
11813
|
+
if (locales) {
|
|
11814
|
+
// Prefix to avoid conflict between brick package's i18n namespace.
|
|
11815
|
+
var ns = "$tmp-".concat(app.id);
|
|
11816
|
+
// Support any languages in `app.locales`.
|
|
11817
|
+
Object.entries(locales).forEach(_ref => {
|
|
11818
|
+
var [lang, resources] = _ref;
|
|
11819
|
+
i18next.addResourceBundle(lang, ns, resources);
|
|
11820
|
+
});
|
|
11821
|
+
// Use `app.name` as the fallback `app.localeName`.
|
|
11822
|
+
app.localeName = i18next.getFixedT(null, ns)("name", app.name);
|
|
11823
|
+
// Remove the temporary i18n resource bundles.
|
|
11824
|
+
Object.keys(locales).forEach(lang => {
|
|
11825
|
+
i18next.removeResourceBundle(lang, ns);
|
|
11826
|
+
});
|
|
11827
|
+
} else {
|
|
11828
|
+
app.localeName = app.name;
|
|
11829
|
+
}
|
|
11830
|
+
}
|
|
11831
|
+
|
|
11829
11832
|
class Router {
|
|
11830
11833
|
constructor(kernel) {
|
|
11831
11834
|
_defineProperty$1(this, "defaultCollapsed", false);
|
|
@@ -12005,6 +12008,7 @@ class Router {
|
|
|
12005
12008
|
if (storyboard) {
|
|
12006
12009
|
var _storyboard$meta, _storyboard$meta2, _storyboard$meta3;
|
|
12007
12010
|
yield _this3.kernel.fulfilStoryboard(storyboard);
|
|
12011
|
+
setAppLocales(storyboard.app);
|
|
12008
12012
|
_this3.kernel.nextApp = storyboard.app;
|
|
12009
12013
|
setWatermark();
|
|
12010
12014
|
removeDeadConditions(storyboard, {
|