@configuratorware/configurator-frontendgui 1.41.2 → 1.42.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/App/Constant.js +2 -3
- package/App/Error/DevelopmentErrorPage/index.js +4 -19
- package/App/Error/ErrorBoundary.js +13 -43
- package/App/Error/ProductionErrorPage/index.js +2 -11
- package/App/Error/ProductionErrorPage/index.story.js +0 -4
- package/App/Frame.js +10 -43
- package/App/Modules/Creator/Components/ConfigurationvariantItem/index.js +15 -58
- package/App/Modules/Creator/Components/ConfigurationvariantSelection/index.js +20 -60
- package/App/Modules/Creator/Components/CustomTitleEditor/index.js +15 -64
- package/App/Modules/Creator/Components/ExternalVisualization/index.js +19 -47
- package/App/Modules/Creator/Components/FastConfiguration/SelectableRow.js +10 -37
- package/App/Modules/Creator/Components/FastConfiguration/index.js +37 -101
- package/App/Modules/Creator/Components/FastConfigurationRow/index.js +12 -38
- package/App/Modules/Creator/Components/FastConfigurationSelect/index.js +29 -85
- package/App/Modules/Creator/Components/FormattedNumber/index.js +1 -17
- package/App/Modules/Creator/Components/FormattedPrice/index.js +1 -19
- package/App/Modules/Creator/Components/FullScreenView/FullScreenView.js +17 -36
- package/App/Modules/Creator/Components/Incompatibility/OptionExclusionRule/index.js +24 -61
- package/App/Modules/Creator/Components/Incompatibility/OptionRule/index.js +24 -60
- package/App/Modules/Creator/Components/Incompatibility/RuleComponent.js +12 -45
- package/App/Modules/Creator/Components/Incompatibility/index.js +28 -89
- package/App/Modules/Creator/Components/InvalidConfigurationNotice/index.js +14 -53
- package/App/Modules/Creator/Components/LoginForm/index.js +14 -52
- package/App/Modules/Creator/Components/Option/index.js +53 -155
- package/App/Modules/Creator/Components/Option/index.story.js +6 -17
- package/App/Modules/Creator/Components/OptionAmount/index.js +33 -74
- package/App/Modules/Creator/Components/OptionGroup/index.js +10 -23
- package/App/Modules/Creator/Components/Optiondetail/ZoomImage/index.js +26 -68
- package/App/Modules/Creator/Components/Optiondetail/index.js +44 -129
- package/App/Modules/Creator/Components/Optiondetail/index.story.js +11 -72
- package/App/Modules/Creator/Components/Optiondetail/index.test.mocks.js +56 -0
- package/App/Modules/Creator/Components/OptionsList/index.js +31 -81
- package/App/Modules/Creator/Components/Price/index.js +12 -40
- package/App/Modules/Creator/Components/ProductPart/index.js +14 -46
- package/App/Modules/Creator/Components/ProductPart/index.story.js +6 -17
- package/App/Modules/Creator/Components/ProductPartsList/index.js +25 -68
- package/App/Modules/Creator/Components/ProductPartsList/index.story.js +6 -21
- package/App/Modules/Creator/Components/SavedConfiguration/index.js +13 -45
- package/App/Modules/Creator/Components/ShareConfiguration/index.js +31 -90
- package/App/Modules/Creator/Components/StockInformation/index.js +13 -44
- package/App/Modules/Creator/Components/StoreConfigurationForm/index.js +15 -52
- package/App/Modules/Creator/Components/Tools/index.js +11 -45
- package/App/Modules/Creator/Components/ValidationResult/index.js +16 -62
- package/App/Modules/Creator/Components/index.js +2 -29
- package/App/Modules/Creator/Containers/AmountPrice/index.js +3 -12
- package/App/Modules/Creator/Containers/ConfigurationvariantSelection/index.js +5 -19
- package/App/Modules/Creator/Containers/CustomTitleEditor/index.js +4 -19
- package/App/Modules/Creator/Containers/FastConfiguration/index.js +6 -20
- package/App/Modules/Creator/Containers/FormattedPrice/index.js +4 -13
- package/App/Modules/Creator/Containers/Incompatibility/index.js +2 -12
- package/App/Modules/Creator/Containers/InvalidConfigurationNotice/index.js +8 -31
- package/App/Modules/Creator/Containers/LoadingOverlay/index.js +2 -9
- package/App/Modules/Creator/Containers/Optiondetail/index.js +7 -18
- package/App/Modules/Creator/Containers/OptionsList/index.js +3 -15
- package/App/Modules/Creator/Containers/ProductPart/index.js +1 -9
- package/App/Modules/Creator/Containers/ProductPartsList/index.js +3 -16
- package/App/Modules/Creator/Containers/SavedConfigurationContainer/index.js +1 -8
- package/App/Modules/Creator/Containers/ShareConfiguration/index.js +2 -10
- package/App/Modules/Creator/Containers/StockInformation/index.js +2 -10
- package/App/Modules/Creator/Containers/Tools/index.js +1 -10
- package/App/Modules/Creator/Containers/ValidationResult/index.js +2 -10
- package/App/Modules/Creator/Containers/index.js +42 -64
- package/App/Modules/Creator/CreatorScreen.js +45 -121
- package/App/Modules/Creator/Layouts/DefaultLayout.js +21 -50
- package/App/Modules/Designer/Components/AddGalleryImage/index.js +31 -92
- package/App/Modules/Designer/Components/AddGalleryImage/index.story.js +9 -22
- package/App/Modules/Designer/Components/AddGalleryImage/index.test.js +13 -35
- package/App/Modules/Designer/Components/AddVisualElement/index.js +30 -86
- package/App/Modules/Designer/Components/AddVisualElement/index.story.js +0 -5
- package/App/Modules/Designer/Components/AddVisualElement/index.test.js +12 -15
- package/App/Modules/Designer/Components/CloseDesignEditor/index.js +18 -51
- package/App/Modules/Designer/Components/CloseGraphicsEditorButton/index.js +7 -17
- package/App/Modules/Designer/Components/ColorPalettes/ColorPalettesSearch.js +20 -57
- package/App/Modules/Designer/Components/ColorPalettes/index.js +62 -178
- package/App/Modules/Designer/Components/ColorPalettes/index.story.js +0 -8
- package/App/Modules/Designer/Components/ColorPalettes/index.test.js +7 -11
- package/App/Modules/Designer/Components/DesignAreaControlbox/index.js +35 -108
- package/App/Modules/Designer/Components/DesignAreaControlbox/index.story.js +0 -8
- package/App/Modules/Designer/Components/DesignAreaControlbox/index.test.js +15 -23
- package/App/Modules/Designer/Components/DesignerSelectionToolbox/CustomFontOverlay.js +18 -51
- package/App/Modules/Designer/Components/DesignerSelectionToolbox/DesignerSelectionToolbox.js +53 -150
- package/App/Modules/Designer/Components/DesignerSelectionToolbox/fontItemUtils.js +10 -20
- package/App/Modules/Designer/Components/Dialog/index.js +21 -63
- package/App/Modules/Designer/Components/EditDesignButton/index.js +20 -43
- package/App/Modules/Designer/Components/FeedbackNotice/index.js +17 -53
- package/App/Modules/Designer/Components/FeedbackNotice/index.test.js +0 -4
- package/App/Modules/Designer/Components/FullScreenView/FullScreenView.js +6 -14
- package/App/Modules/Designer/Components/ImageColorPicker/ImageColorPicker.dev.js +5 -14
- package/App/Modules/Designer/Components/ImageColorPicker/ImageColorPicker.js +42 -137
- package/App/Modules/Designer/Components/ImageColorize/index.js +54 -177
- package/App/Modules/Designer/Components/ImageColorize/index.story.js +2 -6
- package/App/Modules/Designer/Components/ImageControlbox/index.js +27 -90
- package/App/Modules/Designer/Components/ImageEditDialog/ImageThumbnail.js +26 -71
- package/App/Modules/Designer/Components/ImageEditDialog/ImageUpload.js +138 -170
- package/App/Modules/Designer/Components/ImageEditDialog/index.js +55 -168
- package/App/Modules/Designer/Components/ImageLibraryFilter/index.js +20 -61
- package/App/Modules/Designer/Components/ImageLibraryThumbnail/index.js +24 -66
- package/App/Modules/Designer/Components/ObjectTools/index.js +18 -56
- package/App/Modules/Designer/Components/Select/index.js +21 -65
- package/App/Modules/Designer/Components/TextControlbox/TextFormatIcon.js +5 -20
- package/App/Modules/Designer/Components/TextControlbox/index.js +58 -176
- package/App/Modules/Designer/Components/TextControlbox/index.story.js +0 -10
- package/App/Modules/Designer/Components/TextControlbox/index.test.js +34 -41
- package/App/Modules/Designer/Containers/AddGalleryImage.js +8 -24
- package/App/Modules/Designer/Containers/AddVisualElement.js +28 -87
- package/App/Modules/Designer/Containers/CloseDesignEditor.js +1 -10
- package/App/Modules/Designer/Containers/CloseGraphicsEditorButton.js +1 -10
- package/App/Modules/Designer/Containers/ColorPalettes.js +22 -61
- package/App/Modules/Designer/Containers/DesignAreaControlbox.js +5 -17
- package/App/Modules/Designer/Containers/Designer.js +1 -10
- package/App/Modules/Designer/Containers/DesignerSelectionToolbox.js +7 -30
- package/App/Modules/Designer/Containers/EditDesignButton.js +1 -11
- package/App/Modules/Designer/Containers/ImageEditDialog.js +400 -658
- package/App/Modules/Designer/Designer.js +28 -84
- package/App/Modules/Designer/DesignerScreen.js +45 -100
- package/App/Modules/Designer/DesignerUI.js +31 -87
- package/App/Modules/Designer/Layouts/DefaultLayout.js +20 -45
- package/App/Modules/Designer/Layouts/Mobile/TwoSideBottomBar.js +4 -16
- package/App/Modules/Designer/Layouts/PopupAreaProvider.js +20 -67
- package/App/Modules/Designer/MultilayerComponents/DesignerClickAwayListener.js +5 -23
- package/App/Modules/Designer/MultilayerComponents/InlineToolboxPortal.js +19 -52
- package/App/Modules/Designer/MultilayerComponents/StandardToolboxPortal.js +9 -25
- package/App/Modules/Designer/Utils/FontFaceRepository.js +8 -30
- package/App/Modules/Designer/Utils/ImageEditUtils.js +14 -38
- package/App/Modules/Designer/Utils/SvgFixers.js +8 -26
- package/App/Modules/Designer/Utils/Transformers.js +54 -112
- package/App/Modules/Designer/setupDesigner.js +50 -72
- package/App/Modules/Designer/withActiveCanvas.js +22 -70
- package/App/Modules/Visualization/AlignTargetContainer.js +8 -19
- package/App/Modules/Visualization/CreatorAlignTarget.js +9 -20
- package/App/Modules/Visualization/DefaultVisualizationProvider.js +18 -50
- package/App/Modules/Visualization/DesignerAlignTarget.js +7 -13
- package/App/Modules/Visualization/Utils/getFirstDataURLFromScreenshotsObj.js +0 -3
- package/App/Reducers/Actions.js +81 -145
- package/App/Reducers/ConfigurationMode/Actions.js +4 -9
- package/App/Reducers/ConfigurationMode/Reducer.js +6 -23
- package/App/Reducers/ConfigurationMode/Selectors.js +22 -41
- package/App/Reducers/Configurator/Actions.js +386 -760
- package/App/Reducers/Configurator/AttributeSelectors.js +5 -17
- package/App/Reducers/Configurator/Modifiers.js +8 -15
- package/App/Reducers/Configurator/Reducer.js +107 -202
- package/App/Reducers/Configurator/Selectors.js +46 -119
- package/App/Reducers/Confirm/Actions.js +28 -49
- package/App/Reducers/Confirm/Reducer.js +1 -9
- package/App/Reducers/DesignArea/Actions.js +8 -29
- package/App/Reducers/DesignArea/DesignElementSelectors.js +18 -41
- package/App/Reducers/DesignArea/MaskSelectors.js +12 -35
- package/App/Reducers/DesignArea/Reducer.js +8 -40
- package/App/Reducers/DesignArea/Selectors.js +148 -413
- package/App/Reducers/DesignArea/Transformers.js +22 -87
- package/App/Reducers/DesignData/Actions.js +31 -93
- package/App/Reducers/DesignData/Modifiers.js +34 -114
- package/App/Reducers/DesignData/Reducer.js +9 -38
- package/App/Reducers/DesignData/Selectors.js +17 -50
- package/App/Reducers/DesignData/Transformers.js +2 -6
- package/App/Reducers/DesignView/Actions.js +3 -7
- package/App/Reducers/DesignView/Reducer.js +13 -47
- package/App/Reducers/DesignView/Selectors.js +17 -49
- package/App/Reducers/DesignView/Transformers.js +0 -3
- package/App/Reducers/Device/Actions.js +3 -7
- package/App/Reducers/Device/Reducer.js +9 -16
- package/App/Reducers/Fonts/Actions.js +12 -45
- package/App/Reducers/Fonts/Reducer.js +2 -11
- package/App/Reducers/Fonts/Selectors.js +9 -25
- package/App/Reducers/GeneralActions.js +3 -7
- package/App/Reducers/ImageGallery/Actions.js +97 -189
- package/App/Reducers/ImageGallery/Modifiers.js +13 -24
- package/App/Reducers/ImageGallery/Reducer.js +29 -98
- package/App/Reducers/ImageGallery/Selectors.js +21 -79
- package/App/Reducers/Reducer.js +10 -26
- package/App/Reducers/UI/Actions.js +73 -113
- package/App/Reducers/UI/Reducer.js +17 -26
- package/App/Reducers/UI/Selectors.js +3 -12
- package/App/Reducers.js +7 -21
- package/App/Routing.js +30 -107
- package/App/Screens/Configurator/CalculationWidgetScreen.js +10 -39
- package/App/Screens/Configurator/Components/AmountSelection/index.js +25 -77
- package/App/Screens/Configurator/Components/AmountSelection/index.story.js +0 -8
- package/App/Screens/Configurator/Components/CalculationWidget/index.js +53 -154
- package/App/Screens/Configurator/Components/CalculationWidget/index.story.js +6 -19
- package/App/Screens/Configurator/Components/CalculationWidget/index.test.js +39 -38
- package/App/Screens/Configurator/Components/ConfigurationModeSwitch/ConfigurationModeSwitch.js +7 -30
- package/App/Screens/Configurator/Components/ConfigurationModeSwitch/index.js +0 -2
- package/App/Screens/Configurator/Components/Confirm/index.js +13 -50
- package/App/Screens/Configurator/Components/Error/index.js +11 -48
- package/App/Screens/Configurator/Components/FallbackVisualization/FallbackVisualization.js +13 -25
- package/App/Screens/Configurator/Components/FullScreenView/index.js +37 -116
- package/App/Screens/Configurator/Components/FullScreenView/index.test.js +1 -4
- package/App/Screens/Configurator/Components/ImageLoader/ImageLoader.js +11 -42
- package/App/Screens/Configurator/Components/ItemTile/ItemTile.js +89 -33
- package/App/Screens/Configurator/Components/LandscapeInformation/index.js +3 -19
- package/App/Screens/Configurator/Components/NoVisualization/NoVisualization.js +3 -11
- package/App/Screens/Configurator/Components/PreviewPortal/index.js +29 -81
- package/App/Screens/Configurator/Components/Thumbnail/index.js +36 -102
- package/App/Screens/Configurator/Components/Thumbnail/index.test.js +0 -4
- package/App/Screens/Configurator/Components/TotalPrice/TotalPrice.js +9 -24
- package/App/Screens/Configurator/Containers/AmountPrice.js +12 -36
- package/App/Screens/Configurator/Containers/CalculationWidget.js +24 -85
- package/App/Screens/Configurator/Containers/ConfigurationModeSwitch.js +22 -43
- package/App/Screens/Configurator/Containers/Confirm.js +1 -10
- package/App/Screens/Configurator/Containers/FallbackVisualization.js +1 -11
- package/App/Screens/Configurator/Containers/FullScreenView.js +1 -14
- package/App/Screens/Configurator/Containers/Thumbnail.js +1 -13
- package/App/Screens/Configurator/Containers/Visualization.js +1 -5
- package/App/Screens/Configurator/DynamicComponents.js +8 -22
- package/App/Screens/Configurator/Screen.js +31 -70
- package/App/Screens/Configurator/ScreenPropTypes.js +2 -6
- package/App/Screens/Configurator/ThemeProvider.js +8 -42
- package/App/Screens/DesignerProductPreview/Constants.js +4 -7
- package/App/Screens/DesignerProductPreview/DesignerProductPreviewManager.js +204 -289
- package/App/Screens/DesignerProductPreview/Screen.js +58 -139
- package/App/Screens/ItemOverview.js +156 -191
- package/App/Screens.js +12 -20
- package/App/ServiceLocator.js +26 -51
- package/App/Services/AdminareaCommunicationService.js +33 -69
- package/App/Services/AnalyticsService.js +13 -40
- package/App/Services/ConfiguratorService.js +381 -567
- package/App/Services/DesignDataService.js +1448 -2001
- package/App/Services/DesignerService.js +290 -350
- package/App/Services/InteractionService.js +349 -502
- package/App/Services/UIService.js +12 -39
- package/App/Services/VisualizationService.js +246 -336
- package/App/Shared/Components/AcceptDesign/index.js +27 -70
- package/App/Shared/Components/AcceptPrivacy/index.js +21 -58
- package/App/Shared/Components/AddToBasket/index.js +31 -81
- package/App/Shared/Components/AddToBasket/index.story.js +0 -9
- package/App/Shared/Components/AlertDialog/index.js +15 -57
- package/App/Shared/Components/AmountInput/index.js +34 -107
- package/App/Shared/Components/AmountInput/index.story.js +0 -6
- package/App/Shared/Components/AmountPrice/index.js +220 -382
- package/App/Shared/Components/AmountPrice/index.story.js +1 -10
- package/App/Shared/Components/AmountPrice/index.test.js +6 -12
- package/App/Shared/Components/Analytics/AnalyticsWrapper.js +9 -21
- package/App/Shared/Components/BulkNames/index.js +28 -92
- package/App/Shared/Components/CallToAction/index.js +18 -42
- package/App/Shared/Components/ConfigurationOverview/index.js +14 -47
- package/App/Shared/Components/Header/Header.js +18 -46
- package/App/Shared/Components/Header/index.js +0 -2
- package/App/Shared/Components/Header/index.story.js +0 -13
- package/App/Shared/Components/InformationTag/InformationTag.js +20 -55
- package/App/Shared/Components/LicenseNotice/LicenseNotice.js +20 -54
- package/App/Shared/Components/LicenseNotice/index.js +0 -2
- package/App/Shared/Components/LoadConfiguration/index.js +47 -82
- package/App/Shared/Components/MessageBox/index.js +2 -19
- package/App/Shared/Components/MessageBox/index.story.js +0 -7
- package/App/Shared/Components/Notification/index.js +18 -53
- package/App/Shared/Components/Notification/index.story.js +0 -4
- package/App/Shared/Components/PdfDownload/index.js +19 -59
- package/App/Shared/Components/PlusMinusInput/index.js +13 -37
- package/App/Shared/Components/PriceList/index.js +27 -78
- package/App/Shared/Components/PriceList/index.story.js +6 -15
- package/App/Shared/Components/PriceOverview/index.js +29 -74
- package/App/Shared/Components/PriceOverview/index.story.js +1 -18
- package/App/Shared/Components/ProductVariant/Image.js +13 -35
- package/App/Shared/Components/ProductVariant/index.js +34 -123
- package/App/Shared/Components/ProductVariant/index.story.js +9 -22
- package/App/Shared/Components/Progress/Progress.js +6 -15
- package/App/Shared/Components/ReceiveOfferForm/index.js +26 -80
- package/App/Shared/Components/ReceiveOfferForm/index.story.js +0 -6
- package/App/Shared/Components/ReceiveOfferForm/index.test.js +1 -6
- package/App/Shared/Components/SaveConfiguration/index.js +26 -83
- package/App/Shared/Components/SendEmail/index.js +8 -30
- package/App/Shared/Components/Stepper/index.js +19 -56
- package/App/Shared/Components/Stepper/index.story.js +0 -5
- package/App/Shared/Components/ToolbarList/index.js +23 -69
- package/App/Shared/Components/ToolbarList/index.story.js +0 -4
- package/App/Shared/Components/VariantChooser/index.js +25 -68
- package/App/Shared/Components/VariantChooser/index.story.js +0 -13
- package/App/Shared/Containers/AlertMessages.js +1 -11
- package/App/Shared/Containers/AmountPrice/AmountPriceAdminareaWrapper.js +4 -17
- package/App/Shared/Containers/AmountPrice/index.js +29 -74
- package/App/Shared/Containers/BulkNames.js +26 -117
- package/App/Shared/Containers/Error.js +1 -11
- package/App/Shared/Containers/GlobalLoader.js +1 -9
- package/App/Shared/Containers/Header/index.js +22 -57
- package/App/Shared/Containers/LicenseNotice/LicenseNotice.js +2 -9
- package/App/Shared/Containers/LicenseNotice/index.js +0 -2
- package/App/Shared/Containers/LoadConfiguration/LoadConfiguration.js +36 -79
- package/App/Shared/Containers/LoadConfiguration/index.js +0 -2
- package/App/Shared/Containers/PdfDownload/index.js +2 -11
- package/App/Shared/Containers/ProductVariant/ProductVariant.js +59 -144
- package/App/Shared/Containers/ProductVariant/index.js +0 -2
- package/App/Shared/Containers/SaveConfiguration.js +3 -14
- package/App/Shared/Containers/SendEmail/SendEmail.js +3 -15
- package/App/Shared/Containers/SendEmail/index.js +0 -2
- package/App/Shared/Providers/DefaultCanvasProvider.js +5 -25
- package/App/Storage.js +3 -7
- package/App/Store.js +17 -38
- package/App/Translations.js +29 -43
- package/App/Utils/Request/lazyFetch.js +29 -45
- package/App/Utils/Request/pathParams.js +2 -7
- package/App/Utils/createMessageInterface.js +10 -21
- package/App/Utils/customClassName.js +0 -2
- package/App/Utils/getContrastText.js +5 -7
- package/App/Utils/getImageUrl.js +0 -8
- package/App/configuration.js +74 -104
- package/App/index.js +7 -29
- package/App/initServices.js +9 -32
- package/App/setup.js +2 -6
- package/Framework/Api.js +19 -41
- package/Framework/ComponentContainer.js +28 -76
- package/Framework/Components/Carousel/index.js +40 -104
- package/Framework/Components/Dialog/index.js +101 -237
- package/Framework/Components/DialogSelect/index.js +38 -132
- package/Framework/Components/Input/index.js +16 -58
- package/Framework/Components/LoadingOverlay/index.js +1 -12
- package/Framework/Components/Markdown/index.js +5 -26
- package/Framework/Components/Mobile/index.js +5 -13
- package/Framework/CustomError.js +13 -29
- package/Framework/Helpers/TransitionDetect.js +10 -29
- package/Framework/Helpers/isLandscapeMobile.js +0 -3
- package/Framework/Helpers/isMobileDevice.js +3 -8
- package/Framework/Helpers/isMobileSize.js +1 -4
- package/Framework/Services/AbstractAdminareaCommunicationService.js +8 -15
- package/Framework/Services/AbstractAsyncService.js +7 -14
- package/Framework/Services/AbstractConfiguratorService.js +9 -15
- package/Framework/Services/AbstractInteractionService.js +7 -14
- package/Framework/Services/AbstractStoreService.js +9 -15
- package/Framework/Services/AbstractUIService.js +7 -14
- package/Framework/Services/AbstractVisualizationService.js +7 -14
- package/Framework/Services/AsyncService.js +11 -33
- package/Framework/Services/StoreService.js +43 -92
- package/Framework/bindDecorator.js +24 -54
- package/Framework/i18n.js +57 -142
- package/Resources/Icons/MaterialUI/Icons/AddCircle.js +1 -5
- package/Resources/Icons/MaterialUI/Icons/RemoveCircle.js +1 -5
- package/Shared/Components/CustomDialog.js +21 -36
- package/Shared/Components/CustomDialogSelect.js +17 -47
- package/Shared/Components/MainButton.js +14 -33
- package/Shared/ErrorTypes/DeferredError.js +13 -31
- package/Shared/HOCs/ResizeDetect/ResizeDetect.dev.js +9 -18
- package/Shared/HOCs/ResizeDetect/ResizeDetect.js +28 -87
- package/Shared/HOCs/getDisplayName.js +0 -1
- package/Shared/HOCs/withFixedChangeHandler.js +11 -25
- package/Shared/PropTypes/ReactComponent.js +1 -5
- package/Shared/Styles/absoluteCenter.js +2 -5
- package/Utils/Array/isIdentical.js +3 -12
- package/Utils/Async/AsyncManager.js +51 -75
- package/Utils/Async/Deferred.js +12 -40
- package/Utils/Async/ObjectLock.js +3 -7
- package/Utils/Decorators/Observable.js +17 -34
- package/Utils/Dev/HOCs/withFilePicker.js +13 -41
- package/Utils/Dev/isDev.js +0 -2
- package/Utils/Events/pointerEvent.js +14 -47
- package/Utils/Events/preventEventDoubling.js +2 -7
- package/Utils/Function/cached.js +1 -9
- package/Utils/Function/createDebounceManager.js +3 -18
- package/Utils/Function/createSelector.js +7 -18
- package/Utils/Function/memoize.js +3 -12
- package/Utils/Function/sendMessage.js +3 -8
- package/Utils/Helper/createSelectionRangeMemo.js +4 -12
- package/Utils/Immutable/set.js +12 -35
- package/Utils/Math/conversions.js +2 -5
- package/Utils/Math/isPositiveNumber.js +2 -5
- package/Utils/Redux/createActionWithGlobalState.js +8 -11
- package/Utils/Styles/combineMediaQueries.js +2 -6
- package/Utils/Styles/createCheckerBoardBackground.js +5 -6
- package/Utils/Test/CallOrderChecker.js +0 -3
- package/Utils/Test/createStoreProvider.js +1 -7
- package/Utils/Test/formDataToJSON.js +0 -1
- package/Utils/Test/mountWithState.js +3 -9
- package/index.js +2 -2
- package/package.json +36 -33
- package/public/translations/de_DE.json +3 -27
- package/public/translations/en_GB.json +2 -26
- package/scripts/getDefaultWebpackConfig.js +25 -14
- package/src/App/Error/ProductionErrorPage/index.js +1 -1
- package/src/App/Modules/Creator/Components/ConfigurationvariantItem/index.js +3 -4
- package/src/App/Modules/Creator/Components/ConfigurationvariantSelection/index.js +2 -1
- package/src/App/Modules/Creator/Components/FastConfiguration/SelectableRow.js +1 -1
- package/src/App/Modules/Creator/Components/FastConfiguration/index.js +6 -5
- package/src/App/Modules/Creator/Components/FastConfigurationSelect/index.js +8 -6
- package/src/App/Modules/Creator/Components/FullScreenView/FullScreenView.js +3 -1
- package/src/App/Modules/Creator/Components/Incompatibility/OptionExclusionRule/index.js +2 -2
- package/src/App/Modules/Creator/Components/Incompatibility/OptionRule/index.js +2 -2
- package/src/App/Modules/Creator/Components/Incompatibility/index.js +2 -2
- package/src/App/Modules/Creator/Components/InvalidConfigurationNotice/index.js +1 -1
- package/src/App/Modules/Creator/Components/Option/__snapshots__/index.test.js.snap +0 -13
- package/src/App/Modules/Creator/Components/Option/index.js +9 -6
- package/src/App/Modules/Creator/Components/Option/index.test.js +1 -1
- package/src/App/Modules/Creator/Components/OptionAmount/index.js +2 -1
- package/src/App/Modules/Creator/Components/OptionAmount/index.test.js +1 -1
- package/src/App/Modules/Creator/Components/Optiondetail/ZoomImage/index.js +1 -1
- package/src/App/Modules/Creator/Components/Optiondetail/index.js +9 -7
- package/src/App/Modules/Creator/Components/Optiondetail/index.story.js +1 -48
- package/src/App/Modules/Creator/Components/Optiondetail/index.test.js +1 -1
- package/src/App/Modules/Creator/Components/Optiondetail/index.test.mocks.js +49 -0
- package/src/App/Modules/Creator/Components/OptionsList/index.js +3 -2
- package/src/App/Modules/Creator/Components/ProductPart/index.test.js +1 -1
- package/src/App/Modules/Creator/Components/ProductPartsList/index.js +1 -1
- package/src/App/Modules/Creator/Components/SavedConfiguration/index.js +3 -3
- package/src/App/Modules/Creator/Components/StoreConfigurationForm/index.js +2 -2
- package/src/App/Modules/Creator/Containers/CustomTitleEditor/index.js +1 -1
- package/src/App/Modules/Creator/Containers/FastConfiguration/index.js +1 -1
- package/src/App/Modules/Creator/Containers/FormattedPrice/index.js +1 -1
- package/src/App/Modules/Creator/Containers/InvalidConfigurationNotice/index.js +1 -1
- package/src/App/Modules/Creator/Containers/Optiondetail/index.js +1 -1
- package/src/App/Modules/Designer/Components/AddGalleryImage/__snapshots__/index.test.jsx.snap +0 -8
- package/src/App/Modules/Designer/Components/AddGalleryImage/index.js +4 -4
- package/src/App/Modules/Designer/Components/AddGalleryImage/index.test.jsx +0 -27
- package/src/App/Modules/Designer/Components/AddVisualElement/index.js +6 -6
- package/src/App/Modules/Designer/Components/AddVisualElement/index.test.jsx +3 -2
- package/src/App/Modules/Designer/Components/CloseDesignEditor/index.js +3 -3
- package/src/App/Modules/Designer/Components/ColorPalettes/ColorPalettesSearch.js +6 -6
- package/src/App/Modules/Designer/Components/ColorPalettes/index.js +14 -14
- package/src/App/Modules/Designer/Components/ColorPalettes/index.test.jsx +1 -1
- package/src/App/Modules/Designer/Components/DesignAreaControlbox/index.js +8 -8
- package/src/App/Modules/Designer/Components/DesignAreaControlbox/index.test.jsx +1 -1
- package/src/App/Modules/Designer/Components/DesignerSelectionToolbox/CustomFontOverlay.js +5 -5
- package/src/App/Modules/Designer/Components/DesignerSelectionToolbox/DesignerSelectionToolbox.js +2 -2
- package/src/App/Modules/Designer/Components/Dialog/index.js +1 -1
- package/src/App/Modules/Designer/Components/EditDesignButton/index.js +3 -2
- package/src/App/Modules/Designer/Components/FeedbackNotice/index.js +3 -3
- package/src/App/Modules/Designer/Components/ImageColorize/index.js +1 -1
- package/src/App/Modules/Designer/Components/ImageControlbox/index.js +6 -6
- package/src/App/Modules/Designer/Components/ImageEditDialog/ImageUpload.js +32 -6
- package/src/App/Modules/Designer/Components/ImageEditDialog/index.js +16 -12
- package/src/App/Modules/Designer/Components/ImageLibraryFilter/index.js +6 -6
- package/src/App/Modules/Designer/Components/ImageLibraryThumbnail/index.js +11 -7
- package/src/App/Modules/Designer/Components/ObjectTools/index.js +2 -2
- package/src/App/Modules/Designer/Components/Select/index.js +3 -3
- package/src/App/Modules/Designer/Components/TextControlbox/TextFormatIcon.js +1 -1
- package/src/App/Modules/Designer/Components/TextControlbox/index.js +11 -11
- package/src/App/Modules/Designer/Components/TextControlbox/index.test.jsx +3 -2
- package/src/App/Modules/Designer/Containers/AddGalleryImage.js +1 -1
- package/src/App/Modules/Designer/Designer.js +1 -1
- package/src/App/Modules/Designer/DesignerUI.js +7 -2
- package/src/App/Modules/Designer/Layouts/Mobile/TwoSideBottomBar.js +1 -1
- package/src/App/Modules/Designer/Layouts/PopupAreaProvider.js +1 -1
- package/src/App/Modules/Designer/MultilayerComponents/DesignerClickAwayListener.js +1 -1
- package/src/App/Modules/Designer/MultilayerComponents/InlineToolboxPortal.js +1 -1
- package/src/App/Modules/Designer/MultilayerComponents/StandardToolboxPortal.js +1 -1
- package/src/App/Modules/Designer/setupDesigner.js +22 -19
- package/src/App/Modules/Visualization/AlignTargetContainer.js +1 -1
- package/src/App/Modules/Visualization/CreatorAlignTarget.js +1 -1
- package/src/App/Modules/Visualization/DefaultVisualizationProvider.js +7 -2
- package/src/App/Modules/Visualization/DesignerAlignTarget.js +1 -1
- package/src/App/Reducers/Actions.js +5 -5
- package/src/App/Reducers/ConfigurationMode/Selectors.js +6 -0
- package/src/App/Reducers/Configurator/Actions.js +8 -1
- package/src/App/Reducers/Configurator/Reducer.js +27 -21
- package/src/App/Reducers/Configurator/Selectors.js +4 -1
- package/src/App/Reducers/DesignArea/Selectors.js +10 -0
- package/src/App/Reducers/Reducer.js +4 -3
- package/src/App/Reducers/UI/Actions.js +15 -1
- package/src/App/Reducers/UI/Reducer.js +20 -0
- package/src/App/Routing.js +12 -29
- package/src/App/Screens/Configurator/CalculationWidgetScreen.js +1 -4
- package/src/App/Screens/Configurator/Components/AmountSelection/index.js +4 -4
- package/src/App/Screens/Configurator/Components/CalculationWidget/index.js +3 -3
- package/src/App/Screens/Configurator/Components/CalculationWidget/index.test.jsx +5 -2
- package/src/App/Screens/Configurator/Components/ConfigurationModeSwitch/ConfigurationModeSwitch.js +1 -1
- package/src/App/Screens/Configurator/Components/FallbackVisualization/FallbackVisualization.js +1 -1
- package/src/App/Screens/Configurator/Components/FullScreenView/index.js +4 -4
- package/src/App/Screens/Configurator/Components/ItemTile/ItemTile.js +55 -17
- package/src/App/Screens/Configurator/Components/LandscapeInformation/index.js +1 -1
- package/src/App/Screens/Configurator/Components/NoVisualization/NoVisualization.js +1 -1
- package/src/App/Screens/Configurator/Components/PreviewPortal/index.js +7 -5
- package/src/App/Screens/Configurator/Components/Thumbnail/index.js +5 -4
- package/src/App/Screens/Configurator/Components/TotalPrice/TotalPrice.js +3 -3
- package/src/App/Screens/Configurator/Containers/AmountPrice.js +1 -1
- package/src/App/Screens/Configurator/Containers/__tests__/CalculationWidget.test.js +4 -1
- package/src/App/Screens/Configurator/Screen.js +13 -5
- package/src/App/Screens/Configurator/__tests__/Screen.test.js +6 -0
- package/src/App/Screens/DesignerProductPreview/Screen.js +2 -3
- package/src/App/Screens/DesignerProductPreview/__tests__/__snapshots__/Screen.test.js.snap +11 -11
- package/src/App/Screens/ItemOverview.js +74 -57
- package/src/App/Screens.js +1 -1
- package/src/App/Services/AnalyticsService.js +2 -1
- package/src/App/Services/DesignDataService.js +53 -7
- package/src/App/Services/DesignerService.js +22 -13
- package/src/App/Services/UIService.js +1 -1
- package/src/App/Services/VisualizationService.js +41 -2
- package/src/App/Services/__tests__/DesignDataService.test.js +1 -0
- package/src/App/Shared/Components/AcceptDesign/index.js +7 -6
- package/src/App/Shared/Components/AcceptPrivacy/index.js +4 -3
- package/src/App/Shared/Components/AddToBasket/index.js +4 -4
- package/src/App/Shared/Components/AmountInput/index.js +1 -1
- package/src/App/Shared/Components/AmountPrice/__snapshots__/index.test.jsx.snap +0 -125
- package/src/App/Shared/Components/AmountPrice/index.js +40 -17
- package/src/App/Shared/Components/AmountPrice/index.test.jsx +1 -1
- package/src/App/Shared/Components/Analytics/AnalyticsWrapper.test.js +2 -1
- package/src/App/Shared/Components/BulkNames/index.js +3 -3
- package/src/App/Shared/Components/CallToAction/__snapshots__/index.test.js.snap +4 -4
- package/src/App/Shared/Components/CallToAction/index.js +3 -3
- package/src/App/Shared/Components/CallToAction/index.test.js +1 -1
- package/src/App/Shared/Components/ConfigurationOverview/index.js +1 -1
- package/src/App/Shared/Components/Header/Header.js +3 -3
- package/src/App/Shared/Components/InformationTag/InformationTag.js +4 -2
- package/src/App/Shared/Components/LicenseNotice/LicenseNotice.js +3 -1
- package/src/App/Shared/Components/LoadConfiguration/index.js +27 -13
- package/src/App/Shared/Components/Notification/index.js +3 -3
- package/src/App/Shared/Components/PdfDownload/index.js +3 -3
- package/src/App/Shared/Components/PlusMinusInput/index.js +4 -4
- package/src/App/Shared/Components/PriceList/index.js +9 -9
- package/src/App/Shared/Components/PriceList/index.test.js +2 -2
- package/src/App/Shared/Components/PriceOverview/index.js +4 -4
- package/src/App/Shared/Components/PriceOverview/index.story.js +1 -1
- package/src/App/Shared/Components/ProductVariant/Image.js +1 -1
- package/src/App/Shared/Components/ProductVariant/index.js +5 -5
- package/src/App/Shared/Components/Progress/Progress.js +3 -3
- package/src/App/Shared/Components/ReceiveOfferForm/index.js +4 -4
- package/src/App/Shared/Components/SaveConfiguration/index.js +3 -3
- package/src/App/Shared/Components/SendEmail/index.js +3 -3
- package/src/App/Shared/Components/Stepper/index.js +4 -4
- package/src/App/Shared/Components/ToolbarList/index.js +6 -6
- package/src/App/Shared/Components/VariantChooser/index.js +7 -7
- package/src/App/Shared/Containers/AmountPrice/index.js +7 -1
- package/src/App/Shared/Containers/SaveConfiguration.js +1 -1
- package/src/App/Utils/Request/lazyFetch.js +2 -3
- package/src/App/configuration.js +20 -15
- package/src/App/index.js +2 -2
- package/src/Framework/Api.js +3 -3
- package/src/Framework/Components/Carousel/index.js +2 -2
- package/src/Framework/Components/Dialog/index.js +13 -10
- package/src/Framework/Components/DialogSelect/index.js +6 -5
- package/src/Framework/i18n.js +15 -8
- package/src/Shared/Components/CustomDialog.js +2 -1
- package/src/Shared/Components/CustomDialogSelect.js +2 -2
- package/src/Shared/Components/MainButton.js +2 -2
- package/src/Shared/Components/__tests__/index.test.jsx +6 -1
- package/src/Shared/HOCs/ResizeDetect/ResizeDetect.dev.js +1 -1
- package/src/Utils/Decorators/Observable.js +1 -0
- package/src/Utils/Test/mountWithState.js +1 -1
- package/App/Modules/Designer/Components/ImageEditDialog/res/checkers_tile.png +0 -0
- package/src/App/Modules/Designer/Components/ImageEditDialog/res/checkers_tile.png +0 -0
|
@@ -3,89 +3,60 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
exports.
|
|
7
|
-
|
|
6
|
+
exports.setColorOnOperations = exports.replaceColorOnOperations = exports.removeVectorizeFromOperations = exports.reduceNumberOfDistinctColorsBy = exports.isOneColorAboveThreshold = exports.getEditDataFromOperations = exports.createVectorizeColorsMap = exports.compareOperations = exports.applyProductionMethodChangeToCanvasObjects = void 0;
|
|
8
7
|
var _cloneDeep = _interopRequireDefault(require("lodash/cloneDeep"));
|
|
9
|
-
|
|
10
8
|
var _isEqual = _interopRequireDefault(require("lodash/isEqual"));
|
|
11
|
-
|
|
12
9
|
var _omit = _interopRequireDefault(require("lodash/omit"));
|
|
13
|
-
|
|
14
10
|
var _find = _interopRequireDefault(require("lodash/find"));
|
|
15
|
-
|
|
16
11
|
var _flatten = _interopRequireDefault(require("lodash/flatten"));
|
|
17
|
-
|
|
18
12
|
var _get = _interopRequireDefault(require("lodash/get"));
|
|
19
|
-
|
|
20
13
|
var _Selectors = require("./Selectors");
|
|
21
|
-
|
|
22
14
|
var _Selectors2 = require("../DesignArea/Selectors");
|
|
23
|
-
|
|
24
15
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
|
25
|
-
|
|
16
|
+
function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
|
|
26
17
|
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
27
|
-
|
|
28
18
|
function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
29
|
-
|
|
30
|
-
function _iterableToArrayLimit(arr, i) { var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"]; if (_i == null) return; var _arr = []; var _n = true; var _d = false; var _s, _e; try { for (_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"] != null) _i["return"](); } finally { if (_d) throw _e; } } return _arr; }
|
|
31
|
-
|
|
19
|
+
function _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t["return"] && (u = t["return"](), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } }
|
|
32
20
|
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
33
|
-
|
|
34
|
-
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(_e2) { throw _e2; }, 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(_e3) { didErr = true; err = _e3; }, f: function f() { try { if (!normalCompletion && it["return"] != null) it["return"](); } finally { if (didErr) throw err; } } }; }
|
|
35
|
-
|
|
21
|
+
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; } } }; }
|
|
36
22
|
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); }
|
|
37
|
-
|
|
38
|
-
function
|
|
39
|
-
|
|
40
|
-
function
|
|
41
|
-
|
|
42
|
-
function
|
|
43
|
-
|
|
44
|
-
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; }
|
|
45
|
-
|
|
46
|
-
var setColorOnOperations = function setColorOnOperations(prevOperations, color) {
|
|
23
|
+
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; }
|
|
24
|
+
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
25
|
+
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
26
|
+
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
27
|
+
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
|
|
28
|
+
function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
|
|
29
|
+
var setColorOnOperations = exports.setColorOnOperations = function setColorOnOperations(prevOperations, color) {
|
|
47
30
|
var operations = (0, _cloneDeep["default"])(prevOperations);
|
|
48
|
-
|
|
49
31
|
for (var colorKey in operations.vectorizeColorsMap) {
|
|
50
32
|
if (!operations.vectorizeColorsMap.hasOwnProperty(colorKey)) {
|
|
51
33
|
continue;
|
|
52
34
|
}
|
|
53
|
-
|
|
54
35
|
operations.vectorizeColorsMap[colorKey] = color;
|
|
55
36
|
}
|
|
56
|
-
|
|
57
37
|
return operations;
|
|
58
38
|
};
|
|
59
|
-
|
|
60
|
-
exports.setColorOnOperations = setColorOnOperations;
|
|
61
|
-
|
|
62
|
-
var replaceColorOnOperations = function replaceColorOnOperations(prevOperations, oldColor, color) {
|
|
39
|
+
var replaceColorOnOperations = exports.replaceColorOnOperations = function replaceColorOnOperations(prevOperations, oldColor, color) {
|
|
63
40
|
var operations = (0, _cloneDeep["default"])(prevOperations);
|
|
64
|
-
|
|
65
41
|
for (var colorKey in operations.vectorizeColorsMap) {
|
|
66
42
|
if (!operations.vectorizeColorsMap.hasOwnProperty(colorKey)) {
|
|
67
43
|
continue;
|
|
68
44
|
}
|
|
69
|
-
|
|
70
45
|
if (operations.vectorizeColorsMap[colorKey].identifier === oldColor.identifier) {
|
|
71
46
|
operations.vectorizeColorsMap[colorKey] = color;
|
|
72
47
|
}
|
|
73
48
|
}
|
|
74
|
-
|
|
75
49
|
return operations;
|
|
76
50
|
};
|
|
77
|
-
|
|
78
|
-
exports.replaceColorOnOperations = replaceColorOnOperations;
|
|
79
|
-
|
|
80
|
-
var getEditDataFromOperations = function getEditDataFromOperations(imageFileName, operations, designProductionMethod) {
|
|
51
|
+
var getEditDataFromOperations = exports.getEditDataFromOperations = function getEditDataFromOperations(imageFileName, operations, designProductionMethod) {
|
|
81
52
|
var _operations$clipping = operations.clipping,
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
53
|
+
clipping = _operations$clipping === void 0 ? false : _operations$clipping,
|
|
54
|
+
_operations$clippingC = operations.clippingColor,
|
|
55
|
+
clippingColor = _operations$clippingC === void 0 ? false : _operations$clippingC,
|
|
56
|
+
_operations$vectorize = operations.vectorize,
|
|
57
|
+
vectorize = _operations$vectorize === void 0 ? false : _operations$vectorize,
|
|
58
|
+
_operations$vectorize2 = operations.vectorizeThreshold,
|
|
59
|
+
vectorizeThreshold = _operations$vectorize2 === void 0 ? null : _operations$vectorize2;
|
|
89
60
|
var maxColorAmount = +(0, _get["default"])(designProductionMethod, 'options.maxColorAmount', 0);
|
|
90
61
|
var vectorizedLogoMandatory = (0, _get["default"])(designProductionMethod, 'options.vectorizedLogoMandatory', false);
|
|
91
62
|
var vectorizeMonochrome = maxColorAmount === 1 && vectorizeThreshold === 1;
|
|
@@ -94,7 +65,6 @@ var getEditDataFromOperations = function getEditDataFromOperations(imageFileName
|
|
|
94
65
|
operations: [],
|
|
95
66
|
vectorizedLogoMandatory: vectorizedLogoMandatory
|
|
96
67
|
};
|
|
97
|
-
|
|
98
68
|
if (clipping && clippingColor) {
|
|
99
69
|
result.operations.push({
|
|
100
70
|
identifier: 'clipping',
|
|
@@ -104,7 +74,6 @@ var getEditDataFromOperations = function getEditDataFromOperations(imageFileName
|
|
|
104
74
|
}
|
|
105
75
|
});
|
|
106
76
|
}
|
|
107
|
-
|
|
108
77
|
if (vectorize) {
|
|
109
78
|
result.operations.push({
|
|
110
79
|
identifier: 'vectorize',
|
|
@@ -114,19 +83,12 @@ var getEditDataFromOperations = function getEditDataFromOperations(imageFileName
|
|
|
114
83
|
}
|
|
115
84
|
});
|
|
116
85
|
}
|
|
117
|
-
|
|
118
86
|
return result;
|
|
119
87
|
};
|
|
120
|
-
|
|
121
|
-
exports.getEditDataFromOperations = getEditDataFromOperations;
|
|
122
|
-
|
|
123
|
-
var compareOperations = function compareOperations(oldOperations, newOperations) {
|
|
88
|
+
var compareOperations = exports.compareOperations = function compareOperations(oldOperations, newOperations) {
|
|
124
89
|
return (0, _isEqual["default"])((0, _omit["default"])(oldOperations, ['vectorizeColorsMap']), (0, _omit["default"])(newOperations, ['vectorizeColorsMap']));
|
|
125
90
|
};
|
|
126
|
-
|
|
127
|
-
exports.compareOperations = compareOperations;
|
|
128
|
-
|
|
129
|
-
var createVectorizeColorsMap = function createVectorizeColorsMap(currentColorsMap, svgColors) {
|
|
91
|
+
var createVectorizeColorsMap = exports.createVectorizeColorsMap = function createVectorizeColorsMap(currentColorsMap, svgColors) {
|
|
130
92
|
// make sure the original color ordering is kept by creating placeholders for the keys
|
|
131
93
|
var vectorizeColorsMap = svgColors.reduce(function (obj, _ref) {
|
|
132
94
|
var key = _ref.key;
|
|
@@ -134,25 +96,20 @@ var createVectorizeColorsMap = function createVectorizeColorsMap(currentColorsMa
|
|
|
134
96
|
}, {});
|
|
135
97
|
currentColorsMap && Object.keys(currentColorsMap).forEach(function (key) {
|
|
136
98
|
var oldColor = currentColorsMap[key];
|
|
137
|
-
|
|
138
99
|
if (!(0, _find["default"])(svgColors, {
|
|
139
100
|
key: key
|
|
140
101
|
})) {
|
|
141
102
|
return;
|
|
142
103
|
}
|
|
143
|
-
|
|
144
104
|
vectorizeColorsMap[key] = oldColor;
|
|
145
105
|
});
|
|
146
|
-
|
|
147
106
|
var _iterator = _createForOfIteratorHelper(svgColors),
|
|
148
|
-
|
|
149
|
-
|
|
107
|
+
_step;
|
|
150
108
|
try {
|
|
151
109
|
for (_iterator.s(); !(_step = _iterator.n()).done;) {
|
|
152
110
|
var _step$value = _step.value,
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
111
|
+
key = _step$value.key,
|
|
112
|
+
color = _step$value.color;
|
|
156
113
|
if (!vectorizeColorsMap[key]) {
|
|
157
114
|
vectorizeColorsMap[key] = color;
|
|
158
115
|
}
|
|
@@ -162,50 +119,37 @@ var createVectorizeColorsMap = function createVectorizeColorsMap(currentColorsMa
|
|
|
162
119
|
} finally {
|
|
163
120
|
_iterator.f();
|
|
164
121
|
}
|
|
165
|
-
|
|
166
122
|
return vectorizeColorsMap;
|
|
167
123
|
};
|
|
168
|
-
|
|
169
|
-
exports.createVectorizeColorsMap = createVectorizeColorsMap;
|
|
170
|
-
|
|
171
|
-
var isOneColorAboveThreshold = function isOneColorAboveThreshold(vectorizeColorsMap, vectorizeOriginalColorsMap) {
|
|
124
|
+
var isOneColorAboveThreshold = exports.isOneColorAboveThreshold = function isOneColorAboveThreshold(vectorizeColorsMap, vectorizeOriginalColorsMap) {
|
|
172
125
|
var threshold = 1900;
|
|
173
126
|
var aggregatedInitialColors = (0, _Selectors.getAggregatedColors)(vectorizeOriginalColorsMap || {});
|
|
174
127
|
var aggregatedCurrentColors = (0, _Selectors.getAggregatedColors)(vectorizeColorsMap || {});
|
|
175
|
-
|
|
176
128
|
if (Object.keys(aggregatedInitialColors).length !== Object.keys(aggregatedCurrentColors).length) {
|
|
177
129
|
return true;
|
|
178
130
|
}
|
|
179
|
-
|
|
180
131
|
var numberOfCustomColors = Object.values(aggregatedCurrentColors).filter(function (c) {
|
|
181
132
|
return c.identifier && JSON.parse(c.identifier).custom;
|
|
182
133
|
}).length;
|
|
183
134
|
var numberOfNotMatchingColors = Object.entries(aggregatedInitialColors).reduce(function (accumulator, _ref2) {
|
|
184
135
|
var _ref3 = _slicedToArray(_ref2, 2),
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
136
|
+
key = _ref3[0],
|
|
137
|
+
initialColor = _ref3[1];
|
|
188
138
|
var currentColor = Object.values(aggregatedCurrentColors).find(function (c) {
|
|
189
139
|
return c.value === initialColor.value;
|
|
190
140
|
});
|
|
191
|
-
|
|
192
141
|
if (currentColor) {
|
|
193
142
|
return accumulator;
|
|
194
143
|
}
|
|
195
|
-
|
|
196
144
|
if (!aggregatedCurrentColors[key]) {
|
|
197
145
|
return accumulator + 1;
|
|
198
146
|
}
|
|
199
|
-
|
|
200
147
|
var colorDistance = (0, _Selectors2.calculateColorDistance)(initialColor.value, aggregatedCurrentColors[key].value);
|
|
201
148
|
return colorDistance === null || colorDistance > threshold ? accumulator + 1 : accumulator;
|
|
202
149
|
}, 0);
|
|
203
150
|
return numberOfNotMatchingColors > numberOfCustomColors;
|
|
204
151
|
};
|
|
205
|
-
|
|
206
|
-
exports.isOneColorAboveThreshold = isOneColorAboveThreshold;
|
|
207
|
-
|
|
208
|
-
var removeVectorizeFromOperations = function removeVectorizeFromOperations(operations) {
|
|
152
|
+
var removeVectorizeFromOperations = exports.removeVectorizeFromOperations = function removeVectorizeFromOperations(operations) {
|
|
209
153
|
return _objectSpread(_objectSpread({}, operations), {}, {
|
|
210
154
|
vectorize: false,
|
|
211
155
|
vectorizeThreshold: null,
|
|
@@ -215,9 +159,6 @@ var removeVectorizeFromOperations = function removeVectorizeFromOperations(opera
|
|
|
215
159
|
vectorizeMonochrome: false
|
|
216
160
|
});
|
|
217
161
|
};
|
|
218
|
-
|
|
219
|
-
exports.removeVectorizeFromOperations = removeVectorizeFromOperations;
|
|
220
|
-
|
|
221
162
|
var getColorKeysForIdentifier = function getColorKeysForIdentifier(vectorizeColorsMap, identifier) {
|
|
222
163
|
return Object.entries(vectorizeColorsMap).filter(function (colorEntry) {
|
|
223
164
|
return colorEntry[1].identifier === identifier;
|
|
@@ -225,7 +166,6 @@ var getColorKeysForIdentifier = function getColorKeysForIdentifier(vectorizeColo
|
|
|
225
166
|
return colorEntry[0];
|
|
226
167
|
});
|
|
227
168
|
};
|
|
228
|
-
|
|
229
169
|
var findDistinctIdentifiers = function findDistinctIdentifiers(howMany, vectorizeColorsMap) {
|
|
230
170
|
var distinctIdentifiers = [];
|
|
231
171
|
Object.values(vectorizeColorsMap).forEach(function (colorEntry) {
|
|
@@ -235,18 +175,15 @@ var findDistinctIdentifiers = function findDistinctIdentifiers(howMany, vectoriz
|
|
|
235
175
|
});
|
|
236
176
|
return distinctIdentifiers;
|
|
237
177
|
};
|
|
238
|
-
|
|
239
|
-
var reduceNumberOfDistinctColorsBy = function reduceNumberOfDistinctColorsBy(vectorizeColorsMap, numberOfColorsToRemove) {
|
|
178
|
+
var reduceNumberOfDistinctColorsBy = exports.reduceNumberOfDistinctColorsBy = function reduceNumberOfDistinctColorsBy(vectorizeColorsMap, numberOfColorsToRemove) {
|
|
240
179
|
var numberOfUniqueColorValues = Object.values(vectorizeColorsMap).map(function (c) {
|
|
241
180
|
return c.identifier;
|
|
242
181
|
}).filter(function (c, index, array) {
|
|
243
182
|
return array.indexOf(c) === index;
|
|
244
183
|
}).length;
|
|
245
|
-
|
|
246
184
|
if (numberOfUniqueColorValues <= numberOfColorsToRemove) {
|
|
247
185
|
throw new Error('vectorizeColorsMap must have more unique colors than the number of colors we are reducing it by');
|
|
248
186
|
}
|
|
249
|
-
|
|
250
187
|
var identifiers = findDistinctIdentifiers(numberOfColorsToRemove, vectorizeColorsMap);
|
|
251
188
|
var keysForValuesToBeOverWritten = (0, _flatten["default"])(identifiers.map(function (identifier) {
|
|
252
189
|
return getColorKeysForIdentifier(vectorizeColorsMap, identifier);
|
|
@@ -255,7 +192,6 @@ var reduceNumberOfDistinctColorsBy = function reduceNumberOfDistinctColorsBy(vec
|
|
|
255
192
|
return !keysForValuesToBeOverWritten.includes(colorEntry[0]);
|
|
256
193
|
})[1];
|
|
257
194
|
var resultingVecotirzeColorsMap = {};
|
|
258
|
-
|
|
259
195
|
var _loop = function _loop(key) {
|
|
260
196
|
if (keysForValuesToBeOverWritten.find(function (k) {
|
|
261
197
|
return k === key;
|
|
@@ -265,57 +201,42 @@ var reduceNumberOfDistinctColorsBy = function reduceNumberOfDistinctColorsBy(vec
|
|
|
265
201
|
resultingVecotirzeColorsMap[key] = vectorizeColorsMap[key];
|
|
266
202
|
}
|
|
267
203
|
};
|
|
268
|
-
|
|
269
204
|
for (var key in vectorizeColorsMap) {
|
|
270
205
|
_loop(key);
|
|
271
206
|
}
|
|
272
|
-
|
|
273
207
|
return resultingVecotirzeColorsMap;
|
|
274
208
|
};
|
|
275
|
-
|
|
276
|
-
exports.reduceNumberOfDistinctColorsBy = reduceNumberOfDistinctColorsBy;
|
|
277
|
-
|
|
278
|
-
var applyProductionMethodChangeToCanvasObjects = function applyProductionMethodChangeToCanvasObjects(newProductionMethod, oldProductionMethod, objects) {
|
|
209
|
+
var applyProductionMethodChangeToCanvasObjects = exports.applyProductionMethodChangeToCanvasObjects = function applyProductionMethodChangeToCanvasObjects(newProductionMethod, oldProductionMethod, objects) {
|
|
279
210
|
return [updatePositioningAndScaling, updateLockState].reduce(function (objects, updateFunc) {
|
|
280
211
|
return updateFunc(newProductionMethod, oldProductionMethod, objects);
|
|
281
212
|
}, objects);
|
|
282
213
|
};
|
|
283
|
-
|
|
284
|
-
exports.applyProductionMethodChangeToCanvasObjects = applyProductionMethodChangeToCanvasObjects;
|
|
285
|
-
|
|
286
214
|
var updatePositioningAndScaling = function updatePositioningAndScaling(newProductionMethod, oldProductionMethod, objects) {
|
|
287
215
|
var widthA = newProductionMethod.width,
|
|
288
|
-
|
|
216
|
+
heightA = newProductionMethod.height;
|
|
289
217
|
var widthB = oldProductionMethod.width,
|
|
290
|
-
|
|
291
|
-
|
|
218
|
+
heightB = oldProductionMethod.height;
|
|
292
219
|
if (widthA !== widthB || heightA !== heightB) {
|
|
293
220
|
var scaleX = widthA / widthB;
|
|
294
221
|
var scaleY = heightA / heightB;
|
|
295
222
|
return objects.map(function (object) {
|
|
296
223
|
var x = object.x,
|
|
297
|
-
|
|
298
|
-
|
|
224
|
+
y = object.y;
|
|
299
225
|
var fixedObject = _objectSpread(_objectSpread({}, object), {}, {
|
|
300
226
|
x: x * scaleX,
|
|
301
227
|
y: y * scaleY
|
|
302
228
|
});
|
|
303
|
-
|
|
304
229
|
if (fixedObject.fontSize) {
|
|
305
230
|
fixedObject.fontSize *= scaleY;
|
|
306
231
|
}
|
|
307
|
-
|
|
308
232
|
return fixedObject;
|
|
309
233
|
});
|
|
310
234
|
}
|
|
311
|
-
|
|
312
235
|
return objects;
|
|
313
236
|
};
|
|
314
|
-
|
|
315
237
|
var updateLockState = function updateLockState(newProductionMethod, oldProductionMethod, objects) {
|
|
316
238
|
var lockedA = newProductionMethod.designElementsLocked;
|
|
317
239
|
var lockedB = oldProductionMethod.designElementsLocked;
|
|
318
|
-
|
|
319
240
|
if (lockedA !== lockedB) {
|
|
320
241
|
return objects.map(function (object) {
|
|
321
242
|
return _objectSpread(_objectSpread({}, object), {}, {
|
|
@@ -325,6 +246,5 @@ var updateLockState = function updateLockState(newProductionMethod, oldProductio
|
|
|
325
246
|
});
|
|
326
247
|
});
|
|
327
248
|
}
|
|
328
|
-
|
|
329
249
|
return objects;
|
|
330
250
|
};
|
|
@@ -3,38 +3,27 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
+
exports.designDataHandler = designDataHandler;
|
|
6
7
|
exports.getDesignData = getDesignData;
|
|
7
8
|
exports.updateConfiguratorState = updateConfiguratorState;
|
|
8
|
-
exports.designDataHandler = designDataHandler;
|
|
9
|
-
|
|
10
9
|
var _get = _interopRequireDefault(require("lodash/get"));
|
|
11
|
-
|
|
12
10
|
var _cloneDeep = _interopRequireDefault(require("lodash/cloneDeep"));
|
|
13
|
-
|
|
14
11
|
var _escape = _interopRequireDefault(require("lodash/escape"));
|
|
15
|
-
|
|
16
12
|
var _unescape = _interopRequireDefault(require("lodash/unescape"));
|
|
17
|
-
|
|
18
13
|
var _set = _interopRequireDefault(require("../../../Utils/Immutable/set"));
|
|
19
|
-
|
|
20
14
|
var _Actions = require("./Actions");
|
|
21
|
-
|
|
22
15
|
var _Selectors = require("../ImageGallery/Selectors");
|
|
23
|
-
|
|
24
16
|
var _Selectors2 = require("./Selectors");
|
|
25
|
-
|
|
26
17
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
|
27
|
-
|
|
28
|
-
function ownKeys(
|
|
29
|
-
|
|
30
|
-
function
|
|
31
|
-
|
|
32
|
-
function
|
|
33
|
-
|
|
18
|
+
function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
|
|
19
|
+
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
20
|
+
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
21
|
+
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
22
|
+
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
|
|
23
|
+
function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
|
|
34
24
|
function getDesignData(configuratorState) {
|
|
35
25
|
return (0, _get["default"])(configuratorState, 'configuration.designdata');
|
|
36
26
|
}
|
|
37
|
-
|
|
38
27
|
function updateConfiguratorState(state, designAreaIdentifier, designData) {
|
|
39
28
|
var currentDesignData = getDesignData(state) || {};
|
|
40
29
|
return _objectSpread(_objectSpread({}, state), {}, {
|
|
@@ -43,11 +32,9 @@ function updateConfiguratorState(state, designAreaIdentifier, designData) {
|
|
|
43
32
|
})
|
|
44
33
|
});
|
|
45
34
|
}
|
|
46
|
-
|
|
47
35
|
var regExpEscape = function regExpEscape(str) {
|
|
48
36
|
return str.replace(/[.*+?^${}()|[\]\\]/g, '\\$&');
|
|
49
37
|
};
|
|
50
|
-
|
|
51
38
|
function shouldItemHaveBackgroundColor(item) {
|
|
52
39
|
if (item.type === 'Text') {
|
|
53
40
|
return (0, _Selectors2.hasBackgroundColor)(item.style.colors);
|
|
@@ -57,10 +44,8 @@ function shouldItemHaveBackgroundColor(item) {
|
|
|
57
44
|
return (0, _Selectors2.hasBackgroundColor)(objectColors);
|
|
58
45
|
}
|
|
59
46
|
}
|
|
60
|
-
|
|
61
47
|
return false;
|
|
62
48
|
}
|
|
63
|
-
|
|
64
49
|
function updateItemHasBackgroundColor(state, designAreaIdentifier) {
|
|
65
50
|
var objectsPath = "configuration.designdata.".concat(designAreaIdentifier, ".canvasData.objects");
|
|
66
51
|
var objects = (0, _get["default"])(state, objectsPath, []);
|
|
@@ -70,10 +55,8 @@ function updateItemHasBackgroundColor(state, designAreaIdentifier) {
|
|
|
70
55
|
}) : object;
|
|
71
56
|
}));
|
|
72
57
|
}
|
|
73
|
-
|
|
74
58
|
function designDataHandler(state, action) {
|
|
75
59
|
var designAreaIdentifier = action.designAreaIdentifier;
|
|
76
|
-
|
|
77
60
|
switch (action.type) {
|
|
78
61
|
case _Actions.actionTypes.SET_CANVAS_DATA:
|
|
79
62
|
{
|
|
@@ -83,7 +66,6 @@ function designDataHandler(state, action) {
|
|
|
83
66
|
});
|
|
84
67
|
return updateItemHasBackgroundColor(nextState, designAreaIdentifier);
|
|
85
68
|
}
|
|
86
|
-
|
|
87
69
|
case _Actions.actionTypes.SET_CANVAS_DATA_MAP:
|
|
88
70
|
{
|
|
89
71
|
var canvasDataMap = action.canvasDataMap;
|
|
@@ -94,7 +76,6 @@ function designDataHandler(state, action) {
|
|
|
94
76
|
return updateItemHasBackgroundColor(nextState, designAreaIdentifier);
|
|
95
77
|
}, state);
|
|
96
78
|
}
|
|
97
|
-
|
|
98
79
|
case _Actions.actionTypes.SET_DESIGN_PRODUCTION_METHOD:
|
|
99
80
|
{
|
|
100
81
|
var designProductionMethodIdentifier = action.designProductionMethodIdentifier;
|
|
@@ -102,7 +83,6 @@ function designDataHandler(state, action) {
|
|
|
102
83
|
designProductionMethodIdentifier: designProductionMethodIdentifier
|
|
103
84
|
});
|
|
104
85
|
}
|
|
105
|
-
|
|
106
86
|
case _Actions.actionTypes.SET_COLOR_AMOUNT:
|
|
107
87
|
{
|
|
108
88
|
var colorAmount = action.colorAmount;
|
|
@@ -110,7 +90,6 @@ function designDataHandler(state, action) {
|
|
|
110
90
|
colorAmount: colorAmount
|
|
111
91
|
});
|
|
112
92
|
}
|
|
113
|
-
|
|
114
93
|
case _Actions.actionTypes.SET_INITIAL_DESIGN_DATA:
|
|
115
94
|
{
|
|
116
95
|
var initialDesignData = action.initialDesignData;
|
|
@@ -120,12 +99,11 @@ function designDataHandler(state, action) {
|
|
|
120
99
|
})
|
|
121
100
|
});
|
|
122
101
|
}
|
|
123
|
-
|
|
124
102
|
case _Actions.actionTypes.UPDATE_IMAGE_DATA:
|
|
125
103
|
{
|
|
126
104
|
var _designAreaIdentifier = action.designAreaIdentifier,
|
|
127
|
-
|
|
128
|
-
|
|
105
|
+
imageData = action.imageData,
|
|
106
|
+
originalImageIdentifier = action.originalImageIdentifier;
|
|
129
107
|
var designdata = (0, _cloneDeep["default"])(getDesignData(state));
|
|
130
108
|
var areas = _designAreaIdentifier ? [_designAreaIdentifier] : Object.keys(designdata);
|
|
131
109
|
areas.forEach(function (area) {
|
|
@@ -143,7 +121,6 @@ function designDataHandler(state, action) {
|
|
|
143
121
|
})
|
|
144
122
|
});
|
|
145
123
|
}
|
|
146
|
-
|
|
147
124
|
case _Actions.actionTypes.SET_DESIGN_AREA_TEXTS_COLOR:
|
|
148
125
|
{
|
|
149
126
|
var objectsPath = "configuration.designdata.".concat(action.identifier, ".canvasData.objects");
|
|
@@ -152,25 +129,20 @@ function designDataHandler(state, action) {
|
|
|
152
129
|
if (object.type !== 'Text') {
|
|
153
130
|
return object;
|
|
154
131
|
}
|
|
155
|
-
|
|
156
132
|
var content = object.content.replace(/#[0-9a-f]{3,6}/gi, action.color.value).replace(/rgb\([^)]+\)/gi, action.color.value).replace(/data-color="([^"]+)"/gi, "data-color='".concat(action.color.identifier, "'"));
|
|
157
133
|
return _objectSpread(_objectSpread({}, object), {}, {
|
|
158
134
|
content: content
|
|
159
135
|
});
|
|
160
136
|
}));
|
|
161
137
|
}
|
|
162
|
-
|
|
163
138
|
case _Actions.actionTypes.REPLACE_DESIGN_AREA_TEXTS_COLOR:
|
|
164
139
|
{
|
|
165
140
|
var _objectsPath = "configuration.designdata.".concat(action.identifier, ".canvasData.objects");
|
|
166
|
-
|
|
167
141
|
var _objects = (0, _get["default"])(state, _objectsPath, []);
|
|
168
|
-
|
|
169
142
|
return (0, _set["default"])(state, _objectsPath, _objects.map(function (object) {
|
|
170
143
|
if (object.type !== 'Text') {
|
|
171
144
|
return object;
|
|
172
145
|
}
|
|
173
|
-
|
|
174
146
|
var colorToReplace = Object.values(action.oldValue).map(regExpEscape).join('|');
|
|
175
147
|
var content = object.content.replace(/data-color="(.*?)"/gi, function (originalAttr, dataAttr) {
|
|
176
148
|
return (0, _unescape["default"])(dataAttr) === action.oldColorData ? "data-color=\"".concat((0, _escape["default"])(action.colorData), "\"") : originalAttr;
|
|
@@ -180,7 +152,6 @@ function designDataHandler(state, action) {
|
|
|
180
152
|
});
|
|
181
153
|
}));
|
|
182
154
|
}
|
|
183
|
-
|
|
184
155
|
default:
|
|
185
156
|
{
|
|
186
157
|
return state;
|
|
@@ -3,92 +3,59 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
exports.isPlaceholderObject = exports.
|
|
7
|
-
|
|
6
|
+
exports.isPlaceholderObject = exports.hasBackgroundColor = exports.getOriginalColorsMap = exports.getInitialMaxColorAmount = exports.getColorKeysForAggregatedColor = exports.getAggregatedColors = exports.getAggregatedColorCount = void 0;
|
|
8
7
|
var _Selectors = require("../DesignArea/Selectors");
|
|
9
|
-
|
|
10
8
|
var _styles = require("@material-ui/core/styles");
|
|
11
|
-
|
|
12
9
|
var _DesignDataService = require("../../Services/DesignDataService");
|
|
13
|
-
|
|
14
10
|
var _find = _interopRequireDefault(require("lodash/find"));
|
|
15
|
-
|
|
16
11
|
var _get = _interopRequireDefault(require("lodash/get"));
|
|
17
|
-
|
|
18
12
|
var _size = _interopRequireDefault(require("lodash/size"));
|
|
19
|
-
|
|
20
13
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
|
21
|
-
|
|
22
|
-
function ownKeys(
|
|
23
|
-
|
|
24
|
-
function
|
|
25
|
-
|
|
26
|
-
function
|
|
27
|
-
|
|
28
|
-
var hasBackgroundColor = function hasBackgroundColor(colors) {
|
|
14
|
+
function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
|
|
15
|
+
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
16
|
+
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
17
|
+
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
18
|
+
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
|
|
19
|
+
function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
|
|
20
|
+
var hasBackgroundColor = exports.hasBackgroundColor = function hasBackgroundColor(colors) {
|
|
29
21
|
return colors.map(function (color) {
|
|
30
22
|
return (0, _Selectors.isValidHex)(color.value) ? (0, _styles.hexToRgb)(color.value) : color.value || 'rgb(0, 0, 0)';
|
|
31
23
|
}).map(_DesignDataService.getRgbValuesFromString).some(_DesignDataService.isColorTooBright);
|
|
32
24
|
};
|
|
33
|
-
|
|
34
|
-
exports.hasBackgroundColor = hasBackgroundColor;
|
|
35
|
-
|
|
36
|
-
var getAggregatedColors = function getAggregatedColors(colors) {
|
|
25
|
+
var getAggregatedColors = exports.getAggregatedColors = function getAggregatedColors(colors) {
|
|
37
26
|
return Object.keys(colors).reduce(function (uniqColors, colorKey) {
|
|
38
27
|
var color = colors[colorKey];
|
|
39
|
-
|
|
40
28
|
if ((0, _find["default"])(uniqColors, function (c) {
|
|
41
29
|
return c.identifier === color.identifier;
|
|
42
30
|
})) {
|
|
43
31
|
return uniqColors;
|
|
44
32
|
}
|
|
45
|
-
|
|
46
33
|
return _objectSpread(_objectSpread({}, uniqColors), {}, _defineProperty({}, colorKey, color));
|
|
47
34
|
}, {});
|
|
48
35
|
};
|
|
49
|
-
|
|
50
|
-
exports.getAggregatedColors = getAggregatedColors;
|
|
51
|
-
|
|
52
|
-
var getAggregatedColorCount = function getAggregatedColorCount(colors) {
|
|
36
|
+
var getAggregatedColorCount = exports.getAggregatedColorCount = function getAggregatedColorCount(colors) {
|
|
53
37
|
return (0, _size["default"])(getAggregatedColors(colors));
|
|
54
38
|
};
|
|
55
|
-
|
|
56
|
-
exports.getAggregatedColorCount = getAggregatedColorCount;
|
|
57
|
-
|
|
58
|
-
var getInitialMaxColorAmount = function getInitialMaxColorAmount(state) {
|
|
39
|
+
var getInitialMaxColorAmount = exports.getInitialMaxColorAmount = function getInitialMaxColorAmount(state) {
|
|
59
40
|
return (0, _get["default"])(state, 'imageGallery.selectedImage.operations.vectorizeMaxColorAmount', undefined);
|
|
60
41
|
};
|
|
61
|
-
|
|
62
|
-
exports.getInitialMaxColorAmount = getInitialMaxColorAmount;
|
|
63
|
-
|
|
64
|
-
var getOriginalColorsMap = function getOriginalColorsMap(state) {
|
|
42
|
+
var getOriginalColorsMap = exports.getOriginalColorsMap = function getOriginalColorsMap(state) {
|
|
65
43
|
return (0, _get["default"])(state, 'imageGallery.selectedImage.operations.vectorizeOriginalColorsMap', {});
|
|
66
44
|
};
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
var getColorKeysForAggregatedColor = function getColorKeysForAggregatedColor(vectorizeColorsMap, colorKey) {
|
|
71
|
-
var colors = []; //loop over the elements and detect all colors with the same mapped value
|
|
72
|
-
|
|
45
|
+
var getColorKeysForAggregatedColor = exports.getColorKeysForAggregatedColor = function getColorKeysForAggregatedColor(vectorizeColorsMap, colorKey) {
|
|
46
|
+
var colors = [];
|
|
47
|
+
//loop over the elements and detect all colors with the same mapped value
|
|
73
48
|
var colorToColorize = vectorizeColorsMap[colorKey];
|
|
74
|
-
|
|
75
49
|
for (var _colorKey in vectorizeColorsMap) {
|
|
76
50
|
if (!vectorizeColorsMap.hasOwnProperty(_colorKey)) {
|
|
77
51
|
continue;
|
|
78
52
|
}
|
|
79
|
-
|
|
80
53
|
if (vectorizeColorsMap[_colorKey].identifier === colorToColorize.identifier) {
|
|
81
54
|
colors.push(_colorKey);
|
|
82
55
|
}
|
|
83
56
|
}
|
|
84
|
-
|
|
85
57
|
return colors;
|
|
86
58
|
};
|
|
87
|
-
|
|
88
|
-
exports.getColorKeysForAggregatedColor = getColorKeysForAggregatedColor;
|
|
89
|
-
|
|
90
|
-
var isPlaceholderObject = function isPlaceholderObject(obj) {
|
|
59
|
+
var isPlaceholderObject = exports.isPlaceholderObject = function isPlaceholderObject(obj) {
|
|
91
60
|
return obj.type === 'Text' && (0, _Selectors.isPlaceholderContent)(obj.content) || obj.type === 'Image' && obj.imageData.isPlaceHolderImage;
|
|
92
|
-
};
|
|
93
|
-
|
|
94
|
-
exports.isPlaceholderObject = isPlaceholderObject;
|
|
61
|
+
};
|