Comparing version 0.6.0-pre.529 to 0.6.0-pre.533
@@ -65,8 +65,14 @@ "use strict"; | ||
var { pilets = defaultRequestPilets, translations = {}, extendApi = defaultExtendApi, attach, actions } = _a, forwardOptions = __rest(_a, ["pilets", "translations", "extendApi", "attach", "actions"]); | ||
const state = piral_core_1.setupState(Object.assign({}, initialState, { languages: Object.keys(translations) })); | ||
const apis = {}; | ||
const messages = Array.isArray(translations) | ||
? translations.reduce((prev, curr) => { | ||
prev[curr] = {}; | ||
return prev; | ||
}, {}) | ||
: translations; | ||
const state = piral_core_1.setupState(Object.assign({}, initialState, { languages: Object.keys(messages) })); | ||
const localizer = piral_ext_1.setupLocalizer({ | ||
language: state.app.language.selected, | ||
messages: translations, | ||
messages, | ||
}); | ||
const apis = {}; | ||
const Piral = piral_core_1.createInstance(Object.assign({}, forwardOptions, { availablePilets: utils_1.getAvailablePilets(attach), requestPilets: utils_1.getPiletRequester(pilets), actions: Object.assign({}, actions, actions_1.createTranslationsActions(localizer, apis)), extendApi(api, target) { | ||
@@ -73,0 +79,0 @@ const newApi = Object.assign({}, piral_ext_1.createFetchApi(uri), piral_ext_1.createGqlApi(client), piral_ext_1.createLocaleApi(localizer), api); |
@@ -15,6 +15,7 @@ import { ArbiterModuleMetadata } from 'react-arbiter'; | ||
/** | ||
* Sets the default translations to be available. | ||
* Sets the default translations to be available. Alternatively, | ||
* sets the available languages. | ||
* @default {} | ||
*/ | ||
translations?: LocalizationMessages; | ||
translations?: LocalizationMessages | Array<string>; | ||
/** | ||
@@ -21,0 +22,0 @@ * Attaches a single static module to the application. |
{ | ||
"name": "piral", | ||
"version": "0.6.0-pre.529", | ||
"version": "0.6.0-pre.533", | ||
"description": "The all-in-one piral package.", | ||
@@ -44,4 +44,4 @@ "keywords": [ | ||
"graphql": "^14.3.0", | ||
"piral-core": "^0.6.0-pre.529", | ||
"piral-ext": "^0.6.0-pre.529", | ||
"piral-core": "^0.6.0-pre.533", | ||
"piral-ext": "^0.6.0-pre.533", | ||
"promise-polyfill": "^8.1.0", | ||
@@ -60,3 +60,3 @@ "react": "^16.8.1", | ||
}, | ||
"gitHead": "3e0b4f9f9e6691c3987a8d17d3518a32021370fd" | ||
"gitHead": "15d029b23012c62092e4af638f69c5a95e4f9aa4" | ||
} |
@@ -20,6 +20,7 @@ import { ArbiterModuleMetadata } from 'react-arbiter'; | ||
/** | ||
* Sets the default translations to be available. | ||
* Sets the default translations to be available. Alternatively, | ||
* sets the available languages. | ||
* @default {} | ||
*/ | ||
translations?: LocalizationMessages; | ||
translations?: LocalizationMessages | Array<string>; | ||
/** | ||
@@ -26,0 +27,0 @@ * Attaches a single static module to the application. |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
118523
2495
Updatedpiral-core@^0.6.0-pre.533
Updatedpiral-ext@^0.6.0-pre.533