@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
|
@@ -1,114 +1,67 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
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); }
|
|
4
|
-
|
|
5
3
|
Object.defineProperty(exports, "__esModule", {
|
|
6
4
|
value: true
|
|
7
5
|
});
|
|
8
6
|
exports["default"] = exports.ImageEditDialogContainer = void 0;
|
|
9
|
-
|
|
10
7
|
var _react = _interopRequireDefault(require("react"));
|
|
11
|
-
|
|
12
8
|
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
13
|
-
|
|
14
9
|
var _get = _interopRequireDefault(require("lodash/get"));
|
|
15
|
-
|
|
16
10
|
var _isEqual = _interopRequireDefault(require("lodash/isEqual"));
|
|
17
|
-
|
|
18
11
|
var _cloneDeep = _interopRequireDefault(require("lodash/cloneDeep"));
|
|
19
|
-
|
|
20
12
|
var _size = _interopRequireDefault(require("lodash/size"));
|
|
21
|
-
|
|
22
13
|
var _isMatch = _interopRequireDefault(require("lodash/isMatch"));
|
|
23
|
-
|
|
24
14
|
var _ComponentContainer = _interopRequireDefault(require("../../../../Framework/ComponentContainer"));
|
|
25
|
-
|
|
26
15
|
var _i18n = require("../../../../Framework/i18n");
|
|
27
|
-
|
|
28
16
|
var _ServiceLocator = require("../../../ServiceLocator");
|
|
29
|
-
|
|
30
17
|
var _Selectors = require("../../../Reducers/DesignArea/Selectors");
|
|
31
|
-
|
|
32
18
|
var _Selectors2 = require("../../../Reducers/DesignData/Selectors");
|
|
33
|
-
|
|
34
19
|
var _Selectors3 = require("../../../Reducers/ImageGallery/Selectors");
|
|
35
|
-
|
|
36
20
|
var _Selectors4 = require("../../../Reducers/UI/Selectors");
|
|
37
|
-
|
|
38
21
|
var _Actions = require("../../../Reducers/ImageGallery/Actions");
|
|
39
|
-
|
|
40
22
|
var _ImageEditDialog = _interopRequireDefault(require("../Components/ImageEditDialog"));
|
|
41
|
-
|
|
42
23
|
var _ImageUpload = _interopRequireDefault(require("../Components/ImageEditDialog/ImageUpload"));
|
|
43
|
-
|
|
44
24
|
var _ImageColorize = _interopRequireDefault(require("../Components/ImageColorize"));
|
|
45
|
-
|
|
46
25
|
var _FeedbackNotice = _interopRequireDefault(require("../Components/FeedbackNotice"));
|
|
47
|
-
|
|
48
26
|
var _Progress = _interopRequireDefault(require("../../../Shared/Components/Progress/Progress"));
|
|
49
|
-
|
|
50
27
|
var _DesignDataService = require("../../../Services/DesignDataService");
|
|
51
|
-
|
|
52
28
|
var _AddGalleryImage = _interopRequireDefault(require("./AddGalleryImage"));
|
|
53
|
-
|
|
54
29
|
var _createSelector = _interopRequireDefault(require("../../../../Utils/Function/createSelector"));
|
|
55
|
-
|
|
56
30
|
var _configuration = require("../../../configuration");
|
|
57
|
-
|
|
58
31
|
var _Constant = require("../../../Constant");
|
|
59
|
-
|
|
60
32
|
var _ImageEditUtils = require("../Utils/ImageEditUtils");
|
|
61
|
-
|
|
62
33
|
var _Transformers = require("../Utils/Transformers");
|
|
63
|
-
|
|
64
34
|
var _Selectors5 = require("../../../Reducers/Configurator/Selectors");
|
|
65
|
-
|
|
66
35
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
|
67
|
-
|
|
68
|
-
function _extends() { _extends = Object.assign
|
|
69
|
-
|
|
36
|
+
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); }
|
|
37
|
+
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
70
38
|
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; } } }; }
|
|
71
|
-
|
|
72
39
|
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); }
|
|
73
|
-
|
|
74
|
-
function
|
|
75
|
-
|
|
76
|
-
function
|
|
77
|
-
|
|
78
|
-
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; }
|
|
79
|
-
|
|
40
|
+
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; }
|
|
41
|
+
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; }
|
|
42
|
+
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; }
|
|
43
|
+
function _regeneratorRuntime() { "use strict"; /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */ _regeneratorRuntime = function _regeneratorRuntime() { return e; }; var t, e = {}, r = Object.prototype, n = r.hasOwnProperty, o = Object.defineProperty || function (t, e, r) { t[e] = r.value; }, i = "function" == typeof Symbol ? Symbol : {}, a = i.iterator || "@@iterator", c = i.asyncIterator || "@@asyncIterator", u = i.toStringTag || "@@toStringTag"; function define(t, e, r) { return Object.defineProperty(t, e, { value: r, enumerable: !0, configurable: !0, writable: !0 }), t[e]; } try { define({}, ""); } catch (t) { define = function define(t, e, r) { return t[e] = r; }; } function wrap(t, e, r, n) { var i = e && e.prototype instanceof Generator ? e : Generator, a = Object.create(i.prototype), c = new Context(n || []); return o(a, "_invoke", { value: makeInvokeMethod(t, r, c) }), a; } function tryCatch(t, e, r) { try { return { type: "normal", arg: t.call(e, r) }; } catch (t) { return { type: "throw", arg: t }; } } e.wrap = wrap; var h = "suspendedStart", l = "suspendedYield", f = "executing", s = "completed", y = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} var p = {}; define(p, a, function () { return this; }); var d = Object.getPrototypeOf, v = d && d(d(values([]))); v && v !== r && n.call(v, a) && (p = v); var g = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(p); function defineIteratorMethods(t) { ["next", "throw", "return"].forEach(function (e) { define(t, e, function (t) { return this._invoke(e, t); }); }); } function AsyncIterator(t, e) { function invoke(r, o, i, a) { var c = tryCatch(t[r], t, o); if ("throw" !== c.type) { var u = c.arg, h = u.value; return h && "object" == _typeof(h) && n.call(h, "__await") ? e.resolve(h.__await).then(function (t) { invoke("next", t, i, a); }, function (t) { invoke("throw", t, i, a); }) : e.resolve(h).then(function (t) { u.value = t, i(u); }, function (t) { return invoke("throw", t, i, a); }); } a(c.arg); } var r; o(this, "_invoke", { value: function value(t, n) { function callInvokeWithMethodAndArg() { return new e(function (e, r) { invoke(t, n, e, r); }); } return r = r ? r.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg(); } }); } function makeInvokeMethod(e, r, n) { var o = h; return function (i, a) { if (o === f) throw new Error("Generator is already running"); if (o === s) { if ("throw" === i) throw a; return { value: t, done: !0 }; } for (n.method = i, n.arg = a;;) { var c = n.delegate; if (c) { var u = maybeInvokeDelegate(c, n); if (u) { if (u === y) continue; return u; } } if ("next" === n.method) n.sent = n._sent = n.arg;else if ("throw" === n.method) { if (o === h) throw o = s, n.arg; n.dispatchException(n.arg); } else "return" === n.method && n.abrupt("return", n.arg); o = f; var p = tryCatch(e, r, n); if ("normal" === p.type) { if (o = n.done ? s : l, p.arg === y) continue; return { value: p.arg, done: n.done }; } "throw" === p.type && (o = s, n.method = "throw", n.arg = p.arg); } }; } function maybeInvokeDelegate(e, r) { var n = r.method, o = e.iterator[n]; if (o === t) return r.delegate = null, "throw" === n && e.iterator["return"] && (r.method = "return", r.arg = t, maybeInvokeDelegate(e, r), "throw" === r.method) || "return" !== n && (r.method = "throw", r.arg = new TypeError("The iterator does not provide a '" + n + "' method")), y; var i = tryCatch(o, e.iterator, r.arg); if ("throw" === i.type) return r.method = "throw", r.arg = i.arg, r.delegate = null, y; var a = i.arg; return a ? a.done ? (r[e.resultName] = a.value, r.next = e.nextLoc, "return" !== r.method && (r.method = "next", r.arg = t), r.delegate = null, y) : a : (r.method = "throw", r.arg = new TypeError("iterator result is not an object"), r.delegate = null, y); } function pushTryEntry(t) { var e = { tryLoc: t[0] }; 1 in t && (e.catchLoc = t[1]), 2 in t && (e.finallyLoc = t[2], e.afterLoc = t[3]), this.tryEntries.push(e); } function resetTryEntry(t) { var e = t.completion || {}; e.type = "normal", delete e.arg, t.completion = e; } function Context(t) { this.tryEntries = [{ tryLoc: "root" }], t.forEach(pushTryEntry, this), this.reset(!0); } function values(e) { if (e || "" === e) { var r = e[a]; if (r) return r.call(e); if ("function" == typeof e.next) return e; if (!isNaN(e.length)) { var o = -1, i = function next() { for (; ++o < e.length;) if (n.call(e, o)) return next.value = e[o], next.done = !1, next; return next.value = t, next.done = !0, next; }; return i.next = i; } } throw new TypeError(_typeof(e) + " is not iterable"); } return GeneratorFunction.prototype = GeneratorFunctionPrototype, o(g, "constructor", { value: GeneratorFunctionPrototype, configurable: !0 }), o(GeneratorFunctionPrototype, "constructor", { value: GeneratorFunction, configurable: !0 }), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, u, "GeneratorFunction"), e.isGeneratorFunction = function (t) { var e = "function" == typeof t && t.constructor; return !!e && (e === GeneratorFunction || "GeneratorFunction" === (e.displayName || e.name)); }, e.mark = function (t) { return Object.setPrototypeOf ? Object.setPrototypeOf(t, GeneratorFunctionPrototype) : (t.__proto__ = GeneratorFunctionPrototype, define(t, u, "GeneratorFunction")), t.prototype = Object.create(g), t; }, e.awrap = function (t) { return { __await: t }; }, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, c, function () { return this; }), e.AsyncIterator = AsyncIterator, e.async = function (t, r, n, o, i) { void 0 === i && (i = Promise); var a = new AsyncIterator(wrap(t, r, n, o), i); return e.isGeneratorFunction(r) ? a : a.next().then(function (t) { return t.done ? t.value : a.next(); }); }, defineIteratorMethods(g), define(g, u, "Generator"), define(g, a, function () { return this; }), define(g, "toString", function () { return "[object Generator]"; }), e.keys = function (t) { var e = Object(t), r = []; for (var n in e) r.push(n); return r.reverse(), function next() { for (; r.length;) { var t = r.pop(); if (t in e) return next.value = t, next.done = !1, next; } return next.done = !0, next; }; }, e.values = values, Context.prototype = { constructor: Context, reset: function reset(e) { if (this.prev = 0, this.next = 0, this.sent = this._sent = t, this.done = !1, this.delegate = null, this.method = "next", this.arg = t, this.tryEntries.forEach(resetTryEntry), !e) for (var r in this) "t" === r.charAt(0) && n.call(this, r) && !isNaN(+r.slice(1)) && (this[r] = t); }, stop: function stop() { this.done = !0; var t = this.tryEntries[0].completion; if ("throw" === t.type) throw t.arg; return this.rval; }, dispatchException: function dispatchException(e) { if (this.done) throw e; var r = this; function handle(n, o) { return a.type = "throw", a.arg = e, r.next = n, o && (r.method = "next", r.arg = t), !!o; } for (var o = this.tryEntries.length - 1; o >= 0; --o) { var i = this.tryEntries[o], a = i.completion; if ("root" === i.tryLoc) return handle("end"); if (i.tryLoc <= this.prev) { var c = n.call(i, "catchLoc"), u = n.call(i, "finallyLoc"); if (c && u) { if (this.prev < i.catchLoc) return handle(i.catchLoc, !0); if (this.prev < i.finallyLoc) return handle(i.finallyLoc); } else if (c) { if (this.prev < i.catchLoc) return handle(i.catchLoc, !0); } else { if (!u) throw new Error("try statement without catch or finally"); if (this.prev < i.finallyLoc) return handle(i.finallyLoc); } } } }, abrupt: function abrupt(t, e) { for (var r = this.tryEntries.length - 1; r >= 0; --r) { var o = this.tryEntries[r]; if (o.tryLoc <= this.prev && n.call(o, "finallyLoc") && this.prev < o.finallyLoc) { var i = o; break; } } i && ("break" === t || "continue" === t) && i.tryLoc <= e && e <= i.finallyLoc && (i = null); var a = i ? i.completion : {}; return a.type = t, a.arg = e, i ? (this.method = "next", this.next = i.finallyLoc, y) : this.complete(a); }, complete: function complete(t, e) { if ("throw" === t.type) throw t.arg; return "break" === t.type || "continue" === t.type ? this.next = t.arg : "return" === t.type ? (this.rval = this.arg = t.arg, this.method = "return", this.next = "end") : "normal" === t.type && e && (this.next = e), y; }, finish: function finish(t) { for (var e = this.tryEntries.length - 1; e >= 0; --e) { var r = this.tryEntries[e]; if (r.finallyLoc === t) return this.complete(r.completion, r.afterLoc), resetTryEntry(r), y; } }, "catch": function _catch(t) { for (var e = this.tryEntries.length - 1; e >= 0; --e) { var r = this.tryEntries[e]; if (r.tryLoc === t) { var n = r.completion; if ("throw" === n.type) { var o = n.arg; resetTryEntry(r); } return o; } } throw new Error("illegal catch attempt"); }, delegateYield: function delegateYield(e, r, n) { return this.delegate = { iterator: values(e), resultName: r, nextLoc: n }, "next" === this.method && (this.arg = t), y; } }, e; }
|
|
80
44
|
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); } }
|
|
81
|
-
|
|
82
45
|
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); }); }; }
|
|
83
|
-
|
|
84
46
|
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
85
|
-
|
|
86
|
-
function
|
|
87
|
-
|
|
88
|
-
function
|
|
89
|
-
|
|
90
|
-
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); }
|
|
91
|
-
|
|
92
|
-
function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
|
|
93
|
-
|
|
47
|
+
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, _toPropertyKey(descriptor.key), descriptor); } }
|
|
48
|
+
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
|
|
49
|
+
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 } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) _setPrototypeOf(subClass, superClass); }
|
|
50
|
+
function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
|
|
94
51
|
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); }; }
|
|
95
|
-
|
|
96
|
-
function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized(self); }
|
|
97
|
-
|
|
52
|
+
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); }
|
|
98
53
|
function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
|
|
99
|
-
|
|
100
54
|
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; } }
|
|
101
|
-
|
|
102
|
-
function
|
|
103
|
-
|
|
104
|
-
function
|
|
105
|
-
|
|
55
|
+
function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
|
|
56
|
+
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; }
|
|
57
|
+
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
|
|
58
|
+
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); }
|
|
106
59
|
var getOperationsFromState = function getOperationsFromState(state) {
|
|
107
60
|
var clipping = state.clipping,
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
61
|
+
clippingColor = state.clippingColor,
|
|
62
|
+
vectorize = state.vectorize,
|
|
63
|
+
vectorizeThreshold = state.vectorizeThreshold,
|
|
64
|
+
vectorizeColorsMap = state.vectorizeColorsMap;
|
|
112
65
|
return {
|
|
113
66
|
clipping: clipping,
|
|
114
67
|
clippingColor: clippingColor,
|
|
@@ -117,13 +70,10 @@ var getOperationsFromState = function getOperationsFromState(state) {
|
|
|
117
70
|
vectorizeColorsMap: vectorizeColorsMap
|
|
118
71
|
};
|
|
119
72
|
};
|
|
120
|
-
|
|
121
73
|
var getLoadingState = (0, _Selectors4.createBackgroundWorkStateSelector)(_Actions.WN_UPLOAD_IMAGE);
|
|
122
|
-
|
|
123
74
|
var isVectorizableGalleryImage = function isVectorizableGalleryImage(imageData) {
|
|
124
75
|
return Boolean(imageData && !(0, _get["default"])(imageData, 'operations.vectorize') && imageData.gallery && (0, _Selectors3.isEditableVectorImage)(imageData.preview));
|
|
125
76
|
};
|
|
126
|
-
|
|
127
77
|
var getDerivedOperationStateFromImageData = function getDerivedOperationStateFromImageData(imageData) {
|
|
128
78
|
return {
|
|
129
79
|
clipping: (0, _get["default"])(imageData, 'operations.clipping', null),
|
|
@@ -135,35 +85,24 @@ var getDerivedOperationStateFromImageData = function getDerivedOperationStateFro
|
|
|
135
85
|
vectorizeMaxColorAmount: (0, _get["default"])(imageData, 'operations.vectorizeMaxColorAmount', undefined)
|
|
136
86
|
};
|
|
137
87
|
};
|
|
138
|
-
|
|
139
88
|
var isImageInvalidatedByChange = function isImageInvalidatedByChange(imageData1, imageData2) {
|
|
140
89
|
return ['operations.clipping', 'operations.clippingColor', 'displayColorPreview'].some(function (key) {
|
|
141
90
|
return (0, _get["default"])(imageData1, key, null) !== (0, _get["default"])(imageData2, key, null);
|
|
142
91
|
});
|
|
143
92
|
};
|
|
144
|
-
|
|
145
|
-
var ImageEditDialogContainer = /*#__PURE__*/function (_React$Component) {
|
|
93
|
+
var ImageEditDialogContainer = exports.ImageEditDialogContainer = /*#__PURE__*/function (_React$Component) {
|
|
146
94
|
_inherits(ImageEditDialogContainer, _React$Component);
|
|
147
|
-
|
|
148
95
|
var _super = _createSuper(ImageEditDialogContainer);
|
|
149
|
-
|
|
150
96
|
function ImageEditDialogContainer() {
|
|
151
97
|
var _this;
|
|
152
|
-
|
|
153
98
|
_classCallCheck(this, ImageEditDialogContainer);
|
|
154
|
-
|
|
155
99
|
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
156
100
|
args[_key] = arguments[_key];
|
|
157
101
|
}
|
|
158
|
-
|
|
159
102
|
_this = _super.call.apply(_super, [this].concat(args));
|
|
160
|
-
|
|
161
103
|
_defineProperty(_assertThisInitialized(_this), "colorAmountNoticeRef", /*#__PURE__*/_react["default"].createRef());
|
|
162
|
-
|
|
163
104
|
_defineProperty(_assertThisInitialized(_this), "embroideryNoticeRef", /*#__PURE__*/_react["default"].createRef());
|
|
164
|
-
|
|
165
105
|
_defineProperty(_assertThisInitialized(_this), "imageUploadRef", /*#__PURE__*/_react["default"].createRef());
|
|
166
|
-
|
|
167
106
|
_defineProperty(_assertThisInitialized(_this), "state", {
|
|
168
107
|
preview: null,
|
|
169
108
|
clipping: null,
|
|
@@ -180,692 +119,549 @@ var ImageEditDialogContainer = /*#__PURE__*/function (_React$Component) {
|
|
|
180
119
|
originalImagePreview: null,
|
|
181
120
|
upload: null
|
|
182
121
|
});
|
|
183
|
-
|
|
184
122
|
_defineProperty(_assertThisInitialized(_this), "lastImageUpdateData", null);
|
|
185
|
-
|
|
186
|
-
_defineProperty(_assertThisInitialized(_this), "updateOriginalPreview", /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee() {
|
|
123
|
+
_defineProperty(_assertThisInitialized(_this), "updateOriginalPreview", /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee() {
|
|
187
124
|
var image, previewUrl, isSvg, svgContent, preview;
|
|
188
|
-
return
|
|
189
|
-
while (1) {
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
if (!isSvg) {
|
|
197
|
-
_context.next = 11;
|
|
198
|
-
break;
|
|
199
|
-
}
|
|
200
|
-
|
|
201
|
-
_context.next = 6;
|
|
202
|
-
return (0, _DesignDataService.getSvgContent)(previewUrl, true);
|
|
203
|
-
|
|
204
|
-
case 6:
|
|
205
|
-
svgContent = _context.sent;
|
|
206
|
-
preview = (0, _DesignDataService.applySvgContentOperations)(image.preview, null, svgContent);
|
|
207
|
-
|
|
208
|
-
_this.setState({
|
|
209
|
-
originalImagePreview: preview
|
|
210
|
-
});
|
|
211
|
-
|
|
212
|
-
_context.next = 12;
|
|
125
|
+
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
|
126
|
+
while (1) switch (_context.prev = _context.next) {
|
|
127
|
+
case 0:
|
|
128
|
+
image = _this.props.image;
|
|
129
|
+
previewUrl = "".concat((0, _configuration.getConf)('network.host')).concat(image.preview.url);
|
|
130
|
+
isSvg = previewUrl && /\.svg$/.test(previewUrl);
|
|
131
|
+
if (!isSvg) {
|
|
132
|
+
_context.next = 11;
|
|
213
133
|
break;
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
134
|
+
}
|
|
135
|
+
_context.next = 6;
|
|
136
|
+
return (0, _DesignDataService.getSvgContent)(previewUrl, true);
|
|
137
|
+
case 6:
|
|
138
|
+
svgContent = _context.sent;
|
|
139
|
+
preview = (0, _DesignDataService.applySvgContentOperations)(image.preview, null, svgContent);
|
|
140
|
+
_this.setState({
|
|
141
|
+
originalImagePreview: preview
|
|
142
|
+
});
|
|
143
|
+
_context.next = 12;
|
|
144
|
+
break;
|
|
145
|
+
case 11:
|
|
146
|
+
_this.setState({
|
|
147
|
+
originalImagePreview: previewUrl
|
|
148
|
+
});
|
|
149
|
+
case 12:
|
|
150
|
+
case "end":
|
|
151
|
+
return _context.stop();
|
|
224
152
|
}
|
|
225
153
|
}, _callee);
|
|
226
154
|
})));
|
|
227
|
-
|
|
228
155
|
_defineProperty(_assertThisInitialized(_this), "setUpload", function (upload) {
|
|
229
156
|
_this.setState({
|
|
230
157
|
upload: upload
|
|
231
158
|
});
|
|
232
159
|
});
|
|
233
|
-
|
|
234
160
|
_defineProperty(_assertThisInitialized(_this), "resetDerivedImageState", function () {
|
|
235
161
|
_this.setState(_objectSpread({
|
|
236
162
|
originalImagePreview: null
|
|
237
163
|
}, getDerivedOperationStateFromImageData()));
|
|
238
164
|
});
|
|
239
|
-
|
|
240
165
|
_defineProperty(_assertThisInitialized(_this), "changeSelectedBackground", function (value) {
|
|
241
166
|
var partialState = {
|
|
242
167
|
clipping: value
|
|
243
168
|
};
|
|
244
|
-
|
|
245
169
|
if (value !== null && _this.state.clippingColor === null) {
|
|
246
170
|
partialState.clippingColor = '#ffffff';
|
|
247
|
-
}
|
|
248
|
-
|
|
171
|
+
}
|
|
249
172
|
|
|
173
|
+
// remove the threshold value to trigger the re-creation of the color map
|
|
250
174
|
if (_this.state.vectorizeThreshold) {
|
|
251
175
|
partialState.vectorizeThreshold = null;
|
|
252
176
|
}
|
|
253
|
-
|
|
254
177
|
_this.handleStateChange(partialState);
|
|
255
178
|
});
|
|
256
|
-
|
|
257
179
|
_defineProperty(_assertThisInitialized(_this), "changeColor", function (color) {
|
|
258
180
|
var partialState = {
|
|
259
181
|
clippingColor: color.hex
|
|
260
182
|
};
|
|
261
|
-
|
|
262
183
|
if (_this.state.clipping === null) {
|
|
263
184
|
partialState.clipping = 'replace';
|
|
264
|
-
}
|
|
265
|
-
|
|
185
|
+
}
|
|
266
186
|
|
|
187
|
+
// remove the threshold value to trigger the re-creation of the color map
|
|
267
188
|
if (_this.state.vectorizeThreshold) {
|
|
268
189
|
partialState.vectorizeThreshold = null;
|
|
269
190
|
}
|
|
270
|
-
|
|
271
191
|
_this.handleStateChange(partialState);
|
|
272
192
|
});
|
|
273
|
-
|
|
274
193
|
_defineProperty(_assertThisInitialized(_this), "handleStateChange", /*#__PURE__*/function () {
|
|
275
|
-
var _ref2 = _asyncToGenerator( /*#__PURE__*/
|
|
194
|
+
var _ref2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2(partialState) {
|
|
276
195
|
var options,
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
return
|
|
288
|
-
while (1) {
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
});
|
|
325
|
-
|
|
326
|
-
case 15:
|
|
327
|
-
_context2.prev = 15;
|
|
328
|
-
_this.continueBlocked = false;
|
|
329
|
-
return _context2.finish(15);
|
|
330
|
-
|
|
331
|
-
case 18:
|
|
332
|
-
case "end":
|
|
333
|
-
return _context2.stop();
|
|
334
|
-
}
|
|
196
|
+
displayColorPreview,
|
|
197
|
+
image,
|
|
198
|
+
nextState,
|
|
199
|
+
operations,
|
|
200
|
+
result,
|
|
201
|
+
vectorizeColorsMap,
|
|
202
|
+
vectorizeThreshold,
|
|
203
|
+
vectorizeMaxColorAmount,
|
|
204
|
+
vectorizeOriginalColorsMap,
|
|
205
|
+
_args2 = arguments;
|
|
206
|
+
return _regeneratorRuntime().wrap(function _callee2$(_context2) {
|
|
207
|
+
while (1) switch (_context2.prev = _context2.next) {
|
|
208
|
+
case 0:
|
|
209
|
+
options = _args2.length > 1 && _args2[1] !== undefined ? _args2[1] : {};
|
|
210
|
+
displayColorPreview = options.displayColorPreview;
|
|
211
|
+
image = _this.props.image;
|
|
212
|
+
nextState = _objectSpread(_objectSpread({}, _this.state), partialState);
|
|
213
|
+
_this.setState(nextState);
|
|
214
|
+
operations = getOperationsFromState(nextState);
|
|
215
|
+
if (!(!image || (0, _isMatch["default"])(image.operations, operations) && image.displayColorPreview === displayColorPreview)) {
|
|
216
|
+
_context2.next = 8;
|
|
217
|
+
break;
|
|
218
|
+
}
|
|
219
|
+
return _context2.abrupt("return");
|
|
220
|
+
case 8:
|
|
221
|
+
_this.continueBlocked = true;
|
|
222
|
+
_context2.prev = 9;
|
|
223
|
+
_context2.next = 12;
|
|
224
|
+
return _this.props.editFile(operations, image, displayColorPreview !== undefined && {
|
|
225
|
+
displayColorPreview: displayColorPreview
|
|
226
|
+
});
|
|
227
|
+
case 12:
|
|
228
|
+
result = _context2.sent;
|
|
229
|
+
vectorizeColorsMap = result.vectorizeColorsMap, vectorizeThreshold = result.vectorizeThreshold, vectorizeMaxColorAmount = result.vectorizeMaxColorAmount, vectorizeOriginalColorsMap = result.vectorizeOriginalColorsMap;
|
|
230
|
+
_this.setState({
|
|
231
|
+
vectorizeColorsMap: vectorizeColorsMap,
|
|
232
|
+
vectorizeThreshold: vectorizeThreshold,
|
|
233
|
+
vectorizeMaxColorAmount: vectorizeMaxColorAmount,
|
|
234
|
+
vectorizeOriginalColorsMap: vectorizeOriginalColorsMap
|
|
235
|
+
});
|
|
236
|
+
case 15:
|
|
237
|
+
_context2.prev = 15;
|
|
238
|
+
_this.continueBlocked = false;
|
|
239
|
+
return _context2.finish(15);
|
|
240
|
+
case 18:
|
|
241
|
+
case "end":
|
|
242
|
+
return _context2.stop();
|
|
335
243
|
}
|
|
336
244
|
}, _callee2, null, [[9,, 15, 18]]);
|
|
337
245
|
}));
|
|
338
|
-
|
|
339
246
|
return function (_x) {
|
|
340
247
|
return _ref2.apply(this, arguments);
|
|
341
248
|
};
|
|
342
249
|
}());
|
|
343
|
-
|
|
344
250
|
_defineProperty(_assertThisInitialized(_this), "onVectorizeToggleChange", function (value) {
|
|
345
251
|
_this.handleStateChange({
|
|
346
252
|
vectorize: value
|
|
347
253
|
});
|
|
348
254
|
});
|
|
349
|
-
|
|
350
255
|
_defineProperty(_assertThisInitialized(_this), "onVectorizeThresholdChange", function (threshold) {
|
|
351
|
-
var image = _this.props.image;
|
|
256
|
+
var image = _this.props.image;
|
|
352
257
|
|
|
258
|
+
// skip if the threshold is the same as the color count
|
|
353
259
|
var colorCount = (0, _Selectors2.getAggregatedColorCount)(_this.state.vectorizeColorsMap);
|
|
354
|
-
|
|
355
260
|
if (threshold === colorCount) {
|
|
356
261
|
return;
|
|
357
262
|
}
|
|
358
|
-
|
|
359
263
|
if (threshold !== _this.state.vectorizeThreshold && !image.gallery) {
|
|
360
264
|
return _this.handleStateChange({
|
|
361
265
|
vectorizeThreshold: threshold
|
|
362
266
|
});
|
|
363
|
-
}
|
|
364
|
-
|
|
267
|
+
}
|
|
365
268
|
|
|
269
|
+
// if the threshold value is the same, there might be some aggregated colors to restore
|
|
366
270
|
return _this.handleStateChange(_objectSpread({
|
|
367
271
|
vectorizeColorsMap: (0, _ImageEditUtils.expandVectorizeColorsMap)(_this.state.vectorizeColorsMap, _this.props.colorPalettes, threshold)
|
|
368
272
|
}, image.gallery && {
|
|
369
273
|
vectorizeThreshold: threshold
|
|
370
274
|
}));
|
|
371
275
|
});
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
case 2:
|
|
382
|
-
case "end":
|
|
383
|
-
return _context3.stop();
|
|
384
|
-
}
|
|
276
|
+
_defineProperty(_assertThisInitialized(_this), "onColorImageStateReset", /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee3() {
|
|
277
|
+
return _regeneratorRuntime().wrap(function _callee3$(_context3) {
|
|
278
|
+
while (1) switch (_context3.prev = _context3.next) {
|
|
279
|
+
case 0:
|
|
280
|
+
_context3.next = 2;
|
|
281
|
+
return _this.props.resetColorizing();
|
|
282
|
+
case 2:
|
|
283
|
+
case "end":
|
|
284
|
+
return _context3.stop();
|
|
385
285
|
}
|
|
386
286
|
}, _callee3);
|
|
387
287
|
})));
|
|
388
|
-
|
|
389
288
|
_defineProperty(_assertThisInitialized(_this), "selectColor", /*#__PURE__*/function () {
|
|
390
|
-
var _ref4 = _asyncToGenerator( /*#__PURE__*/
|
|
289
|
+
var _ref4 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee4(colorKey, newColor) {
|
|
391
290
|
var vectorizeColorsMap, colorKeys, _colorKey, _iterator, _step, _colorKey2;
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
if (!_ServiceLocator.Services.designData.changeAllColorsNeeded()) {
|
|
401
|
-
_context4.next = 13;
|
|
402
|
-
break;
|
|
403
|
-
}
|
|
404
|
-
|
|
405
|
-
_context4.t0 = regeneratorRuntime.keys(vectorizeColorsMap);
|
|
406
|
-
|
|
407
|
-
case 4:
|
|
408
|
-
if ((_context4.t1 = _context4.t0()).done) {
|
|
409
|
-
_context4.next = 11;
|
|
410
|
-
break;
|
|
411
|
-
}
|
|
412
|
-
|
|
413
|
-
_colorKey = _context4.t1.value;
|
|
414
|
-
|
|
415
|
-
if (vectorizeColorsMap.hasOwnProperty(_colorKey)) {
|
|
416
|
-
_context4.next = 8;
|
|
417
|
-
break;
|
|
418
|
-
}
|
|
419
|
-
|
|
420
|
-
return _context4.abrupt("continue", 4);
|
|
421
|
-
|
|
422
|
-
case 8:
|
|
423
|
-
vectorizeColorsMap[_colorKey] = newColor;
|
|
424
|
-
_context4.next = 4;
|
|
291
|
+
return _regeneratorRuntime().wrap(function _callee4$(_context4) {
|
|
292
|
+
while (1) switch (_context4.prev = _context4.next) {
|
|
293
|
+
case 0:
|
|
294
|
+
vectorizeColorsMap = (0, _cloneDeep["default"])(_this.state.vectorizeColorsMap);
|
|
295
|
+
colorKeys = (0, _Selectors2.getColorKeysForAggregatedColor)(vectorizeColorsMap, colorKey);
|
|
296
|
+
if (!_ServiceLocator.Services.designData.changeAllColorsNeeded()) {
|
|
297
|
+
_context4.next = 13;
|
|
425
298
|
break;
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
299
|
+
}
|
|
300
|
+
_context4.t0 = _regeneratorRuntime().keys(vectorizeColorsMap);
|
|
301
|
+
case 4:
|
|
302
|
+
if ((_context4.t1 = _context4.t0()).done) {
|
|
303
|
+
_context4.next = 11;
|
|
429
304
|
break;
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
305
|
+
}
|
|
306
|
+
_colorKey = _context4.t1.value;
|
|
307
|
+
if (vectorizeColorsMap.hasOwnProperty(_colorKey)) {
|
|
308
|
+
_context4.next = 8;
|
|
309
|
+
break;
|
|
310
|
+
}
|
|
311
|
+
return _context4.abrupt("continue", 4);
|
|
312
|
+
case 8:
|
|
313
|
+
vectorizeColorsMap[_colorKey] = newColor;
|
|
314
|
+
_context4.next = 4;
|
|
315
|
+
break;
|
|
316
|
+
case 11:
|
|
317
|
+
_context4.next = 15;
|
|
318
|
+
break;
|
|
319
|
+
case 13:
|
|
320
|
+
_iterator = _createForOfIteratorHelper(colorKeys);
|
|
321
|
+
try {
|
|
322
|
+
for (_iterator.s(); !(_step = _iterator.n()).done;) {
|
|
323
|
+
_colorKey2 = _step.value;
|
|
324
|
+
vectorizeColorsMap[_colorKey2] = _objectSpread(_objectSpread({}, newColor), {}, {
|
|
325
|
+
isUserColor: true
|
|
326
|
+
});
|
|
445
327
|
}
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
328
|
+
} catch (err) {
|
|
329
|
+
_iterator.e(err);
|
|
330
|
+
} finally {
|
|
331
|
+
_iterator.f();
|
|
332
|
+
}
|
|
333
|
+
case 15:
|
|
334
|
+
_context4.next = 17;
|
|
335
|
+
return _this.handleStateChange({
|
|
336
|
+
vectorizeColorsMap: vectorizeColorsMap
|
|
337
|
+
});
|
|
338
|
+
case 17:
|
|
339
|
+
_ServiceLocator.Services.designData.setImageAndTextColor(newColor);
|
|
340
|
+
_ServiceLocator.Services.analytics.triggerEvent(_Constant.EventTypes.image_edit_colorize_color, newColor.value.replace('#', ''));
|
|
341
|
+
case 19:
|
|
342
|
+
case "end":
|
|
343
|
+
return _context4.stop();
|
|
462
344
|
}
|
|
463
345
|
}, _callee4);
|
|
464
346
|
}));
|
|
465
|
-
|
|
466
347
|
return function (_x2, _x3) {
|
|
467
348
|
return _ref4.apply(this, arguments);
|
|
468
349
|
};
|
|
469
350
|
}());
|
|
470
|
-
|
|
471
351
|
_defineProperty(_assertThisInitialized(_this), "removeColor", /*#__PURE__*/function () {
|
|
472
|
-
var _ref5 = _asyncToGenerator( /*#__PURE__*/
|
|
352
|
+
var _ref5 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee5(colorKey) {
|
|
473
353
|
var vectorizeColorsMap, closestColor;
|
|
474
|
-
return
|
|
475
|
-
while (1) {
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
return _this.selectColor(colorKey, closestColor);
|
|
491
|
-
|
|
492
|
-
case 6:
|
|
493
|
-
case "end":
|
|
494
|
-
return _context5.stop();
|
|
495
|
-
}
|
|
354
|
+
return _regeneratorRuntime().wrap(function _callee5$(_context5) {
|
|
355
|
+
while (1) switch (_context5.prev = _context5.next) {
|
|
356
|
+
case 0:
|
|
357
|
+
vectorizeColorsMap = _this.state.vectorizeColorsMap;
|
|
358
|
+
if (vectorizeColorsMap[colorKey]) {
|
|
359
|
+
_context5.next = 3;
|
|
360
|
+
break;
|
|
361
|
+
}
|
|
362
|
+
throw new Error('Color key does not exist!');
|
|
363
|
+
case 3:
|
|
364
|
+
closestColor = (0, _ImageEditUtils.getClosestColorFromMap)(vectorizeColorsMap, vectorizeColorsMap[colorKey].value);
|
|
365
|
+
_context5.next = 6;
|
|
366
|
+
return _this.selectColor(colorKey, closestColor);
|
|
367
|
+
case 6:
|
|
368
|
+
case "end":
|
|
369
|
+
return _context5.stop();
|
|
496
370
|
}
|
|
497
371
|
}, _callee5);
|
|
498
372
|
}));
|
|
499
|
-
|
|
500
373
|
return function (_x4) {
|
|
501
374
|
return _ref5.apply(this, arguments);
|
|
502
375
|
};
|
|
503
376
|
}());
|
|
504
|
-
|
|
505
377
|
_defineProperty(_assertThisInitialized(_this), "onActiveTabChange", function (activeTabIndex) {
|
|
506
378
|
var image = _this.props.image;
|
|
507
379
|
var upload = _this.state.upload;
|
|
508
|
-
|
|
509
380
|
if (upload !== null) {
|
|
510
381
|
return;
|
|
511
382
|
}
|
|
512
|
-
|
|
513
383
|
if (!image && [1, 2].indexOf(activeTabIndex) !== -1) {
|
|
514
384
|
return;
|
|
515
385
|
}
|
|
516
|
-
|
|
517
386
|
_this.setState({
|
|
518
387
|
activeTabIndex: activeTabIndex
|
|
519
388
|
});
|
|
520
389
|
});
|
|
521
|
-
|
|
522
390
|
_defineProperty(_assertThisInitialized(_this), "updatePreview", /*#__PURE__*/function () {
|
|
523
|
-
var _ref6 = _asyncToGenerator( /*#__PURE__*/
|
|
391
|
+
var _ref6 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee6(svgContent) {
|
|
524
392
|
var _image$preview;
|
|
525
|
-
|
|
526
393
|
var options,
|
|
527
|
-
|
|
528
|
-
|
|
529
|
-
|
|
530
|
-
|
|
531
|
-
|
|
532
|
-
|
|
533
|
-
|
|
534
|
-
|
|
535
|
-
|
|
536
|
-
|
|
537
|
-
|
|
538
|
-
|
|
539
|
-
|
|
540
|
-
|
|
541
|
-
|
|
542
|
-
|
|
543
|
-
|
|
544
|
-
|
|
545
|
-
|
|
546
|
-
|
|
547
|
-
|
|
548
|
-
|
|
549
|
-
previewUrl =
|
|
550
|
-
|
|
551
|
-
|
|
552
|
-
|
|
553
|
-
}
|
|
554
|
-
|
|
555
|
-
isSvg = previewUrl && /\.svg$/.test(previewUrl);
|
|
556
|
-
|
|
557
|
-
if (!image) {
|
|
558
|
-
_context6.next = 22;
|
|
559
|
-
break;
|
|
560
|
-
}
|
|
561
|
-
|
|
562
|
-
updateSVG = isSvg;
|
|
563
|
-
|
|
564
|
-
if (!updateSVG) {
|
|
565
|
-
_context6.next = 19;
|
|
566
|
-
break;
|
|
567
|
-
}
|
|
568
|
-
|
|
569
|
-
if (svgContent) {
|
|
570
|
-
_context6.next = 16;
|
|
571
|
-
break;
|
|
572
|
-
}
|
|
573
|
-
|
|
574
|
-
_context6.next = 15;
|
|
575
|
-
return (0, _DesignDataService.getSvgContent)(image.preview.url, false, forceFetch);
|
|
576
|
-
|
|
577
|
-
case 15:
|
|
578
|
-
svgContent = _context6.sent;
|
|
579
|
-
|
|
580
|
-
case 16:
|
|
581
|
-
preview = (0, _DesignDataService.applySvgContentOperations)(image.preview, image.displayColorPreview ? image.operations : null, svgContent);
|
|
394
|
+
_options$forceFetch,
|
|
395
|
+
forceFetch,
|
|
396
|
+
image,
|
|
397
|
+
activeTabIndex,
|
|
398
|
+
preview,
|
|
399
|
+
originalImagePreview,
|
|
400
|
+
previewUrl,
|
|
401
|
+
isSvg,
|
|
402
|
+
updateSVG,
|
|
403
|
+
forceUpdate,
|
|
404
|
+
_args6 = arguments;
|
|
405
|
+
return _regeneratorRuntime().wrap(function _callee6$(_context6) {
|
|
406
|
+
while (1) switch (_context6.prev = _context6.next) {
|
|
407
|
+
case 0:
|
|
408
|
+
options = _args6.length > 1 && _args6[1] !== undefined ? _args6[1] : {};
|
|
409
|
+
_options$forceFetch = options.forceFetch, forceFetch = _options$forceFetch === void 0 ? false : _options$forceFetch;
|
|
410
|
+
image = _this.props.image;
|
|
411
|
+
activeTabIndex = _this.state.activeTabIndex;
|
|
412
|
+
preview = null;
|
|
413
|
+
originalImagePreview = null;
|
|
414
|
+
previewUrl = image === null || image === void 0 || (_image$preview = image.preview) === null || _image$preview === void 0 ? void 0 : _image$preview.url;
|
|
415
|
+
if (previewUrl && activeTabIndex === 1) {
|
|
416
|
+
previewUrl = (0, _Transformers.getRasterURL)(previewUrl);
|
|
417
|
+
}
|
|
418
|
+
isSvg = previewUrl && /\.svg$/.test(previewUrl);
|
|
419
|
+
if (!image) {
|
|
582
420
|
_context6.next = 22;
|
|
583
421
|
break;
|
|
584
|
-
|
|
585
|
-
|
|
586
|
-
|
|
587
|
-
|
|
588
|
-
|
|
589
|
-
|
|
590
|
-
|
|
591
|
-
|
|
592
|
-
|
|
593
|
-
|
|
594
|
-
|
|
595
|
-
|
|
596
|
-
|
|
597
|
-
|
|
598
|
-
|
|
599
|
-
|
|
600
|
-
|
|
601
|
-
|
|
602
|
-
|
|
603
|
-
|
|
604
|
-
|
|
605
|
-
|
|
606
|
-
|
|
607
|
-
|
|
608
|
-
|
|
422
|
+
}
|
|
423
|
+
updateSVG = isSvg;
|
|
424
|
+
if (!updateSVG) {
|
|
425
|
+
_context6.next = 19;
|
|
426
|
+
break;
|
|
427
|
+
}
|
|
428
|
+
if (svgContent) {
|
|
429
|
+
_context6.next = 16;
|
|
430
|
+
break;
|
|
431
|
+
}
|
|
432
|
+
_context6.next = 15;
|
|
433
|
+
return (0, _DesignDataService.getSvgContent)(image.preview.url, false, forceFetch);
|
|
434
|
+
case 15:
|
|
435
|
+
svgContent = _context6.sent;
|
|
436
|
+
case 16:
|
|
437
|
+
preview = (0, _DesignDataService.applySvgContentOperations)(image.preview, image.displayColorPreview ? image.operations : null, svgContent);
|
|
438
|
+
_context6.next = 22;
|
|
439
|
+
break;
|
|
440
|
+
case 19:
|
|
441
|
+
forceUpdate = isImageInvalidatedByChange(_this.lastImageUpdateData, image);
|
|
442
|
+
if (forceUpdate) {
|
|
443
|
+
_this.previewVersion = Math.random();
|
|
444
|
+
}
|
|
445
|
+
if (previewUrl) {
|
|
446
|
+
preview = (0, _Selectors3.getPreviewUrlFromImageData)(previewUrl) + (_this.previewVersion ? "?".concat(_this.previewVersion) : '');
|
|
447
|
+
originalImagePreview = preview;
|
|
448
|
+
}
|
|
449
|
+
case 22:
|
|
450
|
+
_this.lastImageUpdateData = image;
|
|
451
|
+
_this.setState({
|
|
452
|
+
preview: preview,
|
|
453
|
+
originalImagePreview: originalImagePreview
|
|
454
|
+
});
|
|
455
|
+
case 24:
|
|
456
|
+
case "end":
|
|
457
|
+
return _context6.stop();
|
|
609
458
|
}
|
|
610
459
|
}, _callee6);
|
|
611
460
|
}));
|
|
612
|
-
|
|
613
461
|
return function (_x5) {
|
|
614
462
|
return _ref6.apply(this, arguments);
|
|
615
463
|
};
|
|
616
464
|
}());
|
|
617
|
-
|
|
618
465
|
_defineProperty(_assertThisInitialized(_this), "closeAddImagePanel", function () {
|
|
619
466
|
return _this.setState({
|
|
620
467
|
showAddImagePanel: false
|
|
621
468
|
});
|
|
622
469
|
});
|
|
623
|
-
|
|
624
470
|
_defineProperty(_assertThisInitialized(_this), "onSelectImage", /*#__PURE__*/function () {
|
|
625
|
-
var _ref7 = _asyncToGenerator( /*#__PURE__*/
|
|
471
|
+
var _ref7 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee7(file) {
|
|
626
472
|
var addGalleryImageToUserImages, imageUrl, thumbUrl, fileName, vectorizeColorsMap;
|
|
627
|
-
return
|
|
628
|
-
while (1) {
|
|
629
|
-
|
|
630
|
-
|
|
631
|
-
|
|
632
|
-
|
|
633
|
-
|
|
634
|
-
|
|
635
|
-
|
|
636
|
-
|
|
637
|
-
|
|
638
|
-
|
|
639
|
-
|
|
640
|
-
|
|
641
|
-
|
|
642
|
-
|
|
643
|
-
|
|
644
|
-
|
|
645
|
-
case 8:
|
|
646
|
-
case "end":
|
|
647
|
-
return _context7.stop();
|
|
648
|
-
}
|
|
473
|
+
return _regeneratorRuntime().wrap(function _callee7$(_context7) {
|
|
474
|
+
while (1) switch (_context7.prev = _context7.next) {
|
|
475
|
+
case 0:
|
|
476
|
+
addGalleryImageToUserImages = _this.props.addGalleryImageToUserImages;
|
|
477
|
+
imageUrl = file.imageUrl, thumbUrl = file.thumbUrl;
|
|
478
|
+
fileName = imageUrl.replace(/^.*[\\/]/, '') // get filename
|
|
479
|
+
.replace(/\.[^.$]+$/, ''); // remove extension
|
|
480
|
+
_context7.next = 5;
|
|
481
|
+
return _ServiceLocator.Services.designData.getGalleryImageColors(imageUrl);
|
|
482
|
+
case 5:
|
|
483
|
+
vectorizeColorsMap = _context7.sent;
|
|
484
|
+
addGalleryImageToUserImages(imageUrl, thumbUrl, fileName, vectorizeColorsMap);
|
|
485
|
+
|
|
486
|
+
// exit image upload if a gallery image is selected
|
|
487
|
+
_this.setUpload(null);
|
|
488
|
+
case 8:
|
|
489
|
+
case "end":
|
|
490
|
+
return _context7.stop();
|
|
649
491
|
}
|
|
650
492
|
}, _callee7);
|
|
651
493
|
}));
|
|
652
|
-
|
|
653
494
|
return function (_x6) {
|
|
654
495
|
return _ref7.apply(this, arguments);
|
|
655
496
|
};
|
|
656
497
|
}());
|
|
657
|
-
|
|
658
|
-
_defineProperty(_assertThisInitialized(_this), "continueClick", /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee8() {
|
|
498
|
+
_defineProperty(_assertThisInitialized(_this), "continueClick", /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee8() {
|
|
659
499
|
var _this$props, colorDisabled, image, shouldAddImageImmediately, colorPreviewRequirementFulfilled, _this$state, activeTabIndex, continueButtonDisabled;
|
|
660
|
-
|
|
661
|
-
|
|
662
|
-
|
|
663
|
-
|
|
664
|
-
|
|
665
|
-
|
|
666
|
-
|
|
667
|
-
|
|
668
|
-
|
|
669
|
-
|
|
670
|
-
|
|
671
|
-
|
|
672
|
-
|
|
673
|
-
|
|
674
|
-
|
|
675
|
-
|
|
676
|
-
|
|
677
|
-
|
|
678
|
-
|
|
679
|
-
|
|
680
|
-
|
|
681
|
-
|
|
682
|
-
|
|
683
|
-
|
|
684
|
-
|
|
685
|
-
|
|
686
|
-
|
|
687
|
-
_context8.
|
|
688
|
-
|
|
689
|
-
|
|
690
|
-
|
|
691
|
-
|
|
692
|
-
|
|
693
|
-
|
|
694
|
-
|
|
695
|
-
|
|
696
|
-
|
|
697
|
-
|
|
698
|
-
|
|
699
|
-
|
|
700
|
-
|
|
701
|
-
|
|
702
|
-
|
|
703
|
-
|
|
704
|
-
|
|
705
|
-
|
|
706
|
-
|
|
707
|
-
|
|
708
|
-
|
|
709
|
-
|
|
710
|
-
|
|
711
|
-
|
|
712
|
-
|
|
713
|
-
|
|
714
|
-
|
|
715
|
-
|
|
716
|
-
|
|
717
|
-
|
|
718
|
-
|
|
719
|
-
|
|
720
|
-
|
|
721
|
-
|
|
722
|
-
|
|
723
|
-
|
|
724
|
-
|
|
725
|
-
|
|
726
|
-
|
|
727
|
-
|
|
728
|
-
|
|
729
|
-
|
|
730
|
-
|
|
731
|
-
|
|
732
|
-
|
|
733
|
-
|
|
734
|
-
|
|
735
|
-
|
|
736
|
-
|
|
737
|
-
}
|
|
738
|
-
|
|
739
|
-
if (!(_this.colorAmountNoticeRef && _this.colorAmountNoticeRef.current)) {
|
|
740
|
-
_context8.next = 27;
|
|
741
|
-
break;
|
|
742
|
-
}
|
|
743
|
-
|
|
744
|
-
_this.colorAmountNoticeRef.current.scrollIntoView();
|
|
745
|
-
|
|
746
|
-
return _context8.abrupt("return");
|
|
747
|
-
|
|
748
|
-
case 27:
|
|
749
|
-
_this.continueBlocked = true;
|
|
750
|
-
_context8.prev = 28;
|
|
751
|
-
_context8.next = 31;
|
|
752
|
-
return _ServiceLocator.Services.designer.imageEditDialogContinueClickHandler();
|
|
753
|
-
|
|
754
|
-
case 31:
|
|
755
|
-
_context8.prev = 31;
|
|
756
|
-
_this.continueBlocked = false;
|
|
757
|
-
return _context8.finish(31);
|
|
758
|
-
|
|
759
|
-
case 34:
|
|
760
|
-
case "end":
|
|
761
|
-
return _context8.stop();
|
|
762
|
-
}
|
|
500
|
+
return _regeneratorRuntime().wrap(function _callee8$(_context8) {
|
|
501
|
+
while (1) switch (_context8.prev = _context8.next) {
|
|
502
|
+
case 0:
|
|
503
|
+
if (!_this.continueBlocked) {
|
|
504
|
+
_context8.next = 2;
|
|
505
|
+
break;
|
|
506
|
+
}
|
|
507
|
+
return _context8.abrupt("return");
|
|
508
|
+
case 2:
|
|
509
|
+
_this$props = _this.props, colorDisabled = _this$props.colorDisabled, image = _this$props.image, shouldAddImageImmediately = _this$props.shouldAddImageImmediately, colorPreviewRequirementFulfilled = _this$props.colorPreviewRequirementFulfilled;
|
|
510
|
+
_this$state = _this.state, activeTabIndex = _this$state.activeTabIndex, continueButtonDisabled = _this$state.continueButtonDisabled;
|
|
511
|
+
if (!(activeTabIndex === 0 && shouldAddImageImmediately(image))) {
|
|
512
|
+
_context8.next = 13;
|
|
513
|
+
break;
|
|
514
|
+
}
|
|
515
|
+
_this.continueBlocked = true;
|
|
516
|
+
_context8.prev = 6;
|
|
517
|
+
_context8.next = 9;
|
|
518
|
+
return _ServiceLocator.Services.designer.imageEditDialogContinueClickHandler();
|
|
519
|
+
case 9:
|
|
520
|
+
_context8.prev = 9;
|
|
521
|
+
_this.continueBlocked = false;
|
|
522
|
+
return _context8.finish(9);
|
|
523
|
+
case 12:
|
|
524
|
+
return _context8.abrupt("return");
|
|
525
|
+
case 13:
|
|
526
|
+
if (!(activeTabIndex === 0 && !(image.gallery && colorDisabled))) {
|
|
527
|
+
_context8.next = 16;
|
|
528
|
+
break;
|
|
529
|
+
}
|
|
530
|
+
_this.setState({
|
|
531
|
+
activeTabIndex: image.gallery ? 2 : 1
|
|
532
|
+
});
|
|
533
|
+
return _context8.abrupt("return");
|
|
534
|
+
case 16:
|
|
535
|
+
if (!(activeTabIndex === 1 && !colorDisabled)) {
|
|
536
|
+
_context8.next = 19;
|
|
537
|
+
break;
|
|
538
|
+
}
|
|
539
|
+
_this.setState({
|
|
540
|
+
activeTabIndex: 2
|
|
541
|
+
});
|
|
542
|
+
return _context8.abrupt("return");
|
|
543
|
+
case 19:
|
|
544
|
+
if (!(activeTabIndex === 2 && !colorPreviewRequirementFulfilled)) {
|
|
545
|
+
_context8.next = 23;
|
|
546
|
+
break;
|
|
547
|
+
}
|
|
548
|
+
if (!(_this.embroideryNoticeRef && _this.embroideryNoticeRef.current)) {
|
|
549
|
+
_context8.next = 23;
|
|
550
|
+
break;
|
|
551
|
+
}
|
|
552
|
+
_this.embroideryNoticeRef.current.scrollIntoView();
|
|
553
|
+
return _context8.abrupt("return");
|
|
554
|
+
case 23:
|
|
555
|
+
if (!continueButtonDisabled) {
|
|
556
|
+
_context8.next = 27;
|
|
557
|
+
break;
|
|
558
|
+
}
|
|
559
|
+
if (!(_this.colorAmountNoticeRef && _this.colorAmountNoticeRef.current)) {
|
|
560
|
+
_context8.next = 27;
|
|
561
|
+
break;
|
|
562
|
+
}
|
|
563
|
+
_this.colorAmountNoticeRef.current.scrollIntoView();
|
|
564
|
+
return _context8.abrupt("return");
|
|
565
|
+
case 27:
|
|
566
|
+
_this.continueBlocked = true;
|
|
567
|
+
_context8.prev = 28;
|
|
568
|
+
_context8.next = 31;
|
|
569
|
+
return _ServiceLocator.Services.designer.imageEditDialogContinueClickHandler();
|
|
570
|
+
case 31:
|
|
571
|
+
_context8.prev = 31;
|
|
572
|
+
_this.continueBlocked = false;
|
|
573
|
+
return _context8.finish(31);
|
|
574
|
+
case 34:
|
|
575
|
+
case "end":
|
|
576
|
+
return _context8.stop();
|
|
763
577
|
}
|
|
764
578
|
}, _callee8, null, [[6,, 9, 12], [28,, 31, 34]]);
|
|
765
579
|
})));
|
|
766
|
-
|
|
767
580
|
_defineProperty(_assertThisInitialized(_this), "onGalleryClick", function () {
|
|
768
581
|
_this.setState({
|
|
769
582
|
showAddImagePanel: true
|
|
770
583
|
});
|
|
771
584
|
});
|
|
772
|
-
|
|
773
585
|
_defineProperty(_assertThisInitialized(_this), "closePreviewDialog", function () {
|
|
774
586
|
_ServiceLocator.Services.designer.imageEditDialogCloseHandler();
|
|
775
587
|
});
|
|
776
|
-
|
|
777
588
|
_defineProperty(_assertThisInitialized(_this), "onOriginalImageAndColorPreviewToggleClick", function () {
|
|
778
589
|
_this.handleStateChange({}, {
|
|
779
590
|
displayColorPreview: !_this.props.displayColorPreview
|
|
780
591
|
});
|
|
781
592
|
});
|
|
782
|
-
|
|
783
593
|
_defineProperty(_assertThisInitialized(_this), "uploadImage", function () {
|
|
784
594
|
return _this.imageUploadRef.current.uploadFile();
|
|
785
595
|
});
|
|
786
|
-
|
|
787
596
|
_defineProperty(_assertThisInitialized(_this), "onNewUploadClick", function () {
|
|
788
597
|
_this.setUpload({
|
|
789
598
|
disabled: true
|
|
790
599
|
});
|
|
791
|
-
|
|
792
600
|
_this.resetDerivedImageState();
|
|
793
601
|
});
|
|
794
|
-
|
|
795
602
|
_defineProperty(_assertThisInitialized(_this), "selectUserImage", function (imageIndex) {
|
|
796
603
|
var _this$props2 = _this.props,
|
|
797
|
-
|
|
798
|
-
|
|
604
|
+
userImages = _this$props2.userImages,
|
|
605
|
+
setSelectedImage = _this$props2.setSelectedImage;
|
|
799
606
|
setSelectedImage(userImages[imageIndex].identifier);
|
|
800
|
-
|
|
801
607
|
_this.resetDerivedImageState();
|
|
802
608
|
});
|
|
803
|
-
|
|
804
609
|
return _this;
|
|
805
610
|
}
|
|
806
|
-
|
|
807
611
|
_createClass(ImageEditDialogContainer, [{
|
|
808
612
|
key: "componentDidMount",
|
|
809
613
|
value: function componentDidMount() {
|
|
810
614
|
this.updatePreview(null);
|
|
811
615
|
var _this$props3 = this.props,
|
|
812
|
-
|
|
813
|
-
|
|
814
|
-
|
|
815
|
-
|
|
616
|
+
image = _this$props3.image,
|
|
617
|
+
editMode = _this$props3.editMode,
|
|
618
|
+
hasPlaceHolderImage = _this$props3.hasPlaceHolderImage,
|
|
619
|
+
colorDisabled = _this$props3.colorDisabled;
|
|
816
620
|
var initialState = getDerivedOperationStateFromImageData(image);
|
|
817
|
-
|
|
818
621
|
if (editMode && image && !hasPlaceHolderImage) {
|
|
819
622
|
initialState.activeTabIndex = initialState.vectorize && !colorDisabled ? 2 : 1;
|
|
820
623
|
}
|
|
821
|
-
|
|
822
624
|
this.setState(initialState);
|
|
823
625
|
}
|
|
824
626
|
}, {
|
|
825
627
|
key: "componentDidUpdate",
|
|
826
628
|
value: function componentDidUpdate(prevProps, prevState) {
|
|
827
629
|
var _this$props4 = this.props,
|
|
828
|
-
|
|
829
|
-
|
|
830
|
-
|
|
831
|
-
|
|
832
|
-
|
|
833
|
-
|
|
834
|
-
|
|
835
|
-
|
|
836
|
-
|
|
630
|
+
image = _this$props4.image,
|
|
631
|
+
open = _this$props4.open,
|
|
632
|
+
maxColorAmount = _this$props4.maxColorAmount,
|
|
633
|
+
editMode = _this$props4.editMode,
|
|
634
|
+
hasPlaceHolderImage = _this$props4.hasPlaceHolderImage,
|
|
635
|
+
isImageCompatible = _this$props4.isImageCompatible,
|
|
636
|
+
isColorMappingCompatible = _this$props4.isColorMappingCompatible,
|
|
637
|
+
vectorsRequired = _this$props4.vectorsRequired,
|
|
638
|
+
vectorizedLogoMandatory = _this$props4.vectorizedLogoMandatory;
|
|
837
639
|
var _this$state2 = this.state,
|
|
838
|
-
|
|
839
|
-
|
|
840
|
-
|
|
841
|
-
|
|
640
|
+
vectorize = _this$state2.vectorize,
|
|
641
|
+
vectorizeColorsMap = _this$state2.vectorizeColorsMap,
|
|
642
|
+
activeTabIndex = _this$state2.activeTabIndex,
|
|
643
|
+
originalImagePreview = _this$state2.originalImagePreview;
|
|
842
644
|
var newState = {};
|
|
843
645
|
var justOpened = open !== prevProps.open && open;
|
|
844
646
|
var imageChanged = !!image && image !== prevProps.image;
|
|
845
647
|
var prevOperationData = getDerivedOperationStateFromImageData(prevProps.image);
|
|
846
648
|
var operationData = getDerivedOperationStateFromImageData(image);
|
|
847
649
|
var operationsChanged = !!image && !(0, _isEqual["default"])(prevOperationData, operationData);
|
|
848
|
-
|
|
849
650
|
if (image && image.preview && image.preview.url && activeTabIndex === 2 && originalImagePreview === null && !(0, _Transformers.isOriginalVector)(image)) {
|
|
850
651
|
this.updateOriginalPreview();
|
|
851
652
|
}
|
|
852
|
-
|
|
853
653
|
if (operationsChanged) {
|
|
854
654
|
Object.assign(newState, operationData);
|
|
855
655
|
}
|
|
856
|
-
|
|
857
656
|
if (justOpened) {
|
|
858
657
|
var _activeTabIndex = 0;
|
|
859
|
-
|
|
860
658
|
if (image && editMode && !hasPlaceHolderImage) {
|
|
861
659
|
_activeTabIndex = (0, _Selectors3.isEditableVectorImage)(image.preview) ? 2 : 1;
|
|
862
660
|
}
|
|
863
|
-
|
|
864
661
|
Object.assign(newState, {
|
|
865
662
|
activeTabIndex: _activeTabIndex
|
|
866
663
|
});
|
|
867
664
|
}
|
|
868
|
-
|
|
869
665
|
if (maxColorAmount !== prevProps.maxColorAmount || vectorize !== prevState.vectorize || vectorizeColorsMap !== prevState.vectorizeColorsMap || activeTabIndex !== prevState.activeTabIndex) {
|
|
870
666
|
var colorAmount = (0, _Selectors2.getAggregatedColorCount)(vectorizeColorsMap);
|
|
871
667
|
var continueButtonDisabled = activeTabIndex === 2 && vectorize && !!maxColorAmount && colorAmount > maxColorAmount;
|
|
@@ -874,29 +670,26 @@ var ImageEditDialogContainer = /*#__PURE__*/function (_React$Component) {
|
|
|
874
670
|
continueButtonDisabled: continueButtonDisabled
|
|
875
671
|
});
|
|
876
672
|
}
|
|
877
|
-
|
|
878
|
-
|
|
673
|
+
if (activeTabIndex === 2 && isVectorizableGalleryImage(image) && (!vectorize ||
|
|
674
|
+
// if the user comes from the background removal tab vectorizing should be performed again
|
|
879
675
|
prevState.activeTabIndex === 1)) {
|
|
880
676
|
Object.assign(newState, {
|
|
881
677
|
vectorize: true
|
|
882
678
|
});
|
|
883
|
-
}
|
|
884
|
-
|
|
679
|
+
}
|
|
885
680
|
|
|
681
|
+
// when switching to the colorizing tab the color has to be made compatible
|
|
886
682
|
if (activeTabIndex === 2 && activeTabIndex !== prevState.activeTabIndex && (!isImageCompatible(image) || !isColorMappingCompatible(vectorizeColorsMap))) {
|
|
887
683
|
Object.assign(newState, {
|
|
888
684
|
vectorizeColorsMap: vectorizeColorsMap
|
|
889
685
|
});
|
|
890
686
|
}
|
|
891
|
-
|
|
892
687
|
if (activeTabIndex === 2 && (vectorsRequired || vectorizedLogoMandatory) && !vectorize && !image.gallery) {
|
|
893
688
|
Object.assign(newState, {
|
|
894
689
|
vectorize: true
|
|
895
690
|
});
|
|
896
691
|
}
|
|
897
|
-
|
|
898
692
|
var options;
|
|
899
|
-
|
|
900
693
|
if (activeTabIndex === 2 && !image.gallery && vectorizedLogoMandatory && !image.displayColorPreview && !this.state.displayColorPreview) {
|
|
901
694
|
options = {
|
|
902
695
|
displayColorPreview: true
|
|
@@ -905,9 +698,7 @@ var ImageEditDialogContainer = /*#__PURE__*/function (_React$Component) {
|
|
|
905
698
|
displayColorPreview: true
|
|
906
699
|
});
|
|
907
700
|
}
|
|
908
|
-
|
|
909
701
|
(!(0, _isMatch["default"])(this.state, newState) || options) && this.handleStateChange(newState, options);
|
|
910
|
-
|
|
911
702
|
if ((justOpened || imageChanged) && !image.incomplete) {
|
|
912
703
|
this.updatePreview(null, {
|
|
913
704
|
forceFetch: operationsChanged
|
|
@@ -916,21 +707,21 @@ var ImageEditDialogContainer = /*#__PURE__*/function (_React$Component) {
|
|
|
916
707
|
this.updatePreview(null, {
|
|
917
708
|
forceFetch: true
|
|
918
709
|
});
|
|
919
|
-
}
|
|
920
|
-
|
|
710
|
+
}
|
|
921
711
|
|
|
712
|
+
// update upload state if it is just opened
|
|
922
713
|
if (justOpened) {
|
|
923
714
|
var _this$props5 = this.props,
|
|
924
|
-
|
|
925
|
-
|
|
926
|
-
var upload = null;
|
|
715
|
+
userImages = _this$props5.userImages,
|
|
716
|
+
galleryHasImages = _this$props5.galleryHasImages;
|
|
717
|
+
var upload = null;
|
|
927
718
|
|
|
719
|
+
// if no gallery images, default to user upload
|
|
928
720
|
if (!image && !userImages.length && !galleryHasImages) {
|
|
929
721
|
upload = {
|
|
930
722
|
disabled: true
|
|
931
723
|
};
|
|
932
724
|
}
|
|
933
|
-
|
|
934
725
|
this.setUpload(upload);
|
|
935
726
|
}
|
|
936
727
|
}
|
|
@@ -938,38 +729,37 @@ var ImageEditDialogContainer = /*#__PURE__*/function (_React$Component) {
|
|
|
938
729
|
key: "render",
|
|
939
730
|
value: function render() {
|
|
940
731
|
var _this2 = this;
|
|
941
|
-
|
|
942
732
|
var _this$props6 = this.props,
|
|
943
|
-
|
|
944
|
-
|
|
945
|
-
|
|
946
|
-
|
|
947
|
-
|
|
948
|
-
|
|
949
|
-
|
|
950
|
-
|
|
951
|
-
|
|
952
|
-
|
|
953
|
-
|
|
954
|
-
|
|
955
|
-
|
|
956
|
-
|
|
957
|
-
|
|
958
|
-
|
|
959
|
-
|
|
960
|
-
|
|
961
|
-
|
|
962
|
-
|
|
733
|
+
loading = _this$props6.loading,
|
|
734
|
+
ProgressComponent = _this$props6.ProgressComponent,
|
|
735
|
+
errorCode = _this$props6.errorCode,
|
|
736
|
+
colorPalettes = _this$props6.colorPalettes,
|
|
737
|
+
maxColorAmount = _this$props6.maxColorAmount,
|
|
738
|
+
colorDisabled = _this$props6.colorDisabled,
|
|
739
|
+
vectorsRequired = _this$props6.vectorsRequired,
|
|
740
|
+
vectorizedLogoMandatory = _this$props6.vectorizedLogoMandatory,
|
|
741
|
+
image = _this$props6.image,
|
|
742
|
+
usedColors = _this$props6.usedColors,
|
|
743
|
+
imageColorsWereEdited = _this$props6.imageColorsWereEdited,
|
|
744
|
+
colorPreviewEnabled = _this$props6.colorPreviewEnabled,
|
|
745
|
+
colorPreviewRequirementFulfilled = _this$props6.colorPreviewRequirementFulfilled,
|
|
746
|
+
uploadSize = _this$props6.uploadSize,
|
|
747
|
+
ImageColorizeComponent = _this$props6.ImageColorizeComponent,
|
|
748
|
+
ImageUploadComponent = _this$props6.ImageUploadComponent,
|
|
749
|
+
customControlElements = _this$props6.customControlElements,
|
|
750
|
+
checkOwnership = _this$props6.checkOwnership,
|
|
751
|
+
designProductionMethod = _this$props6.designProductionMethod,
|
|
752
|
+
client = _this$props6.client;
|
|
963
753
|
var _this$state3 = this.state,
|
|
964
|
-
|
|
965
|
-
|
|
966
|
-
|
|
967
|
-
|
|
968
|
-
|
|
969
|
-
|
|
970
|
-
|
|
971
|
-
|
|
972
|
-
|
|
754
|
+
preview = _this$state3.preview,
|
|
755
|
+
clipping = _this$state3.clipping,
|
|
756
|
+
vectorize = _this$state3.vectorize,
|
|
757
|
+
vectorizeColorsMap = _this$state3.vectorizeColorsMap,
|
|
758
|
+
activeTabIndex = _this$state3.activeTabIndex,
|
|
759
|
+
colorAmount = _this$state3.colorAmount,
|
|
760
|
+
continueButtonDisabled = _this$state3.continueButtonDisabled,
|
|
761
|
+
originalImagePreview = _this$state3.originalImagePreview,
|
|
762
|
+
upload = _this$state3.upload;
|
|
973
763
|
var isGalleryImage = image && !!image.gallery;
|
|
974
764
|
var showWarningMessage = (0, _Selectors3.showVectorizeImageQuality)(image);
|
|
975
765
|
var aggregatedColors = (0, _Selectors2.getAggregatedColors)(vectorizeColorsMap);
|
|
@@ -1041,7 +831,6 @@ var ImageEditDialogContainer = /*#__PURE__*/function (_React$Component) {
|
|
|
1041
831
|
},
|
|
1042
832
|
onUploadFinished: function onUploadFinished() {
|
|
1043
833
|
_this2.setUpload(null);
|
|
1044
|
-
|
|
1045
834
|
_this2.onActiveTabChange(1);
|
|
1046
835
|
},
|
|
1047
836
|
checkOwnership: checkOwnership
|
|
@@ -1054,55 +843,13 @@ var ImageEditDialogContainer = /*#__PURE__*/function (_React$Component) {
|
|
|
1054
843
|
}));
|
|
1055
844
|
}
|
|
1056
845
|
}]);
|
|
1057
|
-
|
|
1058
846
|
return ImageEditDialogContainer;
|
|
1059
847
|
}(_react["default"].Component);
|
|
1060
|
-
|
|
1061
|
-
exports.ImageEditDialogContainer = ImageEditDialogContainer;
|
|
1062
|
-
|
|
1063
|
-
_defineProperty(ImageEditDialogContainer, "propTypes", {
|
|
1064
|
-
image: _propTypes["default"].object,
|
|
1065
|
-
open: _propTypes["default"].bool,
|
|
1066
|
-
editMode: _propTypes["default"].bool,
|
|
1067
|
-
vectorsRequired: _propTypes["default"].bool,
|
|
1068
|
-
vectorizedLogoMandatory: _propTypes["default"].bool,
|
|
1069
|
-
colorDisabled: _propTypes["default"].bool,
|
|
1070
|
-
loading: _propTypes["default"].bool,
|
|
1071
|
-
errorCode: _propTypes["default"].string,
|
|
1072
|
-
colorPalettes: _propTypes["default"].array,
|
|
1073
|
-
galleryHasImages: _propTypes["default"].bool,
|
|
1074
|
-
hasPlaceHolderImage: _propTypes["default"].bool,
|
|
1075
|
-
displayColorPreview: _propTypes["default"].bool,
|
|
1076
|
-
imageColorsWereEdited: _propTypes["default"].bool,
|
|
1077
|
-
initialColorMaxAmount: _propTypes["default"].number,
|
|
1078
|
-
originalColorsMap: _propTypes["default"].object,
|
|
1079
|
-
colorPreviewRequirementFulfilled: _propTypes["default"].bool,
|
|
1080
|
-
colorPreviewEnabled: _propTypes["default"].bool,
|
|
1081
|
-
userImages: _propTypes["default"].array.isRequired,
|
|
1082
|
-
editFile: _propTypes["default"].func.isRequired,
|
|
1083
|
-
ProgressComponent: _propTypes["default"].elementType.isRequired,
|
|
1084
|
-
maxColorAmount: _propTypes["default"].number.isRequired,
|
|
1085
|
-
usedColors: _propTypes["default"].array.isRequired,
|
|
1086
|
-
addGalleryImageToUserImages: _propTypes["default"].func.isRequired,
|
|
1087
|
-
setSelectedImage: _propTypes["default"].func.isRequired,
|
|
1088
|
-
shouldAddImageImmediately: _propTypes["default"].func.isRequired,
|
|
1089
|
-
isImageCompatible: _propTypes["default"].func.isRequired,
|
|
1090
|
-
isColorMappingCompatible: _propTypes["default"].func.isRequired,
|
|
1091
|
-
resetColorizing: _propTypes["default"].func.isRequired,
|
|
1092
|
-
uploadSize: _propTypes["default"].number,
|
|
1093
|
-
ImageColorizeComponent: _propTypes["default"].elementType,
|
|
1094
|
-
ImageUploadComponent: _propTypes["default"].elementType,
|
|
1095
|
-
customControlElements: _propTypes["default"].oneOfType([_propTypes["default"].arrayOf(_propTypes["default"].node), _propTypes["default"].node]),
|
|
1096
|
-
checkOwnership: _propTypes["default"].bool,
|
|
1097
|
-
client: _propTypes["default"].object
|
|
1098
|
-
});
|
|
1099
|
-
|
|
1100
848
|
_defineProperty(ImageEditDialogContainer, "defaultProps", {
|
|
1101
849
|
colorPreviewRequirementFulfilled: false,
|
|
1102
850
|
colorPreviewEnabled: false,
|
|
1103
851
|
checkOwnership: true
|
|
1104
852
|
});
|
|
1105
|
-
|
|
1106
853
|
var getUserImages = (0, _createSelector["default"])(function (imageGalleryState) {
|
|
1107
854
|
return imageGalleryState.userImages;
|
|
1108
855
|
}, function (images) {
|
|
@@ -1116,10 +863,9 @@ var getUserImages = (0, _createSelector["default"])(function (imageGalleryState)
|
|
|
1116
863
|
});
|
|
1117
864
|
});
|
|
1118
865
|
});
|
|
1119
|
-
|
|
1120
866
|
var mapStateToProps = function mapStateToProps(state) {
|
|
1121
867
|
var ui = state.ui,
|
|
1122
|
-
|
|
868
|
+
imageGallery = state.imageGallery;
|
|
1123
869
|
var colorPalettes = (0, _Selectors.getColorPalettes)(state);
|
|
1124
870
|
var designProductionMethod = (0, _Selectors.getSelectedDesignProductionMethod)(state);
|
|
1125
871
|
var vectorsRequired = !!(0, _get["default"])(designProductionMethod, 'options.vectorsRequired');
|
|
@@ -1173,7 +919,6 @@ var mapStateToProps = function mapStateToProps(state) {
|
|
|
1173
919
|
client: client
|
|
1174
920
|
};
|
|
1175
921
|
};
|
|
1176
|
-
|
|
1177
922
|
var mapDispatchToProps = function mapDispatchToProps(dispatch) {
|
|
1178
923
|
return {
|
|
1179
924
|
editFile: function editFile(operations, image) {
|
|
@@ -1202,7 +947,4 @@ var mapDispatchToProps = function mapDispatchToProps(dispatch) {
|
|
|
1202
947
|
}
|
|
1203
948
|
};
|
|
1204
949
|
};
|
|
1205
|
-
|
|
1206
|
-
var _default = (0, _ComponentContainer["default"])(mapStateToProps, mapDispatchToProps);
|
|
1207
|
-
|
|
1208
|
-
exports["default"] = _default;
|
|
950
|
+
var _default = exports["default"] = (0, _ComponentContainer["default"])(mapStateToProps, mapDispatchToProps);
|