@beinformed/ui 1.63.2 → 1.63.3

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 (460) hide show
  1. package/CHANGELOG.md +7 -0
  2. package/esm/constants/Settings.js +3 -14
  3. package/esm/constants/Settings.js.map +1 -1
  4. package/esm/exceptions/NotFoundException.js +1 -2
  5. package/esm/exceptions/NotFoundException.js.map +1 -1
  6. package/esm/hooks/useI18n.js +1 -6
  7. package/esm/hooks/useI18n.js.map +1 -1
  8. package/esm/hooks/useModal.js +3 -4
  9. package/esm/hooks/useModal.js.map +1 -1
  10. package/esm/hooks/useModelCatalog.js +10 -30
  11. package/esm/hooks/useModelCatalog.js.map +1 -1
  12. package/esm/hooks/useModularUI.js +4 -5
  13. package/esm/hooks/useModularUI.js.map +1 -1
  14. package/esm/hooks/useModularUIBasic.js +7 -8
  15. package/esm/hooks/useModularUIBasic.js.map +1 -1
  16. package/esm/i18n/Locale.js +2 -5
  17. package/esm/i18n/Locale.js.map +1 -1
  18. package/esm/i18n/Locales.js +2 -5
  19. package/esm/i18n/Locales.js.map +1 -1
  20. package/esm/i18n/Message.js +9 -10
  21. package/esm/i18n/Message.js.map +1 -1
  22. package/esm/i18n/withMessage.js +1 -6
  23. package/esm/i18n/withMessage.js.map +1 -1
  24. package/esm/models/actions/ActionCollection.js +3 -6
  25. package/esm/models/actions/ActionCollection.js.map +1 -1
  26. package/esm/models/actions/ActionModel.js +1 -4
  27. package/esm/models/actions/ActionModel.js.map +1 -1
  28. package/esm/models/application/ApplicationModel.js +2 -2
  29. package/esm/models/application/ApplicationModel.js.map +1 -1
  30. package/esm/models/attributes/AttributeCollection.js +4 -14
  31. package/esm/models/attributes/AttributeCollection.js.map +1 -1
  32. package/esm/models/attributes/AttributeDataHelper.js +1 -2
  33. package/esm/models/attributes/AttributeDataHelper.js.map +1 -1
  34. package/esm/models/attributes/AttributeSetModel.js +1 -5
  35. package/esm/models/attributes/AttributeSetModel.js.map +1 -1
  36. package/esm/models/attributes/CaptchaAttributeModel.js +2 -2
  37. package/esm/models/attributes/CaptchaAttributeModel.js.map +1 -1
  38. package/esm/models/attributes/ChoiceAttributeModel.js +1 -3
  39. package/esm/models/attributes/ChoiceAttributeModel.js.map +1 -1
  40. package/esm/models/attributes/ChoiceAttributeOptionCollection.js +3 -9
  41. package/esm/models/attributes/ChoiceAttributeOptionCollection.js.map +1 -1
  42. package/esm/models/attributes/ChoiceAttributeOptionModel.js +2 -8
  43. package/esm/models/attributes/ChoiceAttributeOptionModel.js.map +1 -1
  44. package/esm/models/attributes/PasswordAttributeModel.js +2 -2
  45. package/esm/models/attributes/PasswordAttributeModel.js.map +1 -1
  46. package/esm/models/attributes/UploadAttributeModel.js +2 -2
  47. package/esm/models/attributes/UploadAttributeModel.js.map +1 -1
  48. package/esm/models/attributes/input-constraints/ConstraintCollection.js +1 -2
  49. package/esm/models/attributes/input-constraints/ConstraintCollection.js.map +1 -1
  50. package/esm/models/attributes/input-constraints/ConstraintModel.js +1 -2
  51. package/esm/models/attributes/input-constraints/ConstraintModel.js.map +1 -1
  52. package/esm/models/attributes/input-constraints/DateBoundaryConstraint.js +1 -4
  53. package/esm/models/attributes/input-constraints/DateBoundaryConstraint.js.map +1 -1
  54. package/esm/models/attributes/input-constraints/NumberBoundaryConstraint.js +1 -6
  55. package/esm/models/attributes/input-constraints/NumberBoundaryConstraint.js.map +1 -1
  56. package/esm/models/attributes/input-constraints/NumberGroupingConstraint.js +1 -4
  57. package/esm/models/attributes/input-constraints/NumberGroupingConstraint.js.map +1 -1
  58. package/esm/models/attributes/input-constraints/PasswordThreeConsecutiveCharactersNotAllowedConstraint.js +1 -2
  59. package/esm/models/attributes/input-constraints/PasswordThreeConsecutiveCharactersNotAllowedConstraint.js.map +1 -1
  60. package/esm/models/attributes/layouthint-rules/DependentAttribute.js +2 -2
  61. package/esm/models/attributes/layouthint-rules/DependentAttribute.js.map +1 -1
  62. package/esm/models/base/BaseCollection.js +1 -2
  63. package/esm/models/base/BaseCollection.js.map +1 -1
  64. package/esm/models/base/BaseModel.js +6 -9
  65. package/esm/models/base/BaseModel.js.map +1 -1
  66. package/esm/models/base/ResourceModel.js +1 -2
  67. package/esm/models/base/ResourceModel.js.map +1 -1
  68. package/esm/models/concepts/BusinessScenarioModel.js +2 -2
  69. package/esm/models/concepts/BusinessScenarioModel.js.map +1 -1
  70. package/esm/models/concepts/ConceptDetailModel.js +1 -2
  71. package/esm/models/concepts/ConceptDetailModel.js.map +1 -1
  72. package/esm/models/concepts/ConceptLinkModel.js +1 -3
  73. package/esm/models/concepts/ConceptLinkModel.js.map +1 -1
  74. package/esm/models/concepts/ConceptRelationCollection.js +1 -4
  75. package/esm/models/concepts/ConceptRelationCollection.js.map +1 -1
  76. package/esm/models/concepts/ConceptRelationModel.js +1 -3
  77. package/esm/models/concepts/ConceptRelationModel.js.map +1 -1
  78. package/esm/models/concepts/SourceReferenceCollection.js +1 -4
  79. package/esm/models/concepts/SourceReferenceCollection.js.map +1 -1
  80. package/esm/models/concepts/SourceReferenceModel.js +7 -3
  81. package/esm/models/concepts/SourceReferenceModel.js.flow +6 -0
  82. package/esm/models/concepts/SourceReferenceModel.js.map +1 -1
  83. package/esm/models/content/ContentLinkModel.js +1 -3
  84. package/esm/models/content/ContentLinkModel.js.map +1 -1
  85. package/esm/models/content/ContentTOCModel.js +2 -2
  86. package/esm/models/content/ContentTOCModel.js.map +1 -1
  87. package/esm/models/contentconfiguration/ContentConfigurationElements.js +1 -2
  88. package/esm/models/contentconfiguration/ContentConfigurationElements.js.map +1 -1
  89. package/esm/models/error/ErrorModel.js +1 -3
  90. package/esm/models/error/ErrorModel.js.map +1 -1
  91. package/esm/models/filters/FilterCollection.js +1 -4
  92. package/esm/models/filters/FilterCollection.js.map +1 -1
  93. package/esm/models/form/FormModel.js +3 -9
  94. package/esm/models/form/FormModel.js.map +1 -1
  95. package/esm/models/form/FormObjectModel.js +2 -4
  96. package/esm/models/form/FormObjectModel.js.map +1 -1
  97. package/esm/models/href/Href.js +3 -6
  98. package/esm/models/href/Href.js.map +1 -1
  99. package/esm/models/href/ListHref.js +1 -2
  100. package/esm/models/href/ListHref.js.map +1 -1
  101. package/esm/models/layouthint/LayoutHintCollection.js +3 -10
  102. package/esm/models/layouthint/LayoutHintCollection.js.map +1 -1
  103. package/esm/models/links/LinkCollection.js +6 -15
  104. package/esm/models/links/LinkCollection.js.map +1 -1
  105. package/esm/models/list/ListModel.js +2 -2
  106. package/esm/models/list/ListModel.js.map +1 -1
  107. package/esm/models/modelcatalog/ModelCategoryCollection.js +1 -2
  108. package/esm/models/modelcatalog/ModelCategoryCollection.js.map +1 -1
  109. package/esm/models/parameter/Parameter.js +2 -4
  110. package/esm/models/parameter/Parameter.js.map +1 -1
  111. package/esm/models/resolveModel.js +1 -2
  112. package/esm/models/resolveModel.js.map +1 -1
  113. package/esm/models/sorting/SortingModel.js +1 -2
  114. package/esm/models/sorting/SortingModel.js.map +1 -1
  115. package/esm/models/user/UserServicesModel.js +2 -2
  116. package/esm/models/user/UserServicesModel.js.map +1 -1
  117. package/esm/modularui/ModularUIRequest.js +1 -2
  118. package/esm/modularui/ModularUIRequest.js.map +1 -1
  119. package/esm/react/ErrorBoundary.js +2 -2
  120. package/esm/react/ErrorBoundary.js.map +1 -1
  121. package/esm/react/ErrorBoundaryFallback.js +13 -16
  122. package/esm/react/ErrorBoundaryFallback.js.map +1 -1
  123. package/esm/react/utils.js +1 -3
  124. package/esm/react/utils.js.map +1 -1
  125. package/esm/react-client/Init.js +20 -23
  126. package/esm/react-client/Init.js.map +1 -1
  127. package/esm/react-client/client.js +9 -13
  128. package/esm/react-client/client.js.map +1 -1
  129. package/esm/react-server/renderSSRComplete.js +9 -10
  130. package/esm/react-server/renderSSRComplete.js.map +1 -1
  131. package/esm/react-server/renderSSRMinimal.js +7 -8
  132. package/esm/react-server/renderSSRMinimal.js.map +1 -1
  133. package/esm/react-server/serverNoSSR.js +11 -12
  134. package/esm/react-server/serverNoSSR.js.map +1 -1
  135. package/esm/react-server/serverSSR.js +11 -12
  136. package/esm/react-server/serverSSR.js.map +1 -1
  137. package/esm/react-server/serverUtil.js +1 -3
  138. package/esm/react-server/serverUtil.js.map +1 -1
  139. package/esm/react-theme/ThemeProvider.js +7 -11
  140. package/esm/react-theme/ThemeProvider.js.map +1 -1
  141. package/esm/react-theme/createTheme.js +3 -10
  142. package/esm/react-theme/createTheme.js.map +1 -1
  143. package/esm/react-theme/utils/background.js +3 -4
  144. package/esm/react-theme/utils/background.js.map +1 -1
  145. package/esm/react-theme/utils/colors.js +7 -16
  146. package/esm/react-theme/utils/colors.js.map +1 -1
  147. package/esm/react-theme/utils/contrast.js +11 -19
  148. package/esm/react-theme/utils/contrast.js.map +1 -1
  149. package/esm/react-theme/utils/corners.js +10 -16
  150. package/esm/react-theme/utils/corners.js.map +1 -1
  151. package/esm/react-theme/utils/spacers.js +15 -38
  152. package/esm/react-theme/utils/spacers.js.map +1 -1
  153. package/esm/react-theme/utils/themeProps.js +7 -22
  154. package/esm/react-theme/utils/themeProps.js.map +1 -1
  155. package/esm/redux/_i18n/I18nReducer.js +5 -8
  156. package/esm/redux/_i18n/I18nReducer.js.map +1 -1
  157. package/esm/redux/_modularui/ModularUIActions.js +19 -23
  158. package/esm/redux/_modularui/ModularUIActions.js.map +1 -1
  159. package/esm/redux/_modularui/ModularUIConnector.js +4 -5
  160. package/esm/redux/_modularui/ModularUIConnector.js.map +1 -1
  161. package/esm/redux/_modularui/ModularUIReducer.js +14 -19
  162. package/esm/redux/_modularui/ModularUIReducer.js.map +1 -1
  163. package/esm/redux/_modularui/ModularUIUtils.js +1 -2
  164. package/esm/redux/_modularui/ModularUIUtils.js.map +1 -1
  165. package/esm/redux/_modularui/withModularUI.js +1 -2
  166. package/esm/redux/_modularui/withModularUI.js.map +1 -1
  167. package/esm/redux/_router/RouterReducer.js +1 -3
  168. package/esm/redux/_router/RouterReducer.js.map +1 -1
  169. package/esm/redux/actions/FormAttributeSet.js +34 -37
  170. package/esm/redux/actions/FormAttributeSet.js.map +1 -1
  171. package/esm/redux/actions/FormAutosubmit.js +1 -2
  172. package/esm/redux/actions/FormAutosubmit.js.map +1 -1
  173. package/esm/redux/actions/Preferences.js +8 -15
  174. package/esm/redux/actions/Preferences.js.map +1 -1
  175. package/esm/redux/connectors/CaseView.js +3 -6
  176. package/esm/redux/connectors/CaseView.js.map +1 -1
  177. package/esm/redux/connectors/ConceptDetail.js +4 -7
  178. package/esm/redux/connectors/ConceptDetail.js.map +1 -1
  179. package/esm/redux/connectors/ContentBrowser.js +3 -6
  180. package/esm/redux/connectors/ContentBrowser.js.map +1 -1
  181. package/esm/redux/connectors/ContentDetail.js +4 -7
  182. package/esm/redux/connectors/ContentDetail.js.map +1 -1
  183. package/esm/redux/connectors/ContentDetailSection.js +5 -8
  184. package/esm/redux/connectors/ContentDetailSection.js.map +1 -1
  185. package/esm/redux/connectors/Form.js +4 -5
  186. package/esm/redux/connectors/Form.js.map +1 -1
  187. package/esm/redux/connectors/FormAttributeSet.js +5 -8
  188. package/esm/redux/connectors/FormAttributeSet.js.map +1 -1
  189. package/esm/redux/connectors/ListDetail.js +3 -6
  190. package/esm/redux/connectors/ListDetail.js.map +1 -1
  191. package/esm/redux/connectors/ModelCatalog.js +3 -6
  192. package/esm/redux/connectors/ModelCatalog.js.map +1 -1
  193. package/esm/redux/connectors/PanelRenderer.js +5 -6
  194. package/esm/redux/connectors/PanelRenderer.js.map +1 -1
  195. package/esm/redux/connectors/QuickSearch.js +3 -6
  196. package/esm/redux/connectors/QuickSearch.js.map +1 -1
  197. package/esm/redux/connectors/Tab.js +3 -6
  198. package/esm/redux/connectors/Tab.js.map +1 -1
  199. package/esm/redux/reducers/AuthReducer.js +1 -3
  200. package/esm/redux/reducers/AuthReducer.js.map +1 -1
  201. package/esm/redux/reducers/ErrorReducer.js +1 -3
  202. package/esm/redux/reducers/ErrorReducer.js.map +1 -1
  203. package/esm/redux/reducers/ModalsReducer.js +1 -3
  204. package/esm/redux/reducers/ModalsReducer.js.map +1 -1
  205. package/esm/redux/reducers/ModelCatalogReducer.js +1 -3
  206. package/esm/redux/reducers/ModelCatalogReducer.js.map +1 -1
  207. package/esm/redux/reducers/NotificationReducer.js +1 -3
  208. package/esm/redux/reducers/NotificationReducer.js.map +1 -1
  209. package/esm/redux/reducers/PreferencesReducer.js +1 -3
  210. package/esm/redux/reducers/PreferencesReducer.js.map +1 -1
  211. package/esm/redux/reducers/ProgressIndicatorReducer.js +1 -3
  212. package/esm/redux/reducers/ProgressIndicatorReducer.js.map +1 -1
  213. package/esm/redux/store/beforeRenderHooks.js +1 -3
  214. package/esm/redux/store/beforeRenderHooks.js.map +1 -1
  215. package/esm/utils/browser/Cache.js +1 -5
  216. package/esm/utils/browser/Cache.js.map +1 -1
  217. package/esm/utils/datetime/DateTimeUtil.js +45 -91
  218. package/esm/utils/datetime/DateTimeUtil.js.map +1 -1
  219. package/esm/utils/fetch/xhr.js +1 -2
  220. package/esm/utils/fetch/xhr.js.map +1 -1
  221. package/esm/utils/helpers/repositoryResource.js +1 -3
  222. package/esm/utils/helpers/repositoryResource.js.map +1 -1
  223. package/esm/utils/helpers/sanitizeHtml.js +3 -4
  224. package/esm/utils/helpers/sanitizeHtml.js.map +1 -1
  225. package/esm/utils/number/DecimalFormat.js +1 -2
  226. package/esm/utils/number/DecimalFormat.js.map +1 -1
  227. package/esm/utils/number/formatValue.js +1 -4
  228. package/esm/utils/number/formatValue.js.map +1 -1
  229. package/esm/utils/number/parseNumbers.js +2 -6
  230. package/esm/utils/number/parseNumbers.js.map +1 -1
  231. package/lib/constants/Settings.js +3 -14
  232. package/lib/constants/Settings.js.map +1 -1
  233. package/lib/exceptions/NotFoundException.js +1 -2
  234. package/lib/exceptions/NotFoundException.js.map +1 -1
  235. package/lib/hooks/useI18n.js +1 -6
  236. package/lib/hooks/useI18n.js.map +1 -1
  237. package/lib/hooks/useModal.js +3 -4
  238. package/lib/hooks/useModal.js.map +1 -1
  239. package/lib/hooks/useModelCatalog.js +10 -30
  240. package/lib/hooks/useModelCatalog.js.map +1 -1
  241. package/lib/hooks/useModularUI.js +4 -5
  242. package/lib/hooks/useModularUI.js.map +1 -1
  243. package/lib/hooks/useModularUIBasic.js +7 -8
  244. package/lib/hooks/useModularUIBasic.js.map +1 -1
  245. package/lib/i18n/Locale.js +2 -5
  246. package/lib/i18n/Locale.js.map +1 -1
  247. package/lib/i18n/Locales.js +2 -5
  248. package/lib/i18n/Locales.js.map +1 -1
  249. package/lib/i18n/Message.js +9 -10
  250. package/lib/i18n/Message.js.map +1 -1
  251. package/lib/i18n/withMessage.js +1 -6
  252. package/lib/i18n/withMessage.js.map +1 -1
  253. package/lib/models/actions/ActionCollection.js +3 -6
  254. package/lib/models/actions/ActionCollection.js.map +1 -1
  255. package/lib/models/actions/ActionModel.js +1 -4
  256. package/lib/models/actions/ActionModel.js.map +1 -1
  257. package/lib/models/application/ApplicationModel.js +2 -2
  258. package/lib/models/application/ApplicationModel.js.map +1 -1
  259. package/lib/models/attributes/AttributeCollection.js +4 -14
  260. package/lib/models/attributes/AttributeCollection.js.map +1 -1
  261. package/lib/models/attributes/AttributeDataHelper.js +1 -2
  262. package/lib/models/attributes/AttributeDataHelper.js.map +1 -1
  263. package/lib/models/attributes/AttributeSetModel.js +1 -5
  264. package/lib/models/attributes/AttributeSetModel.js.map +1 -1
  265. package/lib/models/attributes/CaptchaAttributeModel.js +2 -2
  266. package/lib/models/attributes/CaptchaAttributeModel.js.map +1 -1
  267. package/lib/models/attributes/ChoiceAttributeModel.js +1 -3
  268. package/lib/models/attributes/ChoiceAttributeModel.js.map +1 -1
  269. package/lib/models/attributes/ChoiceAttributeOptionCollection.js +3 -9
  270. package/lib/models/attributes/ChoiceAttributeOptionCollection.js.map +1 -1
  271. package/lib/models/attributes/ChoiceAttributeOptionModel.js +2 -8
  272. package/lib/models/attributes/ChoiceAttributeOptionModel.js.map +1 -1
  273. package/lib/models/attributes/PasswordAttributeModel.js +2 -2
  274. package/lib/models/attributes/PasswordAttributeModel.js.map +1 -1
  275. package/lib/models/attributes/UploadAttributeModel.js +2 -2
  276. package/lib/models/attributes/UploadAttributeModel.js.map +1 -1
  277. package/lib/models/attributes/input-constraints/ConstraintCollection.js +1 -2
  278. package/lib/models/attributes/input-constraints/ConstraintCollection.js.map +1 -1
  279. package/lib/models/attributes/input-constraints/ConstraintModel.js +1 -2
  280. package/lib/models/attributes/input-constraints/ConstraintModel.js.map +1 -1
  281. package/lib/models/attributes/input-constraints/DateBoundaryConstraint.js +1 -4
  282. package/lib/models/attributes/input-constraints/DateBoundaryConstraint.js.map +1 -1
  283. package/lib/models/attributes/input-constraints/NumberBoundaryConstraint.js +1 -6
  284. package/lib/models/attributes/input-constraints/NumberBoundaryConstraint.js.map +1 -1
  285. package/lib/models/attributes/input-constraints/NumberGroupingConstraint.js +1 -4
  286. package/lib/models/attributes/input-constraints/NumberGroupingConstraint.js.map +1 -1
  287. package/lib/models/attributes/input-constraints/PasswordThreeConsecutiveCharactersNotAllowedConstraint.js +1 -2
  288. package/lib/models/attributes/input-constraints/PasswordThreeConsecutiveCharactersNotAllowedConstraint.js.map +1 -1
  289. package/lib/models/attributes/layouthint-rules/DependentAttribute.js +2 -2
  290. package/lib/models/attributes/layouthint-rules/DependentAttribute.js.map +1 -1
  291. package/lib/models/base/BaseCollection.js +1 -2
  292. package/lib/models/base/BaseCollection.js.map +1 -1
  293. package/lib/models/base/BaseModel.js +6 -9
  294. package/lib/models/base/BaseModel.js.map +1 -1
  295. package/lib/models/base/ResourceModel.js +1 -2
  296. package/lib/models/base/ResourceModel.js.map +1 -1
  297. package/lib/models/concepts/BusinessScenarioModel.js +2 -2
  298. package/lib/models/concepts/BusinessScenarioModel.js.map +1 -1
  299. package/lib/models/concepts/ConceptDetailModel.js +1 -2
  300. package/lib/models/concepts/ConceptDetailModel.js.map +1 -1
  301. package/lib/models/concepts/ConceptLinkModel.js +1 -3
  302. package/lib/models/concepts/ConceptLinkModel.js.map +1 -1
  303. package/lib/models/concepts/ConceptRelationCollection.js +1 -4
  304. package/lib/models/concepts/ConceptRelationCollection.js.map +1 -1
  305. package/lib/models/concepts/ConceptRelationModel.js +1 -3
  306. package/lib/models/concepts/ConceptRelationModel.js.map +1 -1
  307. package/lib/models/concepts/SourceReferenceCollection.js +1 -4
  308. package/lib/models/concepts/SourceReferenceCollection.js.map +1 -1
  309. package/lib/models/concepts/SourceReferenceModel.js +7 -3
  310. package/lib/models/concepts/SourceReferenceModel.js.map +1 -1
  311. package/lib/models/content/ContentLinkModel.js +1 -3
  312. package/lib/models/content/ContentLinkModel.js.map +1 -1
  313. package/lib/models/content/ContentTOCModel.js +2 -2
  314. package/lib/models/content/ContentTOCModel.js.map +1 -1
  315. package/lib/models/contentconfiguration/ContentConfigurationElements.js +1 -2
  316. package/lib/models/contentconfiguration/ContentConfigurationElements.js.map +1 -1
  317. package/lib/models/error/ErrorModel.js +1 -3
  318. package/lib/models/error/ErrorModel.js.map +1 -1
  319. package/lib/models/filters/FilterCollection.js +1 -4
  320. package/lib/models/filters/FilterCollection.js.map +1 -1
  321. package/lib/models/form/FormModel.js +3 -9
  322. package/lib/models/form/FormModel.js.map +1 -1
  323. package/lib/models/form/FormObjectModel.js +2 -4
  324. package/lib/models/form/FormObjectModel.js.map +1 -1
  325. package/lib/models/href/Href.js +3 -6
  326. package/lib/models/href/Href.js.map +1 -1
  327. package/lib/models/href/ListHref.js +1 -2
  328. package/lib/models/href/ListHref.js.map +1 -1
  329. package/lib/models/layouthint/LayoutHintCollection.js +3 -10
  330. package/lib/models/layouthint/LayoutHintCollection.js.map +1 -1
  331. package/lib/models/links/LinkCollection.js +6 -15
  332. package/lib/models/links/LinkCollection.js.map +1 -1
  333. package/lib/models/list/ListModel.js +2 -2
  334. package/lib/models/list/ListModel.js.map +1 -1
  335. package/lib/models/modelcatalog/ModelCategoryCollection.js +1 -2
  336. package/lib/models/modelcatalog/ModelCategoryCollection.js.map +1 -1
  337. package/lib/models/parameter/Parameter.js +2 -4
  338. package/lib/models/parameter/Parameter.js.map +1 -1
  339. package/lib/models/resolveModel.js +1 -2
  340. package/lib/models/resolveModel.js.map +1 -1
  341. package/lib/models/sorting/SortingModel.js +1 -2
  342. package/lib/models/sorting/SortingModel.js.map +1 -1
  343. package/lib/models/user/UserServicesModel.js +2 -2
  344. package/lib/models/user/UserServicesModel.js.map +1 -1
  345. package/lib/modularui/ModularUIRequest.js +1 -2
  346. package/lib/modularui/ModularUIRequest.js.map +1 -1
  347. package/lib/react/ErrorBoundary.js +2 -2
  348. package/lib/react/ErrorBoundary.js.map +1 -1
  349. package/lib/react/ErrorBoundaryFallback.js +13 -16
  350. package/lib/react/ErrorBoundaryFallback.js.map +1 -1
  351. package/lib/react/utils.js +1 -3
  352. package/lib/react/utils.js.map +1 -1
  353. package/lib/react-client/Init.js +20 -23
  354. package/lib/react-client/Init.js.map +1 -1
  355. package/lib/react-client/client.js +9 -13
  356. package/lib/react-client/client.js.map +1 -1
  357. package/lib/react-server/renderSSRComplete.js +9 -10
  358. package/lib/react-server/renderSSRComplete.js.map +1 -1
  359. package/lib/react-server/renderSSRMinimal.js +7 -8
  360. package/lib/react-server/renderSSRMinimal.js.map +1 -1
  361. package/lib/react-server/serverNoSSR.js +11 -12
  362. package/lib/react-server/serverNoSSR.js.map +1 -1
  363. package/lib/react-server/serverSSR.js +11 -12
  364. package/lib/react-server/serverSSR.js.map +1 -1
  365. package/lib/react-server/serverUtil.js +1 -3
  366. package/lib/react-server/serverUtil.js.map +1 -1
  367. package/lib/react-theme/ThemeProvider.js +7 -11
  368. package/lib/react-theme/ThemeProvider.js.map +1 -1
  369. package/lib/react-theme/createTheme.js +3 -10
  370. package/lib/react-theme/createTheme.js.map +1 -1
  371. package/lib/react-theme/utils/background.js +3 -4
  372. package/lib/react-theme/utils/background.js.map +1 -1
  373. package/lib/react-theme/utils/colors.js +7 -16
  374. package/lib/react-theme/utils/colors.js.map +1 -1
  375. package/lib/react-theme/utils/contrast.js +11 -19
  376. package/lib/react-theme/utils/contrast.js.map +1 -1
  377. package/lib/react-theme/utils/corners.js +10 -16
  378. package/lib/react-theme/utils/corners.js.map +1 -1
  379. package/lib/react-theme/utils/spacers.js +15 -38
  380. package/lib/react-theme/utils/spacers.js.map +1 -1
  381. package/lib/react-theme/utils/themeProps.js +7 -22
  382. package/lib/react-theme/utils/themeProps.js.map +1 -1
  383. package/lib/redux/_i18n/I18nReducer.js +5 -8
  384. package/lib/redux/_i18n/I18nReducer.js.map +1 -1
  385. package/lib/redux/_modularui/ModularUIActions.js +19 -23
  386. package/lib/redux/_modularui/ModularUIActions.js.map +1 -1
  387. package/lib/redux/_modularui/ModularUIConnector.js +4 -5
  388. package/lib/redux/_modularui/ModularUIConnector.js.map +1 -1
  389. package/lib/redux/_modularui/ModularUIReducer.js +14 -19
  390. package/lib/redux/_modularui/ModularUIReducer.js.map +1 -1
  391. package/lib/redux/_modularui/ModularUIUtils.js +1 -2
  392. package/lib/redux/_modularui/ModularUIUtils.js.map +1 -1
  393. package/lib/redux/_modularui/withModularUI.js +1 -2
  394. package/lib/redux/_modularui/withModularUI.js.map +1 -1
  395. package/lib/redux/_router/RouterReducer.js +1 -3
  396. package/lib/redux/_router/RouterReducer.js.map +1 -1
  397. package/lib/redux/actions/FormAttributeSet.js +34 -37
  398. package/lib/redux/actions/FormAttributeSet.js.map +1 -1
  399. package/lib/redux/actions/FormAutosubmit.js +1 -2
  400. package/lib/redux/actions/FormAutosubmit.js.map +1 -1
  401. package/lib/redux/actions/Preferences.js +8 -15
  402. package/lib/redux/actions/Preferences.js.map +1 -1
  403. package/lib/redux/connectors/CaseView.js +3 -6
  404. package/lib/redux/connectors/CaseView.js.map +1 -1
  405. package/lib/redux/connectors/ConceptDetail.js +4 -7
  406. package/lib/redux/connectors/ConceptDetail.js.map +1 -1
  407. package/lib/redux/connectors/ContentBrowser.js +3 -6
  408. package/lib/redux/connectors/ContentBrowser.js.map +1 -1
  409. package/lib/redux/connectors/ContentDetail.js +4 -7
  410. package/lib/redux/connectors/ContentDetail.js.map +1 -1
  411. package/lib/redux/connectors/ContentDetailSection.js +5 -8
  412. package/lib/redux/connectors/ContentDetailSection.js.map +1 -1
  413. package/lib/redux/connectors/Form.js +4 -5
  414. package/lib/redux/connectors/Form.js.map +1 -1
  415. package/lib/redux/connectors/FormAttributeSet.js +5 -8
  416. package/lib/redux/connectors/FormAttributeSet.js.map +1 -1
  417. package/lib/redux/connectors/ListDetail.js +3 -6
  418. package/lib/redux/connectors/ListDetail.js.map +1 -1
  419. package/lib/redux/connectors/ModelCatalog.js +3 -6
  420. package/lib/redux/connectors/ModelCatalog.js.map +1 -1
  421. package/lib/redux/connectors/PanelRenderer.js +5 -6
  422. package/lib/redux/connectors/PanelRenderer.js.map +1 -1
  423. package/lib/redux/connectors/QuickSearch.js +3 -6
  424. package/lib/redux/connectors/QuickSearch.js.map +1 -1
  425. package/lib/redux/connectors/Tab.js +3 -6
  426. package/lib/redux/connectors/Tab.js.map +1 -1
  427. package/lib/redux/reducers/AuthReducer.js +1 -3
  428. package/lib/redux/reducers/AuthReducer.js.map +1 -1
  429. package/lib/redux/reducers/ErrorReducer.js +1 -3
  430. package/lib/redux/reducers/ErrorReducer.js.map +1 -1
  431. package/lib/redux/reducers/ModalsReducer.js +1 -3
  432. package/lib/redux/reducers/ModalsReducer.js.map +1 -1
  433. package/lib/redux/reducers/ModelCatalogReducer.js +1 -3
  434. package/lib/redux/reducers/ModelCatalogReducer.js.map +1 -1
  435. package/lib/redux/reducers/NotificationReducer.js +1 -3
  436. package/lib/redux/reducers/NotificationReducer.js.map +1 -1
  437. package/lib/redux/reducers/PreferencesReducer.js +1 -3
  438. package/lib/redux/reducers/PreferencesReducer.js.map +1 -1
  439. package/lib/redux/reducers/ProgressIndicatorReducer.js +1 -3
  440. package/lib/redux/reducers/ProgressIndicatorReducer.js.map +1 -1
  441. package/lib/redux/store/beforeRenderHooks.js +1 -3
  442. package/lib/redux/store/beforeRenderHooks.js.map +1 -1
  443. package/lib/utils/browser/Cache.js +1 -5
  444. package/lib/utils/browser/Cache.js.map +1 -1
  445. package/lib/utils/datetime/DateTimeUtil.js +45 -91
  446. package/lib/utils/datetime/DateTimeUtil.js.map +1 -1
  447. package/lib/utils/fetch/xhr.js +1 -2
  448. package/lib/utils/fetch/xhr.js.map +1 -1
  449. package/lib/utils/helpers/repositoryResource.js +1 -3
  450. package/lib/utils/helpers/repositoryResource.js.map +1 -1
  451. package/lib/utils/helpers/sanitizeHtml.js +3 -4
  452. package/lib/utils/helpers/sanitizeHtml.js.map +1 -1
  453. package/lib/utils/number/DecimalFormat.js +1 -2
  454. package/lib/utils/number/DecimalFormat.js.map +1 -1
  455. package/lib/utils/number/formatValue.js +1 -4
  456. package/lib/utils/number/formatValue.js.map +1 -1
  457. package/lib/utils/number/parseNumbers.js +2 -6
  458. package/lib/utils/number/parseNumbers.js.map +1 -1
  459. package/package.json +22 -22
  460. package/src/models/concepts/SourceReferenceModel.js +6 -0
