@fonixtree/magic-design 0.0.78 → 0.0.80
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/es/assets/fonts/magic-box-iconfont.css +24 -12
- package/es/assets/fonts/magic-box-iconfont.css.bak +24 -12
- package/es/assets/fonts/magic-box-iconfont.js +1 -1
- package/es/assets/fonts/magic-box-iconfont.js.bak +1 -1
- package/es/assets/fonts/magic-box-iconfont.ttf +0 -0
- package/es/assets/fonts/magic-box-iconfont.woff +0 -0
- package/es/assets/fonts/magic-box-iconfont.woff2 +0 -0
- package/es/assets/images/layout-icon/layout-navigation-normal.png +0 -0
- package/es/assets/less/common.less +2 -2
- package/es/assets/less/modal.less +7 -2
- package/es/common/Button/index.js +2 -1
- package/es/common/Button/index.less +5 -0
- package/es/common/ButtonIconLayout/index.less +4 -2
- package/es/common/Collapse/index.js +14 -4
- package/es/common/FontStyles/index.less +1 -1
- package/es/common/GroupList/index.js +4 -3
- package/es/common/ImageModal/index.js +31 -26
- package/es/common/ImageModal/index.less +6 -1
- package/es/common/ImgArea/components/Crop.js +267 -0
- package/es/common/ImgArea/components/Icons.js +44 -0
- package/es/common/ImgArea/components/MultiCrops.js +210 -0
- package/es/common/ImgArea/index.js +11 -0
- package/es/common/LinkModal/BundleCampaign/index.js +17 -17
- package/es/common/LinkModal/CustomTable/index.js +1 -0
- package/es/common/LinkModal/FilteredProductModal/index.js +3 -3
- package/es/common/LinkModal/FilteredProductModal/index.less +2 -3
- package/es/common/LinkModal/ProductDetailPage/index.js +3 -3
- package/es/common/LinkModal/index.less +1 -1
- package/es/common/MagicLink/index.js +89 -0
- package/es/common/MagicLink/index.less +0 -0
- package/es/common/ProductModal/index.js +1 -1
- package/es/common/ProductModal/index.less +12 -7
- package/es/common/UrlPicker/index.js +6 -2
- package/es/common/UrlPicker/index.less +12 -1
- package/es/common/index.js +8 -0
- package/es/composite-comp/bol/components/Banner/defaultJSON.js +10 -10
- package/es/composite-comp/bol/components/Banner/mobile/index.js +4 -10
- package/es/composite-comp/bol/components/Banner/pc/index.js +3 -6
- package/es/composite-comp/bol/components/Button/defaultJSON.js +40 -70
- package/es/composite-comp/bol/components/Button/index.js +8 -14
- package/es/composite-comp/bol/components/Button/index.less +1 -0
- package/es/composite-comp/bol/components/Carousel/defaultJSON.js +12 -16
- package/es/composite-comp/bol/components/Carousel/index.js +1 -6
- package/es/composite-comp/bol/components/Carousel/mobile/index.js +4 -8
- package/es/composite-comp/bol/components/Carousel/pc/index.js +15 -7
- package/es/composite-comp/bol/components/Carousel/pc/index.less +13 -5
- package/es/composite-comp/bol/components/ImageGallery/defaultJSON.js +2 -2
- package/es/composite-comp/bol/components/ImageText/defaultJSON.js +27 -167
- package/es/composite-comp/bol/components/ImageText/mobile/index.js +2 -5
- package/es/composite-comp/bol/components/ImageText/mobile/index.less +8 -8
- package/es/composite-comp/bol/components/ImageText/pc/index.js +46 -18
- package/es/composite-comp/bol/components/Newsletter/defaultJSON.js +2 -2
- package/es/composite-comp/bol/components/Newsletter/index.js +1 -6
- package/es/composite-comp/bol/components/Tag/defaultJSON.js +38 -48
- package/es/composite-comp/bol/components/Tag/index.js +8 -14
- package/es/composite-comp/bol/components/Tag/index.less +1 -0
- package/es/composite-comp/bol/components/Text/defaultJSON.js +4 -6
- package/es/composite-comp/bol/components/Text/index.js +4 -8
- package/es/composite-comp/bol/components/Text/index.less +3 -3
- package/es/composite-comp/bol/config-panels/BannerConfig/BannerConfigGroup/index.js +3 -1
- package/es/composite-comp/bol/config-panels/ButtonCompConfig/ButtonConfigGroup/index.js +141 -0
- package/es/composite-comp/bol/config-panels/ButtonCompConfig/ButtonConfigGroup/index.less +16 -0
- package/es/composite-comp/bol/config-panels/ButtonCompConfig/index.js +3 -3
- package/es/composite-comp/bol/config-panels/CarouselConfig/CarouselConfigImageGroup/index.js +4 -2
- package/es/composite-comp/bol/config-panels/CarouselConfig/index.js +1 -0
- package/es/composite-comp/bol/config-panels/ImageTextConfig/ImageTextConfigGroup/index.js +3 -1
- package/es/composite-comp/bol/config-panels/ImageTextConfig/index.js +2 -1
- package/es/composite-comp/bol/config-panels/NewsletterConfig/index.js +6 -4
- package/es/composite-comp/bol/config-panels/TagCompConfig/TagConfigContent/index.js +9 -17
- package/es/composite-comp/bol/config-panels/TagCompConfig/TagConfigGroup/index.js +141 -0
- package/es/composite-comp/bol/config-panels/TagCompConfig/TagConfigGroup/index.less +16 -0
- package/es/composite-comp/bol/config-panels/TagCompConfig/index.js +7 -4
- package/es/composite-comp/bol/config-panels/TextCompConfig/TextConfigGroup/index.js +3 -1
- package/es/composite-comp/bol/config-panels/TextCompConfig/imgs/layout1.png +0 -0
- package/es/composite-comp/bol/second-config-panels/ButtonSecondConfig/index.js +103 -0
- package/es/composite-comp/bol/second-config-panels/ButtonSecondConfig/index.less +3 -0
- package/es/composite-comp/bol/second-config-panels/CarouselSecondConfig/index.js +8 -13
- package/es/composite-comp/bol/second-config-panels/ImageTextSecondConfig/index.js +10 -5
- package/es/composite-comp/bol/second-config-panels/ImageTextSecondConfig/index.less +8 -0
- package/es/composite-comp/bol/{config-panels/ButtonCompConfig/ButtonConfigContent → second-config-panels/TagSecondConfig}/index.js +40 -38
- package/es/composite-comp/bol/second-config-panels/TagSecondConfig/index.less +3 -0
- package/es/composite-comp/common/components/ImageLabel/index.js +2 -2
- package/es/composite-comp/common/components/ImageLabel/index.less +6 -2
- package/es/composite-comp/common/components/ProductItem/index.js +1 -1
- package/es/composite-comp/common/components/ProductItem/index.less +9 -9
- package/es/composite-comp/common/config-panels/CustomizeConfig/index.js +24 -13
- package/es/composite-comp/common/config-panels/SpacingConfig/index.js +25 -25
- package/es/composite-comp/dito/components/FlashDeal/defaultJSON.js +62 -2
- package/es/composite-comp/dito/components/FlashDeal/index.js +5 -1
- package/es/composite-comp/dito/components/FlashDeal/mobile/index.less +0 -1
- package/es/composite-comp/dito/components/FlashDeal/pc/imgs/defImg1.png +0 -0
- package/es/composite-comp/dito/components/FlashDeal/pc/imgs/defImg2.png +0 -0
- package/es/composite-comp/dito/components/FlashDeal/pc/imgs/defImg3.png +0 -0
- package/es/composite-comp/dito/components/FlashDeal/pc/index.js +578 -0
- package/es/composite-comp/dito/components/FlashDeal/pc/index.less +121 -0
- package/es/composite-comp/dito/components/MobileNavigation/defaultJSON.js +5 -4
- package/es/composite-comp/dito/components/MobileNavigation/mobile/index.js +13 -3
- package/es/composite-comp/dito/components/MobileNavigation/mobile/index.less +3 -2
- package/es/composite-comp/dito/components/PcNavigation/defaultJSON.js +131 -0
- package/es/composite-comp/dito/components/PcNavigation/images/menu-icon.svg +6 -0
- package/es/composite-comp/dito/components/PcNavigation/index.js +85 -0
- package/es/composite-comp/dito/components/PcNavigation/pc/index.js +478 -0
- package/es/composite-comp/dito/components/PcNavigation/pc/index.less +98 -0
- package/es/composite-comp/dito/components/Recommend/defaultJSON.js +30 -12
- package/es/composite-comp/dito/components/Recommend/index.js +5 -6
- package/es/composite-comp/dito/components/Recommend/mobile/index.js +45 -37
- package/es/composite-comp/dito/components/Recommend/mobile/index.less +10 -2
- package/es/composite-comp/dito/components/Recommend/pc/index.js +134 -22
- package/es/composite-comp/dito/components/Recommend/pc/index.less +54 -12
- package/es/composite-comp/dito/components/SearchBar/defaultJSON.js +45 -19
- package/es/composite-comp/dito/components/SearchBar/index.js +7 -2
- package/es/composite-comp/dito/components/SearchBar/mobile/index.js +29 -26
- package/es/composite-comp/dito/components/SearchBar/mobile/index.less +13 -3
- package/es/composite-comp/dito/components/SearchBar/pc/index.js +151 -0
- package/es/composite-comp/dito/components/SearchBar/pc/index.less +59 -0
- package/es/composite-comp/dito/config-panels/FlashDealConfig/FlashDealConfigContent/index.js +16 -6
- package/es/composite-comp/dito/config-panels/FlashDealConfig/FlashDealConfigContent/index.less +20 -0
- package/es/composite-comp/dito/config-panels/FlashDealConfig/index.js +12 -2
- package/es/composite-comp/dito/config-panels/MobileNavigationConfig/MobileNavigationConfigGroup/index.js +3 -1
- package/es/composite-comp/dito/config-panels/PcNavigationConfig/PcNavConfigCategory/index.js +129 -0
- package/es/composite-comp/dito/config-panels/PcNavigationConfig/PcNavigationConfigGroup/index.js +128 -0
- package/es/composite-comp/dito/config-panels/PcNavigationConfig/TextOnlyFontConfig/index.js +222 -0
- package/es/composite-comp/dito/config-panels/PcNavigationConfig/index.js +194 -0
- package/es/composite-comp/dito/config-panels/RecommendConfig/index.js +16 -3
- package/es/composite-comp/dito/config-panels/SearchBarConfig/SearchBarConfigContent/index.js +140 -0
- package/es/composite-comp/dito/config-panels/SearchBarConfig/index.js +15 -51
- package/es/composite-comp/dito/second-config-panels/PcNavigationSecondConfig/index.js +102 -0
- package/es/composite-comp/dito/second-config-panels/RecommendSecondConfig/AIRecommendation/index.js +39 -29
- package/es/composite-comp/dito/second-config-panels/RecommendSecondConfig/index.js +80 -49
- package/es/composite-comp/dito/second-config-panels/RecommendSecondConfig/index.less +13 -1
- package/es/constants/component-types.js +13 -3
- package/es/constants/index.js +20 -2
- package/es/constants/layout.js +34 -8
- package/es/core/Designer/CompListPanel/index.js +8 -33
- package/es/core/Designer/ConfigPanel/TerminalSelect/index.js +73 -0
- package/es/core/Designer/ConfigPanel/TerminalSelect/index.less +29 -0
- package/es/core/Designer/ConfigPanel/index.js +72 -23
- package/es/core/Designer/ConfigPanel/index.less +4 -0
- package/es/core/Designer/History/index.js +34 -28
- package/es/core/Designer/PageCompList/index.js +13 -3
- package/es/core/Designer/PageCompList/index.less +10 -10
- package/es/core/Designer/QuickMenuBar/index.js +1 -1
- package/es/core/Designer/ViewArea/index.js +20 -6
- package/es/core/Designer/index.js +43 -37
- package/es/core/Renderer/index.js +21 -5
- package/es/decorator/compositeDecorator.js +45 -12
- package/es/decorator/index.js +8 -0
- package/es/decorator/metaDecorator.js +4 -3
- package/es/decorator/updateConfigDecorator.js +76 -0
- package/es/locale/en/en.json +14 -1
- package/es/locale/es/es.json +14 -1
- package/es/locale/id/id.json +14 -1
- package/es/meta-comp/components/Button/editable.js +114 -0
- package/es/meta-comp/components/Button/editable.less +6 -0
- package/es/meta-comp/components/Button/index.js +14 -33
- package/es/meta-comp/components/Button/index.less +3 -2
- package/es/meta-comp/components/Image/index.js +39 -8
- package/es/meta-comp/components/Image/index.less +7 -4
- package/es/meta-comp/components/Text/index.js +28 -11
- package/es/meta-comp/config-panels/BaseConfig.js +8 -10
- package/es/meta-comp/config-panels/ButtonConfig/index.js +2 -3
- package/es/meta-comp/config-panels/ImageConfig/AreaConfigModal/index.js +164 -0
- package/es/meta-comp/config-panels/ImageConfig/AreaConfigModal/index.less +26 -0
- package/es/meta-comp/config-panels/ImageConfig/HotAreaConfig/index.js +133 -0
- package/es/meta-comp/config-panels/ImageConfig/HotAreaConfig/index.less +17 -0
- package/es/meta-comp/config-panels/ImageConfig/index.js +17 -4
- package/es/meta-comp/config-panels/TextConfig/index.js +15 -6
- package/es/mobx/Store.js +6 -10
- package/es/utils/coreUtil.js +15 -2
- package/lib/assets/fonts/magic-box-iconfont.css +24 -12
- package/lib/assets/fonts/magic-box-iconfont.css.bak +24 -12
- package/lib/assets/fonts/magic-box-iconfont.js +1 -1
- package/lib/assets/fonts/magic-box-iconfont.js.bak +1 -1
- package/lib/assets/fonts/magic-box-iconfont.ttf +0 -0
- package/lib/assets/fonts/magic-box-iconfont.woff +0 -0
- package/lib/assets/fonts/magic-box-iconfont.woff2 +0 -0
- package/lib/assets/images/layout-icon/layout-navigation-normal.png +0 -0
- package/lib/assets/less/common.less +2 -2
- package/lib/assets/less/modal.less +7 -2
- package/lib/common/Button/index.js +2 -1
- package/lib/common/Button/index.less +5 -0
- package/lib/common/ButtonIconLayout/index.less +4 -2
- package/lib/common/Collapse/index.js +14 -4
- package/lib/common/FontStyles/index.less +1 -1
- package/lib/common/GroupList/index.js +4 -3
- package/lib/common/ImageModal/index.js +31 -26
- package/lib/common/ImageModal/index.less +6 -1
- package/lib/common/ImgArea/components/Crop.js +267 -0
- package/lib/common/ImgArea/components/Icons.js +44 -0
- package/lib/common/ImgArea/components/MultiCrops.js +210 -0
- package/lib/common/ImgArea/index.js +11 -0
- package/lib/common/LinkModal/BundleCampaign/index.js +17 -17
- package/lib/common/LinkModal/CustomTable/index.js +1 -0
- package/lib/common/LinkModal/FilteredProductModal/index.js +3 -3
- package/lib/common/LinkModal/FilteredProductModal/index.less +2 -3
- package/lib/common/LinkModal/ProductDetailPage/index.js +3 -3
- package/lib/common/LinkModal/index.less +1 -1
- package/lib/common/MagicLink/index.js +89 -0
- package/lib/common/MagicLink/index.less +0 -0
- package/lib/common/ProductModal/index.js +1 -1
- package/lib/common/ProductModal/index.less +12 -7
- package/lib/common/UrlPicker/index.js +6 -2
- package/lib/common/UrlPicker/index.less +12 -1
- package/lib/common/index.js +8 -0
- package/lib/composite-comp/bol/components/Banner/defaultJSON.js +10 -10
- package/lib/composite-comp/bol/components/Banner/mobile/index.js +4 -10
- package/lib/composite-comp/bol/components/Banner/pc/index.js +3 -6
- package/lib/composite-comp/bol/components/Button/defaultJSON.js +40 -70
- package/lib/composite-comp/bol/components/Button/index.js +8 -14
- package/lib/composite-comp/bol/components/Button/index.less +1 -0
- package/lib/composite-comp/bol/components/Carousel/defaultJSON.js +12 -16
- package/lib/composite-comp/bol/components/Carousel/index.js +1 -6
- package/lib/composite-comp/bol/components/Carousel/mobile/index.js +4 -8
- package/lib/composite-comp/bol/components/Carousel/pc/index.js +15 -7
- package/lib/composite-comp/bol/components/Carousel/pc/index.less +13 -5
- package/lib/composite-comp/bol/components/ImageGallery/defaultJSON.js +2 -2
- package/lib/composite-comp/bol/components/ImageText/defaultJSON.js +27 -167
- package/lib/composite-comp/bol/components/ImageText/mobile/index.js +2 -5
- package/lib/composite-comp/bol/components/ImageText/mobile/index.less +8 -8
- package/lib/composite-comp/bol/components/ImageText/pc/index.js +46 -18
- package/lib/composite-comp/bol/components/Newsletter/defaultJSON.js +2 -2
- package/lib/composite-comp/bol/components/Newsletter/index.js +1 -6
- package/lib/composite-comp/bol/components/Tag/defaultJSON.js +38 -48
- package/lib/composite-comp/bol/components/Tag/index.js +8 -14
- package/lib/composite-comp/bol/components/Tag/index.less +1 -0
- package/lib/composite-comp/bol/components/Text/defaultJSON.js +4 -6
- package/lib/composite-comp/bol/components/Text/index.js +4 -8
- package/lib/composite-comp/bol/components/Text/index.less +3 -3
- package/lib/composite-comp/bol/config-panels/BannerConfig/BannerConfigGroup/index.js +3 -1
- package/lib/composite-comp/bol/config-panels/ButtonCompConfig/ButtonConfigGroup/index.js +141 -0
- package/lib/composite-comp/bol/config-panels/ButtonCompConfig/ButtonConfigGroup/index.less +16 -0
- package/lib/composite-comp/bol/config-panels/ButtonCompConfig/index.js +3 -3
- package/lib/composite-comp/bol/config-panels/CarouselConfig/CarouselConfigImageGroup/index.js +4 -2
- package/lib/composite-comp/bol/config-panels/CarouselConfig/index.js +1 -0
- package/lib/composite-comp/bol/config-panels/ImageTextConfig/ImageTextConfigGroup/index.js +3 -1
- package/lib/composite-comp/bol/config-panels/ImageTextConfig/index.js +2 -1
- package/lib/composite-comp/bol/config-panels/NewsletterConfig/index.js +6 -4
- package/lib/composite-comp/bol/config-panels/TagCompConfig/TagConfigContent/index.js +9 -17
- package/lib/composite-comp/bol/config-panels/TagCompConfig/TagConfigGroup/index.js +141 -0
- package/lib/composite-comp/bol/config-panels/TagCompConfig/TagConfigGroup/index.less +16 -0
- package/lib/composite-comp/bol/config-panels/TagCompConfig/index.js +7 -4
- package/lib/composite-comp/bol/config-panels/TextCompConfig/TextConfigGroup/index.js +3 -1
- package/lib/composite-comp/bol/config-panels/TextCompConfig/imgs/layout1.png +0 -0
- package/lib/composite-comp/bol/second-config-panels/ButtonSecondConfig/index.js +103 -0
- package/lib/composite-comp/bol/second-config-panels/ButtonSecondConfig/index.less +3 -0
- package/lib/composite-comp/bol/second-config-panels/CarouselSecondConfig/index.js +8 -13
- package/lib/composite-comp/bol/second-config-panels/ImageTextSecondConfig/index.js +10 -5
- package/lib/composite-comp/bol/second-config-panels/ImageTextSecondConfig/index.less +8 -0
- package/lib/composite-comp/bol/{config-panels/ButtonCompConfig/ButtonConfigContent → second-config-panels/TagSecondConfig}/index.js +40 -38
- package/lib/composite-comp/bol/second-config-panels/TagSecondConfig/index.less +3 -0
- package/lib/composite-comp/common/components/ImageLabel/index.js +2 -2
- package/lib/composite-comp/common/components/ImageLabel/index.less +6 -2
- package/lib/composite-comp/common/components/ProductItem/index.js +1 -1
- package/lib/composite-comp/common/components/ProductItem/index.less +9 -9
- package/lib/composite-comp/common/config-panels/CustomizeConfig/index.js +24 -13
- package/lib/composite-comp/common/config-panels/SpacingConfig/index.js +25 -25
- package/lib/composite-comp/dito/components/FlashDeal/defaultJSON.js +62 -2
- package/lib/composite-comp/dito/components/FlashDeal/index.js +5 -1
- package/lib/composite-comp/dito/components/FlashDeal/mobile/index.less +0 -1
- package/lib/composite-comp/dito/components/FlashDeal/pc/imgs/defImg1.png +0 -0
- package/lib/composite-comp/dito/components/FlashDeal/pc/imgs/defImg2.png +0 -0
- package/lib/composite-comp/dito/components/FlashDeal/pc/imgs/defImg3.png +0 -0
- package/lib/composite-comp/dito/components/FlashDeal/pc/index.js +578 -0
- package/lib/composite-comp/dito/components/FlashDeal/pc/index.less +121 -0
- package/lib/composite-comp/dito/components/MobileNavigation/defaultJSON.js +5 -4
- package/lib/composite-comp/dito/components/MobileNavigation/mobile/index.js +13 -3
- package/lib/composite-comp/dito/components/MobileNavigation/mobile/index.less +3 -2
- package/lib/composite-comp/dito/components/PcNavigation/defaultJSON.js +131 -0
- package/lib/composite-comp/dito/components/PcNavigation/images/menu-icon.svg +6 -0
- package/lib/composite-comp/dito/components/PcNavigation/index.js +85 -0
- package/lib/composite-comp/dito/components/PcNavigation/pc/index.js +478 -0
- package/lib/composite-comp/dito/components/PcNavigation/pc/index.less +98 -0
- package/lib/composite-comp/dito/components/Recommend/defaultJSON.js +30 -12
- package/lib/composite-comp/dito/components/Recommend/index.js +5 -6
- package/lib/composite-comp/dito/components/Recommend/mobile/index.js +45 -37
- package/lib/composite-comp/dito/components/Recommend/mobile/index.less +10 -2
- package/lib/composite-comp/dito/components/Recommend/pc/index.js +134 -22
- package/lib/composite-comp/dito/components/Recommend/pc/index.less +54 -12
- package/lib/composite-comp/dito/components/SearchBar/defaultJSON.js +45 -19
- package/lib/composite-comp/dito/components/SearchBar/index.js +7 -2
- package/lib/composite-comp/dito/components/SearchBar/mobile/index.js +29 -26
- package/lib/composite-comp/dito/components/SearchBar/mobile/index.less +13 -3
- package/lib/composite-comp/dito/components/SearchBar/pc/index.js +151 -0
- package/lib/composite-comp/dito/components/SearchBar/pc/index.less +59 -0
- package/lib/composite-comp/dito/config-panels/FlashDealConfig/FlashDealConfigContent/index.js +16 -6
- package/lib/composite-comp/dito/config-panels/FlashDealConfig/FlashDealConfigContent/index.less +20 -0
- package/lib/composite-comp/dito/config-panels/FlashDealConfig/index.js +12 -2
- package/lib/composite-comp/dito/config-panels/MobileNavigationConfig/MobileNavigationConfigGroup/index.js +3 -1
- package/lib/composite-comp/dito/config-panels/PcNavigationConfig/PcNavConfigCategory/index.js +129 -0
- package/lib/composite-comp/dito/config-panels/PcNavigationConfig/PcNavigationConfigGroup/index.js +128 -0
- package/lib/composite-comp/dito/config-panels/PcNavigationConfig/TextOnlyFontConfig/index.js +222 -0
- package/lib/composite-comp/dito/config-panels/PcNavigationConfig/index.js +194 -0
- package/lib/composite-comp/dito/config-panels/RecommendConfig/index.js +16 -3
- package/lib/composite-comp/dito/config-panels/SearchBarConfig/SearchBarConfigContent/index.js +140 -0
- package/lib/composite-comp/dito/config-panels/SearchBarConfig/index.js +15 -51
- package/lib/composite-comp/dito/second-config-panels/PcNavigationSecondConfig/index.js +102 -0
- package/lib/composite-comp/dito/second-config-panels/RecommendSecondConfig/AIRecommendation/index.js +39 -29
- package/lib/composite-comp/dito/second-config-panels/RecommendSecondConfig/index.js +80 -49
- package/lib/composite-comp/dito/second-config-panels/RecommendSecondConfig/index.less +13 -1
- package/lib/constants/component-types.js +13 -3
- package/lib/constants/index.js +20 -2
- package/lib/constants/layout.js +34 -8
- package/lib/core/Designer/CompListPanel/index.js +8 -33
- package/lib/core/Designer/ConfigPanel/TerminalSelect/index.js +73 -0
- package/lib/core/Designer/ConfigPanel/TerminalSelect/index.less +29 -0
- package/lib/core/Designer/ConfigPanel/index.js +72 -23
- package/lib/core/Designer/ConfigPanel/index.less +4 -0
- package/lib/core/Designer/History/index.js +34 -28
- package/lib/core/Designer/PageCompList/index.js +13 -3
- package/lib/core/Designer/PageCompList/index.less +10 -10
- package/lib/core/Designer/QuickMenuBar/index.js +1 -1
- package/lib/core/Designer/ViewArea/index.js +20 -6
- package/lib/core/Designer/index.js +43 -37
- package/lib/core/Renderer/index.js +21 -5
- package/lib/decorator/compositeDecorator.js +45 -12
- package/lib/decorator/index.js +8 -0
- package/lib/decorator/metaDecorator.js +4 -3
- package/lib/decorator/updateConfigDecorator.js +76 -0
- package/lib/locale/en/en.json +14 -1
- package/lib/locale/es/es.json +14 -1
- package/lib/locale/id/id.json +14 -1
- package/lib/meta-comp/components/Button/editable.js +114 -0
- package/lib/meta-comp/components/Button/editable.less +6 -0
- package/lib/meta-comp/components/Button/index.js +14 -33
- package/lib/meta-comp/components/Button/index.less +3 -2
- package/lib/meta-comp/components/Image/index.js +39 -8
- package/lib/meta-comp/components/Image/index.less +7 -4
- package/lib/meta-comp/components/Text/index.js +28 -11
- package/lib/meta-comp/config-panels/BaseConfig.js +8 -10
- package/lib/meta-comp/config-panels/ButtonConfig/index.js +2 -3
- package/lib/meta-comp/config-panels/ImageConfig/AreaConfigModal/index.js +164 -0
- package/lib/meta-comp/config-panels/ImageConfig/AreaConfigModal/index.less +26 -0
- package/lib/meta-comp/config-panels/ImageConfig/HotAreaConfig/index.js +133 -0
- package/lib/meta-comp/config-panels/ImageConfig/HotAreaConfig/index.less +17 -0
- package/lib/meta-comp/config-panels/ImageConfig/index.js +17 -4
- package/lib/meta-comp/config-panels/TextConfig/index.js +15 -6
- package/lib/mobx/Store.js +6 -10
- package/lib/utils/coreUtil.js +15 -2
- package/package.json +5 -3
|
@@ -219,7 +219,6 @@ var modalSize = _const.size;
|
|
|
219
219
|
var Search = _antd.Input.Search;
|
|
220
220
|
var picAccept = '.gif,.jpg,.png';
|
|
221
221
|
var videoAccept = '.AVI,.mov,.rmvb,.rm,.FLV,.mp4,.3GP';
|
|
222
|
-
var pageSize = 24;
|
|
223
222
|
|
|
224
223
|
function ImageModal(_a) {
|
|
225
224
|
var _this = this;
|
|
@@ -256,29 +255,33 @@ function ImageModal(_a) {
|
|
|
256
255
|
pageIndex = _j[0],
|
|
257
256
|
setPageIndex = _j[1];
|
|
258
257
|
|
|
259
|
-
var _k = (0, _react.useState)(
|
|
260
|
-
|
|
261
|
-
|
|
258
|
+
var _k = (0, _react.useState)(20),
|
|
259
|
+
pageSize = _k[0],
|
|
260
|
+
setPageSize = _k[1];
|
|
262
261
|
|
|
263
|
-
var _l = (0, _react.useState)(
|
|
264
|
-
|
|
265
|
-
|
|
262
|
+
var _l = (0, _react.useState)(false),
|
|
263
|
+
spinning = _l[0],
|
|
264
|
+
setSpinning = _l[1];
|
|
266
265
|
|
|
267
|
-
var _m = (0, _react.useState)(
|
|
268
|
-
|
|
269
|
-
|
|
266
|
+
var _m = (0, _react.useState)(''),
|
|
267
|
+
name = _m[0],
|
|
268
|
+
setName = _m[1];
|
|
270
269
|
|
|
271
|
-
var _o = (0, _react.useState)(
|
|
272
|
-
|
|
273
|
-
|
|
270
|
+
var _o = (0, _react.useState)([]),
|
|
271
|
+
contentcatgsList = _o[0],
|
|
272
|
+
setContentcatgsList = _o[1];
|
|
274
273
|
|
|
275
|
-
var _p = (0, _react.useState)(
|
|
276
|
-
|
|
277
|
-
|
|
274
|
+
var _p = (0, _react.useState)(''),
|
|
275
|
+
searchValue = _p[0],
|
|
276
|
+
setSearchValue = _p[1];
|
|
278
277
|
|
|
279
|
-
var _q = (0, _react.useState)(
|
|
280
|
-
|
|
281
|
-
|
|
278
|
+
var _q = (0, _react.useState)([]),
|
|
279
|
+
expandedKeys = _q[0],
|
|
280
|
+
setExpandedKeys = _q[1];
|
|
281
|
+
|
|
282
|
+
var _r = (0, _react.useState)(true),
|
|
283
|
+
autoExpandParent = _r[0],
|
|
284
|
+
setAutoExpandParent = _r[1]; // const currentUser = sessionUtil.getUser() || {};
|
|
282
285
|
// const { _csrf } = currentUser;
|
|
283
286
|
// const headers = {};
|
|
284
287
|
// if (_csrf && _csrf.headerName) {
|
|
@@ -287,8 +290,8 @@ function ImageModal(_a) {
|
|
|
287
290
|
|
|
288
291
|
|
|
289
292
|
var headers = {};
|
|
290
|
-
headers['X-CSRF-TOKEN'] = localStorage.getItem('X-CSRF-TOKEN') ||
|
|
291
|
-
headers.accessToken = localStorage.getItem('X-CSRF-TOKEN') ||
|
|
293
|
+
headers['X-CSRF-TOKEN'] = localStorage.getItem('X-CSRF-TOKEN') || '';
|
|
294
|
+
headers.accessToken = localStorage.getItem('X-CSRF-TOKEN') || ''; // 查询图片库类目下的图片列表
|
|
292
295
|
|
|
293
296
|
var qryImageContents = function qryImageContents(data) {
|
|
294
297
|
return __awaiter(_this, void 0, void 0, function () {
|
|
@@ -574,11 +577,13 @@ function ImageModal(_a) {
|
|
|
574
577
|
current: pageIndex,
|
|
575
578
|
pageSize: pageSize,
|
|
576
579
|
total: total,
|
|
577
|
-
onChange: function onChange(
|
|
578
|
-
setPageIndex(
|
|
580
|
+
onChange: function onChange(pageIndex, pageSize) {
|
|
581
|
+
setPageIndex(pageIndex);
|
|
582
|
+
setPageSize(pageSize);
|
|
579
583
|
qryImageContents({
|
|
580
584
|
contentCatgId: selectedKeys[0],
|
|
581
|
-
pageIndex:
|
|
585
|
+
pageIndex: pageIndex,
|
|
586
|
+
pageSize: pageSize
|
|
582
587
|
});
|
|
583
588
|
}
|
|
584
589
|
};
|
|
@@ -718,7 +723,7 @@ function ImageModal(_a) {
|
|
|
718
723
|
className: "catg_img"
|
|
719
724
|
}, /*#__PURE__*/_react["default"].createElement(_antd.Card, {
|
|
720
725
|
bodyStyle: {
|
|
721
|
-
height:
|
|
726
|
+
height: 410,
|
|
722
727
|
overflowX: 'auto'
|
|
723
728
|
}
|
|
724
729
|
}, /*#__PURE__*/_react["default"].createElement(_antd.Spin, {
|
|
@@ -739,7 +744,7 @@ function ImageModal(_a) {
|
|
|
739
744
|
}))), /*#__PURE__*/_react["default"].createElement("div", {
|
|
740
745
|
style: {
|
|
741
746
|
"float": 'right',
|
|
742
|
-
|
|
747
|
+
marginTop: '16px'
|
|
743
748
|
}
|
|
744
749
|
}, /*#__PURE__*/_react["default"].createElement(_antd.Pagination, _extends({
|
|
745
750
|
size: "small"
|
|
@@ -1,4 +1,8 @@
|
|
|
1
1
|
.catg_tree_container {
|
|
2
|
+
.search_container {
|
|
3
|
+
margin-bottom: 15px;
|
|
4
|
+
}
|
|
5
|
+
|
|
2
6
|
.ant-tree-title {
|
|
3
7
|
max-width: 200px;
|
|
4
8
|
overflow: hidden;
|
|
@@ -13,9 +17,10 @@
|
|
|
13
17
|
display: flex;
|
|
14
18
|
flex-wrap: wrap;
|
|
15
19
|
}
|
|
20
|
+
|
|
16
21
|
.ant-upload-list-item-thumbnail {
|
|
17
22
|
img {
|
|
18
23
|
object-fit: contain;
|
|
19
24
|
}
|
|
20
25
|
}
|
|
21
|
-
}
|
|
26
|
+
}
|
|
@@ -0,0 +1,267 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
|
|
4
|
+
|
|
5
|
+
Object.defineProperty(exports, "__esModule", {
|
|
6
|
+
value: true
|
|
7
|
+
});
|
|
8
|
+
exports["default"] = exports.coordinateType = void 0;
|
|
9
|
+
|
|
10
|
+
var _interactjs = _interopRequireDefault(require("interactjs"));
|
|
11
|
+
|
|
12
|
+
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
13
|
+
|
|
14
|
+
var _ramda = require("ramda");
|
|
15
|
+
|
|
16
|
+
var _react = _interopRequireWildcard(require("react"));
|
|
17
|
+
|
|
18
|
+
var _Icons = require("./Icons");
|
|
19
|
+
|
|
20
|
+
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
21
|
+
|
|
22
|
+
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { "default": obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj["default"] = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
23
|
+
|
|
24
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
|
25
|
+
|
|
26
|
+
var __extends = void 0 && (void 0).__extends || function () {
|
|
27
|
+
var _extendStatics = function extendStatics(d, b) {
|
|
28
|
+
_extendStatics = Object.setPrototypeOf || {
|
|
29
|
+
__proto__: []
|
|
30
|
+
} instanceof Array && function (d, b) {
|
|
31
|
+
d.__proto__ = b;
|
|
32
|
+
} || function (d, b) {
|
|
33
|
+
for (var p in b) {
|
|
34
|
+
if (b.hasOwnProperty(p)) d[p] = b[p];
|
|
35
|
+
}
|
|
36
|
+
};
|
|
37
|
+
|
|
38
|
+
return _extendStatics(d, b);
|
|
39
|
+
};
|
|
40
|
+
|
|
41
|
+
return function (d, b) {
|
|
42
|
+
_extendStatics(d, b);
|
|
43
|
+
|
|
44
|
+
function __() {
|
|
45
|
+
this.constructor = d;
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
49
|
+
};
|
|
50
|
+
}();
|
|
51
|
+
|
|
52
|
+
var __assign = void 0 && (void 0).__assign || function () {
|
|
53
|
+
__assign = Object.assign || function (t) {
|
|
54
|
+
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
55
|
+
s = arguments[i];
|
|
56
|
+
|
|
57
|
+
for (var p in s) {
|
|
58
|
+
if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
return t;
|
|
63
|
+
};
|
|
64
|
+
|
|
65
|
+
return __assign.apply(this, arguments);
|
|
66
|
+
};
|
|
67
|
+
|
|
68
|
+
var Crop =
|
|
69
|
+
/** @class */
|
|
70
|
+
function (_super) {
|
|
71
|
+
__extends(Crop, _super);
|
|
72
|
+
|
|
73
|
+
function Crop() {
|
|
74
|
+
var _this = _super !== null && _super.apply(this, arguments) || this; // shouldComponentUpdate(nextProps) {
|
|
75
|
+
// // reduce uncessary update
|
|
76
|
+
// return !equals(nextProps.coordinate.inputVal, this.state.inputVal)||!equals(nextProps.coordinate, this.props.coordinate)
|
|
77
|
+
// || (nextProps.index !== this.props.index)
|
|
78
|
+
// }
|
|
79
|
+
|
|
80
|
+
|
|
81
|
+
_this.handleResizeMove = function (e) {
|
|
82
|
+
var _a = _this.props,
|
|
83
|
+
index = _a.index,
|
|
84
|
+
coordinate = _a.coordinate,
|
|
85
|
+
_b = _a.coordinate,
|
|
86
|
+
x = _b.x,
|
|
87
|
+
y = _b.y,
|
|
88
|
+
coordinates = _a.coordinates,
|
|
89
|
+
onResize = _a.onResize,
|
|
90
|
+
onChange = _a.onChange,
|
|
91
|
+
onSave = _a.onSave;
|
|
92
|
+
var _c = e.rect,
|
|
93
|
+
width = _c.width,
|
|
94
|
+
height = _c.height;
|
|
95
|
+
var _d = e.deltaRect,
|
|
96
|
+
left = _d.left,
|
|
97
|
+
top = _d.top; // console.log(x, left, y, top);
|
|
98
|
+
// if (x + left < 0 || y + top < 0 || x + left + width > 500 || y + top + height > 500) {
|
|
99
|
+
// return;
|
|
100
|
+
// }
|
|
101
|
+
|
|
102
|
+
var nextCoordinate = __assign(__assign({}, coordinate), {
|
|
103
|
+
x: x + left,
|
|
104
|
+
y: y + top,
|
|
105
|
+
width: width,
|
|
106
|
+
height: height
|
|
107
|
+
});
|
|
108
|
+
|
|
109
|
+
var nextCoordinates = (0, _ramda.update)(index, nextCoordinate)(coordinates);
|
|
110
|
+
|
|
111
|
+
if ((0, _ramda.is)(Function, onResize)) {
|
|
112
|
+
onResize(nextCoordinate, index, nextCoordinates);
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
if ((0, _ramda.is)(Function, onChange)) {
|
|
116
|
+
onChange(nextCoordinate, index, nextCoordinates);
|
|
117
|
+
}
|
|
118
|
+
};
|
|
119
|
+
|
|
120
|
+
_this.handleDragMove = function (e) {
|
|
121
|
+
var _a = _this.props,
|
|
122
|
+
index = _a.index,
|
|
123
|
+
coordinate = _a.coordinate,
|
|
124
|
+
_b = _a.coordinate,
|
|
125
|
+
x = _b.x,
|
|
126
|
+
y = _b.y,
|
|
127
|
+
coordinates = _a.coordinates,
|
|
128
|
+
onDrag = _a.onDrag,
|
|
129
|
+
onChange = _a.onChange;
|
|
130
|
+
var dx = e.dx,
|
|
131
|
+
dy = e.dy;
|
|
132
|
+
|
|
133
|
+
var nextCoordinate = __assign(__assign({}, coordinate), {
|
|
134
|
+
x: x + dx,
|
|
135
|
+
y: y + dy
|
|
136
|
+
});
|
|
137
|
+
|
|
138
|
+
var nextCoordinates = (0, _ramda.update)(index, nextCoordinate)(coordinates);
|
|
139
|
+
|
|
140
|
+
if ((0, _ramda.is)(Function, onDrag)) {
|
|
141
|
+
onDrag(nextCoordinate, index, nextCoordinates);
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
if ((0, _ramda.is)(Function, onChange)) {
|
|
145
|
+
onChange(nextCoordinate, index, nextCoordinates);
|
|
146
|
+
}
|
|
147
|
+
};
|
|
148
|
+
|
|
149
|
+
_this.handleDelete = function () {
|
|
150
|
+
var _a = _this.props,
|
|
151
|
+
index = _a.index,
|
|
152
|
+
coordinate = _a.coordinate,
|
|
153
|
+
onDelete = _a.onDelete,
|
|
154
|
+
coordinates = _a.coordinates;
|
|
155
|
+
var nextCoordinates = (0, _ramda.remove)(index, 1)(coordinates);
|
|
156
|
+
|
|
157
|
+
if ((0, _ramda.is)(Function, onDelete)) {
|
|
158
|
+
onDelete(coordinate, index, nextCoordinates);
|
|
159
|
+
}
|
|
160
|
+
};
|
|
161
|
+
|
|
162
|
+
_this.state = {
|
|
163
|
+
inputVal: _this.props.coordinate && _this.props.coordinate.inputVal || ''
|
|
164
|
+
};
|
|
165
|
+
|
|
166
|
+
_this.handleSave = function () {
|
|
167
|
+
var _a = _this.props,
|
|
168
|
+
coordinate = _a.coordinate,
|
|
169
|
+
_b = _a.coordinate,
|
|
170
|
+
x = _b.x,
|
|
171
|
+
y = _b.y,
|
|
172
|
+
coordinates = _a.coordinates,
|
|
173
|
+
index = _a.index,
|
|
174
|
+
onSave = _a.onSave;
|
|
175
|
+
|
|
176
|
+
var nextCoordinate = __assign(__assign({}, coordinate), {
|
|
177
|
+
x: x,
|
|
178
|
+
y: y,
|
|
179
|
+
inputVal: _this.state.inputVal
|
|
180
|
+
});
|
|
181
|
+
|
|
182
|
+
var nextCoordinates = (0, _ramda.update)(index, nextCoordinate)(coordinates);
|
|
183
|
+
onSave && onSave(coordinate, index, nextCoordinates);
|
|
184
|
+
(0, _interactjs["default"])(_this.crop).unset();
|
|
185
|
+
};
|
|
186
|
+
|
|
187
|
+
return _this;
|
|
188
|
+
}
|
|
189
|
+
|
|
190
|
+
Crop.prototype.componentDidMount = function () {
|
|
191
|
+
(0, _interactjs["default"])(this.crop).draggable({
|
|
192
|
+
modifiers: [_interactjs["default"].modifiers.restrictRect({
|
|
193
|
+
restriction: 'parent'
|
|
194
|
+
})]
|
|
195
|
+
}).resizable({
|
|
196
|
+
edges: {
|
|
197
|
+
left: true,
|
|
198
|
+
right: true,
|
|
199
|
+
bottom: true,
|
|
200
|
+
top: true
|
|
201
|
+
}
|
|
202
|
+
}).on('dragmove', this.handleDragMove).on('resizemove', this.handleResizeMove);
|
|
203
|
+
};
|
|
204
|
+
|
|
205
|
+
Crop.prototype.componentWillUnmount = function () {
|
|
206
|
+
(0, _interactjs["default"])(this.crop).unset();
|
|
207
|
+
};
|
|
208
|
+
|
|
209
|
+
Crop.prototype.render = function () {
|
|
210
|
+
var _this = this;
|
|
211
|
+
|
|
212
|
+
var _a = this.props,
|
|
213
|
+
coordinate = _a.coordinate,
|
|
214
|
+
index = _a.index,
|
|
215
|
+
onSave = _a.onSave;
|
|
216
|
+
return /*#__PURE__*/_react["default"].createElement("div", {
|
|
217
|
+
ref: function ref(crop) {
|
|
218
|
+
return _this.crop = crop;
|
|
219
|
+
},
|
|
220
|
+
style: Crop.cropStyle(coordinate)
|
|
221
|
+
}, /*#__PURE__*/_react["default"].createElement(_Icons.NumberIcon, {
|
|
222
|
+
number: index + 1
|
|
223
|
+
}), /*#__PURE__*/_react["default"].createElement(_Icons.DeleteIcon, {
|
|
224
|
+
onClick: this.handleDelete
|
|
225
|
+
}));
|
|
226
|
+
};
|
|
227
|
+
|
|
228
|
+
Crop.cropStyle = function (coordinate) {
|
|
229
|
+
var x = coordinate.x,
|
|
230
|
+
y = coordinate.y,
|
|
231
|
+
width = coordinate.width,
|
|
232
|
+
height = coordinate.height;
|
|
233
|
+
return {
|
|
234
|
+
display: 'inline-block',
|
|
235
|
+
position: 'absolute',
|
|
236
|
+
width: width,
|
|
237
|
+
height: height,
|
|
238
|
+
top: y,
|
|
239
|
+
left: x,
|
|
240
|
+
border: '1px dashed #2F54EB',
|
|
241
|
+
background: 'rgba(47, 84, 235, 0.15)'
|
|
242
|
+
};
|
|
243
|
+
};
|
|
244
|
+
|
|
245
|
+
return Crop;
|
|
246
|
+
}(_react.Component);
|
|
247
|
+
|
|
248
|
+
var coordinateType = _propTypes["default"].shape({
|
|
249
|
+
x: _propTypes["default"].number.isRequired,
|
|
250
|
+
y: _propTypes["default"].number.isRequired,
|
|
251
|
+
width: _propTypes["default"].number.isRequired,
|
|
252
|
+
height: _propTypes["default"].number.isRequired
|
|
253
|
+
});
|
|
254
|
+
|
|
255
|
+
exports.coordinateType = coordinateType;
|
|
256
|
+
Crop.propTypes = {
|
|
257
|
+
coordinate: coordinateType.isRequired,
|
|
258
|
+
index: _propTypes["default"].number.isRequired,
|
|
259
|
+
onResize: _propTypes["default"].func,
|
|
260
|
+
onDrag: _propTypes["default"].func,
|
|
261
|
+
onDelete: _propTypes["default"].func,
|
|
262
|
+
onChange: _propTypes["default"].func,
|
|
263
|
+
coordinates: _propTypes["default"].array,
|
|
264
|
+
onSave: _propTypes["default"].func
|
|
265
|
+
};
|
|
266
|
+
var _default = Crop;
|
|
267
|
+
exports["default"] = _default;
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.NumberIcon = exports.DeleteIcon = void 0;
|
|
7
|
+
|
|
8
|
+
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
9
|
+
|
|
10
|
+
var _react = _interopRequireDefault(require("react"));
|
|
11
|
+
|
|
12
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
|
13
|
+
|
|
14
|
+
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); }
|
|
15
|
+
|
|
16
|
+
var DeleteIcon = function DeleteIcon(props) {
|
|
17
|
+
return /*#__PURE__*/_react["default"].createElement("div", _extends({
|
|
18
|
+
className: "rmc-icon-container"
|
|
19
|
+
}, props), /*#__PURE__*/_react["default"].createElement("div", {
|
|
20
|
+
className: "rmc-remove"
|
|
21
|
+
}), /*#__PURE__*/_react["default"].createElement("style", {
|
|
22
|
+
jsx: "true"
|
|
23
|
+
}, "\n .rmc-icon-container {\n width: 15px;\n height: 15px;\n cursor: pointer;\n float: right;\n background:#2F54EB;\n opacity: 0.8;\n }\n .rmc-remove {\n color: white;\n position: absolute;\n margin-top: 6px;\n }\n\n .rmc-remove:hover {\n cursor: pointer;\n }\n\n .rmc-remove:before {\n content: '';\n position: absolute;\n width: 15px;\n height: 1px;\n background-color: currentColor;\n -webkit-transform: rotate(45deg);\n transform: rotate(45deg);\n }\n\n .rmc-remove:after {\n content: '';\n position: absolute;\n width: 15px;\n height: 1px;\n background-color: currentColor;\n -webkit-transform: rotate(-45deg);\n transform: rotate(-45deg);\n }\n "));
|
|
24
|
+
};
|
|
25
|
+
|
|
26
|
+
exports.DeleteIcon = DeleteIcon;
|
|
27
|
+
|
|
28
|
+
var NumberIcon = function NumberIcon(_a) {
|
|
29
|
+
var number = _a.number;
|
|
30
|
+
return /*#__PURE__*/_react["default"].createElement("div", {
|
|
31
|
+
className: "rmc-number"
|
|
32
|
+
}, number, /*#__PURE__*/_react["default"].createElement("style", {
|
|
33
|
+
jsx: "true"
|
|
34
|
+
}, "\n .rmc-number {\n height: 15px;\n width: 15px;\n float: left;\n font-size: 12px;\n background:#2F54EB;\n text-align: center;\n line-height: 15px;\n color: white;\n opacity: 0.8;\n }\n "));
|
|
35
|
+
};
|
|
36
|
+
|
|
37
|
+
exports.NumberIcon = NumberIcon;
|
|
38
|
+
var number = _propTypes["default"].number;
|
|
39
|
+
NumberIcon.propTypes = {
|
|
40
|
+
number: number
|
|
41
|
+
};
|
|
42
|
+
NumberIcon.defaultProps = {
|
|
43
|
+
number: ''
|
|
44
|
+
};
|
|
@@ -0,0 +1,210 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
|
|
4
|
+
|
|
5
|
+
Object.defineProperty(exports, "__esModule", {
|
|
6
|
+
value: true
|
|
7
|
+
});
|
|
8
|
+
exports.MultiCrops = void 0;
|
|
9
|
+
|
|
10
|
+
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
11
|
+
|
|
12
|
+
var _ramda = require("ramda");
|
|
13
|
+
|
|
14
|
+
var _react = _interopRequireWildcard(require("react"));
|
|
15
|
+
|
|
16
|
+
var _shortid = _interopRequireDefault(require("shortid"));
|
|
17
|
+
|
|
18
|
+
var _Crop = _interopRequireWildcard(require("./Crop"));
|
|
19
|
+
|
|
20
|
+
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
21
|
+
|
|
22
|
+
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { "default": obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj["default"] = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
23
|
+
|
|
24
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
|
25
|
+
|
|
26
|
+
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); }
|
|
27
|
+
|
|
28
|
+
var __extends = void 0 && (void 0).__extends || function () {
|
|
29
|
+
var _extendStatics = function extendStatics(d, b) {
|
|
30
|
+
_extendStatics = Object.setPrototypeOf || {
|
|
31
|
+
__proto__: []
|
|
32
|
+
} instanceof Array && function (d, b) {
|
|
33
|
+
d.__proto__ = b;
|
|
34
|
+
} || function (d, b) {
|
|
35
|
+
for (var p in b) {
|
|
36
|
+
if (b.hasOwnProperty(p)) d[p] = b[p];
|
|
37
|
+
}
|
|
38
|
+
};
|
|
39
|
+
|
|
40
|
+
return _extendStatics(d, b);
|
|
41
|
+
};
|
|
42
|
+
|
|
43
|
+
return function (d, b) {
|
|
44
|
+
_extendStatics(d, b);
|
|
45
|
+
|
|
46
|
+
function __() {
|
|
47
|
+
this.constructor = d;
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
51
|
+
};
|
|
52
|
+
}();
|
|
53
|
+
|
|
54
|
+
var isValidPoint = function isValidPoint(point) {
|
|
55
|
+
if (point === void 0) {
|
|
56
|
+
point = {};
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
var strictNumber = function strictNumber(number) {
|
|
60
|
+
return (0, _ramda.both)((0, _ramda.is)(Number), (0, _ramda.complement)((0, _ramda.equals)(NaN)))(number);
|
|
61
|
+
};
|
|
62
|
+
|
|
63
|
+
return strictNumber(point.x) && strictNumber(point.y);
|
|
64
|
+
};
|
|
65
|
+
|
|
66
|
+
var MultiCrops =
|
|
67
|
+
/** @class */
|
|
68
|
+
function (_super) {
|
|
69
|
+
__extends(MultiCrops, _super);
|
|
70
|
+
|
|
71
|
+
function MultiCrops() {
|
|
72
|
+
var _this = _super !== null && _super.apply(this, arguments) || this;
|
|
73
|
+
|
|
74
|
+
_this.drawingIndex = -1;
|
|
75
|
+
_this.pointA = {};
|
|
76
|
+
_this.id = _shortid["default"].generate();
|
|
77
|
+
|
|
78
|
+
_this.renderCrops = function (props) {
|
|
79
|
+
var indexedMap = (0, _ramda.addIndex)(_ramda.map);
|
|
80
|
+
return indexedMap(function (coor, index) {
|
|
81
|
+
return /*#__PURE__*/_react["default"].createElement(_Crop["default"] // improve performance when delet crop in middle array
|
|
82
|
+
, _extends({
|
|
83
|
+
key: coor.id || index,
|
|
84
|
+
index: index,
|
|
85
|
+
coordinate: coor
|
|
86
|
+
}, props));
|
|
87
|
+
})(props.coordinates);
|
|
88
|
+
};
|
|
89
|
+
|
|
90
|
+
_this.getCursorPosition = function (e) {
|
|
91
|
+
var _a = _this.container.getBoundingClientRect(),
|
|
92
|
+
left = _a.left,
|
|
93
|
+
top = _a.top;
|
|
94
|
+
|
|
95
|
+
return {
|
|
96
|
+
x: e.clientX - left,
|
|
97
|
+
y: e.clientY - top
|
|
98
|
+
};
|
|
99
|
+
};
|
|
100
|
+
|
|
101
|
+
_this.handleMouseDown = function (e) {
|
|
102
|
+
var coordinates = _this.props.coordinates;
|
|
103
|
+
|
|
104
|
+
if (e.target === _this.img || e.target === _this.container) {
|
|
105
|
+
var _a = _this.getCursorPosition(e),
|
|
106
|
+
x = _a.x,
|
|
107
|
+
y = _a.y;
|
|
108
|
+
|
|
109
|
+
_this.drawingIndex = coordinates.length;
|
|
110
|
+
_this.pointA = {
|
|
111
|
+
x: x,
|
|
112
|
+
y: y
|
|
113
|
+
};
|
|
114
|
+
_this.id = _shortid["default"].generate();
|
|
115
|
+
}
|
|
116
|
+
};
|
|
117
|
+
|
|
118
|
+
_this.handleMouseMove = function (e) {
|
|
119
|
+
var _a = _this.props,
|
|
120
|
+
onDraw = _a.onDraw,
|
|
121
|
+
onChange = _a.onChange,
|
|
122
|
+
coordinates = _a.coordinates;
|
|
123
|
+
var pointA = _this.pointA;
|
|
124
|
+
|
|
125
|
+
if (isValidPoint(pointA)) {
|
|
126
|
+
var pointB = _this.getCursorPosition(e); // get the drawing coordinate
|
|
127
|
+
|
|
128
|
+
|
|
129
|
+
var coordinate = {
|
|
130
|
+
x: Math.min(pointA.x, pointB.x),
|
|
131
|
+
y: Math.min(pointA.y, pointB.y),
|
|
132
|
+
width: Math.abs(pointA.x - pointB.x),
|
|
133
|
+
height: Math.abs(pointA.y - pointB.y),
|
|
134
|
+
id: _this.id
|
|
135
|
+
};
|
|
136
|
+
var nextCoordinates = (0, _ramda.clone)(coordinates);
|
|
137
|
+
nextCoordinates[_this.drawingIndex] = coordinate;
|
|
138
|
+
|
|
139
|
+
if ((0, _ramda.is)(Function, onDraw)) {
|
|
140
|
+
onDraw(coordinate, _this.drawingIndex, nextCoordinates);
|
|
141
|
+
}
|
|
142
|
+
|
|
143
|
+
if ((0, _ramda.is)(Function, onChange)) {
|
|
144
|
+
onChange(coordinate, _this.drawingIndex, nextCoordinates);
|
|
145
|
+
}
|
|
146
|
+
}
|
|
147
|
+
};
|
|
148
|
+
|
|
149
|
+
_this.handlMouseUp = function () {
|
|
150
|
+
_this.pointA = {};
|
|
151
|
+
};
|
|
152
|
+
|
|
153
|
+
return _this;
|
|
154
|
+
}
|
|
155
|
+
|
|
156
|
+
MultiCrops.prototype.render = function () {
|
|
157
|
+
var _this = this;
|
|
158
|
+
|
|
159
|
+
var _a = this.props,
|
|
160
|
+
src = _a.src,
|
|
161
|
+
width = _a.width,
|
|
162
|
+
height = _a.height,
|
|
163
|
+
onLoad = _a.onLoad; // const { clicked } = this.state
|
|
164
|
+
|
|
165
|
+
return /*#__PURE__*/_react["default"].createElement("div", {
|
|
166
|
+
style: {
|
|
167
|
+
display: 'inline-block',
|
|
168
|
+
position: 'relative',
|
|
169
|
+
width: '600px'
|
|
170
|
+
},
|
|
171
|
+
onMouseDown: this.handleMouseDown,
|
|
172
|
+
onMouseMove: this.handleMouseMove,
|
|
173
|
+
onMouseUp: this.handlMouseUp,
|
|
174
|
+
ref: function ref(container) {
|
|
175
|
+
return _this.container = container;
|
|
176
|
+
}
|
|
177
|
+
}, /*#__PURE__*/_react["default"].createElement("img", {
|
|
178
|
+
ref: function ref(img) {
|
|
179
|
+
return _this.img = img;
|
|
180
|
+
},
|
|
181
|
+
src: src,
|
|
182
|
+
width: width,
|
|
183
|
+
height: height,
|
|
184
|
+
onLoad: onLoad,
|
|
185
|
+
alt: "",
|
|
186
|
+
draggable: false
|
|
187
|
+
}), this.renderCrops(this.props));
|
|
188
|
+
};
|
|
189
|
+
|
|
190
|
+
return MultiCrops;
|
|
191
|
+
}(_react.Component);
|
|
192
|
+
|
|
193
|
+
exports.MultiCrops = MultiCrops;
|
|
194
|
+
var string = _propTypes["default"].string,
|
|
195
|
+
arrayOf = _propTypes["default"].arrayOf,
|
|
196
|
+
number = _propTypes["default"].number,
|
|
197
|
+
func = _propTypes["default"].func;
|
|
198
|
+
MultiCrops.propTypes = {
|
|
199
|
+
coordinates: arrayOf(_Crop.coordinateType),
|
|
200
|
+
src: string,
|
|
201
|
+
width: number,
|
|
202
|
+
height: number,
|
|
203
|
+
onDraw: func,
|
|
204
|
+
onChange: func,
|
|
205
|
+
onLoad: func
|
|
206
|
+
};
|
|
207
|
+
MultiCrops.defaultProps = {
|
|
208
|
+
coordinates: [],
|
|
209
|
+
src: ''
|
|
210
|
+
};
|