@configuratorware/configurator-frontendgui 1.41.1 → 1.42.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/App/Constant.js +2 -3
- package/App/Error/DevelopmentErrorPage/index.js +4 -19
- package/App/Error/ErrorBoundary.js +13 -43
- package/App/Error/ProductionErrorPage/index.js +2 -11
- package/App/Error/ProductionErrorPage/index.story.js +0 -4
- package/App/Frame.js +10 -43
- package/App/Modules/Creator/Components/ConfigurationvariantItem/index.js +15 -58
- package/App/Modules/Creator/Components/ConfigurationvariantSelection/index.js +20 -60
- package/App/Modules/Creator/Components/CustomTitleEditor/index.js +15 -64
- package/App/Modules/Creator/Components/ExternalVisualization/index.js +19 -47
- package/App/Modules/Creator/Components/FastConfiguration/SelectableRow.js +10 -37
- package/App/Modules/Creator/Components/FastConfiguration/index.js +37 -101
- package/App/Modules/Creator/Components/FastConfigurationRow/index.js +12 -38
- package/App/Modules/Creator/Components/FastConfigurationSelect/index.js +29 -85
- package/App/Modules/Creator/Components/FormattedNumber/index.js +1 -17
- package/App/Modules/Creator/Components/FormattedPrice/index.js +1 -19
- package/App/Modules/Creator/Components/FullScreenView/FullScreenView.js +17 -36
- package/App/Modules/Creator/Components/Incompatibility/OptionExclusionRule/index.js +24 -61
- package/App/Modules/Creator/Components/Incompatibility/OptionRule/index.js +24 -60
- package/App/Modules/Creator/Components/Incompatibility/RuleComponent.js +12 -45
- package/App/Modules/Creator/Components/Incompatibility/index.js +28 -89
- package/App/Modules/Creator/Components/InvalidConfigurationNotice/index.js +14 -53
- package/App/Modules/Creator/Components/LoginForm/index.js +14 -52
- package/App/Modules/Creator/Components/Option/index.js +53 -155
- package/App/Modules/Creator/Components/Option/index.story.js +6 -17
- package/App/Modules/Creator/Components/OptionAmount/index.js +33 -74
- package/App/Modules/Creator/Components/OptionGroup/index.js +10 -23
- package/App/Modules/Creator/Components/Optiondetail/ZoomImage/index.js +26 -68
- package/App/Modules/Creator/Components/Optiondetail/index.js +44 -129
- package/App/Modules/Creator/Components/Optiondetail/index.story.js +11 -72
- package/App/Modules/Creator/Components/Optiondetail/index.test.mocks.js +56 -0
- package/App/Modules/Creator/Components/OptionsList/index.js +31 -81
- package/App/Modules/Creator/Components/Price/index.js +12 -40
- package/App/Modules/Creator/Components/ProductPart/index.js +14 -46
- package/App/Modules/Creator/Components/ProductPart/index.story.js +6 -17
- package/App/Modules/Creator/Components/ProductPartsList/index.js +25 -68
- package/App/Modules/Creator/Components/ProductPartsList/index.story.js +6 -21
- package/App/Modules/Creator/Components/SavedConfiguration/index.js +13 -45
- package/App/Modules/Creator/Components/ShareConfiguration/index.js +31 -90
- package/App/Modules/Creator/Components/StockInformation/index.js +13 -44
- package/App/Modules/Creator/Components/StoreConfigurationForm/index.js +15 -52
- package/App/Modules/Creator/Components/Tools/index.js +11 -45
- package/App/Modules/Creator/Components/ValidationResult/index.js +16 -62
- package/App/Modules/Creator/Components/index.js +2 -29
- package/App/Modules/Creator/Containers/AmountPrice/index.js +3 -12
- package/App/Modules/Creator/Containers/ConfigurationvariantSelection/index.js +5 -19
- package/App/Modules/Creator/Containers/CustomTitleEditor/index.js +4 -19
- package/App/Modules/Creator/Containers/FastConfiguration/index.js +6 -20
- package/App/Modules/Creator/Containers/FormattedPrice/index.js +4 -13
- package/App/Modules/Creator/Containers/Incompatibility/index.js +2 -12
- package/App/Modules/Creator/Containers/InvalidConfigurationNotice/index.js +8 -31
- package/App/Modules/Creator/Containers/LoadingOverlay/index.js +2 -9
- package/App/Modules/Creator/Containers/Optiondetail/index.js +7 -18
- package/App/Modules/Creator/Containers/OptionsList/index.js +3 -15
- package/App/Modules/Creator/Containers/ProductPart/index.js +1 -9
- package/App/Modules/Creator/Containers/ProductPartsList/index.js +3 -16
- package/App/Modules/Creator/Containers/SavedConfigurationContainer/index.js +1 -8
- package/App/Modules/Creator/Containers/ShareConfiguration/index.js +2 -10
- package/App/Modules/Creator/Containers/StockInformation/index.js +2 -10
- package/App/Modules/Creator/Containers/Tools/index.js +1 -10
- package/App/Modules/Creator/Containers/ValidationResult/index.js +2 -10
- package/App/Modules/Creator/Containers/index.js +42 -64
- package/App/Modules/Creator/CreatorScreen.js +45 -121
- package/App/Modules/Creator/Layouts/DefaultLayout.js +21 -50
- package/App/Modules/Designer/Components/AddGalleryImage/index.js +31 -92
- package/App/Modules/Designer/Components/AddGalleryImage/index.story.js +9 -22
- package/App/Modules/Designer/Components/AddGalleryImage/index.test.js +13 -35
- package/App/Modules/Designer/Components/AddVisualElement/index.js +30 -86
- package/App/Modules/Designer/Components/AddVisualElement/index.story.js +0 -5
- package/App/Modules/Designer/Components/AddVisualElement/index.test.js +12 -15
- package/App/Modules/Designer/Components/CloseDesignEditor/index.js +18 -51
- package/App/Modules/Designer/Components/CloseGraphicsEditorButton/index.js +7 -17
- package/App/Modules/Designer/Components/ColorPalettes/ColorPalettesSearch.js +20 -57
- package/App/Modules/Designer/Components/ColorPalettes/index.js +62 -178
- package/App/Modules/Designer/Components/ColorPalettes/index.story.js +0 -8
- package/App/Modules/Designer/Components/ColorPalettes/index.test.js +7 -11
- package/App/Modules/Designer/Components/DesignAreaControlbox/index.js +35 -108
- package/App/Modules/Designer/Components/DesignAreaControlbox/index.story.js +0 -8
- package/App/Modules/Designer/Components/DesignAreaControlbox/index.test.js +15 -23
- package/App/Modules/Designer/Components/DesignerSelectionToolbox/CustomFontOverlay.js +18 -51
- package/App/Modules/Designer/Components/DesignerSelectionToolbox/DesignerSelectionToolbox.js +53 -150
- package/App/Modules/Designer/Components/DesignerSelectionToolbox/fontItemUtils.js +10 -20
- package/App/Modules/Designer/Components/Dialog/index.js +21 -63
- package/App/Modules/Designer/Components/EditDesignButton/index.js +20 -43
- package/App/Modules/Designer/Components/FeedbackNotice/index.js +17 -53
- package/App/Modules/Designer/Components/FeedbackNotice/index.test.js +0 -4
- package/App/Modules/Designer/Components/FullScreenView/FullScreenView.js +6 -14
- package/App/Modules/Designer/Components/ImageColorPicker/ImageColorPicker.dev.js +5 -14
- package/App/Modules/Designer/Components/ImageColorPicker/ImageColorPicker.js +42 -137
- package/App/Modules/Designer/Components/ImageColorize/index.js +54 -177
- package/App/Modules/Designer/Components/ImageColorize/index.story.js +2 -6
- package/App/Modules/Designer/Components/ImageControlbox/index.js +27 -90
- package/App/Modules/Designer/Components/ImageEditDialog/ImageThumbnail.js +26 -71
- package/App/Modules/Designer/Components/ImageEditDialog/ImageUpload.js +138 -170
- package/App/Modules/Designer/Components/ImageEditDialog/index.js +55 -168
- package/App/Modules/Designer/Components/ImageLibraryFilter/index.js +20 -61
- package/App/Modules/Designer/Components/ImageLibraryThumbnail/index.js +24 -66
- package/App/Modules/Designer/Components/ObjectTools/index.js +18 -56
- package/App/Modules/Designer/Components/Select/index.js +21 -65
- package/App/Modules/Designer/Components/TextControlbox/TextFormatIcon.js +5 -20
- package/App/Modules/Designer/Components/TextControlbox/index.js +58 -176
- package/App/Modules/Designer/Components/TextControlbox/index.story.js +0 -10
- package/App/Modules/Designer/Components/TextControlbox/index.test.js +34 -41
- package/App/Modules/Designer/Containers/AddGalleryImage.js +8 -24
- package/App/Modules/Designer/Containers/AddVisualElement.js +28 -87
- package/App/Modules/Designer/Containers/CloseDesignEditor.js +1 -10
- package/App/Modules/Designer/Containers/CloseGraphicsEditorButton.js +1 -10
- package/App/Modules/Designer/Containers/ColorPalettes.js +22 -61
- package/App/Modules/Designer/Containers/DesignAreaControlbox.js +5 -17
- package/App/Modules/Designer/Containers/Designer.js +1 -10
- package/App/Modules/Designer/Containers/DesignerSelectionToolbox.js +7 -30
- package/App/Modules/Designer/Containers/EditDesignButton.js +1 -11
- package/App/Modules/Designer/Containers/ImageEditDialog.js +400 -658
- package/App/Modules/Designer/Designer.js +28 -84
- package/App/Modules/Designer/DesignerScreen.js +45 -100
- package/App/Modules/Designer/DesignerUI.js +31 -87
- package/App/Modules/Designer/Layouts/DefaultLayout.js +20 -45
- package/App/Modules/Designer/Layouts/Mobile/TwoSideBottomBar.js +4 -16
- package/App/Modules/Designer/Layouts/PopupAreaProvider.js +20 -67
- package/App/Modules/Designer/MultilayerComponents/DesignerClickAwayListener.js +5 -23
- package/App/Modules/Designer/MultilayerComponents/InlineToolboxPortal.js +19 -52
- package/App/Modules/Designer/MultilayerComponents/StandardToolboxPortal.js +9 -25
- package/App/Modules/Designer/Utils/FontFaceRepository.js +8 -30
- package/App/Modules/Designer/Utils/ImageEditUtils.js +14 -38
- package/App/Modules/Designer/Utils/SvgFixers.js +8 -26
- package/App/Modules/Designer/Utils/Transformers.js +54 -112
- package/App/Modules/Designer/setupDesigner.js +50 -72
- package/App/Modules/Designer/withActiveCanvas.js +22 -70
- package/App/Modules/Visualization/AlignTargetContainer.js +8 -19
- package/App/Modules/Visualization/CreatorAlignTarget.js +9 -20
- package/App/Modules/Visualization/DefaultVisualizationProvider.js +18 -50
- package/App/Modules/Visualization/DesignerAlignTarget.js +7 -13
- package/App/Modules/Visualization/Utils/getFirstDataURLFromScreenshotsObj.js +0 -3
- package/App/Reducers/Actions.js +81 -145
- package/App/Reducers/ConfigurationMode/Actions.js +4 -9
- package/App/Reducers/ConfigurationMode/Reducer.js +6 -23
- package/App/Reducers/ConfigurationMode/Selectors.js +22 -41
- package/App/Reducers/Configurator/Actions.js +386 -760
- package/App/Reducers/Configurator/AttributeSelectors.js +5 -17
- package/App/Reducers/Configurator/Modifiers.js +8 -15
- package/App/Reducers/Configurator/Reducer.js +107 -202
- package/App/Reducers/Configurator/Selectors.js +46 -119
- package/App/Reducers/Confirm/Actions.js +28 -49
- package/App/Reducers/Confirm/Reducer.js +1 -9
- package/App/Reducers/DesignArea/Actions.js +8 -29
- package/App/Reducers/DesignArea/DesignElementSelectors.js +18 -41
- package/App/Reducers/DesignArea/MaskSelectors.js +12 -35
- package/App/Reducers/DesignArea/Reducer.js +8 -40
- package/App/Reducers/DesignArea/Selectors.js +148 -413
- package/App/Reducers/DesignArea/Transformers.js +22 -87
- package/App/Reducers/DesignData/Actions.js +31 -93
- package/App/Reducers/DesignData/Modifiers.js +34 -114
- package/App/Reducers/DesignData/Reducer.js +9 -38
- package/App/Reducers/DesignData/Selectors.js +17 -50
- package/App/Reducers/DesignData/Transformers.js +2 -6
- package/App/Reducers/DesignView/Actions.js +3 -7
- package/App/Reducers/DesignView/Reducer.js +13 -47
- package/App/Reducers/DesignView/Selectors.js +17 -49
- package/App/Reducers/DesignView/Transformers.js +0 -3
- package/App/Reducers/Device/Actions.js +3 -7
- package/App/Reducers/Device/Reducer.js +9 -16
- package/App/Reducers/Fonts/Actions.js +12 -45
- package/App/Reducers/Fonts/Reducer.js +2 -11
- package/App/Reducers/Fonts/Selectors.js +9 -25
- package/App/Reducers/GeneralActions.js +3 -7
- package/App/Reducers/ImageGallery/Actions.js +97 -189
- package/App/Reducers/ImageGallery/Modifiers.js +13 -24
- package/App/Reducers/ImageGallery/Reducer.js +29 -98
- package/App/Reducers/ImageGallery/Selectors.js +21 -79
- package/App/Reducers/Reducer.js +10 -26
- package/App/Reducers/UI/Actions.js +73 -113
- package/App/Reducers/UI/Reducer.js +17 -26
- package/App/Reducers/UI/Selectors.js +3 -12
- package/App/Reducers.js +7 -21
- package/App/Routing.js +30 -107
- package/App/Screens/Configurator/CalculationWidgetScreen.js +10 -39
- package/App/Screens/Configurator/Components/AmountSelection/index.js +25 -77
- package/App/Screens/Configurator/Components/AmountSelection/index.story.js +0 -8
- package/App/Screens/Configurator/Components/CalculationWidget/index.js +53 -154
- package/App/Screens/Configurator/Components/CalculationWidget/index.story.js +6 -19
- package/App/Screens/Configurator/Components/CalculationWidget/index.test.js +39 -38
- package/App/Screens/Configurator/Components/ConfigurationModeSwitch/ConfigurationModeSwitch.js +7 -30
- package/App/Screens/Configurator/Components/ConfigurationModeSwitch/index.js +0 -2
- package/App/Screens/Configurator/Components/Confirm/index.js +13 -50
- package/App/Screens/Configurator/Components/Error/index.js +11 -48
- package/App/Screens/Configurator/Components/FallbackVisualization/FallbackVisualization.js +13 -25
- package/App/Screens/Configurator/Components/FullScreenView/index.js +37 -116
- package/App/Screens/Configurator/Components/FullScreenView/index.test.js +1 -4
- package/App/Screens/Configurator/Components/ImageLoader/ImageLoader.js +11 -42
- package/App/Screens/Configurator/Components/ItemTile/ItemTile.js +89 -33
- package/App/Screens/Configurator/Components/LandscapeInformation/index.js +3 -19
- package/App/Screens/Configurator/Components/NoVisualization/NoVisualization.js +3 -11
- package/App/Screens/Configurator/Components/PreviewPortal/index.js +29 -81
- package/App/Screens/Configurator/Components/Thumbnail/index.js +36 -102
- package/App/Screens/Configurator/Components/Thumbnail/index.test.js +0 -4
- package/App/Screens/Configurator/Components/TotalPrice/TotalPrice.js +9 -24
- package/App/Screens/Configurator/Containers/AmountPrice.js +12 -36
- package/App/Screens/Configurator/Containers/CalculationWidget.js +24 -85
- package/App/Screens/Configurator/Containers/ConfigurationModeSwitch.js +22 -43
- package/App/Screens/Configurator/Containers/Confirm.js +1 -10
- package/App/Screens/Configurator/Containers/FallbackVisualization.js +1 -11
- package/App/Screens/Configurator/Containers/FullScreenView.js +1 -14
- package/App/Screens/Configurator/Containers/Thumbnail.js +1 -13
- package/App/Screens/Configurator/Containers/Visualization.js +1 -5
- package/App/Screens/Configurator/DynamicComponents.js +8 -22
- package/App/Screens/Configurator/Screen.js +31 -70
- package/App/Screens/Configurator/ScreenPropTypes.js +2 -6
- package/App/Screens/Configurator/ThemeProvider.js +8 -42
- package/App/Screens/DesignerProductPreview/Constants.js +4 -7
- package/App/Screens/DesignerProductPreview/DesignerProductPreviewManager.js +204 -289
- package/App/Screens/DesignerProductPreview/Screen.js +58 -139
- package/App/Screens/ItemOverview.js +156 -191
- package/App/Screens.js +12 -20
- package/App/ServiceLocator.js +26 -51
- package/App/Services/AdminareaCommunicationService.js +33 -69
- package/App/Services/AnalyticsService.js +13 -40
- package/App/Services/ConfiguratorService.js +381 -567
- package/App/Services/DesignDataService.js +1448 -2001
- package/App/Services/DesignerService.js +290 -350
- package/App/Services/InteractionService.js +349 -502
- package/App/Services/UIService.js +12 -39
- package/App/Services/VisualizationService.js +246 -336
- package/App/Shared/Components/AcceptDesign/index.js +27 -70
- package/App/Shared/Components/AcceptPrivacy/index.js +21 -58
- package/App/Shared/Components/AddToBasket/index.js +31 -81
- package/App/Shared/Components/AddToBasket/index.story.js +0 -9
- package/App/Shared/Components/AlertDialog/index.js +15 -57
- package/App/Shared/Components/AmountInput/index.js +34 -107
- package/App/Shared/Components/AmountInput/index.story.js +0 -6
- package/App/Shared/Components/AmountPrice/index.js +220 -382
- package/App/Shared/Components/AmountPrice/index.story.js +1 -10
- package/App/Shared/Components/AmountPrice/index.test.js +6 -12
- package/App/Shared/Components/Analytics/AnalyticsWrapper.js +9 -21
- package/App/Shared/Components/BulkNames/index.js +28 -92
- package/App/Shared/Components/CallToAction/index.js +18 -42
- package/App/Shared/Components/ConfigurationOverview/index.js +14 -47
- package/App/Shared/Components/Header/Header.js +18 -46
- package/App/Shared/Components/Header/index.js +0 -2
- package/App/Shared/Components/Header/index.story.js +0 -13
- package/App/Shared/Components/InformationTag/InformationTag.js +20 -55
- package/App/Shared/Components/LicenseNotice/LicenseNotice.js +20 -54
- package/App/Shared/Components/LicenseNotice/index.js +0 -2
- package/App/Shared/Components/LoadConfiguration/index.js +47 -82
- package/App/Shared/Components/MessageBox/index.js +2 -19
- package/App/Shared/Components/MessageBox/index.story.js +0 -7
- package/App/Shared/Components/Notification/index.js +18 -53
- package/App/Shared/Components/Notification/index.story.js +0 -4
- package/App/Shared/Components/PdfDownload/index.js +19 -59
- package/App/Shared/Components/PlusMinusInput/index.js +13 -37
- package/App/Shared/Components/PriceList/index.js +27 -78
- package/App/Shared/Components/PriceList/index.story.js +6 -15
- package/App/Shared/Components/PriceOverview/index.js +29 -74
- package/App/Shared/Components/PriceOverview/index.story.js +1 -18
- package/App/Shared/Components/ProductVariant/Image.js +13 -35
- package/App/Shared/Components/ProductVariant/index.js +34 -123
- package/App/Shared/Components/ProductVariant/index.story.js +9 -22
- package/App/Shared/Components/Progress/Progress.js +6 -15
- package/App/Shared/Components/ReceiveOfferForm/index.js +26 -80
- package/App/Shared/Components/ReceiveOfferForm/index.story.js +0 -6
- package/App/Shared/Components/ReceiveOfferForm/index.test.js +1 -6
- package/App/Shared/Components/SaveConfiguration/index.js +26 -83
- package/App/Shared/Components/SendEmail/index.js +8 -30
- package/App/Shared/Components/Stepper/index.js +19 -56
- package/App/Shared/Components/Stepper/index.story.js +0 -5
- package/App/Shared/Components/ToolbarList/index.js +23 -69
- package/App/Shared/Components/ToolbarList/index.story.js +0 -4
- package/App/Shared/Components/VariantChooser/index.js +25 -68
- package/App/Shared/Components/VariantChooser/index.story.js +0 -13
- package/App/Shared/Containers/AlertMessages.js +1 -11
- package/App/Shared/Containers/AmountPrice/AmountPriceAdminareaWrapper.js +4 -17
- package/App/Shared/Containers/AmountPrice/index.js +29 -74
- package/App/Shared/Containers/BulkNames.js +26 -117
- package/App/Shared/Containers/Error.js +1 -11
- package/App/Shared/Containers/GlobalLoader.js +1 -9
- package/App/Shared/Containers/Header/index.js +22 -57
- package/App/Shared/Containers/LicenseNotice/LicenseNotice.js +2 -9
- package/App/Shared/Containers/LicenseNotice/index.js +0 -2
- package/App/Shared/Containers/LoadConfiguration/LoadConfiguration.js +36 -79
- package/App/Shared/Containers/LoadConfiguration/index.js +0 -2
- package/App/Shared/Containers/PdfDownload/index.js +2 -11
- package/App/Shared/Containers/ProductVariant/ProductVariant.js +59 -144
- package/App/Shared/Containers/ProductVariant/index.js +0 -2
- package/App/Shared/Containers/SaveConfiguration.js +3 -14
- package/App/Shared/Containers/SendEmail/SendEmail.js +3 -15
- package/App/Shared/Containers/SendEmail/index.js +0 -2
- package/App/Shared/Providers/DefaultCanvasProvider.js +5 -25
- package/App/Storage.js +3 -7
- package/App/Store.js +17 -38
- package/App/Translations.js +29 -43
- package/App/Utils/Request/lazyFetch.js +29 -45
- package/App/Utils/Request/pathParams.js +2 -7
- package/App/Utils/createMessageInterface.js +10 -21
- package/App/Utils/customClassName.js +0 -2
- package/App/Utils/getContrastText.js +5 -7
- package/App/Utils/getImageUrl.js +0 -8
- package/App/configuration.js +74 -104
- package/App/index.js +7 -29
- package/App/initServices.js +9 -32
- package/App/setup.js +2 -6
- package/Framework/Api.js +19 -41
- package/Framework/ComponentContainer.js +28 -76
- package/Framework/Components/Carousel/index.js +40 -104
- package/Framework/Components/Dialog/index.js +101 -237
- package/Framework/Components/DialogSelect/index.js +38 -132
- package/Framework/Components/Input/index.js +16 -58
- package/Framework/Components/LoadingOverlay/index.js +1 -12
- package/Framework/Components/Markdown/index.js +5 -26
- package/Framework/Components/Mobile/index.js +5 -13
- package/Framework/CustomError.js +13 -29
- package/Framework/Helpers/TransitionDetect.js +10 -29
- package/Framework/Helpers/isLandscapeMobile.js +0 -3
- package/Framework/Helpers/isMobileDevice.js +3 -8
- package/Framework/Helpers/isMobileSize.js +1 -4
- package/Framework/Services/AbstractAdminareaCommunicationService.js +8 -15
- package/Framework/Services/AbstractAsyncService.js +7 -14
- package/Framework/Services/AbstractConfiguratorService.js +9 -15
- package/Framework/Services/AbstractInteractionService.js +7 -14
- package/Framework/Services/AbstractStoreService.js +9 -15
- package/Framework/Services/AbstractUIService.js +7 -14
- package/Framework/Services/AbstractVisualizationService.js +7 -14
- package/Framework/Services/AsyncService.js +11 -33
- package/Framework/Services/StoreService.js +43 -92
- package/Framework/bindDecorator.js +24 -54
- package/Framework/i18n.js +57 -142
- package/Resources/Icons/MaterialUI/Icons/AddCircle.js +1 -5
- package/Resources/Icons/MaterialUI/Icons/RemoveCircle.js +1 -5
- package/Shared/Components/CustomDialog.js +21 -36
- package/Shared/Components/CustomDialogSelect.js +17 -47
- package/Shared/Components/MainButton.js +14 -33
- package/Shared/ErrorTypes/DeferredError.js +13 -31
- package/Shared/HOCs/ResizeDetect/ResizeDetect.dev.js +9 -18
- package/Shared/HOCs/ResizeDetect/ResizeDetect.js +28 -87
- package/Shared/HOCs/getDisplayName.js +0 -1
- package/Shared/HOCs/withFixedChangeHandler.js +11 -25
- package/Shared/PropTypes/ReactComponent.js +1 -5
- package/Shared/Styles/absoluteCenter.js +2 -5
- package/Utils/Array/isIdentical.js +3 -12
- package/Utils/Async/AsyncManager.js +51 -75
- package/Utils/Async/Deferred.js +12 -40
- package/Utils/Async/ObjectLock.js +3 -7
- package/Utils/Decorators/Observable.js +17 -34
- package/Utils/Dev/HOCs/withFilePicker.js +13 -41
- package/Utils/Dev/isDev.js +0 -2
- package/Utils/Events/pointerEvent.js +14 -47
- package/Utils/Events/preventEventDoubling.js +2 -7
- package/Utils/Function/cached.js +1 -9
- package/Utils/Function/createDebounceManager.js +3 -18
- package/Utils/Function/createSelector.js +7 -18
- package/Utils/Function/memoize.js +3 -12
- package/Utils/Function/sendMessage.js +3 -8
- package/Utils/Helper/createSelectionRangeMemo.js +4 -12
- package/Utils/Immutable/set.js +12 -35
- package/Utils/Math/conversions.js +2 -5
- package/Utils/Math/isPositiveNumber.js +2 -5
- package/Utils/Redux/createActionWithGlobalState.js +8 -11
- package/Utils/Styles/combineMediaQueries.js +2 -6
- package/Utils/Styles/createCheckerBoardBackground.js +5 -6
- package/Utils/Test/CallOrderChecker.js +0 -3
- package/Utils/Test/createStoreProvider.js +1 -7
- package/Utils/Test/formDataToJSON.js +0 -1
- package/Utils/Test/mountWithState.js +3 -9
- package/index.js +2 -2
- package/package.json +36 -33
- package/public/translations/de_DE.json +3 -27
- package/public/translations/en_GB.json +2 -26
- package/scripts/getDefaultWebpackConfig.js +21 -13
- package/src/App/Error/ProductionErrorPage/index.js +1 -1
- package/src/App/Modules/Creator/Components/ConfigurationvariantItem/index.js +3 -4
- package/src/App/Modules/Creator/Components/ConfigurationvariantSelection/index.js +2 -1
- package/src/App/Modules/Creator/Components/FastConfiguration/SelectableRow.js +1 -1
- package/src/App/Modules/Creator/Components/FastConfiguration/index.js +6 -5
- package/src/App/Modules/Creator/Components/FastConfigurationSelect/index.js +8 -6
- package/src/App/Modules/Creator/Components/FullScreenView/FullScreenView.js +3 -1
- package/src/App/Modules/Creator/Components/Incompatibility/OptionExclusionRule/index.js +2 -2
- package/src/App/Modules/Creator/Components/Incompatibility/OptionRule/index.js +2 -2
- package/src/App/Modules/Creator/Components/Incompatibility/index.js +2 -2
- package/src/App/Modules/Creator/Components/InvalidConfigurationNotice/index.js +1 -1
- package/src/App/Modules/Creator/Components/Option/__snapshots__/index.test.js.snap +0 -13
- package/src/App/Modules/Creator/Components/Option/index.js +9 -6
- package/src/App/Modules/Creator/Components/Option/index.test.js +1 -1
- package/src/App/Modules/Creator/Components/OptionAmount/index.js +2 -1
- package/src/App/Modules/Creator/Components/OptionAmount/index.test.js +1 -1
- package/src/App/Modules/Creator/Components/Optiondetail/ZoomImage/index.js +1 -1
- package/src/App/Modules/Creator/Components/Optiondetail/index.js +9 -7
- package/src/App/Modules/Creator/Components/Optiondetail/index.story.js +1 -48
- package/src/App/Modules/Creator/Components/Optiondetail/index.test.js +1 -1
- package/src/App/Modules/Creator/Components/Optiondetail/index.test.mocks.js +49 -0
- package/src/App/Modules/Creator/Components/OptionsList/index.js +3 -2
- package/src/App/Modules/Creator/Components/ProductPart/index.test.js +1 -1
- package/src/App/Modules/Creator/Components/ProductPartsList/index.js +1 -1
- package/src/App/Modules/Creator/Components/SavedConfiguration/index.js +3 -3
- package/src/App/Modules/Creator/Components/StoreConfigurationForm/index.js +2 -2
- package/src/App/Modules/Creator/Containers/CustomTitleEditor/index.js +1 -1
- package/src/App/Modules/Creator/Containers/FastConfiguration/index.js +1 -1
- package/src/App/Modules/Creator/Containers/FormattedPrice/index.js +1 -1
- package/src/App/Modules/Creator/Containers/InvalidConfigurationNotice/index.js +1 -1
- package/src/App/Modules/Creator/Containers/Optiondetail/index.js +1 -1
- package/src/App/Modules/Designer/Components/AddGalleryImage/__snapshots__/index.test.jsx.snap +0 -8
- package/src/App/Modules/Designer/Components/AddGalleryImage/index.js +4 -4
- package/src/App/Modules/Designer/Components/AddGalleryImage/index.test.jsx +0 -27
- package/src/App/Modules/Designer/Components/AddVisualElement/index.js +6 -6
- package/src/App/Modules/Designer/Components/AddVisualElement/index.test.jsx +3 -2
- package/src/App/Modules/Designer/Components/CloseDesignEditor/index.js +3 -3
- package/src/App/Modules/Designer/Components/ColorPalettes/ColorPalettesSearch.js +6 -6
- package/src/App/Modules/Designer/Components/ColorPalettes/index.js +14 -14
- package/src/App/Modules/Designer/Components/ColorPalettes/index.test.jsx +1 -1
- package/src/App/Modules/Designer/Components/DesignAreaControlbox/index.js +8 -8
- package/src/App/Modules/Designer/Components/DesignAreaControlbox/index.test.jsx +1 -1
- package/src/App/Modules/Designer/Components/DesignerSelectionToolbox/CustomFontOverlay.js +5 -5
- package/src/App/Modules/Designer/Components/DesignerSelectionToolbox/DesignerSelectionToolbox.js +2 -2
- package/src/App/Modules/Designer/Components/Dialog/index.js +1 -1
- package/src/App/Modules/Designer/Components/EditDesignButton/index.js +3 -2
- package/src/App/Modules/Designer/Components/FeedbackNotice/index.js +3 -3
- package/src/App/Modules/Designer/Components/ImageColorize/index.js +1 -1
- package/src/App/Modules/Designer/Components/ImageControlbox/index.js +6 -6
- package/src/App/Modules/Designer/Components/ImageEditDialog/ImageUpload.js +32 -6
- package/src/App/Modules/Designer/Components/ImageEditDialog/index.js +16 -12
- package/src/App/Modules/Designer/Components/ImageLibraryFilter/index.js +6 -6
- package/src/App/Modules/Designer/Components/ImageLibraryThumbnail/index.js +11 -7
- package/src/App/Modules/Designer/Components/ObjectTools/index.js +2 -2
- package/src/App/Modules/Designer/Components/Select/index.js +3 -3
- package/src/App/Modules/Designer/Components/TextControlbox/TextFormatIcon.js +1 -1
- package/src/App/Modules/Designer/Components/TextControlbox/index.js +11 -11
- package/src/App/Modules/Designer/Components/TextControlbox/index.test.jsx +3 -2
- package/src/App/Modules/Designer/Containers/AddGalleryImage.js +1 -1
- package/src/App/Modules/Designer/Designer.js +1 -1
- package/src/App/Modules/Designer/DesignerUI.js +7 -2
- package/src/App/Modules/Designer/Layouts/Mobile/TwoSideBottomBar.js +1 -1
- package/src/App/Modules/Designer/Layouts/PopupAreaProvider.js +1 -1
- package/src/App/Modules/Designer/MultilayerComponents/DesignerClickAwayListener.js +1 -1
- package/src/App/Modules/Designer/MultilayerComponents/InlineToolboxPortal.js +1 -1
- package/src/App/Modules/Designer/MultilayerComponents/StandardToolboxPortal.js +1 -1
- package/src/App/Modules/Designer/setupDesigner.js +22 -19
- package/src/App/Modules/Visualization/AlignTargetContainer.js +1 -1
- package/src/App/Modules/Visualization/CreatorAlignTarget.js +1 -1
- package/src/App/Modules/Visualization/DefaultVisualizationProvider.js +7 -2
- package/src/App/Modules/Visualization/DesignerAlignTarget.js +1 -1
- package/src/App/Reducers/Actions.js +5 -5
- package/src/App/Reducers/ConfigurationMode/Selectors.js +6 -0
- package/src/App/Reducers/Configurator/Actions.js +8 -1
- package/src/App/Reducers/Configurator/Reducer.js +27 -21
- package/src/App/Reducers/Configurator/Selectors.js +4 -1
- package/src/App/Reducers/DesignArea/Selectors.js +10 -0
- package/src/App/Reducers/Reducer.js +4 -3
- package/src/App/Reducers/UI/Actions.js +15 -1
- package/src/App/Reducers/UI/Reducer.js +20 -0
- package/src/App/Routing.js +12 -29
- package/src/App/Screens/Configurator/CalculationWidgetScreen.js +1 -4
- package/src/App/Screens/Configurator/Components/AmountSelection/index.js +4 -4
- package/src/App/Screens/Configurator/Components/CalculationWidget/index.js +3 -3
- package/src/App/Screens/Configurator/Components/CalculationWidget/index.test.jsx +5 -2
- package/src/App/Screens/Configurator/Components/ConfigurationModeSwitch/ConfigurationModeSwitch.js +1 -1
- package/src/App/Screens/Configurator/Components/FallbackVisualization/FallbackVisualization.js +1 -1
- package/src/App/Screens/Configurator/Components/FullScreenView/index.js +4 -4
- package/src/App/Screens/Configurator/Components/ItemTile/ItemTile.js +55 -17
- package/src/App/Screens/Configurator/Components/LandscapeInformation/index.js +1 -1
- package/src/App/Screens/Configurator/Components/NoVisualization/NoVisualization.js +1 -1
- package/src/App/Screens/Configurator/Components/PreviewPortal/index.js +7 -5
- package/src/App/Screens/Configurator/Components/Thumbnail/index.js +5 -4
- package/src/App/Screens/Configurator/Components/TotalPrice/TotalPrice.js +3 -3
- package/src/App/Screens/Configurator/Containers/AmountPrice.js +1 -1
- package/src/App/Screens/Configurator/Containers/__tests__/CalculationWidget.test.js +4 -1
- package/src/App/Screens/Configurator/Screen.js +13 -5
- package/src/App/Screens/Configurator/__tests__/Screen.test.js +6 -0
- package/src/App/Screens/DesignerProductPreview/Screen.js +2 -3
- package/src/App/Screens/DesignerProductPreview/__tests__/__snapshots__/Screen.test.js.snap +11 -11
- package/src/App/Screens/ItemOverview.js +74 -57
- package/src/App/Screens.js +1 -1
- package/src/App/Services/AnalyticsService.js +2 -1
- package/src/App/Services/DesignDataService.js +53 -7
- package/src/App/Services/DesignerService.js +22 -13
- package/src/App/Services/UIService.js +1 -1
- package/src/App/Services/VisualizationService.js +41 -2
- package/src/App/Services/__tests__/DesignDataService.test.js +1 -0
- package/src/App/Shared/Components/AcceptDesign/index.js +7 -6
- package/src/App/Shared/Components/AcceptPrivacy/index.js +4 -3
- package/src/App/Shared/Components/AddToBasket/index.js +4 -4
- package/src/App/Shared/Components/AmountInput/index.js +1 -1
- package/src/App/Shared/Components/AmountPrice/__snapshots__/index.test.jsx.snap +0 -125
- package/src/App/Shared/Components/AmountPrice/index.js +40 -17
- package/src/App/Shared/Components/AmountPrice/index.test.jsx +1 -1
- package/src/App/Shared/Components/Analytics/AnalyticsWrapper.test.js +2 -1
- package/src/App/Shared/Components/BulkNames/index.js +3 -3
- package/src/App/Shared/Components/CallToAction/__snapshots__/index.test.js.snap +4 -4
- package/src/App/Shared/Components/CallToAction/index.js +3 -3
- package/src/App/Shared/Components/CallToAction/index.test.js +1 -1
- package/src/App/Shared/Components/ConfigurationOverview/index.js +1 -1
- package/src/App/Shared/Components/Header/Header.js +3 -3
- package/src/App/Shared/Components/InformationTag/InformationTag.js +4 -2
- package/src/App/Shared/Components/LicenseNotice/LicenseNotice.js +3 -1
- package/src/App/Shared/Components/LoadConfiguration/index.js +27 -13
- package/src/App/Shared/Components/Notification/index.js +3 -3
- package/src/App/Shared/Components/PdfDownload/index.js +3 -3
- package/src/App/Shared/Components/PlusMinusInput/index.js +4 -4
- package/src/App/Shared/Components/PriceList/index.js +9 -9
- package/src/App/Shared/Components/PriceList/index.test.js +2 -2
- package/src/App/Shared/Components/PriceOverview/index.js +4 -4
- package/src/App/Shared/Components/PriceOverview/index.story.js +1 -1
- package/src/App/Shared/Components/ProductVariant/Image.js +1 -1
- package/src/App/Shared/Components/ProductVariant/index.js +5 -5
- package/src/App/Shared/Components/Progress/Progress.js +3 -3
- package/src/App/Shared/Components/ReceiveOfferForm/index.js +4 -4
- package/src/App/Shared/Components/SaveConfiguration/index.js +3 -3
- package/src/App/Shared/Components/SendEmail/index.js +3 -3
- package/src/App/Shared/Components/Stepper/index.js +4 -4
- package/src/App/Shared/Components/ToolbarList/index.js +6 -6
- package/src/App/Shared/Components/VariantChooser/index.js +7 -7
- package/src/App/Shared/Containers/AmountPrice/index.js +7 -1
- package/src/App/Shared/Containers/SaveConfiguration.js +1 -1
- package/src/App/Utils/Request/lazyFetch.js +2 -3
- package/src/App/configuration.js +20 -15
- package/src/App/index.js +2 -2
- package/src/Framework/Api.js +3 -3
- package/src/Framework/Components/Carousel/index.js +2 -2
- package/src/Framework/Components/Dialog/index.js +13 -10
- package/src/Framework/Components/DialogSelect/index.js +6 -5
- package/src/Framework/i18n.js +15 -8
- package/src/Shared/Components/CustomDialog.js +2 -1
- package/src/Shared/Components/CustomDialogSelect.js +2 -2
- package/src/Shared/Components/MainButton.js +2 -2
- package/src/Shared/Components/__tests__/index.test.jsx +6 -1
- package/src/Shared/HOCs/ResizeDetect/ResizeDetect.dev.js +1 -1
- package/src/Utils/Decorators/Observable.js +1 -0
- package/src/Utils/Test/mountWithState.js +1 -1
- package/App/Modules/Designer/Components/ImageEditDialog/res/checkers_tile.png +0 -0
- package/src/App/Modules/Designer/Components/ImageEditDialog/res/checkers_tile.png +0 -0
|
@@ -1,41 +1,27 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
|
|
4
|
-
|
|
5
3
|
Object.defineProperty(exports, "__esModule", {
|
|
6
4
|
value: true
|
|
7
5
|
});
|
|
8
|
-
exports.withFilePicker = withFilePicker;
|
|
9
6
|
exports["default"] = void 0;
|
|
10
|
-
|
|
7
|
+
exports.withFilePicker = withFilePicker;
|
|
11
8
|
var _react = _interopRequireDefault(require("react"));
|
|
12
|
-
|
|
13
9
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
|
14
|
-
|
|
15
|
-
function _extends() { _extends = Object.assign
|
|
16
|
-
|
|
10
|
+
function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
|
|
11
|
+
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
17
12
|
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
18
|
-
|
|
19
|
-
function
|
|
20
|
-
|
|
21
|
-
function
|
|
22
|
-
|
|
23
|
-
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); }
|
|
24
|
-
|
|
25
|
-
function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
|
|
26
|
-
|
|
13
|
+
function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, _toPropertyKey(descriptor.key), descriptor); } }
|
|
14
|
+
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
|
|
15
|
+
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) _setPrototypeOf(subClass, superClass); }
|
|
16
|
+
function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
|
|
27
17
|
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
|
|
28
|
-
|
|
29
|
-
function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized(self); }
|
|
30
|
-
|
|
18
|
+
function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return _assertThisInitialized(self); }
|
|
31
19
|
function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
|
|
32
|
-
|
|
33
20
|
function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
|
|
34
|
-
|
|
35
|
-
function
|
|
36
|
-
|
|
37
|
-
function
|
|
38
|
-
|
|
21
|
+
function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
|
|
22
|
+
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
23
|
+
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
|
|
24
|
+
function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
|
|
39
25
|
/**
|
|
40
26
|
* HOC to provide src to the wrapped component with a file input field in a really simple way.
|
|
41
27
|
* Note: this component was created only as a development helper
|
|
@@ -45,24 +31,17 @@ function _defineProperty(obj, key, value) { if (key in obj) { Object.definePrope
|
|
|
45
31
|
function withFilePicker(Component) {
|
|
46
32
|
var FilePicker = /*#__PURE__*/function (_React$Component) {
|
|
47
33
|
_inherits(FilePicker, _React$Component);
|
|
48
|
-
|
|
49
34
|
var _super = _createSuper(FilePicker);
|
|
50
|
-
|
|
51
35
|
function FilePicker() {
|
|
52
36
|
var _this;
|
|
53
|
-
|
|
54
37
|
_classCallCheck(this, FilePicker);
|
|
55
|
-
|
|
56
38
|
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
57
39
|
args[_key] = arguments[_key];
|
|
58
40
|
}
|
|
59
|
-
|
|
60
41
|
_this = _super.call.apply(_super, [this].concat(args));
|
|
61
|
-
|
|
62
42
|
_defineProperty(_assertThisInitialized(_this), "state", {
|
|
63
43
|
src: false
|
|
64
44
|
});
|
|
65
|
-
|
|
66
45
|
_defineProperty(_assertThisInitialized(_this), "onChange", function (evt) {
|
|
67
46
|
var reader = new FileReader();
|
|
68
47
|
reader.addEventListener('load', function () {
|
|
@@ -70,15 +49,12 @@ function withFilePicker(Component) {
|
|
|
70
49
|
src: reader.result
|
|
71
50
|
});
|
|
72
51
|
}, false);
|
|
73
|
-
|
|
74
52
|
if (evt.target.files && evt.target.files.length) {
|
|
75
53
|
reader.readAsDataURL(evt.target.files[0]);
|
|
76
54
|
}
|
|
77
55
|
});
|
|
78
|
-
|
|
79
56
|
return _this;
|
|
80
57
|
}
|
|
81
|
-
|
|
82
58
|
_createClass(FilePicker, [{
|
|
83
59
|
key: "render",
|
|
84
60
|
value: function render() {
|
|
@@ -90,12 +66,8 @@ function withFilePicker(Component) {
|
|
|
90
66
|
}, this.props))));
|
|
91
67
|
}
|
|
92
68
|
}]);
|
|
93
|
-
|
|
94
69
|
return FilePicker;
|
|
95
70
|
}(_react["default"].Component);
|
|
96
|
-
|
|
97
71
|
return FilePicker;
|
|
98
72
|
}
|
|
99
|
-
|
|
100
|
-
var _default = withFilePicker;
|
|
101
|
-
exports["default"] = _default;
|
|
73
|
+
var _default = exports["default"] = withFilePicker;
|
package/Utils/Dev/isDev.js
CHANGED
|
@@ -4,7 +4,6 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports["default"] = isDev;
|
|
7
|
-
|
|
8
7
|
/**
|
|
9
8
|
* Returns if the environment is development or not
|
|
10
9
|
* When true it calls the given callback if there is one
|
|
@@ -16,6 +15,5 @@ function isDev(cb) {
|
|
|
16
15
|
cb && cb();
|
|
17
16
|
return true;
|
|
18
17
|
}
|
|
19
|
-
|
|
20
18
|
return false;
|
|
21
19
|
}
|
|
@@ -3,17 +3,15 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
exports.
|
|
7
|
-
|
|
6
|
+
exports.getPointFromPointerEvent = exports.createPositionChangeChecker = exports.createPointerHitListener = exports.createPointerEventListener = void 0;
|
|
8
7
|
/**
|
|
9
8
|
* @param {MouseEvent|TouchEvent} evt
|
|
10
9
|
* @param {HTMLElement} relativeTo
|
|
11
10
|
* @returns {{x: number, y: number}}
|
|
12
11
|
*/
|
|
13
|
-
var getPointFromPointerEvent = function getPointFromPointerEvent(evt, relativeTo) {
|
|
12
|
+
var getPointFromPointerEvent = exports.getPointFromPointerEvent = function getPointFromPointerEvent(evt, relativeTo) {
|
|
14
13
|
var x, y;
|
|
15
14
|
var touches = evt.changedTouches && evt.changedTouches.length > 0 && evt.changedTouches || evt.touches;
|
|
16
|
-
|
|
17
15
|
if (touches && touches.length > 0) {
|
|
18
16
|
x = touches[0].clientX;
|
|
19
17
|
y = touches[0].clientY;
|
|
@@ -21,21 +19,19 @@ var getPointFromPointerEvent = function getPointFromPointerEvent(evt, relativeTo
|
|
|
21
19
|
x = evt.clientX;
|
|
22
20
|
y = evt.clientY;
|
|
23
21
|
}
|
|
24
|
-
|
|
25
22
|
if (relativeTo) {
|
|
26
23
|
var _relativeTo$getBoundi = relativeTo.getBoundingClientRect(),
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
24
|
+
top = _relativeTo$getBoundi.top,
|
|
25
|
+
left = _relativeTo$getBoundi.left;
|
|
30
26
|
x -= left;
|
|
31
27
|
y -= top;
|
|
32
28
|
}
|
|
33
|
-
|
|
34
29
|
return {
|
|
35
30
|
x: x,
|
|
36
31
|
y: y
|
|
37
32
|
};
|
|
38
33
|
};
|
|
34
|
+
|
|
39
35
|
/**
|
|
40
36
|
* Creates and stores the print of the event position for later comparison.
|
|
41
37
|
* It can be used to create a position change checker function, in order to solve the problem
|
|
@@ -43,20 +39,16 @@ var getPointFromPointerEvent = function getPointFromPointerEvent(evt, relativeTo
|
|
|
43
39
|
* @param evt
|
|
44
40
|
* @returns {function(*=): boolean}
|
|
45
41
|
*/
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
exports.getPointFromPointerEvent = getPointFromPointerEvent;
|
|
49
|
-
|
|
50
|
-
var createPositionChangeChecker = function createPositionChangeChecker(evt) {
|
|
42
|
+
var createPositionChangeChecker = exports.createPositionChangeChecker = function createPositionChangeChecker(evt) {
|
|
51
43
|
var getPositionPrint = function getPositionPrint(evt) {
|
|
52
44
|
return '' + evt.pageX + '-' + evt.pageY;
|
|
53
45
|
};
|
|
54
|
-
|
|
55
46
|
var initialPrint = getPositionPrint(evt);
|
|
56
47
|
return function (evt) {
|
|
57
48
|
return initialPrint !== getPositionPrint(evt);
|
|
58
49
|
};
|
|
59
50
|
};
|
|
51
|
+
|
|
60
52
|
/**
|
|
61
53
|
* Creates a "hit" event listener.
|
|
62
54
|
* It detects a single tap (or click) - if the pointer was released without moving.
|
|
@@ -64,29 +56,23 @@ var createPositionChangeChecker = function createPositionChangeChecker(evt) {
|
|
|
64
56
|
* @param {function} fn The event handler function
|
|
65
57
|
* @returns {function()} A function to be called to remove the event listeners
|
|
66
58
|
*/
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
exports.createPositionChangeChecker = createPositionChangeChecker;
|
|
70
|
-
|
|
71
|
-
var createPointerHitListener = function createPointerHitListener(element, fn) {
|
|
59
|
+
var createPointerHitListener = exports.createPointerHitListener = function createPointerHitListener(element, fn) {
|
|
72
60
|
var moved = false;
|
|
73
|
-
var checkPositionChange = false;
|
|
74
|
-
// see https://developer.mozilla.org/en-US/docs/Web/API/Touch_events/Supporting_both_TouchEvent_and_MouseEvent
|
|
61
|
+
var checkPositionChange = false;
|
|
75
62
|
|
|
63
|
+
// preventing the emulated mouse events after touchend
|
|
64
|
+
// see https://developer.mozilla.org/en-US/docs/Web/API/Touch_events/Supporting_both_TouchEvent_and_MouseEvent
|
|
76
65
|
var preventEmulatedEvents = function preventEmulatedEvents(cb) {
|
|
77
66
|
return function (evt) {
|
|
78
67
|
if (!moved && evt.type === 'touchend') {
|
|
79
68
|
evt.preventDefault();
|
|
80
69
|
}
|
|
81
|
-
|
|
82
70
|
cb(evt);
|
|
83
71
|
};
|
|
84
72
|
};
|
|
85
|
-
|
|
86
73
|
var startHandler = function startHandler(evt) {
|
|
87
74
|
moved = false;
|
|
88
75
|
var isTouch = (evt.changedTouches || evt.touches || []).length > 0;
|
|
89
|
-
|
|
90
76
|
if (isTouch) {
|
|
91
77
|
// in case of touch events we can skip the check, the events are fired correctly
|
|
92
78
|
checkPositionChange = false;
|
|
@@ -98,7 +84,6 @@ var createPointerHitListener = function createPointerHitListener(element, fn) {
|
|
|
98
84
|
element.addEventListener('mouseup', endHandler);
|
|
99
85
|
}
|
|
100
86
|
};
|
|
101
|
-
|
|
102
87
|
var moveHandler = function moveHandler(evt) {
|
|
103
88
|
if (checkPositionChange) {
|
|
104
89
|
moved = checkPositionChange(evt);
|
|
@@ -106,7 +91,6 @@ var createPointerHitListener = function createPointerHitListener(element, fn) {
|
|
|
106
91
|
moved = true;
|
|
107
92
|
}
|
|
108
93
|
};
|
|
109
|
-
|
|
110
94
|
var endHandler = preventEmulatedEvents(function () {
|
|
111
95
|
!moved && fn.apply(void 0, arguments);
|
|
112
96
|
element.removeEventListener('touchmove', moveHandler, true);
|
|
@@ -121,6 +105,7 @@ var createPointerHitListener = function createPointerHitListener(element, fn) {
|
|
|
121
105
|
element.removeEventListener('touchstart', startHandler);
|
|
122
106
|
};
|
|
123
107
|
};
|
|
108
|
+
|
|
124
109
|
/**
|
|
125
110
|
* Creates a general pointer event listener (for mouse and touch events)
|
|
126
111
|
* @param element
|
|
@@ -128,13 +113,8 @@ var createPointerHitListener = function createPointerHitListener(element, fn) {
|
|
|
128
113
|
* @param {function} fn The event handler function
|
|
129
114
|
* @returns {function()} A function to be called to remove the event listeners
|
|
130
115
|
*/
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
exports.createPointerHitListener = createPointerHitListener;
|
|
134
|
-
|
|
135
|
-
var createPointerEventListener = function createPointerEventListener(element, name, fn) {
|
|
116
|
+
var createPointerEventListener = exports.createPointerEventListener = function createPointerEventListener(element, name, fn) {
|
|
136
117
|
var touchName, mouseName;
|
|
137
|
-
|
|
138
118
|
switch (name) {
|
|
139
119
|
case 'start':
|
|
140
120
|
{
|
|
@@ -142,14 +122,12 @@ var createPointerEventListener = function createPointerEventListener(element, na
|
|
|
142
122
|
mouseName = 'mousedown';
|
|
143
123
|
break;
|
|
144
124
|
}
|
|
145
|
-
|
|
146
125
|
case 'move':
|
|
147
126
|
{
|
|
148
127
|
touchName = 'touchmove';
|
|
149
128
|
mouseName = 'mousemove';
|
|
150
129
|
break;
|
|
151
130
|
}
|
|
152
|
-
|
|
153
131
|
case 'end':
|
|
154
132
|
{
|
|
155
133
|
touchName = 'touchend';
|
|
@@ -157,43 +135,32 @@ var createPointerEventListener = function createPointerEventListener(element, na
|
|
|
157
135
|
break;
|
|
158
136
|
}
|
|
159
137
|
}
|
|
160
|
-
|
|
161
138
|
var tolerance = 1; // ms
|
|
162
|
-
|
|
163
139
|
var timeStamp = 0;
|
|
164
|
-
|
|
165
140
|
var touchHandler = function touchHandler(evt) {
|
|
166
141
|
// prevent mouse events if it's a touch event
|
|
167
142
|
//evt.type.indexOf('touch') === 0 && evt.preventDefault();
|
|
168
143
|
timeStamp = evt.timeStamp;
|
|
169
|
-
|
|
170
144
|
for (var _len = arguments.length, args = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
|
|
171
145
|
args[_key - 1] = arguments[_key];
|
|
172
146
|
}
|
|
173
|
-
|
|
174
147
|
fn.apply(void 0, [evt].concat(args));
|
|
175
148
|
};
|
|
176
|
-
|
|
177
149
|
var mouseHandler = function mouseHandler(evt) {
|
|
178
150
|
if (evt.timeStamp - timeStamp < tolerance) {
|
|
179
151
|
// eslint-disable-next-line no-console
|
|
180
152
|
console.log('Skipped double event handling.');
|
|
181
153
|
return;
|
|
182
154
|
}
|
|
183
|
-
|
|
184
155
|
for (var _len2 = arguments.length, args = new Array(_len2 > 1 ? _len2 - 1 : 0), _key2 = 1; _key2 < _len2; _key2++) {
|
|
185
156
|
args[_key2 - 1] = arguments[_key2];
|
|
186
157
|
}
|
|
187
|
-
|
|
188
158
|
fn.apply(void 0, [evt].concat(args));
|
|
189
159
|
};
|
|
190
|
-
|
|
191
160
|
element.addEventListener(touchName, touchHandler);
|
|
192
161
|
element.addEventListener(mouseName, mouseHandler);
|
|
193
162
|
return function () {
|
|
194
163
|
element.removeEventListener(touchName, touchHandler);
|
|
195
164
|
element.removeEventListener(mouseName, mouseHandler);
|
|
196
165
|
};
|
|
197
|
-
};
|
|
198
|
-
|
|
199
|
-
exports.createPointerEventListener = createPointerEventListener;
|
|
166
|
+
};
|
|
@@ -4,20 +4,15 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.preventEventDoubling = void 0;
|
|
7
|
-
|
|
8
|
-
var preventEventDoubling = function preventEventDoubling(eventHandler) {
|
|
7
|
+
var preventEventDoubling = exports.preventEventDoubling = function preventEventDoubling(eventHandler) {
|
|
9
8
|
var minTimeDiff = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 1000;
|
|
10
9
|
var lastClickTime;
|
|
11
10
|
return function () {
|
|
12
11
|
var thisClickTime = new Date().getTime();
|
|
13
|
-
|
|
14
12
|
if (lastClickTime && thisClickTime - lastClickTime < minTimeDiff) {
|
|
15
13
|
return;
|
|
16
14
|
}
|
|
17
|
-
|
|
18
15
|
lastClickTime = thisClickTime;
|
|
19
16
|
return eventHandler.apply(void 0, arguments);
|
|
20
17
|
};
|
|
21
|
-
};
|
|
22
|
-
|
|
23
|
-
exports.preventEventDoubling = preventEventDoubling;
|
|
18
|
+
};
|
package/Utils/Function/cached.js
CHANGED
|
@@ -4,23 +4,19 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.getCached = getCached;
|
|
7
|
-
|
|
8
7
|
var _isIdentical = _interopRequireDefault(require("../Array/isIdentical"));
|
|
9
|
-
|
|
10
8
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
|
11
|
-
|
|
12
9
|
var cache = new Map();
|
|
10
|
+
|
|
13
11
|
/**
|
|
14
12
|
* A helper function to cache results of expensive functions (an alternative way of memoize)
|
|
15
13
|
* @param {string} name
|
|
16
14
|
* @param {...*} args
|
|
17
15
|
*/
|
|
18
|
-
|
|
19
16
|
function getCached(name) {
|
|
20
17
|
for (var _len = arguments.length, args = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
|
|
21
18
|
args[_key - 1] = arguments[_key];
|
|
22
19
|
}
|
|
23
|
-
|
|
24
20
|
var cachedItem = cache.get(name);
|
|
25
21
|
var isValid = Boolean(cachedItem && (0, _isIdentical["default"])(args, cachedItem.args));
|
|
26
22
|
return {
|
|
@@ -30,14 +26,12 @@ function getCached(name) {
|
|
|
30
26
|
validate: function validate() {
|
|
31
27
|
return isValid;
|
|
32
28
|
},
|
|
33
|
-
|
|
34
29
|
/**
|
|
35
30
|
* @return {*}
|
|
36
31
|
*/
|
|
37
32
|
getValue: function getValue() {
|
|
38
33
|
return isValid && cachedItem.value || undefined;
|
|
39
34
|
},
|
|
40
|
-
|
|
41
35
|
/**
|
|
42
36
|
* @param {*} value
|
|
43
37
|
*/
|
|
@@ -48,7 +42,6 @@ function getCached(name) {
|
|
|
48
42
|
});
|
|
49
43
|
return value;
|
|
50
44
|
},
|
|
51
|
-
|
|
52
45
|
/**
|
|
53
46
|
* @param fn
|
|
54
47
|
* @return {*}
|
|
@@ -57,7 +50,6 @@ function getCached(name) {
|
|
|
57
50
|
if (this.validate()) {
|
|
58
51
|
return this.getValue();
|
|
59
52
|
}
|
|
60
|
-
|
|
61
53
|
return this.setValue(fn());
|
|
62
54
|
}
|
|
63
55
|
};
|
|
@@ -4,19 +4,12 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.createDebounceManager = void 0;
|
|
7
|
-
|
|
8
7
|
function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }
|
|
9
|
-
|
|
10
8
|
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."); }
|
|
11
|
-
|
|
12
9
|
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); }
|
|
13
|
-
|
|
14
10
|
function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); }
|
|
15
|
-
|
|
16
11
|
function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }
|
|
17
|
-
|
|
18
|
-
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; }
|
|
19
|
-
|
|
12
|
+
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; }
|
|
20
13
|
/**
|
|
21
14
|
* Creates a debounce manager for the given function
|
|
22
15
|
* Use case: a debounced function (eg. change handler) has to be synchronized in order to work with the most recent data
|
|
@@ -25,19 +18,17 @@ function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len
|
|
|
25
18
|
* @param {function} callbackFn
|
|
26
19
|
* @param {number} delay The delay in ms
|
|
27
20
|
*/
|
|
28
|
-
var createDebounceManager = function createDebounceManager(callbackFn) {
|
|
21
|
+
var createDebounceManager = exports.createDebounceManager = function createDebounceManager(callbackFn) {
|
|
29
22
|
var delay = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 200;
|
|
30
23
|
var lastChangeTimeout;
|
|
31
24
|
var needsInvocation = false;
|
|
32
25
|
var storedArgs = [];
|
|
33
|
-
|
|
34
26
|
var invokeStored = function invokeStored() {
|
|
35
27
|
if (needsInvocation) {
|
|
36
28
|
needsInvocation = false;
|
|
37
29
|
return callbackFn.apply(void 0, _toConsumableArray(storedArgs));
|
|
38
30
|
}
|
|
39
31
|
};
|
|
40
|
-
|
|
41
32
|
return {
|
|
42
33
|
/**
|
|
43
34
|
* @param args
|
|
@@ -48,22 +39,18 @@ var createDebounceManager = function createDebounceManager(callbackFn) {
|
|
|
48
39
|
needsInvocation = false;
|
|
49
40
|
return callbackFn.apply(void 0, arguments);
|
|
50
41
|
},
|
|
51
|
-
|
|
52
42
|
/**
|
|
53
43
|
* @param args
|
|
54
44
|
*/
|
|
55
45
|
invokeDebounced: function invokeDebounced() {
|
|
56
46
|
window.clearTimeout(lastChangeTimeout);
|
|
57
47
|
needsInvocation = true;
|
|
58
|
-
|
|
59
48
|
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
60
49
|
args[_key] = arguments[_key];
|
|
61
50
|
}
|
|
62
|
-
|
|
63
51
|
storedArgs = args;
|
|
64
52
|
lastChangeTimeout = window.setTimeout(invokeStored, delay);
|
|
65
53
|
},
|
|
66
|
-
|
|
67
54
|
/**
|
|
68
55
|
* @return {*}
|
|
69
56
|
*/
|
|
@@ -72,6 +59,4 @@ var createDebounceManager = function createDebounceManager(callbackFn) {
|
|
|
72
59
|
return invokeStored();
|
|
73
60
|
}
|
|
74
61
|
};
|
|
75
|
-
};
|
|
76
|
-
|
|
77
|
-
exports.createDebounceManager = createDebounceManager;
|
|
62
|
+
};
|
|
@@ -4,11 +4,8 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports["default"] = createSelector;
|
|
7
|
-
|
|
8
7
|
var _memoize = _interopRequireDefault(require("./memoize"));
|
|
9
|
-
|
|
10
8
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
|
11
|
-
|
|
12
9
|
/**
|
|
13
10
|
* Shorter and more simple implementation of reselect's createSelector
|
|
14
11
|
* Takes one or more selectors, or an array of selectors, computes their values
|
|
@@ -22,41 +19,33 @@ function createSelector() {
|
|
|
22
19
|
for (var _len = arguments.length, fns = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
23
20
|
fns[_key] = arguments[_key];
|
|
24
21
|
}
|
|
25
|
-
|
|
26
22
|
// skip calling the result function when the params are unchanged (saving expensive calculation)
|
|
27
23
|
var resultFunc = fns.pop();
|
|
28
|
-
|
|
29
24
|
if (typeof resultFunc !== 'function') {
|
|
30
25
|
throw new TypeError('createSelector accepts only function as argument!');
|
|
31
26
|
}
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
27
|
+
var memResultFunc = (0, _memoize["default"])(resultFunc);
|
|
28
|
+
// check dependency functions
|
|
35
29
|
var length = fns.length;
|
|
36
|
-
|
|
37
30
|
for (var i = 0; i < length; i++) {
|
|
38
31
|
var fn = fns[i];
|
|
39
|
-
|
|
40
32
|
if (typeof fn !== 'function') {
|
|
41
33
|
throw new TypeError('All of the dependencies have to be a function!');
|
|
42
34
|
}
|
|
43
|
-
}
|
|
44
|
-
// (like an unchanged state object)
|
|
45
|
-
|
|
35
|
+
}
|
|
46
36
|
|
|
37
|
+
// memoize will skip the recalculation if the selector function is called with the same arguments
|
|
38
|
+
// (like an unchanged state object)
|
|
47
39
|
return (0, _memoize["default"])(function () {
|
|
48
40
|
// get the result of the dependency functions
|
|
49
41
|
var params = [];
|
|
50
|
-
|
|
51
42
|
for (var _len2 = arguments.length, args = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {
|
|
52
43
|
args[_key2] = arguments[_key2];
|
|
53
44
|
}
|
|
54
|
-
|
|
55
45
|
for (var _i = 0; _i < length; _i++) {
|
|
56
46
|
params.push(fns[_i].apply(null, args));
|
|
57
|
-
}
|
|
58
|
-
|
|
59
|
-
|
|
47
|
+
}
|
|
48
|
+
// call the result function with the params
|
|
60
49
|
return memResultFunc.apply(null, params);
|
|
61
50
|
});
|
|
62
51
|
}
|
|
@@ -3,12 +3,9 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
exports["default"] =
|
|
7
|
-
|
|
6
|
+
exports.memoize = exports["default"] = void 0;
|
|
8
7
|
var _isIdentical = _interopRequireDefault(require("../Array/isIdentical"));
|
|
9
|
-
|
|
10
8
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
|
11
|
-
|
|
12
9
|
/**
|
|
13
10
|
* Memoizes the return value of a function for the given arguments
|
|
14
11
|
* Currently it stores only the result for the last call, it's really simple, fast and also saves memory.
|
|
@@ -20,27 +17,21 @@ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "d
|
|
|
20
17
|
* @returns {function(...[*]=)}
|
|
21
18
|
* @throws TypeError If the given argument is not a function
|
|
22
19
|
*/
|
|
23
|
-
var memoize = function memoize(fn) {
|
|
20
|
+
var memoize = exports.memoize = function memoize(fn) {
|
|
24
21
|
if (typeof fn !== 'function') {
|
|
25
22
|
throw new TypeError('Memoize accepts only function as argument!');
|
|
26
23
|
}
|
|
27
|
-
|
|
28
24
|
var prevArgs = [];
|
|
29
25
|
var value = undefined;
|
|
30
26
|
return function () {
|
|
31
27
|
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
32
28
|
args[_key] = arguments[_key];
|
|
33
29
|
}
|
|
34
|
-
|
|
35
30
|
if (!(0, _isIdentical["default"])(args, prevArgs)) {
|
|
36
31
|
value = fn.apply(void 0, args);
|
|
37
32
|
prevArgs = args;
|
|
38
33
|
}
|
|
39
|
-
|
|
40
34
|
return value;
|
|
41
35
|
};
|
|
42
36
|
};
|
|
43
|
-
|
|
44
|
-
exports.memoize = memoize;
|
|
45
|
-
var _default = memoize;
|
|
46
|
-
exports["default"] = _default;
|
|
37
|
+
var _default = exports["default"] = memoize;
|
|
@@ -3,20 +3,15 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
exports.sendMessage = sendMessage;
|
|
7
6
|
exports["default"] = void 0;
|
|
8
|
-
|
|
9
|
-
function _typeof(
|
|
10
|
-
|
|
7
|
+
exports.sendMessage = sendMessage;
|
|
8
|
+
function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
|
|
11
9
|
function sendMessage(obj, fn) {
|
|
12
10
|
if (obj && _typeof(obj) === 'object' && typeof obj[fn] === 'function') {
|
|
13
11
|
for (var _len = arguments.length, args = new Array(_len > 2 ? _len - 2 : 0), _key = 2; _key < _len; _key++) {
|
|
14
12
|
args[_key - 2] = arguments[_key];
|
|
15
13
|
}
|
|
16
|
-
|
|
17
14
|
return obj[fn].apply(obj, args);
|
|
18
15
|
}
|
|
19
16
|
}
|
|
20
|
-
|
|
21
|
-
var _default = sendMessage;
|
|
22
|
-
exports["default"] = _default;
|
|
17
|
+
var _default = exports["default"] = sendMessage;
|
|
@@ -4,30 +4,25 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.createSelectionRangeMemo = void 0;
|
|
7
|
-
|
|
8
|
-
var createSelectionRangeMemo = function createSelectionRangeMemo() {
|
|
7
|
+
var createSelectionRangeMemo = exports.createSelectionRangeMemo = function createSelectionRangeMemo() {
|
|
9
8
|
var selectedRange = null;
|
|
10
|
-
|
|
11
9
|
var save = function save() {
|
|
12
10
|
if (window.getSelection) {
|
|
13
11
|
var sel = window.getSelection();
|
|
14
|
-
|
|
15
12
|
if (sel.getRangeAt && sel.rangeCount) {
|
|
16
13
|
selectedRange = sel.getRangeAt(0);
|
|
17
14
|
}
|
|
18
15
|
} else if (document.selection && document.selection.createRange) {
|
|
19
16
|
selectedRange = document.selection.createRange();
|
|
20
17
|
}
|
|
21
|
-
|
|
22
18
|
return selectedRange;
|
|
23
19
|
};
|
|
24
|
-
|
|
25
20
|
var restore = function restore() {
|
|
26
21
|
if (selectedRange) {
|
|
27
22
|
if (window.getSelection) {
|
|
28
23
|
var sel = window.getSelection();
|
|
29
|
-
sel.removeAllRanges();
|
|
30
|
-
|
|
24
|
+
sel.removeAllRanges();
|
|
25
|
+
// required for safari while addingRange element should be visible.
|
|
31
26
|
selectedRange.startContainer.parentElement.style.visibility = 'visible';
|
|
32
27
|
sel.addRange(selectedRange);
|
|
33
28
|
} else if (document.selection && selectedRange.select) {
|
|
@@ -35,11 +30,8 @@ var createSelectionRangeMemo = function createSelectionRangeMemo() {
|
|
|
35
30
|
}
|
|
36
31
|
}
|
|
37
32
|
};
|
|
38
|
-
|
|
39
33
|
return {
|
|
40
34
|
save: save,
|
|
41
35
|
restore: restore
|
|
42
36
|
};
|
|
43
|
-
};
|
|
44
|
-
|
|
45
|
-
exports.createSelectionRangeMemo = createSelectionRangeMemo;
|
|
37
|
+
};
|