@beinformed/ui 1.62.7 → 1.62.9

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.
Files changed (680) hide show
  1. package/CHANGELOG.md +16 -0
  2. package/esm/constants/Settings.js +4 -0
  3. package/esm/constants/Settings.js.flow +5 -1
  4. package/esm/constants/Settings.js.map +1 -1
  5. package/esm/react-client/client.js +19 -0
  6. package/esm/react-client/client.js.flow +23 -1
  7. package/esm/react-client/client.js.map +1 -1
  8. package/esm/react-server/__tests__/requestInformation.spec.js.flow +265 -0
  9. package/esm/react-server/requestInformation.js +6 -3
  10. package/esm/react-server/requestInformation.js.flow +8 -3
  11. package/esm/react-server/requestInformation.js.map +1 -1
  12. package/esm/react-server/serverUtil.js +2 -2
  13. package/esm/react-server/serverUtil.js.flow +2 -2
  14. package/esm/react-server/serverUtil.js.map +1 -1
  15. package/esm/redux/_i18n/I18nActions.js.flow +0 -1
  16. package/esm/redux/_i18n/I18nActions.js.map +1 -1
  17. package/esm/redux/_i18n/I18nReducer.js +11 -3
  18. package/esm/redux/_i18n/I18nReducer.js.flow +11 -3
  19. package/esm/redux/_i18n/I18nReducer.js.map +1 -1
  20. package/esm/redux/reducers/createReducer.js +2 -2
  21. package/esm/redux/reducers/createReducer.js.flow +1 -1
  22. package/esm/redux/reducers/createReducer.js.map +1 -1
  23. package/esm/redux/store/configureStore.js +0 -5
  24. package/esm/redux/store/configureStore.js.flow +0 -7
  25. package/esm/redux/store/configureStore.js.map +1 -1
  26. package/esm/utils/datetime/DateTimeUtil.js +3 -2
  27. package/esm/utils/datetime/DateTimeUtil.js.flow +3 -1
  28. package/esm/utils/datetime/DateTimeUtil.js.map +1 -1
  29. package/lib/constants/Settings.js +7 -2
  30. package/lib/constants/Settings.js.map +1 -1
  31. package/lib/react-client/client.js +20 -1
  32. package/lib/react-client/client.js.map +1 -1
  33. package/lib/react-server/requestInformation.js +6 -3
  34. package/lib/react-server/requestInformation.js.map +1 -1
  35. package/lib/react-server/serverUtil.js +1 -1
  36. package/lib/react-server/serverUtil.js.map +1 -1
  37. package/lib/redux/_i18n/I18nActions.js.map +1 -1
  38. package/lib/redux/_i18n/I18nReducer.js +10 -2
  39. package/lib/redux/_i18n/I18nReducer.js.map +1 -1
  40. package/lib/redux/reducers/createReducer.js +2 -2
  41. package/lib/redux/reducers/createReducer.js.map +1 -1
  42. package/lib/redux/store/configureStore.js +0 -5
  43. package/lib/redux/store/configureStore.js.map +1 -1
  44. package/lib/utils/datetime/DateTimeUtil.js +2 -1
  45. package/lib/utils/datetime/DateTimeUtil.js.map +1 -1
  46. package/package.json +10 -10
  47. package/src/constants/Settings.js +5 -1
  48. package/src/react-client/client.js +23 -1
  49. package/src/react-server/__tests__/requestInformation.spec.js +265 -0
  50. package/src/react-server/requestInformation.js +8 -3
  51. package/src/react-server/serverUtil.js +2 -2
  52. package/src/redux/_i18n/I18nActions.js +0 -1
  53. package/src/redux/_i18n/I18nReducer.js +11 -3
  54. package/src/redux/reducers/createReducer.js +1 -1
  55. package/src/redux/store/configureStore.js +0 -7
  56. package/src/utils/datetime/DateTimeUtil.js +3 -1
  57. package/esm/builder/index.d.ts +0 -1
  58. package/esm/builder/mergeLayoutHintConfigurations.d.ts +0 -1
  59. package/esm/constants/Constants.d.ts +0 -158
  60. package/esm/constants/LayoutHintConfig.d.ts +0 -267
  61. package/esm/constants/LayoutHints.d.ts +0 -83
  62. package/esm/constants/Settings.d.ts +0 -32
  63. package/esm/constants/index.d.ts +0 -3
  64. package/esm/exceptions/ConfigurationException.d.ts +0 -7
  65. package/esm/exceptions/FetchException.d.ts +0 -31
  66. package/esm/exceptions/IllegalArgumentException.d.ts +0 -7
  67. package/esm/exceptions/IllegalReturnException.d.ts +0 -6
  68. package/esm/exceptions/IllegalStateException.d.ts +0 -7
  69. package/esm/exceptions/JsonParseException.d.ts +0 -7
  70. package/esm/exceptions/MissingPropertyException.d.ts +0 -7
  71. package/esm/exceptions/NetworkException.d.ts +0 -9
  72. package/esm/exceptions/NotAllowedUriException.d.ts +0 -7
  73. package/esm/exceptions/NotFoundException.d.ts +0 -10
  74. package/esm/exceptions/ServerRequestException.d.ts +0 -7
  75. package/esm/exceptions/ThemePropertyException.d.ts +0 -7
  76. package/esm/exceptions/TimeoutException.d.ts +0 -7
  77. package/esm/exceptions/UnauthorizedException.d.ts +0 -11
  78. package/esm/exceptions/UnsupportedOperationException.d.ts +0 -7
  79. package/esm/exceptions/index.d.ts +0 -15
  80. package/esm/hooks/index.d.ts +0 -16
  81. package/esm/hooks/useAllFormsOnModel.d.ts +0 -7
  82. package/esm/hooks/useAuthentication.d.ts +0 -16
  83. package/esm/hooks/useContent.d.ts +0 -3
  84. package/esm/hooks/useDeepCompareEffect.d.ts +0 -6
  85. package/esm/hooks/useForm.d.ts +0 -21
  86. package/esm/hooks/useI18n.d.ts +0 -13
  87. package/esm/hooks/useModal.d.ts +0 -12
  88. package/esm/hooks/useModelCatalog.d.ts +0 -34
  89. package/esm/hooks/useModels.d.ts +0 -10
  90. package/esm/hooks/useModularUI.d.ts +0 -3
  91. package/esm/hooks/useModularUIBasic.d.ts +0 -9
  92. package/esm/hooks/useModularUIModel.d.ts +0 -27
  93. package/esm/hooks/useModularUIRequest.d.ts +0 -4
  94. package/esm/hooks/useNotification.d.ts +0 -8
  95. package/esm/hooks/usePreference.d.ts +0 -2
  96. package/esm/hooks/useProgressIndicator.d.ts +0 -9
  97. package/esm/hooks/useRouter.d.ts +0 -23
  98. package/esm/i18n/Locale.d.ts +0 -53
  99. package/esm/i18n/Locales.d.ts +0 -59
  100. package/esm/i18n/Message.d.ts +0 -6
  101. package/esm/i18n/index.d.ts +0 -5
  102. package/esm/i18n/languages.d.ts +0 -215
  103. package/esm/i18n/translations/beinformed_error_messages_en.nl.d.ts +0 -97
  104. package/esm/i18n/translations/beinformed_error_messages_nl.nl.d.ts +0 -97
  105. package/esm/i18n/types.d.ts +0 -11
  106. package/esm/i18n/withMessage.d.ts +0 -3
  107. package/esm/index.d.ts +0 -6
  108. package/esm/models/actions/ActionCollection.d.ts +0 -30
  109. package/esm/models/actions/ActionModel.d.ts +0 -82
  110. package/esm/models/application/ApplicationModel.d.ts +0 -48
  111. package/esm/models/attributes/AttributeCollection.d.ts +0 -102
  112. package/esm/models/attributes/AttributeContent.d.ts +0 -64
  113. package/esm/models/attributes/AttributeDataHelper.d.ts +0 -67
  114. package/esm/models/attributes/AttributeModel.d.ts +0 -398
  115. package/esm/models/attributes/AttributeSetModel.d.ts +0 -36
  116. package/esm/models/attributes/BooleanAttributeModel.d.ts +0 -69
  117. package/esm/models/attributes/CaptchaAttributeModel.d.ts +0 -19
  118. package/esm/models/attributes/ChoiceAttributeModel.d.ts +0 -85
  119. package/esm/models/attributes/ChoiceAttributeOptionCollection.d.ts +0 -87
  120. package/esm/models/attributes/ChoiceAttributeOptionModel.d.ts +0 -151
  121. package/esm/models/attributes/CompositeAttributeChildCollection.d.ts +0 -57
  122. package/esm/models/attributes/CompositeAttributeModel.d.ts +0 -42
  123. package/esm/models/attributes/DatetimeAttributeModel.d.ts +0 -85
  124. package/esm/models/attributes/HelptextAttributeModel.d.ts +0 -16
  125. package/esm/models/attributes/LabelAttributeModel.d.ts +0 -12
  126. package/esm/models/attributes/MemoAttributeModel.d.ts +0 -14
  127. package/esm/models/attributes/MoneyAttributeModel.d.ts +0 -14
  128. package/esm/models/attributes/NumberAttributeModel.d.ts +0 -49
  129. package/esm/models/attributes/PasswordAttributeModel.d.ts +0 -62
  130. package/esm/models/attributes/StringAttributeModel.d.ts +0 -65
  131. package/esm/models/attributes/UploadAttributeModel.d.ts +0 -60
  132. package/esm/models/attributes/XMLAttributeModel.d.ts +0 -10
  133. package/esm/models/attributes/_createAttribute.d.ts +0 -7
  134. package/esm/models/attributes/input-constraints/BSNConstraint.d.ts +0 -26
  135. package/esm/models/attributes/input-constraints/ConstraintCollection.d.ts +0 -24
  136. package/esm/models/attributes/input-constraints/ConstraintModel.d.ts +0 -34
  137. package/esm/models/attributes/input-constraints/DateBoundaryConstraint.d.ts +0 -65
  138. package/esm/models/attributes/input-constraints/DateTimeDateFormatConstraint.d.ts +0 -36
  139. package/esm/models/attributes/input-constraints/DateTimeTimeFormatConstraint.d.ts +0 -36
  140. package/esm/models/attributes/input-constraints/DatetimeFormatConstraint.d.ts +0 -50
  141. package/esm/models/attributes/input-constraints/FileExtensionConstraint.d.ts +0 -33
  142. package/esm/models/attributes/input-constraints/FileSizeConstraint.d.ts +0 -42
  143. package/esm/models/attributes/input-constraints/IBANConstraint.d.ts +0 -23
  144. package/esm/models/attributes/input-constraints/MandatoryConstraint.d.ts +0 -23
  145. package/esm/models/attributes/input-constraints/MandatoryRangeConstraint.d.ts +0 -36
  146. package/esm/models/attributes/input-constraints/NumberBoundaryConstraint.d.ts +0 -61
  147. package/esm/models/attributes/input-constraints/NumberFormatConstraint.d.ts +0 -52
  148. package/esm/models/attributes/input-constraints/NumberGroupingConstraint.d.ts +0 -46
  149. package/esm/models/attributes/input-constraints/PasswordConfirmConstraint.d.ts +0 -36
  150. package/esm/models/attributes/input-constraints/PasswordLowerAndUpperCaseConstraint.d.ts +0 -23
  151. package/esm/models/attributes/input-constraints/PasswordMinNumericCharactersConstraint.d.ts +0 -32
  152. package/esm/models/attributes/input-constraints/PasswordMinSpecialCharactersConstraint.d.ts +0 -32
  153. package/esm/models/attributes/input-constraints/PasswordThreeConsecutiveCharactersNotAllowedConstraint.d.ts +0 -35
  154. package/esm/models/attributes/input-constraints/RangeConstraint.d.ts +0 -51
  155. package/esm/models/attributes/input-constraints/RegexConstraint.d.ts +0 -37
  156. package/esm/models/attributes/input-constraints/StringLengthConstraint.d.ts +0 -46
  157. package/esm/models/attributes/input-constraints/XMLConstraint.d.ts +0 -26
  158. package/esm/models/attributes/layouthint-rules/BaseLayoutHintRule.d.ts +0 -45
  159. package/esm/models/attributes/layouthint-rules/DependentAttribute.d.ts +0 -57
  160. package/esm/models/attributes/layouthint-rules/LayoutHintRuleCollection.d.ts +0 -27
  161. package/esm/models/attributes/layouthint-rules/RemainingTotalUploadSize.d.ts +0 -17
  162. package/esm/models/base/BaseCollection.d.ts +0 -89
  163. package/esm/models/base/BaseModel.d.ts +0 -78
  164. package/esm/models/base/ResourceCollection.d.ts +0 -20
  165. package/esm/models/base/ResourceModel.d.ts +0 -102
  166. package/esm/models/caseview/CaseViewModel.d.ts +0 -46
  167. package/esm/models/concepts/BusinessScenarioModel.d.ts +0 -20
  168. package/esm/models/concepts/ConceptDetailModel.d.ts +0 -86
  169. package/esm/models/concepts/ConceptIndexModel.d.ts +0 -44
  170. package/esm/models/concepts/ConceptLinkModel.d.ts +0 -82
  171. package/esm/models/concepts/ConceptRelationCollection.d.ts +0 -36
  172. package/esm/models/concepts/ConceptRelationModel.d.ts +0 -61
  173. package/esm/models/concepts/ConceptTypeDetailModel.d.ts +0 -54
  174. package/esm/models/concepts/SourceReferenceCollection.d.ts +0 -14
  175. package/esm/models/concepts/SourceReferenceModel.d.ts +0 -48
  176. package/esm/models/content/ContentIndexModel.d.ts +0 -41
  177. package/esm/models/content/ContentLinkModel.d.ts +0 -102
  178. package/esm/models/content/ContentModel.d.ts +0 -80
  179. package/esm/models/content/ContentTOCModel.d.ts +0 -56
  180. package/esm/models/content/ContentTypeModel.d.ts +0 -26
  181. package/esm/models/content/SectionModel.d.ts +0 -79
  182. package/esm/models/content/SubSectionModel.d.ts +0 -69
  183. package/esm/models/contentconfiguration/ContentConfiguration.d.ts +0 -28
  184. package/esm/models/contentconfiguration/ContentConfigurationElements.d.ts +0 -47
  185. package/esm/models/contentconfiguration/ContentConfigurationEndResults.d.ts +0 -16
  186. package/esm/models/contentconfiguration/ContentConfigurationQuestions.d.ts +0 -22
  187. package/esm/models/contentconfiguration/ContentConfigurationResults.d.ts +0 -39
  188. package/esm/models/detail/DetailModel.d.ts +0 -80
  189. package/esm/models/error/ErrorCollection.d.ts +0 -51
  190. package/esm/models/error/ErrorModel.d.ts +0 -41
  191. package/esm/models/error/ErrorResponse.d.ts +0 -156
  192. package/esm/models/filters/AssignmentFilterModel.d.ts +0 -35
  193. package/esm/models/filters/BaseFilterModel.d.ts +0 -101
  194. package/esm/models/filters/ConceptIndexFilterModel.d.ts +0 -6
  195. package/esm/models/filters/FilterCollection.d.ts +0 -49
  196. package/esm/models/filters/FilterModel.d.ts +0 -5
  197. package/esm/models/filters/RangeFilterModel.d.ts +0 -6
  198. package/esm/models/filters/StringFilterModel.d.ts +0 -30
  199. package/esm/models/form/FormModel.d.ts +0 -350
  200. package/esm/models/form/FormObjectModel.d.ts +0 -210
  201. package/esm/models/grouping/GroupingModel.d.ts +0 -86
  202. package/esm/models/href/Href.d.ts +0 -218
  203. package/esm/models/href/ListHref.d.ts +0 -64
  204. package/esm/models/index.d.ts +0 -96
  205. package/esm/models/layouthint/LayoutHintCollection.d.ts +0 -43
  206. package/esm/models/links/LinkCollection.d.ts +0 -71
  207. package/esm/models/links/LinkModel.d.ts +0 -93
  208. package/esm/models/links/normalizeLinkJSON.d.ts +0 -9
  209. package/esm/models/list/ListDetailModel.d.ts +0 -69
  210. package/esm/models/list/ListHeaderModel.d.ts +0 -53
  211. package/esm/models/list/ListItemCollection.d.ts +0 -21
  212. package/esm/models/list/ListItemModel.d.ts +0 -35
  213. package/esm/models/list/ListModel.d.ts +0 -143
  214. package/esm/models/lookup/LookupOptionCollection.d.ts +0 -15
  215. package/esm/models/lookup/LookupOptionsModel.d.ts +0 -23
  216. package/esm/models/modelcatalog/ModelCatalogModel.d.ts +0 -23
  217. package/esm/models/modelcatalog/ModelCategoryCollection.d.ts +0 -11
  218. package/esm/models/modelcatalog/ModelCategoryModel.d.ts +0 -39
  219. package/esm/models/paging/PagesizeModel.d.ts +0 -25
  220. package/esm/models/paging/PagingModel.d.ts +0 -49
  221. package/esm/models/panels/GroupingPanelModel.d.ts +0 -49
  222. package/esm/models/parameter/Parameter.d.ts +0 -40
  223. package/esm/models/process/ProcessStatusSettingsModel.d.ts +0 -38
  224. package/esm/models/resolveModel.d.ts +0 -7
  225. package/esm/models/search/CaseSearchModel.d.ts +0 -14
  226. package/esm/models/sorting/SortOptionModel.d.ts +0 -48
  227. package/esm/models/sorting/SortingModel.d.ts +0 -42
  228. package/esm/models/tab/TabModel.d.ts +0 -53
  229. package/esm/models/taskgroup/TaskGroupCollection.d.ts +0 -12
  230. package/esm/models/taskgroup/TaskGroupModel.d.ts +0 -25
  231. package/esm/models/types.d.ts +0 -171
  232. package/esm/models/user/UserModel.d.ts +0 -18
  233. package/esm/models/user/UserProfileModel.d.ts +0 -17
  234. package/esm/models/user/UserServicesModel.d.ts +0 -39
  235. package/esm/modularui/Authenticate.d.ts +0 -46
  236. package/esm/modularui/CaptchaRequest.d.ts +0 -54
  237. package/esm/modularui/ModularUIError.d.ts +0 -10
  238. package/esm/modularui/ModularUIRequest.d.ts +0 -207
  239. package/esm/modularui/ModularUIResponse.d.ts +0 -78
  240. package/esm/modularui/UploadRequest.d.ts +0 -41
  241. package/esm/modularui/index.d.ts +0 -5
  242. package/esm/modularui/types.d.ts +0 -2
  243. package/esm/react/ErrorBoundary.d.ts +0 -31
  244. package/esm/react/ErrorBoundaryFallback.d.ts +0 -8
  245. package/esm/react/index.d.ts +0 -2
  246. package/esm/react/utils.d.ts +0 -5
  247. package/esm/react-client/Init.d.ts +0 -6
  248. package/esm/react-client/client.d.ts +0 -25
  249. package/esm/react-client/contextPath.d.ts +0 -1
  250. package/esm/react-client/index.d.ts +0 -3
  251. package/esm/react-client/rehydrate.d.ts +0 -5
  252. package/esm/react-server/contextPath.d.ts +0 -1
  253. package/esm/react-server/createSSRComplete.d.ts +0 -5
  254. package/esm/react-server/htmlpage.d.ts +0 -11
  255. package/esm/react-server/index.d.ts +0 -8
  256. package/esm/react-server/renderSSRComplete.d.ts +0 -13
  257. package/esm/react-server/renderSSRMinimal.d.ts +0 -11
  258. package/esm/react-server/requestInformation.d.ts +0 -6
  259. package/esm/react-server/serverNoSSR.d.ts +0 -15
  260. package/esm/react-server/serverSSR.d.ts +0 -15
  261. package/esm/react-server/serverUtil.d.ts +0 -46
  262. package/esm/react-theme/ThemeProvider.d.ts +0 -8
  263. package/esm/react-theme/createTheme.d.ts +0 -53
  264. package/esm/react-theme/index.d.ts +0 -10
  265. package/esm/react-theme/types.d.ts +0 -13
  266. package/esm/react-theme/useTheme.d.ts +0 -4
  267. package/esm/react-theme/utils/background.d.ts +0 -4
  268. package/esm/react-theme/utils/colors.d.ts +0 -9
  269. package/esm/react-theme/utils/contrast.d.ts +0 -18
  270. package/esm/react-theme/utils/corners.d.ts +0 -3
  271. package/esm/react-theme/utils/spacers.d.ts +0 -9
  272. package/esm/react-theme/utils/themeProps.d.ts +0 -7
  273. package/esm/redux/_i18n/I18nActions.d.ts +0 -7
  274. package/esm/redux/_i18n/I18nReducer.d.ts +0 -7
  275. package/esm/redux/_i18n/index.d.ts +0 -3
  276. package/esm/redux/_i18n/types.d.ts +0 -13
  277. package/esm/redux/_modularui/ModularUIActions.d.ts +0 -26
  278. package/esm/redux/_modularui/ModularUIConnector.d.ts +0 -7
  279. package/esm/redux/_modularui/ModularUIMiddleware.d.ts +0 -7
  280. package/esm/redux/_modularui/ModularUIReducer.d.ts +0 -7
  281. package/esm/redux/_modularui/ModularUISelectors.d.ts +0 -3
  282. package/esm/redux/_modularui/ModularUIUtils.d.ts +0 -5
  283. package/esm/redux/_modularui/index.d.ts +0 -8
  284. package/esm/redux/_modularui/types.d.ts +0 -84
  285. package/esm/redux/_modularui/withModularUI.d.ts +0 -3
  286. package/esm/redux/_router/RouterActions.d.ts +0 -10
  287. package/esm/redux/_router/RouterConnectors.d.ts +0 -6
  288. package/esm/redux/_router/RouterMiddleware.d.ts +0 -5
  289. package/esm/redux/_router/RouterReducer.d.ts +0 -7
  290. package/esm/redux/_router/index.d.ts +0 -5
  291. package/esm/redux/_router/types.d.ts +0 -35
  292. package/esm/redux/actions/Application.d.ts +0 -4
  293. package/esm/redux/actions/Authorization.d.ts +0 -3
  294. package/esm/redux/actions/Error.d.ts +0 -7
  295. package/esm/redux/actions/Form.d.ts +0 -5
  296. package/esm/redux/actions/FormAttributeSet.d.ts +0 -6
  297. package/esm/redux/actions/FormAttributeSetRepeatable.d.ts +0 -6
  298. package/esm/redux/actions/FormAutosave.d.ts +0 -3
  299. package/esm/redux/actions/FormAutosubmit.d.ts +0 -4
  300. package/esm/redux/actions/FormAutoupdate.d.ts +0 -4
  301. package/esm/redux/actions/FormValidations.d.ts +0 -3
  302. package/esm/redux/actions/Modals.d.ts +0 -4
  303. package/esm/redux/actions/ModelCatalog.d.ts +0 -2
  304. package/esm/redux/actions/Notification.d.ts +0 -10
  305. package/esm/redux/actions/Preferences.d.ts +0 -11
  306. package/esm/redux/actions/ProgressIndicator.d.ts +0 -8
  307. package/esm/redux/actions/SignIn.d.ts +0 -10
  308. package/esm/redux/actions/SignOut.d.ts +0 -4
  309. package/esm/redux/actions/index.d.ts +0 -16
  310. package/esm/redux/connectors/Application.d.ts +0 -4
  311. package/esm/redux/connectors/Breadcrumb.d.ts +0 -3
  312. package/esm/redux/connectors/CaseView.d.ts +0 -4
  313. package/esm/redux/connectors/ConceptDetail.d.ts +0 -4
  314. package/esm/redux/connectors/ContentBrowser.d.ts +0 -4
  315. package/esm/redux/connectors/ContentDetail.d.ts +0 -4
  316. package/esm/redux/connectors/ContentDetailSection.d.ts +0 -4
  317. package/esm/redux/connectors/Form.d.ts +0 -16
  318. package/esm/redux/connectors/FormAttributeSet.d.ts +0 -5
  319. package/esm/redux/connectors/ListDetail.d.ts +0 -4
  320. package/esm/redux/connectors/Modal.d.ts +0 -4
  321. package/esm/redux/connectors/ModelCatalog.d.ts +0 -4
  322. package/esm/redux/connectors/Notification.d.ts +0 -4
  323. package/esm/redux/connectors/PanelRenderer.d.ts +0 -4
  324. package/esm/redux/connectors/Preferences.d.ts +0 -2
  325. package/esm/redux/connectors/Progress.d.ts +0 -3
  326. package/esm/redux/connectors/ProgressIndicator.d.ts +0 -3
  327. package/esm/redux/connectors/QuickSearch.d.ts +0 -11
  328. package/esm/redux/connectors/SignIn.d.ts +0 -4
  329. package/esm/redux/connectors/SignOut.d.ts +0 -4
  330. package/esm/redux/connectors/Tab.d.ts +0 -4
  331. package/esm/redux/connectors/index.d.ts +0 -21
  332. package/esm/redux/index.d.ts +0 -9
  333. package/esm/redux/reducers/AuthReducer.d.ts +0 -8
  334. package/esm/redux/reducers/ErrorReducer.d.ts +0 -8
  335. package/esm/redux/reducers/ModalsReducer.d.ts +0 -8
  336. package/esm/redux/reducers/ModelCatalogReducer.d.ts +0 -8
  337. package/esm/redux/reducers/NotificationReducer.d.ts +0 -8
  338. package/esm/redux/reducers/PreferencesReducer.d.ts +0 -8
  339. package/esm/redux/reducers/ProgressIndicatorReducer.d.ts +0 -8
  340. package/esm/redux/reducers/createReducer.d.ts +0 -14
  341. package/esm/redux/reducers/index.d.ts +0 -8
  342. package/esm/redux/selectors/i18n.d.ts +0 -4
  343. package/esm/redux/selectors/index.d.ts +0 -2
  344. package/esm/redux/selectors/modelcatalog.d.ts +0 -2
  345. package/esm/redux/store/beforeRenderHooks.d.ts +0 -7
  346. package/esm/redux/store/configureStore.d.ts +0 -9
  347. package/esm/redux/types.d.ts +0 -113
  348. package/esm/utils/browser/Cache.d.ts +0 -45
  349. package/esm/utils/browser/Cookies.d.ts +0 -9
  350. package/esm/utils/datetime/DateTimeUtil.d.ts +0 -214
  351. package/esm/utils/fetch/__mocks__/universalFetch.d.ts +0 -3
  352. package/esm/utils/fetch/serverFetch.d.ts +0 -5
  353. package/esm/utils/fetch/types.d.ts +0 -44
  354. package/esm/utils/fetch/universalFetch.d.ts +0 -7
  355. package/esm/utils/fetch/xhr.d.ts +0 -5
  356. package/esm/utils/helpers/checkResource.d.ts +0 -3
  357. package/esm/utils/helpers/createHash.d.ts +0 -9
  358. package/esm/utils/helpers/createHref.d.ts +0 -8
  359. package/esm/utils/helpers/createUUID.d.ts +0 -4
  360. package/esm/utils/helpers/index.d.ts +0 -8
  361. package/esm/utils/helpers/objects.d.ts +0 -11
  362. package/esm/utils/helpers/repositoryResource.d.ts +0 -1
  363. package/esm/utils/helpers/sanitizeHtml.d.ts +0 -9
  364. package/esm/utils/helpers/text.d.ts +0 -7
  365. package/esm/utils/index.d.ts +0 -11
  366. package/esm/utils/number/DecimalFormat.d.ts +0 -90
  367. package/esm/utils/number/formatValue.d.ts +0 -4
  368. package/esm/utils/number/parseNumbers.d.ts +0 -9
  369. package/lib/builder/index.d.ts +0 -1
  370. package/lib/builder/mergeLayoutHintConfigurations.d.ts +0 -1
  371. package/lib/constants/Constants.d.ts +0 -158
  372. package/lib/constants/LayoutHintConfig.d.ts +0 -267
  373. package/lib/constants/LayoutHints.d.ts +0 -83
  374. package/lib/constants/Settings.d.ts +0 -32
  375. package/lib/constants/index.d.ts +0 -3
  376. package/lib/exceptions/ConfigurationException.d.ts +0 -7
  377. package/lib/exceptions/FetchException.d.ts +0 -31
  378. package/lib/exceptions/IllegalArgumentException.d.ts +0 -7
  379. package/lib/exceptions/IllegalReturnException.d.ts +0 -6
  380. package/lib/exceptions/IllegalStateException.d.ts +0 -7
  381. package/lib/exceptions/JsonParseException.d.ts +0 -7
  382. package/lib/exceptions/MissingPropertyException.d.ts +0 -7
  383. package/lib/exceptions/NetworkException.d.ts +0 -9
  384. package/lib/exceptions/NotAllowedUriException.d.ts +0 -7
  385. package/lib/exceptions/NotFoundException.d.ts +0 -10
  386. package/lib/exceptions/ServerRequestException.d.ts +0 -7
  387. package/lib/exceptions/ThemePropertyException.d.ts +0 -7
  388. package/lib/exceptions/TimeoutException.d.ts +0 -7
  389. package/lib/exceptions/UnauthorizedException.d.ts +0 -11
  390. package/lib/exceptions/UnsupportedOperationException.d.ts +0 -7
  391. package/lib/exceptions/index.d.ts +0 -15
  392. package/lib/hooks/index.d.ts +0 -16
  393. package/lib/hooks/useAllFormsOnModel.d.ts +0 -7
  394. package/lib/hooks/useAuthentication.d.ts +0 -16
  395. package/lib/hooks/useContent.d.ts +0 -3
  396. package/lib/hooks/useDeepCompareEffect.d.ts +0 -6
  397. package/lib/hooks/useForm.d.ts +0 -21
  398. package/lib/hooks/useI18n.d.ts +0 -13
  399. package/lib/hooks/useModal.d.ts +0 -12
  400. package/lib/hooks/useModelCatalog.d.ts +0 -34
  401. package/lib/hooks/useModels.d.ts +0 -10
  402. package/lib/hooks/useModularUI.d.ts +0 -3
  403. package/lib/hooks/useModularUIBasic.d.ts +0 -9
  404. package/lib/hooks/useModularUIModel.d.ts +0 -27
  405. package/lib/hooks/useModularUIRequest.d.ts +0 -4
  406. package/lib/hooks/useNotification.d.ts +0 -8
  407. package/lib/hooks/usePreference.d.ts +0 -2
  408. package/lib/hooks/useProgressIndicator.d.ts +0 -9
  409. package/lib/hooks/useRouter.d.ts +0 -23
  410. package/lib/i18n/Locale.d.ts +0 -53
  411. package/lib/i18n/Locales.d.ts +0 -59
  412. package/lib/i18n/Message.d.ts +0 -6
  413. package/lib/i18n/index.d.ts +0 -5
  414. package/lib/i18n/languages.d.ts +0 -215
  415. package/lib/i18n/translations/beinformed_error_messages_en.nl.d.ts +0 -97
  416. package/lib/i18n/translations/beinformed_error_messages_nl.nl.d.ts +0 -97
  417. package/lib/i18n/types.d.ts +0 -11
  418. package/lib/i18n/withMessage.d.ts +0 -3
  419. package/lib/index.d.ts +0 -6
  420. package/lib/models/actions/ActionCollection.d.ts +0 -30
  421. package/lib/models/actions/ActionModel.d.ts +0 -82
  422. package/lib/models/application/ApplicationModel.d.ts +0 -48
  423. package/lib/models/attributes/AttributeCollection.d.ts +0 -102
  424. package/lib/models/attributes/AttributeContent.d.ts +0 -64
  425. package/lib/models/attributes/AttributeDataHelper.d.ts +0 -67
  426. package/lib/models/attributes/AttributeModel.d.ts +0 -398
  427. package/lib/models/attributes/AttributeSetModel.d.ts +0 -36
  428. package/lib/models/attributes/BooleanAttributeModel.d.ts +0 -69
  429. package/lib/models/attributes/CaptchaAttributeModel.d.ts +0 -19
  430. package/lib/models/attributes/ChoiceAttributeModel.d.ts +0 -85
  431. package/lib/models/attributes/ChoiceAttributeOptionCollection.d.ts +0 -87
  432. package/lib/models/attributes/ChoiceAttributeOptionModel.d.ts +0 -151
  433. package/lib/models/attributes/CompositeAttributeChildCollection.d.ts +0 -57
  434. package/lib/models/attributes/CompositeAttributeModel.d.ts +0 -42
  435. package/lib/models/attributes/DatetimeAttributeModel.d.ts +0 -85
  436. package/lib/models/attributes/HelptextAttributeModel.d.ts +0 -16
  437. package/lib/models/attributes/LabelAttributeModel.d.ts +0 -12
  438. package/lib/models/attributes/MemoAttributeModel.d.ts +0 -14
  439. package/lib/models/attributes/MoneyAttributeModel.d.ts +0 -14
  440. package/lib/models/attributes/NumberAttributeModel.d.ts +0 -49
  441. package/lib/models/attributes/PasswordAttributeModel.d.ts +0 -62
  442. package/lib/models/attributes/StringAttributeModel.d.ts +0 -65
  443. package/lib/models/attributes/UploadAttributeModel.d.ts +0 -60
  444. package/lib/models/attributes/XMLAttributeModel.d.ts +0 -10
  445. package/lib/models/attributes/_createAttribute.d.ts +0 -7
  446. package/lib/models/attributes/input-constraints/BSNConstraint.d.ts +0 -26
  447. package/lib/models/attributes/input-constraints/ConstraintCollection.d.ts +0 -24
  448. package/lib/models/attributes/input-constraints/ConstraintModel.d.ts +0 -34
  449. package/lib/models/attributes/input-constraints/DateBoundaryConstraint.d.ts +0 -65
  450. package/lib/models/attributes/input-constraints/DateTimeDateFormatConstraint.d.ts +0 -36
  451. package/lib/models/attributes/input-constraints/DateTimeTimeFormatConstraint.d.ts +0 -36
  452. package/lib/models/attributes/input-constraints/DatetimeFormatConstraint.d.ts +0 -50
  453. package/lib/models/attributes/input-constraints/FileExtensionConstraint.d.ts +0 -33
  454. package/lib/models/attributes/input-constraints/FileSizeConstraint.d.ts +0 -42
  455. package/lib/models/attributes/input-constraints/IBANConstraint.d.ts +0 -23
  456. package/lib/models/attributes/input-constraints/MandatoryConstraint.d.ts +0 -23
  457. package/lib/models/attributes/input-constraints/MandatoryRangeConstraint.d.ts +0 -36
  458. package/lib/models/attributes/input-constraints/NumberBoundaryConstraint.d.ts +0 -61
  459. package/lib/models/attributes/input-constraints/NumberFormatConstraint.d.ts +0 -52
  460. package/lib/models/attributes/input-constraints/NumberGroupingConstraint.d.ts +0 -46
  461. package/lib/models/attributes/input-constraints/PasswordConfirmConstraint.d.ts +0 -36
  462. package/lib/models/attributes/input-constraints/PasswordLowerAndUpperCaseConstraint.d.ts +0 -23
  463. package/lib/models/attributes/input-constraints/PasswordMinNumericCharactersConstraint.d.ts +0 -32
  464. package/lib/models/attributes/input-constraints/PasswordMinSpecialCharactersConstraint.d.ts +0 -32
  465. package/lib/models/attributes/input-constraints/PasswordThreeConsecutiveCharactersNotAllowedConstraint.d.ts +0 -35
  466. package/lib/models/attributes/input-constraints/RangeConstraint.d.ts +0 -51
  467. package/lib/models/attributes/input-constraints/RegexConstraint.d.ts +0 -37
  468. package/lib/models/attributes/input-constraints/StringLengthConstraint.d.ts +0 -46
  469. package/lib/models/attributes/input-constraints/XMLConstraint.d.ts +0 -26
  470. package/lib/models/attributes/layouthint-rules/BaseLayoutHintRule.d.ts +0 -45
  471. package/lib/models/attributes/layouthint-rules/DependentAttribute.d.ts +0 -57
  472. package/lib/models/attributes/layouthint-rules/LayoutHintRuleCollection.d.ts +0 -27
  473. package/lib/models/attributes/layouthint-rules/RemainingTotalUploadSize.d.ts +0 -17
  474. package/lib/models/base/BaseCollection.d.ts +0 -89
  475. package/lib/models/base/BaseModel.d.ts +0 -78
  476. package/lib/models/base/ResourceCollection.d.ts +0 -20
  477. package/lib/models/base/ResourceModel.d.ts +0 -102
  478. package/lib/models/caseview/CaseViewModel.d.ts +0 -46
  479. package/lib/models/concepts/BusinessScenarioModel.d.ts +0 -20
  480. package/lib/models/concepts/ConceptDetailModel.d.ts +0 -86
  481. package/lib/models/concepts/ConceptIndexModel.d.ts +0 -44
  482. package/lib/models/concepts/ConceptLinkModel.d.ts +0 -82
  483. package/lib/models/concepts/ConceptRelationCollection.d.ts +0 -36
  484. package/lib/models/concepts/ConceptRelationModel.d.ts +0 -61
  485. package/lib/models/concepts/ConceptTypeDetailModel.d.ts +0 -54
  486. package/lib/models/concepts/SourceReferenceCollection.d.ts +0 -14
  487. package/lib/models/concepts/SourceReferenceModel.d.ts +0 -48
  488. package/lib/models/content/ContentIndexModel.d.ts +0 -41
  489. package/lib/models/content/ContentLinkModel.d.ts +0 -102
  490. package/lib/models/content/ContentModel.d.ts +0 -80
  491. package/lib/models/content/ContentTOCModel.d.ts +0 -56
  492. package/lib/models/content/ContentTypeModel.d.ts +0 -26
  493. package/lib/models/content/SectionModel.d.ts +0 -79
  494. package/lib/models/content/SubSectionModel.d.ts +0 -69
  495. package/lib/models/contentconfiguration/ContentConfiguration.d.ts +0 -28
  496. package/lib/models/contentconfiguration/ContentConfigurationElements.d.ts +0 -47
  497. package/lib/models/contentconfiguration/ContentConfigurationEndResults.d.ts +0 -16
  498. package/lib/models/contentconfiguration/ContentConfigurationQuestions.d.ts +0 -22
  499. package/lib/models/contentconfiguration/ContentConfigurationResults.d.ts +0 -39
  500. package/lib/models/detail/DetailModel.d.ts +0 -80
  501. package/lib/models/error/ErrorCollection.d.ts +0 -51
  502. package/lib/models/error/ErrorModel.d.ts +0 -41
  503. package/lib/models/error/ErrorResponse.d.ts +0 -156
  504. package/lib/models/filters/AssignmentFilterModel.d.ts +0 -35
  505. package/lib/models/filters/BaseFilterModel.d.ts +0 -101
  506. package/lib/models/filters/ConceptIndexFilterModel.d.ts +0 -6
  507. package/lib/models/filters/FilterCollection.d.ts +0 -49
  508. package/lib/models/filters/FilterModel.d.ts +0 -5
  509. package/lib/models/filters/RangeFilterModel.d.ts +0 -6
  510. package/lib/models/filters/StringFilterModel.d.ts +0 -30
  511. package/lib/models/form/FormModel.d.ts +0 -350
  512. package/lib/models/form/FormObjectModel.d.ts +0 -210
  513. package/lib/models/grouping/GroupingModel.d.ts +0 -86
  514. package/lib/models/href/Href.d.ts +0 -218
  515. package/lib/models/href/ListHref.d.ts +0 -64
  516. package/lib/models/index.d.ts +0 -96
  517. package/lib/models/layouthint/LayoutHintCollection.d.ts +0 -43
  518. package/lib/models/links/LinkCollection.d.ts +0 -71
  519. package/lib/models/links/LinkModel.d.ts +0 -93
  520. package/lib/models/links/normalizeLinkJSON.d.ts +0 -9
  521. package/lib/models/list/ListDetailModel.d.ts +0 -69
  522. package/lib/models/list/ListHeaderModel.d.ts +0 -53
  523. package/lib/models/list/ListItemCollection.d.ts +0 -21
  524. package/lib/models/list/ListItemModel.d.ts +0 -35
  525. package/lib/models/list/ListModel.d.ts +0 -143
  526. package/lib/models/lookup/LookupOptionCollection.d.ts +0 -15
  527. package/lib/models/lookup/LookupOptionsModel.d.ts +0 -23
  528. package/lib/models/modelcatalog/ModelCatalogModel.d.ts +0 -23
  529. package/lib/models/modelcatalog/ModelCategoryCollection.d.ts +0 -11
  530. package/lib/models/modelcatalog/ModelCategoryModel.d.ts +0 -39
  531. package/lib/models/paging/PagesizeModel.d.ts +0 -25
  532. package/lib/models/paging/PagingModel.d.ts +0 -49
  533. package/lib/models/panels/GroupingPanelModel.d.ts +0 -49
  534. package/lib/models/parameter/Parameter.d.ts +0 -40
  535. package/lib/models/process/ProcessStatusSettingsModel.d.ts +0 -38
  536. package/lib/models/resolveModel.d.ts +0 -7
  537. package/lib/models/search/CaseSearchModel.d.ts +0 -14
  538. package/lib/models/sorting/SortOptionModel.d.ts +0 -48
  539. package/lib/models/sorting/SortingModel.d.ts +0 -42
  540. package/lib/models/tab/TabModel.d.ts +0 -53
  541. package/lib/models/taskgroup/TaskGroupCollection.d.ts +0 -12
  542. package/lib/models/taskgroup/TaskGroupModel.d.ts +0 -25
  543. package/lib/models/types.d.ts +0 -171
  544. package/lib/models/user/UserModel.d.ts +0 -18
  545. package/lib/models/user/UserProfileModel.d.ts +0 -17
  546. package/lib/models/user/UserServicesModel.d.ts +0 -39
  547. package/lib/modularui/Authenticate.d.ts +0 -46
  548. package/lib/modularui/CaptchaRequest.d.ts +0 -54
  549. package/lib/modularui/ModularUIError.d.ts +0 -10
  550. package/lib/modularui/ModularUIRequest.d.ts +0 -207
  551. package/lib/modularui/ModularUIResponse.d.ts +0 -78
  552. package/lib/modularui/UploadRequest.d.ts +0 -41
  553. package/lib/modularui/index.d.ts +0 -5
  554. package/lib/modularui/types.d.ts +0 -2
  555. package/lib/react/ErrorBoundary.d.ts +0 -31
  556. package/lib/react/ErrorBoundaryFallback.d.ts +0 -8
  557. package/lib/react/index.d.ts +0 -2
  558. package/lib/react/utils.d.ts +0 -5
  559. package/lib/react-client/Init.d.ts +0 -6
  560. package/lib/react-client/client.d.ts +0 -25
  561. package/lib/react-client/contextPath.d.ts +0 -1
  562. package/lib/react-client/index.d.ts +0 -3
  563. package/lib/react-client/rehydrate.d.ts +0 -5
  564. package/lib/react-server/contextPath.d.ts +0 -1
  565. package/lib/react-server/createSSRComplete.d.ts +0 -5
  566. package/lib/react-server/htmlpage.d.ts +0 -11
  567. package/lib/react-server/index.d.ts +0 -8
  568. package/lib/react-server/renderSSRComplete.d.ts +0 -13
  569. package/lib/react-server/renderSSRMinimal.d.ts +0 -11
  570. package/lib/react-server/requestInformation.d.ts +0 -6
  571. package/lib/react-server/serverNoSSR.d.ts +0 -15
  572. package/lib/react-server/serverSSR.d.ts +0 -15
  573. package/lib/react-server/serverUtil.d.ts +0 -46
  574. package/lib/react-theme/ThemeProvider.d.ts +0 -8
  575. package/lib/react-theme/createTheme.d.ts +0 -53
  576. package/lib/react-theme/index.d.ts +0 -10
  577. package/lib/react-theme/types.d.ts +0 -13
  578. package/lib/react-theme/useTheme.d.ts +0 -4
  579. package/lib/react-theme/utils/background.d.ts +0 -4
  580. package/lib/react-theme/utils/colors.d.ts +0 -9
  581. package/lib/react-theme/utils/contrast.d.ts +0 -18
  582. package/lib/react-theme/utils/corners.d.ts +0 -3
  583. package/lib/react-theme/utils/spacers.d.ts +0 -9
  584. package/lib/react-theme/utils/themeProps.d.ts +0 -7
  585. package/lib/redux/_i18n/I18nActions.d.ts +0 -7
  586. package/lib/redux/_i18n/I18nReducer.d.ts +0 -7
  587. package/lib/redux/_i18n/index.d.ts +0 -3
  588. package/lib/redux/_i18n/types.d.ts +0 -13
  589. package/lib/redux/_modularui/ModularUIActions.d.ts +0 -26
  590. package/lib/redux/_modularui/ModularUIConnector.d.ts +0 -7
  591. package/lib/redux/_modularui/ModularUIMiddleware.d.ts +0 -7
  592. package/lib/redux/_modularui/ModularUIReducer.d.ts +0 -7
  593. package/lib/redux/_modularui/ModularUISelectors.d.ts +0 -3
  594. package/lib/redux/_modularui/ModularUIUtils.d.ts +0 -5
  595. package/lib/redux/_modularui/index.d.ts +0 -8
  596. package/lib/redux/_modularui/types.d.ts +0 -84
  597. package/lib/redux/_modularui/withModularUI.d.ts +0 -3
  598. package/lib/redux/_router/RouterActions.d.ts +0 -10
  599. package/lib/redux/_router/RouterConnectors.d.ts +0 -6
  600. package/lib/redux/_router/RouterMiddleware.d.ts +0 -5
  601. package/lib/redux/_router/RouterReducer.d.ts +0 -7
  602. package/lib/redux/_router/index.d.ts +0 -5
  603. package/lib/redux/_router/types.d.ts +0 -35
  604. package/lib/redux/actions/Application.d.ts +0 -4
  605. package/lib/redux/actions/Authorization.d.ts +0 -3
  606. package/lib/redux/actions/Error.d.ts +0 -7
  607. package/lib/redux/actions/Form.d.ts +0 -5
  608. package/lib/redux/actions/FormAttributeSet.d.ts +0 -6
  609. package/lib/redux/actions/FormAttributeSetRepeatable.d.ts +0 -6
  610. package/lib/redux/actions/FormAutosave.d.ts +0 -3
  611. package/lib/redux/actions/FormAutosubmit.d.ts +0 -4
  612. package/lib/redux/actions/FormAutoupdate.d.ts +0 -4
  613. package/lib/redux/actions/FormValidations.d.ts +0 -3
  614. package/lib/redux/actions/Modals.d.ts +0 -4
  615. package/lib/redux/actions/ModelCatalog.d.ts +0 -2
  616. package/lib/redux/actions/Notification.d.ts +0 -10
  617. package/lib/redux/actions/Preferences.d.ts +0 -11
  618. package/lib/redux/actions/ProgressIndicator.d.ts +0 -8
  619. package/lib/redux/actions/SignIn.d.ts +0 -10
  620. package/lib/redux/actions/SignOut.d.ts +0 -4
  621. package/lib/redux/actions/index.d.ts +0 -16
  622. package/lib/redux/connectors/Application.d.ts +0 -4
  623. package/lib/redux/connectors/Breadcrumb.d.ts +0 -3
  624. package/lib/redux/connectors/CaseView.d.ts +0 -4
  625. package/lib/redux/connectors/ConceptDetail.d.ts +0 -4
  626. package/lib/redux/connectors/ContentBrowser.d.ts +0 -4
  627. package/lib/redux/connectors/ContentDetail.d.ts +0 -4
  628. package/lib/redux/connectors/ContentDetailSection.d.ts +0 -4
  629. package/lib/redux/connectors/Form.d.ts +0 -16
  630. package/lib/redux/connectors/FormAttributeSet.d.ts +0 -5
  631. package/lib/redux/connectors/ListDetail.d.ts +0 -4
  632. package/lib/redux/connectors/Modal.d.ts +0 -4
  633. package/lib/redux/connectors/ModelCatalog.d.ts +0 -4
  634. package/lib/redux/connectors/Notification.d.ts +0 -4
  635. package/lib/redux/connectors/PanelRenderer.d.ts +0 -4
  636. package/lib/redux/connectors/Preferences.d.ts +0 -2
  637. package/lib/redux/connectors/Progress.d.ts +0 -3
  638. package/lib/redux/connectors/ProgressIndicator.d.ts +0 -3
  639. package/lib/redux/connectors/QuickSearch.d.ts +0 -11
  640. package/lib/redux/connectors/SignIn.d.ts +0 -4
  641. package/lib/redux/connectors/SignOut.d.ts +0 -4
  642. package/lib/redux/connectors/Tab.d.ts +0 -4
  643. package/lib/redux/connectors/index.d.ts +0 -21
  644. package/lib/redux/index.d.ts +0 -9
  645. package/lib/redux/reducers/AuthReducer.d.ts +0 -8
  646. package/lib/redux/reducers/ErrorReducer.d.ts +0 -8
  647. package/lib/redux/reducers/ModalsReducer.d.ts +0 -8
  648. package/lib/redux/reducers/ModelCatalogReducer.d.ts +0 -8
  649. package/lib/redux/reducers/NotificationReducer.d.ts +0 -8
  650. package/lib/redux/reducers/PreferencesReducer.d.ts +0 -8
  651. package/lib/redux/reducers/ProgressIndicatorReducer.d.ts +0 -8
  652. package/lib/redux/reducers/createReducer.d.ts +0 -14
  653. package/lib/redux/reducers/index.d.ts +0 -8
  654. package/lib/redux/selectors/i18n.d.ts +0 -4
  655. package/lib/redux/selectors/index.d.ts +0 -2
  656. package/lib/redux/selectors/modelcatalog.d.ts +0 -2
  657. package/lib/redux/store/beforeRenderHooks.d.ts +0 -7
  658. package/lib/redux/store/configureStore.d.ts +0 -9
  659. package/lib/redux/types.d.ts +0 -113
  660. package/lib/utils/browser/Cache.d.ts +0 -45
  661. package/lib/utils/browser/Cookies.d.ts +0 -9
  662. package/lib/utils/datetime/DateTimeUtil.d.ts +0 -214
  663. package/lib/utils/fetch/__mocks__/universalFetch.d.ts +0 -3
  664. package/lib/utils/fetch/serverFetch.d.ts +0 -5
  665. package/lib/utils/fetch/types.d.ts +0 -44
  666. package/lib/utils/fetch/universalFetch.d.ts +0 -7
  667. package/lib/utils/fetch/xhr.d.ts +0 -5
  668. package/lib/utils/helpers/checkResource.d.ts +0 -3
  669. package/lib/utils/helpers/createHash.d.ts +0 -9
  670. package/lib/utils/helpers/createHref.d.ts +0 -8
  671. package/lib/utils/helpers/createUUID.d.ts +0 -4
  672. package/lib/utils/helpers/index.d.ts +0 -8
  673. package/lib/utils/helpers/objects.d.ts +0 -11
  674. package/lib/utils/helpers/repositoryResource.d.ts +0 -1
  675. package/lib/utils/helpers/sanitizeHtml.d.ts +0 -9
  676. package/lib/utils/helpers/text.d.ts +0 -7
  677. package/lib/utils/index.d.ts +0 -11
  678. package/lib/utils/number/DecimalFormat.d.ts +0 -90
  679. package/lib/utils/number/formatValue.d.ts +0 -4
  680. package/lib/utils/number/parseNumbers.d.ts +0 -9
