@configuratorware/configurator-frontendgui 1.27.3-beta.8 → 1.27.6

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/README.md +26 -5
  2. package/babel.config.js +46 -0
  3. package/package.json +102 -20
  4. package/public/ConfigurationMessagingDemo.html +55 -0
  5. package/scripts/cpPath.js +135 -0
  6. package/scripts/cpPublic.js +4 -4
  7. package/scripts/getDefaultWebpackConfig.js +10 -11
  8. package/scripts/moveLibToPackageRoot.js +40 -0
  9. package/scripts/rmDir.js +29 -0
  10. package/scripts/updateLocalPackages.js +68 -0
  11. package/scripts/utils/process.js +19 -0
  12. package/src/App/Error/ProductionErrorPage/Style.scss +1 -1
  13. package/src/App/Modules/Creator/Components/Option/index.js +0 -1
  14. package/src/App/Modules/Creator/Components/Option/index.test.js +1 -1
  15. package/src/App/Modules/Creator/Components/OptionAmount/index.test.js +1 -1
  16. package/src/App/Modules/Creator/Components/Optiondetail/index.js +7 -3
  17. package/src/App/Modules/Creator/Components/ProductPart/index.js +0 -1
  18. package/src/App/Modules/Creator/Components/ProductPart/index.test.js +1 -1
  19. package/src/App/Modules/Designer/Components/AddGalleryImage/index.story.js +1 -1
  20. package/src/App/Modules/Designer/Components/ColorPalettes/index.test.jsx +1 -1
  21. package/src/App/Modules/Designer/Components/DesignAreaControlbox/index.test.jsx +1 -1
  22. package/src/App/Modules/Designer/Components/TextControlbox/index.test.jsx +1 -1
  23. package/src/App/Reducers/Configurator/Actions.js +3 -13
  24. package/src/App/Reducers/DesignArea/Selectors.js +7 -9
  25. package/src/App/Reducers/DesignView/Actions.js +2 -1
  26. package/src/App/Reducers/DesignView/Reducer.js +10 -2
  27. package/src/App/Reducers/DesignView/__mocks__/designerViewData.js +1 -0
  28. package/src/App/Reducers/DesignView/__tests__/Reducer.test.js +22 -0
  29. package/src/App/Reducers/ImageGallery/Actions.js +1 -1
  30. package/src/App/Reducers/UI/Actions.js +0 -8
  31. package/src/App/Reducers/UI/Reducer.js +1 -3
  32. package/src/App/Screens/Configurator/Components/CalculationWidget/index.test.jsx +1 -1
  33. package/src/App/Screens/Configurator/Components/DesignApproval/index.test.jsx +1 -1
  34. package/src/App/Screens/Configurator/Components/FullScreenView/index.test.jsx +1 -1
  35. package/src/App/Screens/Configurator/Containers/AmountPrice.js +1 -1
  36. package/src/App/Screens/Configurator/Containers/Confirm.js +1 -1
  37. package/src/App/Screens/Configurator/Screen.js +1 -1
  38. package/src/App/Screens/Configurator/ThemeProvider.js +0 -1
  39. package/src/App/Services/__tests__/DesignDataService.selectViewForComponent.test.js +53 -0
  40. package/src/App/Shared/Containers/AlertMessages.js +1 -1
  41. package/src/App/Shared/Containers/AmountPrice/index.test.js +1 -1
  42. package/src/App/Shared/Containers/Error.js +1 -1
  43. package/src/App/Shared/Containers/SaveConfiguration.js +1 -1
  44. package/src/App/Translations.js +1 -1
  45. package/src/Framework/Components/Carousel/index.js +8 -29
  46. package/src/Framework/i18n.js +3 -2
  47. package/src/Shared/Components/CustomDialog.js +11 -5
  48. package/tsconfig.json +22 -0
  49. package/App/Constant.js +0 -73
  50. package/App/Error/DevelopmentErrorPage/index.js +0 -74
  51. package/App/Error/ErrorBoundary.js +0 -98
  52. package/App/Error/ProductionErrorPage/Style.scss +0 -47
  53. package/App/Error/ProductionErrorPage/index.js +0 -43
  54. package/App/Error/ProductionErrorPage/index.story.js +0 -13
  55. package/App/Error/ProductionErrorPage/res/error_gears.png +0 -0
  56. package/App/Frame.js +0 -95
  57. package/App/Modules/Creator/Components/ConfigurationvariantItem/Styles.scss +0 -33
  58. package/App/Modules/Creator/Components/ConfigurationvariantItem/index.js +0 -118
  59. package/App/Modules/Creator/Components/ConfigurationvariantSelection/Styles.scss +0 -47
  60. package/App/Modules/Creator/Components/ConfigurationvariantSelection/index.js +0 -130
  61. package/App/Modules/Creator/Components/CustomTitleEditor/Styles.scss +0 -43
  62. package/App/Modules/Creator/Components/CustomTitleEditor/index.js +0 -144
  63. package/App/Modules/Creator/Components/ExternalVisualization/index.js +0 -140
  64. package/App/Modules/Creator/Components/FastConfiguration/SelectableRow.js +0 -128
  65. package/App/Modules/Creator/Components/FastConfiguration/Styles.scss +0 -53
  66. package/App/Modules/Creator/Components/FastConfiguration/index.js +0 -280
  67. package/App/Modules/Creator/Components/FastConfigurationRow/Styles.scss +0 -45
  68. package/App/Modules/Creator/Components/FastConfigurationRow/index.js +0 -78
  69. package/App/Modules/Creator/Components/FastConfigurationSelect/Styles.scss +0 -35
  70. package/App/Modules/Creator/Components/FastConfigurationSelect/index.js +0 -251
  71. package/App/Modules/Creator/Components/FormattedNumber/index.js +0 -45
  72. package/App/Modules/Creator/Components/FormattedPrice/index.js +0 -57
  73. package/App/Modules/Creator/Components/FullScreenView/FullScreenView.js +0 -104
  74. package/App/Modules/Creator/Components/Incompatibility/OptionRule/index.js +0 -182
  75. package/App/Modules/Creator/Components/Incompatibility/RuleComponent.js +0 -88
  76. package/App/Modules/Creator/Components/Incompatibility/index.js +0 -251
  77. package/App/Modules/Creator/Components/InvalidConfigurationNotice/index.js +0 -164
  78. package/App/Modules/Creator/Components/LoginForm/Styles.scss +0 -9
  79. package/App/Modules/Creator/Components/LoginForm/index.js +0 -129
  80. package/App/Modules/Creator/Components/Option/index.js +0 -545
  81. package/App/Modules/Creator/Components/Option/index.story.js +0 -154
  82. package/App/Modules/Creator/Components/OptionAmount/index.js +0 -236
  83. package/App/Modules/Creator/Components/OptionGroup/index.js +0 -55
  84. package/App/Modules/Creator/Components/Optiondetail/ZoomImage/index.js +0 -173
  85. package/App/Modules/Creator/Components/Optiondetail/index.js +0 -497
  86. package/App/Modules/Creator/Components/Optiondetail/index.story.js +0 -117
  87. package/App/Modules/Creator/Components/OptionsList/index.js +0 -193
  88. package/App/Modules/Creator/Components/Price/Styles.scss +0 -3
  89. package/App/Modules/Creator/Components/Price/index.js +0 -79
  90. package/App/Modules/Creator/Components/ProductPart/index.js +0 -185
  91. package/App/Modules/Creator/Components/ProductPart/index.story.js +0 -88
  92. package/App/Modules/Creator/Components/ProductPartsList/index.js +0 -150
  93. package/App/Modules/Creator/Components/ProductPartsList/index.story.js +0 -101
  94. package/App/Modules/Creator/Components/SavedConfiguration/Styles.scss +0 -19
  95. package/App/Modules/Creator/Components/SavedConfiguration/index.js +0 -82
  96. package/App/Modules/Creator/Components/ShareConfiguration/Styles.scss +0 -23
  97. package/App/Modules/Creator/Components/ShareConfiguration/index.js +0 -224
  98. package/App/Modules/Creator/Components/StockInformation/index.js +0 -93
  99. package/App/Modules/Creator/Components/StoreConfigurationForm/Styles.scss +0 -5
  100. package/App/Modules/Creator/Components/StoreConfigurationForm/index.js +0 -123
  101. package/App/Modules/Creator/Components/Tools/Styles.scss +0 -44
  102. package/App/Modules/Creator/Components/Tools/index.js +0 -102
  103. package/App/Modules/Creator/Components/ValidationResult/Styles.scss +0 -45
  104. package/App/Modules/Creator/Components/ValidationResult/index.js +0 -165
  105. package/App/Modules/Creator/Components/index.js +0 -84
  106. package/App/Modules/Creator/Containers/AmountPrice/index.js +0 -26
  107. package/App/Modules/Creator/Containers/ConfigurationvariantSelection/index.js +0 -60
  108. package/App/Modules/Creator/Containers/CustomTitleEditor/index.js +0 -52
  109. package/App/Modules/Creator/Containers/FastConfiguration/index.js +0 -62
  110. package/App/Modules/Creator/Containers/FormattedPrice/index.js +0 -31
  111. package/App/Modules/Creator/Containers/Incompatibility/index.js +0 -40
  112. package/App/Modules/Creator/Containers/InvalidConfigurationNotice/index.js +0 -89
  113. package/App/Modules/Creator/Containers/LoadingOverlay/index.js +0 -26
  114. package/App/Modules/Creator/Containers/Optiondetail/index.js +0 -48
  115. package/App/Modules/Creator/Containers/OptionsList/index.js +0 -49
  116. package/App/Modules/Creator/Containers/ProductPart/index.js +0 -26
  117. package/App/Modules/Creator/Containers/ProductPartsList/index.js +0 -49
  118. package/App/Modules/Creator/Containers/SavedConfigurationContainer/index.js +0 -25
  119. package/App/Modules/Creator/Containers/ShareConfiguration/index.js +0 -42
  120. package/App/Modules/Creator/Containers/StockInformation/index.js +0 -33
  121. package/App/Modules/Creator/Containers/Tools/index.js +0 -44
  122. package/App/Modules/Creator/Containers/ValidationResult/index.js +0 -34
  123. package/App/Modules/Creator/Containers/index.js +0 -175
  124. package/App/Modules/Creator/CreatorScreen.js +0 -307
  125. package/App/Modules/Creator/Layouts/DefaultLayout.js +0 -260
  126. package/App/Modules/Creator/Styles.scss +0 -216
  127. package/App/Modules/Designer/Components/AddGalleryImage/index.js +0 -234
  128. package/App/Modules/Designer/Components/AddGalleryImage/index.story.js +0 -94
  129. package/App/Modules/Designer/Components/AddGalleryImage/index.test.js +0 -151
  130. package/App/Modules/Designer/Components/AddVisualElement/Styles.scss +0 -0
  131. package/App/Modules/Designer/Components/AddVisualElement/index.js +0 -278
  132. package/App/Modules/Designer/Components/AddVisualElement/index.story.js +0 -24
  133. package/App/Modules/Designer/Components/AddVisualElement/index.test.js +0 -47
  134. package/App/Modules/Designer/Components/CloseDesignEditor/index.js +0 -130
  135. package/App/Modules/Designer/Components/CloseGraphicsEditorButton/index.js +0 -54
  136. package/App/Modules/Designer/Components/ColorPalettes/ColorPalettesSearch.js +0 -175
  137. package/App/Modules/Designer/Components/ColorPalettes/index.js +0 -814
  138. package/App/Modules/Designer/Components/ColorPalettes/index.story.js +0 -158
  139. package/App/Modules/Designer/Components/ColorPalettes/index.test.js +0 -150
  140. package/App/Modules/Designer/Components/DesignAreaControlbox/Styles.scss +0 -0
  141. package/App/Modules/Designer/Components/DesignAreaControlbox/index.js +0 -460
  142. package/App/Modules/Designer/Components/DesignAreaControlbox/index.story.js +0 -272
  143. package/App/Modules/Designer/Components/DesignAreaControlbox/index.test.js +0 -164
  144. package/App/Modules/Designer/Components/DesignerSelectionToolbox/CustomFontOverlay.js +0 -162
  145. package/App/Modules/Designer/Components/DesignerSelectionToolbox/DesignerSelectionToolbox.js +0 -425
  146. package/App/Modules/Designer/Components/DesignerSelectionToolbox/fontItemUtils.js +0 -48
  147. package/App/Modules/Designer/Components/Dialog/index.js +0 -125
  148. package/App/Modules/Designer/Components/EditDesignButton/index.js +0 -128
  149. package/App/Modules/Designer/Components/FeedbackNotice/index.js +0 -110
  150. package/App/Modules/Designer/Components/FeedbackNotice/index.test.js +0 -16
  151. package/App/Modules/Designer/Components/FullScreenView/FullScreenView.js +0 -63
  152. package/App/Modules/Designer/Components/ImageColorPicker/ImageColorPicker.dev.js +0 -32
  153. package/App/Modules/Designer/Components/ImageColorPicker/ImageColorPicker.js +0 -430
  154. package/App/Modules/Designer/Components/ImageColorize/index.js +0 -636
  155. package/App/Modules/Designer/Components/ImageColorize/index.story.js +0 -73
  156. package/App/Modules/Designer/Components/ImageControlbox/index.js +0 -302
  157. package/App/Modules/Designer/Components/ImageEditDialog/ImageThumbnail.js +0 -171
  158. package/App/Modules/Designer/Components/ImageEditDialog/ImageUpload.js +0 -478
  159. package/App/Modules/Designer/Components/ImageEditDialog/index.js +0 -716
  160. package/App/Modules/Designer/Components/ImageEditDialog/res/baseline_colorize_black_24dp.png +0 -0
  161. package/App/Modules/Designer/Components/ImageEditDialog/res/checkers_tile.png +0 -0
  162. package/App/Modules/Designer/Components/ImageLibraryFilter/index.js +0 -179
  163. package/App/Modules/Designer/Components/ImageLibraryThumbnail/Styles.scss +0 -14
  164. package/App/Modules/Designer/Components/ImageLibraryThumbnail/index.js +0 -165
  165. package/App/Modules/Designer/Components/ObjectTools/index.js +0 -146
  166. package/App/Modules/Designer/Components/Select/index.js +0 -171
  167. package/App/Modules/Designer/Components/TextControlbox/TextFormatIcon.js +0 -48
  168. package/App/Modules/Designer/Components/TextControlbox/index.js +0 -656
  169. package/App/Modules/Designer/Components/TextControlbox/index.story.js +0 -109
  170. package/App/Modules/Designer/Components/TextControlbox/index.test.js +0 -172
  171. package/App/Modules/Designer/Containers/AddGalleryImage.js +0 -90
  172. package/App/Modules/Designer/Containers/AddVisualElement.js +0 -166
  173. package/App/Modules/Designer/Containers/CloseDesignEditor.js +0 -32
  174. package/App/Modules/Designer/Containers/CloseGraphicsEditorButton.js +0 -32
  175. package/App/Modules/Designer/Containers/ColorPalettes.js +0 -145
  176. package/App/Modules/Designer/Containers/DesignAreaControlbox.js +0 -54
  177. package/App/Modules/Designer/Containers/Designer.js +0 -37
  178. package/App/Modules/Designer/Containers/DesignerSelectionToolbox.js +0 -116
  179. package/App/Modules/Designer/Containers/EditDesignButton.js +0 -35
  180. package/App/Modules/Designer/Containers/ImageEditDialog.js +0 -1130
  181. package/App/Modules/Designer/Designer.js +0 -231
  182. package/App/Modules/Designer/DesignerScreen.js +0 -233
  183. package/App/Modules/Designer/Layouts/DefaultLayout.js +0 -196
  184. package/App/Modules/Designer/Layouts/Mobile/TwoSideBottomBar.js +0 -50
  185. package/App/Modules/Designer/Layouts/PopupAreaProvider.js +0 -186
  186. package/App/Modules/Designer/Utils/FontFaceRepository.js +0 -82
  187. package/App/Modules/Designer/Utils/ImageEditUtils.js +0 -104
  188. package/App/Modules/Designer/Utils/Transformers.js +0 -164
  189. package/App/Modules/Designer/setupDesigner.js +0 -182
  190. package/App/Modules/Designer/withActiveCanvas.js +0 -136
  191. package/App/Modules/Visualization/AlignTargetContainer.js +0 -55
  192. package/App/Modules/Visualization/CreatorAlignTarget.js +0 -41
  193. package/App/Modules/Visualization/DefaultVisualizationProvider.js +0 -105
  194. package/App/Modules/Visualization/DesignerAlignTarget.js +0 -45
  195. package/App/Modules/Visualization/Utils/getFirstDataURLFromScreenshotsObj.js +0 -20
  196. package/App/Reducers/Actions.js +0 -297
  197. package/App/Reducers/ConfigurationMode/Actions.js +0 -21
  198. package/App/Reducers/ConfigurationMode/Reducer.js +0 -80
  199. package/App/Reducers/ConfigurationMode/Selectors.js +0 -84
  200. package/App/Reducers/Configurator/Actions.js +0 -1417
  201. package/App/Reducers/Configurator/AttributeSelectors.js +0 -32
  202. package/App/Reducers/Configurator/Modifiers.js +0 -35
  203. package/App/Reducers/Configurator/Reducer.js +0 -639
  204. package/App/Reducers/Configurator/Selectors.js +0 -242
  205. package/App/Reducers/Confirm/Actions.js +0 -84
  206. package/App/Reducers/Confirm/Reducer.js +0 -30
  207. package/App/Reducers/DesignArea/Actions.js +0 -76
  208. package/App/Reducers/DesignArea/DesignElementSelectors.js +0 -114
  209. package/App/Reducers/DesignArea/MaskSelectors.js +0 -101
  210. package/App/Reducers/DesignArea/Reducer.js +0 -150
  211. package/App/Reducers/DesignArea/Selectors.js +0 -1314
  212. package/App/Reducers/DesignArea/Transformers.js +0 -333
  213. package/App/Reducers/DesignData/Actions.js +0 -232
  214. package/App/Reducers/DesignData/Modifiers.js +0 -328
  215. package/App/Reducers/DesignData/Reducer.js +0 -189
  216. package/App/Reducers/DesignData/Selectors.js +0 -94
  217. package/App/Reducers/DesignData/Transformers.js +0 -27
  218. package/App/Reducers/DesignView/Actions.js +0 -19
  219. package/App/Reducers/DesignView/Reducer.js +0 -165
  220. package/App/Reducers/DesignView/Selectors.js +0 -130
  221. package/App/Reducers/DesignView/Transformers.js +0 -32
  222. package/App/Reducers/Device/Actions.js +0 -16
  223. package/App/Reducers/Device/Reducer.js +0 -51
  224. package/App/Reducers/Fonts/Actions.js +0 -137
  225. package/App/Reducers/Fonts/Reducer.js +0 -39
  226. package/App/Reducers/Fonts/Selectors.js +0 -98
  227. package/App/Reducers/GeneralActions.js +0 -16
  228. package/App/Reducers/ImageGallery/Actions.js +0 -336
  229. package/App/Reducers/ImageGallery/Modifiers.js +0 -67
  230. package/App/Reducers/ImageGallery/Reducer.js +0 -320
  231. package/App/Reducers/ImageGallery/Selectors.js +0 -206
  232. package/App/Reducers/Reducer.js +0 -107
  233. package/App/Reducers/UI/Actions.js +0 -191
  234. package/App/Reducers/UI/Reducer.js +0 -98
  235. package/App/Reducers/UI/Selectors.js +0 -32
  236. package/App/Reducers.js +0 -48
  237. package/App/Routing.js +0 -168
  238. package/App/Screens/Configurator/CalculationWidgetScreen.js +0 -84
  239. package/App/Screens/Configurator/Components/AmountSelection/Styles.scss +0 -17
  240. package/App/Screens/Configurator/Components/AmountSelection/index.js +0 -170
  241. package/App/Screens/Configurator/Components/AmountSelection/index.story.js +0 -36
  242. package/App/Screens/Configurator/Components/CalculationWidget/index.js +0 -652
  243. package/App/Screens/Configurator/Components/CalculationWidget/index.story.js +0 -154
  244. package/App/Screens/Configurator/Components/CalculationWidget/index.test.js +0 -142
  245. package/App/Screens/Configurator/Components/ConfigurationModeSwitch/ConfigurationModeSwitch.js +0 -82
  246. package/App/Screens/Configurator/Components/ConfigurationModeSwitch/index.js +0 -15
  247. package/App/Screens/Configurator/Components/Confirm/Styles.scss +0 -0
  248. package/App/Screens/Configurator/Components/Confirm/index.js +0 -105
  249. package/App/Screens/Configurator/Components/DesignApproval/index.js +0 -76
  250. package/App/Screens/Configurator/Components/DesignApproval/index.story.js +0 -27
  251. package/App/Screens/Configurator/Components/DesignApproval/index.test.js +0 -31
  252. package/App/Screens/Configurator/Components/Error/index.js +0 -106
  253. package/App/Screens/Configurator/Components/FallbackVisualization/FallbackVisualization.js +0 -96
  254. package/App/Screens/Configurator/Components/FileUpload/FileUploadBase.js +0 -1
  255. package/App/Screens/Configurator/Components/FullScreenView/index.js +0 -303
  256. package/App/Screens/Configurator/Components/FullScreenView/index.test.js +0 -28
  257. package/App/Screens/Configurator/Components/ImageLoader/ImageLoader.js +0 -96
  258. package/App/Screens/Configurator/Components/LandscapeInformation/index.js +0 -75
  259. package/App/Screens/Configurator/Components/NoVisualization/NoVisualization.js +0 -35
  260. package/App/Screens/Configurator/Components/PreviewPortal/index.js +0 -246
  261. package/App/Screens/Configurator/Components/Styles.scss +0 -1
  262. package/App/Screens/Configurator/Components/Thumbnail/index.js +0 -394
  263. package/App/Screens/Configurator/Components/Thumbnail/index.test.js +0 -50
  264. package/App/Screens/Configurator/Components/TotalPrice/TotalPrice.js +0 -57
  265. package/App/Screens/Configurator/Containers/AmountPrice.js +0 -84
  266. package/App/Screens/Configurator/Containers/CalculationWidget.js +0 -278
  267. package/App/Screens/Configurator/Containers/ConfigurationModeSwitch.js +0 -81
  268. package/App/Screens/Configurator/Containers/Confirm.js +0 -37
  269. package/App/Screens/Configurator/Containers/DesignApproval.js +0 -129
  270. package/App/Screens/Configurator/Containers/FallbackVisualization.js +0 -32
  271. package/App/Screens/Configurator/Containers/FullScreenView.js +0 -46
  272. package/App/Screens/Configurator/Containers/Thumbnail.js +0 -41
  273. package/App/Screens/Configurator/Containers/Visualization.js +0 -13
  274. package/App/Screens/Configurator/DesignerUI.js +0 -215
  275. package/App/Screens/Configurator/DynamicComponents.js +0 -40
  276. package/App/Screens/Configurator/Screen.js +0 -236
  277. package/App/Screens/Configurator/ScreenPropTypes.js +0 -45
  278. package/App/Screens/Configurator/ThemeProvider.js +0 -298
  279. package/App/Screens/DesignerProductPreview/Constants.js +0 -12
  280. package/App/Screens/DesignerProductPreview/DesignerProductPreviewManager.js +0 -554
  281. package/App/Screens/DesignerProductPreview/Screen.js +0 -407
  282. package/App/Screens.js +0 -42
  283. package/App/ServiceLocator.js +0 -309
  284. package/App/Services/AdminareaCommunicationService.js +0 -149
  285. package/App/Services/AnalyticsService.js +0 -403
  286. package/App/Services/ConfiguratorService.js +0 -1122
  287. package/App/Services/DesignDataService.js +0 -3249
  288. package/App/Services/DesignerService.js +0 -496
  289. package/App/Services/InteractionService.js +0 -782
  290. package/App/Services/UIService.js +0 -129
  291. package/App/Services/VisualizationService.js +0 -842
  292. package/App/Shared/Components/AcceptDesign/index.js +0 -166
  293. package/App/Shared/Components/AddToBasket/index.js +0 -194
  294. package/App/Shared/Components/AddToBasket/index.story.js +0 -47
  295. package/App/Shared/Components/AlertDialog/index.js +0 -138
  296. package/App/Shared/Components/AmountInput/Styles.scss +0 -6
  297. package/App/Shared/Components/AmountInput/index.js +0 -296
  298. package/App/Shared/Components/AmountInput/index.story.js +0 -29
  299. package/App/Shared/Components/AmountPrice/index.js +0 -925
  300. package/App/Shared/Components/AmountPrice/index.story.js +0 -112
  301. package/App/Shared/Components/AmountPrice/index.test.js +0 -125
  302. package/App/Shared/Components/Analytics/AnalyticsWrapper.js +0 -49
  303. package/App/Shared/Components/BulkNames/index.js +0 -319
  304. package/App/Shared/Components/CallToAction/index.js +0 -220
  305. package/App/Shared/Components/Header/Header.js +0 -150
  306. package/App/Shared/Components/Header/index.js +0 -15
  307. package/App/Shared/Components/Header/index.story.js +0 -143
  308. package/App/Shared/Components/InformationTag/InformationTag.js +0 -155
  309. package/App/Shared/Components/LicenseNotice/LicenseNotice.js +0 -148
  310. package/App/Shared/Components/LicenseNotice/index.js +0 -15
  311. package/App/Shared/Components/LoadConfiguration/index.js +0 -218
  312. package/App/Shared/Components/MessageBox/index.js +0 -84
  313. package/App/Shared/Components/MessageBox/index.story.js +0 -49
  314. package/App/Shared/Components/Notification/index.js +0 -105
  315. package/App/Shared/Components/Notification/index.story.js +0 -55
  316. package/App/Shared/Components/PdfDownload/index.js +0 -150
  317. package/App/Shared/Components/PlusMinusInput/index.js +0 -118
  318. package/App/Shared/Components/PriceList/index.js +0 -237
  319. package/App/Shared/Components/PriceList/index.story.js +0 -114
  320. package/App/Shared/Components/PriceOverview/index.js +0 -177
  321. package/App/Shared/Components/PriceOverview/index.story.js +0 -215
  322. package/App/Shared/Components/ProductVariant/Image.js +0 -75
  323. package/App/Shared/Components/ProductVariant/Styles.scss +0 -11
  324. package/App/Shared/Components/ProductVariant/index.js +0 -477
  325. package/App/Shared/Components/ProductVariant/index.story.js +0 -283
  326. package/App/Shared/Components/Progress/Progress.js +0 -59
  327. package/App/Shared/Components/ReceiveOfferForm/index.js +0 -432
  328. package/App/Shared/Components/ReceiveOfferForm/index.story.js +0 -32
  329. package/App/Shared/Components/ReceiveOfferForm/index.test.js +0 -36
  330. package/App/Shared/Components/SaveConfiguration/index.js +0 -286
  331. package/App/Shared/Components/SendEmail/index.js +0 -103
  332. package/App/Shared/Components/Stepper/index.js +0 -136
  333. package/App/Shared/Components/Stepper/index.story.js +0 -38
  334. package/App/Shared/Components/ToolbarList/index.js +0 -231
  335. package/App/Shared/Components/ToolbarList/index.story.js +0 -33
  336. package/App/Shared/Components/VariantChooser/index.js +0 -270
  337. package/App/Shared/Components/VariantChooser/index.story.js +0 -100
  338. package/App/Shared/Containers/AlertMessages.js +0 -37
  339. package/App/Shared/Containers/AmountPrice/AmountPriceAdminareaWrapper.js +0 -40
  340. package/App/Shared/Containers/AmountPrice/index.js +0 -284
  341. package/App/Shared/Containers/BulkNames.js +0 -310
  342. package/App/Shared/Containers/Error.js +0 -37
  343. package/App/Shared/Containers/GlobalLoader.js +0 -25
  344. package/App/Shared/Containers/Header/index.js +0 -178
  345. package/App/Shared/Containers/LicenseNotice/LicenseNotice.js +0 -26
  346. package/App/Shared/Containers/LicenseNotice/index.js +0 -15
  347. package/App/Shared/Containers/LoadConfiguration/LoadConfiguration.js +0 -146
  348. package/App/Shared/Containers/LoadConfiguration/index.js +0 -15
  349. package/App/Shared/Containers/PdfDownload/index.js +0 -39
  350. package/App/Shared/Containers/ProductVariant/ProductVariant.js +0 -339
  351. package/App/Shared/Containers/ProductVariant/index.js +0 -15
  352. package/App/Shared/Containers/SaveConfiguration.js +0 -49
  353. package/App/Shared/Containers/SendEmail/SendEmail.js +0 -45
  354. package/App/Shared/Containers/SendEmail/index.js +0 -15
  355. package/App/Shared/Providers/DefaultCanvasProvider.js +0 -86
  356. package/App/Storage.js +0 -17
  357. package/App/Store.js +0 -87
  358. package/App/Styles.scss +0 -0
  359. package/App/Translations.js +0 -88
  360. package/App/Utils/createMessageInterface.js +0 -52
  361. package/App/Utils/customClassName.js +0 -12
  362. package/App/Utils/getContrastText.js +0 -27
  363. package/App/Utils/getImageUrl.js +0 -32
  364. package/App/Variables.scss +0 -84
  365. package/App/configuration.js +0 -421
  366. package/App/index.js +0 -52
  367. package/App/initServices.js +0 -67
  368. package/App/setup.js +0 -22
  369. package/App/versionInfo.js +0 -8
  370. package/Framework/Api.js +0 -178
  371. package/Framework/ComponentContainer.js +0 -165
  372. package/Framework/Components/Carousel/Styles.scss +0 -85
  373. package/Framework/Components/Carousel/index.js +0 -322
  374. package/Framework/Components/Dialog/Style.scss +0 -79
  375. package/Framework/Components/Dialog/index.js +0 -721
  376. package/Framework/Components/DialogSelect/Styles.scss +0 -53
  377. package/Framework/Components/DialogSelect/index.js +0 -331
  378. package/Framework/Components/Input/index.js +0 -147
  379. package/Framework/Components/LoadingOverlay/Styles.scss +0 -37
  380. package/Framework/Components/LoadingOverlay/index.js +0 -33
  381. package/Framework/Components/Markdown/index.js +0 -62
  382. package/Framework/Components/Mobile/index.js +0 -33
  383. package/Framework/CustomError.js +0 -51
  384. package/Framework/Helpers/TransitionDetect.js +0 -116
  385. package/Framework/Helpers/isLandscapeMobile.js +0 -14
  386. package/Framework/Helpers/isMobileDevice.js +0 -17
  387. package/Framework/Helpers/isMobileSize.js +0 -13
  388. package/Framework/Mixins.scss +0 -235
  389. package/Framework/Services/AbstractAdminareaCommunicationService.js +0 -48
  390. package/Framework/Services/AbstractAsyncService.js +0 -44
  391. package/Framework/Services/AbstractConfiguratorService.js +0 -47
  392. package/Framework/Services/AbstractInteractionService.js +0 -50
  393. package/Framework/Services/AbstractStoreService.js +0 -42
  394. package/Framework/Services/AbstractUIService.js +0 -53
  395. package/Framework/Services/AbstractVisualizationService.js +0 -47
  396. package/Framework/Services/AsyncService.js +0 -93
  397. package/Framework/Services/StoreService.js +0 -237
  398. package/Framework/Variables.scss +0 -22
  399. package/Framework/bindDecorator.js +0 -173
  400. package/Framework/i18n.js +0 -383
  401. package/Resources/Icons/MaterialUI/Icons/AddCircle.js +0 -13
  402. package/Resources/Icons/MaterialUI/Icons/RemoveCircle.js +0 -13
  403. package/Resources/Icons/MaterialUI/fontFace.scss +0 -37
  404. package/Resources/Icons/MaterialUI/fonts/MaterialIcons-Regular.eot +0 -0
  405. package/Resources/Icons/MaterialUI/fonts/MaterialIcons-Regular.svg +0 -2373
  406. package/Resources/Icons/MaterialUI/fonts/MaterialIcons-Regular.ttf +0 -0
  407. package/Resources/Icons/MaterialUI/fonts/MaterialIcons-Regular.woff +0 -0
  408. package/Resources/Icons/MaterialUI/fonts/MaterialIcons-Regular.woff2 +0 -0
  409. package/Resources/Icons/fonts/ionicons.eot +0 -0
  410. package/Resources/Icons/fonts/ionicons.svg +0 -2230
  411. package/Resources/Icons/fonts/ionicons.ttf +0 -0
  412. package/Resources/Icons/fonts/ionicons.woff +0 -0
  413. package/Resources/Icons/ionicons.scss +0 -1489
  414. package/Resources/Icons/ioniconsExtend.scss +0 -1469
  415. package/Resources/Icons/v4/fontFace.scss +0 -11
  416. package/Resources/Icons/v4/fonts/ionicons.eot +0 -0
  417. package/Resources/Icons/v4/fonts/ionicons.svg +0 -2090
  418. package/Resources/Icons/v4/fonts/ionicons.ttf +0 -0
  419. package/Resources/Icons/v4/fonts/ionicons.woff +0 -0
  420. package/Resources/Icons/v4/fonts/ionicons.woff2 +0 -0
  421. package/Resources/Icons/v4/icons.scss +0 -15
  422. package/Resources/Icons/v4/iconsExtend.scss +0 -7
  423. package/Resources/Images/designer_placeholder_logo.svg +0 -1
  424. package/Resources/Masks/circle.svg +0 -4
  425. package/Shared/Components/CustomDialog.js +0 -132
  426. package/Shared/Components/CustomDialogSelect.js +0 -161
  427. package/Shared/Components/MainButton.js +0 -81
  428. package/Shared/ErrorTypes/DeferredError.js +0 -51
  429. package/Shared/HOCs/ResizeDetect/ResizeDetect.dev.js +0 -60
  430. package/Shared/HOCs/ResizeDetect/ResizeDetect.js +0 -217
  431. package/Shared/HOCs/getDisplayName.js +0 -10
  432. package/Shared/HOCs/withFixedChangeHandler.js +0 -46
  433. package/Shared/PropTypes/ReactComponent.js +0 -13
  434. package/Shared/Styles/absoluteCenter.js +0 -17
  435. package/Utils/Array/isIdentical.js +0 -38
  436. package/Utils/Async/AsyncManager.js +0 -128
  437. package/Utils/Async/Deferred.js +0 -146
  438. package/Utils/Async/ObjectLock.js +0 -38
  439. package/Utils/Decorators/Observable.js +0 -130
  440. package/Utils/Dev/HOCs/withFilePicker.js +0 -101
  441. package/Utils/Dev/isDev.js +0 -21
  442. package/Utils/Events/pointerEvent.js +0 -199
  443. package/Utils/Events/preventEventDoubling.js +0 -23
  444. package/Utils/Function/cached.js +0 -64
  445. package/Utils/Function/createDebounceManager.js +0 -77
  446. package/Utils/Function/createSelector.js +0 -62
  447. package/Utils/Function/memoize.js +0 -46
  448. package/Utils/Function/sendMessage.js +0 -22
  449. package/Utils/Helper/createSelectionRangeMemo.js +0 -45
  450. package/Utils/Immutable/set.js +0 -81
  451. package/Utils/Math/conversions.js +0 -13
  452. package/Utils/Math/isPositiveNumber.js +0 -12
  453. package/Utils/Redux/createActionWithGlobalState.js +0 -23
  454. package/Utils/Styles/combineMediaQueries.js +0 -24
  455. package/Utils/Styles/createCheckerBoardBackground.js +0 -22
  456. package/Utils/Test/CallOrderChecker.js +0 -29
  457. package/Utils/Test/createStoreProvider.js +0 -33
  458. package/Utils/Test/formDataToJSON.js +0 -20
  459. package/Utils/Test/mountWithState.js +0 -40
  460. package/index.js +0 -8
