@configuratorware/configurator-frontendgui 1.41.1 → 1.42.1
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 +21 -13
- 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
|
@@ -44,6 +44,7 @@ var _exportNames = {
|
|
|
44
44
|
designProductionMethodHasEmbroideryVisualizationEffect: true,
|
|
45
45
|
designProductionMethodHasEngravingVisualizationEffect: true,
|
|
46
46
|
getEngravingBackgroundColor: true,
|
|
47
|
+
getColorOverlayData: true,
|
|
47
48
|
getVisualizationEffectWithOptions: true,
|
|
48
49
|
getColorPalettes: true,
|
|
49
50
|
getColors: true,
|
|
@@ -82,101 +83,87 @@ var _exportNames = {
|
|
|
82
83
|
getImagesByDesignArea: true,
|
|
83
84
|
isOneLineText: true
|
|
84
85
|
};
|
|
85
|
-
exports.
|
|
86
|
+
exports.createColorData = exports.contentHasText = exports.calculateColorDistance = exports.areHashesCompatible = exports.areAllDesignAreasEmpty = void 0;
|
|
87
|
+
exports.designProductionMethodHasEmbroideryVisualizationEffect = designProductionMethodHasEmbroideryVisualizationEffect;
|
|
88
|
+
exports.designProductionMethodHasEngravingVisualizationEffect = designProductionMethodHasEngravingVisualizationEffect;
|
|
89
|
+
exports.findSmallestFontSizeInCanvasData = findSmallestFontSizeInCanvasData;
|
|
90
|
+
exports.get2DMaxZoom = get2DMaxZoom;
|
|
91
|
+
exports.getActiveDesignAreas = getActiveDesignAreas;
|
|
92
|
+
exports.getAvailableColorsForDesignProductionMethod = getAvailableColorsForDesignProductionMethod;
|
|
93
|
+
exports.getCameraViewListForDesignAreaList = void 0;
|
|
94
|
+
exports.getCanvasSizeFromDesignArea = getCanvasSizeFromDesignArea;
|
|
95
|
+
exports.getCanvasSizeFromDesignProductionMethod = getCanvasSizeFromDesignProductionMethod;
|
|
96
|
+
exports.getColorOverlayData = getColorOverlayData;
|
|
97
|
+
exports.getColorPalettes = void 0;
|
|
98
|
+
exports.getColors = getColors;
|
|
99
|
+
exports.getColorsFromCanvasData = getColorsFromCanvasData;
|
|
100
|
+
exports.getColorsFromCanvasDataWithPalette = getColorsFromCanvasDataWithPalette;
|
|
101
|
+
exports.getColorsWithPalette = getColorsWithPalette;
|
|
102
|
+
exports.getCurrentCanvasSize = getCurrentCanvasSize;
|
|
103
|
+
exports.getDesignAreaPreSelection = exports.getDesignAreaImageCompatibilityInfo = exports.getDesignAreaIdentifierToOpen = exports.getDesignAreaFromSelectedDesignView = exports.getDesignAreaColorAmount = exports.getDefaultTextColor = exports.getDefaultDesignAreaIdentifierFromProductionMethod = exports.getDefaultColorsFromDesignProductionMethod = exports.getCurrentCompatibilityInfoHash = void 0;
|
|
86
104
|
exports.getDesignDataByDesignAreaIdentifier = getDesignDataByDesignAreaIdentifier;
|
|
87
105
|
exports.getDesignDataColorAmounts = getDesignDataColorAmounts;
|
|
88
|
-
exports.getUsedColorsForDesignAreas = getUsedColorsForDesignAreas;
|
|
89
|
-
exports.getAvailableColorsForDesignProductionMethod = getAvailableColorsForDesignProductionMethod;
|
|
90
|
-
exports.getDesignDataUsedColors = getDesignDataUsedColors;
|
|
91
|
-
exports.getPreviousEditedDesignAreaIdentifier = getPreviousEditedDesignAreaIdentifier;
|
|
92
|
-
exports.getFirstEditedDesignAreafromDesignData = getFirstEditedDesignAreafromDesignData;
|
|
93
106
|
exports.getDesignDataForFilteredDesignAreas = getDesignDataForFilteredDesignAreas;
|
|
94
107
|
exports.getDesignDataForSelectedDesignArea = getDesignDataForSelectedDesignArea;
|
|
95
|
-
exports.
|
|
96
|
-
exports.isActiveBulkName = isActiveBulkName;
|
|
97
|
-
exports.isBulkNamesSelected = isBulkNamesSelected;
|
|
98
|
-
exports.isCanvasUpdateRequired = isCanvasUpdateRequired;
|
|
99
|
-
exports.hasSelectedBulkName = hasSelectedBulkName;
|
|
100
|
-
exports.getSelectedDesignProductionMethodIdentifier = getSelectedDesignProductionMethodIdentifier;
|
|
101
|
-
exports.getSelectedDesignProductionMethodForDesignArea = getSelectedDesignProductionMethodForDesignArea;
|
|
108
|
+
exports.getDesignDataUsedColors = getDesignDataUsedColors;
|
|
102
109
|
exports.getDesignProductionMethodByIdentifier = getDesignProductionMethodByIdentifier;
|
|
103
|
-
exports.
|
|
104
|
-
exports.
|
|
110
|
+
exports.getDesignProductionMethods = getDesignProductionMethods;
|
|
111
|
+
exports.getDesignViewListForDesignAreas = void 0;
|
|
112
|
+
exports.getElementLockState = getElementLockState;
|
|
113
|
+
exports.getEngravingBackgroundColor = getEngravingBackgroundColor;
|
|
114
|
+
exports.getFirstEditedDesignAreafromDesignData = getFirstEditedDesignAreafromDesignData;
|
|
115
|
+
exports.getFontSizeMin = getFontSizeMin;
|
|
116
|
+
exports.getMandatoryVectorizationForDesignProductionMethods = exports.getImagesByDesignArea = void 0;
|
|
117
|
+
exports.getMaxUploadSize = getMaxUploadSize;
|
|
118
|
+
exports.getPreviousEditedDesignAreaIdentifier = getPreviousEditedDesignAreaIdentifier;
|
|
105
119
|
exports.getSelectedDesignArea = getSelectedDesignArea;
|
|
106
|
-
exports.
|
|
107
|
-
exports.
|
|
120
|
+
exports.getSelectedDesignAreaProperties = getSelectedDesignAreaProperties;
|
|
121
|
+
exports.getSelectedDesignProductionMethod = getSelectedDesignProductionMethod;
|
|
122
|
+
exports.getSelectedDesignProductionMethodForDesignArea = getSelectedDesignProductionMethodForDesignArea;
|
|
123
|
+
exports.getSelectedDesignProductionMethodIdentifier = getSelectedDesignProductionMethodIdentifier;
|
|
108
124
|
exports.getSelectedViewName = getSelectedViewName;
|
|
109
|
-
exports.
|
|
110
|
-
exports.
|
|
111
|
-
exports.get2DMaxZoom = get2DMaxZoom;
|
|
112
|
-
exports.getCurrentCanvasSize = getCurrentCanvasSize;
|
|
113
|
-
exports.getCanvasSizeFromDesignProductionMethod = getCanvasSizeFromDesignProductionMethod;
|
|
114
|
-
exports.getCanvasSizeFromDesignArea = getCanvasSizeFromDesignArea;
|
|
115
|
-
exports.getFontSizeMin = getFontSizeMin;
|
|
116
|
-
exports.getElementLockState = getElementLockState;
|
|
117
|
-
exports.hasEngravingBackgroundColor = hasEngravingBackgroundColor;
|
|
118
|
-
exports.isColoringDisabled = isColoringDisabled;
|
|
125
|
+
exports.getUsedColorsForDesignAreas = getUsedColorsForDesignAreas;
|
|
126
|
+
exports.getVectorizedImageColor = exports.getVectorizeForDesignProductionMethods = void 0;
|
|
119
127
|
exports.getVisualizationEffect = getVisualizationEffect;
|
|
120
|
-
exports.designProductionMethodHasEmbroideryVisualizationEffect = designProductionMethodHasEmbroideryVisualizationEffect;
|
|
121
|
-
exports.designProductionMethodHasEngravingVisualizationEffect = designProductionMethodHasEngravingVisualizationEffect;
|
|
122
|
-
exports.getEngravingBackgroundColor = getEngravingBackgroundColor;
|
|
123
128
|
exports.getVisualizationEffectWithOptions = getVisualizationEffectWithOptions;
|
|
124
|
-
exports.
|
|
125
|
-
exports.
|
|
126
|
-
exports.
|
|
127
|
-
exports.
|
|
128
|
-
exports.
|
|
129
|
+
exports.hasEngravingBackgroundColor = hasEngravingBackgroundColor;
|
|
130
|
+
exports.hasPlaceHolderImagesForActiveDesignArea = exports.hasLastEditedDesignArea = void 0;
|
|
131
|
+
exports.hasSelectedBulkName = hasSelectedBulkName;
|
|
132
|
+
exports.hexToRgbNumbers = exports.hexToRgb = void 0;
|
|
133
|
+
exports.isActiveBulkName = isActiveBulkName;
|
|
134
|
+
exports.isAnyDesignAreaSelected = isAnyDesignAreaSelected;
|
|
135
|
+
exports.isBulkNamesSelected = isBulkNamesSelected;
|
|
136
|
+
exports.isCanvasUpdateRequired = isCanvasUpdateRequired;
|
|
137
|
+
exports.isColoringDisabled = isColoringDisabled;
|
|
138
|
+
exports.isHighlighted = isHighlighted;
|
|
129
139
|
exports.isOneLineText = isOneLineText;
|
|
130
|
-
exports.
|
|
131
|
-
|
|
140
|
+
exports.isPlaceholderContent = void 0;
|
|
141
|
+
exports.isThereAFatalError = isThereAFatalError;
|
|
142
|
+
exports.rgbToHex = exports.rgbString2hex = exports.rgbObjToHex = exports.parseColorData = exports.isVectorizedLogoMandatory = exports.isValidHex = void 0;
|
|
132
143
|
var _get = _interopRequireDefault(require("lodash/get"));
|
|
133
|
-
|
|
134
144
|
var _first = _interopRequireDefault(require("lodash/first"));
|
|
135
|
-
|
|
136
145
|
var _find2 = _interopRequireDefault(require("lodash/find"));
|
|
137
|
-
|
|
138
146
|
var _findKey = _interopRequireDefault(require("lodash/findKey"));
|
|
139
|
-
|
|
140
147
|
var _uniq = _interopRequireDefault(require("lodash/uniq"));
|
|
141
|
-
|
|
142
148
|
var _uniqWith = _interopRequireDefault(require("lodash/uniqWith"));
|
|
143
|
-
|
|
144
149
|
var _isEmpty = _interopRequireDefault(require("lodash/isEmpty"));
|
|
145
|
-
|
|
146
150
|
var _replace = _interopRequireDefault(require("lodash/replace"));
|
|
147
|
-
|
|
148
151
|
var _isObject = _interopRequireDefault(require("lodash/isObject"));
|
|
149
|
-
|
|
150
152
|
var _uniqBy = _interopRequireDefault(require("lodash/uniqBy"));
|
|
151
|
-
|
|
152
153
|
var _cloneDeep = _interopRequireDefault(require("lodash/cloneDeep"));
|
|
153
|
-
|
|
154
154
|
var _intersectionBy = _interopRequireDefault(require("lodash/intersectionBy"));
|
|
155
|
-
|
|
156
155
|
var _isEqual = _interopRequireDefault(require("lodash/isEqual"));
|
|
157
|
-
|
|
158
156
|
var _values = _interopRequireDefault(require("lodash/values"));
|
|
159
|
-
|
|
160
157
|
var _createSelector = _interopRequireDefault(require("../../../Utils/Function/createSelector"));
|
|
161
|
-
|
|
162
158
|
var _memoize = _interopRequireDefault(require("../../../Utils/Function/memoize"));
|
|
163
|
-
|
|
164
159
|
var _configuration = require("../../configuration");
|
|
165
|
-
|
|
166
160
|
var _DesignDataService = require("../../Services/DesignDataService");
|
|
167
|
-
|
|
168
161
|
var _Selectors = require("../Configurator/Selectors");
|
|
169
|
-
|
|
170
162
|
var _Transformers = require("../DesignView/Transformers");
|
|
171
|
-
|
|
172
163
|
var _Selectors2 = require("../ImageGallery/Selectors");
|
|
173
|
-
|
|
174
164
|
var _Transformers2 = require("./Transformers");
|
|
175
|
-
|
|
176
165
|
var _Actions = require("../UI/Actions");
|
|
177
|
-
|
|
178
166
|
var _MaskSelectors = require("./MaskSelectors");
|
|
179
|
-
|
|
180
167
|
Object.keys(_MaskSelectors).forEach(function (key) {
|
|
181
168
|
if (key === "default" || key === "__esModule") return;
|
|
182
169
|
if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
|
|
@@ -188,117 +175,84 @@ Object.keys(_MaskSelectors).forEach(function (key) {
|
|
|
188
175
|
}
|
|
189
176
|
});
|
|
190
177
|
});
|
|
191
|
-
|
|
192
178
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
|
193
|
-
|
|
194
179
|
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
195
|
-
|
|
196
180
|
function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
197
|
-
|
|
198
|
-
function _iterableToArrayLimit(arr, i) { var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"]; if (_i == null) return; var _arr = []; var _n = true; var _d = false; var _s, _e; try { for (_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"] != null) _i["return"](); } finally { if (_d) throw _e; } } return _arr; }
|
|
199
|
-
|
|
181
|
+
function _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t["return"] && (u = t["return"](), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } }
|
|
200
182
|
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
201
|
-
|
|
202
183
|
function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }
|
|
203
|
-
|
|
204
184
|
function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
205
|
-
|
|
206
185
|
function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); }
|
|
207
|
-
|
|
208
186
|
function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }
|
|
209
|
-
|
|
210
|
-
function
|
|
211
|
-
|
|
212
|
-
function
|
|
213
|
-
|
|
214
|
-
function
|
|
215
|
-
|
|
216
|
-
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
217
|
-
|
|
218
|
-
function _createForOfIteratorHelper(o, allowArrayLike) { var it = typeof Symbol !== "undefined" && o[Symbol.iterator] || o["@@iterator"]; if (!it) { if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") { if (it) o = it; var i = 0; var F = function F() {}; return { s: F, n: function n() { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }, e: function e(_e2) { throw _e2; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var normalCompletion = true, didErr = false, err; return { s: function s() { it = it.call(o); }, n: function n() { var step = it.next(); normalCompletion = step.done; return step; }, e: function e(_e3) { didErr = true; err = _e3; }, f: function f() { try { if (!normalCompletion && it["return"] != null) it["return"](); } finally { if (didErr) throw err; } } }; }
|
|
219
|
-
|
|
187
|
+
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); }
|
|
188
|
+
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; }
|
|
189
|
+
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; }
|
|
190
|
+
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; }
|
|
191
|
+
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
|
|
192
|
+
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); }
|
|
193
|
+
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; } } }; }
|
|
220
194
|
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); }
|
|
221
|
-
|
|
222
|
-
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; }
|
|
223
|
-
|
|
195
|
+
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; }
|
|
224
196
|
function getDesignProductionMethods(state) {
|
|
225
197
|
return (0, _get["default"])(state, 'designArea.selectedDesignArea.designProductionMethods');
|
|
226
198
|
}
|
|
227
|
-
|
|
228
199
|
function getDesignDataByDesignAreaIdentifier(_ref, designAreaIdentifier) {
|
|
229
200
|
var configurator = _ref.configurator;
|
|
230
201
|
var configuration = configurator.configuration;
|
|
231
202
|
return (0, _get["default"])(configuration, "designdata.".concat(designAreaIdentifier), {});
|
|
232
203
|
}
|
|
233
|
-
|
|
234
204
|
function getDesignDataColorAmounts(_ref2) {
|
|
235
205
|
var configurator = _ref2.configurator;
|
|
236
206
|
var configuration = configurator.configuration;
|
|
237
207
|
var designdata = (0, _get["default"])(configuration, 'designdata', {});
|
|
238
208
|
var colorAmounts = {};
|
|
239
|
-
|
|
240
209
|
for (var key in designdata) {
|
|
241
210
|
if (!designdata.hasOwnProperty(key)) {
|
|
242
211
|
continue;
|
|
243
212
|
}
|
|
244
|
-
|
|
245
213
|
colorAmounts[key] = designdata[key].colorAmount;
|
|
246
214
|
}
|
|
247
|
-
|
|
248
215
|
return colorAmounts;
|
|
249
216
|
}
|
|
250
|
-
|
|
251
217
|
function getUsedColorsForDesignAreas(state) {
|
|
252
218
|
var designdata = (0, _get["default"])(state, 'configurator.configuration.designdata', {});
|
|
253
219
|
var colors = [];
|
|
254
|
-
|
|
255
220
|
for (var key in designdata) {
|
|
256
221
|
if (!designdata.hasOwnProperty(key)) {
|
|
257
222
|
continue;
|
|
258
223
|
}
|
|
259
|
-
|
|
260
224
|
if (!(0, _isEmpty["default"])(designdata[key].canvasData)) {
|
|
261
225
|
var _iterator = _createForOfIteratorHelper(designdata[key].canvasData.objects),
|
|
262
|
-
|
|
263
|
-
|
|
226
|
+
_step;
|
|
264
227
|
try {
|
|
265
228
|
for (_iterator.s(); !(_step = _iterator.n()).done;) {
|
|
266
229
|
var object = _step.value;
|
|
267
230
|
var objectColors = void 0;
|
|
268
|
-
|
|
269
231
|
if (object.type === 'Image') {
|
|
270
232
|
objectColors = (0, _values["default"])((0, _get["default"])(object, 'imageData.operations.vectorizeColorsMap')) || [];
|
|
271
233
|
} else if (object.type === 'Text') {
|
|
272
234
|
objectColors = object.style.colors;
|
|
273
235
|
}
|
|
274
|
-
|
|
275
236
|
var _iterator2 = _createForOfIteratorHelper(objectColors),
|
|
276
|
-
|
|
277
|
-
|
|
237
|
+
_step2;
|
|
278
238
|
try {
|
|
279
239
|
for (_iterator2.s(); !(_step2 = _iterator2.n()).done;) {
|
|
280
240
|
var colorObj = _step2.value;
|
|
281
|
-
|
|
282
241
|
var color = _objectSpread({}, colorObj);
|
|
283
|
-
|
|
284
242
|
var colorData = color.identifier;
|
|
285
|
-
|
|
286
243
|
try {
|
|
287
244
|
colorData = JSON.parse(color.identifier);
|
|
288
245
|
} catch (e) {
|
|
289
246
|
// eslint-disable-next-line no-console
|
|
290
247
|
console.error("failed to parse color data: ".concat(color.identifier));
|
|
291
248
|
}
|
|
292
|
-
|
|
293
249
|
if ((0, _isObject["default"])(colorData) && colorData.custom) {
|
|
294
250
|
continue;
|
|
295
251
|
}
|
|
296
|
-
|
|
297
252
|
if ((0, _isObject["default"])(colorData)) {
|
|
298
253
|
color.identifier = colorData.color;
|
|
299
254
|
color.palette = colorData.palette;
|
|
300
255
|
}
|
|
301
|
-
|
|
302
256
|
var isColorValueHex = isValidHex(color.value);
|
|
303
257
|
color.hex_value = (0, _replace["default"])(isColorValueHex ? color.value : rgbString2hex(color.value), '#', '');
|
|
304
258
|
colors.push(color);
|
|
@@ -316,21 +270,17 @@ function getUsedColorsForDesignAreas(state) {
|
|
|
316
270
|
}
|
|
317
271
|
}
|
|
318
272
|
}
|
|
319
|
-
|
|
320
273
|
return (0, _uniqBy["default"])(colors, 'identifier');
|
|
321
274
|
}
|
|
322
|
-
|
|
323
275
|
function getAvailableColorsForDesignProductionMethod(productionMethod) {
|
|
324
276
|
var _ref4;
|
|
325
|
-
|
|
326
277
|
if (!productionMethod || _typeof(productionMethod) !== 'object') {
|
|
327
278
|
return [];
|
|
328
279
|
}
|
|
329
|
-
|
|
330
280
|
var colorPalettes = productionMethod.colorPalettes;
|
|
331
281
|
var colorsArray = colorPalettes.map(function (_ref3) {
|
|
332
282
|
var identifier = _ref3.identifier,
|
|
333
|
-
|
|
283
|
+
colors = _ref3.colors;
|
|
334
284
|
return colors.map(function (color) {
|
|
335
285
|
return _objectSpread(_objectSpread({}, color), {}, {
|
|
336
286
|
paletteIdentifier: identifier
|
|
@@ -339,19 +289,16 @@ function getAvailableColorsForDesignProductionMethod(productionMethod) {
|
|
|
339
289
|
});
|
|
340
290
|
return (_ref4 = []).concat.apply(_ref4, _toConsumableArray(colorsArray));
|
|
341
291
|
}
|
|
342
|
-
|
|
343
292
|
function getDesignDataUsedColors(state) {
|
|
344
293
|
var usedColors = getUsedColorsForDesignAreas(state);
|
|
345
294
|
var prodMethodColors = getAvailableColorsForDesignProductionMethod(getSelectedDesignProductionMethod(state));
|
|
346
295
|
return (0, _intersectionBy["default"])(usedColors, prodMethodColors, 'identifier');
|
|
347
296
|
}
|
|
348
|
-
|
|
349
297
|
function getPreviousEditedDesignAreaIdentifier(state) {
|
|
350
298
|
var previousEditedDesignArea = state.designArea.previousEditedDesignArea;
|
|
351
299
|
return previousEditedDesignArea.identifier;
|
|
352
300
|
}
|
|
353
|
-
|
|
354
|
-
var getDesignAreaIdentifierToOpen = function getDesignAreaIdentifierToOpen(state) {
|
|
301
|
+
var getDesignAreaIdentifierToOpen = exports.getDesignAreaIdentifierToOpen = function getDesignAreaIdentifierToOpen(state) {
|
|
355
302
|
var identifier = state.designArea.selectedDesignArea.identifier;
|
|
356
303
|
var previousEditedDesignAreaIdentifier = getPreviousEditedDesignAreaIdentifier(state);
|
|
357
304
|
var firstEditedDesignAreafromDesignData = getFirstEditedDesignAreafromDesignData(state);
|
|
@@ -359,9 +306,6 @@ var getDesignAreaIdentifierToOpen = function getDesignAreaIdentifierToOpen(state
|
|
|
359
306
|
var defaultDesignAreaFromProductionMethod = getDefaultDesignAreaIdentifierFromProductionMethod(state);
|
|
360
307
|
return identifier || previousEditedDesignAreaIdentifier || firstEditedDesignAreafromDesignData || designAreaFromSelectedDesignView || defaultDesignAreaFromProductionMethod || null;
|
|
361
308
|
};
|
|
362
|
-
|
|
363
|
-
exports.getDesignAreaIdentifierToOpen = getDesignAreaIdentifierToOpen;
|
|
364
|
-
|
|
365
309
|
function getFirstEditedDesignAreafromDesignData(state) {
|
|
366
310
|
var designdata = state.configurator.configuration.designdata;
|
|
367
311
|
var editedDesignAreaIdentifier = (0, _findKey["default"])(designdata, function (_ref5) {
|
|
@@ -370,7 +314,6 @@ function getFirstEditedDesignAreafromDesignData(state) {
|
|
|
370
314
|
});
|
|
371
315
|
return editedDesignAreaIdentifier;
|
|
372
316
|
}
|
|
373
|
-
|
|
374
317
|
function getDesignDataForFilteredDesignAreas(state) {
|
|
375
318
|
var filteredDesignAreas = state.designArea.filteredDesignAreas;
|
|
376
319
|
var hasDesign = {};
|
|
@@ -379,17 +322,13 @@ function getDesignDataForFilteredDesignAreas(state) {
|
|
|
379
322
|
});
|
|
380
323
|
return hasDesign;
|
|
381
324
|
}
|
|
382
|
-
|
|
383
325
|
function getDesignDataForSelectedDesignArea(state) {
|
|
384
326
|
var selectedDesignArea = (0, _get["default"])(state, 'designArea.selectedDesignArea');
|
|
385
|
-
|
|
386
327
|
if (!selectedDesignArea) {
|
|
387
328
|
return {};
|
|
388
329
|
}
|
|
389
|
-
|
|
390
330
|
return getDesignDataByDesignAreaIdentifier(state, selectedDesignArea.identifier);
|
|
391
331
|
}
|
|
392
|
-
|
|
393
332
|
function getSelectedDesignProductionMethod(state) {
|
|
394
333
|
var designProductionMethods = getDesignProductionMethods(state);
|
|
395
334
|
var designAreaData = getDesignDataForSelectedDesignArea(state);
|
|
@@ -398,26 +337,20 @@ function getSelectedDesignProductionMethod(state) {
|
|
|
398
337
|
identifier: designProductionMethodIdentifier
|
|
399
338
|
}) || (0, _first["default"])(designProductionMethods);
|
|
400
339
|
}
|
|
401
|
-
|
|
402
340
|
function isActiveBulkName(state) {
|
|
403
341
|
var designArea = state.designArea;
|
|
404
342
|
var designedAreas = (0, _get["default"])(designArea, 'filteredDesignAreas', []);
|
|
405
|
-
|
|
406
343
|
var _iterator3 = _createForOfIteratorHelper(designedAreas),
|
|
407
|
-
|
|
408
|
-
|
|
344
|
+
_step3;
|
|
409
345
|
try {
|
|
410
346
|
for (_iterator3.s(); !(_step3 = _iterator3.n()).done;) {
|
|
411
347
|
var da = _step3.value;
|
|
412
|
-
|
|
413
348
|
if (da.designProductionMethods && da.designProductionMethods.length > 0) {
|
|
414
349
|
var _iterator4 = _createForOfIteratorHelper(da.designProductionMethods),
|
|
415
|
-
|
|
416
|
-
|
|
350
|
+
_step4;
|
|
417
351
|
try {
|
|
418
352
|
for (_iterator4.s(); !(_step4 = _iterator4.n()).done;) {
|
|
419
353
|
var designProductionMethod = _step4.value;
|
|
420
|
-
|
|
421
354
|
if (designProductionMethod.allowBulkNames) {
|
|
422
355
|
return true;
|
|
423
356
|
}
|
|
@@ -434,25 +367,19 @@ function isActiveBulkName(state) {
|
|
|
434
367
|
} finally {
|
|
435
368
|
_iterator3.f();
|
|
436
369
|
}
|
|
437
|
-
|
|
438
370
|
return false;
|
|
439
371
|
}
|
|
440
|
-
|
|
441
372
|
function isBulkNamesSelected(configuratorState) {
|
|
442
373
|
var configuration = configuratorState.configuration;
|
|
443
374
|
var designData = (0, _get["default"])(configuration, 'designdata', {}) || {};
|
|
444
|
-
|
|
445
375
|
for (var _i = 0, _Object$values = Object.values(designData); _i < _Object$values.length; _i++) {
|
|
446
376
|
var dd = _Object$values[_i];
|
|
447
|
-
|
|
448
377
|
if (dd.canvasData && dd.canvasData.objects.length > 0) {
|
|
449
378
|
var _iterator5 = _createForOfIteratorHelper(dd.canvasData.objects),
|
|
450
|
-
|
|
451
|
-
|
|
379
|
+
_step5;
|
|
452
380
|
try {
|
|
453
381
|
for (_iterator5.s(); !(_step5 = _iterator5.n()).done;) {
|
|
454
382
|
var object = _step5.value;
|
|
455
|
-
|
|
456
383
|
if (object.isBulkName) {
|
|
457
384
|
return true;
|
|
458
385
|
}
|
|
@@ -464,64 +391,52 @@ function isBulkNamesSelected(configuratorState) {
|
|
|
464
391
|
}
|
|
465
392
|
}
|
|
466
393
|
}
|
|
467
|
-
|
|
468
394
|
return false;
|
|
469
395
|
}
|
|
470
|
-
|
|
471
396
|
function isCanvasUpdateRequired(_ref6, _ref7) {
|
|
472
397
|
var position = _ref6.position;
|
|
473
398
|
var width = _ref7.width,
|
|
474
|
-
|
|
399
|
+
height = _ref7.height;
|
|
475
400
|
return position.width !== width || position.height !== height;
|
|
476
401
|
}
|
|
477
|
-
|
|
478
402
|
function hasSelectedBulkName(designArea) {
|
|
479
403
|
var canvasDataObjs = (0, _get["default"])(designArea, 'canvasData.objects', []);
|
|
480
404
|
return canvasDataObjs.filter(function (obj) {
|
|
481
405
|
return obj.type === 'Text' && obj.isBulkName;
|
|
482
406
|
}).length > 0;
|
|
483
407
|
}
|
|
484
|
-
|
|
485
408
|
function getSelectedDesignProductionMethodIdentifier(state) {
|
|
486
409
|
var configuration = state.configurator.configuration,
|
|
487
|
-
|
|
410
|
+
selectedDesignArea = state.designArea.selectedDesignArea;
|
|
488
411
|
return (0, _get["default"])(configuration, "designdata.".concat(selectedDesignArea.identifier, ".designProductionMethodIdentifier"));
|
|
489
412
|
}
|
|
490
|
-
|
|
491
413
|
function getSelectedDesignProductionMethodForDesignArea(state, designArea) {
|
|
492
414
|
var designProductionMethods = designArea.designProductionMethods;
|
|
493
415
|
var designAreaData = getDesignDataByDesignAreaIdentifier(state, designArea.identifier);
|
|
494
|
-
|
|
495
416
|
var _ref8 = designAreaData || {},
|
|
496
|
-
|
|
497
|
-
|
|
417
|
+
designProductionMethodIdentifier = _ref8.designProductionMethodIdentifier;
|
|
498
418
|
return (0, _find2["default"])(designProductionMethods, {
|
|
499
419
|
identifier: designProductionMethodIdentifier
|
|
500
420
|
}) || (0, _find2["default"])(designProductionMethods, {
|
|
501
421
|
isDefault: true
|
|
502
422
|
}) || (0, _first["default"])(designProductionMethods);
|
|
503
423
|
}
|
|
504
|
-
|
|
505
424
|
function getDesignProductionMethodByIdentifier(state, identifier) {
|
|
506
425
|
var designProductionMethods = getDesignProductionMethods(state);
|
|
507
426
|
return (0, _find2["default"])(designProductionMethods, {
|
|
508
427
|
identifier: identifier
|
|
509
428
|
});
|
|
510
429
|
}
|
|
511
|
-
|
|
512
430
|
function getSelectedDesignAreaProperties(state) {
|
|
513
431
|
var designArea = state.designArea;
|
|
514
432
|
var filteredDesignAreas = designArea.filteredDesignAreas,
|
|
515
|
-
|
|
516
|
-
|
|
433
|
+
selectedDesignArea = designArea.selectedDesignArea;
|
|
517
434
|
if (!filteredDesignAreas || !selectedDesignArea) {
|
|
518
435
|
return {};
|
|
519
436
|
}
|
|
520
|
-
|
|
521
437
|
if (!selectedDesignArea) {
|
|
522
438
|
return {};
|
|
523
439
|
}
|
|
524
|
-
|
|
525
440
|
var designAreaData = getDesignDataForSelectedDesignArea(state);
|
|
526
441
|
var colorAmount = designAreaData.colorAmount;
|
|
527
442
|
var designProductionMethod = getSelectedDesignProductionMethod(state);
|
|
@@ -536,7 +451,6 @@ function getSelectedDesignAreaProperties(state) {
|
|
|
536
451
|
selectedDesignArea: selectedDesignArea
|
|
537
452
|
};
|
|
538
453
|
}
|
|
539
|
-
|
|
540
454
|
function getActiveDesignAreas(state) {
|
|
541
455
|
var filteredDesignAreas = state.designArea.filteredDesignAreas;
|
|
542
456
|
return filteredDesignAreas.reduce(function (obj, designArea) {
|
|
@@ -544,83 +458,70 @@ function getActiveDesignAreas(state) {
|
|
|
544
458
|
return _objectSpread(_objectSpread({}, obj), {}, _defineProperty({}, designArea.identifier, (0, _get["default"])(designData, 'canvasData.objects.length', 0) > 0));
|
|
545
459
|
}, {});
|
|
546
460
|
}
|
|
547
|
-
|
|
548
461
|
function getSelectedDesignArea(state) {
|
|
549
462
|
return (0, _get["default"])(state, 'designArea.selectedDesignArea');
|
|
550
463
|
}
|
|
551
|
-
|
|
552
464
|
function isAnyDesignAreaSelected(state) {
|
|
553
465
|
return Object.keys(getSelectedDesignArea(state)).length > 0;
|
|
554
466
|
}
|
|
555
|
-
|
|
556
467
|
function isIt500Error(_ref9) {
|
|
557
468
|
var error = _ref9.ui.error;
|
|
558
469
|
return error && error.response && error.response.status === 500;
|
|
559
470
|
}
|
|
560
|
-
|
|
561
471
|
function isConfigurationNotFound(_ref10) {
|
|
562
472
|
var error = _ref10.ui.error;
|
|
563
473
|
return error && error.source && error.response && error.response.status === 404 && ['loadbyitemidentifier', 'getconfigurationvariants'].indexOf((error.source.url || error.source).split('/')[1]) !== -1 || error && error.type === _Actions.CONFIGURATION_NOT_FOUND_ERROR;
|
|
564
474
|
}
|
|
565
|
-
|
|
566
475
|
function isThereAFatalError(state) {
|
|
567
476
|
return isIt500Error(state) || isConfigurationNotFound(state);
|
|
568
477
|
}
|
|
569
|
-
|
|
570
478
|
function getSelectedViewName(designArea) {
|
|
571
|
-
return (0, _get["default"])(designArea, 'customData.selectedCameraView') ||
|
|
572
|
-
|
|
573
|
-
(0, _get["default"])(designArea, 'identifier') ||
|
|
479
|
+
return (0, _get["default"])(designArea, 'customData.selectedCameraView') ||
|
|
480
|
+
// used by the 3D camera positions
|
|
481
|
+
(0, _get["default"])(designArea, 'designView.identifier') ||
|
|
482
|
+
// used by the 2D design view associations
|
|
483
|
+
(0, _get["default"])(designArea, 'identifier') ||
|
|
484
|
+
// fallback to the design area identifier (currently no known use case)
|
|
574
485
|
'default' // if no design area selected use the default view
|
|
575
486
|
;
|
|
576
487
|
}
|
|
577
488
|
|
|
578
|
-
var hasPlaceHolderImagesForActiveDesignArea = function hasPlaceHolderImagesForActiveDesignArea(state) {
|
|
489
|
+
var hasPlaceHolderImagesForActiveDesignArea = exports.hasPlaceHolderImagesForActiveDesignArea = function hasPlaceHolderImagesForActiveDesignArea(state) {
|
|
579
490
|
var designData = getDesignDataForSelectedDesignArea(state);
|
|
580
491
|
var canvasObjects = (0, _get["default"])(designData, 'canvasData.objects') || null;
|
|
581
492
|
return canvasObjects && !!canvasObjects.find(function (object) {
|
|
582
493
|
return object.type === 'Image' && object.imageData.isPlaceHolderImage;
|
|
583
494
|
});
|
|
584
495
|
};
|
|
585
|
-
|
|
586
|
-
exports.hasPlaceHolderImagesForActiveDesignArea = hasPlaceHolderImagesForActiveDesignArea;
|
|
587
|
-
|
|
588
496
|
function isHighlighted(state) {
|
|
589
497
|
return (0, _get["default"])(state, 'designArea.showHighlight') || false;
|
|
590
498
|
}
|
|
591
|
-
|
|
592
499
|
function getMaxUploadSize(state) {
|
|
593
500
|
return (0, _get["default"])(state, 'designArea.uploadMaxSize') || 20000000;
|
|
594
501
|
}
|
|
595
|
-
|
|
596
502
|
function get2DMaxZoom(state) {
|
|
597
503
|
return (0, _get["default"])(state, 'designArea.maxZoom2d') || 2.0;
|
|
598
504
|
}
|
|
599
|
-
|
|
600
505
|
var zeroSize = {
|
|
601
506
|
width: 0,
|
|
602
507
|
height: 0
|
|
603
508
|
};
|
|
509
|
+
|
|
604
510
|
/**
|
|
605
511
|
* Returns the canvas size in mm-s
|
|
606
512
|
* @param state
|
|
607
513
|
* @param defaultSize
|
|
608
514
|
* @returns {*}
|
|
609
515
|
*/
|
|
610
|
-
|
|
611
516
|
function getCurrentCanvasSize(state) {
|
|
612
517
|
var defaultSize = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : zeroSize;
|
|
613
|
-
|
|
614
518
|
var _getSelectedDesignAre = getSelectedDesignAreaProperties(state),
|
|
615
|
-
|
|
616
|
-
|
|
519
|
+
designProductionMethod = _getSelectedDesignAre.designProductionMethod;
|
|
617
520
|
if (!designProductionMethod) {
|
|
618
521
|
return defaultSize;
|
|
619
522
|
}
|
|
620
|
-
|
|
621
523
|
return getCanvasSizeFromDesignProductionMethod(designProductionMethod);
|
|
622
524
|
}
|
|
623
|
-
|
|
624
525
|
var memoizedCanvasSize = (0, _memoize["default"])(function (width, height, isMetric, dpi) {
|
|
625
526
|
return {
|
|
626
527
|
width: width,
|
|
@@ -629,133 +530,114 @@ var memoizedCanvasSize = (0, _memoize["default"])(function (width, height, isMet
|
|
|
629
530
|
dpi: dpi
|
|
630
531
|
};
|
|
631
532
|
});
|
|
632
|
-
|
|
633
533
|
function getCanvasSizeFromDesignProductionMethod(designProductionMethod) {
|
|
634
534
|
var defaultSize = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : zeroSize;
|
|
635
535
|
var width = designProductionMethod.width,
|
|
636
|
-
|
|
637
|
-
|
|
638
|
-
|
|
536
|
+
height = designProductionMethod.height,
|
|
537
|
+
dpi = designProductionMethod.dpi;
|
|
639
538
|
if (!width || !height) {
|
|
640
539
|
return defaultSize;
|
|
641
540
|
}
|
|
642
|
-
|
|
643
541
|
return memoizedCanvasSize(width, height, true, dpi || (0, _configuration.getConf)('designer.dpi', 300));
|
|
644
542
|
}
|
|
645
|
-
|
|
646
543
|
function getCanvasSizeFromDesignArea(state, designArea) {
|
|
647
544
|
var defaultSize = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : zeroSize;
|
|
648
545
|
var designProductionMethod = getSelectedDesignProductionMethodForDesignArea(state, designArea);
|
|
649
546
|
return designProductionMethod ? getCanvasSizeFromDesignProductionMethod(designProductionMethod) : defaultSize;
|
|
650
547
|
}
|
|
651
|
-
|
|
652
548
|
function getFontSizeMin(state) {
|
|
653
549
|
var designProductionMethodIdentifier = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
|
|
654
550
|
var designProductionMethod = designProductionMethodIdentifier ? getDesignProductionMethodByIdentifier(state, designProductionMethodIdentifier) : getSelectedDesignProductionMethod(state);
|
|
655
551
|
return Number((0, _get["default"])(designProductionMethod, 'options.minFontSize')) || 5;
|
|
656
552
|
}
|
|
657
|
-
|
|
658
553
|
function getElementLockState(state) {
|
|
659
554
|
var designProductionMethodIdentifier = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
|
|
660
555
|
var designProductionMethod = designProductionMethodIdentifier ? getDesignProductionMethodByIdentifier(state, designProductionMethodIdentifier) : getSelectedDesignProductionMethod(state);
|
|
661
556
|
return (0, _get["default"])(designProductionMethod, 'designElementsLocked');
|
|
662
557
|
}
|
|
663
|
-
|
|
664
558
|
function hasEngravingBackgroundColor(state) {
|
|
665
559
|
var designProductionMethodIdentifier = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
|
|
666
560
|
var designProductionMethod = designProductionMethodIdentifier ? getDesignProductionMethodByIdentifier(state, designProductionMethodIdentifier) : getSelectedDesignProductionMethod(state);
|
|
667
561
|
return designProductionMethodHasEngravingVisualizationEffect(designProductionMethod);
|
|
668
562
|
}
|
|
669
|
-
|
|
670
563
|
function isColoringDisabled(state) {
|
|
671
564
|
var designProductionMethodIdentifier = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
|
|
672
565
|
var designProductionMethod = designProductionMethodIdentifier ? getDesignProductionMethodByIdentifier(state, designProductionMethodIdentifier) : getSelectedDesignProductionMethod(state);
|
|
673
566
|
var visualizationEffect = (0, _get["default"])(designProductionMethod, 'options.visualizationEffect', 'print');
|
|
674
567
|
return ['engraving', 'embossing'].indexOf(visualizationEffect) !== -1;
|
|
675
568
|
}
|
|
676
|
-
|
|
677
569
|
function getVisualizationEffect(designProductionMethod) {
|
|
678
570
|
return (0, _get["default"])(designProductionMethod, 'options.visualizationEffect', 'print');
|
|
679
571
|
}
|
|
680
|
-
|
|
681
572
|
function designProductionMethodHasEmbroideryVisualizationEffect(designProductionMethod) {
|
|
682
573
|
return 'embroidery' === getVisualizationEffect(designProductionMethod);
|
|
683
574
|
}
|
|
684
|
-
|
|
685
575
|
function designProductionMethodHasEngravingVisualizationEffect(designProductionMethod) {
|
|
686
576
|
return 'engraving' === getVisualizationEffect(designProductionMethod);
|
|
687
577
|
}
|
|
688
|
-
|
|
689
578
|
function getEngravingBackgroundColor(state, designProductionMethod) {
|
|
690
579
|
var variantIdentifier = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;
|
|
691
|
-
|
|
692
580
|
var _designProductionMethod = designProductionMethod || getSelectedDesignProductionMethod(state) || {};
|
|
693
|
-
|
|
694
581
|
var engravingBackgroundColors = _designProductionMethod.engravingBackgroundColors;
|
|
695
582
|
return (0, _get["default"])((0, _find2["default"])(engravingBackgroundColors, {
|
|
696
583
|
itemIdentifier: variantIdentifier || (0, _Selectors.getSelectedVariantIdentifier)((0, _Selectors.getConfigurator)(state))
|
|
697
584
|
}), 'colorHex', 'rgba(0, 0, 0, 0.5)');
|
|
698
585
|
}
|
|
699
|
-
|
|
586
|
+
function getColorOverlayData(state, designArea) {
|
|
587
|
+
var variantIdentifier = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;
|
|
588
|
+
var designProductionMethod = getSelectedDesignProductionMethodForDesignArea(state, designArea);
|
|
589
|
+
if (!designProductionMethodHasEngravingVisualizationEffect(designProductionMethod)) {
|
|
590
|
+
return null;
|
|
591
|
+
}
|
|
592
|
+
return {
|
|
593
|
+
color: getEngravingBackgroundColor(state, designArea, variantIdentifier)
|
|
594
|
+
};
|
|
595
|
+
}
|
|
700
596
|
function getVisualizationEffectWithOptions(state, designArea) {
|
|
701
597
|
var variantIdentifier = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;
|
|
702
598
|
var designProductionMethod = getSelectedDesignProductionMethodForDesignArea(state, designArea);
|
|
703
599
|
var effect = getVisualizationEffect(designProductionMethod);
|
|
704
|
-
|
|
705
600
|
var effectOptions = _objectSpread({}, designProductionMethodHasEngravingVisualizationEffect(designProductionMethod) && {
|
|
706
601
|
fillColor: getEngravingBackgroundColor(state, designProductionMethod, variantIdentifier)
|
|
707
602
|
});
|
|
708
|
-
|
|
709
603
|
return {
|
|
710
604
|
effect: effect,
|
|
711
605
|
effectOptions: effectOptions
|
|
712
606
|
};
|
|
713
607
|
}
|
|
714
|
-
|
|
715
|
-
var getColorPalettes = (0, _createSelector["default"])(function (state) {
|
|
608
|
+
var getColorPalettes = exports.getColorPalettes = (0, _createSelector["default"])(function (state) {
|
|
716
609
|
var _getSelectedDesignAre2 = getSelectedDesignAreaProperties(state),
|
|
717
|
-
|
|
718
|
-
|
|
610
|
+
designProductionMethod = _getSelectedDesignAre2.designProductionMethod;
|
|
719
611
|
return designProductionMethod;
|
|
720
612
|
}, function (designProductionMethod) {
|
|
721
613
|
return designProductionMethod ? designProductionMethod.colorPalettes : [];
|
|
722
614
|
});
|
|
723
|
-
exports.getColorPalettes = getColorPalettes;
|
|
724
|
-
|
|
725
615
|
function getColors(state) {
|
|
726
616
|
return getColorsFromCanvasData(getDesignDataForSelectedDesignArea(state).canvasData);
|
|
727
617
|
}
|
|
728
|
-
|
|
729
618
|
function getColorsWithPalette(state) {
|
|
730
619
|
return getColorsFromCanvasDataWithPalette(getDesignDataForSelectedDesignArea(state).canvasData);
|
|
731
620
|
}
|
|
732
|
-
|
|
733
|
-
var isValidHex = function isValidHex(hex) {
|
|
621
|
+
var isValidHex = exports.isValidHex = function isValidHex(hex) {
|
|
734
622
|
return /^#([0-9A-F]{3}){1,2}$/i.test(hex);
|
|
735
623
|
};
|
|
736
|
-
|
|
737
|
-
exports.isValidHex = isValidHex;
|
|
738
|
-
|
|
739
|
-
var hexToRgb = function hexToRgb(hex) {
|
|
624
|
+
var hexToRgb = exports.hexToRgb = function hexToRgb(hex) {
|
|
740
625
|
var stringify = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true;
|
|
741
626
|
// Expand shorthand form (e.g. "03F") to full form (e.g. "0033FF")
|
|
742
627
|
hex = hex.replace(/^#?([a-f\d])([a-f\d])([a-f\d])$/i, function (m, r, g, b) {
|
|
743
628
|
return r + r + g + g + b + b;
|
|
744
629
|
});
|
|
745
630
|
var result = /^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(hex);
|
|
746
|
-
|
|
747
631
|
if (!result) {
|
|
748
632
|
return null;
|
|
749
633
|
}
|
|
750
|
-
|
|
751
634
|
var _map = [1, 2, 3].map(function (i) {
|
|
752
|
-
|
|
753
|
-
|
|
754
|
-
|
|
755
|
-
|
|
756
|
-
|
|
757
|
-
|
|
758
|
-
|
|
635
|
+
return parseInt(result[i], 16);
|
|
636
|
+
}),
|
|
637
|
+
_map2 = _slicedToArray(_map, 3),
|
|
638
|
+
r = _map2[0],
|
|
639
|
+
g = _map2[1],
|
|
640
|
+
b = _map2[2];
|
|
759
641
|
if (!stringify) {
|
|
760
642
|
return {
|
|
761
643
|
r: r,
|
|
@@ -763,82 +645,55 @@ var hexToRgb = function hexToRgb(hex) {
|
|
|
763
645
|
b: b
|
|
764
646
|
};
|
|
765
647
|
}
|
|
766
|
-
|
|
767
648
|
return "rgb(".concat(r, ", ").concat(g, ", ").concat(b, ")");
|
|
768
649
|
};
|
|
769
|
-
|
|
770
|
-
exports.hexToRgb = hexToRgb;
|
|
771
|
-
|
|
772
|
-
var hexToRgbNumbers = function hexToRgbNumbers(hex) {
|
|
650
|
+
var hexToRgbNumbers = exports.hexToRgbNumbers = function hexToRgbNumbers(hex) {
|
|
773
651
|
var rgbAsString = hexToRgb(hex);
|
|
774
652
|
return rgbAsString && rgbAsString.slice(4, rgbAsString.length - 1).split(',').map(function (numString) {
|
|
775
653
|
return parseInt(numString);
|
|
776
654
|
});
|
|
777
655
|
};
|
|
778
|
-
|
|
779
|
-
exports.hexToRgbNumbers = hexToRgbNumbers;
|
|
780
|
-
|
|
781
|
-
var calculateColorDistance = function calculateColorDistance(firstColor, secondColor) {
|
|
656
|
+
var calculateColorDistance = exports.calculateColorDistance = function calculateColorDistance(firstColor, secondColor) {
|
|
782
657
|
var firstRgb = hexToRgbNumbers(firstColor);
|
|
783
658
|
var secondRgb = hexToRgbNumbers(secondColor);
|
|
784
|
-
|
|
785
659
|
if (!firstRgb || !secondRgb) {
|
|
786
660
|
return null;
|
|
787
661
|
}
|
|
788
|
-
|
|
789
662
|
return firstRgb.map(function (color, index) {
|
|
790
663
|
return Math.pow(color - secondRgb[index], 2);
|
|
791
664
|
}).reduce(function (accumulator, value) {
|
|
792
665
|
return accumulator + value;
|
|
793
666
|
});
|
|
794
667
|
};
|
|
795
|
-
|
|
796
|
-
exports.calculateColorDistance = calculateColorDistance;
|
|
797
|
-
|
|
798
|
-
var rgbToHex = function rgbToHex(r, g, b) {
|
|
668
|
+
var rgbToHex = exports.rgbToHex = function rgbToHex(r, g, b) {
|
|
799
669
|
if (r > 255 || g > 255 || b > 255) {
|
|
800
670
|
throw new Error('Invalid color component');
|
|
801
671
|
}
|
|
802
|
-
|
|
803
672
|
var value = (r << 16 | g << 8 | b).toString(16);
|
|
804
673
|
return '#' + ('000000' + value).slice(-6);
|
|
805
674
|
};
|
|
806
|
-
|
|
807
|
-
exports.rgbToHex = rgbToHex;
|
|
808
|
-
|
|
809
|
-
var rgbString2hex = function rgbString2hex(rgb) {
|
|
675
|
+
var rgbString2hex = exports.rgbString2hex = function rgbString2hex(rgb) {
|
|
810
676
|
rgb = rgb.match(/^rgba?[\s+]?\([\s+]?(\d+)[\s+]?,[\s+]?(\d+)[\s+]?,[\s+]?(\d+)[\s+]?/i);
|
|
811
677
|
return rgb && rgb.length === 4 ? '#' + ('0' + parseInt(rgb[1], 10).toString(16)).slice(-2) + ('0' + parseInt(rgb[2], 10).toString(16)).slice(-2) + ('0' + parseInt(rgb[3], 10).toString(16)).slice(-2) : '';
|
|
812
678
|
};
|
|
813
|
-
|
|
814
|
-
exports.rgbString2hex = rgbString2hex;
|
|
815
|
-
|
|
816
|
-
var rgbObjToHex = function rgbObjToHex(_ref11) {
|
|
679
|
+
var rgbObjToHex = exports.rgbObjToHex = function rgbObjToHex(_ref11) {
|
|
817
680
|
var r = _ref11.r,
|
|
818
|
-
|
|
819
|
-
|
|
681
|
+
g = _ref11.g,
|
|
682
|
+
b = _ref11.b;
|
|
820
683
|
return rgbToHex(r, g, b);
|
|
821
684
|
};
|
|
822
|
-
|
|
823
|
-
exports.rgbObjToHex = rgbObjToHex;
|
|
824
|
-
|
|
825
685
|
function getColorsFromCanvasData(canvasData) {
|
|
826
686
|
var objects = (0, _get["default"])(canvasData, 'objects', []);
|
|
827
687
|
var colors = [];
|
|
828
|
-
|
|
829
688
|
var _iterator6 = _createForOfIteratorHelper(objects),
|
|
830
|
-
|
|
831
|
-
|
|
689
|
+
_step6;
|
|
832
690
|
try {
|
|
833
691
|
for (_iterator6.s(); !(_step6 = _iterator6.n()).done;) {
|
|
834
692
|
var object = _step6.value;
|
|
835
|
-
|
|
836
693
|
if (object.type === 'Text') {
|
|
837
694
|
var objectColors = (0, _get["default"])(object, 'style.colors') || [];
|
|
838
|
-
|
|
839
695
|
var _iterator7 = _createForOfIteratorHelper(objectColors),
|
|
840
|
-
|
|
841
|
-
|
|
696
|
+
_step7;
|
|
842
697
|
try {
|
|
843
698
|
for (_iterator7.s(); !(_step7 = _iterator7.n()).done;) {
|
|
844
699
|
var color = _step7.value;
|
|
@@ -851,7 +706,6 @@ function getColorsFromCanvasData(canvasData) {
|
|
|
851
706
|
}
|
|
852
707
|
} else if (object.type === 'Image') {
|
|
853
708
|
var _objectColors = Object.values((0, _get["default"])(object, 'imageData.operations.vectorizeColorsMap') || {});
|
|
854
|
-
|
|
855
709
|
for (var _i2 = 0, _objectColors2 = _objectColors; _i2 < _objectColors2.length; _i2++) {
|
|
856
710
|
var _color = _objectColors2[_i2];
|
|
857
711
|
colors.push(_color.value.startsWith('#') ? hexToRgb(_color.value) : _color.value);
|
|
@@ -863,27 +717,20 @@ function getColorsFromCanvasData(canvasData) {
|
|
|
863
717
|
} finally {
|
|
864
718
|
_iterator6.f();
|
|
865
719
|
}
|
|
866
|
-
|
|
867
720
|
return (0, _uniq["default"])(colors);
|
|
868
721
|
}
|
|
869
|
-
|
|
870
722
|
function getColorsFromCanvasDataWithPalette(canvasData) {
|
|
871
723
|
var objects = (0, _get["default"])(canvasData, 'objects', []);
|
|
872
724
|
var colors = [];
|
|
873
|
-
|
|
874
725
|
var _iterator8 = _createForOfIteratorHelper(objects),
|
|
875
|
-
|
|
876
|
-
|
|
726
|
+
_step8;
|
|
877
727
|
try {
|
|
878
728
|
for (_iterator8.s(); !(_step8 = _iterator8.n()).done;) {
|
|
879
729
|
var object = _step8.value;
|
|
880
|
-
|
|
881
730
|
if (object.type === 'Text') {
|
|
882
731
|
var objectColors = (0, _get["default"])(object, 'style.colors') || [];
|
|
883
|
-
|
|
884
732
|
var _iterator9 = _createForOfIteratorHelper(objectColors),
|
|
885
|
-
|
|
886
|
-
|
|
733
|
+
_step9;
|
|
887
734
|
try {
|
|
888
735
|
for (_iterator9.s(); !(_step9 = _iterator9.n()).done;) {
|
|
889
736
|
var color = _step9.value;
|
|
@@ -896,18 +743,14 @@ function getColorsFromCanvasDataWithPalette(canvasData) {
|
|
|
896
743
|
}
|
|
897
744
|
} else if (object.type === 'Image') {
|
|
898
745
|
var _objectColors3 = (0, _cloneDeep["default"])(Object.values((0, _get["default"])(object, 'imageData.operations.vectorizeColorsMap') || {}));
|
|
899
|
-
|
|
900
746
|
var _iterator10 = _createForOfIteratorHelper(_objectColors3),
|
|
901
|
-
|
|
902
|
-
|
|
747
|
+
_step10;
|
|
903
748
|
try {
|
|
904
749
|
for (_iterator10.s(); !(_step10 = _iterator10.n()).done;) {
|
|
905
750
|
var _color2 = _step10.value;
|
|
906
|
-
|
|
907
751
|
if (_color2.value.startsWith('#')) {
|
|
908
752
|
_color2.value = hexToRgb(_color2.value);
|
|
909
753
|
}
|
|
910
|
-
|
|
911
754
|
colors.push(_color2);
|
|
912
755
|
}
|
|
913
756
|
} catch (err) {
|
|
@@ -922,98 +765,79 @@ function getColorsFromCanvasDataWithPalette(canvasData) {
|
|
|
922
765
|
} finally {
|
|
923
766
|
_iterator8.f();
|
|
924
767
|
}
|
|
925
|
-
|
|
926
768
|
return (0, _uniqWith["default"])(colors, function (color1, color2) {
|
|
927
769
|
return color1.identifier === color2.identifier && color1.value === color2.value;
|
|
928
770
|
});
|
|
929
771
|
}
|
|
930
|
-
|
|
931
772
|
function findSmallestFontSizeInCanvasData(canvasData) {
|
|
932
773
|
var objects = (0, _get["default"])(canvasData, 'objects', []);
|
|
933
774
|
return Math.min.apply(0, objects.map(function (object) {
|
|
934
775
|
return object.fontSize || Infinity;
|
|
935
776
|
}));
|
|
936
777
|
}
|
|
937
|
-
|
|
938
|
-
var createColorData = function createColorData(identifier, paletteIdentifier, custom, value) {
|
|
778
|
+
var createColorData = exports.createColorData = function createColorData(identifier, paletteIdentifier, custom, value) {
|
|
939
779
|
var data = {
|
|
940
780
|
color: identifier,
|
|
941
781
|
palette: paletteIdentifier
|
|
942
782
|
};
|
|
943
|
-
|
|
944
783
|
if (custom) {
|
|
945
784
|
data.custom = true;
|
|
946
785
|
}
|
|
947
|
-
|
|
948
786
|
return {
|
|
949
787
|
identifier: JSON.stringify(data),
|
|
950
788
|
value: value.toLowerCase()
|
|
951
789
|
};
|
|
952
790
|
};
|
|
953
|
-
|
|
954
|
-
exports.createColorData = createColorData;
|
|
955
|
-
|
|
956
|
-
var parseColorData = function parseColorData(jsonStr) {
|
|
791
|
+
var parseColorData = exports.parseColorData = function parseColorData(jsonStr) {
|
|
957
792
|
var colorData;
|
|
958
|
-
|
|
959
793
|
try {
|
|
960
794
|
colorData = JSON.parse(jsonStr);
|
|
961
795
|
} catch (e) {
|
|
962
796
|
// eslint-disable-next-line no-console
|
|
963
797
|
console.error("failed to parse color data: ".concat(jsonStr));
|
|
964
798
|
}
|
|
965
|
-
|
|
966
799
|
return _objectSpread({
|
|
967
800
|
palette: null,
|
|
968
801
|
color: null
|
|
969
802
|
}, colorData);
|
|
970
803
|
};
|
|
971
|
-
|
|
972
|
-
|
|
973
|
-
|
|
974
|
-
var getCameraViewListForDesignAreaList = function getCameraViewListForDesignAreaList(filteredDesignAreas, designedAreas) {
|
|
975
|
-
return ['default'].concat(filteredDesignAreas // get the design area objects by their id
|
|
804
|
+
var getCameraViewListForDesignAreaList = exports.getCameraViewListForDesignAreaList = function getCameraViewListForDesignAreaList(filteredDesignAreas, designedAreas) {
|
|
805
|
+
return ['default'].concat(filteredDesignAreas
|
|
806
|
+
// get the design area objects by their id
|
|
976
807
|
.filter(function (designArea) {
|
|
977
808
|
return designedAreas.indexOf(designArea.identifier) !== -1;
|
|
978
|
-
})
|
|
809
|
+
})
|
|
810
|
+
// get the camera view values
|
|
979
811
|
.map(function (designArea) {
|
|
980
812
|
return (0, _get["default"])(designArea, 'customData.selectedCameraView');
|
|
981
|
-
})
|
|
813
|
+
})
|
|
814
|
+
// remove empty values and duplicates
|
|
982
815
|
.filter(function (viewName, index, arr) {
|
|
983
816
|
return viewName && index === arr.indexOf(viewName);
|
|
984
|
-
})
|
|
817
|
+
})
|
|
818
|
+
// make them lower case
|
|
985
819
|
.map(function (viewName) {
|
|
986
820
|
return viewName.toLowerCase();
|
|
987
821
|
}));
|
|
988
822
|
};
|
|
989
|
-
|
|
990
|
-
exports.getCameraViewListForDesignAreaList = getCameraViewListForDesignAreaList;
|
|
991
|
-
|
|
992
|
-
var getDesignViewListForDesignAreas = function getDesignViewListForDesignAreas(state, designAreas) {
|
|
823
|
+
var getDesignViewListForDesignAreas = exports.getDesignViewListForDesignAreas = function getDesignViewListForDesignAreas(state, designAreas) {
|
|
993
824
|
var designViews = state.designView.designViews,
|
|
994
|
-
|
|
995
|
-
|
|
825
|
+
designerAvailable = state.configurationMode.availableModes.designer;
|
|
996
826
|
if (!designerAvailable) {
|
|
997
827
|
return designViews;
|
|
998
828
|
}
|
|
999
|
-
|
|
1000
829
|
var designViewList = [];
|
|
1001
|
-
|
|
1002
830
|
var _iterator11 = _createForOfIteratorHelper(designViews),
|
|
1003
|
-
|
|
1004
|
-
|
|
831
|
+
_step11;
|
|
1005
832
|
try {
|
|
1006
833
|
for (_iterator11.s(); !(_step11 = _iterator11.n()).done;) {
|
|
1007
834
|
var designView = _step11.value;
|
|
1008
835
|
var designAreaList = [];
|
|
1009
|
-
|
|
1010
836
|
var _iterator12 = _createForOfIteratorHelper(designView.designAreas),
|
|
1011
|
-
|
|
1012
|
-
|
|
837
|
+
_step12;
|
|
1013
838
|
try {
|
|
1014
839
|
for (_iterator12.s(); !(_step12 = _iterator12.n()).done;) {
|
|
1015
840
|
var designArea = _step12.value;
|
|
1016
|
-
|
|
1017
841
|
if (!designAreas || designAreas.indexOf(designArea.identifier) !== -1) {
|
|
1018
842
|
designAreaList.push((0, _Transformers2.recalculateSingleDesignArea)(state, designArea));
|
|
1019
843
|
}
|
|
@@ -1023,7 +847,6 @@ var getDesignViewListForDesignAreas = function getDesignViewListForDesignAreas(s
|
|
|
1023
847
|
} finally {
|
|
1024
848
|
_iterator12.f();
|
|
1025
849
|
}
|
|
1026
|
-
|
|
1027
850
|
if (designAreaList.length) {
|
|
1028
851
|
designViewList.push(_objectSpread(_objectSpread({}, designView), {}, {
|
|
1029
852
|
designAreas: designAreaList.sort(_Transformers.compareDesignAreasBySize)
|
|
@@ -1035,23 +858,15 @@ var getDesignViewListForDesignAreas = function getDesignViewListForDesignAreas(s
|
|
|
1035
858
|
} finally {
|
|
1036
859
|
_iterator11.f();
|
|
1037
860
|
}
|
|
1038
|
-
|
|
1039
861
|
return designViewList;
|
|
1040
862
|
};
|
|
1041
|
-
|
|
1042
|
-
exports.getDesignViewListForDesignAreas = getDesignViewListForDesignAreas;
|
|
1043
|
-
|
|
1044
|
-
var getDesignAreaFromSelectedDesignView = function getDesignAreaFromSelectedDesignView(state) {
|
|
863
|
+
var getDesignAreaFromSelectedDesignView = exports.getDesignAreaFromSelectedDesignView = function getDesignAreaFromSelectedDesignView(state) {
|
|
1045
864
|
var _find;
|
|
1046
|
-
|
|
1047
865
|
var filteredDesignAreas = state.designArea.filteredDesignAreas,
|
|
1048
|
-
|
|
866
|
+
selectedDesignView = state.designView.selectedDesignView;
|
|
1049
867
|
return (_find = (0, _find2["default"])(filteredDesignAreas, ['designView.identifier', selectedDesignView.identifier])) === null || _find === void 0 ? void 0 : _find.identifier;
|
|
1050
868
|
};
|
|
1051
|
-
|
|
1052
|
-
exports.getDesignAreaFromSelectedDesignView = getDesignAreaFromSelectedDesignView;
|
|
1053
|
-
|
|
1054
|
-
var getDefaultDesignAreaIdentifierFromProductionMethod = function getDefaultDesignAreaIdentifierFromProductionMethod(state) {
|
|
869
|
+
var getDefaultDesignAreaIdentifierFromProductionMethod = exports.getDefaultDesignAreaIdentifierFromProductionMethod = function getDefaultDesignAreaIdentifierFromProductionMethod(state) {
|
|
1055
870
|
//return the first designArea with isDefault: true due to api call accepts multiple productionmethods to be default
|
|
1056
871
|
var filteredDesignAreas = state.designArea.filteredDesignAreas;
|
|
1057
872
|
var defaultDesignArea = filteredDesignAreas && filteredDesignAreas.find(function (designArea) {
|
|
@@ -1059,23 +874,16 @@ var getDefaultDesignAreaIdentifierFromProductionMethod = function getDefaultDesi
|
|
|
1059
874
|
return method.isDefault;
|
|
1060
875
|
});
|
|
1061
876
|
});
|
|
1062
|
-
|
|
1063
877
|
if (defaultDesignArea) {
|
|
1064
878
|
return defaultDesignArea.identifier;
|
|
1065
879
|
} else {
|
|
1066
880
|
return null;
|
|
1067
881
|
}
|
|
1068
882
|
};
|
|
1069
|
-
|
|
1070
|
-
exports.getDefaultDesignAreaIdentifierFromProductionMethod = getDefaultDesignAreaIdentifierFromProductionMethod;
|
|
1071
|
-
|
|
1072
|
-
var getDefaultColorsFromDesignProductionMethod = function getDefaultColorsFromDesignProductionMethod(designProductionMethod) {
|
|
883
|
+
var getDefaultColorsFromDesignProductionMethod = exports.getDefaultColorsFromDesignProductionMethod = function getDefaultColorsFromDesignProductionMethod(designProductionMethod) {
|
|
1073
884
|
return (0, _get["default"])(designProductionMethod, 'defaultColors') || {};
|
|
1074
885
|
};
|
|
1075
|
-
|
|
1076
|
-
exports.getDefaultColorsFromDesignProductionMethod = getDefaultColorsFromDesignProductionMethod;
|
|
1077
|
-
|
|
1078
|
-
var getDefaultTextColor = function getDefaultTextColor(state) {
|
|
886
|
+
var getDefaultTextColor = exports.getDefaultTextColor = function getDefaultTextColor(state) {
|
|
1079
887
|
var colorIndex = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : null;
|
|
1080
888
|
var colorPalettes = getColorPalettes(state);
|
|
1081
889
|
var defaultColor = {
|
|
@@ -1084,16 +892,13 @@ var getDefaultTextColor = function getDefaultTextColor(state) {
|
|
|
1084
892
|
custom: true,
|
|
1085
893
|
value: '#ff0000'
|
|
1086
894
|
};
|
|
1087
|
-
|
|
1088
895
|
if (!colorPalettes.length) {
|
|
1089
896
|
return defaultColor;
|
|
1090
897
|
}
|
|
1091
|
-
|
|
1092
898
|
if (colorIndex !== null) {
|
|
1093
899
|
if (colorPalettes[0].colors.length <= colorIndex) {
|
|
1094
900
|
return defaultColor;
|
|
1095
901
|
}
|
|
1096
|
-
|
|
1097
902
|
return {
|
|
1098
903
|
identifier: colorPalettes[0].colors[colorIndex].identifier,
|
|
1099
904
|
paletteIdentifier: colorPalettes[0].identifier,
|
|
@@ -1101,21 +906,17 @@ var getDefaultTextColor = function getDefaultTextColor(state) {
|
|
|
1101
906
|
value: '#' + colorPalettes[0].colors[colorIndex].hex_value
|
|
1102
907
|
};
|
|
1103
908
|
}
|
|
1104
|
-
|
|
1105
909
|
var designProductionMethod = getSelectedDesignProductionMethod(state);
|
|
1106
910
|
var defaultColors = getDefaultColorsFromDesignProductionMethod(designProductionMethod);
|
|
1107
911
|
var variantIdentifier = (0, _Selectors.getSelectedVariantIdentifier)((0, _Selectors.getConfigurator)(state));
|
|
1108
|
-
|
|
1109
912
|
if (defaultColors && defaultColors[variantIdentifier]) {
|
|
1110
913
|
var colorPalette = (0, _find2["default"])(colorPalettes, {
|
|
1111
914
|
identifier: Object.keys(defaultColors[variantIdentifier])[0]
|
|
1112
915
|
});
|
|
1113
|
-
|
|
1114
916
|
if (colorPalette) {
|
|
1115
917
|
var color = (0, _find2["default"])(colorPalette.colors, {
|
|
1116
918
|
identifier: defaultColors[variantIdentifier][colorPalette.identifier]
|
|
1117
919
|
});
|
|
1118
|
-
|
|
1119
920
|
if (color) {
|
|
1120
921
|
return {
|
|
1121
922
|
identifier: color.identifier,
|
|
@@ -1126,12 +927,10 @@ var getDefaultTextColor = function getDefaultTextColor(state) {
|
|
|
1126
927
|
}
|
|
1127
928
|
}
|
|
1128
929
|
}
|
|
1129
|
-
|
|
1130
930
|
var paletteDefaultColorIdentifier = (0, _get["default"])(colorPalettes[0], 'defaultColor.identifier', '');
|
|
1131
931
|
var paletteDefaultColor = (0, _find2["default"])(colorPalettes[0].colors, {
|
|
1132
932
|
identifier: paletteDefaultColorIdentifier
|
|
1133
933
|
});
|
|
1134
|
-
|
|
1135
934
|
if (paletteDefaultColor) {
|
|
1136
935
|
return {
|
|
1137
936
|
identifier: paletteDefaultColor.identifier,
|
|
@@ -1140,7 +939,6 @@ var getDefaultTextColor = function getDefaultTextColor(state) {
|
|
|
1140
939
|
value: '#' + paletteDefaultColor.hex_value
|
|
1141
940
|
};
|
|
1142
941
|
}
|
|
1143
|
-
|
|
1144
942
|
if (colorPalettes[0].colors.length) {
|
|
1145
943
|
return {
|
|
1146
944
|
identifier: colorPalettes[0].colors[0].identifier,
|
|
@@ -1149,27 +947,17 @@ var getDefaultTextColor = function getDefaultTextColor(state) {
|
|
|
1149
947
|
value: '#' + colorPalettes[0].colors[0].hex_value
|
|
1150
948
|
};
|
|
1151
949
|
}
|
|
1152
|
-
|
|
1153
950
|
return defaultColor;
|
|
1154
951
|
};
|
|
1155
|
-
|
|
1156
|
-
exports.getDefaultTextColor = getDefaultTextColor;
|
|
1157
|
-
|
|
1158
|
-
var isPlaceholderContent = function isPlaceholderContent(content) {
|
|
952
|
+
var isPlaceholderContent = exports.isPlaceholderContent = function isPlaceholderContent(content) {
|
|
1159
953
|
return content.indexOf('data-placeholder="true"') !== -1;
|
|
1160
954
|
};
|
|
1161
|
-
|
|
1162
|
-
exports.isPlaceholderContent = isPlaceholderContent;
|
|
1163
|
-
|
|
1164
|
-
var contentHasText = function contentHasText(content) {
|
|
955
|
+
var contentHasText = exports.contentHasText = function contentHasText(content) {
|
|
1165
956
|
var div = document.createElement('div');
|
|
1166
957
|
div.innerHTML = content;
|
|
1167
958
|
return /\S/.test(div.textContent);
|
|
1168
959
|
};
|
|
1169
|
-
|
|
1170
|
-
exports.contentHasText = contentHasText;
|
|
1171
|
-
|
|
1172
|
-
var getDesignAreaImageCompatibilityInfo = function getDesignAreaImageCompatibilityInfo(designProductionMethod) {
|
|
960
|
+
var getDesignAreaImageCompatibilityInfo = exports.getDesignAreaImageCompatibilityInfo = function getDesignAreaImageCompatibilityInfo(designProductionMethod) {
|
|
1173
961
|
var colorPalettes = ((0, _get["default"])(designProductionMethod, 'colorPalettes') || []).map(function (_ref12) {
|
|
1174
962
|
var identifier = _ref12.identifier;
|
|
1175
963
|
return identifier;
|
|
@@ -1184,26 +972,16 @@ var getDesignAreaImageCompatibilityInfo = function getDesignAreaImageCompatibili
|
|
|
1184
972
|
vectorizedLogoMandatory: vectorizedLogoMandatory
|
|
1185
973
|
};
|
|
1186
974
|
};
|
|
1187
|
-
|
|
1188
|
-
exports.getDesignAreaImageCompatibilityInfo = getDesignAreaImageCompatibilityInfo;
|
|
1189
|
-
|
|
1190
|
-
var getCurrentCompatibilityInfoHash = function getCurrentCompatibilityInfoHash(state) {
|
|
975
|
+
var getCurrentCompatibilityInfoHash = exports.getCurrentCompatibilityInfoHash = function getCurrentCompatibilityInfoHash(state) {
|
|
1191
976
|
return getDesignAreaImageCompatibilityInfo(getSelectedDesignProductionMethod(state));
|
|
1192
977
|
};
|
|
1193
|
-
|
|
1194
|
-
exports.getCurrentCompatibilityInfoHash = getCurrentCompatibilityInfoHash;
|
|
1195
|
-
|
|
1196
|
-
var areHashesCompatible = function areHashesCompatible(storedHash, targetHash) {
|
|
978
|
+
var areHashesCompatible = exports.areHashesCompatible = function areHashesCompatible(storedHash, targetHash) {
|
|
1197
979
|
return Boolean(!targetHash || storedHash && (0, _isEqual["default"])(storedHash.colorPalettes, targetHash.colorPalettes) && (!targetHash.vectorsRequired || storedHash.vectorsRequired) && (!targetHash.vectorizedLogoMandatory || storedHash.vectorizedLogoMandatory) && (!targetHash.maxColorAmount || storedHash.maxColorAmount <= targetHash.maxColorAmount));
|
|
1198
980
|
};
|
|
1199
|
-
|
|
1200
|
-
exports.areHashesCompatible = areHashesCompatible;
|
|
1201
|
-
|
|
1202
|
-
var getVectorizedImageColor = function getVectorizedImageColor(state) {
|
|
981
|
+
var getVectorizedImageColor = exports.getVectorizedImageColor = function getVectorizedImageColor(state) {
|
|
1203
982
|
var selectedDesignProductionMethod = getSelectedDesignProductionMethod(state);
|
|
1204
983
|
var selectedImage = (0, _get["default"])(state, 'imageGallery.selectedImage', {});
|
|
1205
984
|
var reversedUserImages = (0, _get["default"])(state, 'imageGallery.userImages', []).slice().reverse();
|
|
1206
|
-
|
|
1207
985
|
if (selectedImage && reversedUserImages.length > 0 && reversedUserImages.find(function (image) {
|
|
1208
986
|
return image.originalFileName === selectedImage.originalFileName;
|
|
1209
987
|
}) && selectedImage.originalFileName !== reversedUserImages[0].originalFileName) {
|
|
@@ -1215,19 +993,15 @@ var getVectorizedImageColor = function getVectorizedImageColor(state) {
|
|
|
1215
993
|
});
|
|
1216
994
|
reversedUserImages = [currentLastImage].concat(_toConsumableArray(imagesWithoutSelectedImage));
|
|
1217
995
|
}
|
|
1218
|
-
|
|
1219
996
|
var _iterator13 = _createForOfIteratorHelper(reversedUserImages),
|
|
1220
|
-
|
|
1221
|
-
|
|
997
|
+
_step13;
|
|
1222
998
|
try {
|
|
1223
999
|
for (_iterator13.s(); !(_step13 = _iterator13.n()).done;) {
|
|
1224
1000
|
var image = _step13.value;
|
|
1225
1001
|
var objectColors = (0, _values["default"])((0, _get["default"])(image, 'operations.vectorizeColorsMap'));
|
|
1226
|
-
|
|
1227
1002
|
if (!objectColors || !objectColors.length) {
|
|
1228
1003
|
continue;
|
|
1229
1004
|
}
|
|
1230
|
-
|
|
1231
1005
|
if ((0, _Selectors2.isImageCompatible)(state, image)) {
|
|
1232
1006
|
return (0, _first["default"])(objectColors);
|
|
1233
1007
|
} else {
|
|
@@ -1240,78 +1014,50 @@ var getVectorizedImageColor = function getVectorizedImageColor(state) {
|
|
|
1240
1014
|
} finally {
|
|
1241
1015
|
_iterator13.f();
|
|
1242
1016
|
}
|
|
1243
|
-
|
|
1244
1017
|
return {};
|
|
1245
1018
|
};
|
|
1246
|
-
|
|
1247
|
-
exports.getVectorizedImageColor = getVectorizedImageColor;
|
|
1248
|
-
|
|
1249
|
-
var areAllDesignAreasEmpty = function areAllDesignAreasEmpty(_ref13) {
|
|
1019
|
+
var areAllDesignAreasEmpty = exports.areAllDesignAreasEmpty = function areAllDesignAreasEmpty(_ref13) {
|
|
1250
1020
|
var configuration = _ref13.configuration;
|
|
1251
1021
|
var designdata = (0, _get["default"])(configuration, 'designdata', {});
|
|
1252
|
-
|
|
1253
1022
|
for (var key in designdata) {
|
|
1254
1023
|
if (!designdata.hasOwnProperty(key)) {
|
|
1255
1024
|
continue;
|
|
1256
1025
|
}
|
|
1257
|
-
|
|
1258
1026
|
if (designdata[key].canvasData) {
|
|
1259
1027
|
return false;
|
|
1260
1028
|
}
|
|
1261
1029
|
}
|
|
1262
|
-
|
|
1263
1030
|
return true;
|
|
1264
1031
|
};
|
|
1265
|
-
|
|
1266
|
-
exports.areAllDesignAreasEmpty = areAllDesignAreasEmpty;
|
|
1267
|
-
|
|
1268
|
-
var hasLastEditedDesignArea = function hasLastEditedDesignArea(designArea) {
|
|
1032
|
+
var hasLastEditedDesignArea = exports.hasLastEditedDesignArea = function hasLastEditedDesignArea(designArea) {
|
|
1269
1033
|
var lastSelectedDesignAreaIdentifier = (0, _get["default"])(designArea, 'lastSelectedDesignAreaIdentifier', {});
|
|
1270
1034
|
var previousEditedDesignArea = (0, _get["default"])(designArea, 'previousEditedDesignArea', {});
|
|
1271
1035
|
return !(0, _isEmpty["default"])(lastSelectedDesignAreaIdentifier) || !(0, _isEmpty["default"])(previousEditedDesignArea);
|
|
1272
1036
|
};
|
|
1273
|
-
|
|
1274
|
-
exports.hasLastEditedDesignArea = hasLastEditedDesignArea;
|
|
1275
|
-
|
|
1276
|
-
var getDesignAreaPreSelection = function getDesignAreaPreSelection(identifier) {
|
|
1037
|
+
var getDesignAreaPreSelection = exports.getDesignAreaPreSelection = function getDesignAreaPreSelection(identifier) {
|
|
1277
1038
|
var designerPreSelection = (0, _configuration.getConf)('designerPreSelection', {});
|
|
1278
|
-
|
|
1279
1039
|
if (!designerPreSelection.designAreas || !designerPreSelection.designAreas.length) {
|
|
1280
1040
|
return {};
|
|
1281
1041
|
}
|
|
1282
|
-
|
|
1283
1042
|
var preSelection = (0, _find2["default"])(designerPreSelection.designAreas, {
|
|
1284
1043
|
identifier: identifier
|
|
1285
1044
|
});
|
|
1286
1045
|
return preSelection ? preSelection : {};
|
|
1287
1046
|
};
|
|
1288
|
-
|
|
1289
|
-
exports.getDesignAreaPreSelection = getDesignAreaPreSelection;
|
|
1290
|
-
|
|
1291
|
-
var getDesignAreaColorAmount = function getDesignAreaColorAmount(maxColorAmount, preSelectionColorAmount) {
|
|
1047
|
+
var getDesignAreaColorAmount = exports.getDesignAreaColorAmount = function getDesignAreaColorAmount(maxColorAmount, preSelectionColorAmount) {
|
|
1292
1048
|
var amount = maxColorAmount > 0 ? 1 : null;
|
|
1293
|
-
|
|
1294
1049
|
if (preSelectionColorAmount > 0) {
|
|
1295
1050
|
amount = preSelectionColorAmount > maxColorAmount ? maxColorAmount : preSelectionColorAmount;
|
|
1296
1051
|
}
|
|
1297
|
-
|
|
1298
1052
|
return amount;
|
|
1299
1053
|
};
|
|
1300
|
-
|
|
1301
|
-
exports.getDesignAreaColorAmount = getDesignAreaColorAmount;
|
|
1302
|
-
|
|
1303
|
-
var isVectorizedLogoMandatory = function isVectorizedLogoMandatory(designProductionMethod) {
|
|
1054
|
+
var isVectorizedLogoMandatory = exports.isVectorizedLogoMandatory = function isVectorizedLogoMandatory(designProductionMethod) {
|
|
1304
1055
|
var _designProductionMeth;
|
|
1305
|
-
|
|
1306
1056
|
return !!(designProductionMethod !== null && designProductionMethod !== void 0 && (_designProductionMeth = designProductionMethod.options) !== null && _designProductionMeth !== void 0 && _designProductionMeth.vectorizedLogoMandatory);
|
|
1307
1057
|
};
|
|
1308
|
-
|
|
1309
|
-
exports.isVectorizedLogoMandatory = isVectorizedLogoMandatory;
|
|
1310
|
-
|
|
1311
|
-
var getVectorizeForDesignProductionMethods = function getVectorizeForDesignProductionMethods(state, designProductionMethodIdentifier) {
|
|
1058
|
+
var getVectorizeForDesignProductionMethods = exports.getVectorizeForDesignProductionMethods = function getVectorizeForDesignProductionMethods(state, designProductionMethodIdentifier) {
|
|
1312
1059
|
var _getSelectedDesignAre3 = getSelectedDesignAreaProperties(state),
|
|
1313
|
-
|
|
1314
|
-
|
|
1060
|
+
designProductionMethod = _getSelectedDesignAre3.designProductionMethod;
|
|
1315
1061
|
var newProductionMethod = getDesignProductionMethodByIdentifier(state, designProductionMethodIdentifier);
|
|
1316
1062
|
var currentVectorsRequired = !!(0, _get["default"])(designProductionMethod, 'options.vectorsRequired') && isVectorizedLogoMandatory(designProductionMethod);
|
|
1317
1063
|
var newVectorsRequired = !!(0, _get["default"])(newProductionMethod, 'options.vectorsRequired') && isVectorizedLogoMandatory(newProductionMethod);
|
|
@@ -1320,13 +1066,9 @@ var getVectorizeForDesignProductionMethods = function getVectorizeForDesignProdu
|
|
|
1320
1066
|
newVectorsRequired: newVectorsRequired
|
|
1321
1067
|
};
|
|
1322
1068
|
};
|
|
1323
|
-
|
|
1324
|
-
exports.getVectorizeForDesignProductionMethods = getVectorizeForDesignProductionMethods;
|
|
1325
|
-
|
|
1326
|
-
var getMandatoryVectorizationForDesignProductionMethods = function getMandatoryVectorizationForDesignProductionMethods(state, designProductionMethodIdentifier) {
|
|
1069
|
+
var getMandatoryVectorizationForDesignProductionMethods = exports.getMandatoryVectorizationForDesignProductionMethods = function getMandatoryVectorizationForDesignProductionMethods(state, designProductionMethodIdentifier) {
|
|
1327
1070
|
var _getSelectedDesignAre4 = getSelectedDesignAreaProperties(state),
|
|
1328
|
-
|
|
1329
|
-
|
|
1071
|
+
designProductionMethod = _getSelectedDesignAre4.designProductionMethod;
|
|
1330
1072
|
var newProductionMethod = getDesignProductionMethodByIdentifier(state, designProductionMethodIdentifier);
|
|
1331
1073
|
var currentVectorsMandatory = isVectorizedLogoMandatory(designProductionMethod);
|
|
1332
1074
|
var newVectorsMandatory = isVectorizedLogoMandatory(newProductionMethod);
|
|
@@ -1335,23 +1077,16 @@ var getMandatoryVectorizationForDesignProductionMethods = function getMandatoryV
|
|
|
1335
1077
|
newVectorsMandatory: newVectorsMandatory
|
|
1336
1078
|
};
|
|
1337
1079
|
};
|
|
1338
|
-
|
|
1339
|
-
exports.getMandatoryVectorizationForDesignProductionMethods = getMandatoryVectorizationForDesignProductionMethods;
|
|
1340
|
-
|
|
1341
|
-
var getImagesByDesignArea = function getImagesByDesignArea(state, designAreaIdentifier) {
|
|
1080
|
+
var getImagesByDesignArea = exports.getImagesByDesignArea = function getImagesByDesignArea(state, designAreaIdentifier) {
|
|
1342
1081
|
if (!designAreaIdentifier) {
|
|
1343
1082
|
designAreaIdentifier = getSelectedDesignArea(state).identifier;
|
|
1344
1083
|
}
|
|
1345
|
-
|
|
1346
1084
|
var designData = getDesignDataByDesignAreaIdentifier(state, designAreaIdentifier);
|
|
1347
1085
|
return (0, _get["default"])(designData, 'canvasData.objects', []).filter(function (_ref14) {
|
|
1348
1086
|
var type = _ref14.type;
|
|
1349
1087
|
return type === 'Image';
|
|
1350
1088
|
});
|
|
1351
1089
|
};
|
|
1352
|
-
|
|
1353
|
-
exports.getImagesByDesignArea = getImagesByDesignArea;
|
|
1354
|
-
|
|
1355
1090
|
function isOneLineText(state) {
|
|
1356
1091
|
return (0, _get["default"])(getSelectedDesignProductionMethod(state), 'oneLineText', false);
|
|
1357
1092
|
}
|