@@ -4,7 +4,7 @@ var _interopRequireDefault = require("@babel/runtime-corejs3/helpers/interopRequ
4
4
  Object.defineProperty(exports, "__esModule", {
5
5
  value: true
6
6
  });
7
- exports.setSettings = exports.setSetting = exports.setContextPath = exports.logoutPath = exports.loginUsernameField = exports.loginType = exports.loginPath = exports.loginPasswordField = exports.isIncludeTimeOffsetInDateTimes = exports.hasAllContentInData = exports.getUploadPath = exports.getSwimLaneDiagramConfiguration = exports.getSetting = exports.getCaptchaPath = exports.getBasePathServer = exports.getBasePathModularUI = exports.getBasePath = exports.cacheContributions = exports.allSettings = exports.LOGOUT_PATH = exports.LOGIN_PATH = exports.BASE = void 0;
7
+ exports.setSettings = exports.setSetting = exports.setContextPath = exports.logoutPath = exports.loginUsernameField = exports.loginType = exports.loginPath = exports.loginPasswordField = exports.isIncludeTimeOffsetInDateTimes = exports.hasAllContentInData = exports.getUploadPath = exports.getSwimLaneDiagramConfiguration = exports.getSetting = exports.getEnabledLocales = exports.getCaptchaPath = exports.getBasePathServer = exports.getBasePathModularUI = exports.getBasePath = exports.cacheContributions = exports.allSettings = exports.LOGOUT_PATH = exports.LOGIN_PATH = exports.BASE = void 0;
8
8
  var _assign = _interopRequireDefault(require("@babel/runtime-corejs3/core-js-stable/object/assign"));
9
9
  var _startsWith = _interopRequireDefault(require("@babel/runtime-corejs3/core-js-stable/instance/starts-with"));
10
10
  var _objects = require("../utils/helpers/objects");
@@ -162,12 +162,17 @@ const hasAllContentInData = () => getSetting(_Constants.ALL_CONTENT_IN_DATA_SETT
162
162
  exports.hasAllContentInData = hasAllContentInData;
163
163
  const isIncludeTimeOffsetInDateTimes = () => getSetting(_Constants.INCLUDE_TIME_OFFSET, false);
164
164
 
165
+ /**
166
+ */
167
+ exports.isIncludeTimeOffsetInDateTimes = isIncludeTimeOffsetInDateTimes;
168
+ const getEnabledLocales = () => getSetting("ENABLED_LOCALES", ["en"]);
169
+
165
170
  /**
166
171
  * Login type, only available when pac4j is configured
167
172
  *
168
173
  * Preview does not support pac4j, thus is probably not configured when started, which results in login type JAAS
169
174
  */
170
- exports.isIncludeTimeOffsetInDateTimes = isIncludeTimeOffsetInDateTimes;
175
+ exports.getEnabledLocales = getEnabledLocales;
171
176
  const loginType = () => getSetting(_Constants.LOGIN_TYPE, _Constants.INTERNAL_LOGIN_TYPE.JAAS);
172
177
 
173
178
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"Settings.js","names":["_objects","require","_repositoryResource","_Constants","serverBase","__CONTEXT_PATH__","defaultSettings","CONTEXT_PATH","window","contextPath","CACHE_CONTRIBUTIONS","DEBUG_I18N_MESSAGE_NOT_FOUND","HIDE_NOTIFICATION_TIMEOUT","ALWAYS_COMMIT_FORM","RENDER_QUESTION_LABELS","RENDER_MANDATORY_ATTRIBUTE_INDICATION","RENDER_OPTIONAL_ATTRIBUTE_INDICATION","AVAILABLE_LIST_VIEWS","USE_CLIENTSIDE_VALIDATION","USE_INSTANT_SERVER_VALIDATION","ENABLED_LOCALES","RENDER_GLOBAL_LOGIN_PAGE","RENDER_GLOBAL_LOGOUT_PAGE","RENDER_MULTI_LOGIN_ON_GLOBAL_LOGOUT_PAGE","LOGIN_PATH","ADMINISTRATOR_LOGIN_PATH","LOGOUT_PATH","RENDER_FORMS_IN_MODAL","SHOW_SUBMIT_WAIT_TIMEOUT","SWIM_LANE_DIAGRAM_CONFIGURATION","BUSINESS_SCENARIO_CONCEPT_TYPE","BUSINESS_SCENARIO_STEP_CONCEPT_TYPE","BUSINESS_SCENARIO_PERSONA_CONCEPT_TYPE","BUSINESS_SCENARIO_SYSTEM_CONCEPT_TYPE","CALENDAR_WEEK_STARTS_ON","CALENDAR_FIRST_WEEK_CONTAINS_DATE","UI_PARAMETERS","ALLOW_HIDE_WHEN_EMPTY_ON_TABS","PAGE_RELOAD_ON_UNAUTHORIZED_ERROR","XHR_TIMEOUT_MS","XHR_ALWAYS_WITH_CREDENTIALS","HIDE_WHEN_EMPTY_IGNORE_TASKS","SHOW_AVATARS","COMPLETE_SOURCE","settings","setSettings","config","isPlainObject","_assign","default","exports","getSetting","key","defaultValue","has","undefined","Error","setSetting","value","allSettings","cacheContributions","getBasePath","getBasePathModularUI","getBasePathServer","getUploadPath","arguments","length","origin","UPLOAD_PATH","getCaptchaPath","CAPTCHA_PATH","hasAllContentInData","ALL_CONTENT_IN_DATA_SETTING","isIncludeTimeOffsetInDateTimes","INCLUDE_TIME_OFFSET","loginType","LOGIN_TYPE","INTERNAL_LOGIN_TYPE","JAAS","loginPath","clientName","LOGIN_PATH_SETTING","loginUsernameField","LOGIN_USERNAME_SETTING","loginPasswordField","LOGIN_PASSWORD_SETTING","logoutPath","LOGOUT_PATH_SETTING","getSwimLaneDiagramConfiguration","configLocation","_startsWith","call","getRepositoryResourceUrl","setContextPath","BASE"],"sources":["../../src/constants/Settings.js"],"sourcesContent":["// @flow\nimport { isPlainObject, has } from \"../utils/helpers/objects\";\nimport { getRepositoryResourceUrl } from \"../utils/helpers/repositoryResource\";\nimport {\n ALL_CONTENT_IN_DATA_SETTING,\n INCLUDE_TIME_OFFSET,\n INTERNAL_LOGIN_TYPE,\n LOGIN_TYPE,\n LOGIN_PATH_SETTING,\n LOGIN_USERNAME_SETTING,\n LOGIN_PASSWORD_SETTING,\n LOGOUT_PATH_SETTING,\n UPLOAD_PATH,\n CAPTCHA_PATH,\n} from \"./Constants\";\n\ntype Setting = boolean | string | number | Array<string>;\n\nconst serverBase =\n typeof __CONTEXT_PATH__ === \"undefined\" ? null : __CONTEXT_PATH__;\n\nconst defaultSettings: { [name: string]: Setting } = {\n // This uses contextPath set from property from server\n CONTEXT_PATH:\n serverBase ??\n (typeof window !== \"undefined\" && window.contextPath\n ? window.contextPath\n : \"/BeInformed\"),\n\n // Indicates if contributions should be cached\n CACHE_CONTRIBUTIONS: true,\n\n // Debug missing i18n messages in layout\n DEBUG_I18N_MESSAGE_NOT_FOUND: true,\n\n // Time to show the notification bar\n HIDE_NOTIFICATION_TIMEOUT: 5000,\n\n // Always commit form, does not show result pages for instruments\n ALWAYS_COMMIT_FORM: false,\n\n // Render instrument and event question labels on forms (might result in duplicate labels)\n RENDER_QUESTION_LABELS: true,\n\n // Render mandatory indications on attributes\n RENDER_MANDATORY_ATTRIBUTE_INDICATION: true,\n\n // Render optional indications on attributes\n RENDER_OPTIONAL_ATTRIBUTE_INDICATION: false,\n\n // Renders a toggle with supported list views, options are ListView and TableView\n AVAILABLE_LIST_VIEWS: [\"ListView\", \"TableView\"],\n\n // Toggle client side validation\n USE_CLIENTSIDE_VALIDATION: true,\n\n // Indicates if server validation should be used when a form field is changed\n USE_INSTANT_SERVER_VALIDATION: true,\n\n // Indicates which locales are enabled\n ENABLED_LOCALES: [\"en\", \"nl\"],\n\n // Renders the global log in page\n RENDER_GLOBAL_LOGIN_PAGE: false,\n\n // Renders the global log out page\n RENDER_GLOBAL_LOGOUT_PAGE: false,\n\n // Renders the login variants as option on the global logout page\n RENDER_MULTI_LOGIN_ON_GLOBAL_LOGOUT_PAGE: false,\n\n // Path to login page / component\n LOGIN_PATH: \"/signin\",\n\n // Path to administrator login page / component\n ADMINISTRATOR_LOGIN_PATH: \"\",\n\n // Path to logout page / component\n LOGOUT_PATH: \"/signout\",\n\n // Render forms in a modal\n RENDER_FORMS_IN_MODAL: true,\n\n // Wait timeout before rendering submit wait icon\n SHOW_SUBMIT_WAIT_TIMEOUT: 300,\n\n // Swim lane diagram configuration file\n SWIM_LANE_DIAGRAM_CONFIGURATION: \"/Library/Diagrams/Overviews.json\",\n\n // Business scenario concept types\n BUSINESS_SCENARIO_CONCEPT_TYPE: [\n \"/Library/KMTs/Business scenarios.bixml/BusinessScenario\",\n ],\n BUSINESS_SCENARIO_STEP_CONCEPT_TYPE: [\n \"/Library/KMTs/Business scenarios.bixml/ScenarioStep\",\n ],\n BUSINESS_SCENARIO_PERSONA_CONCEPT_TYPE: [\n \"/Library/KMTs/Business scenarios.bixml/Persona\",\n ],\n BUSINESS_SCENARIO_SYSTEM_CONCEPT_TYPE: [\n \"/Library/KMTs/Business scenarios.bixml/System\",\n ],\n\n // indicates on what day the week starts (0 = Sunday)\n CALENDAR_WEEK_STARTS_ON: 1,\n\n // indicates which date indicates the first week of the year\n CALENDAR_FIRST_WEEK_CONTAINS_DATE: 1,\n\n // parameters that are added for the ui state, but should not be send to the modular ui\n UI_PARAMETERS: [],\n\n // disable hide-when-empty hint for layouts running on Be Informed versions older than 21.1\n ALLOW_HIDE_WHEN_EMPTY_ON_TABS: true,\n\n // reload the complete page on signout, usefull when third party authentication is in place\n PAGE_RELOAD_ON_UNAUTHORIZED_ERROR: false,\n\n XHR_TIMEOUT_MS: 300000,\n\n XHR_ALWAYS_WITH_CREDENTIALS: false,\n\n HIDE_WHEN_EMPTY_IGNORE_TASKS: false,\n\n SHOW_AVATARS: true,\n\n COMPLETE_SOURCE: false,\n};\n\nlet settings = defaultSettings;\n\n/**\n */\nexport const setSettings = (config: Object) => {\n if (isPlainObject(config)) {\n settings = Object.assign(defaultSettings, config);\n }\n};\n\n/**\n */\nexport const getSetting = (key: string, defaultValue?: any): any => {\n if (!has(settings, key) && defaultValue === undefined) {\n throw new Error(\n `Setting with name ${key} not found and no defaultValue given`,\n );\n }\n\n return settings[key] ?? defaultValue;\n};\n\n/**\n */\nexport const setSetting = (key: string, value: any) => {\n settings[key] = value;\n};\n\n/**\n */\nexport const allSettings = (): { [name: string]: Setting } => settings;\n\n/**\n * Indicates if contributions must be cached\n */\nexport const cacheContributions = (): boolean =>\n getSetting(\"CACHE_CONTRIBUTIONS\", true);\n\n/**\n * The context path is retrieved on the server using the context path property as set in the runtime properties\n * This can be manually override by setting the UI setting 'CONTEXT_PATH'\n */\nexport const getBasePath = (): string =>\n getSetting(\"CONTEXT_PATH\", \"/BeInformed\");\n\n/**\n * The context path to modular ui rest services\n */\nexport const getBasePathModularUI = (): string =>\n getSetting(\"CONTEXT_PATH_SERVER\", getBasePath());\n\n/**\n * Used to link the css and js files in the server templates\n */\nexport const getBasePathServer = (): string =>\n getSetting(\"CONTEXT_PATH_SERVER\", getBasePath());\n\n/**\n * Path to upload service\n */\nexport const getUploadPath = (\n contextPath: string = getBasePathModularUI(),\n origin: string = \"\",\n): string => `${origin}${contextPath}${UPLOAD_PATH}`;\n\n/**\n * Path to captcha service\n */\nexport const getCaptchaPath = (\n contextPath: string = getBasePathModularUI(),\n origin: string = \"\",\n): string => `${origin}${contextPath}${CAPTCHA_PATH}`;\n\n/**\n */\nexport const hasAllContentInData = (): boolean =>\n getSetting(ALL_CONTENT_IN_DATA_SETTING, true);\n\n/**\n */\nexport const isIncludeTimeOffsetInDateTimes = (): boolean =>\n getSetting(INCLUDE_TIME_OFFSET, false);\n\n/**\n * Login type, only available when pac4j is configured\n *\n * Preview does not support pac4j, thus is probably not configured when started, which results in login type JAAS\n */\nexport const loginType = (): string =>\n getSetting(LOGIN_TYPE, INTERNAL_LOGIN_TYPE.JAAS);\n\n/**\n */\nexport const loginPath = (clientName: string = \"FormClient\"): string =>\n getSetting(LOGIN_PATH_SETTING, `/callback?client_name=${clientName}`);\n/**\n */\nexport const loginUsernameField = (): string =>\n getSetting(LOGIN_USERNAME_SETTING, \"j_username\");\n/**\n */\nexport const loginPasswordField = (): string =>\n getSetting(LOGIN_PASSWORD_SETTING, \"j_password\");\n/**\n */\nexport const logoutPath = (): string =>\n getSetting(LOGOUT_PATH_SETTING, \"/logout\");\n\nexport const LOGIN_PATH: string = loginPath();\nexport const LOGOUT_PATH: string = logoutPath();\n\n/**\n * Model overview swim lane configuration\n */\nexport const getSwimLaneDiagramConfiguration: Object = () => {\n let configLocation = getSetting(\n \"SWIM_LANE_DIAGRAM_CONFIGURATION\",\n \"/Library/Diagrams/Overviews.json\",\n );\n if (!configLocation.startsWith(\"/\")) {\n configLocation = `/${configLocation}`;\n }\n return getRepositoryResourceUrl(configLocation);\n};\n\n/**\n * Set the context path for requests to be informed\n */\nexport const setContextPath = (contextPath: string) => {\n setSetting(\"CONTEXT_PATH\", contextPath);\n};\n\n/**\n * Backwards compatible export of BASE constant\n */\nexport const BASE: string = getBasePath();\n"],"mappings":";;;;;;;;;AACA,IAAAA,QAAA,GAAAC,OAAA;AACA,IAAAC,mBAAA,GAAAD,OAAA;AACA,IAAAE,UAAA,GAAAF,OAAA;AAeA,MAAMG,UAAU,GACd,OAAOC,gBAAgB,KAAK,WAAW,GAAG,IAAI,GAAG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UAAU,CAC7B,iCAAiC,EACjC,kCACF,CAAC;EACD,IAAI,CAAC,IAAAuC,WAAA,CAAAzC,OAAA,EAAAwC,cAAc,EAAAE,IAAA,CAAdF,cAAc,EAAY,GAAG,CAAC,EAAE;IACnCA,cAAc,GAAG,IAAIA,cAAc,EAAE;EACvC;EACA,OAAO,IAAAG,4CAAwB,EAACH,cAAc,CAAC;AACjD,CAAC;;AAED;AACA;AACA;AAFAvC,OAAA,CAAAsC,+BAAA,GAAAA,+BAAA;AAGO,MAAMK,cAAc,GAAIpF,WAAmB,IAAK;EACrDgD,UAAU,CAAC,cAAc,EAAEhD,WAAW,CAAC;AACzC,CAAC;;AAED;AACA;AACA;AAFAyC,OAAA,CAAA2C,cAAA,GAAAA,cAAA;AAGO,MAAMC,IAAY,GAAA5C,OAAA,CAAA4C,IAAA,GAAGjC,WAAW,CAAC,CAAC","ignoreList":[]}
1
+ {"version":3,"file":"Settings.js","names":["_objects","require","_repositoryResource","_Constants","serverBase","__CONTEXT_PATH__","defaultSettings","CONTEXT_PATH","window","contextPath","CACHE_CONTRIBUTIONS","DEBUG_I18N_MESSAGE_NOT_FOUND","HIDE_NOTIFICATION_TIMEOUT","ALWAYS_COMMIT_FORM","RENDER_QUESTION_LABELS","RENDER_MANDATORY_ATTRIBUTE_INDICATION","RENDER_OPTIONAL_ATTRIBUTE_INDICATION","AVAILABLE_LIST_VIEWS","USE_CLIENTSIDE_VALIDATION","USE_INSTANT_SERVER_VALIDATION","ENABLED_LOCALES","RENDER_GLOBAL_LOGIN_PAGE","RENDER_GLOBAL_LOGOUT_PAGE","RENDER_MULTI_LOGIN_ON_GLOBAL_LOGOUT_PAGE","LOGIN_PATH","ADMINISTRATOR_LOGIN_PATH","LOGOUT_PATH","RENDER_FORMS_IN_MODAL","SHOW_SUBMIT_WAIT_TIMEOUT","SWIM_LANE_DIAGRAM_CONFIGURATION","BUSINESS_SCENARIO_CONCEPT_TYPE","BUSINESS_SCENARIO_STEP_CONCEPT_TYPE","BUSINESS_SCENARIO_PERSONA_CONCEPT_TYPE","BUSINESS_SCENARIO_SYSTEM_CONCEPT_TYPE","CALENDAR_WEEK_STARTS_ON","CALENDAR_FIRST_WEEK_CONTAINS_DATE","UI_PARAMETERS","ALLOW_HIDE_WHEN_EMPTY_ON_TABS","PAGE_RELOAD_ON_UNAUTHORIZED_ERROR","XHR_TIMEOUT_MS","XHR_ALWAYS_WITH_CREDENTIALS","HIDE_WHEN_EMPTY_IGNORE_TASKS","SHOW_AVATARS","COMPLETE_SOURCE","settings","setSettings","config","isPlainObject","_assign","default","exports","getSetting","key","defaultValue","has","undefined","Error","setSetting","value","allSettings","cacheContributions","getBasePath","getBasePathModularUI","getBasePathServer","getUploadPath","arguments","length","origin","UPLOAD_PATH","getCaptchaPath","CAPTCHA_PATH","hasAllContentInData","ALL_CONTENT_IN_DATA_SETTING","isIncludeTimeOffsetInDateTimes","INCLUDE_TIME_OFFSET","getEnabledLocales","loginType","LOGIN_TYPE","INTERNAL_LOGIN_TYPE","JAAS","loginPath","clientName","LOGIN_PATH_SETTING","loginUsernameField","LOGIN_USERNAME_SETTING","loginPasswordField","LOGIN_PASSWORD_SETTING","logoutPath","LOGOUT_PATH_SETTING","getSwimLaneDiagramConfiguration","configLocation","_startsWith","call","getRepositoryResourceUrl","setContextPath","BASE"],"sources":["../../src/constants/Settings.js"],"sourcesContent":["// @flow\nimport { isPlainObject, has } from \"../utils/helpers/objects\";\nimport { getRepositoryResourceUrl } from \"../utils/helpers/repositoryResource\";\nimport {\n ALL_CONTENT_IN_DATA_SETTING,\n INCLUDE_TIME_OFFSET,\n INTERNAL_LOGIN_TYPE,\n LOGIN_TYPE,\n LOGIN_PATH_SETTING,\n LOGIN_USERNAME_SETTING,\n LOGIN_PASSWORD_SETTING,\n LOGOUT_PATH_SETTING,\n UPLOAD_PATH,\n CAPTCHA_PATH,\n} from \"./Constants\";\n\ntype Setting = boolean | string | number | Array<string>;\n\nconst serverBase =\n typeof __CONTEXT_PATH__ === \"undefined\" ? null : __CONTEXT_PATH__;\n\nconst defaultSettings: { [name: string]: Setting } = {\n // This uses contextPath set from property from server\n CONTEXT_PATH:\n serverBase ??\n (typeof window !== \"undefined\" && window.contextPath\n ? window.contextPath\n : \"/BeInformed\"),\n\n // Indicates if contributions should be cached\n CACHE_CONTRIBUTIONS: true,\n\n // Debug missing i18n messages in layout\n DEBUG_I18N_MESSAGE_NOT_FOUND: true,\n\n // Time to show the notification bar\n HIDE_NOTIFICATION_TIMEOUT: 5000,\n\n // Always commit form, does not show result pages for instruments\n ALWAYS_COMMIT_FORM: false,\n\n // Render instrument and event question labels on forms (might result in duplicate labels)\n RENDER_QUESTION_LABELS: true,\n\n // Render mandatory indications on attributes\n RENDER_MANDATORY_ATTRIBUTE_INDICATION: true,\n\n // Render optional indications on attributes\n RENDER_OPTIONAL_ATTRIBUTE_INDICATION: false,\n\n // Renders a toggle with supported list views, options are ListView and TableView\n AVAILABLE_LIST_VIEWS: [\"ListView\", \"TableView\"],\n\n // Toggle client side validation\n USE_CLIENTSIDE_VALIDATION: true,\n\n // Indicates if server validation should be used when a form field is changed\n USE_INSTANT_SERVER_VALIDATION: true,\n\n // Indicates which locales are enabled\n ENABLED_LOCALES: [\"en\", \"nl\"],\n\n // Renders the global log in page\n RENDER_GLOBAL_LOGIN_PAGE: false,\n\n // Renders the global log out page\n RENDER_GLOBAL_LOGOUT_PAGE: false,\n\n // Renders the login variants as option on the global logout page\n RENDER_MULTI_LOGIN_ON_GLOBAL_LOGOUT_PAGE: false,\n\n // Path to login page / component\n LOGIN_PATH: \"/signin\",\n\n // Path to administrator login page / component\n ADMINISTRATOR_LOGIN_PATH: \"\",\n\n // Path to logout page / component\n LOGOUT_PATH: \"/signout\",\n\n // Render forms in a modal\n RENDER_FORMS_IN_MODAL: true,\n\n // Wait timeout before rendering submit wait icon\n SHOW_SUBMIT_WAIT_TIMEOUT: 300,\n\n // Swim lane diagram configuration file\n SWIM_LANE_DIAGRAM_CONFIGURATION: \"/Library/Diagrams/Overviews.json\",\n\n // Business scenario concept types\n BUSINESS_SCENARIO_CONCEPT_TYPE: [\n \"/Library/KMTs/Business scenarios.bixml/BusinessScenario\",\n ],\n BUSINESS_SCENARIO_STEP_CONCEPT_TYPE: [\n \"/Library/KMTs/Business scenarios.bixml/ScenarioStep\",\n ],\n BUSINESS_SCENARIO_PERSONA_CONCEPT_TYPE: [\n \"/Library/KMTs/Business scenarios.bixml/Persona\",\n ],\n BUSINESS_SCENARIO_SYSTEM_CONCEPT_TYPE: [\n \"/Library/KMTs/Business scenarios.bixml/System\",\n ],\n\n // indicates on what day the week starts (0 = Sunday)\n CALENDAR_WEEK_STARTS_ON: 1,\n\n // indicates which date indicates the first week of the year\n CALENDAR_FIRST_WEEK_CONTAINS_DATE: 1,\n\n // parameters that are added for the ui state, but should not be send to the modular ui\n UI_PARAMETERS: [],\n\n // disable hide-when-empty hint for layouts running on Be Informed versions older than 21.1\n ALLOW_HIDE_WHEN_EMPTY_ON_TABS: true,\n\n // reload the complete page on signout, usefull when third party authentication is in place\n PAGE_RELOAD_ON_UNAUTHORIZED_ERROR: false,\n\n XHR_TIMEOUT_MS: 300000,\n\n XHR_ALWAYS_WITH_CREDENTIALS: false,\n\n HIDE_WHEN_EMPTY_IGNORE_TASKS: false,\n\n SHOW_AVATARS: true,\n\n COMPLETE_SOURCE: false,\n};\n\nlet settings = defaultSettings;\n\n/**\n */\nexport const setSettings = (config: Object) => {\n if (isPlainObject(config)) {\n settings = Object.assign(defaultSettings, config);\n }\n};\n\n/**\n */\nexport const getSetting = (key: string, defaultValue?: any): any => {\n if (!has(settings, key) && defaultValue === undefined) {\n throw new Error(\n `Setting with name ${key} not found and no defaultValue given`,\n );\n }\n return settings[key] ?? defaultValue;\n};\n\n/**\n */\nexport const setSetting = (key: string, value: any) => {\n settings[key] = value;\n};\n\n/**\n */\nexport const allSettings = (): { [name: string]: Setting } => settings;\n\n/**\n * Indicates if contributions must be cached\n */\nexport const cacheContributions = (): boolean =>\n getSetting(\"CACHE_CONTRIBUTIONS\", true);\n\n/**\n * The context path is retrieved on the server using the context path property as set in the runtime properties\n * This can be manually override by setting the UI setting 'CONTEXT_PATH'\n */\nexport const getBasePath = (): string =>\n getSetting(\"CONTEXT_PATH\", \"/BeInformed\");\n\n/**\n * The context path to modular ui rest services\n */\nexport const getBasePathModularUI = (): string =>\n getSetting(\"CONTEXT_PATH_SERVER\", getBasePath());\n\n/**\n * Used to link the css and js files in the server templates\n */\nexport const getBasePathServer = (): string =>\n getSetting(\"CONTEXT_PATH_SERVER\", getBasePath());\n\n/**\n * Path to upload service\n */\nexport const getUploadPath = (\n contextPath: string = getBasePathModularUI(),\n origin: string = \"\",\n): string => `${origin}${contextPath}${UPLOAD_PATH}`;\n\n/**\n * Path to captcha service\n */\nexport const getCaptchaPath = (\n contextPath: string = getBasePathModularUI(),\n origin: string = \"\",\n): string => `${origin}${contextPath}${CAPTCHA_PATH}`;\n\n/**\n */\nexport const hasAllContentInData = (): boolean =>\n getSetting(ALL_CONTENT_IN_DATA_SETTING, true);\n\n/**\n */\nexport const isIncludeTimeOffsetInDateTimes = (): boolean =>\n getSetting(INCLUDE_TIME_OFFSET, false);\n\n/**\n */\nexport const getEnabledLocales = (): Array<string> =>\n getSetting(\"ENABLED_LOCALES\", [\"en\"]);\n\n/**\n * Login type, only available when pac4j is configured\n *\n * Preview does not support pac4j, thus is probably not configured when started, which results in login type JAAS\n */\nexport const loginType = (): string =>\n getSetting(LOGIN_TYPE, INTERNAL_LOGIN_TYPE.JAAS);\n\n/**\n */\nexport const loginPath = (clientName: string = \"FormClient\"): string =>\n getSetting(LOGIN_PATH_SETTING, `/callback?client_name=${clientName}`);\n/**\n */\nexport const loginUsernameField = (): string =>\n getSetting(LOGIN_USERNAME_SETTING, \"j_username\");\n/**\n */\nexport const loginPasswordField = (): string =>\n getSetting(LOGIN_PASSWORD_SETTING, \"j_password\");\n/**\n */\nexport const logoutPath = (): string =>\n getSetting(LOGOUT_PATH_SETTING, \"/logout\");\n\nexport const LOGIN_PATH: string = loginPath();\nexport const LOGOUT_PATH: string = logoutPath();\n\n/**\n * Model overview swim lane configuration\n */\nexport const getSwimLaneDiagramConfiguration: Object = () => {\n let configLocation = getSetting(\n \"SWIM_LANE_DIAGRAM_CONFIGURATION\",\n \"/Library/Diagrams/Overviews.json\",\n );\n if (!configLocation.startsWith(\"/\")) {\n configLocation = `/${configLocation}`;\n }\n return getRepositoryResourceUrl(configLocation);\n};\n\n/**\n * Set the context path for requests to be informed\n */\nexport const setContextPath = (contextPath: string) => {\n setSetting(\"CONTEXT_PATH\", contextPath);\n};\n\n/**\n * Backwards compatible export of BASE constant\n */\nexport const BASE: string = getBasePath();\n"],"mappings":";;;;;;;;;AACA,IAAAA,QAAA,GAAAC,OAAA;AACA,IAAAC,mBAAA,GAAAD,OAAA;AACA,IAAAE,UAAA,GAAAF,OAAA;AAeA,MAAMG,UAAU,GACd,OAAOC,gBAAgB,KAAK,WAAW,GAAG,IAAI,GAAGA,gBAAgB;AAEnE,MAAMC,eAA4C,GAAG;EACnD;EACAC,YAAY,EACVH,UAAU,KACT,OAAOI,MAAM,KAAK,WAAW,IAAIA,MAAM,CAACC,WAAW,GAChDD,MAAM,CAACC,WAAW,GAClB,aAAa,CAAC;EAEpB;EACAC,mBAAmB,EAAE,IAAI;EAEzB;EACAC,4BAA4B,EAAE,IAAI;EAElC;EACAC,yBAAyB,EAAE,IAAI;EAE/B;EACAC,kBAAkB,EAAE,KAAK;EAEzB;EACAC,sBAAsB,EAAE,IAAI;EAE5B;EACAC,qCAAqC,EAAE,IAAI;EAE3C;EACAC,oCAAoC,EAAE,KAAK;EAE3C;EACAC,oBAAoB,EAAE,CAAC,UAAU,EAAE,WAAW,CAAC;EAE/C;EACAC,yBAAyB,EAAE,IAAI;EAE/B;EACAC,6BAA6B,EAAE,IAAI;EAEnC;EACAC,eAAe,EAAE,CAAC,IAAI,EAAE,IAAI,CAAC;EAE7B;EACAC,wBAAwB,EAAE,KAAK;EA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AGO,MAAMC,IAAY,GAAA7C,OAAA,CAAA6C,IAAA,GAAGlC,WAAW,CAAC,CAAC","ignoreList":[]}
@@ -25,6 +25,8 @@ var _RouterActions = require("../redux/_router/RouterActions");
25
25
  var _exceptions = require("../exceptions");
26
26
  var _Init = require("./Init");
27
27
  var _beforeRenderHooks = require("../redux/store/beforeRenderHooks");
28
+ var _createTheme = _interopRequireDefault(require("../react-theme/createTheme"));
29
+ var _redux = require("../redux");
28
30
  var _jsxRuntime = require("react/jsx-runtime");
29
31
  // eslint-disable-next-line react/no-deprecated
30
32
  /*
@@ -63,11 +65,25 @@ const setUnhandledRejectionEvent = store => {
63
65
  };
64
66
  };
65
67
 
68
+ /**
69
+ */
70
+ exports.setUnhandledRejectionEvent = setUnhandledRejectionEvent;
71
+ const initThemeSettings = (state, theme) => {
72
+ const storedTheme = state.preferences.theme;
73
+ // $FlowFixMe
74
+ (0, _createTheme.default)(storedTheme, theme); // on theme creation, the settings are set
75
+ };
76
+ const handleLocale = store => {
77
+ const locale = store.getState().i18n.locale;
78
+ if (locale) {
79
+ store.dispatch((0, _redux.receiveLocale)(locale));
80
+ }
81
+ };
82
+
66
83
  /**
67
84
  * The redirectURI querystring parameter is available when the server is redirecting an unauthorized deep link
68
85
  * @param store
69
86
  */
70
- exports.setUnhandledRejectionEvent = setUnhandledRejectionEvent;
71
87
  const handleRedirectURI = store => {
72
88
  const urlParams = new _urlSearchParams.default(window.location.search);
73
89
  const redirectURI = urlParams.get("redirectURI");
@@ -107,6 +123,7 @@ exports.setModelCatalogEntryDate = setModelCatalogEntryDate;
107
123
  const setupClient = function () {
108
124
  let customReducers = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
109
125
  let beforeRenderHooks = arguments.length > 1 ? arguments[1] : undefined;
126
+ let theme = arguments.length > 2 ? arguments[2] : undefined;
110
127
  if (typeof window.contextPath === "undefined") {
111
128
  throw new Error("Missing contextPath on window object");
112
129
  }
@@ -123,6 +140,8 @@ const setupClient = function () {
123
140
  routerHistory,
124
141
  store
125
142
  } = (0, _configureStore.default)(browserHistory, customReducers, (0, _rehydrate.default)(data));
143
+ initThemeSettings(store.getState(), theme);
144
+ handleLocale(store);
126
145
  handleRedirectURI(store);
127
146
  setModelCatalogEntryDate(store);
128
147
  (0, _Preferences.setAllContentInDataSetting)(store.getState());
@@ -1 +1 @@
1
- {"version":3,"file":"client.js","names":["_client","require","_objects","_setimmediate","_interopRequireDefault","_Cache","_xhr","_history","_configureStore","_rehydrate","_Settings","_Preferences","_Notification","_Error","_SignIn","_ModelCatalog","_RouterActions","_exceptions","_Init","_beforeRenderHooks","_jsxRuntime","parseDataToJSON","data","JSON","parse","error","JsonParseException","getDataFromServer","_context","dataElement","document","querySelector","Error","_trim","default","textContent","call","setUnhandledRejectionEvent","store","window","onunhandledrejection","event","detail","setImmediate","errorMessage","reason","message","toString","dispatch","showXHRErrorNotification","exports","handleRedirectURI","urlParams","_urlSearchParams","location","search","redirectURI","get","xhr","url","getBasePathModularUI","catch","e","id","LOGIN_PATH","getSetting","replace","from","pathname","modal","setModelCatalogEntryDate","entryDateFromUrl","updateEntryDate","Cache","hasItem","getItem","setupClient","customReducers","arguments","length","undefined","beforeRenderHooks","contextPath","clear","browserHistory","createBrowserHistory","basename","getBasePathServer","routerHistory","configureStore","rehydrate","setAllContentInDataSetting","getState","setLoginPreferences","setDateTimeSettings","loadOtherBrowserTabs","loginSuccess","has","FetchException","response","handleError","listen","action","locationChange","body","className","handleBeforeRenderHooks","addContentLoadedEvent","theme","render","ErrorFallbackComponent","mount","addEventListener","applicationNode","jsx","Init","children","mountClient","element","isSSR","hydrateRoot","root","createRoot","client","_ref"],"sources":["../../src/react-client/client.js"],"sourcesContent":["// @flow\n// eslint-disable-next-line react/no-deprecated\nimport { hydrateRoot, createRoot } from \"react-dom/client\";\n\nimport { has } from \"../utils/helpers/objects\";\nimport setImmediate from \"setimmediate\";\n\nimport Cache from \"../utils/browser/Cache\";\n\nimport xhr from \"../utils/fetch/xhr\";\n\nimport { createBrowserHistory } from \"history\";\nimport configureStore from \"../redux/store/configureStore\";\n\nimport rehydrate from \"./rehydrate\";\nimport {\n getBasePathModularUI,\n getBasePathServer,\n getSetting,\n} from \"../constants/Settings\";\n\nimport {\n setAllContentInDataSetting,\n setDateTimeSettings,\n setLoginPreferences,\n} from \"../redux/actions/Preferences\";\nimport { showXHRErrorNotification } from \"../redux/actions/Notification\";\nimport { handleError } from \"../redux/actions/Error\";\nimport { loginSuccess } from \"../redux/actions/SignIn\";\nimport { updateEntryDate } from \"../redux/actions/ModelCatalog\";\n\nimport { locationChange, replace } from \"../redux/_router/RouterActions\";\n\nimport { JsonParseException, FetchException } from \"../exceptions\";\n\nimport { Init } from \"./Init\";\n\nimport { handleBeforeRenderHooks } from \"../redux/store/beforeRenderHooks\";\n\nimport type {\n ComponentType,\n Element as ReactElement,\n ElementType,\n} from \"react\";\nimport type { Theme } from \"../react-theme/types\";\nimport type { CustomReducers, ReduxStore } from \"../redux/types\";\nimport type { RouterHistory } from \"react-router\";\nimport type { BeforeRenderHook } from \"../redux/store/beforeRenderHooks\";\nimport type { Props as FallbackProps } from \"../react/ErrorBoundaryFallback\";\n\ntype RenderFunction = () => ReactElement<ElementType>;\ntype MountFunction = (\n applicationNode: Element,\n element: ReactElement<ElementType>,\n) => void;\ntype Props = {\n customReducers?: CustomReducers,\n theme?: Theme | Array<Theme>,\n render: RenderFunction,\n mount: MountFunction,\n beforeRenderHooks?: Array<BeforeRenderHook>,\n ErrorFallbackComponent?: ComponentType<FallbackProps>,\n};\n\n/*\n * deserialize serialized data from the server to provide a smooth dehydration.\n */\nconst parseDataToJSON = (data: string) => {\n try {\n return JSON.parse(data);\n } catch (error) {\n throw new JsonParseException(`Error parsing content ${data}`);\n }\n};\n\nconst getDataFromServer = () => {\n const dataElement = document.querySelector(\n 'script[type=\"application/json\"][data-app-state=\"app-json\"]',\n );\n\n if (!dataElement) {\n throw new Error(\"Error loading state, json not found\");\n } else if (dataElement.textContent.trim() === \"\") {\n return {};\n }\n\n return parseDataToJSON(dataElement.textContent);\n};\n\n/**\n */\nexport const setUnhandledRejectionEvent = (store: ReduxStore) => {\n window.onunhandledrejection = (event) => {\n if (event.detail) {\n return setImmediate(() => {\n const errorMessage = event.detail.reason.message.toString();\n\n store.dispatch(showXHRErrorNotification(errorMessage));\n throw event.detail.reason;\n });\n }\n\n return event;\n };\n};\n\n/**\n * The redirectURI querystring parameter is available when the server is redirecting an unauthorized deep link\n * @param store\n */\nconst handleRedirectURI = (store: ReduxStore) => {\n const urlParams = new URLSearchParams(window.location.search);\n const redirectURI = urlParams.get(\"redirectURI\");\n if (redirectURI) {\n xhr({ url: `${getBasePathModularUI()}${redirectURI}` }).catch((e) => {\n if (\n e.id === \"UnauthorizedException\" ||\n e.id === \"Error.NotAuthorized\" ||\n e.id === \"Error.Authentication.Required\" ||\n e.id === \"Error.Authentication.InvalidCredentials\"\n ) {\n const LOGIN_PATH = getSetting(\"LOGIN_PATH\", \"/signin\");\n store.dispatch(\n replace(LOGIN_PATH, {\n from: { pathname: redirectURI },\n modal: false,\n }),\n );\n }\n });\n }\n};\n\n/**\n */\nexport const setModelCatalogEntryDate = (store: ReduxStore) => {\n if (typeof window !== \"undefined\") {\n const entryDateFromUrl = new URLSearchParams(window.location?.search).get(\n \"entryDate\",\n );\n if (entryDateFromUrl) {\n store.dispatch(updateEntryDate(entryDateFromUrl));\n } else if (Cache.hasItem(\"ModelCatalogEntryDate\")) {\n store.dispatch(Cache.getItem(\"ModelCatalogEntryDate\"));\n }\n }\n};\n\n/**\n */\nexport const setupClient = (\n customReducers: CustomReducers = {},\n beforeRenderHooks: ?Array<BeforeRenderHook>,\n): { store: ReduxStore, routerHistory: RouterHistory } => {\n if (typeof window.contextPath === \"undefined\") {\n throw new Error(\"Missing contextPath on window object\");\n }\n\n const data = getDataFromServer();\n\n // remove all resources from cache\n Cache.clear(\"^res:\");\n\n // $FlowExpectedError\n const browserHistory: RouterHistory = createBrowserHistory({\n basename: getBasePathServer(),\n });\n const { routerHistory, store } = configureStore(\n browserHistory,\n customReducers,\n rehydrate(data),\n );\n\n handleRedirectURI(store);\n setModelCatalogEntryDate(store);\n\n setAllContentInDataSetting(store.getState());\n setLoginPreferences(store.getState());\n setDateTimeSettings(store.getState());\n\n // load existing cache from other browser tabs\n Cache.loadOtherBrowserTabs(() => {\n if (Cache.getItem(\"auth\")) {\n store.dispatch(loginSuccess());\n }\n });\n\n if (has(data, \"error.name\")) {\n const error = new FetchException(data?.error?.response);\n store.dispatch(handleError(error));\n }\n\n if (Cache.getItem(\"auth\")) {\n store.dispatch(loginSuccess());\n }\n\n // listen to history change and update the redux router store\n routerHistory.listen((location, action) => {\n store.dispatch(locationChange(location, action));\n });\n\n setUnhandledRejectionEvent(store);\n\n if (document.body) {\n document.body.className = \"js\";\n }\n\n if (beforeRenderHooks) {\n handleBeforeRenderHooks(beforeRenderHooks, { store });\n }\n\n return { store, routerHistory };\n};\n\n/**\n */\nexport const addContentLoadedEvent = (\n store: ReduxStore,\n routerHistory: RouterHistory,\n theme?: Theme | Array<Theme>,\n render: RenderFunction,\n ErrorFallbackComponent?: ComponentType<FallbackProps>,\n mount: MountFunction,\n) => {\n window.addEventListener(\"DOMContentLoaded\", () => {\n const applicationNode = document.querySelector(\"#application\");\n if (!applicationNode) {\n throw new Error(\n \"No DOM element with id application found to attach client to\",\n );\n }\n\n mount(\n applicationNode,\n <Init\n store={store}\n routerHistory={routerHistory}\n contextPath={window.contextPath}\n theme={theme}\n ErrorFallbackComponent={ErrorFallbackComponent}\n >\n {render()}\n </Init>,\n );\n });\n};\n\n/**\n */\nconst mountClient = (\n applicationNode: Element,\n element: ReactElement<ElementType>,\n) => {\n const isSSR = applicationNode.querySelector(\".application\");\n if (isSSR) {\n hydrateRoot(element, applicationNode);\n } else {\n const root = createRoot(element);\n root.render(applicationNode);\n }\n};\n\n/**\n * Mount the webapplication to the DOM, setup redux store and caches, add unhandledRejectionEvent, used client side when JavaScript is enabled.\n */\nexport const client = ({\n customReducers,\n theme,\n render,\n beforeRenderHooks,\n ErrorFallbackComponent,\n mount,\n}: Props) => {\n const { store, routerHistory } = setupClient(\n customReducers,\n beforeRenderHooks,\n );\n\n addContentLoadedEvent(\n store,\n routerHistory,\n theme,\n render,\n ErrorFallbackComponent,\n mount ?? mountClient,\n );\n};\n"],"mappings":";;;;;;;;;AAEA,IAAAA,OAAA,GAAAC,OAAA;AAEA,IAAAC,QAAA,GAAAD,OAAA;AACA,IAAAE,aAAA,GAAAC,sBAAA,CAAAH,OAAA;AAEA,IAAAI,MAAA,GAAAD,sBAAA,CAAAH,OAAA;AAEA,IAAAK,IAAA,GAAAF,sBAAA,CAAAH,OAAA;AAEA,IAAAM,QAAA,GAAAN,OAAA;AACA,IAAAO,eAAA,GAAAJ,sBAAA,CAAAH,OAAA;AAEA,IAAAQ,UAAA,GAAAL,sBAAA,CAAAH,OAAA;AACA,IAAAS,SAAA,GAAAT,OAAA;AAMA,IAAAU,YAAA,GAAAV,OAAA;AAKA,IAAAW,aAAA,GAAAX,OAAA;AACA,IAAAY,MAAA,GAAAZ,OAAA;AACA,IAAAa,OAAA,GAAAb,OAAA;AACA,IAAAc,aAAA,GAAAd,OAAA;AAEA,IAAAe,cAAA,GAAAf,OAAA;AAEA,IAAAgB,WAAA,GAAAhB,OAAA;AAEA,IAAAiB,KAAA,GAAAjB,OAAA;AAEA,IAAAkB,kBAAA,GAAAlB,OAAA;AAA2E,IAAAmB,WAAA,GAAAnB,OAAA;AApC3E;AA+DA;AACA;AACA;AACA,MAAMoB,eAAe,GAAIC,IAAY,IAAK;EACxC,IAAI;IACF,OAAOC,IAAI,CAACC,KAAK,CAACF,IAAI,CAAC;EACzB,CAAC,CAAC,OAAOG,KAAK,EAAE;IACd,MAAM,IAAIC,8BAAkB,CAAC,yBAAyBJ,IAAI,EAAE,CAAC;EAC/D;AACF,CAAC;AAED,MAAMK,iBAAiB,GAAGA,CAAA,KAAM;EAAA,IAAAC,QAAA;EAC9B,MAAM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CACR,CAAC;EACH,CAAC,CAAC;AACJ,CAAC;;AAED;AACA;AADA3D,OAAA,CAAAyD,qBAAA,GAAAA,qBAAA;AAEA,MAAMU,WAAW,GAAGA,CAClBJ,eAAwB,EACxBK,OAAkC,KAC/B;EACH,MAAMC,KAAK,GAAGN,eAAe,CAAClF,aAAa,CAAC,cAAc,CAAC;EAC3D,IAAIwF,KAAK,EAAE;IACT,IAAAC,mBAAW,EAACF,OAAO,EAAEL,eAAe,CAAC;EACvC,CAAC,MAAM;IACL,MAAMQ,IAAI,GAAG,IAAAC,kBAAU,EAACJ,OAAO,CAAC;IAChCG,IAAI,CAACZ,MAAM,CAACI,eAAe,CAAC;EAC9B;AACF,CAAC;;AAED;AACA;AACA;AACO,MAAMU,MAAM,GAAGC,IAAA,IAOT;EAAA,IAPU;IACrB/C,cAAc;IACd+B,KAAK;IACLC,MAAM;IACN5B,iBAAiB;IACjB6B,sBAAsB;IACtBC;EACK,CAAC,GAAAa,IAAA;EACN,MAAM;IAAEtF,KAAK;IAAEkD;EAAc,CAAC,GAAGZ,WAAW,CAC1CC,cAAc,EACdI,iBACF,CAAC;EAED0B,qBAAqB,CACnBrE,KAAK,EACLkD,aAAa,EACboB,KAAK,EACLC,MAAM,EACNC,sBAAsB,EACtBC,KAAK,IAAIM,WACX,CAAC;AACH,CAAC;AAACnE,OAAA,CAAAyE,MAAA,GAAAA,MAAA","ignoreList":[]}
1
+ {"version":3,"file":"client.js","names":["_client","require","_objects","_setimmediate","_interopRequireDefault","_Cache","_xhr","_history","_configureStore","_rehydrate","_Settings","_Preferences","_Notification","_Error","_SignIn","_ModelCatalog","_RouterActions","_exceptions","_Init","_beforeRenderHooks","_createTheme","_redux","_jsxRuntime","parseDataToJSON","data","JSON","parse","error","JsonParseException","getDataFromServer","_context","dataElement","document","querySelector","Error","_trim","default","textContent","call","setUnhandledRejectionEvent","store","window","onunhandledrejection","event","detail","setImmediate","errorMessage","reason","message","toString","dispatch","showXHRErrorNotification","exports","initThemeSettings","state","theme","storedTheme","preferences","createTheme","handleLocale","locale","getState","i18n","receiveLocale","handleRedirectURI","urlParams","_urlSearchParams","location","search","redirectURI","get","xhr","url","getBasePathModularUI","catch","e","id","LOGIN_PATH","getSetting","replace","from","pathname","modal","setModelCatalogEntryDate","entryDateFromUrl","updateEntryDate","Cache","hasItem","getItem","setupClient","customReducers","arguments","length","undefined","beforeRenderHooks","contextPath","clear","browserHistory","createBrowserHistory","basename","getBasePathServer","routerHistory","configureStore","rehydrate","setAllContentInDataSetting","setLoginPreferences","setDateTimeSettings","loadOtherBrowserTabs","loginSuccess","has","FetchException","response","handleError","listen","action","locationChange","body","className","handleBeforeRenderHooks","addContentLoadedEvent","render","ErrorFallbackComponent","mount","addEventListener","applicationNode","jsx","Init","children","mountClient","element","isSSR","hydrateRoot","root","createRoot","client","_ref"],"sources":["../../src/react-client/client.js"],"sourcesContent":["// @flow\n// eslint-disable-next-line react/no-deprecated\nimport { hydrateRoot, createRoot } from \"react-dom/client\";\n\nimport { has } from \"../utils/helpers/objects\";\nimport setImmediate from \"setimmediate\";\n\nimport Cache from \"../utils/browser/Cache\";\n\nimport xhr from \"../utils/fetch/xhr\";\n\nimport { createBrowserHistory } from \"history\";\nimport configureStore from \"../redux/store/configureStore\";\n\nimport rehydrate from \"./rehydrate\";\nimport {\n getBasePathModularUI,\n getBasePathServer,\n getSetting,\n} from \"../constants/Settings\";\n\nimport {\n setAllContentInDataSetting,\n setDateTimeSettings,\n setLoginPreferences,\n} from \"../redux/actions/Preferences\";\nimport { showXHRErrorNotification } from \"../redux/actions/Notification\";\nimport { handleError } from \"../redux/actions/Error\";\nimport { loginSuccess } from \"../redux/actions/SignIn\";\nimport { updateEntryDate } from \"../redux/actions/ModelCatalog\";\n\nimport { locationChange, replace } from \"../redux/_router/RouterActions\";\n\nimport { JsonParseException, FetchException } from \"../exceptions\";\n\nimport { Init } from \"./Init\";\n\nimport { handleBeforeRenderHooks } from \"../redux/store/beforeRenderHooks\";\n\nimport type {\n ComponentType,\n Element as ReactElement,\n ElementType,\n} from \"react\";\nimport type { Theme } from \"../react-theme/types\";\nimport type { CustomReducers, ReduxState, ReduxStore } from \"../redux/types\";\nimport type { RouterHistory } from \"react-router\";\nimport type { BeforeRenderHook } from \"../redux/store/beforeRenderHooks\";\nimport type { Props as FallbackProps } from \"../react/ErrorBoundaryFallback\";\nimport createTheme from \"../react-theme/createTheme\";\nimport { receiveLocale } from \"../redux\";\n\ntype RenderFunction = () => ReactElement<ElementType>;\ntype MountFunction = (\n applicationNode: Element,\n element: ReactElement<ElementType>,\n) => void;\ntype Props = {\n customReducers?: CustomReducers,\n theme?: Theme | Array<Theme>,\n render: RenderFunction,\n mount: MountFunction,\n beforeRenderHooks?: Array<BeforeRenderHook>,\n ErrorFallbackComponent?: ComponentType<FallbackProps>,\n};\n\n/*\n * deserialize serialized data from the server to provide a smooth dehydration.\n */\nconst parseDataToJSON = (data: string) => {\n try {\n return JSON.parse(data);\n } catch (error) {\n throw new JsonParseException(`Error parsing content ${data}`);\n }\n};\n\nconst getDataFromServer = () => {\n const dataElement = document.querySelector(\n 'script[type=\"application/json\"][data-app-state=\"app-json\"]',\n );\n\n if (!dataElement) {\n throw new Error(\"Error loading state, json not found\");\n } else if (dataElement.textContent.trim() === \"\") {\n return {};\n }\n\n return parseDataToJSON(dataElement.textContent);\n};\n\n/**\n */\nexport const setUnhandledRejectionEvent = (store: ReduxStore) => {\n window.onunhandledrejection = (event) => {\n if (event.detail) {\n return setImmediate(() => {\n const errorMessage = event.detail.reason.message.toString();\n\n store.dispatch(showXHRErrorNotification(errorMessage));\n throw event.detail.reason;\n });\n }\n\n return event;\n };\n};\n\n/**\n */\nconst initThemeSettings = (state: ReduxState, theme?: Theme | Array<Theme>) => {\n const storedTheme = state.preferences.theme;\n // $FlowFixMe\n createTheme(storedTheme, theme); // on theme creation, the settings are set\n};\n\nconst handleLocale = (store: ReduxStore) => {\n const locale = store.getState().i18n.locale;\n if (locale) {\n store.dispatch(receiveLocale(locale));\n }\n};\n\n/**\n * The redirectURI querystring parameter is available when the server is redirecting an unauthorized deep link\n * @param store\n */\nconst handleRedirectURI = (store: ReduxStore) => {\n const urlParams = new URLSearchParams(window.location.search);\n const redirectURI = urlParams.get(\"redirectURI\");\n if (redirectURI) {\n xhr({ url: `${getBasePathModularUI()}${redirectURI}` }).catch((e) => {\n if (\n e.id === \"UnauthorizedException\" ||\n e.id === \"Error.NotAuthorized\" ||\n e.id === \"Error.Authentication.Required\" ||\n e.id === \"Error.Authentication.InvalidCredentials\"\n ) {\n const LOGIN_PATH = getSetting(\"LOGIN_PATH\", \"/signin\");\n store.dispatch(\n replace(LOGIN_PATH, {\n from: { pathname: redirectURI },\n modal: false,\n }),\n );\n }\n });\n }\n};\n\n/**\n */\nexport const setModelCatalogEntryDate = (store: ReduxStore) => {\n if (typeof window !== \"undefined\") {\n const entryDateFromUrl = new URLSearchParams(window.location?.search).get(\n \"entryDate\",\n );\n if (entryDateFromUrl) {\n store.dispatch(updateEntryDate(entryDateFromUrl));\n } else if (Cache.hasItem(\"ModelCatalogEntryDate\")) {\n store.dispatch(Cache.getItem(\"ModelCatalogEntryDate\"));\n }\n }\n};\n\n/**\n */\nexport const setupClient = (\n customReducers: CustomReducers = {},\n beforeRenderHooks: ?Array<BeforeRenderHook>,\n theme?: Theme | Array<Theme>,\n): { store: ReduxStore, routerHistory: RouterHistory } => {\n if (typeof window.contextPath === \"undefined\") {\n throw new Error(\"Missing contextPath on window object\");\n }\n\n const data = getDataFromServer();\n\n // remove all resources from cache\n Cache.clear(\"^res:\");\n\n // $FlowExpectedError\n const browserHistory: RouterHistory = createBrowserHistory({\n basename: getBasePathServer(),\n });\n const { routerHistory, store } = configureStore(\n browserHistory,\n customReducers,\n rehydrate(data),\n );\n\n initThemeSettings(store.getState(), theme);\n\n handleLocale(store);\n\n handleRedirectURI(store);\n setModelCatalogEntryDate(store);\n\n setAllContentInDataSetting(store.getState());\n setLoginPreferences(store.getState());\n setDateTimeSettings(store.getState());\n\n // load existing cache from other browser tabs\n Cache.loadOtherBrowserTabs(() => {\n if (Cache.getItem(\"auth\")) {\n store.dispatch(loginSuccess());\n }\n });\n\n if (has(data, \"error.name\")) {\n const error = new FetchException(data?.error?.response);\n store.dispatch(handleError(error));\n }\n\n if (Cache.getItem(\"auth\")) {\n store.dispatch(loginSuccess());\n }\n\n // listen to history change and update the redux router store\n routerHistory.listen((location, action) => {\n store.dispatch(locationChange(location, action));\n });\n\n setUnhandledRejectionEvent(store);\n\n if (document.body) {\n document.body.className = \"js\";\n }\n\n if (beforeRenderHooks) {\n handleBeforeRenderHooks(beforeRenderHooks, { store });\n }\n\n return { store, routerHistory };\n};\n\n/**\n */\nexport const addContentLoadedEvent = (\n store: ReduxStore,\n routerHistory: RouterHistory,\n theme?: Theme | Array<Theme>,\n render: RenderFunction,\n ErrorFallbackComponent?: ComponentType<FallbackProps>,\n mount: MountFunction,\n) => {\n window.addEventListener(\"DOMContentLoaded\", () => {\n const applicationNode = document.querySelector(\"#application\");\n if (!applicationNode) {\n throw new Error(\n \"No DOM element with id application found to attach client to\",\n );\n }\n\n mount(\n applicationNode,\n <Init\n store={store}\n routerHistory={routerHistory}\n contextPath={window.contextPath}\n theme={theme}\n ErrorFallbackComponent={ErrorFallbackComponent}\n >\n {render()}\n </Init>,\n );\n });\n};\n\n/**\n */\nconst mountClient = (\n applicationNode: Element,\n element: ReactElement<ElementType>,\n) => {\n const isSSR = applicationNode.querySelector(\".application\");\n if (isSSR) {\n hydrateRoot(element, applicationNode);\n } else {\n const root = createRoot(element);\n root.render(applicationNode);\n }\n};\n\n/**\n * Mount the webapplication to the DOM, setup redux store and caches, add unhandledRejectionEvent, used client side when JavaScript is enabled.\n */\nexport const client = ({\n customReducers,\n theme,\n render,\n beforeRenderHooks,\n ErrorFallbackComponent,\n mount,\n}: Props) => {\n const { store, routerHistory } = setupClient(\n customReducers,\n beforeRenderHooks,\n );\n\n addContentLoadedEvent(\n store,\n routerHistory,\n theme,\n render,\n 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1CC,cAAc,EACdI,iBACF,CAAC;EAEDyB,qBAAqB,CACnB/E,KAAK,EACL6D,aAAa,EACb9C,KAAK,EACLiE,MAAM,EACNC,sBAAsB,EACtBC,KAAK,IAAIM,WACX,CAAC;AACH,CAAC;AAAC5E,OAAA,CAAAkF,MAAA,GAAAA,MAAA","ignoreList":[]}
@@ -5,14 +5,17 @@ Object.defineProperty(exports, "__esModule", {
5
5
  value: true
6
6
  });
7
7
  exports.getPreferredLocale = exports.getFullRequestUrl = exports.getFullRequestHref = exports.getCookieFromRequest = void 0;
8
+ var _map = _interopRequireDefault(require("@babel/runtime-corejs3/core-js-stable/instance/map"));
8
9
  var _Href = _interopRequireDefault(require("../models/href/Href"));
9
10
  /**
10
11
  */
11
12
  const getFullRequestUrl = request => {
12
- const pathInfo = request.getPathInfo() || "/";
13
- const queryString = request.getQueryString();
13
+ var _context;
14
+ let pathInfo = request.getPathInfo() || "/";
15
+ let queryString = request.getQueryString();
16
+ pathInfo = (0, _map.default)(_context = pathInfo.split("/")).call(_context, segment => encodeURIComponent(segment)).join("/");
14
17
  if (queryString) {
15
- return `${pathInfo}?${queryString}`;
18
+ return `${pathInfo}?${encodeURIComponent(queryString)}`;
16
19
  }
17
20
  return pathInfo;
18
21
  };
@@ -1 +1 @@
1
- {"version":3,"file":"requestInformation.js","names":["_Href","_interopRequireDefault","require","getFullRequestUrl","request","pathInfo","getPathInfo","queryString","getQueryString","exports","getFullRequestHref","Href","getCookieFromRequest","cookieName","getCookieByName","getPreferredLocale","locales","languageFromCookie","acceptLanguageHeader","getHeader","availableLocaleCodes"],"sources":["../../src/react-server/requestInformation.js"],"sourcesContent":["// @flow\nimport Href from \"../models/href/Href\";\n\nimport type Locales from \"../i18n/Locales\";\n\n/**\n */\nexport const getFullRequestUrl = (request: HttpServletRequestJava): string => {\n const pathInfo = request.getPathInfo() || \"/\";\n const queryString = request.getQueryString();\n\n if (queryString) {\n return `${pathInfo}?${queryString}`;\n }\n\n return pathInfo;\n};\n\n/**\n */\nexport const getFullRequestHref = (request: HttpServletRequestJava): Href =>\n new Href(getFullRequestUrl(request));\n\n/**\n */\nexport const getCookieFromRequest = (\n request: HttpServletRequestJava,\n cookieName: string,\n): null | string => {\n return request.getCookieByName(cookieName);\n};\n\n/**\n */\nexport const getPreferredLocale = (\n request: HttpServletRequestJava,\n locales: Locales,\n): void | string => {\n const languageFromCookie = getCookieFromRequest(request, \"locale\");\n const acceptLanguageHeader =\n languageFromCookie || request.getHeader(\"Accept-Language\");\n\n // when no accept language header or cookie present, get first locale code\n if (acceptLanguageHeader === null) {\n return locales.availableLocaleCodes[0];\n }\n\n return locales.getPreferredLocale(acceptLanguageHeader);\n};\n"],"mappings":";;;;;;;AACA,IAAAA,KAAA,GAAAC,sBAAA,CAAAC,OAAA;AAIA;AACA;AACO,MAAMC,iBAAiB,GAAIC,OAA+B,IAAa;EAC5E,MAAMC,QAAQ,GAAGD,OAAO,CAACE,WAAW,CAAC,CAAC,IAAI,GAAG;EAC7C,MAAMC,WAAW,GAAGH,OAAO,CAACI,cAAc,CAAC,CAAC;EAE5C,IAAID,WAAW,EAAE;IACf,OAAO,GAAGF,QAAQ,IAAIE,WAAW,EAAE;EACrC;EAEA,OAAOF,QAAQ;AACjB,CAAC;;AAED;AACA;AADAI,OAAA,CAAAN,iBAAA,GAAAA,iBAAA;AAEO,MAAMO,kBAAkB,GAAIN,OAA+B,IAChE,IAAIO,aAAI,CAACR,iBAAiB,CAACC,OAAO,CAAC,CAAC;;AAEtC;AACA;AADAK,OAAA,CAAAC,kBAAA,GAAAA,kBAAA;AAEO,MAAME,oBAAoB,GAAGA,CAClCR,OAA+B,EAC/BS,UAAkB,KACA;EAClB,OAAOT,OAAO,CAACU,eAAe,CAACD,UAAU,CAAC;AAC5C,CAAC;;AAED;AACA;AADAJ,OAAA,CAAAG,oBAAA,GAAAA,oBAAA;AAEO,MAAMG,kBAAkB,GAAGA,CAChCX,OAA+B,EAC/BY,OAAgB,KACE;EAClB,MAAMC,kBAAkB,GAAGL,oBAAoB,CAACR,OAAO,EAAE,QAAQ,CAAC;EAClE,MAAMc,oBAAoB,GACxBD,kBAAkB,IAAIb,OAAO,CAACe,SAAS,CAAC,iBAAiB,CAAC;;EAE5D;EACA,IAAID,oBAAoB,KAAK,IAAI,EAAE;IACjC,OAAOF,OAAO,CAACI,oBAAoB,CAAC,CAAC,CAAC;EACxC;EAEA,OAAOJ,OAAO,CAACD,kBAAkB,CAACG,oBAAoB,CAAC;AACzD,CAAC;AAACT,OAAA,CAAAM,kBAAA,GAAAA,kBAAA","ignoreList":[]}
1
+ {"version":3,"file":"requestInformation.js","names":["_Href","_interopRequireDefault","require","getFullRequestUrl","request","_context","pathInfo","getPathInfo","queryString","getQueryString","_map","default","split","call","segment","encodeURIComponent","join","exports","getFullRequestHref","Href","getCookieFromRequest","cookieName","getCookieByName","getPreferredLocale","locales","languageFromCookie","acceptLanguageHeader","getHeader","availableLocaleCodes"],"sources":["../../src/react-server/requestInformation.js"],"sourcesContent":["// @flow\nimport Href from \"../models/href/Href\";\n\nimport type Locales from \"../i18n/Locales\";\n\n/**\n */\nexport const getFullRequestUrl = (request: HttpServletRequestJava): string => {\n let pathInfo = request.getPathInfo() || \"/\";\n let queryString = request.getQueryString();\n\n pathInfo = pathInfo\n .split(\"/\")\n .map((segment) => encodeURIComponent(segment))\n .join(\"/\");\n\n if (queryString) {\n return `${pathInfo}?${encodeURIComponent(queryString)}`;\n }\n\n return pathInfo;\n};\n\n/**\n */\nexport const getFullRequestHref = (request: HttpServletRequestJava): Href =>\n new Href(getFullRequestUrl(request));\n\n/**\n */\nexport const getCookieFromRequest = (\n request: HttpServletRequestJava,\n cookieName: string,\n): null | string => {\n return request.getCookieByName(cookieName);\n};\n\n/**\n */\nexport const getPreferredLocale = (\n request: HttpServletRequestJava,\n locales: Locales,\n): void | string => {\n const languageFromCookie = getCookieFromRequest(request, \"locale\");\n const acceptLanguageHeader =\n languageFromCookie || request.getHeader(\"Accept-Language\");\n\n // when no accept language header or cookie present, get first locale code\n if (acceptLanguageHeader === null) {\n return locales.availableLocaleCodes[0];\n }\n\n return locales.getPreferredLocale(acceptLanguageHeader);\n};\n"],"mappings":";;;;;;;;AACA,IAAAA,KAAA,GAAAC,sBAAA,CAAAC,OAAA;AAIA;AACA;AACO,MAAMC,iBAAiB,GAAIC,OAA+B,IAAa;EAAA,IAAAC,QAAA;EAC5E,IAAIC,QAAQ,GAAGF,OAAO,CAACG,WAAW,CAAC,CAAC,IAAI,GAAG;EAC3C,IAAIC,WAAW,GAAGJ,OAAO,CAACK,cAAc,CAAC,CAAC;EAE1CH,QAAQ,GAAG,IAAAI,IAAA,CAAAC,OAAA,EAAAN,QAAA,GAAAC,QAAQ,CAChBM,KAAK,CAAC,GAAG,CAAC,EAAAC,IAAA,CAAAR,QAAA,EACLS,OAAO,IAAKC,kBAAkB,CAACD,OAAO,CAAC,CAAC,CAC7CE,IAAI,CAAC,GAAG,CAAC;EAEZ,IAAIR,WAAW,EAAE;IACf,OAAO,GAAGF,QAAQ,IAAIS,kBAAkB,CAACP,WAAW,CAAC,EAAE;EACzD;EAEA,OAAOF,QAAQ;AACjB,CAAC;;AAED;AACA;AADAW,OAAA,CAAAd,iBAAA,GAAAA,iBAAA;AAEO,MAAMe,kBAAkB,GAAId,OAA+B,IAChE,IAAIe,aAAI,CAAChB,iBAAiB,CAACC,OAAO,CAAC,CAAC;;AAEtC;AACA;AADAa,OAAA,CAAAC,kBAAA,GAAAA,kBAAA;AAEO,MAAME,oBAAoB,GAAGA,CAClChB,OAA+B,EAC/BiB,UAAkB,KACA;EAClB,OAAOjB,OAAO,CAACkB,eAAe,CAACD,UAAU,CAAC;AAC5C,CAAC;;AAED;AACA;AADAJ,OAAA,CAAAG,oBAAA,GAAAA,oBAAA;AAEO,MAAMG,kBAAkB,GAAGA,CAChCnB,OAA+B,EAC/BoB,OAAgB,KACE;EAClB,MAAMC,kBAAkB,GAAGL,oBAAoB,CAAChB,OAAO,EAAE,QAAQ,CAAC;EAClE,MAAMsB,oBAAoB,GACxBD,kBAAkB,IAAIrB,OAAO,CAACuB,SAAS,CAAC,iBAAiB,CAAC;;EAE5D;EACA,IAAID,oBAAoB,KAAK,IAAI,EAAE;IACjC,OAAOF,OAAO,CAACI,oBAAoB,CAAC,CAAC,CAAC;EACxC;EAEA,OAAOJ,OAAO,CAACD,kBAAkB,CAACG,oBAAoB,CAAC;AACzD,CAAC;AAACT,OAAA,CAAAM,kBAAA,GAAAA,kBAAA","ignoreList":[]}
@@ -67,7 +67,7 @@ const setI18n = function (store) {
67
67
  });
68
68
  const enabledLocales = (0, _filter.default)(mergedLocales).call(mergedLocales, locale => {
69
69
  var _context;
70
- return (0, _includes.default)(_context = (0, _Settings.getSetting)("ENABLED_LOCALES")).call(_context, locale.code);
70
+ return (0, _includes.default)(_context = (0, _Settings.getEnabledLocales)()).call(_context, locale.code);
71
71
  });
72
72
  const localesInstance = new _Locales.default(enabledLocales);
73
73
  const preferredLocale = (0, _requestInformation.getPreferredLocale)(request, localesInstance);
@@ -1 +1 @@
1
- {"version":3,"file":"serverUtil.js","names":["_history","require","_objects","_deepmerge","_interopRequireDefault","_configureStore","_Locales","_interopRequireWildcard","_requestInformation","_I18nActions","_Preferences","_Settings","_exceptions","_redux","_i18n","_ModularUIRequest","e","t","_WeakMap","r","n","__esModule","o","i","f","__proto__","default","has","get","set","hasOwnProperty","call","Object","defineProperty","_Object$getOwnPropertyDescriptor","createReduxStore","requestHref","customReducers","initialState","history","createMemoryHistory","initialEntries","toString","store","configureStore","exports","setI18n","locales","arguments","length","undefined","request","Array","isArray","IllegalArgumentException","mergedLocales","_map","availableLocales","locale","code","customLocale","_find","custLocale","deepmerge","forEach","some","push","enabledLocales","_filter","_context","_includes","getSetting","localesInstance","Locales","preferredLocale","getPreferredLocale","dispatch","setLocales","setServerPreferencesFromArray","serverPreferences","serverPreference","name","defaultValue","type","setServerPreference","setServerPreferences","setAllContentInDataSetting","setLoginPreferences","setDateTimeSettings","preferencesProvider","isStudioContext","setPreference","setConfigurationTheme","configTheme","configFileLocation","getLayoutConfigFileLocation","configFilePath","_startsWith","dataFetcher","fetch","setThemePreference","Error","setApplication","getLocale","getState","application","ModularUIRequest","fetchSync","connectKey","initModels","key","model","handleErrors","state","error","shouldThrowOnServer","dehydrate","modularui","status","lastModification","filteredState","_stringify","replace","createHead","sheet","UUID","helmetContext","style","getStyleTags","meta","helmet"],"sources":["../../src/react-server/serverUtil.js"],"sourcesContent":["// @flow\nimport { createMemoryHistory } from \"history\";\nimport { has } from \"../utils/helpers/objects\";\nimport deepmerge from \"deepmerge\";\n\nimport configureStore from \"../redux/store/configureStore\";\n\nimport { availableLocales } from \"../i18n/Locales\";\nimport Locales from \"../i18n/Locales\";\n\nimport { getPreferredLocale } from \"./requestInformation\";\nimport { setLocales } from \"../redux/_i18n/I18nActions\";\n\nimport {\n setServerPreference,\n setThemePreference,\n setPreference,\n setAllContentInDataSetting,\n setLoginPreferences,\n setDateTimeSettings,\n} from \"../redux/actions/Preferences\";\n\nimport { getSetting } from \"../constants/Settings\";\n\nimport { IllegalArgumentException } from \"../exceptions\";\n\nimport { initModels } from \"../redux\";\nimport { getLocale } from \"../redux/selectors/i18n\";\n\nimport ModularUIRequest from \"../modularui/ModularUIRequest\";\n\nimport type { LocaleConfiguration } from \"../i18n/types\";\nimport type { ReduxState, ReduxStore } from \"../redux/types\";\nimport type Href from \"../models/href/Href\";\nimport type { RouterHistory } from \"react-router\";\n\nexport type PreferenceValue = {\n name: string,\n defaultValue?: string | null,\n type?: string,\n};\n\n/**\n */\nconst createReduxStore = (\n requestHref: Href,\n customReducers: Object,\n initialState?: $Shape<ReduxState>,\n): ReduxStore => {\n // $FlowExpectedError\n const history: RouterHistory = createMemoryHistory({\n initialEntries: [requestHref.toString()],\n });\n\n const { store } = configureStore(history, customReducers, initialState);\n\n return store;\n};\n\n/**\n */\nconst setI18n = (\n store: ReduxStore,\n locales: Array<LocaleConfiguration> = [],\n request: HttpServletRequestJava,\n) => {\n if (!Array.isArray(locales)) {\n throw new IllegalArgumentException(\"locales must be an array of objects\");\n }\n if (!request) {\n throw new IllegalArgumentException(\"missing request argument\");\n }\n\n const mergedLocales = availableLocales.map((locale) => {\n const code = locale.code;\n const customLocale = locales.find((custLocale) => custLocale.code === code);\n\n if (customLocale) {\n return deepmerge(locale, customLocale);\n }\n\n return locale;\n });\n\n locales.forEach((customLocale) => {\n if (!mergedLocales.some((locale) => locale.code === customLocale.code)) {\n mergedLocales.push(customLocale);\n }\n });\n\n const enabledLocales = mergedLocales.filter((locale: LocaleConfiguration) =>\n getSetting(\"ENABLED_LOCALES\").includes(locale.code),\n );\n\n const localesInstance = new Locales(enabledLocales);\n const preferredLocale = getPreferredLocale(request, localesInstance);\n store.dispatch(setLocales(localesInstance, preferredLocale ?? \"en\"));\n};\n\nconst setServerPreferencesFromArray = (\n store: ReduxStore,\n serverPreferences: Array<string | PreferenceValue>,\n) => {\n serverPreferences.forEach((serverPreference) => {\n if (typeof serverPreference === \"object\") {\n const { name, defaultValue, type } = serverPreference;\n store.dispatch(setServerPreference(name, defaultValue, type));\n } else {\n store.dispatch(setServerPreference(serverPreference, null));\n }\n });\n};\n\n/**\n * Server preferences can be suplied by an array of preference names,\n * or an array of objects which has the name, an optional default value and an optional type.<br>\n * When the type is set to string, a comma separated value is not converted to an array:\n *\n * @example\n * // value becomes an array [default1, default2]\n * { name: \"prefName\", defaultValue: \"default1, default2\" }\n * // value remains a string \"default1, default2\"\n * { name: \"prefName\", defaultValue: \"default1, default2\", type: \"string\" }\n *\n * @param store\n * @param serverPreferences\n */\nconst setServerPreferences = (\n store: ReduxStore,\n serverPreferences: Array<string | PreferenceValue>,\n) => {\n if (Array.isArray(serverPreferences)) {\n setServerPreferencesFromArray(store, serverPreferences);\n }\n\n store.dispatch(setAllContentInDataSetting());\n store.dispatch(setLoginPreferences());\n store.dispatch(setDateTimeSettings());\n\n if (\n preferencesProvider &&\n preferencesProvider.isStudioContext &&\n preferencesProvider.isStudioContext()\n ) {\n store.dispatch(setPreference(\"isStudioContext\", true));\n }\n};\n\n/**\n */\nconst setConfigurationTheme = (store: ReduxStore) => {\n let configTheme = null;\n\n const configFileLocation = preferencesProvider.getLayoutConfigFileLocation();\n if (typeof configFileLocation === \"string\") {\n const configFilePath = configFileLocation.startsWith(\"/\")\n ? `/resource${configFileLocation}`\n : `/resource/${configFileLocation}`;\n\n configTheme = dataFetcher.fetch(configFilePath);\n\n if (configTheme) {\n store.dispatch(setThemePreference(configTheme));\n } else {\n throw new Error(\n `Could not read theme configuration file from: ${configFilePath}`,\n );\n }\n }\n};\n\n/**\n */\nconst setApplication = (store: ReduxStore) => {\n try {\n const locale = getLocale(store.getState());\n const application = new ModularUIRequest(\"/\", {\n locale: locale,\n }).fetchSync();\n\n application.connectKey = `application(/)(${locale})`;\n\n store.dispatch(\n initModels([\n {\n key: `application(/)(${locale})`,\n model: application,\n },\n ]),\n );\n } catch (e) {\n // swallow error, in this case we just don't pre-cache the webapplication,\n // which has not much difference for the end user\n }\n};\n\n/**\n */\nconst handleErrors = (store: ReduxStore) => {\n const state = store.getState();\n\n if (\n state.error &&\n (state.error.shouldThrowOnServer ||\n !has(state.error, \"shouldThrowOnServer\"))\n ) {\n throw state.error;\n }\n};\n\n/**\n */\nconst dehydrate = (store: ReduxStore): string => {\n const state = store.getState();\n\n const modularui: {\n [key: string]: { status: string, lastModification: number, model: ?Object },\n } = {};\n\n for (const key in state.modularui) {\n const { status, model, lastModification } = state.modularui[key];\n\n if (model) {\n modularui[key] = {\n status,\n lastModification,\n model: model.dehydrate(),\n };\n } else {\n modularui[key] = {\n status,\n lastModification,\n model: undefined,\n };\n }\n }\n\n const filteredState = {\n ...state,\n modularui,\n };\n\n return JSON.stringify(filteredState).replace(/</g, \"\\\\u003c\");\n};\n\n/**\n */\nconst createHead = (\n sheet: any,\n UUID: string,\n helmetContext?: Object,\n): Object => {\n const style = sheet.getStyleTags();\n const meta = helmetContext ? [...helmetContext.helmet.meta] : [];\n\n if (helmetContext) {\n return {\n ...helmetContext.helmet,\n style,\n meta,\n };\n }\n\n return {\n style,\n meta,\n };\n};\n\nexport {\n createReduxStore,\n setI18n,\n setApplication,\n setServerPreferences,\n setConfigurationTheme,\n createHead,\n handleErrors,\n dehydrate,\n};\n"],"mappings":";;;;;;;;;;;;;;;AACA,IAAAA,QAAA,GAAAC,OAAA;AACA,IAAAC,QAAA,GAAAD,OAAA;AACA,IAAAE,UAAA,GAAAC,sBAAA,CAAAH,OAAA;AAEA,IAAAI,eAAA,GAAAD,sBAAA,CAAAH,OAAA;AAEA,IAAAK,QAAA,GAAAC,uBAAA,CAAAN,OAAA;AAGA,IAAAO,mBAAA,GAAAP,OAAA;AACA,IAAAQ,YAAA,GAAAR,OAAA;AAEA,IAAAS,YAAA,GAAAT,OAAA;AASA,IAAAU,SAAA,GAAAV,OAAA;AAEA,IAAAW,WAAA,GAAAX,OAAA;AAEA,IAAAY,MAAA,GAAAZ,OAAA;AACA,IAAAa,KAAA,GAAAb,OAAA;AAEA,IAAAc,iBAAA,GAAAX,sBAAA,CAAAH,OAAA;AAA6D,SAAAM,wBAAAS,CAAA,EAAAC,CAAA,6BAAAC,QAAA,MAAAC,CAAA,OAAAD,QAAA,IAAAE,CAAA,OAAAF,QAAA,YAAAX,uBAAA,YAAAA,CAAAS,CAAA,EAAAC,CAAA,SAAAA,CAAA,IAAAD,CAAA,IAAAA,CAAA,CAAAK,UAAA,SAAAL,CAAA,MAAAM,CAAA,EAAAC,CAAA,EAAAC,CAAA,KAAAC,SAAA,QAAAC,OAAA,EAAAV,CAAA,iBAAAA,CAAA,uBAAAA,CAAA,yBAAAA,CAAA,SAAAQ,CAAA,MAAAF,CAAA,GAAAL,CAAA,GAAAG,CAAA,GAAAD,CAAA,QAAAG,CAAA,CAAAK,GAAA,CAAAX,CAAA,UAAAM,CAAA,CAAAM,GAAA,CAAAZ,CAAA,GAAAM,CAAA,CAAAO,GAAA,CAAAb,CAAA,EAAAQ,CAAA,gBAAAP,CA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GH,KAAK,CAACI,YAAY,CAAC,CAAC;EAClC,MAAMC,IAAI,GAAGH,aAAa,GAAG,CAAC,GAAGA,aAAa,CAACI,MAAM,CAACD,IAAI,CAAC,GAAG,EAAE;EAEhE,IAAIH,aAAa,EAAE;IACjB,OAAO;MACL,GAAGA,aAAa,CAACI,MAAM;MACvBH,KAAK;MACLE;IACF,CAAC;EACH;EAEA,OAAO;IACLF,KAAK;IACLE;EACF,CAAC;AACH,CAAC;AAACpF,OAAA,CAAA8E,UAAA,GAAAA,UAAA","ignoreList":[]}
1
+ {"version":3,"file":"serverUtil.js","names":["_history","require","_objects","_deepmerge","_interopRequireDefault","_configureStore","_Locales","_interopRequireWildcard","_requestInformation","_I18nActions","_Preferences","_Settings","_exceptions","_redux","_i18n","_ModularUIRequest","e","t","_WeakMap","r","n","__esModule","o","i","f","__proto__","default","has","get","set","hasOwnProperty","call","Object","defineProperty","_Object$getOwnPropertyDescriptor","createReduxStore","requestHref","customReducers","initialState","history","createMemoryHistory","initialEntries","toString","store","configureStore","exports","setI18n","locales","arguments","length","undefined","request","Array","isArray","IllegalArgumentException","mergedLocales","_map","availableLocales","locale","code","customLocale","_find","custLocale","deepmerge","forEach","some","push","enabledLocales","_filter","_context","_includes","getEnabledLocales","localesInstance","Locales","preferredLocale","getPreferredLocale","dispatch","setLocales","setServerPreferencesFromArray","serverPreferences","serverPreference","name","defaultValue","type","setServerPreference","setServerPreferences","setAllContentInDataSetting","setLoginPreferences","setDateTimeSettings","preferencesProvider","isStudioContext","setPreference","setConfigurationTheme","configTheme","configFileLocation","getLayoutConfigFileLocation","configFilePath","_startsWith","dataFetcher","fetch","setThemePreference","Error","setApplication","getLocale","getState","application","ModularUIRequest","fetchSync","connectKey","initModels","key","model","handleErrors","state","error","shouldThrowOnServer","dehydrate","modularui","status","lastModification","filteredState","_stringify","replace","createHead","sheet","UUID","helmetContext","style","getStyleTags","meta","helmet"],"sources":["../../src/react-server/serverUtil.js"],"sourcesContent":["// @flow\nimport { createMemoryHistory } from \"history\";\nimport { has } from \"../utils/helpers/objects\";\nimport deepmerge from \"deepmerge\";\n\nimport configureStore from \"../redux/store/configureStore\";\n\nimport { availableLocales } from \"../i18n/Locales\";\nimport Locales from \"../i18n/Locales\";\n\nimport { getPreferredLocale } from \"./requestInformation\";\nimport { setLocales } from \"../redux/_i18n/I18nActions\";\n\nimport {\n setServerPreference,\n setThemePreference,\n setPreference,\n setAllContentInDataSetting,\n setLoginPreferences,\n setDateTimeSettings,\n} from \"../redux/actions/Preferences\";\n\nimport { getEnabledLocales } from \"../constants/Settings\";\n\nimport { IllegalArgumentException } from \"../exceptions\";\n\nimport { initModels } from \"../redux\";\nimport { getLocale } from \"../redux/selectors/i18n\";\n\nimport ModularUIRequest from \"../modularui/ModularUIRequest\";\n\nimport type { LocaleConfiguration } from \"../i18n/types\";\nimport type { ReduxState, ReduxStore } from \"../redux/types\";\nimport type Href from \"../models/href/Href\";\nimport type { RouterHistory } from \"react-router\";\n\nexport type PreferenceValue = {\n name: string,\n defaultValue?: string | null,\n type?: string,\n};\n\n/**\n */\nconst createReduxStore = (\n requestHref: Href,\n customReducers: Object,\n initialState?: $Shape<ReduxState>,\n): ReduxStore => {\n // $FlowExpectedError\n const history: RouterHistory = createMemoryHistory({\n initialEntries: [requestHref.toString()],\n });\n\n const { store } = configureStore(history, customReducers, initialState);\n\n return store;\n};\n\n/**\n */\nconst setI18n = (\n store: ReduxStore,\n locales: Array<LocaleConfiguration> = [],\n request: HttpServletRequestJava,\n) => {\n if (!Array.isArray(locales)) {\n throw new IllegalArgumentException(\"locales must be an array of objects\");\n }\n if (!request) {\n throw new IllegalArgumentException(\"missing request argument\");\n }\n\n const mergedLocales = availableLocales.map((locale) => {\n const code = locale.code;\n const customLocale = locales.find((custLocale) => custLocale.code === code);\n\n if (customLocale) {\n return deepmerge(locale, customLocale);\n }\n\n return locale;\n });\n\n locales.forEach((customLocale) => {\n if (!mergedLocales.some((locale) => locale.code === customLocale.code)) {\n mergedLocales.push(customLocale);\n }\n });\n\n const enabledLocales = mergedLocales.filter((locale: LocaleConfiguration) =>\n getEnabledLocales().includes(locale.code),\n );\n\n const localesInstance = new Locales(enabledLocales);\n const preferredLocale = getPreferredLocale(request, localesInstance);\n store.dispatch(setLocales(localesInstance, preferredLocale ?? \"en\"));\n};\n\nconst setServerPreferencesFromArray = (\n store: ReduxStore,\n serverPreferences: Array<string | PreferenceValue>,\n) => {\n serverPreferences.forEach((serverPreference) => {\n if (typeof serverPreference === \"object\") {\n const { name, defaultValue, type } = serverPreference;\n store.dispatch(setServerPreference(name, defaultValue, type));\n } else {\n store.dispatch(setServerPreference(serverPreference, null));\n }\n });\n};\n\n/**\n * Server preferences can be suplied by an array of preference names,\n * or an array of objects which has the name, an optional default value and an optional type.<br>\n * When the type is set to string, a comma separated value is not converted to an array:\n *\n * @example\n * // value becomes an array [default1, default2]\n * { name: \"prefName\", defaultValue: \"default1, default2\" }\n * // value remains a string \"default1, default2\"\n * { name: \"prefName\", defaultValue: \"default1, default2\", type: \"string\" }\n *\n * @param store\n * @param serverPreferences\n */\nconst setServerPreferences = (\n store: ReduxStore,\n serverPreferences: Array<string | PreferenceValue>,\n) => {\n if (Array.isArray(serverPreferences)) {\n setServerPreferencesFromArray(store, serverPreferences);\n }\n\n store.dispatch(setAllContentInDataSetting());\n store.dispatch(setLoginPreferences());\n store.dispatch(setDateTimeSettings());\n\n if (\n preferencesProvider &&\n preferencesProvider.isStudioContext &&\n preferencesProvider.isStudioContext()\n ) {\n store.dispatch(setPreference(\"isStudioContext\", true));\n }\n};\n\n/**\n */\nconst setConfigurationTheme = (store: ReduxStore) => {\n let configTheme = null;\n\n const configFileLocation = preferencesProvider.getLayoutConfigFileLocation();\n if (typeof configFileLocation === \"string\") {\n const configFilePath = configFileLocation.startsWith(\"/\")\n ? `/resource${configFileLocation}`\n : `/resource/${configFileLocation}`;\n\n configTheme = dataFetcher.fetch(configFilePath);\n\n if (configTheme) {\n store.dispatch(setThemePreference(configTheme));\n } else {\n throw new Error(\n `Could not read theme configuration file from: ${configFilePath}`,\n );\n }\n }\n};\n\n/**\n */\nconst setApplication = (store: ReduxStore) => {\n try {\n const locale = getLocale(store.getState());\n const application = new ModularUIRequest(\"/\", {\n locale: locale,\n }).fetchSync();\n\n application.connectKey = `application(/)(${locale})`;\n\n store.dispatch(\n initModels([\n {\n key: `application(/)(${locale})`,\n model: application,\n },\n ]),\n );\n } catch (e) {\n // swallow error, in this case we just don't pre-cache the webapplication,\n // which has not much difference for the end user\n }\n};\n\n/**\n */\nconst handleErrors = (store: ReduxStore) => {\n const state = store.getState();\n\n if (\n state.error &&\n (state.error.shouldThrowOnServer ||\n !has(state.error, \"shouldThrowOnServer\"))\n ) {\n throw state.error;\n }\n};\n\n/**\n */\nconst dehydrate = (store: ReduxStore): string => {\n const state = store.getState();\n\n const modularui: {\n [key: string]: { status: string, lastModification: number, model: ?Object },\n } = {};\n\n for (const key in state.modularui) {\n const { status, model, lastModification } = state.modularui[key];\n\n if (model) {\n modularui[key] = {\n status,\n lastModification,\n model: model.dehydrate(),\n };\n } else {\n modularui[key] = {\n status,\n lastModification,\n model: undefined,\n };\n }\n }\n\n const filteredState = {\n ...state,\n modularui,\n };\n\n return JSON.stringify(filteredState).replace(/</g, \"\\\\u003c\");\n};\n\n/**\n */\nconst createHead = (\n sheet: any,\n UUID: string,\n helmetContext?: Object,\n): Object => {\n const style = sheet.getStyleTags();\n const meta = helmetContext ? [...helmetContext.helmet.meta] : [];\n\n if (helmetContext) {\n return {\n ...helmetContext.helmet,\n style,\n meta,\n };\n }\n\n return {\n style,\n meta,\n };\n};\n\nexport {\n createReduxStore,\n setI18n,\n setApplication,\n setServerPreferences,\n setConfigurationTheme,\n createHead,\n handleErrors,\n dehydrate,\n};\n"],"mappings":";;;;;;;;;;;;;;;AACA,IAAAA,QAAA,GAAAC,OAAA;AACA,IAAAC,QAAA,GAAAD,OAAA;AACA,IAAAE,UAAA,GAAAC,sBAAA,CAAAH,OAAA;AAEA,I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GAAAA,UAAA","ignoreList":[]}
@@ -1 +1 @@
1
- {"version":3,"file":"I18nActions.js","names":["_ProgressIndicator","require","receiveLocale","locale","type","payload","exports","updateLocale","dispatch","startProgress","finishProgress","setLocales","locales"],"sources":["../../../src/redux/_i18n/I18nActions.js"],"sourcesContent":["// @flow\nimport { startProgress, finishProgress } from \"../actions/ProgressIndicator\";\n\nimport type Locales from \"../../i18n/Locales\";\nimport type { SetLocalesAction, UpdateLocaleAction } from \"./types\";\nimport type { ThunkAction } from \"../types\";\n\n/**\n * Update current locale\n */\nexport const receiveLocale = (locale: string): UpdateLocaleAction => ({\n type: \"UPDATE_LOCALE\",\n payload: locale,\n});\n\n/**\n * Change locale of application and redirect\n */\nexport const updateLocale =\n (locale: string): ThunkAction =>\n (dispatch) => {\n dispatch(startProgress());\n dispatch(receiveLocale(locale));\n\n dispatch(finishProgress());\n };\n\n/**\n */\nexport const setLocales = (\n locales: Locales,\n locale: string,\n): SetLocalesAction => ({\n type: \"SET_LOCALES\",\n payload: {\n locales,\n locale,\n },\n});\n"],"mappings":";;;;;;AACA,IAAAA,kBAAA,GAAAC,OAAA;AAMA;AACA;AACA;AACO,MAAMC,aAAa,GAAIC,MAAc,KAA0B;EACpEC,IAAI,EAAE,eAAe;EACrBC,OAAO,EAAEF;AACX,CAAC,CAAC;;AAEF;AACA;AACA;AAFAG,OAAA,CAAAJ,aAAA,GAAAA,aAAA;AAGO,MAAMK,YAAY,GACtBJ,MAAc,IACdK,QAAQ,IAAK;EACZA,QAAQ,CAAC,IAAAC,gCAAa,EAAC,CAAC,CAAC;EACzBD,QAAQ,CAACN,aAAa,CAACC,MAAM,CAAC,CAAC;EAE/BK,QAAQ,CAAC,IAAAE,iCAAc,EAAC,CAAC,CAAC;AAC5B,CAAC;;AAEH;AACA;AADAJ,OAAA,CAAAC,YAAA,GAAAA,YAAA;AAEO,MAAMI,UAAU,GAAGA,CACxBC,OAAgB,EAChBT,MAAc,MACQ;EACtBC,IAAI,EAAE,aAAa;EACnBC,OAAO,EAAE;IACPO,OAAO;IACPT;EACF;AACF,CAAC,CAAC;AAACG,OAAA,CAAAK,UAAA,GAAAA,UAAA","ignoreList":[]}
1
+ {"version":3,"file":"I18nActions.js","names":["_ProgressIndicator","require","receiveLocale","locale","type","payload","exports","updateLocale","dispatch","startProgress","finishProgress","setLocales","locales"],"sources":["../../../src/redux/_i18n/I18nActions.js"],"sourcesContent":["// @flow\nimport { startProgress, finishProgress } from \"../actions/ProgressIndicator\";\n\nimport type Locales from \"../../i18n/Locales\";\nimport type { SetLocalesAction, UpdateLocaleAction } from \"./types\";\nimport type { ThunkAction } from \"../types\";\n\n/**\n * Update current locale\n */\nexport const receiveLocale = (locale: string): UpdateLocaleAction => ({\n type: \"UPDATE_LOCALE\",\n payload: locale,\n});\n\n/**\n * Change locale of application and redirect\n */\nexport const updateLocale =\n (locale: string): ThunkAction =>\n (dispatch) => {\n dispatch(startProgress());\n dispatch(receiveLocale(locale));\n dispatch(finishProgress());\n };\n\n/**\n */\nexport const setLocales = (\n locales: Locales,\n locale: string,\n): SetLocalesAction => ({\n type: \"SET_LOCALES\",\n payload: {\n locales,\n locale,\n },\n});\n"],"mappings":";;;;;;AACA,IAAAA,kBAAA,GAAAC,OAAA;AAMA;AACA;AACA;AACO,MAAMC,aAAa,GAAIC,MAAc,KAA0B;EACpEC,IAAI,EAAE,eAAe;EACrBC,OAAO,EAAEF;AACX,CAAC,CAAC;;AAEF;AACA;AACA;AAFAG,OAAA,CAAAJ,aAAA,GAAAA,aAAA;AAGO,MAAMK,YAAY,GACtBJ,MAAc,IACdK,QAAQ,IAAK;EACZA,QAAQ,CAAC,IAAAC,gCAAa,EAAC,CAAC,CAAC;EACzBD,QAAQ,CAACN,aAAa,CAACC,MAAM,CAAC,CAAC;EAC/BK,QAAQ,CAAC,IAAAE,iCAAc,EAAC,CAAC,CAAC;AAC5B,CAAC;;AAEH;AACA;AADAJ,OAAA,CAAAC,YAAA,GAAAA,YAAA;AAEO,MAAMI,UAAU,GAAGA,CACxBC,OAAgB,EAChBT,MAAc,MACQ;EACtBC,IAAI,EAAE,aAAa;EACnBC,OAAO,EAAE;IACPO,OAAO;IACPT;EACF;AACF,CAAC,CAAC;AAACG,OAAA,CAAAK,UAAA,GAAAA,UAAA","ignoreList":[]}
@@ -12,7 +12,11 @@ var _Locales = _interopRequireDefault(require("../../i18n/Locales"));
12
12
  */
13
13
  const updateLocale = (state, locale) => {
14
14
  // set locale in cookie
15
- (0, _Cookies.setCookie)("locale", locale);
15
+ if (state.locales?.length > 1) {
16
+ (0, _Cookies.setCookie)("locale", locale);
17
+ } else {
18
+ (0, _Cookies.clearCookie)("locale");
19
+ }
16
20
 
17
21
  // clear cache because of cached contributions
18
22
  _Cache.default.clear();
@@ -30,7 +34,11 @@ const setLocales = (state, _ref) => {
30
34
  locales
31
35
  } = _ref;
32
36
  // set locale in cookie
33
- (0, _Cookies.setCookie)("locale", locale);
37
+ if (state.locales.length > 1) {
38
+ (0, _Cookies.setCookie)("locale", locale);
39
+ } else {
40
+ (0, _Cookies.clearCookie)("locale");
41
+ }
34
42
  if (locale) {
35
43
  return {
36
44
  ...state,
@@ -1 +1 @@
1
- {"version":3,"file":"I18nReducer.js","names":["_Cache","_interopRequireDefault","require","_Cookies","_Locales","updateLocale","state","locale","setCookie","Cache","clear","setLocales","_ref","locales","getDefaultLocale","navigator","language","split","initialState","Locales","I18nReducer","arguments","length","undefined","action","type","payload","exports"],"sources":["../../../src/redux/_i18n/I18nReducer.js"],"sourcesContent":["// @flow\nimport Cache from \"../../utils/browser/Cache\";\nimport { setCookie } from \"../../utils/browser/Cookies\";\n\nimport Locales from \"../../i18n/Locales\";\n\nimport type { Reducer } from \"redux\";\nimport type { I18nState } from \"./types\";\nimport type { ReduxAction } from \"../types\";\n\n/**\n */\nconst updateLocale = (state: I18nState, locale: string) => {\n // set locale in cookie\n setCookie(\"locale\", locale);\n\n // clear cache because of cached contributions\n Cache.clear();\n\n return {\n ...state,\n locale,\n };\n};\n\n/**\n */\nconst setLocales = (\n state: I18nState,\n { locale, locales }: { locale: string, locales: Locales },\n) => {\n // set locale in cookie\n setCookie(\"locale\", locale);\n\n if (locale) {\n return {\n ...state,\n locales,\n locale,\n };\n }\n\n return {\n ...state,\n locales,\n };\n};\n\nconst getDefaultLocale = () => {\n if (typeof navigator !== \"undefined\" && navigator?.language) {\n return navigator?.language.split(\"-\")[0] || \"en\";\n }\n return \"en\";\n};\n\n// REDUCER\nconst initialState: I18nState = {\n locales: new Locales(),\n locale: getDefaultLocale(),\n};\n\n/**\n * Form reducer\n */\nexport const I18nReducer: Reducer<I18nState, ReduxAction> = (\n state = initialState,\n action = void 0,\n) => {\n if (!action) {\n return state;\n }\n\n switch (action.type) {\n case \"SET_LOCALES\":\n return setLocales(state, action.payload);\n\n case \"UPDATE_LOCALE\":\n return updateLocale(state, action.payload);\n\n default:\n return state;\n }\n};\n"],"mappings":";;;;;;;AACA,IAAAA,MAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,IAAAC,QAAA,GAAAD,OAAA;AAEA,IAAAE,QAAA,GAAAH,sBAAA,CAAAC,OAAA;AAMA;AACA;AACA,MAAMG,YAAY,GAAGA,CAACC,KAAgB,EAAEC,MAAc,KAAK;EACzD;EACA,IAAAC,kBAAS,EAAC,QAAQ,EAAED,MAAM,CAAC;;EAE3B;EACAE,cAAK,CAACC,KAAK,CAAC,CAAC;EAEb,OAAO;IACL,GAAGJ,KAAK;IACRC;EACF,CAAC;AACH,CAAC;;AAED;AACA;AACA,MAAMI,UAAU,GAAGA,CACjBL,KAAgB,EAAAM,IAAA,KAEb;EAAA,IADH;IAAEL,MAAM;IAAEM;EAA8C,CAAC,GAAAD,IAAA;EAEzD;EACA,IAAAJ,kBAAS,EAAC,QAAQ,EAAED,MAAM,CAAC;EAE3B,IAAIA,MAAM,EAAE;IACV,OAAO;MACL,GAAGD,KAAK;MACRO,OAAO;MACPN;IACF,CAAC;EACH;EAEA,OAAO;IACL,GAAGD,KAAK;IACRO;EACF,CAAC;AACH,CAAC;AAED,MAAMC,gBAAgB,GAAGA,CAAA,KAAM;EAC7B,IAAI,OAAOC,SAAS,KAAK,WAAW,IAAIA,SAAS,EAAEC,QAAQ,EAAE;IAC3D,OAAOD,SAAS,EAAEC,QAAQ,CAACC,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,IAAI,IAAI;EAClD;EACA,OAAO,IAAI;AACb,CAAC;;AAED;AACA,MAAMC,YAAuB,GAAG;EAC9BL,OAAO,EAAE,IAAIM,gBAAO,CAAC,CAAC;EACtBZ,MAAM,EAAEO,gBAAgB,CAAC;AAC3B,CAAC;;AAED;AACA;AACA;AACO,MAAMM,WAA4C,GAAG,SAAAA,CAAA,EAGvD;EAAA,IAFHd,KAAK,GAAAe,SAAA,CAAAC,MAAA,QAAAD,SAAA,QAAAE,SAAA,GAAAF,SAAA,MAAGH,YAAY;EAAA,IACpBM,MAAM,GAAAH,SAAA,CAAAC,MAAA,QAAAD,SAAA,QAAAE,SAAA,GAAAF,SAAA,MAAG,KAAK,CAAC;EAEf,IAAI,CAACG,MAAM,EAAE;IACX,OAAOlB,KAAK;EACd;EAEA,QAAQkB,MAAM,CAACC,IAAI;IACjB,KAAK,aAAa;MAChB,OAAOd,UAAU,CAACL,KAAK,EAAEkB,MAAM,CAACE,OAAO,CAAC;IAE1C,KAAK,eAAe;MAClB,OAAOrB,YAAY,CAACC,KAAK,EAAEkB,MAAM,CAACE,OAAO,CAAC;IAE5C;MACE,OAAOpB,KAAK;EAChB;AACF,CAAC;AAACqB,OAAA,CAAAP,WAAA,GAAAA,WAAA","ignoreList":[]}
1
+ {"version":3,"file":"I18nReducer.js","names":["_Cache","_interopRequireDefault","require","_Cookies","_Locales","updateLocale","state","locale","locales","length","setCookie","clearCookie","Cache","clear","setLocales","_ref","getDefaultLocale","navigator","language","split","initialState","Locales","I18nReducer","arguments","undefined","action","type","payload","exports"],"sources":["../../../src/redux/_i18n/I18nReducer.js"],"sourcesContent":["// @flow\nimport Cache from \"../../utils/browser/Cache\";\nimport { setCookie, clearCookie } from \"../../utils/browser/Cookies\";\n\nimport Locales from \"../../i18n/Locales\";\n\nimport type { Reducer } from \"redux\";\nimport type { I18nState } from \"./types\";\nimport type { ReduxAction } from \"../types\";\n\n/**\n */\nconst updateLocale = (state: I18nState, locale: string) => {\n // set locale in cookie\n if (state.locales?.length > 1) {\n setCookie(\"locale\", locale);\n } else {\n clearCookie(\"locale\");\n }\n\n // clear cache because of cached contributions\n Cache.clear();\n\n return {\n ...state,\n locale,\n };\n};\n\n/**\n */\nconst setLocales = (\n state: I18nState,\n { locale, locales }: { locale: string, locales: Locales },\n) => {\n // set locale in cookie\n if (state.locales.length > 1) {\n setCookie(\"locale\", locale);\n } else {\n clearCookie(\"locale\");\n }\n\n if (locale) {\n return {\n ...state,\n locales,\n locale,\n };\n }\n\n return {\n ...state,\n locales,\n };\n};\n\nconst getDefaultLocale = () => {\n if (typeof navigator !== \"undefined\" && navigator?.language) {\n return navigator?.language.split(\"-\")[0] || \"en\";\n }\n return \"en\";\n};\n\n// REDUCER\nconst initialState: I18nState = {\n locales: new Locales(),\n locale: getDefaultLocale(),\n};\n\n/**\n * Form reducer\n */\nexport const I18nReducer: Reducer<I18nState, ReduxAction> = (\n state = initialState,\n action = void 0,\n) => {\n if (!action) {\n return state;\n }\n\n switch (action.type) {\n case \"SET_LOCALES\":\n return setLocales(state, action.payload);\n\n case \"UPDATE_LOCALE\":\n return updateLocale(state, action.payload);\n\n default:\n return state;\n }\n};\n"],"mappings":";;;;;;;AACA,IAAAA,MAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,IAAAC,QAAA,GAAAD,OAAA;AAEA,IAAAE,QAAA,GAAAH,sBAAA,CAAAC,OAAA;AAMA;AACA;AACA,MAAMG,YAAY,GAAGA,CAACC,KAAgB,EAAEC,MAAc,KAAK;EACzD;EACA,IAAID,KAAK,CAACE,OAAO,EAAEC,MAAM,GAAG,CAAC,EAAE;IAC7B,IAAAC,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,MAAA,QAAAc,SAAA,QAAAC,SAAA,GAAAD,SAAA,MAAG,KAAK,CAAC;EAEf,IAAI,CAACE,MAAM,EAAE;IACX,OAAOnB,KAAK;EACd;EAEA,QAAQmB,MAAM,CAACC,IAAI;IACjB,KAAK,aAAa;MAChB,OAAOZ,UAAU,CAACR,KAAK,EAAEmB,MAAM,CAACE,OAAO,CAAC;IAE1C,KAAK,eAAe;MAClB,OAAOtB,YAAY,CAACC,KAAK,EAAEmB,MAAM,CAACE,OAAO,CAAC;IAE5C;MACE,OAAOrB,KAAK;EAChB;AACF,CAAC;AAACsB,OAAA,CAAAN,WAAA,GAAAA,WAAA","ignoreList":[]}
@@ -18,6 +18,7 @@ var _PreferencesReducer = _interopRequireDefault(require("./PreferencesReducer")
18
18
  /**
19
19
  */
20
20
  const createReducer = () => ({
21
+ preferences: _PreferencesReducer.default,
21
22
  router: _RouterReducer.RouterReducer,
22
23
  modularui: _ModularUIReducer.ModularUIReducer,
23
24
  i18n: _I18nReducer.I18nReducer,
@@ -26,8 +27,7 @@ const createReducer = () => ({
26
27
  modals: _ModalsReducer.default,
27
28
  modelcatalog: _ModelCatalogReducer.default,
28
29
  notification: _NotificationReducer.default,
29
- progressindicator: _ProgressIndicatorReducer.default,
30
- preferences: _PreferencesReducer.default
30
+ progressindicator: _ProgressIndicatorReducer.default
31
31
  });
32
32
  exports.createReducer = createReducer;
33
33
  //# sourceMappingURL=createReducer.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"createReducer.js","names":["_RouterReducer","require","_ModularUIReducer","_I18nReducer","_ModalsReducer","_interopRequireDefault","_AuthReducer","_ErrorReducer","_ModelCatalogReducer","_NotificationReducer","_ProgressIndicatorReducer","_PreferencesReducer","createReducer","router","RouterReducer","modularui","ModularUIReducer","i18n","I18nReducer","auth","AuthReducer","error","ErrorReducer","modals","ModalsReducer","modelcatalog","ModelCatalogReducer","notification","NotificationReducer","progressindicator","ProgressIndicatorReducer","preferences","PreferencesReducer","exports"],"sources":["../../../src/redux/reducers/createReducer.js"],"sourcesContent":["// @flow\nimport { RouterReducer } from \"../_router/RouterReducer\";\nimport { ModularUIReducer } from \"../_modularui/ModularUIReducer\";\nimport { I18nReducer } from \"../_i18n/I18nReducer\";\n\nimport ModalsReducer from \"./ModalsReducer\";\nimport AuthReducer from \"./AuthReducer\";\nimport ErrorReducer from \"./ErrorReducer\";\nimport ModelCatalogReducer from \"./ModelCatalogReducer\";\nimport NotificationReducer from \"./NotificationReducer\";\nimport ProgressIndicatorReducer from \"./ProgressIndicatorReducer\";\nimport PreferencesReducer from \"./PreferencesReducer\";\n\nimport type { Reducer } from \"redux\";\nimport type {\n ReduxAction,\n ProgressIndicatorState,\n PreferencesState,\n NotificationState,\n ModalsState,\n ErrorState,\n AuthState,\n ModelCatalogState,\n} from \"../types\";\nimport type { RouterState } from \"../_router/types\";\nimport type { ModularUIState } from \"../_modularui/types\";\nimport type { I18nState } from \"../_i18n/types\";\n\ntype Reducers = {\n auth: Reducer<AuthState, ReduxAction>,\n error: Reducer<ErrorState, ReduxAction>,\n i18n: Reducer<I18nState, ReduxAction>,\n modals: Reducer<ModalsState, ReduxAction>,\n modelcatalog: Reducer<ModelCatalogState, ReduxAction>,\n modularui: Reducer<ModularUIState, ReduxAction>,\n notification: Reducer<NotificationState, ReduxAction>,\n preferences: Reducer<PreferencesState, ReduxAction>,\n progressindicator: Reducer<ProgressIndicatorState, ReduxAction>,\n router: Reducer<RouterState, ReduxAction>,\n};\n\n/**\n */\nexport const createReducer = (): Reducers => ({\n router: RouterReducer,\n modularui: ModularUIReducer,\n i18n: I18nReducer,\n auth: AuthReducer,\n error: ErrorReducer,\n modals: ModalsReducer,\n modelcatalog: ModelCatalogReducer,\n notification: NotificationReducer,\n progressindicator: ProgressIndicatorReducer,\n preferences: PreferencesReducer,\n});\n"],"mappings":";;;;;;;AACA,IAAAA,cAAA,GAAAC,OAAA;AACA,IAAAC,iBAAA,GAAAD,OAAA;AACA,IAAAE,YAAA,GAAAF,OAAA;AAEA,IAAAG,cAAA,GAAAC,sBAAA,CAAAJ,OAAA;AACA,IAAAK,YAAA,GAAAD,sBAAA,CAAAJ,OAAA;AACA,IAAAM,aAAA,GAAAF,sBAAA,CAAAJ,OAAA;AACA,IAAAO,oBAAA,GAAAH,sBAAA,CAAAJ,OAAA;AACA,IAAAQ,oBAAA,GAAAJ,sBAAA,CAAAJ,OAAA;AACA,IAAAS,yBAAA,GAAAL,sBAAA,CAAAJ,OAAA;AACA,IAAAU,mBAAA,GAAAN,sBAAA,CAAAJ,OAAA;AA8BA;AACA;AACO,MAAMW,aAAa,GAAGA,CAAA,MAAiB;EAC5CC,MAAM,EAAEC,4BAAa;EACrBC,SAAS,EAAEC,kCAAgB;EAC3BC,IAAI,EAAEC,wBAAW;EACjBC,IAAI,EAAEC,oBAAW;EACjBC,KAAK,EAAEC,qBAAY;EACnBC,MAAM,EAAEC,sBAAa;EACrBC,YAAY,EAAEC,4BAAmB;EACjCC,YAAY,EAAEC,4BAAmB;EACjCC,iBAAiB,EAAEC,iCAAwB;EAC3CC,WAAW,EAAEC;AACf,CAAC,CAAC;AAACC,OAAA,CAAArB,aAAA,GAAAA,aAAA","ignoreList":[]}
1
+ {"version":3,"file":"createReducer.js","names":["_RouterReducer","require","_ModularUIReducer","_I18nReducer","_ModalsReducer","_interopRequireDefault","_AuthReducer","_ErrorReducer","_ModelCatalogReducer","_NotificationReducer","_ProgressIndicatorReducer","_PreferencesReducer","createReducer","preferences","PreferencesReducer","router","RouterReducer","modularui","ModularUIReducer","i18n","I18nReducer","auth","AuthReducer","error","ErrorReducer","modals","ModalsReducer","modelcatalog","ModelCatalogReducer","notification","NotificationReducer","progressindicator","ProgressIndicatorReducer","exports"],"sources":["../../../src/redux/reducers/createReducer.js"],"sourcesContent":["// @flow\nimport { RouterReducer } from \"../_router/RouterReducer\";\nimport { ModularUIReducer } from \"../_modularui/ModularUIReducer\";\nimport { I18nReducer } from \"../_i18n/I18nReducer\";\n\nimport ModalsReducer from \"./ModalsReducer\";\nimport AuthReducer from \"./AuthReducer\";\nimport ErrorReducer from \"./ErrorReducer\";\nimport ModelCatalogReducer from \"./ModelCatalogReducer\";\nimport NotificationReducer from \"./NotificationReducer\";\nimport ProgressIndicatorReducer from \"./ProgressIndicatorReducer\";\nimport PreferencesReducer from \"./PreferencesReducer\";\n\nimport type { Reducer } from \"redux\";\nimport type {\n ReduxAction,\n ProgressIndicatorState,\n PreferencesState,\n NotificationState,\n ModalsState,\n ErrorState,\n AuthState,\n ModelCatalogState,\n} from \"../types\";\nimport type { RouterState } from \"../_router/types\";\nimport type { ModularUIState } from \"../_modularui/types\";\nimport type { I18nState } from \"../_i18n/types\";\n\ntype Reducers = {\n auth: Reducer<AuthState, ReduxAction>,\n error: Reducer<ErrorState, ReduxAction>,\n i18n: Reducer<I18nState, ReduxAction>,\n modals: Reducer<ModalsState, ReduxAction>,\n modelcatalog: Reducer<ModelCatalogState, ReduxAction>,\n modularui: Reducer<ModularUIState, ReduxAction>,\n notification: Reducer<NotificationState, ReduxAction>,\n preferences: Reducer<PreferencesState, ReduxAction>,\n progressindicator: Reducer<ProgressIndicatorState, ReduxAction>,\n router: Reducer<RouterState, ReduxAction>,\n};\n\n/**\n */\nexport const createReducer = (): Reducers => ({\n preferences: PreferencesReducer,\n router: RouterReducer,\n modularui: ModularUIReducer,\n i18n: I18nReducer,\n auth: AuthReducer,\n error: ErrorReducer,\n modals: ModalsReducer,\n modelcatalog: ModelCatalogReducer,\n notification: NotificationReducer,\n progressindicator: ProgressIndicatorReducer,\n});\n"],"mappings":";;;;;;;AACA,IAAAA,cAAA,GAAAC,OAAA;AACA,IAAAC,iBAAA,GAAAD,OAAA;AACA,IAAAE,YAAA,GAAAF,OAAA;AAEA,IAAAG,cAAA,GAAAC,sBAAA,CAAAJ,OAAA;AACA,IAAAK,YAAA,GAAAD,sBAAA,CAAAJ,OAAA;AACA,IAAAM,aAAA,GAAAF,sBAAA,CAAAJ,OAAA;AACA,IAAAO,oBAAA,GAAAH,sBAAA,CAAAJ,OAAA;AACA,IAAAQ,oBAAA,GAAAJ,sBAAA,CAAAJ,OAAA;AACA,IAAAS,yBAAA,GAAAL,sBAAA,CAAAJ,OAAA;AACA,IAAAU,mBAAA,GAAAN,sBAAA,CAAAJ,OAAA;AA8BA;AACA;AACO,MAAMW,aAAa,GAAGA,CAAA,MAAiB;EAC5CC,WAAW,EAAEC,2BAAkB;EAC/BC,MAAM,EAAEC,4BAAa;EACrBC,SAAS,EAAEC,kCAAgB;EAC3BC,IAAI,EAAEC,wBAAW;EACjBC,IAAI,EAAEC,oBAAW;EACjBC,KAAK,EAAEC,qBAAY;EACnBC,MAAM,EAAEC,sBAAa;EACrBC,YAAY,EAAEC,4BAAmB;EACjCC,YAAY,EAAEC,4BAAmB;EACjCC,iBAAiB,EAAEC;AACrB,CAAC,CAAC;AAACC,OAAA,CAAArB,aAAA,GAAAA,aAAA","ignoreList":[]}
@@ -11,7 +11,6 @@ var _RouterMiddleware = require("../_router/RouterMiddleware");
11
11
  var _ModularUIMiddleware = require("../_modularui/ModularUIMiddleware");
12
12
  var _createReducer = require("../reducers/createReducer");
13
13
  var _RouterActions = require("../_router/RouterActions");
14
- var _I18nActions = require("../_i18n/I18nActions");
15
14
  /**
16
15
  */
17
16
  const configureStore = (routerHistory, customReducers, initialState) => {
@@ -29,10 +28,6 @@ const configureStore = (routerHistory, customReducers, initialState) => {
29
28
  if (!initialState?.router) {
30
29
  store.dispatch((0, _RouterActions.locationChange)(routerHistory.location, "PUSH"));
31
30
  }
32
- const locale = initialState?.i18n.locale;
33
- if (locale) {
34
- store.dispatch((0, _I18nActions.updateLocale)(locale));
35
- }
36
31
  return {
37
32
  routerHistory,
38
33
  store
@@ -1 +1 @@
1
- {"version":3,"file":"configureStore.js","names":["_redux","require","_reduxThunk","_interopRequireDefault","_RouterMiddleware","_ModularUIMiddleware","_createReducer","_RouterActions","_I18nActions","configureStore","routerHistory","customReducers","initialState","composeEnhancers","compose","process","env","NODE_ENV","window","__REDUX_DEVTOOLS_EXTENSION_COMPOSE__","combinedReducers","combineReducers","createReducer","middleware","applyMiddleware","modularUIMiddleware","routerMiddleware","thunk","enhancers","store","createReduxStore","router","dispatch","locationChange","location","locale","i18n","updateLocale","_default","exports","default"],"sources":["../../../src/redux/store/configureStore.js"],"sourcesContent":["// @flow\nimport {\n applyMiddleware,\n compose,\n combineReducers,\n createStore as createReduxStore,\n} from \"redux\";\nimport thunk from \"redux-thunk\";\n\nimport { routerMiddleware } from \"../_router/RouterMiddleware\";\nimport { modularUIMiddleware } from \"../_modularui/ModularUIMiddleware\";\n\nimport { createReducer } from \"../reducers/createReducer\";\nimport { locationChange } from \"../_router/RouterActions\";\n\nimport { updateLocale } from \"../_i18n/I18nActions\";\n\nimport type { RouterHistory } from \"react-router\";\nimport type { ReduxAction, ReduxState, ReduxStore } from \"../types\";\nimport type { Reducer } from \"redux\";\n\n/**\n */\nconst configureStore = (\n routerHistory: RouterHistory,\n customReducers?: Object,\n initialState?: $Shape<ReduxState>,\n): { routerHistory: RouterHistory, store: ReduxStore } => {\n let composeEnhancers = compose;\n\n if (process.env.NODE_ENV !== \"production\" && typeof window !== \"undefined\") {\n composeEnhancers = window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__ || compose;\n }\n\n const combinedReducers: Reducer<ReduxState, ReduxAction> = combineReducers({\n ...customReducers,\n ...createReducer(),\n });\n\n const middleware = applyMiddleware(\n modularUIMiddleware,\n routerMiddleware(routerHistory),\n thunk,\n );\n\n const enhancers = composeEnhancers(middleware);\n\n const store: ReduxStore = createReduxStore(\n combinedReducers,\n initialState,\n enhancers,\n );\n\n if (!initialState?.router) {\n store.dispatch(locationChange(routerHistory.location, \"PUSH\"));\n }\n\n const locale = initialState?.i18n.locale;\n if (locale) {\n store.dispatch(updateLocale(locale));\n }\n\n return { routerHistory, store };\n};\n\nexport default configureStore;\n"],"mappings":";;;;;;;AACA,IAAAA,MAAA,GAAAC,OAAA;AAMA,IAAAC,WAAA,GAAAC,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,GAAAC,OAAA,CAAAC,OAAA,GAEa/B,cAAc","ignoreList":[]}
1
+ {"version":3,"file":"configureStore.js","names":["_redux","require","_reduxThunk","_interopRequireDefault","_RouterMiddleware","_ModularUIMiddleware","_createReducer","_RouterActions","configureStore","routerHistory","customReducers","initialState","composeEnhancers","compose","process","env","NODE_ENV","window","__REDUX_DEVTOOLS_EXTENSION_COMPOSE__","combinedReducers","combineReducers","createReducer","middleware","applyMiddleware","modularUIMiddleware","routerMiddleware","thunk","enhancers","store","createReduxStore","router","dispatch","locationChange","location","_default","exports","default"],"sources":["../../../src/redux/store/configureStore.js"],"sourcesContent":["// @flow\nimport {\n applyMiddleware,\n compose,\n combineReducers,\n createStore as createReduxStore,\n} from \"redux\";\nimport thunk from \"redux-thunk\";\n\nimport { routerMiddleware } from \"../_router/RouterMiddleware\";\nimport { modularUIMiddleware } from \"../_modularui/ModularUIMiddleware\";\n\nimport { createReducer } from \"../reducers/createReducer\";\nimport { locationChange } from \"../_router/RouterActions\";\n\nimport type { RouterHistory } from \"react-router\";\nimport type { ReduxAction, ReduxState, ReduxStore } from \"../types\";\nimport type { Reducer } from \"redux\";\n\n/**\n */\nconst configureStore = (\n routerHistory: RouterHistory,\n customReducers?: Object,\n initialState?: $Shape<ReduxState>,\n): { routerHistory: RouterHistory, store: ReduxStore } => {\n let composeEnhancers = compose;\n\n if (process.env.NODE_ENV !== \"production\" && typeof window !== \"undefined\") {\n composeEnhancers = window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__ || compose;\n }\n\n const combinedReducers: Reducer<ReduxState, ReduxAction> = combineReducers({\n ...customReducers,\n ...createReducer(),\n });\n\n const middleware = applyMiddleware(\n modularUIMiddleware,\n routerMiddleware(routerHistory),\n thunk,\n );\n\n const enhancers = composeEnhancers(middleware);\n\n const store: ReduxStore = createReduxStore(\n combinedReducers,\n initialState,\n enhancers,\n );\n\n if (!initialState?.router) {\n store.dispatch(locationChange(routerHistory.location, \"PUSH\"));\n }\n\n return { routerHistory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**
106
106
  */
107
107
  getLocale() {
108
- const locale = (0, _Cookies.getCookie)("locale") ?? "en";
108
+ const defaultLocale = (0, _constants.getEnabledLocales)()[0];
109
+ const locale = (0, _Cookies.getCookie)("locale") ?? defaultLocale ?? "en";
109
110
  if (locale === "nl") {
110
111
  return _locale.nl;
111
112
  }