@@ -1,1122 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports["default"] = void 0;
7
-
8
- var _get = _interopRequireDefault(require("lodash/get"));
9
-
10
- var _has = _interopRequireDefault(require("lodash/has"));
11
-
12
- var _find = _interopRequireDefault(require("lodash/find"));
13
-
14
- var _map = _interopRequireDefault(require("lodash/map"));
15
-
16
- var _keys2 = _interopRequireDefault(require("lodash/keys"));
17
-
18
- var _isEqual = _interopRequireDefault(require("lodash/isEqual"));
19
-
20
- var _difference = _interopRequireDefault(require("lodash/difference"));
21
-
22
- var _omit = _interopRequireDefault(require("lodash/omit"));
23
-
24
- var _debounce = _interopRequireDefault(require("lodash/debounce"));
25
-
26
- var _AbstractConfiguratorService = _interopRequireDefault(require("../../Framework/Services/AbstractConfiguratorService"));
27
-
28
- var configuratorActions = _interopRequireWildcard(require("../Reducers/Configurator/Actions"));
29
-
30
- var _Selectors = require("../Reducers/Configurator/Selectors");
31
-
32
- var _Selectors2 = require("../Reducers/DesignArea/Selectors");
33
-
34
- var _Actions2 = require("../Reducers/UI/Actions");
35
-
36
- var _Selectors3 = require("../Reducers/Fonts/Selectors");
37
-
38
- var _ServiceLocator = require("../ServiceLocator");
39
-
40
- var _configuration2 = require("../configuration");
41
-
42
- var _Reducer = require("../Reducers/DesignData/Reducer");
43
-
44
- var _cached = require("../../Utils/Function/cached");
45
-
46
- var _getFirstDataURLFromScreenshotsObj = require("../Modules/Visualization/Utils/getFirstDataURLFromScreenshotsObj");
47
-
48
- var _Selectors4 = require("../Reducers/DesignData/Selectors");
49
-
50
- var _createMessageInterface = _interopRequireDefault(require("../Utils/createMessageInterface"));
51
-
52
- var _excluded = ["code"];
53
-
54
- function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
55
-
56
- function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { "default": obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj["default"] = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
57
-
58
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
59
-
60
- function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
61
-
62
- function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) { symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); } keys.push.apply(keys, symbols); } return keys; }
63
-
64
- function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
65
-
66
- function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
67
-
68
- function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
69
-
70
- function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
71
-
72
- function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { Promise.resolve(value).then(_next, _throw); } }
73
-
74
- function _asyncToGenerator(fn) { return function () { var self = this, args = arguments; return new Promise(function (resolve, reject) { var gen = fn.apply(self, args); function _next(value) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value); } function _throw(err) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err); } _next(undefined); }); }; }
75
-
76
- function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
77
-
78
- function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
79
-
80
- function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }
81
-
82
- function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); }
83
-
84
- function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
85
-
86
- function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
87
-
88
- function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return _assertThisInitialized(self); }
89
-
90
- function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
91
-
92
- function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
93
-
94
- function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
95
-
96
- function _createForOfIteratorHelper(o, allowArrayLike) { var it = typeof Symbol !== "undefined" && o[Symbol.iterator] || o["@@iterator"]; if (!it) { if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") { if (it) o = it; var i = 0; var F = function F() {}; return { s: F, n: function n() { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }, e: function e(_e) { throw _e; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var normalCompletion = true, didErr = false, err; return { s: function s() { it = it.call(o); }, n: function n() { var step = it.next(); normalCompletion = step.done; return step; }, e: function e(_e2) { didErr = true; err = _e2; }, f: function f() { try { if (!normalCompletion && it["return"] != null) it["return"](); } finally { if (didErr) throw err; } } }; }
97
-
98
- function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
99
-
100
- function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }
101
-
102
- var getSelectedAmountsBySizes = function getSelectedAmountsBySizes(item, selectedAmounts) {
103
- var itemGroupMap = function itemGroupMap(rootItem, fn) {
104
- var data = [];
105
-
106
- if ((0, _get["default"])(rootItem, 'itemGroup.children.length', 0) > 0) {
107
- var _iterator = _createForOfIteratorHelper(rootItem.itemGroup.children),
108
- _step;
109
-
110
- try {
111
- for (_iterator.s(); !(_step = _iterator.n()).done;) {
112
- var _item = _step.value;
113
- var mappedData = fn(_item, data);
114
- mappedData && data.push(mappedData);
115
- }
116
- } catch (err) {
117
- _iterator.e(err);
118
- } finally {
119
- _iterator.f();
120
- }
121
- }
122
-
123
- return data;
124
- };
125
-
126
- return itemGroupMap(item, function (colorGroupItem) {
127
- return {
128
- identifier: colorGroupItem.identifier,
129
- amount: (0, _get["default"])(selectedAmounts, colorGroupItem.identifier, 0),
130
- sizes: itemGroupMap(colorGroupItem, function (sizeGroupItem) {
131
- return {
132
- amount: (0, _get["default"])(selectedAmounts, sizeGroupItem.identifier, 0),
133
- identifier: sizeGroupItem.identifier
134
- };
135
- })
136
- };
137
- });
138
- };
139
-
140
- var ConfiguratorService = /*#__PURE__*/function (_AbstractConfigurator) {
141
- _inherits(ConfiguratorService, _AbstractConfigurator);
142
-
143
- var _super = _createSuper(ConfiguratorService);
144
-
145
- function ConfiguratorService() {
146
- var _this;
147
-
148
- _classCallCheck(this, ConfiguratorService);
149
-
150
- _this = _super.call(this);
151
-
152
- _ServiceLocator.Services.store.observeStore(function (state) {
153
- return state.configurator.configuration;
154
- }, function () {
155
- // since it's debounced, the prevConfiguration should be the configuration from the latest call
156
- var prevConfiguration = {};
157
- return (0, _debounce["default"])(function (configuration) {
158
- _this.onConfigurationChange(configuration, prevConfiguration);
159
-
160
- prevConfiguration = configuration;
161
- }, 300);
162
- }());
163
-
164
- return _this;
165
- }
166
-
167
- _createClass(ConfiguratorService, [{
168
- key: "init",
169
- value: function init() {
170
- var adminMode = (0, _configuration2.getConf)('adminMode');
171
-
172
- if (!adminMode) {
173
- var messageInterface = (0, _createMessageInterface["default"])();
174
- messageInterface.addListener('switch_options', /*#__PURE__*/function () {
175
- var _ref = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee(event) {
176
- var optionsJSON, optionsToSelect;
177
- return regeneratorRuntime.wrap(function _callee$(_context) {
178
- while (1) {
179
- switch (_context.prev = _context.next) {
180
- case 0:
181
- optionsJSON = (0, _get["default"])(event, 'data.options');
182
-
183
- try {
184
- optionsToSelect = JSON.parse(optionsJSON);
185
-
186
- _ServiceLocator.Services.store.dispatch((0, configuratorActions.selectMultipleOptions)(optionsToSelect));
187
- } catch (e) {
188
- // eslint-disable-next-line no-console
189
- console.error('Wrong JSON provided for switch_options:', optionsJSON);
190
- }
191
-
192
- case 2:
193
- case "end":
194
- return _context.stop();
195
- }
196
- }
197
- }, _callee);
198
- }));
199
-
200
- return function (_x) {
201
- return _ref.apply(this, arguments);
202
- };
203
- }());
204
- }
205
- } // state selector
206
-
207
- }, {
208
- key: "state",
209
- get: function get() {
210
- return _ServiceLocator.Services.store.state.configurator;
211
- }
212
- }, {
213
- key: "initialize",
214
- value: function initialize() {
215
- var params = {};
216
- var basePath = (0, _configuration2.getConf)('routingBasePath', '/');
217
- var itemRegex = new RegExp("".concat(basePath, "(code|identifier):([^/]+)"));
218
- var results = itemRegex.exec(location.pathname);
219
-
220
- if (results) {
221
- params[results[1]] = results[2];
222
- }
223
-
224
- if (params.identifier) {
225
- this.setLoadIdentifier(params.identifier);
226
- } else if (params.code) {
227
- this.setLoadCode(params.code);
228
- }
229
-
230
- this.loadClientData();
231
- }
232
- }, {
233
- key: "prepareConfigurationForSave",
234
- value: function prepareConfigurationForSave() {
235
- var overwrite = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false;
236
- var extraData = arguments.length > 1 ? arguments[1] : undefined;
237
- var configuration = this.state.configuration;
238
-
239
- var updatedConfiguration = _ServiceLocator.Services.designData.removeAllDesignAreaPlaceholders(configuration); // remove the code by default (to prevent overwriting the current configuration)
240
-
241
-
242
- var code = updatedConfiguration.code,
243
- otherData = _objectWithoutProperties(updatedConfiguration, _excluded); // always remove parentCode from customdata
244
-
245
-
246
- var customdata = (0, _omit["default"])(updatedConfiguration.customdata || {}, ['parentCode']); // add parentCode only when it's set in the config
247
-
248
- if ((0, _configuration2.getConf)('addParentCodeOnSave')) {
249
- customdata.parentCode = code;
250
- }
251
-
252
- return _objectSpread(_objectSpread(_objectSpread(_objectSpread({}, otherData), overwrite ? {
253
- code: code
254
- } : {}), extraData), {}, {
255
- customdata: customdata
256
- });
257
- }
258
- }, {
259
- key: "setCalculationAutoResolveEnabled",
260
- value: function setCalculationAutoResolveEnabled(enabled) {
261
- _ServiceLocator.Services.store.dispatch((0, configuratorActions.setCalculationAutoResolveEnabled)(enabled));
262
- }
263
- }, {
264
- key: "skipNextCalculationAutoResolve",
265
- value: function skipNextCalculationAutoResolve() {
266
- _ServiceLocator.Services.store.dispatch((0, configuratorActions.skipNextAutoResolve)());
267
- }
268
- }, {
269
- key: "onConfigurationChange",
270
- value: function () {
271
- var _onConfigurationChange = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee2(configuration, prevConfiguration) {
272
- return regeneratorRuntime.wrap(function _callee2$(_context2) {
273
- while (1) {
274
- switch (_context2.prev = _context2.next) {
275
- case 0:
276
- if (!(this.state.calculationIsEnabled && (!configuration.check_results || // no check results
277
- configuration.check_results.status) && // or the check result status is ok
278
- this.shouldInvalidateCalculation(prevConfiguration, configuration))) {
279
- _context2.next = 11;
280
- break;
281
- }
282
-
283
- if (!(0, _Selectors.isCalculationAutoResolveEnabled)(this.state)) {
284
- _context2.next = 9;
285
- break;
286
- }
287
-
288
- // disable automatic price updates to take direct control over error handling
289
- _ServiceLocator.Services.store.dispatch((0, configuratorActions.setCalculationEnabled)(false)); // triggering the calculation directly to make sure it's synced
290
-
291
-
292
- _context2.next = 5;
293
- return _ServiceLocator.Services.store.dispatch(configuratorActions.doCalculation());
294
-
295
- case 5:
296
- _ServiceLocator.Services.store.dispatch((0, configuratorActions.setCalculationEnabled)(true));
297
-
298
- _ServiceLocator.Services.configurator.resolveCalculationErrors();
299
-
300
- _context2.next = 11;
301
- break;
302
-
303
- case 9:
304
- _ServiceLocator.Services.store.dispatch(configuratorActions.invalidateCalculation());
305
-
306
- _ServiceLocator.Services.store.dispatch(configuratorActions.doCalculation());
307
-
308
- case 11:
309
- if (this.shouldUpdateVisualization(prevConfiguration, configuration)) {
310
- _ServiceLocator.Services.visualization.update(configuration);
311
- }
312
-
313
- case 12:
314
- case "end":
315
- return _context2.stop();
316
- }
317
- }
318
- }, _callee2, this);
319
- }));
320
-
321
- function onConfigurationChange(_x2, _x3) {
322
- return _onConfigurationChange.apply(this, arguments);
323
- }
324
-
325
- return onConfigurationChange;
326
- }()
327
- }, {
328
- key: "shouldInvalidateCalculation",
329
- value: function shouldInvalidateCalculation(prevConfiguration, configuration) {
330
- return this.isRoughEqual(configuration, prevConfiguration);
331
- }
332
- }, {
333
- key: "shouldUpdateVisualization",
334
- value: function shouldUpdateVisualization(prevConfiguration, configuration) {
335
- return this.isRoughEqual(configuration, prevConfiguration);
336
- }
337
- }, {
338
- key: "isRoughEqual",
339
- value: function isRoughEqual(configuration, prevConfiguration) {
340
- // calculation should be invalidated only when one of the relevant properties has changed
341
- var pc = this.getRoughConfiguration(prevConfiguration);
342
- var cc = this.getRoughConfiguration(configuration);
343
- return !(0, _isEqual["default"])(cc, pc);
344
- }
345
- /**
346
- * Returns the configuration core values
347
- * Use this method to create a more simple comparable object that represents the same
348
- * configuration
349
- * @param configuration
350
- * @returns {{item: {identifier: *, price: *}, optionclassifications: Array, designdata: {}, customdata: {}}}
351
- */
352
-
353
- }, {
354
- key: "getRoughConfiguration",
355
- value: function getRoughConfiguration(configuration) {
356
- var item = configuration.item,
357
- optionclassifications = configuration.optionclassifications,
358
- designdata = configuration.designdata;
359
- var customdata = configuration.customdata && (0, _omit["default"])(configuration.customdata, ['comment']);
360
- return {
361
- item: item && {
362
- identifier: item.identifier,
363
- price: item.price
364
- },
365
- optionclassifications: optionclassifications && (0, _map["default"])(optionclassifications, function (oc) {
366
- return {
367
- identifier: oc.identifier,
368
- selectedoptions: (0, _map["default"])(oc.selectedoptions, function (o) {
369
- return {
370
- identifier: o.identifier,
371
- amount: o.amount,
372
- price: o.price
373
- };
374
- })
375
- };
376
- }),
377
- designdata: designdata && this.getRoughDesignData(designdata),
378
- customdata: customdata
379
- };
380
- }
381
- /**
382
- * The design data can also invalidate the calculation if any of the relevant properties have changed.
383
- * (Eg. an object is added or removed, or a design area related option has changed.)
384
- * @param designData
385
- * @returns {null|object}
386
- */
387
-
388
- }, {
389
- key: "getRoughDesignData",
390
- value: function getRoughDesignData(designData) {
391
- if (!designData) {
392
- return null;
393
- }
394
-
395
- var designAreas = Object.keys(designData);
396
- var roughDesignData = {};
397
-
398
- for (var _i = 0, _designAreas = designAreas; _i < _designAreas.length; _i++) {
399
- var designAreaIdentifier = _designAreas[_i];
400
- var designAreaData = designData[designAreaIdentifier];
401
- var canvasData = designAreaData.canvasData,
402
- designProductionMethodIdentifier = designAreaData.designProductionMethodIdentifier,
403
- colorAmount = designAreaData.colorAmount;
404
- roughDesignData[designAreaIdentifier] = {
405
- objectCount: (0, _get["default"])(canvasData, 'objects.length'),
406
- designProductionMethodIdentifier: designProductionMethodIdentifier,
407
- colorAmount: colorAmount
408
- };
409
- }
410
-
411
- return roughDesignData;
412
- } //// <-- ACTIONS -->
413
-
414
- }, {
415
- key: "saveConfiguration",
416
- value: function () {
417
- var _saveConfiguration = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee3(configuration, configurationtype) {
418
- return regeneratorRuntime.wrap(function _callee3$(_context3) {
419
- while (1) {
420
- switch (_context3.prev = _context3.next) {
421
- case 0:
422
- return _context3.abrupt("return", _ServiceLocator.Services.store.dispatch(configuratorActions.saveConfiguration(configuration, configurationtype)));
423
-
424
- case 1:
425
- case "end":
426
- return _context3.stop();
427
- }
428
- }
429
- }, _callee3);
430
- }));
431
-
432
- function saveConfiguration(_x4, _x5) {
433
- return _saveConfiguration.apply(this, arguments);
434
- }
435
-
436
- return saveConfiguration;
437
- }()
438
- }, {
439
- key: "getPreviewImagesForVariants",
440
- value: function () {
441
- var _getPreviewImagesForVariants = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee4() {
442
- var options,
443
- _options$size,
444
- size,
445
- designData,
446
- configurationOptions,
447
- cached,
448
- memo,
449
- designAreas,
450
- defaultDesignAreaIdentifier,
451
- areasWithDesign,
452
- screenshotAreaIdentifier,
453
- screenshotArea,
454
- usedAreas,
455
- firstDesignViewIdentifier,
456
- usedViews,
457
- variants,
458
- screenshots,
459
- images,
460
- _args4 = arguments;
461
-
462
- return regeneratorRuntime.wrap(function _callee4$(_context4) {
463
- while (1) {
464
- switch (_context4.prev = _context4.next) {
465
- case 0:
466
- options = _args4.length > 0 && _args4[0] !== undefined ? _args4[0] : {};
467
-
468
- _ServiceLocator.Services.designData.closeDesignAreaEditor();
469
-
470
- _ServiceLocator.Services.designData.clearDesignAreaSelection();
471
-
472
- _options$size = options.size, size = _options$size === void 0 ? {
473
- width: 100,
474
- height: 100
475
- } : _options$size;
476
- designData = (0, _Reducer.getDesignData)(this.state);
477
- configurationOptions = (0, _Selectors.getConfiguration)(this.state).optionclassifications;
478
- cached = (0, _cached.getCached)('variantPreviewImages', designData, configurationOptions);
479
-
480
- if (!cached.validate()) {
481
- _context4.next = 9;
482
- break;
483
- }
484
-
485
- return _context4.abrupt("return", cached.getValue());
486
-
487
- case 9:
488
- memo = _ServiceLocator.Services.designData.createHighlightMemo(false);
489
- designAreas = _ServiceLocator.Services.store.state.designArea.filteredDesignAreas; // use the first area as default if it's not defined through the production methods
490
-
491
- defaultDesignAreaIdentifier = (0, _Selectors2.getDefaultDesignAreaIdentifierFromProductionMethod)(_ServiceLocator.Services.store.state) || (designAreas.length ? designAreas[0].identifier : null);
492
- areasWithDesign = designData && Object.keys(designData).filter(function (designAreaIdentifier) {
493
- return (0, _get["default"])(designData[designAreaIdentifier], 'canvasData.objects.length');
494
- }); // use the default design area, or the first that contains a design
495
-
496
- screenshotAreaIdentifier = areasWithDesign && (areasWithDesign.indexOf(defaultDesignAreaIdentifier) !== -1 ? defaultDesignAreaIdentifier : areasWithDesign[0]) || defaultDesignAreaIdentifier;
497
- screenshotArea = (0, _find["default"])(designAreas, {
498
- identifier: screenshotAreaIdentifier
499
- });
500
- usedAreas = screenshotAreaIdentifier && [screenshotAreaIdentifier];
501
- firstDesignViewIdentifier = (0, _get["default"])(_ServiceLocator.Services.store.state.designView, 'designViews[0].identifier');
502
- usedViews = [screenshotArea ? screenshotArea.designView.identifier : firstDesignViewIdentifier];
503
- variants = (0, _Selectors.getChildren)(this.state).map(function (_ref2) {
504
- var identifier = _ref2.identifier;
505
- return identifier;
506
- });
507
-
508
- if (!variants[0]) {
509
- variants = [(0, _Selectors.getItem)(this.state).identifier];
510
- }
511
-
512
- _context4.prev = 20;
513
- _context4.next = 23;
514
- return _ServiceLocator.Services.visualization.getScreenshots({
515
- areaList: usedAreas,
516
- viewList: usedViews,
517
- variantList: variants,
518
- size: size
519
- });
520
-
521
- case 23:
522
- screenshots = _context4.sent;
523
-
524
- if (screenshots) {
525
- _context4.next = 26;
526
- break;
527
- }
528
-
529
- return _context4.abrupt("return", {});
530
-
531
- case 26:
532
- images = {};
533
- Object.keys(screenshots).forEach(function (identifier) {
534
- images[variants.length === 1 ? variants[0] : identifier] = (0, _getFirstDataURLFromScreenshotsObj.getFirstDataURLFromScreenshotsObj)(screenshots[identifier]);
535
- });
536
- cached.setValue(images);
537
- return _context4.abrupt("return", images);
538
-
539
- case 32:
540
- _context4.prev = 32;
541
- _context4.t0 = _context4["catch"](20);
542
- // eslint-disable-next-line no-console
543
- console.error('Error occurred while generating preview images:', _context4.t0);
544
-
545
- case 35:
546
- _context4.prev = 35;
547
- memo.restore();
548
- return _context4.finish(35);
549
-
550
- case 38:
551
- case "end":
552
- return _context4.stop();
553
- }
554
- }
555
- }, _callee4, this, [[20, 32, 35, 38]]);
556
- }));
557
-
558
- function getPreviewImagesForVariants() {
559
- return _getPreviewImagesForVariants.apply(this, arguments);
560
- }
561
-
562
- return getPreviewImagesForVariants;
563
- }()
564
- }, {
565
- key: "togglePlaceholders",
566
- value: function togglePlaceholders(show) {
567
- var _this2 = this;
568
-
569
- var canvases = _ServiceLocator.Services.designData.getDesignAreaCanvases();
570
-
571
- canvases.forEach(function (_ref3) {
572
- var canvas = _ref3.canvas;
573
-
574
- var _iterator2 = _createForOfIteratorHelper(canvas.objects),
575
- _step2;
576
-
577
- try {
578
- for (_iterator2.s(); !(_step2 = _iterator2.n()).done;) {
579
- var obj = _step2.value;
580
-
581
- if ((0, _Selectors4.isPlaceholderObject)(obj)) {
582
- obj.wrappedObject.visible = show;
583
- }
584
- }
585
- } catch (err) {
586
- _iterator2.e(err);
587
- } finally {
588
- _iterator2.f();
589
- }
590
- });
591
- return function () {
592
- return _this2.togglePlaceholders(true);
593
- };
594
- }
595
- }, {
596
- key: "createMediaDataForConfiguration",
597
- value: function () {
598
- var _createMediaDataForConfiguration = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee5(configuration) {
599
- var mediaData, restorePlaceholderVisibility, memo, fontMapping, svgs, fullSvgs, usedAreas, designArea, filteredDesignAreas, usedViews, item, selectedAmounts, selectedVariants, selectedVariant, designViewList, screenshots, _iterator4, _step4, variant, variantImages, _keys, orderedImages, index, key;
600
-
601
- return regeneratorRuntime.wrap(function _callee5$(_context5) {
602
- while (1) {
603
- switch (_context5.prev = _context5.next) {
604
- case 0:
605
- mediaData = {};
606
- restorePlaceholderVisibility = this.togglePlaceholders(false);
607
- memo = _ServiceLocator.Services.designData.createHighlightMemo(false);
608
- fontMapping = (0, _Selectors3.getFontMapping)(_ServiceLocator.Services.store.state);
609
- _context5.next = 6;
610
- return _ServiceLocator.Services.designData.getScreenshotsOfElements(fontMapping);
611
-
612
- case 6:
613
- svgs = _context5.sent;
614
- mediaData.designDataSnapshots = svgs;
615
- _context5.next = 10;
616
- return _ServiceLocator.Services.designData.getScreenshots(fontMapping);
617
-
618
- case 10:
619
- fullSvgs = _context5.sent;
620
- mediaData.printDesignData = fullSvgs;
621
- usedAreas = Object.keys(fullSvgs);
622
- designArea = _ServiceLocator.Services.store.state.designArea;
623
- filteredDesignAreas = designArea.filteredDesignAreas;
624
- usedViews = (0, _Selectors2.getCameraViewListForDesignAreaList)(filteredDesignAreas, usedAreas);
625
- item = (0, _Selectors.getItem)(this.state);
626
- selectedAmounts = (0, _Selectors.getSelectedAmounts)(this.state);
627
- selectedVariants = getSelectedAmountsBySizes(item, selectedAmounts).filter(function (item) {
628
- if (item.sizes.length > 0) {
629
- var _iterator3 = _createForOfIteratorHelper(item.sizes),
630
- _step3;
631
-
632
- try {
633
- for (_iterator3.s(); !(_step3 = _iterator3.n()).done;) {
634
- var size = _step3.value;
635
-
636
- if (size.amount > 0) {
637
- return true;
638
- }
639
- }
640
- } catch (err) {
641
- _iterator3.e(err);
642
- } finally {
643
- _iterator3.f();
644
- }
645
- } else {
646
- if (item.amount > 0) {
647
- return true;
648
- }
649
- }
650
-
651
- return false;
652
- }).map(function (item) {
653
- return item.identifier;
654
- });
655
- selectedVariant = (0, _Selectors.getSelectedVariantIdentifier)(this.state);
656
-
657
- if (selectedVariants.length === 0) {
658
- selectedVariants.push(selectedVariant);
659
- }
660
-
661
- designViewList = (0, _Selectors2.getDesignViewListForDesignAreas)(_ServiceLocator.Services.store.state);
662
- mediaData.screenshots = {};
663
- _context5.prev = 23;
664
- _context5.next = 26;
665
- return _ServiceLocator.Services.visualization.getScreenshots({
666
- areaList: usedAreas,
667
- // used in 2D visualization
668
- viewList: usedViews,
669
- // used in 3D visualization
670
- variantList: selectedVariants,
671
- designViewList: designViewList // used in 2D visualization
672
-
673
- });
674
-
675
- case 26:
676
- screenshots = _context5.sent;
677
-
678
- if (screenshots) {
679
- // make sure the order is kept on the server side
680
- _iterator4 = _createForOfIteratorHelper(selectedVariants);
681
-
682
- try {
683
- for (_iterator4.s(); !(_step4 = _iterator4.n()).done;) {
684
- variant = _step4.value;
685
- variantImages = screenshots[variant];
686
-
687
- if (variantImages) {
688
- _keys = Object.keys(variantImages);
689
- orderedImages = {};
690
-
691
- for (index = 0; index < _keys.length; index++) {
692
- key = _keys[index];
693
- orderedImages[index + key] = variantImages[key];
694
- }
695
-
696
- screenshots[variant] = orderedImages;
697
- }
698
- }
699
- } catch (err) {
700
- _iterator4.e(err);
701
- } finally {
702
- _iterator4.f();
703
- }
704
- }
705
-
706
- mediaData.screenshots = screenshots;
707
- _context5.next = 34;
708
- break;
709
-
710
- case 31:
711
- _context5.prev = 31;
712
- _context5.t0 = _context5["catch"](23);
713
- // do not save in case of an error while generating screenshots
714
- // eslint-disable-next-line no-console
715
- console.error('Error occurred while generating screenshots:', _context5.t0);
716
-
717
- case 34:
718
- memo.restore();
719
-
720
- if (_typeof(configuration) === 'object') {
721
- Object.assign(configuration, mediaData);
722
- }
723
-
724
- restorePlaceholderVisibility();
725
- return _context5.abrupt("return", mediaData);
726
-
727
- case 38:
728
- case "end":
729
- return _context5.stop();
730
- }
731
- }
732
- }, _callee5, this, [[23, 31]]);
733
- }));
734
-
735
- function createMediaDataForConfiguration(_x6) {
736
- return _createMediaDataForConfiguration.apply(this, arguments);
737
- }
738
-
739
- return createMediaDataForConfiguration;
740
- }()
741
- }, {
742
- key: "captureAndSaveConfiguration",
743
- value: function () {
744
- var _captureAndSaveConfiguration = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee6(saveType) {
745
- var extraData,
746
- configuration,
747
- _args6 = arguments;
748
- return regeneratorRuntime.wrap(function _callee6$(_context6) {
749
- while (1) {
750
- switch (_context6.prev = _context6.next) {
751
- case 0:
752
- extraData = _args6.length > 1 && _args6[1] !== undefined ? _args6[1] : {};
753
- _context6.prev = 1;
754
- _context6.next = 4;
755
- return this.editNameAsync(saveType);
756
-
757
- case 4:
758
- _context6.next = 10;
759
- break;
760
-
761
- case 6:
762
- _context6.prev = 6;
763
- _context6.t0 = _context6["catch"](1);
764
- // do not save if the name is not entered / confirmed
765
- // eslint-disable-next-line no-console
766
- console.error('Custom name editor not confirmed!');
767
- return _context6.abrupt("return");
768
-
769
- case 10:
770
- configuration = this.prepareConfigurationForSave(false, extraData);
771
- _context6.next = 13;
772
- return this.createMediaDataForConfiguration(configuration);
773
-
774
- case 13:
775
- return _context6.abrupt("return", this.saveConfiguration(configuration, saveType));
776
-
777
- case 14:
778
- case "end":
779
- return _context6.stop();
780
- }
781
- }
782
- }, _callee6, this, [[1, 6]]);
783
- }));
784
-
785
- function captureAndSaveConfiguration(_x7) {
786
- return _captureAndSaveConfiguration.apply(this, arguments);
787
- }
788
-
789
- return captureAndSaveConfiguration;
790
- }()
791
- }, {
792
- key: "editNameAsync",
793
- value: function editNameAsync(saveType) {
794
- if ((0, _configuration2.getConf)('editCustomTitleBeforeSave') && (0, _configuration2.getConf)('customTitleSaveTypes').indexOf(saveType) !== -1) {
795
- _ServiceLocator.Services.ui.show('customTitleEditor');
796
-
797
- return _ServiceLocator.Services.async.create('customEditorConfirm');
798
- }
799
- }
800
- }, {
801
- key: "validateConfiguration",
802
- value: function validateConfiguration() {
803
- return _ServiceLocator.Services.store.dispatch((0, _Actions2.withGlobalLoader)(configuratorActions.validateConfiguration(this.state.configuration)));
804
- }
805
- }, {
806
- key: "saveAndReloadConfiguration",
807
- value: function () {
808
- var _saveAndReloadConfiguration = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee7(saveType) {
809
- var tmpConfiguration, _configuration, _this$state, selectedoptionclassification, configuration, loadIdentifier, itemIdentifier;
810
-
811
- return regeneratorRuntime.wrap(function _callee7$(_context7) {
812
- while (1) {
813
- switch (_context7.prev = _context7.next) {
814
- case 0:
815
- if (!this.state.configuration.item.identifier) {
816
- _context7.next = 6;
817
- break;
818
- }
819
-
820
- tmpConfiguration = (0, _omit["default"])(this.state.configuration, ['code', 'date_created']);
821
- _context7.next = 4;
822
- return this.saveConfiguration(tmpConfiguration, saveType);
823
-
824
- case 4:
825
- _configuration = this.state.configuration;
826
- this.setLoadCode(_configuration.code);
827
-
828
- case 6:
829
- _this$state = this.state, selectedoptionclassification = _this$state.selectedoptionclassification, configuration = _this$state.configuration, loadIdentifier = _this$state.loadIdentifier;
830
- itemIdentifier = configuration.item.identifier || loadIdentifier; // item identifier is required for the following actions
831
-
832
- if (itemIdentifier) {
833
- _context7.next = 10;
834
- break;
835
- }
836
-
837
- return _context7.abrupt("return");
838
-
839
- case 10:
840
- // reload inspirations
841
- if ((0, _configuration2.getConf)('loadInspirations')) {
842
- this.loadInspirations(itemIdentifier);
843
- } // reload configuration variants
844
-
845
-
846
- this.loadConfigurationVariants(itemIdentifier); // the optionlist should be reloaded as well if open
847
-
848
- if (configuration.item.identifier && selectedoptionclassification.identifier) {
849
- this.loadOptions(configuration.item.identifier, selectedoptionclassification.identifier, configuration);
850
- }
851
-
852
- case 13:
853
- case "end":
854
- return _context7.stop();
855
- }
856
- }
857
- }, _callee7, this);
858
- }));
859
-
860
- function saveAndReloadConfiguration(_x8) {
861
- return _saveAndReloadConfiguration.apply(this, arguments);
862
- }
863
-
864
- return saveAndReloadConfiguration;
865
- }()
866
- }, {
867
- key: "setLoadCode",
868
- value: function setLoadCode(code) {
869
- return _ServiceLocator.Services.store.dispatch(configuratorActions.setLoadCode(code));
870
- }
871
- }, {
872
- key: "setLoadIdentifier",
873
- value: function setLoadIdentifier(identifier) {
874
- return _ServiceLocator.Services.store.dispatch(configuratorActions.setLoadIdentifier(identifier));
875
- }
876
- }, {
877
- key: "loadInspirations",
878
- value: function loadInspirations(itemIdentifier) {
879
- return _ServiceLocator.Services.store.dispatch(configuratorActions.fetchInspirations(itemIdentifier));
880
- }
881
- }, {
882
- key: "loadConfigurationVariants",
883
- value: function loadConfigurationVariants(itemIdentifier) {
884
- return _ServiceLocator.Services.store.dispatch(configuratorActions.fetchConfigurationVariants(itemIdentifier));
885
- }
886
- }, {
887
- key: "loadOptions",
888
- value: function loadOptions(itemIdentifier, optionClassificationIdentifier, configuration) {
889
- return _ServiceLocator.Services.store.dispatch(configuratorActions.fetchOptions(itemIdentifier, optionClassificationIdentifier, configuration));
890
- }
891
- }, {
892
- key: "loadInitialOptions",
893
- value: function loadInitialOptions() {
894
- return _ServiceLocator.Services.store.dispatch(configuratorActions.loadInitialOptionclassification(this.state.configuration));
895
- }
896
- }, {
897
- key: "loadInitialConfiguration",
898
- value: function loadInitialConfiguration() {
899
- return _ServiceLocator.Services.store.dispatch((0, _Actions2.withGlobalLoader)(configuratorActions.fetchInitialConfiguration()));
900
- }
901
- }, {
902
- key: "loadConfigurationForDesignerProductPreview",
903
- value: function loadConfigurationForDesignerProductPreview() {
904
- return _ServiceLocator.Services.store.dispatch((0, _Actions2.withGlobalLoader)(configuratorActions.fetchConfigurationForDesignerProductPreview()));
905
- }
906
- }, {
907
- key: "loadCodeSnippets",
908
- value: function loadCodeSnippets() {
909
- var _this3 = this;
910
-
911
- return _ServiceLocator.Services.store.dispatch(configuratorActions.fetchCodesnippets()).then(function (codeSnippets) {
912
- return _this3.attachCodeSnippets(codeSnippets);
913
- });
914
- }
915
- }, {
916
- key: "loadClientData",
917
- value: function loadClientData() {
918
- return _ServiceLocator.Services.store.dispatch((0, _Actions2.withGlobalLoader)(configuratorActions.fetchClientData()));
919
- }
920
- }, {
921
- key: "attachCodeSnippets",
922
- value: function attachCodeSnippets(codeSnippets) {
923
- if (codeSnippets.data.length > 0) {
924
- codeSnippets.data.forEach(function (_ref4) {
925
- var code = _ref4.code;
926
- var fragment = document.createRange().createContextualFragment(code);
927
-
928
- while (fragment.children.length > 0) {
929
- document.head.insertBefore(fragment.children[0], document.head.firstElementChild);
930
- }
931
- });
932
- window.dataLayer && _ServiceLocator.Services.analytics.setDataLayer(window.dataLayer);
933
- }
934
- }
935
- }, {
936
- key: "setSelectedAmount",
937
- value: function setSelectedAmount(identifier, amount) {
938
- var isUpdatedByUser = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;
939
- return _ServiceLocator.Services.store.dispatch(configuratorActions.setSelectedAmount(identifier || (0, _Selectors.getSelectedVariantIdentifier)(this.state) || this.state.configuration.item.identifier, amount, isUpdatedByUser));
940
- }
941
- }, {
942
- key: "resolveCalculationErrors",
943
- value: function resolveCalculationErrors() {
944
- var configuratorstate = _ServiceLocator.Services.store.state.configurator;
945
- var configurationItem = (0, _get["default"])(configuratorstate, 'configuration.item', {});
946
-
947
- if ((0, _Selectors.createCalculationErrorChecker)(configuratorstate).isMinOrderAmountError()) {
948
- var calculation = (0, _Selectors.getCalculation)(configuratorstate);
949
- calculation.errors.forEach(function (error) {
950
- var variant = '';
951
- var amount = 0;
952
-
953
- if (error.itemIdentifier === configurationItem.parentItemIdentifier) {
954
- var selectedAmounts = (0, _Selectors.getSelectedAmounts)(configuratorstate);
955
-
956
- if ((0, _keys2["default"])(selectedAmounts).length > 1) {
957
- variant = configuratorstate.selectedVariantIdentifier;
958
- var selectedVariantAmount = (0, _has["default"])(selectedAmounts, configuratorstate.selectedVariantIdentifier) ? selectedAmounts[configuratorstate.selectedVariantIdentifier] : 0;
959
- amount = error.minimumAmount - error.selectedAmount + selectedVariantAmount;
960
- } else {
961
- variant = configuratorstate.selectedVariantIdentifier;
962
- amount = error.minimumAmount;
963
- }
964
- } else {
965
- variant = error.itemIdentifier;
966
- amount = error.minimumAmount;
967
- }
968
-
969
- _ServiceLocator.Services.store.dispatch(configuratorActions.setSelectedAmount(variant, amount, false));
970
- });
971
- }
972
-
973
- _ServiceLocator.Services.store.dispatch(configuratorActions.setCalculationErrorsResolved());
974
- }
975
- }, {
976
- key: "updateSelectedAmount",
977
- value: function updateSelectedAmount(oldVariant, newVariant) {
978
- if (!(0, _Selectors.isSelectedAmountsUpdated)(this.state) && !(0, _Selectors.hasMultipleVariantsSelected)(this.state)) {
979
- if (!oldVariant.children && !newVariant.children && !oldVariant.itemGroup && !newVariant.itemGroup) {
980
- return _ServiceLocator.Services.store.dispatch(configuratorActions.switchSelectedAmount(oldVariant.identifier, newVariant.identifier));
981
- }
982
-
983
- var oldIdentifiers = (0, _Selectors.getDeepestChildIdentifiers)(oldVariant);
984
- var newIdentifiers = (0, _Selectors.getDeepestChildIdentifiers)(newVariant);
985
- var oldIdentifierKeys = (0, _keys2["default"])(oldIdentifiers);
986
- var newIdentifierKeys = (0, _keys2["default"])(newIdentifiers);
987
- var sortedOldIdentifierKeys = oldIdentifierKeys.sort(function (a, b) {
988
- return a.localeCompare(b, 0, {
989
- numeric: false
990
- });
991
- });
992
- var sortedNewIdentifierKeys = newIdentifierKeys.sort(function (a, b) {
993
- return a.localeCompare(b, 0, {
994
- numeric: false
995
- });
996
- });
997
- var identifierDiffs = (0, _difference["default"])(sortedOldIdentifierKeys, sortedNewIdentifierKeys);
998
-
999
- if (identifierDiffs.length === 0 && (0, _isEqual["default"])(sortedOldIdentifierKeys, sortedNewIdentifierKeys)) {
1000
- for (var key in oldIdentifiers) {
1001
- if (!oldIdentifiers.hasOwnProperty(key)) {
1002
- continue;
1003
- }
1004
-
1005
- if (newIdentifiers[key]) {
1006
- _ServiceLocator.Services.store.dispatch(configuratorActions.switchSelectedAmount(oldIdentifiers[key], newIdentifiers[key]));
1007
- }
1008
- }
1009
- }
1010
- }
1011
- }
1012
- }, {
1013
- key: "clearBulkNames",
1014
- value: function clearBulkNames() {
1015
- return _ServiceLocator.Services.store.dispatch(configuratorActions.clearBulkNames());
1016
- }
1017
- }, {
1018
- key: "saveBulkNames",
1019
- value: function saveBulkNames(identifier, bulkNamesData) {
1020
- return _ServiceLocator.Services.store.dispatch(configuratorActions.saveBulkNames(identifier, bulkNamesData));
1021
- }
1022
- }, {
1023
- key: "switchSelectedAmount",
1024
- value: function switchSelectedAmount(oldIdentifier, newIdentifier) {
1025
- this.setSelectedVariantIdentifier(newIdentifier);
1026
- var item = this.state.configuration.item;
1027
- var oldVariant = (0, _find["default"])(item.itemGroup.children, function (o) {
1028
- return o.identifier === oldIdentifier;
1029
- });
1030
- var newVariant = (0, _find["default"])(item.itemGroup.children, function (o) {
1031
- return o.identifier === newIdentifier;
1032
- });
1033
- var selectedAmounts = (0, _Selectors.getSelectedAmounts)(this.state);
1034
- var firstSelectedAmountIdentifier = (0, _keys2["default"])(selectedAmounts)[0];
1035
- var oldSelectedAmountVariant = (0, _find["default"])(item.itemGroup.children, function (o) {
1036
- if (o.itemGroup) {
1037
- var children = o.itemGroup.children;
1038
- return children.find(function (child) {
1039
- return child.identifier === firstSelectedAmountIdentifier;
1040
- });
1041
- } else {
1042
- return o.identifier === firstSelectedAmountIdentifier;
1043
- }
1044
- });
1045
-
1046
- if (!(0, _configuration2.getConf)('restrictAmountselectionToSelectedVariant', false)) {
1047
- // Updates selected Amounts from previous selectedVariant amount to new variant
1048
- this.updateSelectedAmount(oldSelectedAmountVariant, newVariant);
1049
- return;
1050
- }
1051
-
1052
- if (!oldVariant.children && !newVariant.children) {
1053
- return _ServiceLocator.Services.store.dispatch(configuratorActions.switchSelectedAmount(oldVariant.identifier, newVariant.identifier));
1054
- }
1055
-
1056
- var oldIdentifiers = (0, _Selectors.getDeepestChildIdentifiers)(oldVariant);
1057
- var newIdentifiers = (0, _Selectors.getDeepestChildIdentifiers)(newVariant);
1058
-
1059
- for (var key in oldIdentifiers) {
1060
- if (!oldIdentifiers.hasOwnProperty(key)) {
1061
- continue;
1062
- }
1063
-
1064
- if (newIdentifiers[key]) {
1065
- _ServiceLocator.Services.store.dispatch(configuratorActions.switchSelectedAmount(oldIdentifiers[key], newIdentifiers[key]));
1066
- }
1067
- }
1068
- }
1069
- }, {
1070
- key: "setConfigurationComment",
1071
- value: function setConfigurationComment(comment) {
1072
- return _ServiceLocator.Services.store.dispatch(configuratorActions.setComment(comment));
1073
- }
1074
- }, {
1075
- key: "setSelectedCalculation",
1076
- value: function setSelectedCalculation(identifier, value) {
1077
- return _ServiceLocator.Services.store.dispatch(configuratorActions.setSelectedCalculation(identifier, value));
1078
- }
1079
- }, {
1080
- key: "setSelectedVariantIdentifier",
1081
- value: function setSelectedVariantIdentifier(identifier) {
1082
- return _ServiceLocator.Services.store.dispatch(configuratorActions.setSelectedVariantIdentifier(identifier));
1083
- }
1084
- /**
1085
- * A simple method for saving the configuration without any additional design data or screenshot
1086
- * @param {string} saveType
1087
- * @param {object} extraData
1088
- * @returns {Promise}
1089
- */
1090
-
1091
- }, {
1092
- key: "prepareAndSaveConfiguration",
1093
- value: function prepareAndSaveConfiguration(saveType) {
1094
- var extraData = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
1095
- var configuration = this.prepareConfigurationForSave(false, extraData);
1096
- return this.saveConfiguration(configuration, saveType);
1097
- }
1098
- }, {
1099
- key: "addToCartCallback",
1100
- value: function addToCartCallback(configuration) {
1101
- // after saving call parent function if existing or send postMessage (depending on the configuration)
1102
- if (window.parent !== undefined) {
1103
- var addToCartMethod = (0, _configuration2.getConf)('addToCartMethod');
1104
-
1105
- if (addToCartMethod === 'postMessage' && window.parent.postMessage !== undefined) {
1106
- var appConf = (0, _configuration2.getConf)();
1107
- var targetOrigin = (0, _get["default"])(appConf, 'addToCartPostMessageTargetOrigin', '*');
1108
- window.parent.postMessage({
1109
- method: 'addtocart',
1110
- code: configuration.code
1111
- }, targetOrigin);
1112
- } else if (addToCartMethod === 'functionCall' && window.parent.addToCart !== undefined) {
1113
- window.parent.addToCart(configuration.code);
1114
- }
1115
- }
1116
- }
1117
- }]);
1118
-
1119
- return ConfiguratorService;
1120
- }(_AbstractConfiguratorService["default"]);
1121
-
1122
- exports["default"] = ConfiguratorService;