@@ -1 +1 @@
1
- {"version":3,"file":"ErrorBoundary.js","names":["Component","ErrorBoundaryFallback","jsx","_jsx","ErrorBoundary","constructor","arguments","_defineProperty","error","errorInfo","componentDidCatch","setState","render","children","FallbackComponent","props","state","componentStack","displayName"],"sources":["../../src/react/ErrorBoundary.js"],"sourcesContent":["// @flow\nimport { Component } from \"react\";\n\nimport ErrorBoundaryFallback from \"./ErrorBoundaryFallback\";\n\nimport type { ComponentType, Node } from \"react\";\nimport type { Props as FallbackProps } from \"./ErrorBoundaryFallback\";\nexport type Props = {\n +children: ?Node,\n +FallbackComponent: ComponentType<FallbackProps>,\n};\n\ntype ErrorInfo = {\n componentStack: string,\n ...\n};\n\ntype State = {\n error: ?Error,\n errorInfo: ?ErrorInfo,\n};\n\n/**\n */\nclass ErrorBoundary extends Component<Props, State> {\n static defaultProps: { FallbackComponent: ComponentType<FallbackProps> } = {\n FallbackComponent: ErrorBoundaryFallback,\n };\n\n state: State = {\n error: null,\n errorInfo: null,\n };\n\n /**\n */\n componentDidCatch(error: Error, errorInfo: ErrorInfo): void {\n this.setState({ error, errorInfo });\n }\n\n /**\n */\n render(): Node {\n const { children, FallbackComponent } = this.props; // NOSONAR\n const { error, errorInfo } = this.state;\n\n if (error != null) {\n return (\n <FallbackComponent\n componentStack={errorInfo ? errorInfo.componentStack : \"\"}\n error={error}\n />\n );\n }\n\n return children ?? null;\n }\n}\nErrorBoundary.displayName = \"BI.ErrorBoundary\";\n\nexport default ErrorBoundary;\n"],"mappings":";AACA,SAASA,SAAS,QAAQ,OAAO;AAEjC,OAAOC,qBAAqB,MAAM,yBAAyB;AAAC,SAAAC,GAAA,IAAAC,IAAA;AAmB5D;AACA;AACA,MAAMC,aAAa,SAASJ,SAAS,CAAe;EAAAK,YAAA;IAAA,SAAAC,SAAA;IAAAC,eAAA,gBAKnC;MACbC,KAAK,EAAE,IAAI;MACXC,SAAS,EAAE;IACb,CAAC;EAAA;EAED;AACF;EACEC,iBAAiBA,CAACF,KAAY,EAAEC,SAAoB,EAAQ;IAC1D,IAAI,CAACE,QAAQ,CAAC;MAAEH,KAAK;MAAEC;IAAU,CAAC,CAAC;EACrC;;EAEA;AACF;EACEG,MAAMA,CAAA,EAAS;IACb,MAAM;MAAEC,QAAQ;MAAEC;IAAkB,CAAC,GAAG,IAAI,CAACC,KAAK,CAAC,CAAC;IACpD,MAAM;MAAEP,KAAK;MAAEC;IAAU,CAAC,GAAG,IAAI,CAACO,KAAK;IAEvC,IAAIR,KAAK,IAAI,IAAI,EAAE;MACjB,oBACEL,IAAA,CAACW,iBAAiB;QAChBG,cAAc,EAAER,SAAS,GAAGA,SAAS,CAACQ,cAAc,GAAG,EAAG;QAC1DT,KAAK,EAAEA;MAAM,CACd,CAAC;IAEN;IAEA,OAAOK,QAAQ,IAAI,IAAI;EACzB;AACF;AAACN,eAAA,CAjCKH,aAAa,kBAC0D;EACzEU,iBAAiB,EAAEb;AACrB,CAAC;AA+BHG,aAAa,CAACc,WAAW,GAAG,kBAAkB;AAE9C,eAAed,aAAa","ignoreList":[]}
1
+ {"version":3,"file":"ErrorBoundary.js","names":["Component","ErrorBoundaryFallback","jsx","_jsx","ErrorBoundary","constructor","args","_defineProperty","error","errorInfo","componentDidCatch","setState","render","children","FallbackComponent","props","state","componentStack","displayName"],"sources":["../../src/react/ErrorBoundary.js"],"sourcesContent":["// @flow\nimport { Component } from \"react\";\n\nimport ErrorBoundaryFallback from \"./ErrorBoundaryFallback\";\n\nimport type { ComponentType, Node } from \"react\";\nimport type { Props as FallbackProps } from \"./ErrorBoundaryFallback\";\nexport type Props = {\n +children: ?Node,\n +FallbackComponent: ComponentType<FallbackProps>,\n};\n\ntype ErrorInfo = {\n componentStack: string,\n ...\n};\n\ntype State = {\n error: ?Error,\n errorInfo: ?ErrorInfo,\n};\n\n/**\n */\nclass ErrorBoundary extends Component<Props, State> {\n static defaultProps: { FallbackComponent: ComponentType<FallbackProps> } = {\n FallbackComponent: ErrorBoundaryFallback,\n };\n\n state: State = {\n error: null,\n errorInfo: null,\n };\n\n /**\n */\n componentDidCatch(error: Error, errorInfo: ErrorInfo): void {\n this.setState({ error, errorInfo });\n }\n\n /**\n */\n render(): Node {\n const { children, FallbackComponent } = this.props; // NOSONAR\n const { error, errorInfo } = this.state;\n\n if (error != null) {\n return (\n <FallbackComponent\n componentStack={errorInfo ? errorInfo.componentStack : \"\"}\n error={error}\n />\n );\n }\n\n return children ?? null;\n }\n}\nErrorBoundary.displayName = \"BI.ErrorBoundary\";\n\nexport default ErrorBoundary;\n"],"mappings":";AACA,SAASA,SAAS,QAAQ,OAAO;AAEjC,OAAOC,qBAAqB,MAAM,yBAAyB;AAAC,SAAAC,GAAA,IAAAC,IAAA;AAmB5D;AACA;AACA,MAAMC,aAAa,SAASJ,SAAS,CAAe;EAAAK,YAAA,GAAAC,IAAA;IAAA,SAAAA,IAAA;IAAAC,eAAA,gBAKnC;MACbC,KAAK,EAAE,IAAI;MACXC,SAAS,EAAE;IACb,CAAC;EAAA;EAED;AACF;EACEC,iBAAiBA,CAACF,KAAY,EAAEC,SAAoB,EAAQ;IAC1D,IAAI,CAACE,QAAQ,CAAC;MAAEH,KAAK;MAAEC;IAAU,CAAC,CAAC;EACrC;;EAEA;AACF;EACEG,MAAMA,CAAA,EAAS;IACb,MAAM;MAAEC,QAAQ;MAAEC;IAAkB,CAAC,GAAG,IAAI,CAACC,KAAK,CAAC,CAAC;IACpD,MAAM;MAAEP,KAAK;MAAEC;IAAU,CAAC,GAAG,IAAI,CAACO,KAAK;IAEvC,IAAIR,KAAK,IAAI,IAAI,EAAE;MACjB,oBACEL,IAAA,CAACW,iBAAiB;QAChBG,cAAc,EAAER,SAAS,GAAGA,SAAS,CAACQ,cAAc,GAAG,EAAG;QAC1DT,KAAK,EAAEA;MAAM,CACd,CAAC;IAEN;IAEA,OAAOK,QAAQ,IAAI,IAAI;EACzB;AACF;AAACN,eAAA,CAjCKH,aAAa,kBAC0D;EACzEU,iBAAiB,EAAEb;AACrB,CAAC;AA+BHG,aAAa,CAACc,WAAW,GAAG,kBAAkB;AAE9C,eAAed,aAAa","ignoreList":[]}
@@ -13,22 +13,19 @@ const StyledStack = /*#__PURE__*/styled.pre.withConfig({
13
13
 
14
14
  /**
15
15
  */
16
- const ErrorBoundaryFallback = _ref => {
17
- let {
18
- className,
19
- componentStack,
20
- error
21
- } = _ref;
22
- return /*#__PURE__*/_jsxs(StyledBoundary, {
23
- className: className,
24
- children: [/*#__PURE__*/_jsx("h2", {
25
- children: error.toString()
26
- }), /*#__PURE__*/_jsx(StyledStack, {
27
- className: "debug",
28
- children: componentStack
29
- })]
30
- });
31
- };
16
+ const ErrorBoundaryFallback = ({
17
+ className,
18
+ componentStack,
19
+ error
20
+ }) => /*#__PURE__*/_jsxs(StyledBoundary, {
21
+ className: className,
22
+ children: [/*#__PURE__*/_jsx("h2", {
23
+ children: error.toString()
24
+ }), /*#__PURE__*/_jsx(StyledStack, {
25
+ className: "debug",
26
+ children: componentStack
27
+ })]
28
+ });
32
29
  ErrorBoundaryFallback.displayName = "BI.ErrorBoundaryFallback";
33
30
  export default ErrorBoundaryFallback;
34
31
  //# sourceMappingURL=ErrorBoundaryFallback.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"ErrorBoundaryFallback.js","names":["styled","spacers","spacer","jsx","_jsx","jsxs","_jsxs","StyledBoundary","div","withConfig","componentId","StyledStack","pre","ErrorBoundaryFallback","_ref","className","componentStack","error","children","toString","displayName"],"sources":["../../src/react/ErrorBoundaryFallback.js"],"sourcesContent":["// @flow\nimport styled from \"styled-components\";\nimport { spacers, spacer } from \"../react-theme/utils/spacers\";\n\nimport type { StyledComponent } from \"styled-components\";\nimport type { Theme } from \"../react-theme/types\";\nimport type { Node } from \"react\";\n\nexport type Props = {\n +className?: string,\n +componentStack: string,\n +error: Error,\n};\n\n// $FlowFixMe\nconst StyledBoundary: StyledComponent<{}, Theme, *> = styled.div`\n padding: ${spacers(2, 1)};\n margin-bottom: ${spacer(2)};\n background-color: #e9ecef;\n border-radius: 0.3em;\n`;\n\n// $FlowFixMe\nconst StyledStack = styled.pre`\n display: block;\n font-size: 87.5%;\n color: #212529;\n font-style: italic;\n`;\n\n/**\n */\nconst ErrorBoundaryFallback = ({\n className,\n componentStack,\n error,\n}: Props): Node => (\n <StyledBoundary className={className}>\n <h2>{error.toString()}</h2>\n <StyledStack className=\"debug\">{componentStack}</StyledStack>\n </StyledBoundary>\n);\n\nErrorBoundaryFallback.displayName = \"BI.ErrorBoundaryFallback\";\n\nexport default ErrorBoundaryFallback;\n"],"mappings":"AACA,OAAOA,MAAM,MAAM,mBAAmB;AACtC,SAASC,OAAO,EAAEC,MAAM,QAAQ,8BAA8B;AAAC,SAAAC,GAAA,IAAAC,IAAA,EAAAC,IAAA,IAAAC,KAAA;AAY/D;AACA,MAAMC,cAA6C,gBAAGP,MAAM,CAACQ,GAAG,CAAAC,UAAA;EAAAC,WAAA;AAAA,sFACnDT,OAAO,CAAC,CAAC,EAAE,CAAC,CAAC,EACPC,MAAM,CAAC,CAAC,CAAC,CAG3B;;AAED;AACA,MAAMS,WAAW,gBAAGX,MAAM,CAACY,GAAG,CAAAH,UAAA;EAAAC,WAAA;AAAA,sEAK7B;;AAED;AACA;AACA,MAAMG,qBAAqB,GAAGC,IAAA;EAAA,IAAC;IAC7BC,SAAS;IACTC,cAAc;IACdC;EACK,CAAC,GAAAH,IAAA;EAAA,oBACNR,KAAA,CAACC,cAAc;IAACQ,SAAS,EAAEA,SAAU;IAAAG,QAAA,gBACnCd,IAAA;MAAAc,QAAA,EAAKD,KAAK,CAACE,QAAQ,CAAC;IAAC,CAAK,CAAC,eAC3Bf,IAAA,CAACO,WAAW;MAACI,SAAS,EAAC,OAAO;MAAAG,QAAA,EAAEF;IAAc,CAAc,CAAC;EAAA,CAC/C,CAAC;AAAA,CAClB;AAEDH,qBAAqB,CAACO,WAAW,GAAG,0BAA0B;AAE9D,eAAeP,qBAAqB","ignoreList":[]}
1
+ {"version":3,"file":"ErrorBoundaryFallback.js","names":["styled","spacers","spacer","jsx","_jsx","jsxs","_jsxs","StyledBoundary","div","withConfig","componentId","StyledStack","pre","ErrorBoundaryFallback","className","componentStack","error","children","toString","displayName"],"sources":["../../src/react/ErrorBoundaryFallback.js"],"sourcesContent":["// @flow\nimport styled from \"styled-components\";\nimport { spacers, spacer } from \"../react-theme/utils/spacers\";\n\nimport type { StyledComponent } from \"styled-components\";\nimport type { Theme } from \"../react-theme/types\";\nimport type { Node } from \"react\";\n\nexport type Props = {\n +className?: string,\n +componentStack: string,\n +error: Error,\n};\n\n// $FlowFixMe\nconst StyledBoundary: StyledComponent<{}, Theme, *> = styled.div`\n padding: ${spacers(2, 1)};\n margin-bottom: ${spacer(2)};\n background-color: #e9ecef;\n border-radius: 0.3em;\n`;\n\n// $FlowFixMe\nconst StyledStack = styled.pre`\n display: block;\n font-size: 87.5%;\n color: #212529;\n font-style: italic;\n`;\n\n/**\n */\nconst ErrorBoundaryFallback = ({\n className,\n componentStack,\n error,\n}: Props): Node => (\n <StyledBoundary className={className}>\n <h2>{error.toString()}</h2>\n <StyledStack className=\"debug\">{componentStack}</StyledStack>\n </StyledBoundary>\n);\n\nErrorBoundaryFallback.displayName = \"BI.ErrorBoundaryFallback\";\n\nexport default ErrorBoundaryFallback;\n"],"mappings":"AACA,OAAOA,MAAM,MAAM,mBAAmB;AACtC,SAASC,OAAO,EAAEC,MAAM,QAAQ,8BAA8B;AAAC,SAAAC,GAAA,IAAAC,IAAA,EAAAC,IAAA,IAAAC,KAAA;AAY/D;AACA,MAAMC,cAA6C,gBAAGP,MAAM,CAACQ,GAAG,CAAAC,UAAA;EAAAC,WAAA;AAAA,sFACnDT,OAAO,CAAC,CAAC,EAAE,CAAC,CAAC,EACPC,MAAM,CAAC,CAAC,CAAC,CAG3B;;AAED;AACA,MAAMS,WAAW,gBAAGX,MAAM,CAACY,GAAG,CAAAH,UAAA;EAAAC,WAAA;AAAA,sEAK7B;;AAED;AACA;AACA,MAAMG,qBAAqB,GAAGA,CAAC;EAC7BC,SAAS;EACTC,cAAc;EACdC;AACK,CAAC,kBACNV,KAAA,CAACC,cAAc;EAACO,SAAS,EAAEA,SAAU;EAAAG,QAAA,gBACnCb,IAAA;IAAAa,QAAA,EAAKD,KAAK,CAACE,QAAQ,CAAC;EAAC,CAAK,CAAC,eAC3Bd,IAAA,CAACO,WAAW;IAACG,SAAS,EAAC,OAAO;IAAAG,QAAA,EAAEF;EAAc,CAAc,CAAC;AAAA,CAC/C,CACjB;AAEDF,qBAAqB,CAACM,WAAW,GAAG,0BAA0B;AAE9D,eAAeN,qBAAqB","ignoreList":[]}
@@ -1,8 +1,6 @@
1
1
  /**
2
2
  */
3
- export const getDisplayName = function (WrappedComponent) {
4
- let defaultName = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : "Component";
5
- let contextId = arguments.length > 2 ? arguments[2] : undefined;
3
+ export const getDisplayName = (WrappedComponent, defaultName = "Component", contextId) => {
6
4
  const componentName = WrappedComponent.displayName || WrappedComponent.name || defaultName;
7
5
  if (contextId) {
8
6
  return `${componentName}[${contextId}]`;
@@ -1 +1 @@
1
- {"version":3,"file":"utils.js","names":["getDisplayName","WrappedComponent","defaultName","arguments","length","undefined","contextId","componentName","displayName","name","mergeRefs","refs","value","forEach","ref","current"],"sources":["../../src/react/utils.js"],"sourcesContent":["// @flow\nimport type { ComponentType, Ref } from \"react\";\n\n/**\n */\nexport const getDisplayName = (\n WrappedComponent: ComponentType<any>,\n defaultName: string = \"Component\",\n contextId?: string,\n): string => {\n const componentName =\n WrappedComponent.displayName || WrappedComponent.name || defaultName;\n\n if (contextId) {\n return `${componentName}[${contextId}]`;\n }\n\n return componentName;\n};\n\n/**\n */\nexport const mergeRefs =\n <T: any>(refs: Array<Ref<T>>): Ref<T> =>\n (value) => {\n refs.forEach((ref) => {\n if (typeof ref === \"function\") {\n ref(value);\n } else if (ref != null && typeof ref === \"object\") {\n ref.current = value;\n }\n });\n };\n"],"mappings":"AAGA;AACA;AACA,OAAO,MAAMA,cAAc,GAAG,SAAAA,CAC5BC,gBAAoC,EAGzB;EAAA,IAFXC,WAAmB,GAAAC,SAAA,CAAAC,MAAA,QAAAD,SAAA,QAAAE,SAAA,GAAAF,SAAA,MAAG,WAAW;EAAA,IACjCG,SAAkB,GAAAH,SAAA,CAAAC,MAAA,OAAAD,SAAA,MAAAE,SAAA;EAElB,MAAME,aAAa,GACjBN,gBAAgB,CAACO,WAAW,IAAIP,gBAAgB,CAACQ,IAAI,IAAIP,WAAW;EAEtE,IAAII,SAAS,EAAE;IACb,OAAO,GAAGC,aAAa,IAAID,SAAS,GAAG;EACzC;EAEA,OAAOC,aAAa;AACtB,CAAC;;AAED;AACA;AACA,OAAO,MAAMG,SAAS,GACXC,IAAmB,IAC3BC,KAAK,IAAK;EACTD,IAAI,CAACE,OAAO,CAAEC,GAAG,IAAK;IACpB,IAAI,OAAOA,GAAG,KAAK,UAAU,EAAE;MAC7BA,GAAG,CAACF,KAAK,CAAC;IACZ,CAAC,MAAM,IAAIE,GAAG,IAAI,IAAI,IAAI,OAAOA,GAAG,KAAK,QAAQ,EAAE;MACjDA,GAAG,CAACC,OAAO,GAAGH,KAAK;IACrB;EACF,CAAC,CAAC;AACJ,CAAC","ignoreList":[]}
1
+ {"version":3,"file":"utils.js","names":["getDisplayName","WrappedComponent","defaultName","contextId","componentName","displayName","name","mergeRefs","refs","value","forEach","ref","current"],"sources":["../../src/react/utils.js"],"sourcesContent":["// @flow\nimport type { ComponentType, Ref } from \"react\";\n\n/**\n */\nexport const getDisplayName = (\n WrappedComponent: ComponentType<any>,\n defaultName: string = \"Component\",\n contextId?: string,\n): string => {\n const componentName =\n WrappedComponent.displayName || WrappedComponent.name || defaultName;\n\n if (contextId) {\n return `${componentName}[${contextId}]`;\n }\n\n return componentName;\n};\n\n/**\n */\nexport const mergeRefs =\n <T: any>(refs: Array<Ref<T>>): Ref<T> =>\n (value) => {\n refs.forEach((ref) => {\n if (typeof ref === \"function\") {\n ref(value);\n } else if (ref != null && typeof ref === \"object\") {\n ref.current = value;\n }\n });\n };\n"],"mappings":"AAGA;AACA;AACA,OAAO,MAAMA,cAAc,GAAGA,CAC5BC,gBAAoC,EACpCC,WAAmB,GAAG,WAAW,EACjCC,SAAkB,KACP;EACX,MAAMC,aAAa,GACjBH,gBAAgB,CAACI,WAAW,IAAIJ,gBAAgB,CAACK,IAAI,IAAIJ,WAAW;EAEtE,IAAIC,SAAS,EAAE;IACb,OAAO,GAAGC,aAAa,IAAID,SAAS,GAAG;EACzC;EAEA,OAAOC,aAAa;AACtB,CAAC;;AAED;AACA;AACA,OAAO,MAAMG,SAAS,GACXC,IAAmB,IAC3BC,KAAK,IAAK;EACTD,IAAI,CAACE,OAAO,CAAEC,GAAG,IAAK;IACpB,IAAI,OAAOA,GAAG,KAAK,UAAU,EAAE;MAC7BA,GAAG,CAACF,KAAK,CAAC;IACZ,CAAC,MAAM,IAAIE,GAAG,IAAI,IAAI,IAAI,OAAOA,GAAG,KAAK,QAAQ,EAAE;MACjDA,GAAG,CAACC,OAAO,GAAGH,KAAK;IACrB;EACF,CAAC,CAAC;AACJ,CAAC","ignoreList":[]}
@@ -6,31 +6,28 @@ import ErrorBoundary from "../react/ErrorBoundary";
6
6
  import { jsx as _jsx } from "react/jsx-runtime";
7
7
  /**
8
8
  */
9
- export const Init = _ref => {
10
- let {
11
- store,
12
- routerHistory,
13
- contextPath,
14
- theme,
15
- children,
16
- ErrorFallbackComponent
17
- } = _ref;
18
- return /*#__PURE__*/_jsx(Provider, {
19
- store: store,
20
- children: /*#__PURE__*/_jsx(ThemeProvider, {
21
- theme: theme,
22
- children: /*#__PURE__*/_jsx(HelmetProvider, {
23
- children: /*#__PURE__*/_jsx(ErrorBoundary, {
24
- FallbackComponent: ErrorFallbackComponent,
25
- children: /*#__PURE__*/_jsx(Router, {
26
- history: routerHistory,
27
- basename: contextPath,
28
- children: children
29
- })
9
+ export const Init = ({
10
+ store,
11
+ routerHistory,
12
+ contextPath,
13
+ theme,
14
+ children,
15
+ ErrorFallbackComponent
16
+ }) => /*#__PURE__*/_jsx(Provider, {
17
+ store: store,
18
+ children: /*#__PURE__*/_jsx(ThemeProvider, {
19
+ theme: theme,
20
+ children: /*#__PURE__*/_jsx(HelmetProvider, {
21
+ children: /*#__PURE__*/_jsx(ErrorBoundary, {
22
+ FallbackComponent: ErrorFallbackComponent,
23
+ children: /*#__PURE__*/_jsx(Router, {
24
+ history: routerHistory,
25
+ basename: contextPath,
26
+ children: children
30
27
  })
31
28
  })
32
29
  })
33
- });
34
- };
30
+ })
31
+ });
35
32
  Init.displayName = "BI.Init";
36
33
  //# sourceMappingURL=Init.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"Init.js","names":["Provider","HelmetProvider","Router","ThemeProvider","ErrorBoundary","jsx","_jsx","Init","_ref","store","routerHistory","contextPath","theme","children","ErrorFallbackComponent","FallbackComponent","history","basename","displayName"],"sources":["../../src/react-client/Init.js"],"sourcesContent":["// @flow\nimport { Provider } from \"react-redux\";\nimport { HelmetProvider } from \"react-helmet-async\";\nimport { Router } from \"react-router\";\n\nimport ThemeProvider from \"../react-theme/ThemeProvider\";\nimport ErrorBoundary from \"../react/ErrorBoundary\";\n\nimport type { ComponentType, Node } from \"react\";\nimport type { RouterHistory } from \"react-router\";\nimport type { Theme } from \"../react-theme/types\";\nimport type { ReduxStore } from \"../redux/types\";\nimport type { Props as FallbackProps } from \"../react/ErrorBoundaryFallback\";\n\ntype Props = {\n +store: ReduxStore,\n +routerHistory: RouterHistory,\n +contextPath: string,\n +theme?: Theme | Array<Theme>,\n +children: ?Node,\n +ErrorFallbackComponent?: ComponentType<FallbackProps>,\n};\n\n/**\n */\nexport const Init = ({\n store,\n routerHistory,\n contextPath,\n theme,\n children,\n ErrorFallbackComponent,\n}: Props): Node => (\n <Provider store={store}>\n <ThemeProvider theme={theme}>\n <HelmetProvider>\n <ErrorBoundary FallbackComponent={ErrorFallbackComponent}>\n <Router history={routerHistory} basename={contextPath}>\n {children}\n </Router>\n </ErrorBoundary>\n </HelmetProvider>\n </ThemeProvider>\n </Provider>\n);\nInit.displayName = \"BI.Init\";\n"],"mappings":"AACA,SAASA,QAAQ,QAAQ,aAAa;AACtC,SAASC,cAAc,QAAQ,oBAAoB;AACnD,SAASC,MAAM,QAAQ,cAAc;AAErC,OAAOC,aAAa,MAAM,8BAA8B;AACxD,OAAOC,aAAa,MAAM,wBAAwB;AAAC,SAAAC,GAAA,IAAAC,IAAA;AAiBnD;AACA;AACA,OAAO,MAAMC,IAAI,GAAGC,IAAA;EAAA,IAAC;IACnBC,KAAK;IACLC,aAAa;IACbC,WAAW;IACXC,KAAK;IACLC,QAAQ;IACRC;EACK,CAAC,GAAAN,IAAA;EAAA,oBACNF,IAAA,CAACN,QAAQ;IAACS,KAAK,EAAEA,KAAM;IAAAI,QAAA,eACrBP,IAAA,CAACH,aAAa;MAACS,KAAK,EAAEA,KAAM;MAAAC,QAAA,eAC1BP,IAAA,CAACL,cAAc;QAAAY,QAAA,eACbP,IAAA,CAACF,aAAa;UAACW,iBAAiB,EAAED,sBAAuB;UAAAD,QAAA,eACvDP,IAAA,CAACJ,MAAM;YAACc,OAAO,EAAEN,aAAc;YAACO,QAAQ,EAAEN,WAAY;YAAAE,QAAA,EACnDA;UAAQ,CACH;QAAC,CACI;MAAC,CACF;IAAC,CACJ;EAAC,CACR,CAAC;AAAA,CACZ;AACDN,IAAI,CAACW,WAAW,GAAG,SAAS","ignoreList":[]}
1
+ {"version":3,"file":"Init.js","names":["Provider","HelmetProvider","Router","ThemeProvider","ErrorBoundary","jsx","_jsx","Init","store","routerHistory","contextPath","theme","children","ErrorFallbackComponent","FallbackComponent","history","basename","displayName"],"sources":["../../src/react-client/Init.js"],"sourcesContent":["// @flow\nimport { Provider } from \"react-redux\";\nimport { HelmetProvider } from \"react-helmet-async\";\nimport { Router } from \"react-router\";\n\nimport ThemeProvider from \"../react-theme/ThemeProvider\";\nimport ErrorBoundary from \"../react/ErrorBoundary\";\n\nimport type { ComponentType, Node } from \"react\";\nimport type { RouterHistory } from \"react-router\";\nimport type { Theme } from \"../react-theme/types\";\nimport type { ReduxStore } from \"../redux/types\";\nimport type { Props as FallbackProps } from \"../react/ErrorBoundaryFallback\";\n\ntype Props = {\n +store: ReduxStore,\n +routerHistory: RouterHistory,\n +contextPath: string,\n +theme?: Theme | Array<Theme>,\n +children: ?Node,\n +ErrorFallbackComponent?: ComponentType<FallbackProps>,\n};\n\n/**\n */\nexport const Init = ({\n store,\n routerHistory,\n contextPath,\n theme,\n children,\n ErrorFallbackComponent,\n}: Props): Node => (\n <Provider store={store}>\n <ThemeProvider theme={theme}>\n <HelmetProvider>\n <ErrorBoundary FallbackComponent={ErrorFallbackComponent}>\n <Router history={routerHistory} basename={contextPath}>\n {children}\n </Router>\n </ErrorBoundary>\n </HelmetProvider>\n </ThemeProvider>\n </Provider>\n);\nInit.displayName = \"BI.Init\";\n"],"mappings":"AACA,SAASA,QAAQ,QAAQ,aAAa;AACtC,SAASC,cAAc,QAAQ,oBAAoB;AACnD,SAASC,MAAM,QAAQ,cAAc;AAErC,OAAOC,aAAa,MAAM,8BAA8B;AACxD,OAAOC,aAAa,MAAM,wBAAwB;AAAC,SAAAC,GAAA,IAAAC,IAAA;AAiBnD;AACA;AACA,OAAO,MAAMC,IAAI,GAAGA,CAAC;EACnBC,KAAK;EACLC,aAAa;EACbC,WAAW;EACXC,KAAK;EACLC,QAAQ;EACRC;AACK,CAAC,kBACNP,IAAA,CAACN,QAAQ;EAACQ,KAAK,EAAEA,KAAM;EAAAI,QAAA,eACrBN,IAAA,CAACH,aAAa;IAACQ,KAAK,EAAEA,KAAM;IAAAC,QAAA,eAC1BN,IAAA,CAACL,cAAc;MAAAW,QAAA,eACbN,IAAA,CAACF,aAAa;QAACU,iBAAiB,EAAED,sBAAuB;QAAAD,QAAA,eACvDN,IAAA,CAACJ,MAAM;UAACa,OAAO,EAAEN,aAAc;UAACO,QAAQ,EAAEN,WAAY;UAAAE,QAAA,EACnDA;QAAQ,CACH;MAAC,CACI;IAAC,CACF;EAAC,CACJ;AAAC,CACR,CACX;AACDL,IAAI,CAACU,WAAW,GAAG,SAAS","ignoreList":[]}
@@ -111,10 +111,7 @@ export const setModelCatalogEntryDate = store => {
111
111
 
112
112
  /**
113
113
  */
114
- export const setupClient = function () {
115
- let customReducers = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
116
- let beforeRenderHooks = arguments.length > 1 ? arguments[1] : undefined;
117
- let theme = arguments.length > 2 ? arguments[2] : undefined;
114
+ export const setupClient = (customReducers = {}, beforeRenderHooks, theme) => {
118
115
  if (typeof window.contextPath === "undefined") {
119
116
  throw new Error("Missing contextPath on window object");
120
117
  }
@@ -206,15 +203,14 @@ const mountClient = (applicationNode, element) => {
206
203
  /**
207
204
  * Mount the webapplication to the DOM, setup redux store and caches, add unhandledRejectionEvent, used client side when JavaScript is enabled.
208
205
  */
209
- export const client = _ref => {
210
- let {
211
- customReducers,
212
- theme,
213
- render,
214
- beforeRenderHooks,
215
- ErrorFallbackComponent,
216
- mount
217
- } = _ref;
206
+ export const client = ({
207
+ customReducers,
208
+ theme,
209
+ render,
210
+ beforeRenderHooks,
211
+ ErrorFallbackComponent,
212
+ mount
213
+ }) => {
218
214
  const {
219
215
  store,
220
216
  routerHistory
@@ -1 +1 @@
1
- {"version":3,"file":"client.js","names":["hydrateRoot","createRoot","has","setImmediate","Cache","xhr","createBrowserHistory","configureStore","rehydrate","getBasePathModularUI","getBasePathServer","getSetting","setAllContentInDataSetting","setDateTimeSettings","setLoginPreferences","showXHRErrorNotification","handleError","loginSuccess","updateEntryDate","locationChange","replace","JsonParseException","FetchException","Init","handleBeforeRenderHooks","createTheme","receiveLocale","jsx","_jsx","parseDataToJSON","data","JSON","parse","error","getDataFromServer","_context","dataElement","document","querySelector","Error","_trimInstanceProperty","textContent","call","setUnhandledRejectionEvent","store","window","onunhandledrejection","event","detail","errorMessage","reason","message","toString","dispatch","initThemeSettings","state","theme","storedTheme","preferences","handleLocale","locale","getState","i18n","handleRedirectURI","urlParams","_URLSearchParams","location","search","redirectURI","get","url","catch","e","id","LOGIN_PATH","from","pathname","modal","setModelCatalogEntryDate","entryDateFromUrl","hasItem","getItem","setupClient","customReducers","arguments","length","undefined","beforeRenderHooks","contextPath","clear","browserHistory","basename","routerHistory","loadOtherBrowserTabs","response","listen","action","body","className","addContentLoadedEvent","render","ErrorFallbackComponent","mount","addEventListener","applicationNode","children","mountClient","element","isSSR","root","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 ErrorFallbackComponent,\n mount ?? mountClient,\n );\n};\n"],"mappings":";;AACA;AACA,SAASA,WAAW,EAAEC,UAAU,QAAQ,kBAAkB;AAE1D,SAASC,GAAG,QAAQ,0BAA0B;AAC9C,OAAOC,YAAY,MAAM,cAAc;AAEvC,OAAOC,KAAK,MAAM,wBAAwB;AAE1C,OAAOC,GAAG,MAAM,oBAAoB;AAEpC,SAASC,oBAAoB,QAAQ,SAAS;AAC9C,OAAOC,cAAc,MAAM,+BAA+B;AAE1D,OAAOC,SAAS,MAAM,aAAa;AACnC,SACEC,oBAAoB,EACpBC,iBAAiB,EACjBC,UAAU,QACL,uBAAuB;AAE9B,SACEC,0BAA0B,EAC1BC,mBAAmB,EACnBC,mBAAmB,QACd,8BAA8B;AACrC,SAASC,wBAAwB,QAAQ,+BAA+B;AACxE,SAASC,WAAW,QAAQ,wBAAwB;AACpD,SAASC,YAAY,QAAQ,yBAAyB;AACtD,SAASC,eAAe,QAAQ,+BAA+B;AAE/D,SAASC,cAAc,EAAEC,OAAO,QAAQ,gCAAgC;AAExE,SAASC,kBAAkB,EAAEC,cAAc,QAAQ,eAAe;AAElE,SAASC,IAAI,QAAQ,QAAQ;AAE7B,SAASC,uBAAuB,QAAQ,kCAAkC;AAY1E,OAAOC,WAAW,MAAM,4BAA4B;AACpD,SAASC,aAAa,QAAQ,UAAU;AAAC,SAAAC,GAAA,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;IAAEgD;EAAc,CAAC,GAAGV,WAAW,CAC1CC,cAAc,EACdI,iBACF,CAAC;EAEDY,qBAAqB,CACnBvD,KAAK,EACLgD,aAAa,EACbpC,KAAK,EACL4C,MAAM,EACNC,sBAAsB,EACtBC,KAAK,IAAII,WACX,CAAC;AACH,CAAC","ignoreList":[]}
1
+ {"version":3,"file":"client.js","names":["hydrateRoot","createRoot","has","setImmediate","Cache","xhr","createBrowserHistory","configureStore","rehydrate","getBasePathModularUI","getBasePathServer","getSetting","setAllContentInDataSetting","setDateTimeSettings","setLoginPreferences","showXHRErrorNotification","handleError","loginSuccess","updateEntryDate","locationChange","replace","JsonParseException","FetchException","Init","handleBeforeRenderHooks","createTheme","receiveLocale","jsx","_jsx","parseDataToJSON","data","JSON","parse","error","getDataFromServer","_context","dataElement","document","querySelector","Error","_trimInstanceProperty","textContent","call","setUnhandledRejectionEvent","store","window","onunhandledrejection","event","detail","errorMessage","reason","message","toString","dispatch","initThemeSettings","state","theme","storedTheme","preferences","handleLocale","locale","getState","i18n","handleRedirectURI","urlParams","_URLSearchParams","location","search","redirectURI","get","url","catch","e","id","LOGIN_PATH","from","pathname","modal","setModelCatalogEntryDate","entryDateFromUrl","hasItem","getItem","setupClient","customReducers","beforeRenderHooks","contextPath","clear","browserHistory","basename","routerHistory","loadOtherBrowserTabs","response","listen","action","body","className","addContentLoadedEvent","render","ErrorFallbackComponent","mount","addEventListener","applicationNode","children","mountClient","element","isSSR","root","client"],"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 ErrorFallbackComponent,\n mount ?? mountClient,\n );\n};\n"],"mappings":";;AACA;AACA,SAASA,WAAW,EAAEC,UAAU,QAAQ,kBAAkB;AAE1D,SAASC,GAAG,QAAQ,0BAA0B;AAC9C,OAAOC,YAAY,MAAM,cAAc;AAEvC,OAAOC,KAAK,MAAM,wBAAwB;AAE1C,OAAOC,GAAG,MAAM,oBAAoB;AAEpC,SAASC,oBAAoB,QAAQ,SAAS;AAC9C,OAAOC,cAAc,MAAM,+BAA+B;AAE1D,OAAOC,SAAS,MAAM,aAAa;AACnC,SACEC,oBAAoB,EACpBC,iBAAiB,EACjBC,UAAU,QACL,uBAAuB;AAE9B,SACEC,0BAA0B,EAC1BC,mBAAmB,EACnBC,mBAAmB,QACd,8BAA8B;AACrC,SAASC,wBAAwB,QAAQ,+BAA+B;AACxE,SAASC,WAAW,QAAQ,wBAAwB;AACpD,SAASC,YAAY,QAAQ,yBAAyB;AACtD,SAASC,eAAe,QAAQ,+BAA+B;AAE/D,SAASC,cAAc,EAAEC,OAAO,QAAQ,gCAAgC;AAExE,SAASC,kBAAkB,EAAEC,cAAc,QAAQ,eAAe;AAElE,SAASC,IAAI,QAAQ,QAAQ;AAE7B,SAASC,uBAAuB,QAAQ,kCAAkC;AAY1E,OAAOC,WAAW,MAAM,4BAA4B;AACpD,SAASC,aAAa,QAAQ,UAAU;AAAC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createHead, handleErrors, dehydrate } from "./serverUtil";
12
12
  import { jsx as _jsx } from "react/jsx-runtime";
13
13
  /**
14
14
  */
15
- const renderSSRComplete = _ref => {
16
- let {
17
- store,
18
- theme,
19
- UUID = "",
20
- requestHref,
21
- render,
22
- ErrorPage,
23
- template = htmlpage
24
- } = _ref;
15
+ const renderSSRComplete = ({
16
+ store,
17
+ theme,
18
+ UUID = "",
19
+ requestHref,
20
+ render,
21
+ ErrorPage,
22
+ template = htmlpage
23
+ }) => {
25
24
  const helmetContext = {
26
25
  helmet: {}
27
26
  };
@@ -1 +1 @@
1
- {"version":3,"file":"renderSSRComplete.js","names":["renderToString","Provider","StaticRouter","Router","HelmetProvider","ServerStyleSheet","StyleSheetManager","createSSRComplete","htmlpage","getBasePathServer","ThemeProvider","ErrorBoundary","createHead","handleErrors","dehydrate","jsx","_jsx","renderSSRComplete","_ref","store","theme","UUID","requestHref","render","ErrorPage","template","helmetContext","helmet","routerContext","sheet","location","toLocation","basePath","children","instance","context","basename","then","appHTML","head","contextPath","html","state","catch","error","errorMessage","message","errorResource","fileName","errorLine","lineNumber","errorStack","stack"],"sources":["../../src/react-server/renderSSRComplete.js"],"sourcesContent":["// @flow\nimport { renderToString } from \"react-dom/server\";\nimport { Provider } from \"react-redux\";\nimport { StaticRouter as Router } from \"react-router\";\n\nimport { HelmetProvider } from \"react-helmet-async\";\n\nimport { ServerStyleSheet, StyleSheetManager } from \"styled-components\";\n\nimport createSSRComplete from \"./createSSRComplete\";\nimport htmlpage from \"./htmlpage\";\n\nimport { getBasePathServer } from \"../constants/Settings\";\n\nimport ThemeProvider from \"../react-theme/ThemeProvider\";\nimport ErrorBoundary from \"../react/ErrorBoundary\";\n\nimport { createHead, handleErrors, dehydrate } from \"./serverUtil\";\n\nimport type { Theme } from \"../react-theme/types\";\nimport type { ReduxStore } from \"../redux/types\";\nimport type Href from \"../models/href/Href\";\nimport type { TemplateProps } from \"./htmlpage\";\nimport type { Location } from \"react-router\";\n\ntype Props = {\n store: ReduxStore,\n theme: Theme,\n UUID: string,\n requestHref: Href,\n render: Function,\n ErrorPage: any,\n template?: (TemplateProps) => string,\n};\n/**\n */\nconst renderSSRComplete = ({\n store,\n theme,\n UUID = \"\",\n requestHref,\n render,\n ErrorPage,\n template = htmlpage,\n}: Props): Promise<string> => {\n const helmetContext = { helmet: {} };\n const routerContext = {};\n\n const sheet = new ServerStyleSheet();\n\n // $FlowFixMe[incompatible-type]\n // $FlowFixMe[prop-missing]\n const location: Location = requestHref.toLocation();\n\n const basePath = getBasePathServer();\n\n return createSSRComplete(store, () =>\n renderToString(\n <Provider store={store}>\n <StyleSheetManager sheet={sheet.instance}>\n <ThemeProvider theme={theme}>\n <HelmetProvider context={helmetContext}>\n <ErrorBoundary>\n <Router\n basename={basePath}\n location={location}\n context={routerContext}\n >\n {render()}\n </Router>\n </ErrorBoundary>\n </HelmetProvider>\n </ThemeProvider>\n </StyleSheetManager>\n </Provider>,\n ),\n )\n .then((appHTML) => {\n handleErrors(store);\n const head = createHead(sheet, UUID, helmetContext);\n return template({\n contextPath: basePath,\n html: appHTML,\n head,\n state: dehydrate(store),\n UUID,\n });\n })\n .catch((error) =>\n template({\n contextPath: basePath,\n html: renderToString(\n <StyleSheetManager sheet={sheet.instance}>\n <ThemeProvider theme={theme}>\n <ErrorPage\n errorMessage={error.message}\n errorResource={error.fileName}\n errorLine={error.lineNumber}\n errorStack={error.stack}\n />\n </ThemeProvider>\n </StyleSheetManager>,\n ),\n head: helmetContext.helmet,\n state: \"\",\n UUID,\n }),\n );\n};\n\nexport default renderSSRComplete;\n"],"mappings":"AACA,SAASA,cAAc,QAAQ,kBAAkB;AACjD,SAASC,QAAQ,QAAQ,aAAa;AACtC,SAASC,YAAY,IAAIC,MAAM,QAAQ,cAAc;AAErD,SAASC,cAAc,QAAQ,oBAAoB;AAEnD,SAASC,gBAAgB,EAAEC,iBAAiB,QAAQ,mBAAmB;AAEvE,OAAOC,iBAAiB,MAAM,qBAAqB;AACnD,OAAO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AC,CACF;MAAC,CACJ;IAAC,CACC;EAAC,CACZ,CACZ,CACF,CAAC,CACEc,IAAI,CAAEC,OAAO,IAAK;IACjBzB,YAAY,CAACM,KAAK,CAAC;IACnB,MAAMoB,IAAI,GAAG3B,UAAU,CAACiB,KAAK,EAAER,IAAI,EAAEK,aAAa,CAAC;IACnD,OAAOD,QAAQ,CAAC;MACde,WAAW,EAAER,QAAQ;MACrBS,IAAI,EAAEH,OAAO;MACbC,IAAI;MACJG,KAAK,EAAE5B,SAAS,CAACK,KAAK,CAAC;MACvBE;IACF,CAAC,CAAC;EACJ,CAAC,CAAC,CACDsB,KAAK,CAAEC,KAAK,IACXnB,QAAQ,CAAC;IACPe,WAAW,EAAER,QAAQ;IACrBS,IAAI,EAAEzC,cAAc,cAClBgB,IAAA,CAACV,iBAAiB;MAACuB,KAAK,EAAEA,KAAK,CAACK,QAAS;MAAAD,QAAA,eACvCjB,IAAA,CAACN,aAAa;QAACU,KAAK,EAAEA,KAAM;QAAAa,QAAA,eAC1BjB,IAAA,CAACQ,SAAS;UACRqB,YAAY,EAAED,KAAK,CAACE,OAAQ;UAC5BC,aAAa,EAAEH,KAAK,CAACI,QAAS;UAC9BC,SAAS,EAAEL,KAAK,CAACM,UAAW;UAC5BC,UAAU,EAAEP,KAAK,CAACQ;QAAM,CACzB;MAAC,CACW;IAAC,CACC,CACrB,CAAC;IACDb,IAAI,EAAEb,aAAa,CAACC,MAAM;IAC1Be,KAAK,EAAE,EAAE;IACTrB;EACF,CAAC,CACH,CAAC;AACL,CAAC;AAED,eAAeJ,iBAAiB","ignoreList":[]}
1
+ {"version":3,"file":"renderSSRComplete.js","names":["renderToString","Provider","StaticRouter","Router","HelmetProvider","ServerStyleSheet","StyleSheetManager","createSSRComplete","htmlpage","getBasePathServer","ThemeProvider","ErrorBoundary","createHead","handleErrors","dehydrate","jsx","_jsx","renderSSRComplete","store","theme","UUID","requestHref","render","ErrorPage","template","helmetContext","helmet","routerContext","sheet","location","toLocation","basePath","children","instance","context","basename","then","appHTML","head","contextPath","html","state","catch","error","errorMessage","message","errorResource","fileName","errorLine","lineNumber","errorStack","stack"],"sources":["../../src/react-server/renderSSRComplete.js"],"sourcesContent":["// @flow\nimport { renderToString } from \"react-dom/server\";\nimport { Provider } from \"react-redux\";\nimport { StaticRouter as Router } from \"react-router\";\n\nimport { HelmetProvider } from \"react-helmet-async\";\n\nimport { ServerStyleSheet, StyleSheetManager } from \"styled-components\";\n\nimport createSSRComplete from \"./createSSRComplete\";\nimport htmlpage from \"./htmlpage\";\n\nimport { getBasePathServer } from \"../constants/Settings\";\n\nimport ThemeProvider from \"../react-theme/ThemeProvider\";\nimport ErrorBoundary from \"../react/ErrorBoundary\";\n\nimport { createHead, handleErrors, dehydrate } from \"./serverUtil\";\n\nimport type { Theme } from \"../react-theme/types\";\nimport type { ReduxStore } from \"../redux/types\";\nimport type Href from \"../models/href/Href\";\nimport type { TemplateProps } from \"./htmlpage\";\nimport type { Location } from \"react-router\";\n\ntype Props = {\n store: ReduxStore,\n theme: Theme,\n UUID: string,\n requestHref: Href,\n render: Function,\n ErrorPage: any,\n template?: (TemplateProps) => string,\n};\n/**\n */\nconst renderSSRComplete = ({\n store,\n theme,\n UUID = \"\",\n requestHref,\n render,\n ErrorPage,\n template = htmlpage,\n}: Props): Promise<string> => {\n const helmetContext = { helmet: {} };\n const routerContext = {};\n\n const sheet = new ServerStyleSheet();\n\n // $FlowFixMe[incompatible-type]\n // $FlowFixMe[prop-missing]\n const location: Location = requestHref.toLocation();\n\n const basePath = getBasePathServer();\n\n return createSSRComplete(store, () =>\n renderToString(\n <Provider store={store}>\n <StyleSheetManager sheet={sheet.instance}>\n <ThemeProvider theme={theme}>\n <HelmetProvider context={helmetContext}>\n <ErrorBoundary>\n <Router\n basename={basePath}\n location={location}\n context={routerContext}\n >\n {render()}\n </Router>\n </ErrorBoundary>\n </HelmetProvider>\n </ThemeProvider>\n </StyleSheetManager>\n </Provider>,\n ),\n )\n .then((appHTML) => {\n handleErrors(store);\n const head = createHead(sheet, UUID, helmetContext);\n return template({\n contextPath: basePath,\n html: appHTML,\n head,\n state: dehydrate(store),\n UUID,\n });\n })\n .catch((error) =>\n template({\n contextPath: basePath,\n html: renderToString(\n <StyleSheetManager sheet={sheet.instance}>\n <ThemeProvider theme={theme}>\n <ErrorPage\n errorMessage={error.message}\n errorResource={error.fileName}\n errorLine={error.lineNumber}\n errorStack={error.stack}\n />\n </ThemeProvider>\n </StyleSheetManager>,\n ),\n head: helmetContext.helmet,\n state: \"\",\n UUID,\n }),\n );\n};\n\nexport default renderSSRComplete;\n"],"mappings":"AACA,SAASA,cAAc,QAAQ,kBAAkB;AACjD,SAASC,QAAQ,QAAQ,aAAa;AACtC,SAASC,YAAY,IAAIC,MAAM,QAAQ,cAAc;AAErD,SAASC,cAAc,QAAQ,oBAAoB;AAEnD,SAASC,gBAAgB,EAAEC,iBAAiB,QAAQ,mBAAmB;AAEvE,OAAOC,iBAAiB,MAAM,qBAAqB;AACnD,OAAOC,QAAQ,MAAM,YAAY;AAEjC,SAASC,iBAAiB,QAAQ,uBAAuB;AAEzD,OAAOC,aAAa,MAAM,8BAA8B;AACxD,OAAOC,aAAa,MAAM,wBAAwB;AAElD,SAASC,UAAU,EAAEC,YAAY,EAAEC,SAAS,QAAQ,cAAc;AAAC,SAAAC,GAAA,IAAAC,IAAA;AAiBnE;AACA;AACA,MAAMC,iBAAiB,GAAGA,CAAC;EACzBC,KAAK;EACLC,KAAK;EACLC,IAAI,GAAG,EAAE;EACTC,WAAW;EACXC,MAAM;EACNC,SAAS;EACTC,QAAQ,GAAGhB;AACN,CAAC,KAAsB;EAC5B,MAAMiB,aAAa,GAAG;IAAEC,MAAM,EAAE,CAAC;EAAE,CAAC;EACpC,MAAMC,aAAa,GAAG,CAAC,CAAC;EAExB,MAAMC,KAAK,GAAG,IAAIvB,gBAAgB,CAAC,CAAC;;EAEpC;EACA;EACA,MAAMwB,QAAkB,GAAGR,WAAW,CAACS,UAAU,CAAC,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AA,CAACO,SAAS;UACRqB,YAAY,EAAED,KAAK,CAACE,OAAQ;UAC5BC,aAAa,EAAEH,KAAK,CAACI,QAAS;UAC9BC,SAAS,EAAEL,KAAK,CAACM,UAAW;UAC5BC,UAAU,EAAEP,KAAK,CAACQ;QAAM,CACzB;MAAC,CACW;IAAC,CACC,CACrB,CAAC;IACDb,IAAI,EAAEb,aAAa,CAACC,MAAM;IAC1Be,KAAK,EAAE,EAAE;IACTrB;EACF,CAAC,CACH,CAAC;AACL,CAAC;AAED,eAAeH,iBAAiB","ignoreList":[]}
@@ -8,14 +8,13 @@ import htmlpage from "./htmlpage";
8
8
  import { jsx as _jsx } from "react/jsx-runtime";
9
9
  /**
10
10
  */
11
- const renderSSRMinimal = _ref => {
12
- let {
13
- store,
14
- theme,
15
- UUID = "",
16
- render,
17
- template = htmlpage
18
- } = _ref;
11
+ const renderSSRMinimal = ({
12
+ store,
13
+ theme,
14
+ UUID = "",
15
+ render,
16
+ template = htmlpage
17
+ }) => {
19
18
  const sheet = new ServerStyleSheet();
20
19
  const appHTML = renderToString(/*#__PURE__*/_jsx(Provider, {
21
20
  store: store,
@@ -1 +1 @@
1
- {"version":3,"file":"renderSSRMinimal.js","names":["renderToString","Provider","ServerStyleSheet","StyleSheetManager","ThemeProvider","getBasePathServer","createHead","dehydrate","htmlpage","jsx","_jsx","renderSSRMinimal","_ref","store","theme","UUID","render","template","sheet","appHTML","children","instance","head","contextPath","html","state"],"sources":["../../src/react-server/renderSSRMinimal.js"],"sourcesContent":["// @flow\nimport { renderToString } from \"react-dom/server\";\n\nimport { Provider } from \"react-redux\";\n\nimport { ServerStyleSheet, StyleSheetManager } from \"styled-components\";\nimport ThemeProvider from \"../react-theme/ThemeProvider\";\n\nimport { getBasePathServer } from \"../constants/Settings\";\n\nimport { createHead, dehydrate } from \"./serverUtil\";\nimport htmlpage from \"./htmlpage\";\n\nimport type { Theme } from \"../react-theme/types\";\nimport type { ReduxStore } from \"../redux/types\";\nimport type { TemplateProps } from \"./htmlpage\";\ntype Props = {\n store: ReduxStore,\n theme?: Theme | Array<Theme>,\n UUID: string,\n render: Function,\n template?: (TemplateProps) => string,\n};\n\n/**\n */\nconst renderSSRMinimal = ({\n store,\n theme,\n UUID = \"\",\n render,\n template = htmlpage,\n}: Props): string => {\n const sheet = new ServerStyleSheet();\n\n const appHTML = renderToString(\n <Provider store={store}>\n <StyleSheetManager sheet={sheet.instance}>\n <ThemeProvider theme={theme}>{render()}</ThemeProvider>\n </StyleSheetManager>\n </Provider>,\n );\n\n const head = createHead(sheet, UUID);\n return template({\n contextPath: getBasePathServer(),\n html: appHTML,\n head,\n state: dehydrate(store),\n UUID,\n });\n};\n\nexport default renderSSRMinimal;\n"],"mappings":"AACA,SAASA,cAAc,QAAQ,kBAAkB;AAEjD,SAASC,QAAQ,QAAQ,aAAa;AAEtC,SAASC,gBAAgB,EAAEC,iBAAiB,QAAQ,mBAAmB;AACvE,OAAOC,aAAa,MAAM,8BAA8B;AAExD,SAASC,iBAAiB,QAAQ,uBAAuB;AAEzD,SAASC,UAAU,EAAEC,SAAS,QAAQ,cAAc;AACpD,OAAOC,QAAQ,MAAM,YAAY;AAAC,SAAAC,GAAA,IAAAC,IAAA;AAalC;AACA;AACA,MAAMC,gBAAgB,GAAGC,IAAA,IAMJ;EAAA,IANK;IACxBC,KAAK;IACLC,KAAK;IACLC,IAAI,GAAG,EAAE;IACTC,MAAM;IACNC,QAAQ,GAAGT;EACN,CAAC,GAAAI,IAAA;EACN,MAAMM,KAAK,GAAG,IAAIhB,gBAAgB,CAAC,CAAC;EAEpC,MAAMiB,OAAO,GAAGnB,cAAc,cAC5BU,IAAA,CAACT,QAAQ;IAACY,KAAK,EAAEA,KAAM;IAAAO,QAAA,eACrBV,IAAA,CAACP,iBAAiB;MAACe,KAAK,EAAEA,KAAK,CAACG,QAAS;MAAAD,QAAA,eACvCV,IAAA,CAACN,aAAa;QAACU,KAAK,EAAEA,KAAM;QAAAM,QAAA,EAAEJ,MAAM,CAAC;MAAC,CAAgB;IAAC,CACtC;EAAC,CACZ,CACZ,CAAC;EAED,MAAMM,IAAI,GAAGhB,UAAU,CAACY,KAAK,EAAEH,IAAI,CAAC;EACpC,OAAOE,QAAQ,CAAC;IACdM,WAAW,EAAElB,iBAAiB,CAAC,CAAC;IAChCmB,IAAI,EAAEL,OAAO;IACbG,IAAI;IACJG,KAAK,EAAElB,SAAS,CAACM,KAAK,CAAC;IACvBE;EACF,CAAC,CAAC;AACJ,CAAC;AAED,eAAeJ,gBAAgB","ignoreList":[]}
1
+ {"version":3,"file":"renderSSRMinimal.js","names":["renderToString","Provider","ServerStyleSheet","StyleSheetManager","ThemeProvider","getBasePathServer","createHead","dehydrate","htmlpage","jsx","_jsx","renderSSRMinimal","store","theme","UUID","render","template","sheet","appHTML","children","instance","head","contextPath","html","state"],"sources":["../../src/react-server/renderSSRMinimal.js"],"sourcesContent":["// @flow\nimport { renderToString } from \"react-dom/server\";\n\nimport { Provider } from \"react-redux\";\n\nimport { ServerStyleSheet, StyleSheetManager } from \"styled-components\";\nimport ThemeProvider from \"../react-theme/ThemeProvider\";\n\nimport { getBasePathServer } from \"../constants/Settings\";\n\nimport { createHead, dehydrate } from \"./serverUtil\";\nimport htmlpage from \"./htmlpage\";\n\nimport type { Theme } from \"../react-theme/types\";\nimport type { ReduxStore } from \"../redux/types\";\nimport type { TemplateProps } from \"./htmlpage\";\ntype Props = {\n store: ReduxStore,\n theme?: Theme | Array<Theme>,\n UUID: string,\n render: Function,\n template?: (TemplateProps) => string,\n};\n\n/**\n */\nconst renderSSRMinimal = ({\n store,\n theme,\n UUID = \"\",\n render,\n template = htmlpage,\n}: Props): string => {\n const sheet = new ServerStyleSheet();\n\n const appHTML = renderToString(\n <Provider store={store}>\n <StyleSheetManager sheet={sheet.instance}>\n <ThemeProvider theme={theme}>{render()}</ThemeProvider>\n </StyleSheetManager>\n </Provider>,\n );\n\n const head = createHead(sheet, UUID);\n return template({\n contextPath: getBasePathServer(),\n html: appHTML,\n head,\n state: dehydrate(store),\n UUID,\n });\n};\n\nexport default renderSSRMinimal;\n"],"mappings":"AACA,SAASA,cAAc,QAAQ,kBAAkB;AAEjD,SAASC,QAAQ,QAAQ,aAAa;AAEtC,SAASC,gBAAgB,EAAEC,iBAAiB,QAAQ,mBAAmB;AACvE,OAAOC,aAAa,MAAM,8BAA8B;AAExD,SAASC,iBAAiB,QAAQ,uBAAuB;AAEzD,SAASC,UAAU,EAAEC,SAAS,QAAQ,cAAc;AACpD,OAAOC,QAAQ,MAAM,YAAY;AAAC,SAAAC,GAAA,IAAAC,IAAA;AAalC;AACA;AACA,MAAMC,gBAAgB,GAAGA,CAAC;EACxBC,KAAK;EACLC,KAAK;EACLC,IAAI,GAAG,EAAE;EACTC,MAAM;EACNC,QAAQ,GAAGR;AACN,CAAC,KAAa;EACnB,MAAMS,KAAK,GAAG,IAAIf,gBAAgB,CAAC,CAAC;EAEpC,MAAMgB,OAAO,GAAGlB,cAAc,cAC5BU,IAAA,CAACT,QAAQ;IAACW,KAAK,EAAEA,KAAM;IAAAO,QAAA,eACrBT,IAAA,CAACP,iBAAiB;MAACc,KAAK,EAAEA,KAAK,CAACG,QAAS;MAAAD,QAAA,eACvCT,IAAA,CAACN,aAAa;QAACS,KAAK,EAAEA,KAAM;QAAAM,QAAA,EAAEJ,MAAM,CAAC;MAAC,CAAgB;IAAC,CACtC;EAAC,CACZ,CACZ,CAAC;EAED,MAAMM,IAAI,GAAGf,UAAU,CAACW,KAAK,EAAEH,IAAI,CAAC;EACpC,OAAOE,QAAQ,CAAC;IACdM,WAAW,EAAEjB,iBAAiB,CAAC,CAAC;IAChCkB,IAAI,EAAEL,OAAO;IACbG,IAAI;IACJG,KAAK,EAAEjB,SAAS,CAACK,KAAK,CAAC;IACvBE;EACF,CAAC,CAAC;AACJ,CAAC;AAED,eAAeH,gBAAgB","ignoreList":[]}
@@ -7,18 +7,17 @@ import renderSSRMinimal from "./renderSSRMinimal";
7
7
  import createTheme from "../react-theme/createTheme";
8
8
  /**
9
9
  */
10
- const serverNoSSR = _ref => {
11
- let {
12
- request,
13
- locales,
14
- customReducers,
15
- serverPreferences = [],
16
- theme,
17
- render,
18
- template,
19
- beforeRenderHooks,
20
- preloadApplication = true
21
- } = _ref;
10
+ const serverNoSSR = ({
11
+ request,
12
+ locales,
13
+ customReducers,
14
+ serverPreferences = [],
15
+ theme,
16
+ render,
17
+ template,
18
+ beforeRenderHooks,
19
+ preloadApplication = true
20
+ }) => {
22
21
  const isPreviewCheck = request.getHeader("X-BI-Preview-Available");
23
22
  if (isPreviewCheck) {
24
23
  return "<h1>Preview Available</h1>";
@@ -1 +1 @@
1
- {"version":3,"file":"serverNoSSR.js","names":["createUUID","getFullRequestHref","createReduxStore","setI18n","setApplication","setServerPreferences","setConfigurationTheme","handleErrors","handleBeforeRenderHooks","renderSSRMinimal","createTheme","serverNoSSR","_ref","request","locales","customReducers","serverPreferences","theme","render","template","beforeRenderHooks","preloadApplication","isPreviewCheck","getHeader","UUID","__webpack_nonce__","requestHref","store","storedTheme","getState","preferences"],"sources":["../../src/react-server/serverNoSSR.js"],"sourcesContent":["// @flow\nimport \"./contextPath\";\n\nimport createUUID from \"../utils/helpers/createUUID\";\nimport { getFullRequestHref } from \"./requestInformation\";\n\nimport {\n createReduxStore,\n setI18n,\n setApplication,\n setServerPreferences,\n setConfigurationTheme,\n handleErrors,\n} from \"./serverUtil\";\n\nimport { handleBeforeRenderHooks } from \"../redux/store/beforeRenderHooks\";\n\nimport renderSSRMinimal from \"./renderSSRMinimal\";\n\nimport createTheme from \"../react-theme/createTheme\";\n\nimport type { TemplateProps } from \"./htmlpage\";\nimport type { BeforeRenderHook } from \"../redux/store/beforeRenderHooks\";\nimport type { PreferenceValue } from \"./serverUtil\";\nimport type { LocaleConfiguration } from \"../i18n/types\";\nimport type { Theme } from \"../react-theme/types\";\n\ntype serverProps = {\n request: HttpServletRequestJava,\n locales?: Array<LocaleConfiguration>,\n customReducers?: Object,\n theme?: Theme | Array<Theme>,\n serverPreferences?: Array<string | PreferenceValue>,\n render: Function,\n template?: (TemplateProps) => string,\n beforeRenderHooks?: Array<BeforeRenderHook>,\n preloadApplication?: boolean,\n};\n\n/**\n */\nconst serverNoSSR = ({\n request,\n locales,\n customReducers,\n serverPreferences = [],\n theme,\n render,\n template,\n beforeRenderHooks,\n preloadApplication = true,\n}: serverProps): string => {\n const isPreviewCheck = request.getHeader(\"X-BI-Preview-Available\");\n if (isPreviewCheck) {\n return \"<h1>Preview Available</h1>\";\n }\n\n const UUID = createUUID();\n __webpack_nonce__ = UUID; // NOSONAR\n\n const requestHref = getFullRequestHref(request);\n\n const store = createReduxStore(requestHref, customReducers);\n\n setServerPreferences(store, serverPreferences);\n setConfigurationTheme(store);\n\n if (theme) {\n const storedTheme = store.getState()?.preferences?.theme;\n //$FlowFixMe[incompatible-call]\n createTheme(storedTheme, theme);\n }\n\n setI18n(store, locales, request);\n\n if (preloadApplication) {\n setApplication(store);\n }\n\n handleErrors(store);\n\n handleBeforeRenderHooks(beforeRenderHooks, { store, request });\n\n return renderSSRMinimal({ store, theme, UUID, render, template });\n};\n\nexport default serverNoSSR;\n"],"mappings":"AACA,OAAO,eAAe;AAEtB,OAAOA,UAAU,MAAM,6BAA6B;AACpD,SAASC,kBAAkB,QAAQ,sBAAsB;AAEzD,SACEC,gBAAgB,EAChBC,OAAO,EACPC,cAAc,EACdC,oBAAoB,EACpBC,qBAAqB,EACrBC,YAAY,QACP,cAAc;AAErB,SAASC,uBAAuB,QAAQ,kCAAkC;AAE1E,OAAOC,gBAAgB,MAAM,oBAAoB;AAEjD,OAAOC,WAAW,MAAM,4BAA4B;AAoBpD;AACA;AACA,MAAMC,WAAW,GAAGC,IAAA,IAUO;EAAA,IAVN;IACnBC,OAAO;IACPC,OAAO;IACPC,cAAc;IACdC,iBAAiB,GAAG,EAAE;IACtBC,KAAK;IACLC,MAAM;IACNC,QAAQ;IACRC,iBAAiB;IACjBC,kBAAkB,GAAG;EACV,CAAC,GAAAT,IAAA;EACZ,MAAMU,cAAc,GAAGT,OAAO,CAACU,SAAS,CAAC,wBAAwB,CAAC;EAClE,IAAID,cAAc,EAAE;IAClB,OAAO,4BAA4B;EACrC;EAEA,MAAME,IAAI,GAAGxB,UAAU,CAAC,CAAC;EACzByB,iBAAiB,GAAGD,IAAI,CAAC,CAAC;;EAE1B,MAAME,WAAW,GAAGzB,kBAAkB,CAACY,OAAO,CAAC;EAE/C,MAAMc,KAAK,GAAGzB,gBAAgB,CAACwB,WAAW,EAAEX,cAAc,CAAC;EAE3DV,oBAAoB,CAACsB,KAAK,EAAEX,iBAAiB,CAAC;EAC9CV,qBAAqB,CAACqB,KAAK,CAAC;EAE5B,IAAIV,KAAK,EAAE;IACT,MAAMW,WAAW,GAAGD,KAAK,CAACE,QAAQ,CAAC,CAAC,EAAEC,WAAW,EAAEb,KAAK;IACxD;IACAP,WAAW,CAACkB,WAAW,EAAEX,KAAK,CAAC;EACjC;EAEAd,OAAO,CAACwB,KAAK,EAAEb,OAAO,EAAED,OAAO,CAAC;EAEhC,IAAIQ,kBAAkB,EAAE;IACtBjB,cAAc,CAACuB,KAAK,CAAC;EACvB;EAEApB,YAAY,CAACoB,KAAK,CAAC;EAEnBnB,uBAAuB,CAACY,iBAAiB,EAAE;IAAEO,KAAK;IAAEd;EAAQ,CAAC,CAAC;EAE9D,OAAOJ,gBAAgB,CAAC;IAAEkB,KAAK;IAAEV,KAAK;IAAEO,IAAI;IAAEN,MAAM;IAAEC;EAAS,CAAC,CAAC;AACnE,CAAC;AAED,eAAeR,WAAW","ignoreList":[]}
1
+ {"version":3,"file":"serverNoSSR.js","names":["createUUID","getFullRequestHref","createReduxStore","setI18n","setApplication","setServerPreferences","setConfigurationTheme","handleErrors","handleBeforeRenderHooks","renderSSRMinimal","createTheme","serverNoSSR","request","locales","customReducers","serverPreferences","theme","render","template","beforeRenderHooks","preloadApplication","isPreviewCheck","getHeader","UUID","__webpack_nonce__","requestHref","store","storedTheme","getState","preferences"],"sources":["../../src/react-server/serverNoSSR.js"],"sourcesContent":["// @flow\nimport \"./contextPath\";\n\nimport createUUID from \"../utils/helpers/createUUID\";\nimport { getFullRequestHref } from \"./requestInformation\";\n\nimport {\n createReduxStore,\n setI18n,\n setApplication,\n setServerPreferences,\n setConfigurationTheme,\n handleErrors,\n} from \"./serverUtil\";\n\nimport { handleBeforeRenderHooks } from \"../redux/store/beforeRenderHooks\";\n\nimport renderSSRMinimal from \"./renderSSRMinimal\";\n\nimport createTheme from \"../react-theme/createTheme\";\n\nimport type { TemplateProps } from \"./htmlpage\";\nimport type { BeforeRenderHook } from \"../redux/store/beforeRenderHooks\";\nimport type { PreferenceValue } from \"./serverUtil\";\nimport type { LocaleConfiguration } from \"../i18n/types\";\nimport type { Theme } from \"../react-theme/types\";\n\ntype serverProps = {\n request: HttpServletRequestJava,\n locales?: Array<LocaleConfiguration>,\n customReducers?: Object,\n theme?: Theme | Array<Theme>,\n serverPreferences?: Array<string | PreferenceValue>,\n render: Function,\n template?: (TemplateProps) => string,\n beforeRenderHooks?: Array<BeforeRenderHook>,\n preloadApplication?: boolean,\n};\n\n/**\n */\nconst serverNoSSR = ({\n request,\n locales,\n customReducers,\n serverPreferences = [],\n theme,\n render,\n template,\n beforeRenderHooks,\n preloadApplication = true,\n}: serverProps): string => {\n const isPreviewCheck = request.getHeader(\"X-BI-Preview-Available\");\n if (isPreviewCheck) {\n return \"<h1>Preview Available</h1>\";\n }\n\n const UUID = createUUID();\n __webpack_nonce__ = UUID; // NOSONAR\n\n const requestHref = getFullRequestHref(request);\n\n const store = createReduxStore(requestHref, customReducers);\n\n setServerPreferences(store, serverPreferences);\n setConfigurationTheme(store);\n\n if (theme) {\n const storedTheme = store.getState()?.preferences?.theme;\n //$FlowFixMe[incompatible-call]\n createTheme(storedTheme, theme);\n }\n\n setI18n(store, locales, request);\n\n if (preloadApplication) {\n setApplication(store);\n }\n\n handleErrors(store);\n\n handleBeforeRenderHooks(beforeRenderHooks, { store, request });\n\n return renderS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,cAAc,CAACsB,KAAK,CAAC;EACvB;EAEAnB,YAAY,CAACmB,KAAK,CAAC;EAEnBlB,uBAAuB,CAACW,iBAAiB,EAAE;IAAEO,KAAK;IAAEd;EAAQ,CAAC,CAAC;EAE9D,OAAOH,gBAAgB,CAAC;IAAEiB,KAAK;IAAEV,KAAK;IAAEO,IAAI;IAAEN,MAAM;IAAEC;EAAS,CAAC,CAAC;AACnE,CAAC;AAED,eAAeP,WAAW","ignoreList":[]}
@@ -6,18 +6,17 @@ import { handleBeforeRenderHooks } from "../redux/store/beforeRenderHooks";
6
6
  import renderSSRComplete from "./renderSSRComplete";
7
7
  /**
8
8
  */
9
- const serverSSR = _ref => {
10
- let {
11
- request,
12
- locales,
13
- customReducers,
14
- serverPreferences = [],
15
- theme = null,
16
- render,
17
- ErrorPage,
18
- template,
19
- beforeRenderHooks
20
- } = _ref;
9
+ const serverSSR = ({
10
+ request,
11
+ locales,
12
+ customReducers,
13
+ serverPreferences = [],
14
+ theme = null,
15
+ render,
16
+ ErrorPage,
17
+ template,
18
+ beforeRenderHooks
19
+ }) => {
21
20
  const UUID = createUUID();
22
21
  __webpack_nonce__ = UUID; // NOSONAR
23
22
 
@@ -1 +1 @@
1
- {"version":3,"file":"serverSSR.js","names":["createUUID","getFullRequestHref","createReduxStore","setI18n","setServerPreferences","setConfigurationTheme","handleBeforeRenderHooks","renderSSRComplete","serverSSR","_ref","request","locales","customReducers","serverPreferences","theme","render","ErrorPage","template","beforeRenderHooks","UUID","__webpack_nonce__","requestHref","store"],"sources":["../../src/react-server/serverSSR.js"],"sourcesContent":["// @flow\nimport \"./contextPath\";\n\nimport createUUID from \"../utils/helpers/createUUID\";\nimport { getFullRequestHref } from \"./requestInformation\";\n\nimport {\n createReduxStore,\n setI18n,\n setServerPreferences,\n setConfigurationTheme,\n} from \"./serverUtil\";\n\nimport { handleBeforeRenderHooks } from \"../redux/store/beforeRenderHooks\";\n\nimport renderSSRComplete from \"./renderSSRComplete\";\n\nimport type { TemplateProps } from \"./htmlpage\";\nimport type { BeforeRenderHook } from \"../redux/store/beforeRenderHooks\";\nimport type { PreferenceValue } from \"./serverUtil\";\nimport type { LocaleConfiguration } from \"../i18n/types\";\ntype serverProps = {\n request: HttpServletRequestJava,\n locales?: Array<LocaleConfiguration>,\n customReducers?: Object,\n theme?: Object,\n serverPreferences?: Array<string | PreferenceValue>,\n render: Function,\n ErrorPage?: any,\n template?: (TemplateProps) => string,\n beforeRenderHooks?: Array<BeforeRenderHook>,\n};\n\n/**\n */\nconst serverSSR = ({\n request,\n locales,\n customReducers,\n serverPreferences = [],\n theme = null,\n render,\n ErrorPage,\n template,\n beforeRenderHooks,\n}: serverProps): Promise<string> => {\n const UUID = createUUID();\n __webpack_nonce__ = UUID; // NOSONAR\n\n const requestHref = getFullRequestHref(request);\n const store = createReduxStore(requestHref, customReducers);\n\n setServerPreferences(store, serverPreferences);\n setConfigurationTheme(store);\n setI18n(store, locales, request);\n\n handleBeforeRenderHooks(beforeRenderHooks, { request, store });\n\n return renderSSRComplete({\n store,\n theme,\n UUID,\n requestHref,\n render,\n ErrorPage,\n template,\n });\n};\n\nexport default serverSSR;\n"],"mappings":"AACA,OAAO,eAAe;AAEtB,OAAOA,UAAU,MAAM,6BAA6B;AACpD,SAASC,kBAAkB,QAAQ,sBAAsB;AAEzD,SACEC,gBAAgB,EAChBC,OAAO,EACPC,oBAAoB,EACpBC,qBAAqB,QAChB,cAAc;AAErB,SAASC,uBAAuB,QAAQ,kCAAkC;AAE1E,OAAOC,iBAAiB,MAAM,qBAAqB;AAkBnD;AACA;AACA,MAAMC,SAAS,GAAGC,IAAA,IAUkB;EAAA,IAVjB;IACjBC,OAAO;IACPC,OAAO;IACPC,cAAc;IACdC,iBAAiB,GAAG,EAAE;IACtBC,KAAK,GAAG,IAAI;IACZC,MAAM;IACNC,SAAS;IACTC,QAAQ;IACRC;EACW,CAAC,GAAAT,IAAA;EACZ,MAAMU,IAAI,GAAGnB,UAAU,CAAC,CAAC;EACzBoB,iBAAiB,GAAGD,IAAI,CAAC,CAAC;;EAE1B,MAAME,WAAW,GAAGpB,kBAAkB,CAACS,OAAO,CAAC;EAC/C,MAAMY,KAAK,GAAGpB,gBAAgB,CAACmB,WAAW,EAAET,cAAc,CAAC;EAE3DR,oBAAoB,CAACkB,KAAK,EAAET,iBAAiB,CAAC;EAC9CR,qBAAqB,CAACiB,KAAK,CAAC;EAC5BnB,OAAO,CAACmB,KAAK,EAAEX,OAAO,EAAED,OAAO,CAAC;EAEhCJ,uBAAuB,CAACY,iBAAiB,EAAE;IAAER,OAAO;IAAEY;EAAM,CAAC,CAAC;EAE9D,OAAOf,iBAAiB,CAAC;IACvBe,KAAK;IACLR,KAAK;IACLK,IAAI;IACJE,WAAW;IACXN,MAAM;IACNC,SAAS;IACTC;EACF,CAAC,CAAC;AACJ,CAAC;AAED,eAAeT,SAAS","ignoreList":[]}
1
+ {"version":3,"file":"serverSSR.js","names":["createUUID","getFullRequestHref","createReduxStore","setI18n","setServerPreferences","setConfigurationTheme","handleBeforeRenderHooks","renderSSRComplete","serverSSR","request","locales","customReducers","serverPreferences","theme","render","ErrorPage","template","beforeRenderHooks","UUID","__webpack_nonce__","requestHref","store"],"sources":["../../src/react-server/serverSSR.js"],"sourcesContent":["// @flow\nimport \"./contextPath\";\n\nimport createUUID from \"../utils/helpers/createUUID\";\nimport { getFullRequestHref } from \"./requestInformation\";\n\nimport {\n createReduxStore,\n setI18n,\n setServerPreferences,\n setConfigurationTheme,\n} from \"./serverUtil\";\n\nimport { handleBeforeRenderHooks } from \"../redux/store/beforeRenderHooks\";\n\nimport renderSSRComplete from \"./renderSSRComplete\";\n\nimport type { TemplateProps } from \"./htmlpage\";\nimport type { BeforeRenderHook } from \"../redux/store/beforeRenderHooks\";\nimport type { PreferenceValue } from \"./serverUtil\";\nimport type { LocaleConfiguration } from \"../i18n/types\";\ntype serverProps = {\n request: HttpServletRequestJava,\n locales?: Array<LocaleConfiguration>,\n customReducers?: Object,\n theme?: Object,\n serverPreferences?: Array<string | PreferenceValue>,\n render: Function,\n ErrorPage?: any,\n template?: (TemplateProps) => string,\n beforeRenderHooks?: Array<BeforeRenderHook>,\n};\n\n/**\n */\nconst serverSSR = ({\n request,\n locales,\n customReducers,\n serverPreferences = [],\n theme = null,\n render,\n ErrorPage,\n template,\n beforeRenderHooks,\n}: serverProps): Promise<string> => {\n const UUID = createUUID();\n __webpack_nonce__ = UUID; // NOSONAR\n\n const requestHref = getFullRequestHref(request);\n const store = createReduxStore(requestHref, customReducers);\n\n setServerPreferences(store, serverPreferences);\n setConfigurationTheme(store);\n setI18n(store, locales, request);\n\n handleBeforeRenderHooks(beforeRenderHooks, { request, store });\n\n return renderSSRComplete({\n store,\n theme,\n UUID,\n requestHref,\n render,\n ErrorPage,\n template,\n });\n};\n\nexport default serverSSR;\n"],"mappings":"AACA,OAAO,eAAe;AAEtB,OAAOA,UAAU,MAAM,6BAA6B;AACpD,SAASC,kBAAkB,QAAQ,sBAAsB;AAEzD,SACEC,gBAAgB,EAChBC,OAAO,EACPC,oBAAoB,EACpBC,qBAAqB,QAChB,cAAc;AAErB,SAASC,uBAAuB,QAAQ,kCAAkC;AAE1E,OAAOC,iBAAiB,MAAM,qBAAqB;AAkBnD;AACA;AACA,MAAMC,SAAS,GAAGA,CAAC;EACjBC,OAAO;EACPC,OAAO;EACPC,cAAc;EACdC,iBAAiB,GAAG,EAAE;EACtBC,KAAK,GAAG,IAAI;EACZC,MAAM;EACNC,SAAS;EACTC,QAAQ;EACRC;AACW,CAAC,KAAsB;EAClC,MAAMC,IAAI,GAAGlB,UAAU,CAAC,CAAC;EACzBmB,iBAAiB,GAAGD,IAAI,CAAC,CAAC;;EAE1B,MAAME,WAAW,GAAGnB,kBAAkB,CAACQ,OAAO,CAAC;EAC/C,MAAMY,KAAK,GAAGnB,gBAAgB,CAACkB,WAAW,EAAET,cAAc,CAAC;EAE3DP,oBAAoB,CAACiB,KAAK,EAAET,iBAAiB,CAAC;EAC9CP,qBAAqB,CAACgB,KAAK,CAAC;EAC5BlB,OAAO,CAACkB,KAAK,EAAEX,OAAO,EAAED,OAAO,CAAC;EAEhCH,uBAAuB,CAACW,iBAAiB,EAAE;IAAER,OAAO;IAAEY;EAAM,CAAC,CAAC;EAE9D,OAAOd,iBAAiB,CAAC;IACvBc,KAAK;IACLR,KAAK;IACLK,IAAI;IACJE,WAAW;IACXN,MAAM;IACNC,SAAS;IACTC;EACF,CAAC,CAAC;AACJ,CAAC;AAED,eAAeR,SAAS","ignoreList":[]}
@@ -33,9 +33,7 @@ const createReduxStore = (requestHref, customReducers, initialState) => {
33
33
 
34
34
  /**
35
35
  */
36
- const setI18n = function (store) {
37
- let locales = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : [];
38
- let request = arguments.length > 2 ? arguments[2] : undefined;
36
+ const setI18n = (store, locales = [], request) => {
39
37
  if (!Array.isArray(locales)) {
40
38
  throw new IllegalArgumentException("locales must be an array of objects");
41
39
  }
@@ -1 +1 @@
1
- {"version":3,"file":"serverUtil.js","names":["createMemoryHistory","has","deepmerge","configureStore","availableLocales","Locales","getPreferredLocale","setLocales","setServerPreference","setThemePreference","setPreference","setAllContentInDataSetting","setLoginPreferences","setDateTimeSettings","getEnabledLocales","IllegalArgumentException","initModels","getLocale","ModularUIRequest","createReduxStore","requestHref","customReducers","initialState","history","initialEntries","toString","store","setI18n","locales","arguments","length","undefined","request","Array","isArray","mergedLocales","_mapInstanceProperty","call","locale","code","customLocale","_findInstanceProperty","custLocale","forEach","some","push","enabledLocales","_filterInstanceProperty","_context","_includesInstanceProperty","localesInstance","preferredLocale","dispatch","setServerPreferencesFromArray","serverPreferences","serverPreference","name","defaultValue","type","setServerPreferences","preferencesProvider","isStudioContext","setConfigurationTheme","configTheme","configFileLocation","getLayoutConfigFileLocation","configFilePath","_startsWithInstanceProperty","dataFetcher","fetch","Error","setApplication","getState","application","fetchSync","connectKey","key","model","e","handleErrors","state","error","shouldThrowOnServer","dehydrate","modularui","status","lastModification","filteredState","_JSON$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,SAASA,mBAAmB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EACdZ,oBAAoB,EACpBG,qBAAqB,EACrB4B,UAAU,EACVX,YAAY,EACZI,SAAS","ignoreList":[]}
1
+ {"version":3,"file":"serverUtil.js","names":["createMemoryHistory","has","deepmerge","configureStore","availableLocales","Locales","getPreferredLocale","setLocales","setServerPreference","setThemePreference","setPreference","setAllContentInDataSetting","setLoginPreferences","setDateTimeSettings","getEnabledLocales","IllegalArgumentException","initModels","getLocale","ModularUIRequest","createReduxStore","requestHref","customReducers","initialState","history","initialEntries","toString","store","setI18n","locales","request","Array","isArray","mergedLocales","_mapInstanceProperty","call","locale","code","customLocale","_findInstanceProperty","custLocale","forEach","some","push","enabledLocales","_filterInstanceProperty","_context","_includesInstanceProperty","localesInstance","preferredLocale","dispatch","setServerPreferencesFromArray","serverPreferences","serverPreference","name","defaultValue","type","setServerPreferences","preferencesProvider","isStudioContext","setConfigurationTheme","configTheme","configFileLocation","getLayoutConfigFileLocation","configFilePath","_startsWithInstanceProperty","dataFetcher","fetch","Error","setApplication","getState","application","fetchSync","connectKey","key","model","e","handleErrors","state","error","shouldThrowOnServer","dehydrate","modularui","status","lastModification","undefined","filteredState","_JSON$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,SAASA,mBAAmB,QAAQ,SAAS;AAC7C,SAASC,GAAG,QAAQ,0BAA0B;AAC9C,OAAOC,SAAS,MAAM,WAAW;AAEjC,OAAOC,cAAc,MAAM,+BAA+B;AAE1D,SAASC,gBAAgB,QAAQ,iBAAiB;AAClD,OAAOC,OAAO,MAAM,iBAAiB;AAErC,SAASC,kBAAkB,QAAQ,sBAAsB;AACzD,SAASC,UAAU,QAAQ,4BAA4B;AAEvD,SACEC,mBAAmB,EACnBC,kBAAkB,EAClBC,aAAa,EACbC,0BAA0B,EAC1BC,mBAAmB,EACnBC,mBAAmB,QACd,8BAA8B;AAErC,SAASC,iBAAiB,QAAQ,uBAAuB;AAEzD,SAASC,wBAAwB,QAAQ,eAAe;AAExD,SAASC,UAAU,QAAQ,UAAU;AACrC,SAASC,SAAS,QAAQ,yBAAyB;AAEnD,OAAOC,gBAAgB,MAAM,+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