@configuratorware/configurator-frontendgui 1.28.3 → 1.29.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 +73 -0
- package/App/Error/DevelopmentErrorPage/index.js +74 -0
- package/App/Error/ErrorBoundary.js +98 -0
- package/App/Error/ProductionErrorPage/Style.scss +47 -0
- package/App/Error/ProductionErrorPage/index.js +43 -0
- package/App/Error/ProductionErrorPage/index.story.js +13 -0
- package/App/Error/ProductionErrorPage/res/error_gears.png +0 -0
- package/App/Frame.js +95 -0
- package/App/Modules/Creator/Components/ConfigurationvariantItem/Styles.scss +33 -0
- package/App/Modules/Creator/Components/ConfigurationvariantItem/index.js +118 -0
- package/App/Modules/Creator/Components/ConfigurationvariantSelection/Styles.scss +47 -0
- package/App/Modules/Creator/Components/ConfigurationvariantSelection/index.js +130 -0
- package/App/Modules/Creator/Components/CustomTitleEditor/Styles.scss +43 -0
- package/App/Modules/Creator/Components/CustomTitleEditor/index.js +144 -0
- package/App/Modules/Creator/Components/ExternalVisualization/index.js +140 -0
- package/App/Modules/Creator/Components/FastConfiguration/SelectableRow.js +128 -0
- package/App/Modules/Creator/Components/FastConfiguration/Styles.scss +53 -0
- package/App/Modules/Creator/Components/FastConfiguration/index.js +280 -0
- package/App/Modules/Creator/Components/FastConfigurationRow/Styles.scss +45 -0
- package/App/Modules/Creator/Components/FastConfigurationRow/index.js +78 -0
- package/App/Modules/Creator/Components/FastConfigurationSelect/Styles.scss +35 -0
- package/App/Modules/Creator/Components/FastConfigurationSelect/index.js +251 -0
- package/App/Modules/Creator/Components/FormattedNumber/index.js +45 -0
- package/App/Modules/Creator/Components/FormattedPrice/index.js +57 -0
- package/App/Modules/Creator/Components/FullScreenView/FullScreenView.js +104 -0
- package/App/Modules/Creator/Components/Incompatibility/OptionRule/index.js +182 -0
- package/App/Modules/Creator/Components/Incompatibility/RuleComponent.js +88 -0
- package/App/Modules/Creator/Components/Incompatibility/index.js +251 -0
- package/App/Modules/Creator/Components/InvalidConfigurationNotice/index.js +164 -0
- package/App/Modules/Creator/Components/LoginForm/Styles.scss +9 -0
- package/App/Modules/Creator/Components/LoginForm/index.js +129 -0
- package/App/Modules/Creator/Components/Option/index.js +545 -0
- package/App/Modules/Creator/Components/Option/index.story.js +154 -0
- package/App/Modules/Creator/Components/OptionAmount/index.js +236 -0
- package/App/Modules/Creator/Components/OptionGroup/index.js +55 -0
- package/App/Modules/Creator/Components/Optiondetail/ZoomImage/index.js +173 -0
- package/App/Modules/Creator/Components/Optiondetail/index.js +499 -0
- package/App/Modules/Creator/Components/Optiondetail/index.story.js +117 -0
- package/App/Modules/Creator/Components/OptionsList/index.js +193 -0
- package/App/Modules/Creator/Components/Price/Styles.scss +3 -0
- package/App/Modules/Creator/Components/Price/index.js +79 -0
- package/App/Modules/Creator/Components/ProductPart/index.js +187 -0
- package/App/Modules/Creator/Components/ProductPart/index.story.js +88 -0
- package/App/Modules/Creator/Components/ProductPartsList/index.js +153 -0
- package/App/Modules/Creator/Components/ProductPartsList/index.story.js +101 -0
- package/App/Modules/Creator/Components/SavedConfiguration/Styles.scss +19 -0
- package/App/Modules/Creator/Components/SavedConfiguration/index.js +82 -0
- package/App/Modules/Creator/Components/ShareConfiguration/Styles.scss +23 -0
- package/App/Modules/Creator/Components/ShareConfiguration/index.js +224 -0
- package/App/Modules/Creator/Components/StockInformation/index.js +93 -0
- package/App/Modules/Creator/Components/StoreConfigurationForm/Styles.scss +5 -0
- package/App/Modules/Creator/Components/StoreConfigurationForm/index.js +123 -0
- package/App/Modules/Creator/Components/Tools/Styles.scss +44 -0
- package/App/Modules/Creator/Components/Tools/index.js +102 -0
- package/App/Modules/Creator/Components/ValidationResult/Styles.scss +45 -0
- package/App/Modules/Creator/Components/ValidationResult/index.js +165 -0
- package/App/Modules/Creator/Components/index.js +84 -0
- package/App/Modules/Creator/Containers/AmountPrice/index.js +26 -0
- package/App/Modules/Creator/Containers/ConfigurationvariantSelection/index.js +60 -0
- package/App/Modules/Creator/Containers/CustomTitleEditor/index.js +52 -0
- package/App/Modules/Creator/Containers/FastConfiguration/index.js +62 -0
- package/App/Modules/Creator/Containers/FormattedPrice/index.js +31 -0
- package/App/Modules/Creator/Containers/Incompatibility/index.js +40 -0
- package/App/Modules/Creator/Containers/InvalidConfigurationNotice/index.js +89 -0
- package/App/Modules/Creator/Containers/LoadingOverlay/index.js +26 -0
- package/App/Modules/Creator/Containers/Optiondetail/index.js +48 -0
- package/App/Modules/Creator/Containers/OptionsList/index.js +49 -0
- package/App/Modules/Creator/Containers/ProductPart/index.js +26 -0
- package/App/Modules/Creator/Containers/ProductPartsList/index.js +50 -0
- package/App/Modules/Creator/Containers/SavedConfigurationContainer/index.js +25 -0
- package/App/Modules/Creator/Containers/ShareConfiguration/index.js +42 -0
- package/App/Modules/Creator/Containers/StockInformation/index.js +33 -0
- package/App/Modules/Creator/Containers/Tools/index.js +44 -0
- package/App/Modules/Creator/Containers/ValidationResult/index.js +34 -0
- package/App/Modules/Creator/Containers/index.js +175 -0
- package/App/Modules/Creator/CreatorScreen.js +307 -0
- package/App/Modules/Creator/Layouts/DefaultLayout.js +260 -0
- package/App/Modules/Creator/Styles.scss +216 -0
- package/App/Modules/Designer/Components/AddGalleryImage/index.js +234 -0
- package/App/Modules/Designer/Components/AddGalleryImage/index.story.js +94 -0
- package/App/Modules/Designer/Components/AddGalleryImage/index.test.js +151 -0
- package/App/Modules/Designer/Components/AddVisualElement/Styles.scss +0 -0
- package/App/Modules/Designer/Components/AddVisualElement/index.js +278 -0
- package/App/Modules/Designer/Components/AddVisualElement/index.story.js +24 -0
- package/App/Modules/Designer/Components/AddVisualElement/index.test.js +47 -0
- package/App/Modules/Designer/Components/CloseDesignEditor/index.js +130 -0
- package/App/Modules/Designer/Components/CloseGraphicsEditorButton/index.js +54 -0
- package/App/Modules/Designer/Components/ColorPalettes/ColorPalettesSearch.js +175 -0
- package/App/Modules/Designer/Components/ColorPalettes/index.js +814 -0
- package/App/Modules/Designer/Components/ColorPalettes/index.story.js +158 -0
- package/App/Modules/Designer/Components/ColorPalettes/index.test.js +150 -0
- package/App/Modules/Designer/Components/DesignAreaControlbox/Styles.scss +0 -0
- package/App/Modules/Designer/Components/DesignAreaControlbox/index.js +467 -0
- package/App/Modules/Designer/Components/DesignAreaControlbox/index.story.js +272 -0
- package/App/Modules/Designer/Components/DesignAreaControlbox/index.test.js +164 -0
- package/App/Modules/Designer/Components/DesignerSelectionToolbox/CustomFontOverlay.js +162 -0
- package/App/Modules/Designer/Components/DesignerSelectionToolbox/DesignerSelectionToolbox.js +425 -0
- package/App/Modules/Designer/Components/DesignerSelectionToolbox/fontItemUtils.js +48 -0
- package/App/Modules/Designer/Components/Dialog/index.js +125 -0
- package/App/Modules/Designer/Components/EditDesignButton/index.js +128 -0
- package/App/Modules/Designer/Components/FeedbackNotice/index.js +110 -0
- package/App/Modules/Designer/Components/FeedbackNotice/index.test.js +16 -0
- package/App/Modules/Designer/Components/FullScreenView/FullScreenView.js +63 -0
- package/App/Modules/Designer/Components/ImageColorPicker/ImageColorPicker.dev.js +32 -0
- package/App/Modules/Designer/Components/ImageColorPicker/ImageColorPicker.js +430 -0
- package/App/Modules/Designer/Components/ImageColorize/index.js +636 -0
- package/App/Modules/Designer/Components/ImageColorize/index.story.js +73 -0
- package/App/Modules/Designer/Components/ImageControlbox/index.js +302 -0
- package/App/Modules/Designer/Components/ImageEditDialog/ImageThumbnail.js +171 -0
- package/App/Modules/Designer/Components/ImageEditDialog/ImageUpload.js +478 -0
- package/App/Modules/Designer/Components/ImageEditDialog/index.js +716 -0
- package/App/Modules/Designer/Components/ImageEditDialog/res/baseline_colorize_black_24dp.png +0 -0
- package/App/Modules/Designer/Components/ImageEditDialog/res/checkers_tile.png +0 -0
- package/App/Modules/Designer/Components/ImageLibraryFilter/index.js +179 -0
- package/App/Modules/Designer/Components/ImageLibraryThumbnail/Styles.scss +14 -0
- package/App/Modules/Designer/Components/ImageLibraryThumbnail/index.js +165 -0
- package/App/Modules/Designer/Components/ObjectTools/index.js +146 -0
- package/App/Modules/Designer/Components/Select/index.js +171 -0
- package/App/Modules/Designer/Components/TextControlbox/TextFormatIcon.js +48 -0
- package/App/Modules/Designer/Components/TextControlbox/index.js +656 -0
- package/App/Modules/Designer/Components/TextControlbox/index.story.js +109 -0
- package/App/Modules/Designer/Components/TextControlbox/index.test.js +172 -0
- package/App/Modules/Designer/Containers/AddGalleryImage.js +90 -0
- package/App/Modules/Designer/Containers/AddVisualElement.js +166 -0
- package/App/Modules/Designer/Containers/CloseDesignEditor.js +32 -0
- package/App/Modules/Designer/Containers/CloseGraphicsEditorButton.js +32 -0
- package/App/Modules/Designer/Containers/ColorPalettes.js +145 -0
- package/App/Modules/Designer/Containers/DesignAreaControlbox.js +54 -0
- package/App/Modules/Designer/Containers/Designer.js +37 -0
- package/App/Modules/Designer/Containers/DesignerSelectionToolbox.js +116 -0
- package/App/Modules/Designer/Containers/EditDesignButton.js +35 -0
- package/App/Modules/Designer/Containers/ImageEditDialog.js +1130 -0
- package/App/Modules/Designer/Designer.js +231 -0
- package/App/Modules/Designer/DesignerScreen.js +255 -0
- package/App/Modules/Designer/DesignerUI.js +241 -0
- package/App/Modules/Designer/Layouts/DefaultLayout.js +221 -0
- package/App/Modules/Designer/Layouts/Mobile/TwoSideBottomBar.js +50 -0
- package/App/Modules/Designer/Layouts/PopupAreaProvider.js +186 -0
- package/App/Modules/Designer/MultilayerComponents/DesignerClickAwayListener.js +53 -0
- package/App/Modules/Designer/MultilayerComponents/InlineToolboxPortal.js +106 -0
- package/App/Modules/Designer/MultilayerComponents/StandardToolboxPortal.js +64 -0
- package/App/Modules/Designer/Utils/FontFaceRepository.js +82 -0
- package/App/Modules/Designer/Utils/ImageEditUtils.js +104 -0
- package/App/Modules/Designer/Utils/Transformers.js +164 -0
- package/App/Modules/Designer/setupDesigner.js +182 -0
- package/App/Modules/Designer/withActiveCanvas.js +136 -0
- package/App/Modules/Visualization/AlignTargetContainer.js +55 -0
- package/App/Modules/Visualization/CreatorAlignTarget.js +41 -0
- package/App/Modules/Visualization/DefaultVisualizationProvider.js +105 -0
- package/App/Modules/Visualization/DesignerAlignTarget.js +45 -0
- package/App/Modules/Visualization/Utils/getFirstDataURLFromScreenshotsObj.js +20 -0
- package/App/Reducers/Actions.js +297 -0
- package/App/Reducers/ConfigurationMode/Actions.js +21 -0
- package/App/Reducers/ConfigurationMode/Reducer.js +80 -0
- package/App/Reducers/ConfigurationMode/Selectors.js +84 -0
- package/App/Reducers/Configurator/Actions.js +1417 -0
- package/App/Reducers/Configurator/AttributeSelectors.js +32 -0
- package/App/Reducers/Configurator/Modifiers.js +35 -0
- package/App/Reducers/Configurator/Reducer.js +639 -0
- package/App/Reducers/Configurator/Selectors.js +242 -0
- package/App/Reducers/Confirm/Actions.js +84 -0
- package/App/Reducers/Confirm/Reducer.js +30 -0
- package/App/Reducers/DesignArea/Actions.js +76 -0
- package/App/Reducers/DesignArea/DesignElementSelectors.js +114 -0
- package/App/Reducers/DesignArea/MaskSelectors.js +101 -0
- package/App/Reducers/DesignArea/Reducer.js +150 -0
- package/App/Reducers/DesignArea/Selectors.js +1304 -0
- package/App/Reducers/DesignArea/Transformers.js +333 -0
- package/App/Reducers/DesignData/Actions.js +232 -0
- package/App/Reducers/DesignData/Modifiers.js +328 -0
- package/App/Reducers/DesignData/Reducer.js +189 -0
- package/App/Reducers/DesignData/Selectors.js +94 -0
- package/App/Reducers/DesignData/Transformers.js +27 -0
- package/App/Reducers/DesignView/Actions.js +19 -0
- package/App/Reducers/DesignView/Reducer.js +165 -0
- package/App/Reducers/DesignView/Selectors.js +130 -0
- package/App/Reducers/DesignView/Transformers.js +32 -0
- package/App/Reducers/Device/Actions.js +16 -0
- package/App/Reducers/Device/Reducer.js +51 -0
- package/App/Reducers/Fonts/Actions.js +137 -0
- package/App/Reducers/Fonts/Reducer.js +39 -0
- package/App/Reducers/Fonts/Selectors.js +98 -0
- package/App/Reducers/GeneralActions.js +16 -0
- package/App/Reducers/ImageGallery/Actions.js +336 -0
- package/App/Reducers/ImageGallery/Modifiers.js +67 -0
- package/App/Reducers/ImageGallery/Reducer.js +320 -0
- package/App/Reducers/ImageGallery/Selectors.js +206 -0
- package/App/Reducers/Reducer.js +107 -0
- package/App/Reducers/UI/Actions.js +191 -0
- package/App/Reducers/UI/Reducer.js +98 -0
- package/App/Reducers/UI/Selectors.js +32 -0
- package/App/Reducers.js +48 -0
- package/App/Routing.js +168 -0
- package/App/Screens/Configurator/CalculationWidgetScreen.js +84 -0
- package/App/Screens/Configurator/Components/AmountSelection/Styles.scss +17 -0
- package/App/Screens/Configurator/Components/AmountSelection/index.js +170 -0
- package/App/Screens/Configurator/Components/AmountSelection/index.story.js +36 -0
- package/App/Screens/Configurator/Components/CalculationWidget/index.js +652 -0
- package/App/Screens/Configurator/Components/CalculationWidget/index.story.js +154 -0
- package/App/Screens/Configurator/Components/CalculationWidget/index.test.js +142 -0
- package/App/Screens/Configurator/Components/ConfigurationModeSwitch/ConfigurationModeSwitch.js +82 -0
- package/App/Screens/Configurator/Components/ConfigurationModeSwitch/index.js +15 -0
- package/App/Screens/Configurator/Components/Confirm/Styles.scss +0 -0
- package/App/Screens/Configurator/Components/Confirm/index.js +105 -0
- package/App/Screens/Configurator/Components/DesignApproval/index.js +76 -0
- package/App/Screens/Configurator/Components/DesignApproval/index.story.js +27 -0
- package/App/Screens/Configurator/Components/DesignApproval/index.test.js +31 -0
- package/App/Screens/Configurator/Components/Error/index.js +106 -0
- package/App/Screens/Configurator/Components/FallbackVisualization/FallbackVisualization.js +96 -0
- package/App/Screens/Configurator/Components/FileUpload/FileUploadBase.js +1 -0
- package/App/Screens/Configurator/Components/FullScreenView/index.js +304 -0
- package/App/Screens/Configurator/Components/FullScreenView/index.test.js +28 -0
- package/App/Screens/Configurator/Components/ImageLoader/ImageLoader.js +96 -0
- package/App/Screens/Configurator/Components/LandscapeInformation/index.js +75 -0
- package/App/Screens/Configurator/Components/NoVisualization/NoVisualization.js +35 -0
- package/App/Screens/Configurator/Components/PreviewPortal/index.js +249 -0
- package/App/Screens/Configurator/Components/Styles.scss +1 -0
- package/App/Screens/Configurator/Components/Thumbnail/index.js +394 -0
- package/App/Screens/Configurator/Components/Thumbnail/index.test.js +50 -0
- package/App/Screens/Configurator/Components/TotalPrice/TotalPrice.js +57 -0
- package/App/Screens/Configurator/Containers/AmountPrice.js +84 -0
- package/App/Screens/Configurator/Containers/CalculationWidget.js +278 -0
- package/App/Screens/Configurator/Containers/ConfigurationModeSwitch.js +81 -0
- package/App/Screens/Configurator/Containers/Confirm.js +37 -0
- package/App/Screens/Configurator/Containers/DesignApproval.js +129 -0
- package/App/Screens/Configurator/Containers/FallbackVisualization.js +32 -0
- package/App/Screens/Configurator/Containers/FullScreenView.js +47 -0
- package/App/Screens/Configurator/Containers/Thumbnail.js +41 -0
- package/App/Screens/Configurator/Containers/Visualization.js +13 -0
- package/App/Screens/Configurator/DynamicComponents.js +40 -0
- package/App/Screens/Configurator/Screen.js +238 -0
- package/App/Screens/Configurator/ScreenPropTypes.js +45 -0
- package/App/Screens/Configurator/ThemeProvider.js +298 -0
- package/App/Screens/DesignerProductPreview/Constants.js +12 -0
- package/App/Screens/DesignerProductPreview/DesignerProductPreviewManager.js +554 -0
- package/App/Screens/DesignerProductPreview/Screen.js +407 -0
- package/App/Screens.js +42 -0
- package/App/ServiceLocator.js +309 -0
- package/App/Services/AdminareaCommunicationService.js +149 -0
- package/App/Services/AnalyticsService.js +403 -0
- package/App/Services/ConfiguratorService.js +1166 -0
- package/App/Services/DesignDataService.js +3249 -0
- package/App/Services/DesignerService.js +496 -0
- package/App/Services/InteractionService.js +784 -0
- package/App/Services/UIService.js +129 -0
- package/App/Services/VisualizationService.js +844 -0
- package/App/Shared/Components/AcceptDesign/index.js +166 -0
- package/App/Shared/Components/AddToBasket/index.js +194 -0
- package/App/Shared/Components/AddToBasket/index.story.js +47 -0
- package/App/Shared/Components/AlertDialog/index.js +138 -0
- package/App/Shared/Components/AmountInput/Styles.scss +6 -0
- package/App/Shared/Components/AmountInput/index.js +296 -0
- package/App/Shared/Components/AmountInput/index.story.js +29 -0
- package/App/Shared/Components/AmountPrice/index.js +925 -0
- package/App/Shared/Components/AmountPrice/index.story.js +112 -0
- package/App/Shared/Components/AmountPrice/index.test.js +125 -0
- package/App/Shared/Components/Analytics/AnalyticsWrapper.js +49 -0
- package/App/Shared/Components/BulkNames/index.js +319 -0
- package/App/Shared/Components/CallToAction/index.js +220 -0
- package/App/Shared/Components/Header/Header.js +150 -0
- package/App/Shared/Components/Header/index.js +15 -0
- package/App/Shared/Components/Header/index.story.js +143 -0
- package/App/Shared/Components/InformationTag/InformationTag.js +155 -0
- package/App/Shared/Components/LicenseNotice/LicenseNotice.js +148 -0
- package/App/Shared/Components/LicenseNotice/index.js +15 -0
- package/App/Shared/Components/LoadConfiguration/index.js +218 -0
- package/App/Shared/Components/MessageBox/index.js +84 -0
- package/App/Shared/Components/MessageBox/index.story.js +49 -0
- package/App/Shared/Components/Notification/index.js +105 -0
- package/App/Shared/Components/Notification/index.story.js +55 -0
- package/App/Shared/Components/PdfDownload/index.js +150 -0
- package/App/Shared/Components/PlusMinusInput/index.js +118 -0
- package/App/Shared/Components/PriceList/index.js +237 -0
- package/App/Shared/Components/PriceList/index.story.js +114 -0
- package/App/Shared/Components/PriceOverview/index.js +177 -0
- package/App/Shared/Components/PriceOverview/index.story.js +215 -0
- package/App/Shared/Components/ProductVariant/Image.js +75 -0
- package/App/Shared/Components/ProductVariant/Styles.scss +11 -0
- package/App/Shared/Components/ProductVariant/index.js +477 -0
- package/App/Shared/Components/ProductVariant/index.story.js +283 -0
- package/App/Shared/Components/Progress/Progress.js +59 -0
- package/App/Shared/Components/ReceiveOfferForm/index.js +432 -0
- package/App/Shared/Components/ReceiveOfferForm/index.story.js +32 -0
- package/App/Shared/Components/ReceiveOfferForm/index.test.js +36 -0
- package/App/Shared/Components/SaveConfiguration/index.js +286 -0
- package/App/Shared/Components/SendEmail/index.js +103 -0
- package/App/Shared/Components/Stepper/index.js +136 -0
- package/App/Shared/Components/Stepper/index.story.js +38 -0
- package/App/Shared/Components/ToolbarList/index.js +231 -0
- package/App/Shared/Components/ToolbarList/index.story.js +33 -0
- package/App/Shared/Components/VariantChooser/index.js +270 -0
- package/App/Shared/Components/VariantChooser/index.story.js +100 -0
- package/App/Shared/Containers/AlertMessages.js +37 -0
- package/App/Shared/Containers/AmountPrice/AmountPriceAdminareaWrapper.js +40 -0
- package/App/Shared/Containers/AmountPrice/index.js +284 -0
- package/App/Shared/Containers/BulkNames.js +310 -0
- package/App/Shared/Containers/Error.js +37 -0
- package/App/Shared/Containers/GlobalLoader.js +25 -0
- package/App/Shared/Containers/Header/index.js +178 -0
- package/App/Shared/Containers/LicenseNotice/LicenseNotice.js +26 -0
- package/App/Shared/Containers/LicenseNotice/index.js +15 -0
- package/App/Shared/Containers/LoadConfiguration/LoadConfiguration.js +146 -0
- package/App/Shared/Containers/LoadConfiguration/index.js +15 -0
- package/App/Shared/Containers/PdfDownload/index.js +39 -0
- package/App/Shared/Containers/ProductVariant/ProductVariant.js +339 -0
- package/App/Shared/Containers/ProductVariant/index.js +15 -0
- package/App/Shared/Containers/SaveConfiguration.js +49 -0
- package/App/Shared/Containers/SendEmail/SendEmail.js +45 -0
- package/App/Shared/Containers/SendEmail/index.js +15 -0
- package/App/Shared/Providers/DefaultCanvasProvider.js +86 -0
- package/App/Storage.js +17 -0
- package/App/Store.js +87 -0
- package/App/Styles.scss +0 -0
- package/App/Translations.js +88 -0
- package/App/Utils/createMessageInterface.js +65 -0
- package/App/Utils/customClassName.js +12 -0
- package/App/Utils/getContrastText.js +27 -0
- package/App/Utils/getImageUrl.js +32 -0
- package/App/Variables.scss +84 -0
- package/App/configuration.js +421 -0
- package/App/index.js +52 -0
- package/App/initServices.js +67 -0
- package/App/setup.js +22 -0
- package/App/versionInfo.js +8 -0
- package/Framework/Api.js +178 -0
- package/Framework/ComponentContainer.js +165 -0
- package/Framework/Components/Carousel/Styles.scss +85 -0
- package/Framework/Components/Carousel/index.js +322 -0
- package/Framework/Components/Dialog/Style.scss +79 -0
- package/Framework/Components/Dialog/index.js +721 -0
- package/Framework/Components/DialogSelect/Styles.scss +53 -0
- package/Framework/Components/DialogSelect/index.js +331 -0
- package/Framework/Components/Input/index.js +147 -0
- package/Framework/Components/LoadingOverlay/Styles.scss +37 -0
- package/Framework/Components/LoadingOverlay/index.js +33 -0
- package/Framework/Components/Markdown/index.js +62 -0
- package/Framework/Components/Mobile/index.js +33 -0
- package/Framework/CustomError.js +51 -0
- package/Framework/Helpers/TransitionDetect.js +116 -0
- package/Framework/Helpers/isLandscapeMobile.js +14 -0
- package/Framework/Helpers/isMobileDevice.js +17 -0
- package/Framework/Helpers/isMobileSize.js +13 -0
- package/Framework/Mixins.scss +235 -0
- package/Framework/Services/AbstractAdminareaCommunicationService.js +48 -0
- package/Framework/Services/AbstractAsyncService.js +44 -0
- package/Framework/Services/AbstractConfiguratorService.js +47 -0
- package/Framework/Services/AbstractInteractionService.js +50 -0
- package/Framework/Services/AbstractStoreService.js +42 -0
- package/Framework/Services/AbstractUIService.js +53 -0
- package/Framework/Services/AbstractVisualizationService.js +47 -0
- package/Framework/Services/AsyncService.js +93 -0
- package/Framework/Services/StoreService.js +237 -0
- package/Framework/Variables.scss +22 -0
- package/Framework/bindDecorator.js +173 -0
- package/Framework/i18n.js +382 -0
- package/README.md +5 -26
- package/Resources/Icons/MaterialUI/Icons/AddCircle.js +13 -0
- package/Resources/Icons/MaterialUI/Icons/RemoveCircle.js +13 -0
- package/Resources/Icons/MaterialUI/fontFace.scss +37 -0
- package/Resources/Icons/MaterialUI/fonts/MaterialIcons-Regular.eot +0 -0
- package/Resources/Icons/MaterialUI/fonts/MaterialIcons-Regular.svg +2373 -0
- package/Resources/Icons/MaterialUI/fonts/MaterialIcons-Regular.ttf +0 -0
- package/Resources/Icons/MaterialUI/fonts/MaterialIcons-Regular.woff +0 -0
- package/Resources/Icons/MaterialUI/fonts/MaterialIcons-Regular.woff2 +0 -0
- package/Resources/Icons/fonts/ionicons.eot +0 -0
- package/Resources/Icons/fonts/ionicons.svg +2230 -0
- package/Resources/Icons/fonts/ionicons.ttf +0 -0
- package/Resources/Icons/fonts/ionicons.woff +0 -0
- package/Resources/Icons/ionicons.scss +1489 -0
- package/Resources/Icons/ioniconsExtend.scss +1469 -0
- package/Resources/Icons/v4/fontFace.scss +11 -0
- package/Resources/Icons/v4/fonts/ionicons.eot +0 -0
- package/Resources/Icons/v4/fonts/ionicons.svg +2090 -0
- package/Resources/Icons/v4/fonts/ionicons.ttf +0 -0
- package/Resources/Icons/v4/fonts/ionicons.woff +0 -0
- package/Resources/Icons/v4/fonts/ionicons.woff2 +0 -0
- package/Resources/Icons/v4/icons.scss +15 -0
- package/Resources/Icons/v4/iconsExtend.scss +7 -0
- package/Resources/Images/designer_placeholder_logo.svg +1 -0
- package/Resources/Masks/circle.svg +4 -0
- package/Shared/Components/CustomDialog.js +133 -0
- package/Shared/Components/CustomDialogSelect.js +161 -0
- package/Shared/Components/MainButton.js +81 -0
- package/Shared/ErrorTypes/DeferredError.js +51 -0
- package/Shared/HOCs/ResizeDetect/ResizeDetect.dev.js +60 -0
- package/Shared/HOCs/ResizeDetect/ResizeDetect.js +217 -0
- package/Shared/HOCs/getDisplayName.js +10 -0
- package/Shared/HOCs/withFixedChangeHandler.js +46 -0
- package/Shared/PropTypes/ReactComponent.js +13 -0
- package/Shared/Styles/absoluteCenter.js +17 -0
- package/Utils/Array/isIdentical.js +38 -0
- package/Utils/Async/AsyncManager.js +128 -0
- package/Utils/Async/Deferred.js +145 -0
- package/Utils/Async/ObjectLock.js +38 -0
- package/Utils/Decorators/Observable.js +130 -0
- package/Utils/Dev/HOCs/withFilePicker.js +101 -0
- package/Utils/Dev/isDev.js +21 -0
- package/Utils/Events/pointerEvent.js +199 -0
- package/Utils/Events/preventEventDoubling.js +23 -0
- package/Utils/Function/cached.js +64 -0
- package/Utils/Function/createDebounceManager.js +77 -0
- package/Utils/Function/createSelector.js +62 -0
- package/Utils/Function/memoize.js +46 -0
- package/Utils/Function/sendMessage.js +22 -0
- package/Utils/Helper/createSelectionRangeMemo.js +45 -0
- package/Utils/Immutable/set.js +81 -0
- package/Utils/Math/conversions.js +13 -0
- package/Utils/Math/isPositiveNumber.js +12 -0
- package/Utils/Redux/createActionWithGlobalState.js +23 -0
- package/Utils/Styles/combineMediaQueries.js +24 -0
- package/Utils/Styles/createCheckerBoardBackground.js +22 -0
- package/Utils/Test/CallOrderChecker.js +29 -0
- package/Utils/Test/createStoreProvider.js +33 -0
- package/Utils/Test/formDataToJSON.js +20 -0
- package/Utils/Test/mountWithState.js +40 -0
- package/index.js +8 -0
- package/package.json +22 -103
- package/scripts/cpPublic.js +3 -3
- package/scripts/getDefaultWebpackConfig.js +11 -10
- package/src/App/Error/ProductionErrorPage/Style.scss +1 -1
- package/src/App/Modules/Creator/Components/Option/index.test.js +1 -1
- package/src/App/Modules/Creator/Components/OptionAmount/index.test.js +1 -1
- package/src/App/Modules/Creator/Components/ProductPart/__snapshots__/index.test.js.snap +33 -10
- package/src/App/Modules/Creator/Components/ProductPart/index.js +5 -1
- package/src/App/Modules/Creator/Components/ProductPart/index.test.js +14 -1
- package/src/App/Modules/Creator/Components/ProductPartsList/index.js +3 -0
- package/src/App/Modules/Creator/Containers/ProductPartsList/index.js +1 -0
- package/src/App/Modules/Designer/Components/AddGalleryImage/index.story.js +1 -1
- package/src/App/Modules/Designer/Components/ColorPalettes/index.test.jsx +1 -1
- package/src/App/Modules/Designer/Components/DesignAreaControlbox/index.js +21 -4
- package/src/App/Modules/Designer/Components/DesignAreaControlbox/index.test.jsx +1 -1
- package/src/App/Modules/Designer/Components/TextControlbox/index.test.jsx +1 -1
- package/src/App/Modules/Designer/Containers/Designer.js +1 -1
- package/src/App/Modules/Designer/DesignerScreen.js +32 -8
- package/src/App/{Screens/Configurator → Modules/Designer}/DesignerUI.js +42 -26
- package/src/App/Modules/Designer/Layouts/DefaultLayout.js +35 -1
- package/src/App/Modules/Designer/MultilayerComponents/DesignerClickAwayListener.js +18 -0
- package/src/App/Modules/Designer/MultilayerComponents/InlineToolboxPortal.js +54 -0
- package/src/App/Modules/Designer/MultilayerComponents/StandardToolboxPortal.js +38 -0
- package/src/App/Reducers/DesignView/Actions.js +1 -2
- package/src/App/Reducers/DesignView/Reducer.js +2 -10
- package/src/App/Reducers/DesignView/__mocks__/designerViewData.js +0 -1
- package/src/App/Reducers/DesignView/__tests__/Reducer.test.js +0 -22
- package/src/App/Reducers/ImageGallery/Actions.js +1 -1
- package/src/App/Screens/Configurator/Components/CalculationWidget/index.test.jsx +1 -1
- package/src/App/Screens/Configurator/Components/DesignApproval/index.test.jsx +1 -1
- package/src/App/Screens/Configurator/Components/FullScreenView/index.js +3 -2
- package/src/App/Screens/Configurator/Components/FullScreenView/index.test.jsx +1 -1
- package/src/App/Screens/Configurator/Components/PreviewPortal/index.js +7 -3
- package/src/App/Screens/Configurator/Containers/AmountPrice.js +1 -1
- package/src/App/Screens/Configurator/Containers/Confirm.js +1 -1
- package/src/App/Screens/Configurator/Containers/FullScreenView.js +1 -0
- package/src/App/Screens/Configurator/Containers/__tests__/Designer.test.js +1 -1
- package/src/App/Screens/Configurator/Screen.js +4 -2
- package/src/App/Screens/Configurator/__tests__/Screen.test.js +3 -0
- package/src/App/Services/ConfiguratorService.js +25 -4
- package/src/App/Services/InteractionService.js +2 -1
- package/src/App/Services/VisualizationService.js +3 -0
- package/src/App/Services/__tests__/DesignDataService.selectViewForComponent.test.js +0 -53
- package/src/App/Shared/Containers/AlertMessages.js +1 -1
- package/src/App/Shared/Containers/AmountPrice/index.test.js +1 -1
- package/src/App/Shared/Containers/Error.js +1 -1
- package/src/App/Shared/Containers/SaveConfiguration.js +1 -1
- package/src/App/Translations.js +1 -1
- package/src/App/Utils/createMessageInterface.js +10 -0
- package/src/App/configuration.js +3 -0
- package/src/Framework/i18n.js +2 -3
- package/babel.config.js +0 -46
- package/public/ConfigurationMessagingDemo.html +0 -55
- package/scripts/cpPath.js +0 -135
- package/scripts/moveLibToPackageRoot.js +0 -40
- package/scripts/rmDir.js +0 -29
- package/scripts/updateLocalPackages.js +0 -68
- package/scripts/utils/process.js +0 -19
- package/tsconfig.json +0 -22
|
@@ -0,0 +1,1304 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
var _exportNames = {
|
|
7
|
+
getDesignProductionMethods: true,
|
|
8
|
+
getDesignDataByDesignAreaIdentifier: true,
|
|
9
|
+
getDesignDataColorAmounts: true,
|
|
10
|
+
getUsedColorsForDesignAreas: true,
|
|
11
|
+
getAvailableColorsForDesignProductionMethod: true,
|
|
12
|
+
getDesignDataUsedColors: true,
|
|
13
|
+
getPreviousEditedDesignAreaIdentifier: true,
|
|
14
|
+
getDesignAreaIdentifierToOpen: true,
|
|
15
|
+
getFirstEditedDesignAreafromDesignData: true,
|
|
16
|
+
getDesignDataForFilteredDesignAreas: true,
|
|
17
|
+
getDesignDataForSelectedDesignArea: true,
|
|
18
|
+
getSelectedDesignProductionMethod: true,
|
|
19
|
+
isActiveBulkName: true,
|
|
20
|
+
isBulkNamesSelected: true,
|
|
21
|
+
isCanvasUpdateRequired: true,
|
|
22
|
+
hasSelectedBulkName: true,
|
|
23
|
+
getSelectedDesignProductionMethodIdentifier: true,
|
|
24
|
+
getSelectedDesignProductionMethodForDesignArea: true,
|
|
25
|
+
getDesignProductionMethodByIdentifier: true,
|
|
26
|
+
getSelectedDesignAreaProperties: true,
|
|
27
|
+
getActiveDesignAreas: true,
|
|
28
|
+
getSelectedDesignArea: true,
|
|
29
|
+
isAnyDesignAreaSelected: true,
|
|
30
|
+
isThereAFatalError: true,
|
|
31
|
+
getSelectedViewName: true,
|
|
32
|
+
hasPlaceHolderImagesForActiveDesignArea: true,
|
|
33
|
+
isHighlighted: true,
|
|
34
|
+
getMaxUploadSize: true,
|
|
35
|
+
get2DMaxZoom: true,
|
|
36
|
+
getCurrentCanvasSize: true,
|
|
37
|
+
getCanvasSizeFromDesignProductionMethod: true,
|
|
38
|
+
getCanvasSizeFromDesignArea: true,
|
|
39
|
+
getFontSizeMin: true,
|
|
40
|
+
getElementLockState: true,
|
|
41
|
+
hasEngravingBackgroundColor: true,
|
|
42
|
+
isColoringDisabled: true,
|
|
43
|
+
getVisualizationEffect: true,
|
|
44
|
+
designProductionMethodHasEmbroideryVisualizationEffect: true,
|
|
45
|
+
designProductionMethodHasEngravingVisualizationEffect: true,
|
|
46
|
+
getEngravingBackgroundColor: true,
|
|
47
|
+
getVisualizationEffectWithOptions: true,
|
|
48
|
+
getColorPalettes: true,
|
|
49
|
+
getColors: true,
|
|
50
|
+
getColorsWithPalette: true,
|
|
51
|
+
isValidHex: true,
|
|
52
|
+
hexToRgb: true,
|
|
53
|
+
hexToRgbNumbers: true,
|
|
54
|
+
calculateColorDistance: true,
|
|
55
|
+
rgbToHex: true,
|
|
56
|
+
rgbString2hex: true,
|
|
57
|
+
rgbObjToHex: true,
|
|
58
|
+
getColorsFromCanvasData: true,
|
|
59
|
+
getColorsFromCanvasDataWithPalette: true,
|
|
60
|
+
findSmallestFontSizeInCanvasData: true,
|
|
61
|
+
createColorData: true,
|
|
62
|
+
parseColorData: true,
|
|
63
|
+
getCameraViewListForDesignAreaList: true,
|
|
64
|
+
getDesignViewListForDesignAreas: true,
|
|
65
|
+
getDefaultDesignAreaIdentifierFromProductionMethod: true,
|
|
66
|
+
getDefaultColorsFromDesignProductionMethod: true,
|
|
67
|
+
getDefaultTextColor: true,
|
|
68
|
+
isPlaceholderContent: true,
|
|
69
|
+
contentHasText: true,
|
|
70
|
+
getDesignAreaImageCompatibilityInfo: true,
|
|
71
|
+
getCurrentCompatibilityInfoHash: true,
|
|
72
|
+
areHashesCompatible: true,
|
|
73
|
+
getVectorizedImageColor: true,
|
|
74
|
+
areAllDesignAreasEmpty: true,
|
|
75
|
+
hasLastEditedDesignArea: true,
|
|
76
|
+
getDesignAreaPreSelection: true,
|
|
77
|
+
getDesignAreaColorAmount: true,
|
|
78
|
+
getVectorizeForDesignProductionMethods: true,
|
|
79
|
+
getImagesByDesignArea: true
|
|
80
|
+
};
|
|
81
|
+
exports.getDesignProductionMethods = getDesignProductionMethods;
|
|
82
|
+
exports.getDesignDataByDesignAreaIdentifier = getDesignDataByDesignAreaIdentifier;
|
|
83
|
+
exports.getDesignDataColorAmounts = getDesignDataColorAmounts;
|
|
84
|
+
exports.getUsedColorsForDesignAreas = getUsedColorsForDesignAreas;
|
|
85
|
+
exports.getAvailableColorsForDesignProductionMethod = getAvailableColorsForDesignProductionMethod;
|
|
86
|
+
exports.getDesignDataUsedColors = getDesignDataUsedColors;
|
|
87
|
+
exports.getPreviousEditedDesignAreaIdentifier = getPreviousEditedDesignAreaIdentifier;
|
|
88
|
+
exports.getFirstEditedDesignAreafromDesignData = getFirstEditedDesignAreafromDesignData;
|
|
89
|
+
exports.getDesignDataForFilteredDesignAreas = getDesignDataForFilteredDesignAreas;
|
|
90
|
+
exports.getDesignDataForSelectedDesignArea = getDesignDataForSelectedDesignArea;
|
|
91
|
+
exports.getSelectedDesignProductionMethod = getSelectedDesignProductionMethod;
|
|
92
|
+
exports.isActiveBulkName = isActiveBulkName;
|
|
93
|
+
exports.isBulkNamesSelected = isBulkNamesSelected;
|
|
94
|
+
exports.isCanvasUpdateRequired = isCanvasUpdateRequired;
|
|
95
|
+
exports.hasSelectedBulkName = hasSelectedBulkName;
|
|
96
|
+
exports.getSelectedDesignProductionMethodIdentifier = getSelectedDesignProductionMethodIdentifier;
|
|
97
|
+
exports.getSelectedDesignProductionMethodForDesignArea = getSelectedDesignProductionMethodForDesignArea;
|
|
98
|
+
exports.getDesignProductionMethodByIdentifier = getDesignProductionMethodByIdentifier;
|
|
99
|
+
exports.getSelectedDesignAreaProperties = getSelectedDesignAreaProperties;
|
|
100
|
+
exports.getActiveDesignAreas = getActiveDesignAreas;
|
|
101
|
+
exports.getSelectedDesignArea = getSelectedDesignArea;
|
|
102
|
+
exports.isAnyDesignAreaSelected = isAnyDesignAreaSelected;
|
|
103
|
+
exports.isThereAFatalError = isThereAFatalError;
|
|
104
|
+
exports.getSelectedViewName = getSelectedViewName;
|
|
105
|
+
exports.isHighlighted = isHighlighted;
|
|
106
|
+
exports.getMaxUploadSize = getMaxUploadSize;
|
|
107
|
+
exports.get2DMaxZoom = get2DMaxZoom;
|
|
108
|
+
exports.getCurrentCanvasSize = getCurrentCanvasSize;
|
|
109
|
+
exports.getCanvasSizeFromDesignProductionMethod = getCanvasSizeFromDesignProductionMethod;
|
|
110
|
+
exports.getCanvasSizeFromDesignArea = getCanvasSizeFromDesignArea;
|
|
111
|
+
exports.getFontSizeMin = getFontSizeMin;
|
|
112
|
+
exports.getElementLockState = getElementLockState;
|
|
113
|
+
exports.hasEngravingBackgroundColor = hasEngravingBackgroundColor;
|
|
114
|
+
exports.isColoringDisabled = isColoringDisabled;
|
|
115
|
+
exports.getVisualizationEffect = getVisualizationEffect;
|
|
116
|
+
exports.designProductionMethodHasEmbroideryVisualizationEffect = designProductionMethodHasEmbroideryVisualizationEffect;
|
|
117
|
+
exports.designProductionMethodHasEngravingVisualizationEffect = designProductionMethodHasEngravingVisualizationEffect;
|
|
118
|
+
exports.getEngravingBackgroundColor = getEngravingBackgroundColor;
|
|
119
|
+
exports.getVisualizationEffectWithOptions = getVisualizationEffectWithOptions;
|
|
120
|
+
exports.getColors = getColors;
|
|
121
|
+
exports.getColorsWithPalette = getColorsWithPalette;
|
|
122
|
+
exports.getColorsFromCanvasData = getColorsFromCanvasData;
|
|
123
|
+
exports.getColorsFromCanvasDataWithPalette = getColorsFromCanvasDataWithPalette;
|
|
124
|
+
exports.findSmallestFontSizeInCanvasData = findSmallestFontSizeInCanvasData;
|
|
125
|
+
exports.getImagesByDesignArea = exports.getVectorizeForDesignProductionMethods = exports.getDesignAreaColorAmount = exports.getDesignAreaPreSelection = exports.hasLastEditedDesignArea = exports.areAllDesignAreasEmpty = exports.getVectorizedImageColor = exports.areHashesCompatible = exports.getCurrentCompatibilityInfoHash = exports.getDesignAreaImageCompatibilityInfo = exports.contentHasText = exports.isPlaceholderContent = exports.getDefaultTextColor = exports.getDefaultColorsFromDesignProductionMethod = exports.getDefaultDesignAreaIdentifierFromProductionMethod = exports.getDesignViewListForDesignAreas = exports.getCameraViewListForDesignAreaList = exports.parseColorData = exports.createColorData = exports.rgbObjToHex = exports.rgbString2hex = exports.rgbToHex = exports.calculateColorDistance = exports.hexToRgbNumbers = exports.hexToRgb = exports.isValidHex = exports.getColorPalettes = exports.hasPlaceHolderImagesForActiveDesignArea = exports.getDesignAreaIdentifierToOpen = void 0;
|
|
126
|
+
|
|
127
|
+
var _get = _interopRequireDefault(require("lodash/get"));
|
|
128
|
+
|
|
129
|
+
var _first = _interopRequireDefault(require("lodash/first"));
|
|
130
|
+
|
|
131
|
+
var _find = _interopRequireDefault(require("lodash/find"));
|
|
132
|
+
|
|
133
|
+
var _findKey = _interopRequireDefault(require("lodash/findKey"));
|
|
134
|
+
|
|
135
|
+
var _uniq = _interopRequireDefault(require("lodash/uniq"));
|
|
136
|
+
|
|
137
|
+
var _uniqWith = _interopRequireDefault(require("lodash/uniqWith"));
|
|
138
|
+
|
|
139
|
+
var _isEmpty = _interopRequireDefault(require("lodash/isEmpty"));
|
|
140
|
+
|
|
141
|
+
var _replace = _interopRequireDefault(require("lodash/replace"));
|
|
142
|
+
|
|
143
|
+
var _isObject = _interopRequireDefault(require("lodash/isObject"));
|
|
144
|
+
|
|
145
|
+
var _uniqBy = _interopRequireDefault(require("lodash/uniqBy"));
|
|
146
|
+
|
|
147
|
+
var _cloneDeep = _interopRequireDefault(require("lodash/cloneDeep"));
|
|
148
|
+
|
|
149
|
+
var _intersectionBy = _interopRequireDefault(require("lodash/intersectionBy"));
|
|
150
|
+
|
|
151
|
+
var _isEqual = _interopRequireDefault(require("lodash/isEqual"));
|
|
152
|
+
|
|
153
|
+
var _values = _interopRequireDefault(require("lodash/values"));
|
|
154
|
+
|
|
155
|
+
var _createSelector = _interopRequireDefault(require("../../../Utils/Function/createSelector"));
|
|
156
|
+
|
|
157
|
+
var _configuration = require("../../configuration");
|
|
158
|
+
|
|
159
|
+
var _DesignDataService = require("../../Services/DesignDataService");
|
|
160
|
+
|
|
161
|
+
var _Selectors = require("../Configurator/Selectors");
|
|
162
|
+
|
|
163
|
+
var _Transformers = require("../DesignView/Transformers");
|
|
164
|
+
|
|
165
|
+
var _Selectors2 = require("../ImageGallery/Selectors");
|
|
166
|
+
|
|
167
|
+
var _Transformers2 = require("./Transformers");
|
|
168
|
+
|
|
169
|
+
var _Actions = require("../UI/Actions");
|
|
170
|
+
|
|
171
|
+
var _MaskSelectors = require("./MaskSelectors");
|
|
172
|
+
|
|
173
|
+
Object.keys(_MaskSelectors).forEach(function (key) {
|
|
174
|
+
if (key === "default" || key === "__esModule") return;
|
|
175
|
+
if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
|
|
176
|
+
if (key in exports && exports[key] === _MaskSelectors[key]) return;
|
|
177
|
+
Object.defineProperty(exports, key, {
|
|
178
|
+
enumerable: true,
|
|
179
|
+
get: function get() {
|
|
180
|
+
return _MaskSelectors[key];
|
|
181
|
+
}
|
|
182
|
+
});
|
|
183
|
+
});
|
|
184
|
+
|
|
185
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
|
186
|
+
|
|
187
|
+
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
188
|
+
|
|
189
|
+
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."); }
|
|
190
|
+
|
|
191
|
+
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; }
|
|
192
|
+
|
|
193
|
+
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
194
|
+
|
|
195
|
+
function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }
|
|
196
|
+
|
|
197
|
+
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."); }
|
|
198
|
+
|
|
199
|
+
function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); }
|
|
200
|
+
|
|
201
|
+
function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }
|
|
202
|
+
|
|
203
|
+
function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
|
|
204
|
+
|
|
205
|
+
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) { symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); } keys.push.apply(keys, symbols); } return keys; }
|
|
206
|
+
|
|
207
|
+
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
|
|
208
|
+
|
|
209
|
+
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; }
|
|
210
|
+
|
|
211
|
+
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; } } }; }
|
|
212
|
+
|
|
213
|
+
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); }
|
|
214
|
+
|
|
215
|
+
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; }
|
|
216
|
+
|
|
217
|
+
function getDesignProductionMethods(state) {
|
|
218
|
+
return (0, _get["default"])(state, 'designArea.selectedDesignArea.designProductionMethods');
|
|
219
|
+
}
|
|
220
|
+
|
|
221
|
+
function getDesignDataByDesignAreaIdentifier(_ref, designAreaIdentifier) {
|
|
222
|
+
var configurator = _ref.configurator;
|
|
223
|
+
var configuration = configurator.configuration;
|
|
224
|
+
return (0, _get["default"])(configuration, "designdata.".concat(designAreaIdentifier), {});
|
|
225
|
+
}
|
|
226
|
+
|
|
227
|
+
function getDesignDataColorAmounts(_ref2) {
|
|
228
|
+
var configurator = _ref2.configurator;
|
|
229
|
+
var configuration = configurator.configuration;
|
|
230
|
+
var designdata = (0, _get["default"])(configuration, 'designdata', {});
|
|
231
|
+
var colorAmounts = {};
|
|
232
|
+
|
|
233
|
+
for (var key in designdata) {
|
|
234
|
+
if (!designdata.hasOwnProperty(key)) {
|
|
235
|
+
continue;
|
|
236
|
+
}
|
|
237
|
+
|
|
238
|
+
colorAmounts[key] = designdata[key].colorAmount;
|
|
239
|
+
}
|
|
240
|
+
|
|
241
|
+
return colorAmounts;
|
|
242
|
+
}
|
|
243
|
+
|
|
244
|
+
function getUsedColorsForDesignAreas(state) {
|
|
245
|
+
var designdata = (0, _get["default"])(state, 'configurator.configuration.designdata', {});
|
|
246
|
+
var colors = [];
|
|
247
|
+
|
|
248
|
+
for (var key in designdata) {
|
|
249
|
+
if (!designdata.hasOwnProperty(key)) {
|
|
250
|
+
continue;
|
|
251
|
+
}
|
|
252
|
+
|
|
253
|
+
if (!(0, _isEmpty["default"])(designdata[key].canvasData)) {
|
|
254
|
+
var _iterator = _createForOfIteratorHelper(designdata[key].canvasData.objects),
|
|
255
|
+
_step;
|
|
256
|
+
|
|
257
|
+
try {
|
|
258
|
+
for (_iterator.s(); !(_step = _iterator.n()).done;) {
|
|
259
|
+
var object = _step.value;
|
|
260
|
+
var objectColors = void 0;
|
|
261
|
+
|
|
262
|
+
if (object.type === 'Image') {
|
|
263
|
+
objectColors = (0, _values["default"])((0, _get["default"])(object, 'imageData.operations.vectorizeColorsMap')) || [];
|
|
264
|
+
} else if (object.type === 'Text') {
|
|
265
|
+
objectColors = object.style.colors;
|
|
266
|
+
}
|
|
267
|
+
|
|
268
|
+
var _iterator2 = _createForOfIteratorHelper(objectColors),
|
|
269
|
+
_step2;
|
|
270
|
+
|
|
271
|
+
try {
|
|
272
|
+
for (_iterator2.s(); !(_step2 = _iterator2.n()).done;) {
|
|
273
|
+
var colorObj = _step2.value;
|
|
274
|
+
|
|
275
|
+
var color = _objectSpread({}, colorObj);
|
|
276
|
+
|
|
277
|
+
var colorData = color.identifier;
|
|
278
|
+
|
|
279
|
+
try {
|
|
280
|
+
colorData = JSON.parse(color.identifier);
|
|
281
|
+
} catch (e) {
|
|
282
|
+
// eslint-disable-next-line no-console
|
|
283
|
+
console.error("failed to parse color data: ".concat(color.identifier));
|
|
284
|
+
}
|
|
285
|
+
|
|
286
|
+
if ((0, _isObject["default"])(colorData) && colorData.custom) {
|
|
287
|
+
continue;
|
|
288
|
+
}
|
|
289
|
+
|
|
290
|
+
if ((0, _isObject["default"])(colorData)) {
|
|
291
|
+
color.identifier = colorData.color;
|
|
292
|
+
color.palette = colorData.palette;
|
|
293
|
+
}
|
|
294
|
+
|
|
295
|
+
var isColorValueHex = isValidHex(color.value);
|
|
296
|
+
color.hex_value = (0, _replace["default"])(isColorValueHex ? color.value : rgbString2hex(color.value), '#', '');
|
|
297
|
+
colors.push(color);
|
|
298
|
+
}
|
|
299
|
+
} catch (err) {
|
|
300
|
+
_iterator2.e(err);
|
|
301
|
+
} finally {
|
|
302
|
+
_iterator2.f();
|
|
303
|
+
}
|
|
304
|
+
}
|
|
305
|
+
} catch (err) {
|
|
306
|
+
_iterator.e(err);
|
|
307
|
+
} finally {
|
|
308
|
+
_iterator.f();
|
|
309
|
+
}
|
|
310
|
+
}
|
|
311
|
+
}
|
|
312
|
+
|
|
313
|
+
return (0, _uniqBy["default"])(colors, 'identifier');
|
|
314
|
+
}
|
|
315
|
+
|
|
316
|
+
function getAvailableColorsForDesignProductionMethod(productionMethod) {
|
|
317
|
+
var _ref4;
|
|
318
|
+
|
|
319
|
+
if (!productionMethod || _typeof(productionMethod) !== 'object') {
|
|
320
|
+
return [];
|
|
321
|
+
}
|
|
322
|
+
|
|
323
|
+
var colorPalettes = productionMethod.colorPalettes;
|
|
324
|
+
var colorsArray = colorPalettes.map(function (_ref3) {
|
|
325
|
+
var identifier = _ref3.identifier,
|
|
326
|
+
colors = _ref3.colors;
|
|
327
|
+
return colors.map(function (color) {
|
|
328
|
+
return _objectSpread(_objectSpread({}, color), {}, {
|
|
329
|
+
paletteIdentifier: identifier
|
|
330
|
+
});
|
|
331
|
+
});
|
|
332
|
+
});
|
|
333
|
+
return (_ref4 = []).concat.apply(_ref4, _toConsumableArray(colorsArray));
|
|
334
|
+
}
|
|
335
|
+
|
|
336
|
+
function getDesignDataUsedColors(state) {
|
|
337
|
+
var usedColors = getUsedColorsForDesignAreas(state);
|
|
338
|
+
var prodMethodColors = getAvailableColorsForDesignProductionMethod(getSelectedDesignProductionMethod(state));
|
|
339
|
+
return (0, _intersectionBy["default"])(usedColors, prodMethodColors, 'identifier');
|
|
340
|
+
}
|
|
341
|
+
|
|
342
|
+
function getPreviousEditedDesignAreaIdentifier(state) {
|
|
343
|
+
var previousEditedDesignArea = state.designArea.previousEditedDesignArea;
|
|
344
|
+
return previousEditedDesignArea.identifier;
|
|
345
|
+
}
|
|
346
|
+
|
|
347
|
+
var getDesignAreaIdentifierToOpen = function getDesignAreaIdentifierToOpen(state) {
|
|
348
|
+
var identifier = state.designArea.selectedDesignArea.identifier;
|
|
349
|
+
var previousEditedDesignAreaIdentifier = getPreviousEditedDesignAreaIdentifier(state);
|
|
350
|
+
var firstEditedDesignAreafromDesignData = getFirstEditedDesignAreafromDesignData(state);
|
|
351
|
+
var defaultDesignAreaFromProductionMethod = getDefaultDesignAreaIdentifierFromProductionMethod(state);
|
|
352
|
+
return identifier || previousEditedDesignAreaIdentifier || firstEditedDesignAreafromDesignData || defaultDesignAreaFromProductionMethod || null;
|
|
353
|
+
};
|
|
354
|
+
|
|
355
|
+
exports.getDesignAreaIdentifierToOpen = getDesignAreaIdentifierToOpen;
|
|
356
|
+
|
|
357
|
+
function getFirstEditedDesignAreafromDesignData(state) {
|
|
358
|
+
var designdata = state.configurator.configuration.designdata;
|
|
359
|
+
var editedDesignAreaIdentifier = (0, _findKey["default"])(designdata, function (_ref5) {
|
|
360
|
+
var canvasData = _ref5.canvasData;
|
|
361
|
+
return canvasData && canvasData.objects.length > 0;
|
|
362
|
+
});
|
|
363
|
+
return editedDesignAreaIdentifier;
|
|
364
|
+
}
|
|
365
|
+
|
|
366
|
+
function getDesignDataForFilteredDesignAreas(state) {
|
|
367
|
+
var filteredDesignAreas = state.designArea.filteredDesignAreas;
|
|
368
|
+
var hasDesign = {};
|
|
369
|
+
filteredDesignAreas.forEach(function (designArea) {
|
|
370
|
+
hasDesign[designArea.identifier] = (0, _get["default"])(getDesignDataByDesignAreaIdentifier(state, designArea.identifier), 'canvasData.objects.length', 0) > 0;
|
|
371
|
+
});
|
|
372
|
+
return hasDesign;
|
|
373
|
+
}
|
|
374
|
+
|
|
375
|
+
function getDesignDataForSelectedDesignArea(state) {
|
|
376
|
+
var selectedDesignArea = (0, _get["default"])(state, 'designArea.selectedDesignArea');
|
|
377
|
+
|
|
378
|
+
if (!selectedDesignArea) {
|
|
379
|
+
return {};
|
|
380
|
+
}
|
|
381
|
+
|
|
382
|
+
return getDesignDataByDesignAreaIdentifier(state, selectedDesignArea.identifier);
|
|
383
|
+
}
|
|
384
|
+
|
|
385
|
+
function getSelectedDesignProductionMethod(state) {
|
|
386
|
+
var designProductionMethods = getDesignProductionMethods(state);
|
|
387
|
+
var designAreaData = getDesignDataForSelectedDesignArea(state);
|
|
388
|
+
var designProductionMethodIdentifier = designAreaData.designProductionMethodIdentifier;
|
|
389
|
+
return (0, _find["default"])(designProductionMethods, {
|
|
390
|
+
identifier: designProductionMethodIdentifier
|
|
391
|
+
}) || (0, _first["default"])(designProductionMethods);
|
|
392
|
+
}
|
|
393
|
+
|
|
394
|
+
function isActiveBulkName(state) {
|
|
395
|
+
var designArea = state.designArea;
|
|
396
|
+
var designedAreas = (0, _get["default"])(designArea, 'filteredDesignAreas', []);
|
|
397
|
+
|
|
398
|
+
var _iterator3 = _createForOfIteratorHelper(designedAreas),
|
|
399
|
+
_step3;
|
|
400
|
+
|
|
401
|
+
try {
|
|
402
|
+
for (_iterator3.s(); !(_step3 = _iterator3.n()).done;) {
|
|
403
|
+
var da = _step3.value;
|
|
404
|
+
|
|
405
|
+
if (da.designProductionMethods && da.designProductionMethods.length > 0) {
|
|
406
|
+
var _iterator4 = _createForOfIteratorHelper(da.designProductionMethods),
|
|
407
|
+
_step4;
|
|
408
|
+
|
|
409
|
+
try {
|
|
410
|
+
for (_iterator4.s(); !(_step4 = _iterator4.n()).done;) {
|
|
411
|
+
var designProductionMethod = _step4.value;
|
|
412
|
+
|
|
413
|
+
if (designProductionMethod.allowBulkNames) {
|
|
414
|
+
return true;
|
|
415
|
+
}
|
|
416
|
+
}
|
|
417
|
+
} catch (err) {
|
|
418
|
+
_iterator4.e(err);
|
|
419
|
+
} finally {
|
|
420
|
+
_iterator4.f();
|
|
421
|
+
}
|
|
422
|
+
}
|
|
423
|
+
}
|
|
424
|
+
} catch (err) {
|
|
425
|
+
_iterator3.e(err);
|
|
426
|
+
} finally {
|
|
427
|
+
_iterator3.f();
|
|
428
|
+
}
|
|
429
|
+
|
|
430
|
+
return false;
|
|
431
|
+
}
|
|
432
|
+
|
|
433
|
+
function isBulkNamesSelected(configuratorState) {
|
|
434
|
+
var configuration = configuratorState.configuration;
|
|
435
|
+
var designData = (0, _get["default"])(configuration, 'designdata', {}) || {};
|
|
436
|
+
|
|
437
|
+
for (var _i = 0, _Object$values = Object.values(designData); _i < _Object$values.length; _i++) {
|
|
438
|
+
var dd = _Object$values[_i];
|
|
439
|
+
|
|
440
|
+
if (dd.canvasData && dd.canvasData.objects.length > 0) {
|
|
441
|
+
var _iterator5 = _createForOfIteratorHelper(dd.canvasData.objects),
|
|
442
|
+
_step5;
|
|
443
|
+
|
|
444
|
+
try {
|
|
445
|
+
for (_iterator5.s(); !(_step5 = _iterator5.n()).done;) {
|
|
446
|
+
var object = _step5.value;
|
|
447
|
+
|
|
448
|
+
if (object.isBulkName) {
|
|
449
|
+
return true;
|
|
450
|
+
}
|
|
451
|
+
}
|
|
452
|
+
} catch (err) {
|
|
453
|
+
_iterator5.e(err);
|
|
454
|
+
} finally {
|
|
455
|
+
_iterator5.f();
|
|
456
|
+
}
|
|
457
|
+
}
|
|
458
|
+
}
|
|
459
|
+
|
|
460
|
+
return false;
|
|
461
|
+
}
|
|
462
|
+
|
|
463
|
+
function isCanvasUpdateRequired(_ref6, _ref7) {
|
|
464
|
+
var position = _ref6.position;
|
|
465
|
+
var width = _ref7.width,
|
|
466
|
+
height = _ref7.height;
|
|
467
|
+
return position.width !== width || position.height !== height;
|
|
468
|
+
}
|
|
469
|
+
|
|
470
|
+
function hasSelectedBulkName(designArea) {
|
|
471
|
+
var canvasDataObjs = (0, _get["default"])(designArea, 'canvasData.objects', []);
|
|
472
|
+
return canvasDataObjs.filter(function (obj) {
|
|
473
|
+
return obj.type === 'Text' && obj.isBulkName;
|
|
474
|
+
}).length > 0;
|
|
475
|
+
}
|
|
476
|
+
|
|
477
|
+
function getSelectedDesignProductionMethodIdentifier(state) {
|
|
478
|
+
var configuration = state.configurator.configuration,
|
|
479
|
+
selectedDesignArea = state.designArea.selectedDesignArea;
|
|
480
|
+
return (0, _get["default"])(configuration, "designdata.".concat(selectedDesignArea.identifier, ".designProductionMethodIdentifier"));
|
|
481
|
+
}
|
|
482
|
+
|
|
483
|
+
function getSelectedDesignProductionMethodForDesignArea(state, designArea) {
|
|
484
|
+
var designProductionMethods = designArea.designProductionMethods;
|
|
485
|
+
var designAreaData = getDesignDataByDesignAreaIdentifier(state, designArea.identifier);
|
|
486
|
+
|
|
487
|
+
var _ref8 = designAreaData || {},
|
|
488
|
+
designProductionMethodIdentifier = _ref8.designProductionMethodIdentifier;
|
|
489
|
+
|
|
490
|
+
return (0, _find["default"])(designProductionMethods, {
|
|
491
|
+
identifier: designProductionMethodIdentifier
|
|
492
|
+
}) || (0, _first["default"])(designProductionMethods);
|
|
493
|
+
}
|
|
494
|
+
|
|
495
|
+
function getDesignProductionMethodByIdentifier(state, identifier) {
|
|
496
|
+
var designProductionMethods = getDesignProductionMethods(state);
|
|
497
|
+
return (0, _find["default"])(designProductionMethods, {
|
|
498
|
+
identifier: identifier
|
|
499
|
+
});
|
|
500
|
+
}
|
|
501
|
+
|
|
502
|
+
function getSelectedDesignAreaProperties(state) {
|
|
503
|
+
var designArea = state.designArea;
|
|
504
|
+
var filteredDesignAreas = designArea.filteredDesignAreas,
|
|
505
|
+
selectedDesignArea = designArea.selectedDesignArea;
|
|
506
|
+
|
|
507
|
+
if (!filteredDesignAreas || !selectedDesignArea) {
|
|
508
|
+
return {};
|
|
509
|
+
}
|
|
510
|
+
|
|
511
|
+
if (!selectedDesignArea) {
|
|
512
|
+
return {};
|
|
513
|
+
}
|
|
514
|
+
|
|
515
|
+
var designAreaData = getDesignDataForSelectedDesignArea(state);
|
|
516
|
+
var colorAmount = designAreaData.colorAmount;
|
|
517
|
+
var designProductionMethod = getSelectedDesignProductionMethod(state);
|
|
518
|
+
var maxColorAmount = (0, _get["default"])(designProductionMethod, 'options.maxColorAmount', 0);
|
|
519
|
+
var hasEngravingBackgroundColors = designProductionMethodHasEngravingVisualizationEffect(designProductionMethod);
|
|
520
|
+
return {
|
|
521
|
+
filteredDesignAreas: filteredDesignAreas,
|
|
522
|
+
colorAmount: colorAmount,
|
|
523
|
+
maxColorAmount: maxColorAmount,
|
|
524
|
+
hasEngravingBackgroundColors: hasEngravingBackgroundColors,
|
|
525
|
+
designProductionMethod: designProductionMethod,
|
|
526
|
+
selectedDesignArea: selectedDesignArea
|
|
527
|
+
};
|
|
528
|
+
}
|
|
529
|
+
|
|
530
|
+
function getActiveDesignAreas(state) {
|
|
531
|
+
var filteredDesignAreas = state.designArea.filteredDesignAreas;
|
|
532
|
+
return filteredDesignAreas.reduce(function (obj, designArea) {
|
|
533
|
+
var designData = getDesignDataByDesignAreaIdentifier(state, designArea.identifier);
|
|
534
|
+
return _objectSpread(_objectSpread({}, obj), {}, _defineProperty({}, designArea.identifier, (0, _get["default"])(designData, 'canvasData.objects.length', 0) > 0));
|
|
535
|
+
}, {});
|
|
536
|
+
}
|
|
537
|
+
|
|
538
|
+
function getSelectedDesignArea(state) {
|
|
539
|
+
return (0, _get["default"])(state, 'designArea.selectedDesignArea');
|
|
540
|
+
}
|
|
541
|
+
|
|
542
|
+
function isAnyDesignAreaSelected(state) {
|
|
543
|
+
return Object.keys(getSelectedDesignArea(state)).length > 0;
|
|
544
|
+
}
|
|
545
|
+
|
|
546
|
+
function isIt500Error(_ref9) {
|
|
547
|
+
var error = _ref9.ui.error;
|
|
548
|
+
return error && error.response && error.response.status === 500;
|
|
549
|
+
}
|
|
550
|
+
|
|
551
|
+
function isConfigurationNotFound(_ref10) {
|
|
552
|
+
var error = _ref10.ui.error;
|
|
553
|
+
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;
|
|
554
|
+
}
|
|
555
|
+
|
|
556
|
+
function isThereAFatalError(state) {
|
|
557
|
+
return isIt500Error(state) || isConfigurationNotFound(state);
|
|
558
|
+
}
|
|
559
|
+
|
|
560
|
+
function getSelectedViewName(designArea) {
|
|
561
|
+
return (0, _get["default"])(designArea, 'customData.selectedCameraView') || // used by the 3D camera positions
|
|
562
|
+
(0, _get["default"])(designArea, 'designView.identifier') || // used by the 2D design view associations
|
|
563
|
+
(0, _get["default"])(designArea, 'identifier') || // fallback to the design area identifier (currently no known use case)
|
|
564
|
+
'default' // if no design area selected use the default view
|
|
565
|
+
;
|
|
566
|
+
}
|
|
567
|
+
|
|
568
|
+
var hasPlaceHolderImagesForActiveDesignArea = function hasPlaceHolderImagesForActiveDesignArea(state) {
|
|
569
|
+
var designData = getDesignDataForSelectedDesignArea(state);
|
|
570
|
+
var canvasObjects = (0, _get["default"])(designData, 'canvasData.objects') || null;
|
|
571
|
+
return canvasObjects && !!canvasObjects.find(function (object) {
|
|
572
|
+
return object.type === 'Image' && object.imageData.isPlaceHolderImage;
|
|
573
|
+
});
|
|
574
|
+
};
|
|
575
|
+
|
|
576
|
+
exports.hasPlaceHolderImagesForActiveDesignArea = hasPlaceHolderImagesForActiveDesignArea;
|
|
577
|
+
|
|
578
|
+
function isHighlighted(state) {
|
|
579
|
+
return (0, _get["default"])(state, 'designArea.showHighlight') || false;
|
|
580
|
+
}
|
|
581
|
+
|
|
582
|
+
function getMaxUploadSize(state) {
|
|
583
|
+
return (0, _get["default"])(state, 'designArea.uploadMaxSize') || 20000000;
|
|
584
|
+
}
|
|
585
|
+
|
|
586
|
+
function get2DMaxZoom(state) {
|
|
587
|
+
return (0, _get["default"])(state, 'designArea.maxZoom2d') || 2.0;
|
|
588
|
+
}
|
|
589
|
+
|
|
590
|
+
var zeroSize = {
|
|
591
|
+
width: 0,
|
|
592
|
+
height: 0
|
|
593
|
+
};
|
|
594
|
+
/**
|
|
595
|
+
* Returns the canvas size in mm-s
|
|
596
|
+
* @param state
|
|
597
|
+
* @param defaultSize
|
|
598
|
+
* @returns {*}
|
|
599
|
+
*/
|
|
600
|
+
|
|
601
|
+
function getCurrentCanvasSize(state) {
|
|
602
|
+
var defaultSize = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : zeroSize;
|
|
603
|
+
|
|
604
|
+
var _getSelectedDesignAre = getSelectedDesignAreaProperties(state),
|
|
605
|
+
designProductionMethod = _getSelectedDesignAre.designProductionMethod;
|
|
606
|
+
|
|
607
|
+
if (!designProductionMethod) {
|
|
608
|
+
return defaultSize;
|
|
609
|
+
}
|
|
610
|
+
|
|
611
|
+
return getCanvasSizeFromDesignProductionMethod(designProductionMethod);
|
|
612
|
+
}
|
|
613
|
+
|
|
614
|
+
function getCanvasSizeFromDesignProductionMethod(designProductionMethod) {
|
|
615
|
+
var defaultSize = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : zeroSize;
|
|
616
|
+
var width = designProductionMethod.width,
|
|
617
|
+
height = designProductionMethod.height,
|
|
618
|
+
dpi = designProductionMethod.dpi;
|
|
619
|
+
|
|
620
|
+
if (!width || !height) {
|
|
621
|
+
return defaultSize;
|
|
622
|
+
}
|
|
623
|
+
|
|
624
|
+
return {
|
|
625
|
+
width: width,
|
|
626
|
+
height: height,
|
|
627
|
+
isMetric: true,
|
|
628
|
+
dpi: dpi || (0, _configuration.getConf)('designer.dpi', 300)
|
|
629
|
+
};
|
|
630
|
+
}
|
|
631
|
+
|
|
632
|
+
function getCanvasSizeFromDesignArea(state, designArea) {
|
|
633
|
+
var defaultSize = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : zeroSize;
|
|
634
|
+
var designProductionMethod = getSelectedDesignProductionMethodForDesignArea(state, designArea);
|
|
635
|
+
return designProductionMethod ? getCanvasSizeFromDesignProductionMethod(designProductionMethod) : defaultSize;
|
|
636
|
+
}
|
|
637
|
+
|
|
638
|
+
function getFontSizeMin(state) {
|
|
639
|
+
var designProductionMethodIdentifier = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
|
|
640
|
+
var designProductionMethod = designProductionMethodIdentifier ? getDesignProductionMethodByIdentifier(state, designProductionMethodIdentifier) : getSelectedDesignProductionMethod(state);
|
|
641
|
+
return Number((0, _get["default"])(designProductionMethod, 'options.minFontSize')) || 5;
|
|
642
|
+
}
|
|
643
|
+
|
|
644
|
+
function getElementLockState(state) {
|
|
645
|
+
var designProductionMethodIdentifier = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
|
|
646
|
+
var designProductionMethod = designProductionMethodIdentifier ? getDesignProductionMethodByIdentifier(state, designProductionMethodIdentifier) : getSelectedDesignProductionMethod(state);
|
|
647
|
+
return (0, _get["default"])(designProductionMethod, 'designElementsLocked');
|
|
648
|
+
}
|
|
649
|
+
|
|
650
|
+
function hasEngravingBackgroundColor(state) {
|
|
651
|
+
var designProductionMethodIdentifier = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
|
|
652
|
+
var designProductionMethod = designProductionMethodIdentifier ? getDesignProductionMethodByIdentifier(state, designProductionMethodIdentifier) : getSelectedDesignProductionMethod(state);
|
|
653
|
+
return designProductionMethodHasEngravingVisualizationEffect(designProductionMethod);
|
|
654
|
+
}
|
|
655
|
+
|
|
656
|
+
function isColoringDisabled(state) {
|
|
657
|
+
var designProductionMethodIdentifier = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
|
|
658
|
+
var designProductionMethod = designProductionMethodIdentifier ? getDesignProductionMethodByIdentifier(state, designProductionMethodIdentifier) : getSelectedDesignProductionMethod(state);
|
|
659
|
+
var visualizationEffect = (0, _get["default"])(designProductionMethod, 'options.visualizationEffect', 'print');
|
|
660
|
+
return ['engraving', 'embossing'].indexOf(visualizationEffect) !== -1;
|
|
661
|
+
}
|
|
662
|
+
|
|
663
|
+
function getVisualizationEffect(designProductionMethod) {
|
|
664
|
+
return (0, _get["default"])(designProductionMethod, 'options.visualizationEffect', 'print');
|
|
665
|
+
}
|
|
666
|
+
|
|
667
|
+
function designProductionMethodHasEmbroideryVisualizationEffect(designProductionMethod) {
|
|
668
|
+
return 'embroidery' === getVisualizationEffect(designProductionMethod);
|
|
669
|
+
}
|
|
670
|
+
|
|
671
|
+
function designProductionMethodHasEngravingVisualizationEffect(designProductionMethod) {
|
|
672
|
+
return 'engraving' === getVisualizationEffect(designProductionMethod);
|
|
673
|
+
}
|
|
674
|
+
|
|
675
|
+
function getEngravingBackgroundColor(state, designProductionMethod) {
|
|
676
|
+
var variantIdentifier = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;
|
|
677
|
+
|
|
678
|
+
var _designProductionMethod = designProductionMethod || getSelectedDesignProductionMethod(state) || {};
|
|
679
|
+
|
|
680
|
+
var engravingBackgroundColors = _designProductionMethod.engravingBackgroundColors;
|
|
681
|
+
return (0, _get["default"])((0, _find["default"])(engravingBackgroundColors, {
|
|
682
|
+
itemIdentifier: variantIdentifier || (0, _Selectors.getSelectedVariantIdentifier)((0, _Selectors.getConfigurator)(state))
|
|
683
|
+
}), 'colorHex', 'rgba(0, 0, 0, 0.5)');
|
|
684
|
+
}
|
|
685
|
+
|
|
686
|
+
function getVisualizationEffectWithOptions(state, designArea) {
|
|
687
|
+
var variantIdentifier = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;
|
|
688
|
+
var designProductionMethod = getSelectedDesignProductionMethodForDesignArea(state, designArea);
|
|
689
|
+
var effect = getVisualizationEffect(designProductionMethod);
|
|
690
|
+
|
|
691
|
+
var effectOptions = _objectSpread({}, designProductionMethodHasEngravingVisualizationEffect(designProductionMethod) && {
|
|
692
|
+
fillColor: getEngravingBackgroundColor(state, designProductionMethod, variantIdentifier)
|
|
693
|
+
});
|
|
694
|
+
|
|
695
|
+
return {
|
|
696
|
+
effect: effect,
|
|
697
|
+
effectOptions: effectOptions
|
|
698
|
+
};
|
|
699
|
+
}
|
|
700
|
+
|
|
701
|
+
var getColorPalettes = (0, _createSelector["default"])(function (state) {
|
|
702
|
+
var _getSelectedDesignAre2 = getSelectedDesignAreaProperties(state),
|
|
703
|
+
designProductionMethod = _getSelectedDesignAre2.designProductionMethod;
|
|
704
|
+
|
|
705
|
+
return designProductionMethod;
|
|
706
|
+
}, function (designProductionMethod) {
|
|
707
|
+
return designProductionMethod ? designProductionMethod.colorPalettes : [];
|
|
708
|
+
});
|
|
709
|
+
exports.getColorPalettes = getColorPalettes;
|
|
710
|
+
|
|
711
|
+
function getColors(state) {
|
|
712
|
+
return getColorsFromCanvasData(getDesignDataForSelectedDesignArea(state).canvasData);
|
|
713
|
+
}
|
|
714
|
+
|
|
715
|
+
function getColorsWithPalette(state) {
|
|
716
|
+
return getColorsFromCanvasDataWithPalette(getDesignDataForSelectedDesignArea(state).canvasData);
|
|
717
|
+
}
|
|
718
|
+
|
|
719
|
+
var isValidHex = function isValidHex(hex) {
|
|
720
|
+
return /^#([0-9A-F]{3}){1,2}$/i.test(hex);
|
|
721
|
+
};
|
|
722
|
+
|
|
723
|
+
exports.isValidHex = isValidHex;
|
|
724
|
+
|
|
725
|
+
var hexToRgb = function hexToRgb(hex) {
|
|
726
|
+
var stringify = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true;
|
|
727
|
+
// Expand shorthand form (e.g. "03F") to full form (e.g. "0033FF")
|
|
728
|
+
hex = hex.replace(/^#?([a-f\d])([a-f\d])([a-f\d])$/i, function (m, r, g, b) {
|
|
729
|
+
return r + r + g + g + b + b;
|
|
730
|
+
});
|
|
731
|
+
var result = /^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(hex);
|
|
732
|
+
|
|
733
|
+
if (!result) {
|
|
734
|
+
return null;
|
|
735
|
+
}
|
|
736
|
+
|
|
737
|
+
var _map = [1, 2, 3].map(function (i) {
|
|
738
|
+
return parseInt(result[i], 16);
|
|
739
|
+
}),
|
|
740
|
+
_map2 = _slicedToArray(_map, 3),
|
|
741
|
+
r = _map2[0],
|
|
742
|
+
g = _map2[1],
|
|
743
|
+
b = _map2[2];
|
|
744
|
+
|
|
745
|
+
if (!stringify) {
|
|
746
|
+
return {
|
|
747
|
+
r: r,
|
|
748
|
+
g: g,
|
|
749
|
+
b: b
|
|
750
|
+
};
|
|
751
|
+
}
|
|
752
|
+
|
|
753
|
+
return "rgb(".concat(r, ", ").concat(g, ", ").concat(b, ")");
|
|
754
|
+
};
|
|
755
|
+
|
|
756
|
+
exports.hexToRgb = hexToRgb;
|
|
757
|
+
|
|
758
|
+
var hexToRgbNumbers = function hexToRgbNumbers(hex) {
|
|
759
|
+
var rgbAsString = hexToRgb(hex);
|
|
760
|
+
return rgbAsString && rgbAsString.slice(4, rgbAsString.length - 1).split(',').map(function (numString) {
|
|
761
|
+
return parseInt(numString);
|
|
762
|
+
});
|
|
763
|
+
};
|
|
764
|
+
|
|
765
|
+
exports.hexToRgbNumbers = hexToRgbNumbers;
|
|
766
|
+
|
|
767
|
+
var calculateColorDistance = function calculateColorDistance(firstColor, secondColor) {
|
|
768
|
+
var firstRgb = hexToRgbNumbers(firstColor);
|
|
769
|
+
var secondRgb = hexToRgbNumbers(secondColor);
|
|
770
|
+
|
|
771
|
+
if (!firstRgb || !secondRgb) {
|
|
772
|
+
return null;
|
|
773
|
+
}
|
|
774
|
+
|
|
775
|
+
return firstRgb.map(function (color, index) {
|
|
776
|
+
return Math.pow(color - secondRgb[index], 2);
|
|
777
|
+
}).reduce(function (accumulator, value) {
|
|
778
|
+
return accumulator + value;
|
|
779
|
+
});
|
|
780
|
+
};
|
|
781
|
+
|
|
782
|
+
exports.calculateColorDistance = calculateColorDistance;
|
|
783
|
+
|
|
784
|
+
var rgbToHex = function rgbToHex(r, g, b) {
|
|
785
|
+
if (r > 255 || g > 255 || b > 255) {
|
|
786
|
+
throw new Error('Invalid color component');
|
|
787
|
+
}
|
|
788
|
+
|
|
789
|
+
var value = (r << 16 | g << 8 | b).toString(16);
|
|
790
|
+
return '#' + ('000000' + value).slice(-6);
|
|
791
|
+
};
|
|
792
|
+
|
|
793
|
+
exports.rgbToHex = rgbToHex;
|
|
794
|
+
|
|
795
|
+
var rgbString2hex = function rgbString2hex(rgb) {
|
|
796
|
+
rgb = rgb.match(/^rgba?[\s+]?\([\s+]?(\d+)[\s+]?,[\s+]?(\d+)[\s+]?,[\s+]?(\d+)[\s+]?/i);
|
|
797
|
+
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) : '';
|
|
798
|
+
};
|
|
799
|
+
|
|
800
|
+
exports.rgbString2hex = rgbString2hex;
|
|
801
|
+
|
|
802
|
+
var rgbObjToHex = function rgbObjToHex(_ref11) {
|
|
803
|
+
var r = _ref11.r,
|
|
804
|
+
g = _ref11.g,
|
|
805
|
+
b = _ref11.b;
|
|
806
|
+
return rgbToHex(r, g, b);
|
|
807
|
+
};
|
|
808
|
+
|
|
809
|
+
exports.rgbObjToHex = rgbObjToHex;
|
|
810
|
+
|
|
811
|
+
function getColorsFromCanvasData(canvasData) {
|
|
812
|
+
var objects = (0, _get["default"])(canvasData, 'objects', []);
|
|
813
|
+
var colors = [];
|
|
814
|
+
|
|
815
|
+
var _iterator6 = _createForOfIteratorHelper(objects),
|
|
816
|
+
_step6;
|
|
817
|
+
|
|
818
|
+
try {
|
|
819
|
+
for (_iterator6.s(); !(_step6 = _iterator6.n()).done;) {
|
|
820
|
+
var object = _step6.value;
|
|
821
|
+
|
|
822
|
+
if (object.type === 'Text') {
|
|
823
|
+
var objectColors = (0, _get["default"])(object, 'style.colors') || [];
|
|
824
|
+
|
|
825
|
+
var _iterator7 = _createForOfIteratorHelper(objectColors),
|
|
826
|
+
_step7;
|
|
827
|
+
|
|
828
|
+
try {
|
|
829
|
+
for (_iterator7.s(); !(_step7 = _iterator7.n()).done;) {
|
|
830
|
+
var color = _step7.value;
|
|
831
|
+
colors.push(color.value);
|
|
832
|
+
}
|
|
833
|
+
} catch (err) {
|
|
834
|
+
_iterator7.e(err);
|
|
835
|
+
} finally {
|
|
836
|
+
_iterator7.f();
|
|
837
|
+
}
|
|
838
|
+
} else if (object.type === 'Image') {
|
|
839
|
+
var _objectColors = Object.values((0, _get["default"])(object, 'imageData.operations.vectorizeColorsMap') || {});
|
|
840
|
+
|
|
841
|
+
for (var _i2 = 0, _objectColors2 = _objectColors; _i2 < _objectColors2.length; _i2++) {
|
|
842
|
+
var _color = _objectColors2[_i2];
|
|
843
|
+
colors.push(_color.value.startsWith('#') ? hexToRgb(_color.value) : _color.value);
|
|
844
|
+
}
|
|
845
|
+
}
|
|
846
|
+
}
|
|
847
|
+
} catch (err) {
|
|
848
|
+
_iterator6.e(err);
|
|
849
|
+
} finally {
|
|
850
|
+
_iterator6.f();
|
|
851
|
+
}
|
|
852
|
+
|
|
853
|
+
return (0, _uniq["default"])(colors);
|
|
854
|
+
}
|
|
855
|
+
|
|
856
|
+
function getColorsFromCanvasDataWithPalette(canvasData) {
|
|
857
|
+
var objects = (0, _get["default"])(canvasData, 'objects', []);
|
|
858
|
+
var colors = [];
|
|
859
|
+
|
|
860
|
+
var _iterator8 = _createForOfIteratorHelper(objects),
|
|
861
|
+
_step8;
|
|
862
|
+
|
|
863
|
+
try {
|
|
864
|
+
for (_iterator8.s(); !(_step8 = _iterator8.n()).done;) {
|
|
865
|
+
var object = _step8.value;
|
|
866
|
+
|
|
867
|
+
if (object.type === 'Text') {
|
|
868
|
+
var objectColors = (0, _get["default"])(object, 'style.colors') || [];
|
|
869
|
+
|
|
870
|
+
var _iterator9 = _createForOfIteratorHelper(objectColors),
|
|
871
|
+
_step9;
|
|
872
|
+
|
|
873
|
+
try {
|
|
874
|
+
for (_iterator9.s(); !(_step9 = _iterator9.n()).done;) {
|
|
875
|
+
var color = _step9.value;
|
|
876
|
+
colors.push(color);
|
|
877
|
+
}
|
|
878
|
+
} catch (err) {
|
|
879
|
+
_iterator9.e(err);
|
|
880
|
+
} finally {
|
|
881
|
+
_iterator9.f();
|
|
882
|
+
}
|
|
883
|
+
} else if (object.type === 'Image') {
|
|
884
|
+
var _objectColors3 = (0, _cloneDeep["default"])(Object.values((0, _get["default"])(object, 'imageData.operations.vectorizeColorsMap') || {}));
|
|
885
|
+
|
|
886
|
+
var _iterator10 = _createForOfIteratorHelper(_objectColors3),
|
|
887
|
+
_step10;
|
|
888
|
+
|
|
889
|
+
try {
|
|
890
|
+
for (_iterator10.s(); !(_step10 = _iterator10.n()).done;) {
|
|
891
|
+
var _color2 = _step10.value;
|
|
892
|
+
|
|
893
|
+
if (_color2.value.startsWith('#')) {
|
|
894
|
+
_color2.value = hexToRgb(_color2.value);
|
|
895
|
+
}
|
|
896
|
+
|
|
897
|
+
colors.push(_color2);
|
|
898
|
+
}
|
|
899
|
+
} catch (err) {
|
|
900
|
+
_iterator10.e(err);
|
|
901
|
+
} finally {
|
|
902
|
+
_iterator10.f();
|
|
903
|
+
}
|
|
904
|
+
}
|
|
905
|
+
}
|
|
906
|
+
} catch (err) {
|
|
907
|
+
_iterator8.e(err);
|
|
908
|
+
} finally {
|
|
909
|
+
_iterator8.f();
|
|
910
|
+
}
|
|
911
|
+
|
|
912
|
+
return (0, _uniqWith["default"])(colors, function (color1, color2) {
|
|
913
|
+
return color1.identifier === color2.identifier && color1.value === color2.value;
|
|
914
|
+
});
|
|
915
|
+
}
|
|
916
|
+
|
|
917
|
+
function findSmallestFontSizeInCanvasData(canvasData) {
|
|
918
|
+
var objects = (0, _get["default"])(canvasData, 'objects', []);
|
|
919
|
+
return Math.min.apply(0, objects.map(function (object) {
|
|
920
|
+
return object.fontSize || Infinity;
|
|
921
|
+
}));
|
|
922
|
+
}
|
|
923
|
+
|
|
924
|
+
var createColorData = function createColorData(identifier, paletteIdentifier, custom, value) {
|
|
925
|
+
var data = {
|
|
926
|
+
color: identifier,
|
|
927
|
+
palette: paletteIdentifier
|
|
928
|
+
};
|
|
929
|
+
|
|
930
|
+
if (custom) {
|
|
931
|
+
data.custom = true;
|
|
932
|
+
}
|
|
933
|
+
|
|
934
|
+
return {
|
|
935
|
+
identifier: JSON.stringify(data),
|
|
936
|
+
value: value.toLowerCase()
|
|
937
|
+
};
|
|
938
|
+
};
|
|
939
|
+
|
|
940
|
+
exports.createColorData = createColorData;
|
|
941
|
+
|
|
942
|
+
var parseColorData = function parseColorData(jsonStr) {
|
|
943
|
+
var colorData;
|
|
944
|
+
|
|
945
|
+
try {
|
|
946
|
+
colorData = JSON.parse(jsonStr);
|
|
947
|
+
} catch (e) {
|
|
948
|
+
// eslint-disable-next-line no-console
|
|
949
|
+
console.error("failed to parse color data: ".concat(jsonStr));
|
|
950
|
+
}
|
|
951
|
+
|
|
952
|
+
return _objectSpread({
|
|
953
|
+
palette: null,
|
|
954
|
+
color: null
|
|
955
|
+
}, colorData);
|
|
956
|
+
};
|
|
957
|
+
|
|
958
|
+
exports.parseColorData = parseColorData;
|
|
959
|
+
|
|
960
|
+
var getCameraViewListForDesignAreaList = function getCameraViewListForDesignAreaList(filteredDesignAreas, designedAreas) {
|
|
961
|
+
return ['default'].concat(filteredDesignAreas // get the design area objects by their id
|
|
962
|
+
.filter(function (designArea) {
|
|
963
|
+
return designedAreas.indexOf(designArea.identifier) !== -1;
|
|
964
|
+
}) // get the camera view values
|
|
965
|
+
.map(function (designArea) {
|
|
966
|
+
return (0, _get["default"])(designArea, 'customData.selectedCameraView');
|
|
967
|
+
}) // remove empty values and duplicates
|
|
968
|
+
.filter(function (viewName, index, arr) {
|
|
969
|
+
return viewName && index === arr.indexOf(viewName);
|
|
970
|
+
}) // make them lower case
|
|
971
|
+
.map(function (viewName) {
|
|
972
|
+
return viewName.toLowerCase();
|
|
973
|
+
}));
|
|
974
|
+
};
|
|
975
|
+
|
|
976
|
+
exports.getCameraViewListForDesignAreaList = getCameraViewListForDesignAreaList;
|
|
977
|
+
|
|
978
|
+
var getDesignViewListForDesignAreas = function getDesignViewListForDesignAreas(state, designAreas) {
|
|
979
|
+
var designViews = state.designView.designViews,
|
|
980
|
+
designerAvailable = state.configurationMode.availableModes.designer;
|
|
981
|
+
|
|
982
|
+
if (!designerAvailable) {
|
|
983
|
+
return designViews;
|
|
984
|
+
}
|
|
985
|
+
|
|
986
|
+
var designViewList = [];
|
|
987
|
+
|
|
988
|
+
var _iterator11 = _createForOfIteratorHelper(designViews),
|
|
989
|
+
_step11;
|
|
990
|
+
|
|
991
|
+
try {
|
|
992
|
+
for (_iterator11.s(); !(_step11 = _iterator11.n()).done;) {
|
|
993
|
+
var designView = _step11.value;
|
|
994
|
+
var designAreaList = [];
|
|
995
|
+
|
|
996
|
+
var _iterator12 = _createForOfIteratorHelper(designView.designAreas),
|
|
997
|
+
_step12;
|
|
998
|
+
|
|
999
|
+
try {
|
|
1000
|
+
for (_iterator12.s(); !(_step12 = _iterator12.n()).done;) {
|
|
1001
|
+
var designArea = _step12.value;
|
|
1002
|
+
|
|
1003
|
+
if (!designAreas || designAreas.indexOf(designArea.identifier) !== -1) {
|
|
1004
|
+
designAreaList.push((0, _Transformers2.recalculateSingleDesignArea)(state, designArea));
|
|
1005
|
+
}
|
|
1006
|
+
}
|
|
1007
|
+
} catch (err) {
|
|
1008
|
+
_iterator12.e(err);
|
|
1009
|
+
} finally {
|
|
1010
|
+
_iterator12.f();
|
|
1011
|
+
}
|
|
1012
|
+
|
|
1013
|
+
if (designAreaList.length) {
|
|
1014
|
+
designViewList.push(_objectSpread(_objectSpread({}, designView), {}, {
|
|
1015
|
+
designAreas: designAreaList.sort(_Transformers.compareDesignAreasBySize)
|
|
1016
|
+
}));
|
|
1017
|
+
}
|
|
1018
|
+
}
|
|
1019
|
+
} catch (err) {
|
|
1020
|
+
_iterator11.e(err);
|
|
1021
|
+
} finally {
|
|
1022
|
+
_iterator11.f();
|
|
1023
|
+
}
|
|
1024
|
+
|
|
1025
|
+
return designViewList;
|
|
1026
|
+
};
|
|
1027
|
+
|
|
1028
|
+
exports.getDesignViewListForDesignAreas = getDesignViewListForDesignAreas;
|
|
1029
|
+
|
|
1030
|
+
var getDefaultDesignAreaIdentifierFromProductionMethod = function getDefaultDesignAreaIdentifierFromProductionMethod(state) {
|
|
1031
|
+
//return the first designArea with isDefault: true due to api call accepts multiple productionmethods to be default
|
|
1032
|
+
var filteredDesignAreas = state.designArea.filteredDesignAreas;
|
|
1033
|
+
var defaultDesignArea = filteredDesignAreas && filteredDesignAreas.find(function (designArea) {
|
|
1034
|
+
return !!designArea.designProductionMethods.find(function (method) {
|
|
1035
|
+
return method.isDefault;
|
|
1036
|
+
});
|
|
1037
|
+
});
|
|
1038
|
+
|
|
1039
|
+
if (defaultDesignArea) {
|
|
1040
|
+
return defaultDesignArea.identifier;
|
|
1041
|
+
} else {
|
|
1042
|
+
return null;
|
|
1043
|
+
}
|
|
1044
|
+
};
|
|
1045
|
+
|
|
1046
|
+
exports.getDefaultDesignAreaIdentifierFromProductionMethod = getDefaultDesignAreaIdentifierFromProductionMethod;
|
|
1047
|
+
|
|
1048
|
+
var getDefaultColorsFromDesignProductionMethod = function getDefaultColorsFromDesignProductionMethod(designProductionMethod) {
|
|
1049
|
+
return (0, _get["default"])(designProductionMethod, 'defaultColors') || {};
|
|
1050
|
+
};
|
|
1051
|
+
|
|
1052
|
+
exports.getDefaultColorsFromDesignProductionMethod = getDefaultColorsFromDesignProductionMethod;
|
|
1053
|
+
|
|
1054
|
+
var getDefaultTextColor = function getDefaultTextColor(state) {
|
|
1055
|
+
var colorIndex = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : null;
|
|
1056
|
+
var colorPalettes = getColorPalettes(state);
|
|
1057
|
+
var defaultColor = {
|
|
1058
|
+
identifier: 'ff0000',
|
|
1059
|
+
paletteIdentifier: null,
|
|
1060
|
+
custom: true,
|
|
1061
|
+
value: '#ff0000'
|
|
1062
|
+
};
|
|
1063
|
+
|
|
1064
|
+
if (!colorPalettes.length) {
|
|
1065
|
+
return defaultColor;
|
|
1066
|
+
}
|
|
1067
|
+
|
|
1068
|
+
if (colorIndex !== null) {
|
|
1069
|
+
if (colorPalettes[0].colors.length <= colorIndex) {
|
|
1070
|
+
return defaultColor;
|
|
1071
|
+
}
|
|
1072
|
+
|
|
1073
|
+
return {
|
|
1074
|
+
identifier: colorPalettes[0].colors[colorIndex].identifier,
|
|
1075
|
+
paletteIdentifier: colorPalettes[0].identifier,
|
|
1076
|
+
custom: false,
|
|
1077
|
+
value: '#' + colorPalettes[0].colors[colorIndex].hex_value
|
|
1078
|
+
};
|
|
1079
|
+
}
|
|
1080
|
+
|
|
1081
|
+
var designProductionMethod = getSelectedDesignProductionMethod(state);
|
|
1082
|
+
var defaultColors = getDefaultColorsFromDesignProductionMethod(designProductionMethod);
|
|
1083
|
+
var variantIdentifier = (0, _Selectors.getSelectedVariantIdentifier)((0, _Selectors.getConfigurator)(state));
|
|
1084
|
+
|
|
1085
|
+
if (defaultColors && defaultColors[variantIdentifier]) {
|
|
1086
|
+
var colorPalette = (0, _find["default"])(colorPalettes, {
|
|
1087
|
+
identifier: Object.keys(defaultColors[variantIdentifier])[0]
|
|
1088
|
+
});
|
|
1089
|
+
|
|
1090
|
+
if (colorPalette) {
|
|
1091
|
+
var color = (0, _find["default"])(colorPalette.colors, {
|
|
1092
|
+
identifier: defaultColors[variantIdentifier][colorPalette.identifier]
|
|
1093
|
+
});
|
|
1094
|
+
|
|
1095
|
+
if (color) {
|
|
1096
|
+
return {
|
|
1097
|
+
identifier: color.identifier,
|
|
1098
|
+
paletteIdentifier: colorPalette.identifier,
|
|
1099
|
+
custom: false,
|
|
1100
|
+
value: '#' + color.hex_value
|
|
1101
|
+
};
|
|
1102
|
+
}
|
|
1103
|
+
}
|
|
1104
|
+
}
|
|
1105
|
+
|
|
1106
|
+
var paletteDefaultColorIdentifier = (0, _get["default"])(colorPalettes[0], 'defaultColor.identifier', '');
|
|
1107
|
+
var paletteDefaultColor = (0, _find["default"])(colorPalettes[0].colors, {
|
|
1108
|
+
identifier: paletteDefaultColorIdentifier
|
|
1109
|
+
});
|
|
1110
|
+
|
|
1111
|
+
if (paletteDefaultColor) {
|
|
1112
|
+
return {
|
|
1113
|
+
identifier: paletteDefaultColor.identifier,
|
|
1114
|
+
paletteIdentifier: colorPalettes[0].identifier,
|
|
1115
|
+
custom: false,
|
|
1116
|
+
value: '#' + paletteDefaultColor.hex_value
|
|
1117
|
+
};
|
|
1118
|
+
}
|
|
1119
|
+
|
|
1120
|
+
if (colorPalettes[0].colors.length) {
|
|
1121
|
+
return {
|
|
1122
|
+
identifier: colorPalettes[0].colors[0].identifier,
|
|
1123
|
+
paletteIdentifier: colorPalettes[0].identifier,
|
|
1124
|
+
custom: false,
|
|
1125
|
+
value: '#' + colorPalettes[0].colors[0].hex_value
|
|
1126
|
+
};
|
|
1127
|
+
}
|
|
1128
|
+
|
|
1129
|
+
return defaultColor;
|
|
1130
|
+
};
|
|
1131
|
+
|
|
1132
|
+
exports.getDefaultTextColor = getDefaultTextColor;
|
|
1133
|
+
|
|
1134
|
+
var isPlaceholderContent = function isPlaceholderContent(content) {
|
|
1135
|
+
return content.indexOf('data-placeholder="true"') !== -1;
|
|
1136
|
+
};
|
|
1137
|
+
|
|
1138
|
+
exports.isPlaceholderContent = isPlaceholderContent;
|
|
1139
|
+
|
|
1140
|
+
var contentHasText = function contentHasText(content) {
|
|
1141
|
+
var div = document.createElement('div');
|
|
1142
|
+
div.innerHTML = content;
|
|
1143
|
+
return /\S/.test(div.textContent);
|
|
1144
|
+
};
|
|
1145
|
+
|
|
1146
|
+
exports.contentHasText = contentHasText;
|
|
1147
|
+
|
|
1148
|
+
var getDesignAreaImageCompatibilityInfo = function getDesignAreaImageCompatibilityInfo(designProductionMethod) {
|
|
1149
|
+
var colorPalettes = ((0, _get["default"])(designProductionMethod, 'colorPalettes') || []).map(function (_ref12) {
|
|
1150
|
+
var identifier = _ref12.identifier;
|
|
1151
|
+
return identifier;
|
|
1152
|
+
}).sort();
|
|
1153
|
+
var vectorsRequired = !!(0, _get["default"])(designProductionMethod, 'options.vectorsRequired');
|
|
1154
|
+
var maxColorAmount = (0, _get["default"])(designProductionMethod, 'options.maxColorAmount', 0);
|
|
1155
|
+
return {
|
|
1156
|
+
colorPalettes: colorPalettes,
|
|
1157
|
+
vectorsRequired: vectorsRequired,
|
|
1158
|
+
maxColorAmount: maxColorAmount
|
|
1159
|
+
};
|
|
1160
|
+
};
|
|
1161
|
+
|
|
1162
|
+
exports.getDesignAreaImageCompatibilityInfo = getDesignAreaImageCompatibilityInfo;
|
|
1163
|
+
|
|
1164
|
+
var getCurrentCompatibilityInfoHash = function getCurrentCompatibilityInfoHash(state) {
|
|
1165
|
+
return getDesignAreaImageCompatibilityInfo(getSelectedDesignProductionMethod(state));
|
|
1166
|
+
};
|
|
1167
|
+
|
|
1168
|
+
exports.getCurrentCompatibilityInfoHash = getCurrentCompatibilityInfoHash;
|
|
1169
|
+
|
|
1170
|
+
var areHashesCompatible = function areHashesCompatible(storedHash, targetHash) {
|
|
1171
|
+
return Boolean(!targetHash || storedHash && (0, _isEqual["default"])(storedHash.colorPalettes, targetHash.colorPalettes) && (!targetHash.vectorsRequired || storedHash.vectorsRequired) && (!targetHash.maxColorAmount || storedHash.maxColorAmount <= targetHash.maxColorAmount));
|
|
1172
|
+
};
|
|
1173
|
+
|
|
1174
|
+
exports.areHashesCompatible = areHashesCompatible;
|
|
1175
|
+
|
|
1176
|
+
var getVectorizedImageColor = function getVectorizedImageColor(state) {
|
|
1177
|
+
var selectedDesignProductionMethod = getSelectedDesignProductionMethod(state);
|
|
1178
|
+
var selectedImage = (0, _get["default"])(state, 'imageGallery.selectedImage', {});
|
|
1179
|
+
var reversedUserImages = (0, _get["default"])(state, 'imageGallery.userImages', []).slice().reverse();
|
|
1180
|
+
|
|
1181
|
+
if (selectedImage && reversedUserImages.length > 0 && reversedUserImages.find(function (image) {
|
|
1182
|
+
return image.originalFileName === selectedImage.originalFileName;
|
|
1183
|
+
}) && selectedImage.originalFileName !== reversedUserImages[0].originalFileName) {
|
|
1184
|
+
var currentLastImage = reversedUserImages.find(function (image) {
|
|
1185
|
+
return image.originalFileName === selectedImage.originalFileName;
|
|
1186
|
+
});
|
|
1187
|
+
var imagesWithoutSelectedImage = reversedUserImages.filter(function (image) {
|
|
1188
|
+
return image !== currentLastImage;
|
|
1189
|
+
});
|
|
1190
|
+
reversedUserImages = [currentLastImage].concat(_toConsumableArray(imagesWithoutSelectedImage));
|
|
1191
|
+
}
|
|
1192
|
+
|
|
1193
|
+
var _iterator13 = _createForOfIteratorHelper(reversedUserImages),
|
|
1194
|
+
_step13;
|
|
1195
|
+
|
|
1196
|
+
try {
|
|
1197
|
+
for (_iterator13.s(); !(_step13 = _iterator13.n()).done;) {
|
|
1198
|
+
var image = _step13.value;
|
|
1199
|
+
var objectColors = (0, _values["default"])((0, _get["default"])(image, 'operations.vectorizeColorsMap'));
|
|
1200
|
+
|
|
1201
|
+
if (!objectColors || !objectColors.length) {
|
|
1202
|
+
continue;
|
|
1203
|
+
}
|
|
1204
|
+
|
|
1205
|
+
if ((0, _Selectors2.isImageCompatible)(state, image)) {
|
|
1206
|
+
return (0, _first["default"])(objectColors);
|
|
1207
|
+
} else {
|
|
1208
|
+
var replacedColor = (0, _first["default"])((0, _DesignDataService.getMissingColorPalettesColors)((0, _first["default"])(objectColors) ? [(0, _first["default"])(objectColors)] : [], selectedDesignProductionMethod ? selectedDesignProductionMethod.colorPalettes : []));
|
|
1209
|
+
return (0, _get["default"])(replacedColor, 'closestColor');
|
|
1210
|
+
}
|
|
1211
|
+
}
|
|
1212
|
+
} catch (err) {
|
|
1213
|
+
_iterator13.e(err);
|
|
1214
|
+
} finally {
|
|
1215
|
+
_iterator13.f();
|
|
1216
|
+
}
|
|
1217
|
+
|
|
1218
|
+
return {};
|
|
1219
|
+
};
|
|
1220
|
+
|
|
1221
|
+
exports.getVectorizedImageColor = getVectorizedImageColor;
|
|
1222
|
+
|
|
1223
|
+
var areAllDesignAreasEmpty = function areAllDesignAreasEmpty(_ref13) {
|
|
1224
|
+
var configuration = _ref13.configuration;
|
|
1225
|
+
var designdata = (0, _get["default"])(configuration, 'designdata', {});
|
|
1226
|
+
|
|
1227
|
+
for (var key in designdata) {
|
|
1228
|
+
if (!designdata.hasOwnProperty(key)) {
|
|
1229
|
+
continue;
|
|
1230
|
+
}
|
|
1231
|
+
|
|
1232
|
+
if (designdata[key].canvasData) {
|
|
1233
|
+
return false;
|
|
1234
|
+
}
|
|
1235
|
+
}
|
|
1236
|
+
|
|
1237
|
+
return true;
|
|
1238
|
+
};
|
|
1239
|
+
|
|
1240
|
+
exports.areAllDesignAreasEmpty = areAllDesignAreasEmpty;
|
|
1241
|
+
|
|
1242
|
+
var hasLastEditedDesignArea = function hasLastEditedDesignArea(designArea) {
|
|
1243
|
+
var lastSelectedDesignAreaIdentifier = (0, _get["default"])(designArea, 'lastSelectedDesignAreaIdentifier', {});
|
|
1244
|
+
var previousEditedDesignArea = (0, _get["default"])(designArea, 'previousEditedDesignArea', {});
|
|
1245
|
+
return !(0, _isEmpty["default"])(lastSelectedDesignAreaIdentifier) || !(0, _isEmpty["default"])(previousEditedDesignArea);
|
|
1246
|
+
};
|
|
1247
|
+
|
|
1248
|
+
exports.hasLastEditedDesignArea = hasLastEditedDesignArea;
|
|
1249
|
+
|
|
1250
|
+
var getDesignAreaPreSelection = function getDesignAreaPreSelection(identifier) {
|
|
1251
|
+
var designerPreSelection = (0, _configuration.getConf)('designerPreSelection', {});
|
|
1252
|
+
|
|
1253
|
+
if (!designerPreSelection.designAreas || !designerPreSelection.designAreas.length) {
|
|
1254
|
+
return {};
|
|
1255
|
+
}
|
|
1256
|
+
|
|
1257
|
+
var preSelection = (0, _find["default"])(designerPreSelection.designAreas, {
|
|
1258
|
+
identifier: identifier
|
|
1259
|
+
});
|
|
1260
|
+
return preSelection ? preSelection : {};
|
|
1261
|
+
};
|
|
1262
|
+
|
|
1263
|
+
exports.getDesignAreaPreSelection = getDesignAreaPreSelection;
|
|
1264
|
+
|
|
1265
|
+
var getDesignAreaColorAmount = function getDesignAreaColorAmount(maxColorAmount, preSelectionColorAmount) {
|
|
1266
|
+
var amount = maxColorAmount > 0 ? 1 : null;
|
|
1267
|
+
|
|
1268
|
+
if (preSelectionColorAmount > 0) {
|
|
1269
|
+
amount = preSelectionColorAmount > maxColorAmount ? maxColorAmount : preSelectionColorAmount;
|
|
1270
|
+
}
|
|
1271
|
+
|
|
1272
|
+
return amount;
|
|
1273
|
+
};
|
|
1274
|
+
|
|
1275
|
+
exports.getDesignAreaColorAmount = getDesignAreaColorAmount;
|
|
1276
|
+
|
|
1277
|
+
var getVectorizeForDesignProductionMethods = function getVectorizeForDesignProductionMethods(state, designProductionMethodIdentifier) {
|
|
1278
|
+
var _getSelectedDesignAre3 = getSelectedDesignAreaProperties(state),
|
|
1279
|
+
designProductionMethod = _getSelectedDesignAre3.designProductionMethod;
|
|
1280
|
+
|
|
1281
|
+
var newProductionMethod = getDesignProductionMethodByIdentifier(state, designProductionMethodIdentifier);
|
|
1282
|
+
var currentVectorsRequired = !!(0, _get["default"])(designProductionMethod, 'options.vectorsRequired');
|
|
1283
|
+
var newVectorsRequired = !!(0, _get["default"])(newProductionMethod, 'options.vectorsRequired');
|
|
1284
|
+
return {
|
|
1285
|
+
currentVectorsRequired: currentVectorsRequired,
|
|
1286
|
+
newVectorsRequired: newVectorsRequired
|
|
1287
|
+
};
|
|
1288
|
+
};
|
|
1289
|
+
|
|
1290
|
+
exports.getVectorizeForDesignProductionMethods = getVectorizeForDesignProductionMethods;
|
|
1291
|
+
|
|
1292
|
+
var getImagesByDesignArea = function getImagesByDesignArea(state, designAreaIdentifier) {
|
|
1293
|
+
if (!designAreaIdentifier) {
|
|
1294
|
+
designAreaIdentifier = getSelectedDesignArea(state).identifier;
|
|
1295
|
+
}
|
|
1296
|
+
|
|
1297
|
+
var designData = getDesignDataByDesignAreaIdentifier(state, designAreaIdentifier);
|
|
1298
|
+
return (0, _get["default"])(designData, 'canvasData.objects', []).filter(function (_ref14) {
|
|
1299
|
+
var type = _ref14.type;
|
|
1300
|
+
return type === 'Image';
|
|
1301
|
+
});
|
|
1302
|
+
};
|
|
1303
|
+
|
|
1304
|
+
exports.getImagesByDesignArea = getImagesByDesignArea;
|