@fonixtree/magic-design 0.0.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/es/assets/fonts/Montserrat-Bold.ttf +0 -0
- package/es/assets/fonts/Montserrat-Medium.ttf +0 -0
- package/es/assets/fonts/Montserrat-Regular.ttf +0 -0
- package/es/assets/fonts/Montserrat-SemiBold.ttf +0 -0
- package/es/assets/fonts/OpenSans-Bold.ttf +0 -0
- package/es/assets/fonts/OpenSans-Regular.ttf +0 -0
- package/es/assets/fonts/OpenSans-SemiBold.ttf +0 -0
- package/es/assets/fonts/magic-box-iconfont.css +299 -0
- package/es/assets/fonts/magic-box-iconfont.css.bak +299 -0
- package/es/assets/fonts/magic-box-iconfont.js +1 -0
- package/es/assets/fonts/magic-box-iconfont.js.bak +1 -0
- 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/icon/index.js +68 -0
- package/es/assets/images/layout-icon/carouselLayout1.png +0 -0
- package/es/assets/images/layout-icon/carouselLayout2.png +0 -0
- package/es/assets/images/layout-icon/dividerLayout.svg +4 -0
- package/es/assets/images/layout-icon/imageGalleryLayout1.png +0 -0
- package/es/assets/images/layout-icon/imageGalleryLayout2.png +0 -0
- package/es/assets/images/layout-icon/imageGalleryLayout3.png +0 -0
- package/es/assets/images/layout-icon/layout-imagetext-m1-1.png +0 -0
- package/es/assets/images/layout-icon/layout-imagetext-m1-2.png +0 -0
- package/es/assets/images/layout-icon/layout-imagetext-m1-3.png +0 -0
- package/es/assets/images/layout-icon/layout-imagetext-m2.png +0 -0
- package/es/assets/images/layout-icon/layout-imagetext-m3-1.svg +18 -0
- package/es/assets/images/layout-icon/layout-imagetext-m3-2.svg +9 -0
- package/es/assets/images/layout-icon/layout-imagetext-m3.png +0 -0
- package/es/assets/images/layout-icon/layout-imagetext-p1.png +0 -0
- package/es/assets/images/layout-icon/layout-imagetext-p2.png +0 -0
- package/es/assets/images/layout-icon/layout-imagetext-p3.png +0 -0
- package/es/assets/images/layout-icon/layout-imagetext-p4.png +0 -0
- package/es/assets/images/layout-icon/layout-search.png +0 -0
- package/es/assets/images/layout-icon/newsletter.svg +7 -0
- package/es/assets/less/button.less +9 -0
- package/es/assets/less/common.less +82 -0
- package/es/assets/less/cylon-antd.less +32534 -0
- package/es/assets/less/font.less +50 -0
- package/es/assets/less/global.less +8 -0
- package/es/assets/less/index.less +11 -0
- package/es/assets/less/input.less +8 -0
- package/es/assets/less/menu.less +21 -0
- package/es/assets/less/modal.less +16 -0
- package/es/assets/less/select.less +19 -0
- package/es/assets/less/slider.less +21 -0
- package/es/assets/less/switch.less +20 -0
- package/es/assets/less/table.less +40 -0
- package/es/assets/less/variables.less +4 -0
- package/es/common/AlignSelector/index.js +104 -0
- package/es/common/AlignSelector/index.less +28 -0
- package/es/common/Button/index.js +134 -0
- package/es/common/Button/index.less +68 -0
- package/es/common/ButtonIconLayout/index.js +103 -0
- package/es/common/ButtonIconLayout/index.less +53 -0
- package/es/common/Collapse/index.js +384 -0
- package/es/common/Collapse/index.less +97 -0
- package/es/common/ColorPicker/imgs/no-color.png +0 -0
- package/es/common/ColorPicker/index.js +131 -0
- package/es/common/ColorPicker/index.less +26 -0
- package/es/common/ColorPickerInput/imgs/code.png +0 -0
- package/es/common/ColorPickerInput/index.js +114 -0
- package/es/common/ColorPickerInput/index.less +50 -0
- package/es/common/CountDown/index.js +151 -0
- package/es/common/CountDown/index.less +23 -0
- package/es/common/Field/index.js +80 -0
- package/es/common/Field/index.less +37 -0
- package/es/common/FontStyles/index.js +178 -0
- package/es/common/FontStyles/index.less +63 -0
- package/es/common/GroupList/defaultImg.png +0 -0
- package/es/common/GroupList/index.js +210 -0
- package/es/common/GroupList/index.less +85 -0
- package/es/common/IconPicker/index.js +147 -0
- package/es/common/IconPicker/index.less +46 -0
- package/es/common/Iconfont/index.js +148 -0
- package/es/common/Iconfont/index.less +20 -0
- package/es/common/ImageModal/CommonModal/const.js +22 -0
- package/es/common/ImageModal/CommonModal/index.js +46 -0
- package/es/common/ImageModal/CommonSelPicCard/index.js +80 -0
- package/es/common/ImageModal/CommonSelPicCard/index.less +40 -0
- package/es/common/ImageModal/const.js +24 -0
- package/es/common/ImageModal/index.js +748 -0
- package/es/common/ImageModal/index.less +21 -0
- package/es/common/ImagePicker/index.js +162 -0
- package/es/common/ImagePicker/index.less +104 -0
- package/es/common/InputNumber/index.js +91 -0
- package/es/common/InputNumber/index.less +33 -0
- package/es/common/LayoutSelector/imgs/center.png +0 -0
- package/es/common/LayoutSelector/imgs/left.png +0 -0
- package/es/common/LayoutSelector/imgs/right.png +0 -0
- package/es/common/LayoutSelector/index.js +111 -0
- package/es/common/LayoutSelector/index.less +34 -0
- package/es/common/LinkModal/CatgTable/index.js +234 -0
- package/es/common/LinkModal/CouponTable/index.js +299 -0
- package/es/common/LinkModal/CustomTable/index.js +227 -0
- package/es/common/LinkModal/FilteredProductModal/index.js +640 -0
- package/es/common/LinkModal/FilteredProductModal/index.less +113 -0
- package/es/common/LinkModal/FunctionTable/index.js +221 -0
- package/es/common/LinkModal/ProductDetailPage/index.js +433 -0
- package/es/common/LinkModal/ProductDetailPage/index.less +21 -0
- package/es/common/LinkModal/index.js +136 -0
- package/es/common/LinkModal/index.less +108 -0
- package/es/common/NewImg/index.js +165 -0
- package/es/common/NewImg/index.less +0 -0
- package/es/common/ProductModal/index.js +760 -0
- package/es/common/ProductModal/index.less +238 -0
- package/es/common/ProductSource/index.js +250 -0
- package/es/common/ProductSource/index.less +12 -0
- package/es/common/RcCollapse/Collapse.js +240 -0
- package/es/common/RcCollapse/Panel.js +193 -0
- package/es/common/RcCollapse/PanelContent.js +59 -0
- package/es/common/RcCollapse/index.js +15 -0
- package/es/common/RcCollapse/index.less +108 -0
- package/es/common/RcCollapse/interface.js +1 -0
- package/es/common/RcCollapse/motion.less +12 -0
- package/es/common/RcCollapse/motionUtil.js +44 -0
- package/es/common/Slider/index.js +151 -0
- package/es/common/Slider/index.less +45 -0
- package/es/common/SwitchCollapse/index.js +216 -0
- package/es/common/SwitchCollapse/index.less +40 -0
- package/es/common/UrlPicker/index.js +119 -0
- package/es/common/UrlPicker/index.less +72 -0
- package/es/common/index.js +127 -0
- package/es/composite-comp/bol/components/Banner/defaultJSON.js +268 -0
- package/es/composite-comp/bol/components/Banner/imgs/banner.png +0 -0
- package/es/composite-comp/bol/components/Banner/index.js +89 -0
- package/es/composite-comp/bol/components/Banner/mobile/index.js +216 -0
- package/es/composite-comp/bol/components/Banner/mobile/index.less +73 -0
- package/es/composite-comp/bol/components/Banner/pc/index.js +278 -0
- package/es/composite-comp/bol/components/Banner/pc/index.less +78 -0
- package/es/composite-comp/bol/components/Button/defaultJSON.js +110 -0
- package/es/composite-comp/bol/components/Button/index.js +103 -0
- package/es/composite-comp/bol/components/Button/index.less +47 -0
- package/es/composite-comp/bol/components/Carousel/defaultJSON.js +292 -0
- package/es/composite-comp/bol/components/Carousel/imgs/defaultImg.png +0 -0
- package/es/composite-comp/bol/components/Carousel/index.js +93 -0
- package/es/composite-comp/bol/components/Carousel/mobile/index.js +248 -0
- package/es/composite-comp/bol/components/Carousel/mobile/index.less +81 -0
- package/es/composite-comp/bol/components/Carousel/pc/index.js +254 -0
- package/es/composite-comp/bol/components/Carousel/pc/index.less +81 -0
- package/es/composite-comp/bol/components/Divider/defaultJSON.js +47 -0
- package/es/composite-comp/bol/components/Divider/index.js +101 -0
- package/es/composite-comp/bol/components/ImageGallery/defaultJSON.js +74 -0
- package/es/composite-comp/bol/components/ImageGallery/imgs/banner.png +0 -0
- package/es/composite-comp/bol/components/ImageGallery/index.js +84 -0
- package/es/composite-comp/bol/components/ImageGallery/mobile/index.js +83 -0
- package/es/composite-comp/bol/components/ImageGallery/mobile/index.less +73 -0
- package/es/composite-comp/bol/components/ImageText/defaultJSON.js +537 -0
- package/es/composite-comp/bol/components/ImageText/index.js +88 -0
- package/es/composite-comp/bol/components/ImageText/mobile/index.js +181 -0
- package/es/composite-comp/bol/components/ImageText/mobile/index.less +284 -0
- package/es/composite-comp/bol/components/ImageText/pc/index.js +155 -0
- package/es/composite-comp/bol/components/ImageText/pc/index.less +106 -0
- package/es/composite-comp/bol/components/Newsletter/defaultJSON.js +135 -0
- package/es/composite-comp/bol/components/Newsletter/index.js +127 -0
- package/es/composite-comp/bol/components/Newsletter/index.less +75 -0
- package/es/composite-comp/bol/components/Tag/defaultJSON.js +112 -0
- package/es/composite-comp/bol/components/Tag/index.js +107 -0
- package/es/composite-comp/bol/components/Tag/index.less +34 -0
- package/es/composite-comp/bol/components/Text/defaultJSON.js +149 -0
- package/es/composite-comp/bol/components/Text/index.js +123 -0
- package/es/composite-comp/bol/components/Text/index.less +60 -0
- package/es/composite-comp/bol/components/Text/slice.svg +1 -0
- package/es/composite-comp/bol/config-panels/BannerConfig/BannerConfigGroup/index.js +126 -0
- package/es/composite-comp/bol/config-panels/BannerConfig/BannerConfigGroup/index.less +16 -0
- package/es/composite-comp/bol/config-panels/BannerConfig/BannerConfigSetting/index.js +225 -0
- package/es/composite-comp/bol/config-panels/BannerConfig/BannerConfigSetting/index.less +9 -0
- package/es/composite-comp/bol/config-panels/BannerConfig/index.js +46 -0
- package/es/composite-comp/bol/config-panels/ButtonCompConfig/ButtonConfigContent/index.js +99 -0
- package/es/composite-comp/bol/config-panels/ButtonCompConfig/imgs/defaultImg.png +0 -0
- package/es/composite-comp/bol/config-panels/ButtonCompConfig/imgs/layout1.png +0 -0
- package/es/composite-comp/bol/config-panels/ButtonCompConfig/imgs/layout2.png +0 -0
- package/es/composite-comp/bol/config-panels/ButtonCompConfig/index.js +67 -0
- package/es/composite-comp/bol/config-panels/CarouselConfig/CarouselConfigImageGroup/index.js +144 -0
- package/es/composite-comp/bol/config-panels/CarouselConfig/CarouselConfigImageGroup/index.less +0 -0
- package/es/composite-comp/bol/config-panels/CarouselConfig/CarouselConfigSetting/index.js +199 -0
- package/es/composite-comp/bol/config-panels/CarouselConfig/CarouselConfigSetting/index.less +9 -0
- package/es/composite-comp/bol/config-panels/CarouselConfig/imgs/defaultImg.png +0 -0
- package/es/composite-comp/bol/config-panels/CarouselConfig/index.js +67 -0
- package/es/composite-comp/bol/config-panels/DividerConfig/DividerConfigSetting/index.js +98 -0
- package/es/composite-comp/bol/config-panels/DividerConfig/DividerConfigSetting/index.less +9 -0
- package/es/composite-comp/bol/config-panels/DividerConfig/DividerContentSetting/index.js +177 -0
- package/es/composite-comp/bol/config-panels/DividerConfig/DividerSpacingSetting/index.js +89 -0
- package/es/composite-comp/bol/config-panels/DividerConfig/index.js +57 -0
- package/es/composite-comp/bol/config-panels/ImageGalleryConfig/ImageGalleryConfigImageGroup/index.js +144 -0
- package/es/composite-comp/bol/config-panels/ImageGalleryConfig/ImageGalleryConfigImageGroup/index.less +0 -0
- package/es/composite-comp/bol/config-panels/ImageGalleryConfig/imgs/defaultImg.png +0 -0
- package/es/composite-comp/bol/config-panels/ImageGalleryConfig/index.js +57 -0
- package/es/composite-comp/bol/config-panels/ImageTextConfig/ImageTextConfigGroup/index.js +126 -0
- package/es/composite-comp/bol/config-panels/ImageTextConfig/index.js +196 -0
- package/es/composite-comp/bol/config-panels/NewsletterConfig/InputField/index.js +185 -0
- package/es/composite-comp/bol/config-panels/NewsletterConfig/NewsletterContentSetting/index.js +111 -0
- package/es/composite-comp/bol/config-panels/NewsletterConfig/index.js +57 -0
- package/es/composite-comp/bol/config-panels/TagCompConfig/TagConfigContent/index.js +109 -0
- package/es/composite-comp/bol/config-panels/TagCompConfig/imgs/defaultImg.png +0 -0
- package/es/composite-comp/bol/config-panels/TagCompConfig/imgs/layout1.png +0 -0
- package/es/composite-comp/bol/config-panels/TagCompConfig/imgs/layout2.png +0 -0
- package/es/composite-comp/bol/config-panels/TagCompConfig/index.js +61 -0
- package/es/composite-comp/bol/config-panels/TextCompConfig/TextConfigContent/index.js +99 -0
- package/es/composite-comp/bol/config-panels/TextCompConfig/TextConfigContent/index.less +0 -0
- package/es/composite-comp/bol/config-panels/TextCompConfig/TextConfigGroup/index.js +138 -0
- package/es/composite-comp/bol/config-panels/TextCompConfig/TextConfigGroup/index.less +16 -0
- package/es/composite-comp/bol/config-panels/TextCompConfig/imgs/defaultImg.png +0 -0
- package/es/composite-comp/bol/config-panels/TextCompConfig/imgs/layout1.png +0 -0
- package/es/composite-comp/bol/config-panels/TextCompConfig/index.js +69 -0
- package/es/composite-comp/bol/second-config-panels/BannerSecondConfig/index.js +151 -0
- package/es/composite-comp/bol/second-config-panels/BannerSecondConfig/index.less +3 -0
- package/es/composite-comp/bol/second-config-panels/CarouselSecondConfig/index.js +164 -0
- package/es/composite-comp/bol/second-config-panels/ImageGallerySecondConfig/index.js +82 -0
- package/es/composite-comp/bol/second-config-panels/ImageTextSecondConfig/index.js +141 -0
- package/es/composite-comp/bol/second-config-panels/TextSecondConfig/TextContentConfigContent/index.js +99 -0
- package/es/composite-comp/bol/second-config-panels/TextSecondConfig/TextContentConfigContent/index.less +0 -0
- package/es/composite-comp/bol/second-config-panels/TextSecondConfig/index.js +90 -0
- package/es/composite-comp/bol/second-config-panels/TextSecondConfig/index.less +3 -0
- package/es/composite-comp/common/components/ImageLabel/index.js +90 -0
- package/es/composite-comp/common/components/ImageLabel/index.less +35 -0
- package/es/composite-comp/common/components/ProductItem/index.js +191 -0
- package/es/composite-comp/common/components/ProductItem/index.less +121 -0
- package/es/composite-comp/common/config-panels/BackgroundConfig/index.js +109 -0
- package/es/composite-comp/common/config-panels/CustomizeConfig/index.js +202 -0
- package/es/composite-comp/common/config-panels/CustomizeConfig/index.less +21 -0
- package/es/composite-comp/common/config-panels/SpacingConfig/index.js +154 -0
- package/es/composite-comp/common/config-panels/SpacingConfig/index.less +17 -0
- package/es/composite-comp/dito/components/FlashDeal/defaultJSON.js +183 -0
- package/es/composite-comp/dito/components/FlashDeal/index.js +86 -0
- package/es/composite-comp/dito/components/FlashDeal/mobile/imgs/defImg1.png +0 -0
- package/es/composite-comp/dito/components/FlashDeal/mobile/imgs/defImg2.png +0 -0
- package/es/composite-comp/dito/components/FlashDeal/mobile/imgs/defImg3.png +0 -0
- package/es/composite-comp/dito/components/FlashDeal/mobile/index.js +436 -0
- package/es/composite-comp/dito/components/FlashDeal/mobile/index.less +94 -0
- package/es/composite-comp/dito/components/Recommend/defaultJSON.js +220 -0
- package/es/composite-comp/dito/components/Recommend/index.js +86 -0
- package/es/composite-comp/dito/components/Recommend/mobile/imgs/defImg1.png +0 -0
- package/es/composite-comp/dito/components/Recommend/mobile/imgs/defImg2.png +0 -0
- package/es/composite-comp/dito/components/Recommend/mobile/imgs/defImg3.png +0 -0
- package/es/composite-comp/dito/components/Recommend/mobile/index.js +530 -0
- package/es/composite-comp/dito/components/Recommend/mobile/index.less +79 -0
- package/es/composite-comp/dito/components/SearchBar/defaultJSON.js +56 -0
- package/es/composite-comp/dito/components/SearchBar/imgs/dito-logo.svg +6 -0
- package/es/composite-comp/dito/components/SearchBar/index.js +86 -0
- package/es/composite-comp/dito/components/SearchBar/mobile/index.js +108 -0
- package/es/composite-comp/dito/components/SearchBar/mobile/index.less +38 -0
- package/es/composite-comp/dito/config-panels/FlashDealConfig/FlashDealConfigContent/index.js +143 -0
- package/es/composite-comp/dito/config-panels/FlashDealConfig/FlashDealConfigContent/index.less +0 -0
- package/es/composite-comp/dito/config-panels/FlashDealConfig/FlashDealConfigTitle/index.js +125 -0
- package/es/composite-comp/dito/config-panels/FlashDealConfig/FlashDealConfigTitle/index.less +0 -0
- package/es/composite-comp/dito/config-panels/FlashDealConfig/imgs/layout1.png +0 -0
- package/es/composite-comp/dito/config-panels/FlashDealConfig/index.js +62 -0
- package/es/composite-comp/dito/config-panels/RecommendConfig/RecommendConfigContent/index.js +118 -0
- package/es/composite-comp/dito/config-panels/RecommendConfig/RecommendConfigContent/index.less +0 -0
- package/es/composite-comp/dito/config-panels/RecommendConfig/RecommendConfigGroup/index.js +143 -0
- package/es/composite-comp/dito/config-panels/RecommendConfig/RecommendConfigGroup/index.less +16 -0
- package/es/composite-comp/dito/config-panels/RecommendConfig/imgs/defaultImg.png +0 -0
- package/es/composite-comp/dito/config-panels/RecommendConfig/imgs/layout1.png +0 -0
- package/es/composite-comp/dito/config-panels/RecommendConfig/index.js +62 -0
- package/es/composite-comp/dito/config-panels/SearchBarConfig/index.js +138 -0
- package/es/composite-comp/dito/second-config-panels/RecommendSecondConfig/index.js +185 -0
- package/es/composite-comp/dito/second-config-panels/RecommendSecondConfig/index.less +3 -0
- package/es/constants/component-types.js +87 -0
- package/es/constants/index.js +144 -0
- package/es/constants/layout.js +120 -0
- package/es/core/Designer/CompListPanel/CompCard/index.js +42 -0
- package/es/core/Designer/CompListPanel/CompCard/index.less +69 -0
- package/es/core/Designer/CompListPanel/index.js +156 -0
- package/es/core/Designer/CompListPanel/index.less +69 -0
- package/es/core/Designer/ConfigPanel/index.js +294 -0
- package/es/core/Designer/ConfigPanel/index.less +139 -0
- package/es/core/Designer/History/index.js +91 -0
- package/es/core/Designer/PageCompList/index.js +266 -0
- package/es/core/Designer/PageCompList/index.less +114 -0
- package/es/core/Designer/QuickMenuBar/index.js +176 -0
- package/es/core/Designer/QuickMenuBar/index.less +67 -0
- package/es/core/Designer/ViewArea/index.js +150 -0
- package/es/core/Designer/ViewArea/index.less +53 -0
- package/es/core/Designer/index.js +454 -0
- package/es/core/Designer/index.less +6 -0
- package/es/core/Renderer/index.js +82 -0
- package/es/decorator/compositeDecorator.js +129 -0
- package/es/decorator/index.js +23 -0
- package/es/decorator/metaDecorator.js +199 -0
- package/es/index.js +27 -0
- package/es/meta-comp/components/Button/index.js +185 -0
- package/es/meta-comp/components/Button/index.less +19 -0
- package/es/meta-comp/components/Image/index.js +171 -0
- package/es/meta-comp/components/Image/index.less +18 -0
- package/es/meta-comp/components/Text/index.js +470 -0
- package/es/meta-comp/components/Text/index.less +38 -0
- package/es/meta-comp/components/index.js +31 -0
- package/es/meta-comp/config-panels/BaseConfig.js +87 -0
- package/es/meta-comp/config-panels/ButtonConfig/index.js +349 -0
- package/es/meta-comp/config-panels/ButtonConfig/index.less +4 -0
- package/es/meta-comp/config-panels/ImageConfig/index.js +204 -0
- package/es/meta-comp/config-panels/ImageConfig/index.less +16 -0
- package/es/meta-comp/config-panels/TextConfig/index.js +327 -0
- package/es/meta-comp/config-panels/TextConfig/index.less +24 -0
- package/es/mobx/Store.js +93 -0
- package/es/mobx/index.js +36 -0
- package/es/utils/androidUtil.js +113 -0
- package/es/utils/businessUtil.js +235 -0
- package/es/utils/commonUtil.js +269 -0
- package/es/utils/compJsonUtil.js +240 -0
- package/es/utils/coreUtil.js +156 -0
- package/es/utils/currencyUtil.js +190 -0
- package/es/utils/dataTreeUtils.js +105 -0
- package/es/utils/dateUtil.js +70 -0
- package/es/utils/storeUtil.js +258 -0
- package/lib/assets/fonts/Montserrat-Bold.ttf +0 -0
- package/lib/assets/fonts/Montserrat-Medium.ttf +0 -0
- package/lib/assets/fonts/Montserrat-Regular.ttf +0 -0
- package/lib/assets/fonts/Montserrat-SemiBold.ttf +0 -0
- package/lib/assets/fonts/OpenSans-Bold.ttf +0 -0
- package/lib/assets/fonts/OpenSans-Regular.ttf +0 -0
- package/lib/assets/fonts/OpenSans-SemiBold.ttf +0 -0
- package/lib/assets/fonts/magic-box-iconfont.css +299 -0
- package/lib/assets/fonts/magic-box-iconfont.css.bak +299 -0
- package/lib/assets/fonts/magic-box-iconfont.js +1 -0
- package/lib/assets/fonts/magic-box-iconfont.js.bak +1 -0
- 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/icon/index.js +68 -0
- package/lib/assets/images/layout-icon/carouselLayout1.png +0 -0
- package/lib/assets/images/layout-icon/carouselLayout2.png +0 -0
- package/lib/assets/images/layout-icon/dividerLayout.svg +4 -0
- package/lib/assets/images/layout-icon/imageGalleryLayout1.png +0 -0
- package/lib/assets/images/layout-icon/imageGalleryLayout2.png +0 -0
- package/lib/assets/images/layout-icon/imageGalleryLayout3.png +0 -0
- package/lib/assets/images/layout-icon/layout-imagetext-m1-1.png +0 -0
- package/lib/assets/images/layout-icon/layout-imagetext-m1-2.png +0 -0
- package/lib/assets/images/layout-icon/layout-imagetext-m1-3.png +0 -0
- package/lib/assets/images/layout-icon/layout-imagetext-m2.png +0 -0
- package/lib/assets/images/layout-icon/layout-imagetext-m3-1.svg +18 -0
- package/lib/assets/images/layout-icon/layout-imagetext-m3-2.svg +9 -0
- package/lib/assets/images/layout-icon/layout-imagetext-m3.png +0 -0
- package/lib/assets/images/layout-icon/layout-imagetext-p1.png +0 -0
- package/lib/assets/images/layout-icon/layout-imagetext-p2.png +0 -0
- package/lib/assets/images/layout-icon/layout-imagetext-p3.png +0 -0
- package/lib/assets/images/layout-icon/layout-imagetext-p4.png +0 -0
- package/lib/assets/images/layout-icon/layout-search.png +0 -0
- package/lib/assets/images/layout-icon/newsletter.svg +7 -0
- package/lib/assets/less/button.less +9 -0
- package/lib/assets/less/common.less +82 -0
- package/lib/assets/less/cylon-antd.less +32534 -0
- package/lib/assets/less/font.less +50 -0
- package/lib/assets/less/global.less +8 -0
- package/lib/assets/less/index.less +11 -0
- package/lib/assets/less/input.less +8 -0
- package/lib/assets/less/menu.less +21 -0
- package/lib/assets/less/modal.less +16 -0
- package/lib/assets/less/select.less +19 -0
- package/lib/assets/less/slider.less +21 -0
- package/lib/assets/less/switch.less +20 -0
- package/lib/assets/less/table.less +40 -0
- package/lib/assets/less/variables.less +4 -0
- package/lib/common/AlignSelector/index.js +104 -0
- package/lib/common/AlignSelector/index.less +28 -0
- package/lib/common/Button/index.js +134 -0
- package/lib/common/Button/index.less +68 -0
- package/lib/common/ButtonIconLayout/index.js +103 -0
- package/lib/common/ButtonIconLayout/index.less +53 -0
- package/lib/common/Collapse/index.js +384 -0
- package/lib/common/Collapse/index.less +97 -0
- package/lib/common/ColorPicker/imgs/no-color.png +0 -0
- package/lib/common/ColorPicker/index.js +131 -0
- package/lib/common/ColorPicker/index.less +26 -0
- package/lib/common/ColorPickerInput/imgs/code.png +0 -0
- package/lib/common/ColorPickerInput/index.js +114 -0
- package/lib/common/ColorPickerInput/index.less +50 -0
- package/lib/common/CountDown/index.js +151 -0
- package/lib/common/CountDown/index.less +23 -0
- package/lib/common/Field/index.js +80 -0
- package/lib/common/Field/index.less +37 -0
- package/lib/common/FontStyles/index.js +178 -0
- package/lib/common/FontStyles/index.less +63 -0
- package/lib/common/GroupList/defaultImg.png +0 -0
- package/lib/common/GroupList/index.js +210 -0
- package/lib/common/GroupList/index.less +85 -0
- package/lib/common/IconPicker/index.js +147 -0
- package/lib/common/IconPicker/index.less +46 -0
- package/lib/common/Iconfont/index.js +148 -0
- package/lib/common/Iconfont/index.less +20 -0
- package/lib/common/ImageModal/CommonModal/const.js +22 -0
- package/lib/common/ImageModal/CommonModal/index.js +46 -0
- package/lib/common/ImageModal/CommonSelPicCard/index.js +80 -0
- package/lib/common/ImageModal/CommonSelPicCard/index.less +40 -0
- package/lib/common/ImageModal/const.js +24 -0
- package/lib/common/ImageModal/index.js +748 -0
- package/lib/common/ImageModal/index.less +21 -0
- package/lib/common/ImagePicker/index.js +162 -0
- package/lib/common/ImagePicker/index.less +104 -0
- package/lib/common/InputNumber/index.js +91 -0
- package/lib/common/InputNumber/index.less +33 -0
- package/lib/common/LayoutSelector/imgs/center.png +0 -0
- package/lib/common/LayoutSelector/imgs/left.png +0 -0
- package/lib/common/LayoutSelector/imgs/right.png +0 -0
- package/lib/common/LayoutSelector/index.js +111 -0
- package/lib/common/LayoutSelector/index.less +34 -0
- package/lib/common/LinkModal/CatgTable/index.js +234 -0
- package/lib/common/LinkModal/CouponTable/index.js +299 -0
- package/lib/common/LinkModal/CustomTable/index.js +227 -0
- package/lib/common/LinkModal/FilteredProductModal/index.js +640 -0
- package/lib/common/LinkModal/FilteredProductModal/index.less +113 -0
- package/lib/common/LinkModal/FunctionTable/index.js +221 -0
- package/lib/common/LinkModal/ProductDetailPage/index.js +433 -0
- package/lib/common/LinkModal/ProductDetailPage/index.less +21 -0
- package/lib/common/LinkModal/index.js +136 -0
- package/lib/common/LinkModal/index.less +108 -0
- package/lib/common/NewImg/index.js +165 -0
- package/lib/common/NewImg/index.less +0 -0
- package/lib/common/ProductModal/index.js +760 -0
- package/lib/common/ProductModal/index.less +238 -0
- package/lib/common/ProductSource/index.js +250 -0
- package/lib/common/ProductSource/index.less +12 -0
- package/lib/common/RcCollapse/Collapse.js +240 -0
- package/lib/common/RcCollapse/Panel.js +193 -0
- package/lib/common/RcCollapse/PanelContent.js +59 -0
- package/lib/common/RcCollapse/index.js +15 -0
- package/lib/common/RcCollapse/index.less +108 -0
- package/lib/common/RcCollapse/interface.js +1 -0
- package/lib/common/RcCollapse/motion.less +12 -0
- package/lib/common/RcCollapse/motionUtil.js +44 -0
- package/lib/common/Slider/index.js +151 -0
- package/lib/common/Slider/index.less +45 -0
- package/lib/common/SwitchCollapse/index.js +216 -0
- package/lib/common/SwitchCollapse/index.less +40 -0
- package/lib/common/UrlPicker/index.js +119 -0
- package/lib/common/UrlPicker/index.less +72 -0
- package/lib/common/index.js +127 -0
- package/lib/composite-comp/bol/components/Banner/defaultJSON.js +268 -0
- package/lib/composite-comp/bol/components/Banner/imgs/banner.png +0 -0
- package/lib/composite-comp/bol/components/Banner/index.js +89 -0
- package/lib/composite-comp/bol/components/Banner/mobile/index.js +216 -0
- package/lib/composite-comp/bol/components/Banner/mobile/index.less +73 -0
- package/lib/composite-comp/bol/components/Banner/pc/index.js +278 -0
- package/lib/composite-comp/bol/components/Banner/pc/index.less +78 -0
- package/lib/composite-comp/bol/components/Button/defaultJSON.js +110 -0
- package/lib/composite-comp/bol/components/Button/index.js +103 -0
- package/lib/composite-comp/bol/components/Button/index.less +47 -0
- package/lib/composite-comp/bol/components/Carousel/defaultJSON.js +292 -0
- package/lib/composite-comp/bol/components/Carousel/imgs/defaultImg.png +0 -0
- package/lib/composite-comp/bol/components/Carousel/index.js +93 -0
- package/lib/composite-comp/bol/components/Carousel/mobile/index.js +248 -0
- package/lib/composite-comp/bol/components/Carousel/mobile/index.less +81 -0
- package/lib/composite-comp/bol/components/Carousel/pc/index.js +254 -0
- package/lib/composite-comp/bol/components/Carousel/pc/index.less +81 -0
- package/lib/composite-comp/bol/components/Divider/defaultJSON.js +47 -0
- package/lib/composite-comp/bol/components/Divider/index.js +101 -0
- package/lib/composite-comp/bol/components/ImageGallery/defaultJSON.js +74 -0
- package/lib/composite-comp/bol/components/ImageGallery/imgs/banner.png +0 -0
- package/lib/composite-comp/bol/components/ImageGallery/index.js +84 -0
- package/lib/composite-comp/bol/components/ImageGallery/mobile/index.js +83 -0
- package/lib/composite-comp/bol/components/ImageGallery/mobile/index.less +73 -0
- package/lib/composite-comp/bol/components/ImageText/defaultJSON.js +537 -0
- package/lib/composite-comp/bol/components/ImageText/index.js +88 -0
- package/lib/composite-comp/bol/components/ImageText/mobile/index.js +181 -0
- package/lib/composite-comp/bol/components/ImageText/mobile/index.less +284 -0
- package/lib/composite-comp/bol/components/ImageText/pc/index.js +155 -0
- package/lib/composite-comp/bol/components/ImageText/pc/index.less +106 -0
- package/lib/composite-comp/bol/components/Newsletter/defaultJSON.js +135 -0
- package/lib/composite-comp/bol/components/Newsletter/index.js +127 -0
- package/lib/composite-comp/bol/components/Newsletter/index.less +75 -0
- package/lib/composite-comp/bol/components/Tag/defaultJSON.js +112 -0
- package/lib/composite-comp/bol/components/Tag/index.js +107 -0
- package/lib/composite-comp/bol/components/Tag/index.less +34 -0
- package/lib/composite-comp/bol/components/Text/defaultJSON.js +149 -0
- package/lib/composite-comp/bol/components/Text/index.js +123 -0
- package/lib/composite-comp/bol/components/Text/index.less +60 -0
- package/lib/composite-comp/bol/components/Text/slice.svg +1 -0
- package/lib/composite-comp/bol/config-panels/BannerConfig/BannerConfigGroup/index.js +126 -0
- package/lib/composite-comp/bol/config-panels/BannerConfig/BannerConfigGroup/index.less +16 -0
- package/lib/composite-comp/bol/config-panels/BannerConfig/BannerConfigSetting/index.js +225 -0
- package/lib/composite-comp/bol/config-panels/BannerConfig/BannerConfigSetting/index.less +9 -0
- package/lib/composite-comp/bol/config-panels/BannerConfig/index.js +46 -0
- package/lib/composite-comp/bol/config-panels/ButtonCompConfig/ButtonConfigContent/index.js +99 -0
- package/lib/composite-comp/bol/config-panels/ButtonCompConfig/imgs/defaultImg.png +0 -0
- package/lib/composite-comp/bol/config-panels/ButtonCompConfig/imgs/layout1.png +0 -0
- package/lib/composite-comp/bol/config-panels/ButtonCompConfig/imgs/layout2.png +0 -0
- package/lib/composite-comp/bol/config-panels/ButtonCompConfig/index.js +67 -0
- package/lib/composite-comp/bol/config-panels/CarouselConfig/CarouselConfigImageGroup/index.js +144 -0
- package/lib/composite-comp/bol/config-panels/CarouselConfig/CarouselConfigImageGroup/index.less +0 -0
- package/lib/composite-comp/bol/config-panels/CarouselConfig/CarouselConfigSetting/index.js +199 -0
- package/lib/composite-comp/bol/config-panels/CarouselConfig/CarouselConfigSetting/index.less +9 -0
- package/lib/composite-comp/bol/config-panels/CarouselConfig/imgs/defaultImg.png +0 -0
- package/lib/composite-comp/bol/config-panels/CarouselConfig/index.js +67 -0
- package/lib/composite-comp/bol/config-panels/DividerConfig/DividerConfigSetting/index.js +98 -0
- package/lib/composite-comp/bol/config-panels/DividerConfig/DividerConfigSetting/index.less +9 -0
- package/lib/composite-comp/bol/config-panels/DividerConfig/DividerContentSetting/index.js +177 -0
- package/lib/composite-comp/bol/config-panels/DividerConfig/DividerSpacingSetting/index.js +89 -0
- package/lib/composite-comp/bol/config-panels/DividerConfig/index.js +57 -0
- package/lib/composite-comp/bol/config-panels/ImageGalleryConfig/ImageGalleryConfigImageGroup/index.js +144 -0
- package/lib/composite-comp/bol/config-panels/ImageGalleryConfig/ImageGalleryConfigImageGroup/index.less +0 -0
- package/lib/composite-comp/bol/config-panels/ImageGalleryConfig/imgs/defaultImg.png +0 -0
- package/lib/composite-comp/bol/config-panels/ImageGalleryConfig/index.js +57 -0
- package/lib/composite-comp/bol/config-panels/ImageTextConfig/ImageTextConfigGroup/index.js +126 -0
- package/lib/composite-comp/bol/config-panels/ImageTextConfig/index.js +196 -0
- package/lib/composite-comp/bol/config-panels/NewsletterConfig/InputField/index.js +185 -0
- package/lib/composite-comp/bol/config-panels/NewsletterConfig/NewsletterContentSetting/index.js +111 -0
- package/lib/composite-comp/bol/config-panels/NewsletterConfig/index.js +57 -0
- package/lib/composite-comp/bol/config-panels/TagCompConfig/TagConfigContent/index.js +109 -0
- package/lib/composite-comp/bol/config-panels/TagCompConfig/imgs/defaultImg.png +0 -0
- package/lib/composite-comp/bol/config-panels/TagCompConfig/imgs/layout1.png +0 -0
- package/lib/composite-comp/bol/config-panels/TagCompConfig/imgs/layout2.png +0 -0
- package/lib/composite-comp/bol/config-panels/TagCompConfig/index.js +61 -0
- package/lib/composite-comp/bol/config-panels/TextCompConfig/TextConfigContent/index.js +99 -0
- package/lib/composite-comp/bol/config-panels/TextCompConfig/TextConfigContent/index.less +0 -0
- package/lib/composite-comp/bol/config-panels/TextCompConfig/TextConfigGroup/index.js +138 -0
- package/lib/composite-comp/bol/config-panels/TextCompConfig/TextConfigGroup/index.less +16 -0
- package/lib/composite-comp/bol/config-panels/TextCompConfig/imgs/defaultImg.png +0 -0
- package/lib/composite-comp/bol/config-panels/TextCompConfig/imgs/layout1.png +0 -0
- package/lib/composite-comp/bol/config-panels/TextCompConfig/index.js +69 -0
- package/lib/composite-comp/bol/second-config-panels/BannerSecondConfig/index.js +151 -0
- package/lib/composite-comp/bol/second-config-panels/BannerSecondConfig/index.less +3 -0
- package/lib/composite-comp/bol/second-config-panels/CarouselSecondConfig/index.js +164 -0
- package/lib/composite-comp/bol/second-config-panels/ImageGallerySecondConfig/index.js +82 -0
- package/lib/composite-comp/bol/second-config-panels/ImageTextSecondConfig/index.js +141 -0
- package/lib/composite-comp/bol/second-config-panels/TextSecondConfig/TextContentConfigContent/index.js +99 -0
- package/lib/composite-comp/bol/second-config-panels/TextSecondConfig/TextContentConfigContent/index.less +0 -0
- package/lib/composite-comp/bol/second-config-panels/TextSecondConfig/index.js +90 -0
- package/lib/composite-comp/bol/second-config-panels/TextSecondConfig/index.less +3 -0
- package/lib/composite-comp/common/components/ImageLabel/index.js +90 -0
- package/lib/composite-comp/common/components/ImageLabel/index.less +35 -0
- package/lib/composite-comp/common/components/ProductItem/index.js +191 -0
- package/lib/composite-comp/common/components/ProductItem/index.less +121 -0
- package/lib/composite-comp/common/config-panels/BackgroundConfig/index.js +109 -0
- package/lib/composite-comp/common/config-panels/CustomizeConfig/index.js +202 -0
- package/lib/composite-comp/common/config-panels/CustomizeConfig/index.less +21 -0
- package/lib/composite-comp/common/config-panels/SpacingConfig/index.js +154 -0
- package/lib/composite-comp/common/config-panels/SpacingConfig/index.less +17 -0
- package/lib/composite-comp/dito/components/FlashDeal/defaultJSON.js +183 -0
- package/lib/composite-comp/dito/components/FlashDeal/index.js +86 -0
- package/lib/composite-comp/dito/components/FlashDeal/mobile/imgs/defImg1.png +0 -0
- package/lib/composite-comp/dito/components/FlashDeal/mobile/imgs/defImg2.png +0 -0
- package/lib/composite-comp/dito/components/FlashDeal/mobile/imgs/defImg3.png +0 -0
- package/lib/composite-comp/dito/components/FlashDeal/mobile/index.js +436 -0
- package/lib/composite-comp/dito/components/FlashDeal/mobile/index.less +94 -0
- package/lib/composite-comp/dito/components/Recommend/defaultJSON.js +220 -0
- package/lib/composite-comp/dito/components/Recommend/index.js +86 -0
- package/lib/composite-comp/dito/components/Recommend/mobile/imgs/defImg1.png +0 -0
- package/lib/composite-comp/dito/components/Recommend/mobile/imgs/defImg2.png +0 -0
- package/lib/composite-comp/dito/components/Recommend/mobile/imgs/defImg3.png +0 -0
- package/lib/composite-comp/dito/components/Recommend/mobile/index.js +530 -0
- package/lib/composite-comp/dito/components/Recommend/mobile/index.less +79 -0
- package/lib/composite-comp/dito/components/SearchBar/defaultJSON.js +56 -0
- package/lib/composite-comp/dito/components/SearchBar/imgs/dito-logo.svg +6 -0
- package/lib/composite-comp/dito/components/SearchBar/index.js +86 -0
- package/lib/composite-comp/dito/components/SearchBar/mobile/index.js +108 -0
- package/lib/composite-comp/dito/components/SearchBar/mobile/index.less +38 -0
- package/lib/composite-comp/dito/config-panels/FlashDealConfig/FlashDealConfigContent/index.js +143 -0
- package/lib/composite-comp/dito/config-panels/FlashDealConfig/FlashDealConfigContent/index.less +0 -0
- package/lib/composite-comp/dito/config-panels/FlashDealConfig/FlashDealConfigTitle/index.js +125 -0
- package/lib/composite-comp/dito/config-panels/FlashDealConfig/FlashDealConfigTitle/index.less +0 -0
- package/lib/composite-comp/dito/config-panels/FlashDealConfig/imgs/layout1.png +0 -0
- package/lib/composite-comp/dito/config-panels/FlashDealConfig/index.js +62 -0
- package/lib/composite-comp/dito/config-panels/RecommendConfig/RecommendConfigContent/index.js +118 -0
- package/lib/composite-comp/dito/config-panels/RecommendConfig/RecommendConfigContent/index.less +0 -0
- package/lib/composite-comp/dito/config-panels/RecommendConfig/RecommendConfigGroup/index.js +143 -0
- package/lib/composite-comp/dito/config-panels/RecommendConfig/RecommendConfigGroup/index.less +16 -0
- package/lib/composite-comp/dito/config-panels/RecommendConfig/imgs/defaultImg.png +0 -0
- package/lib/composite-comp/dito/config-panels/RecommendConfig/imgs/layout1.png +0 -0
- package/lib/composite-comp/dito/config-panels/RecommendConfig/index.js +62 -0
- package/lib/composite-comp/dito/config-panels/SearchBarConfig/index.js +138 -0
- package/lib/composite-comp/dito/second-config-panels/RecommendSecondConfig/index.js +185 -0
- package/lib/composite-comp/dito/second-config-panels/RecommendSecondConfig/index.less +3 -0
- package/lib/constants/component-types.js +87 -0
- package/lib/constants/index.js +144 -0
- package/lib/constants/layout.js +120 -0
- package/lib/core/Designer/CompListPanel/CompCard/index.js +42 -0
- package/lib/core/Designer/CompListPanel/CompCard/index.less +69 -0
- package/lib/core/Designer/CompListPanel/index.js +156 -0
- package/lib/core/Designer/CompListPanel/index.less +69 -0
- package/lib/core/Designer/ConfigPanel/index.js +294 -0
- package/lib/core/Designer/ConfigPanel/index.less +139 -0
- package/lib/core/Designer/History/index.js +91 -0
- package/lib/core/Designer/PageCompList/index.js +266 -0
- package/lib/core/Designer/PageCompList/index.less +114 -0
- package/lib/core/Designer/QuickMenuBar/index.js +176 -0
- package/lib/core/Designer/QuickMenuBar/index.less +67 -0
- package/lib/core/Designer/ViewArea/index.js +150 -0
- package/lib/core/Designer/ViewArea/index.less +53 -0
- package/lib/core/Designer/index.js +454 -0
- package/lib/core/Designer/index.less +6 -0
- package/lib/core/Renderer/index.js +82 -0
- package/lib/decorator/compositeDecorator.js +129 -0
- package/lib/decorator/index.js +23 -0
- package/lib/decorator/metaDecorator.js +199 -0
- package/lib/index.js +27 -0
- package/lib/meta-comp/components/Button/index.js +185 -0
- package/lib/meta-comp/components/Button/index.less +19 -0
- package/lib/meta-comp/components/Image/index.js +171 -0
- package/lib/meta-comp/components/Image/index.less +18 -0
- package/lib/meta-comp/components/Text/index.js +470 -0
- package/lib/meta-comp/components/Text/index.less +38 -0
- package/lib/meta-comp/components/index.js +31 -0
- package/lib/meta-comp/config-panels/BaseConfig.js +87 -0
- package/lib/meta-comp/config-panels/ButtonConfig/index.js +349 -0
- package/lib/meta-comp/config-panels/ButtonConfig/index.less +4 -0
- package/lib/meta-comp/config-panels/ImageConfig/index.js +204 -0
- package/lib/meta-comp/config-panels/ImageConfig/index.less +16 -0
- package/lib/meta-comp/config-panels/TextConfig/index.js +327 -0
- package/lib/meta-comp/config-panels/TextConfig/index.less +24 -0
- package/lib/mobx/Store.js +93 -0
- package/lib/mobx/index.js +36 -0
- package/lib/utils/androidUtil.js +113 -0
- package/lib/utils/businessUtil.js +235 -0
- package/lib/utils/commonUtil.js +269 -0
- package/lib/utils/compJsonUtil.js +240 -0
- package/lib/utils/coreUtil.js +156 -0
- package/lib/utils/currencyUtil.js +190 -0
- package/lib/utils/dataTreeUtils.js +105 -0
- package/lib/utils/dateUtil.js +70 -0
- package/lib/utils/storeUtil.js +258 -0
- package/package.json +68 -0
|
@@ -0,0 +1,171 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports["default"] = void 0;
|
|
7
|
+
|
|
8
|
+
var _react = _interopRequireDefault(require("react"));
|
|
9
|
+
|
|
10
|
+
var _classnames = _interopRequireDefault(require("classnames"));
|
|
11
|
+
|
|
12
|
+
require("./index.less");
|
|
13
|
+
|
|
14
|
+
var _coreUtil = require("../../../utils/coreUtil");
|
|
15
|
+
|
|
16
|
+
var _decorator = require("../../../decorator");
|
|
17
|
+
|
|
18
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
|
19
|
+
|
|
20
|
+
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); }
|
|
21
|
+
|
|
22
|
+
var __extends = void 0 && (void 0).__extends || function () {
|
|
23
|
+
var _extendStatics = function extendStatics(d, b) {
|
|
24
|
+
_extendStatics = Object.setPrototypeOf || {
|
|
25
|
+
__proto__: []
|
|
26
|
+
} instanceof Array && function (d, b) {
|
|
27
|
+
d.__proto__ = b;
|
|
28
|
+
} || function (d, b) {
|
|
29
|
+
for (var p in b) {
|
|
30
|
+
if (b.hasOwnProperty(p)) d[p] = b[p];
|
|
31
|
+
}
|
|
32
|
+
};
|
|
33
|
+
|
|
34
|
+
return _extendStatics(d, b);
|
|
35
|
+
};
|
|
36
|
+
|
|
37
|
+
return function (d, b) {
|
|
38
|
+
_extendStatics(d, b);
|
|
39
|
+
|
|
40
|
+
function __() {
|
|
41
|
+
this.constructor = d;
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
45
|
+
};
|
|
46
|
+
}();
|
|
47
|
+
|
|
48
|
+
var __decorate = void 0 && (void 0).__decorate || function (decorators, target, key, desc) {
|
|
49
|
+
var c = arguments.length,
|
|
50
|
+
r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc,
|
|
51
|
+
d;
|
|
52
|
+
if ((typeof Reflect === "undefined" ? "undefined" : _typeof(Reflect)) === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);else for (var i = decorators.length - 1; i >= 0; i--) {
|
|
53
|
+
if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
54
|
+
}
|
|
55
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
56
|
+
};
|
|
57
|
+
|
|
58
|
+
var Image =
|
|
59
|
+
/** @class */
|
|
60
|
+
function (_super) {
|
|
61
|
+
__extends(Image, _super);
|
|
62
|
+
|
|
63
|
+
function Image() {
|
|
64
|
+
var _this = _super !== null && _super.apply(this, arguments) || this;
|
|
65
|
+
|
|
66
|
+
_this.state = {
|
|
67
|
+
// 当仅作为一个图片时,鼠标移上去,hover状态
|
|
68
|
+
hoverImgSrc: false
|
|
69
|
+
};
|
|
70
|
+
|
|
71
|
+
_this.getStyle = function () {
|
|
72
|
+
var _a = _this.props,
|
|
73
|
+
data = _a.data,
|
|
74
|
+
hoverState = _a.hoverState,
|
|
75
|
+
maxHeight = _a.maxHeight,
|
|
76
|
+
maxWidth = _a.maxWidth;
|
|
77
|
+
var hoverImgSrc = _this.state.hoverImgSrc;
|
|
78
|
+
var obj = {};
|
|
79
|
+
|
|
80
|
+
if (data.hover.open && data.hover.backgroundType === 'enlarge' && (hoverState || hoverImgSrc)) {
|
|
81
|
+
// return { transform: `scale(${data.hover.magnification})` };
|
|
82
|
+
obj.transform = "scale(" + data.hover.magnification + ")";
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
if (maxHeight) {
|
|
86
|
+
obj.maxHeight = maxHeight;
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
if (maxWidth) {
|
|
90
|
+
obj.maxWidth = maxWidth;
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
return obj;
|
|
94
|
+
};
|
|
95
|
+
|
|
96
|
+
_this.mouseEnterImg = function () {
|
|
97
|
+
var _a = _this.props,
|
|
98
|
+
data = _a.data,
|
|
99
|
+
isBackground = _a.isBackground;
|
|
100
|
+
|
|
101
|
+
if (data.hover.open && !isBackground) {
|
|
102
|
+
_this.setState({
|
|
103
|
+
hoverImgSrc: true
|
|
104
|
+
});
|
|
105
|
+
}
|
|
106
|
+
};
|
|
107
|
+
|
|
108
|
+
_this.mouseLeaveImg = function () {
|
|
109
|
+
var _a = _this.props,
|
|
110
|
+
data = _a.data,
|
|
111
|
+
isBackground = _a.isBackground;
|
|
112
|
+
|
|
113
|
+
if (data.hover.open && !isBackground) {
|
|
114
|
+
_this.setState({
|
|
115
|
+
hoverImgSrc: false
|
|
116
|
+
});
|
|
117
|
+
}
|
|
118
|
+
};
|
|
119
|
+
|
|
120
|
+
return _this;
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
Image.prototype.render = function () {
|
|
124
|
+
var _a, _b;
|
|
125
|
+
|
|
126
|
+
var _c = this.props,
|
|
127
|
+
data = _c.data,
|
|
128
|
+
isBackground = _c.isBackground,
|
|
129
|
+
hoverState = _c.hoverState;
|
|
130
|
+
var hoverImgSrc = this.state.hoverImgSrc; // const { hoverSrc } = this.state;
|
|
131
|
+
// console.log('--metaImage ', this.props);
|
|
132
|
+
|
|
133
|
+
var srcImg = (0, _coreUtil.isPc)() ? (_a = data.content) === null || _a === void 0 ? void 0 : _a.pcImgSrc : (_b = data.content) === null || _b === void 0 ? void 0 : _b.h5ImgSrc;
|
|
134
|
+
|
|
135
|
+
if (data.hover.open && data.hover.backgroundType === 'new' && (hoverState || hoverImgSrc)) {
|
|
136
|
+
srcImg = (0, _coreUtil.isPc)() ? data.hover.pcImgHoverUrl : data.hover.h5ImgHoverUrl;
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
if (window.magicDesign.isShop && (srcImg === null || srcImg === void 0 ? void 0 : srcImg.includes('ecommerce/static'))) {
|
|
140
|
+
srcImg = srcImg.replace('ecommerce/static', 'static');
|
|
141
|
+
}
|
|
142
|
+
|
|
143
|
+
return /*#__PURE__*/_react["default"].createElement("div", {
|
|
144
|
+
className: (0, _classnames["default"])('m-meta-image', {
|
|
145
|
+
backgroundImg: isBackground
|
|
146
|
+
}),
|
|
147
|
+
onClick: function onClick() {
|
|
148
|
+
(0, _coreUtil.clickUrl)(data.content.clickUrl);
|
|
149
|
+
}
|
|
150
|
+
}, srcImg && /*#__PURE__*/_react["default"].createElement("img", {
|
|
151
|
+
onMouseEnter: this.mouseEnterImg,
|
|
152
|
+
onMouseLeave: this.mouseLeaveImg,
|
|
153
|
+
src: srcImg,
|
|
154
|
+
style: this.getStyle()
|
|
155
|
+
}));
|
|
156
|
+
};
|
|
157
|
+
|
|
158
|
+
Image.defaultProps = {
|
|
159
|
+
data: {
|
|
160
|
+
content: {},
|
|
161
|
+
hover: {}
|
|
162
|
+
},
|
|
163
|
+
isBackground: false,
|
|
164
|
+
hoverState: false
|
|
165
|
+
};
|
|
166
|
+
Image = __decorate([_decorator.metaDecorator], Image);
|
|
167
|
+
return Image;
|
|
168
|
+
}(_react["default"].Component);
|
|
169
|
+
|
|
170
|
+
var _default = Image;
|
|
171
|
+
exports["default"] = _default;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
.m-meta-image {
|
|
2
|
+
width: 100%;
|
|
3
|
+
height: 100%;
|
|
4
|
+
|
|
5
|
+
&>img {
|
|
6
|
+
width: 100%;
|
|
7
|
+
height: 100%;
|
|
8
|
+
object-fit: contain;
|
|
9
|
+
transition: all .2s linear;
|
|
10
|
+
vertical-align:initial;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
&.backgroundImg {
|
|
14
|
+
&>img {
|
|
15
|
+
object-fit: cover;
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
}
|
|
@@ -0,0 +1,470 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports["default"] = exports.contentStyle = void 0;
|
|
7
|
+
|
|
8
|
+
var _react = _interopRequireDefault(require("react"));
|
|
9
|
+
|
|
10
|
+
var _classnames = _interopRequireDefault(require("classnames"));
|
|
11
|
+
|
|
12
|
+
var _lodash = require("lodash");
|
|
13
|
+
|
|
14
|
+
require("./index.less");
|
|
15
|
+
|
|
16
|
+
var _Iconfont = require("../../../common/Iconfont");
|
|
17
|
+
|
|
18
|
+
var _decorator = require("../../../decorator");
|
|
19
|
+
|
|
20
|
+
var _coreUtil = require("../../../utils/coreUtil");
|
|
21
|
+
|
|
22
|
+
var _mobx = require("../../../mobx");
|
|
23
|
+
|
|
24
|
+
var _commonUtil = require("../../../utils/commonUtil");
|
|
25
|
+
|
|
26
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
|
27
|
+
|
|
28
|
+
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); }
|
|
29
|
+
|
|
30
|
+
var __extends = void 0 && (void 0).__extends || function () {
|
|
31
|
+
var _extendStatics = function extendStatics(d, b) {
|
|
32
|
+
_extendStatics = Object.setPrototypeOf || {
|
|
33
|
+
__proto__: []
|
|
34
|
+
} instanceof Array && function (d, b) {
|
|
35
|
+
d.__proto__ = b;
|
|
36
|
+
} || function (d, b) {
|
|
37
|
+
for (var p in b) {
|
|
38
|
+
if (b.hasOwnProperty(p)) d[p] = b[p];
|
|
39
|
+
}
|
|
40
|
+
};
|
|
41
|
+
|
|
42
|
+
return _extendStatics(d, b);
|
|
43
|
+
};
|
|
44
|
+
|
|
45
|
+
return function (d, b) {
|
|
46
|
+
_extendStatics(d, b);
|
|
47
|
+
|
|
48
|
+
function __() {
|
|
49
|
+
this.constructor = d;
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
53
|
+
};
|
|
54
|
+
}();
|
|
55
|
+
|
|
56
|
+
var __assign = void 0 && (void 0).__assign || function () {
|
|
57
|
+
__assign = Object.assign || function (t) {
|
|
58
|
+
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
59
|
+
s = arguments[i];
|
|
60
|
+
|
|
61
|
+
for (var p in s) {
|
|
62
|
+
if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
return t;
|
|
67
|
+
};
|
|
68
|
+
|
|
69
|
+
return __assign.apply(this, arguments);
|
|
70
|
+
};
|
|
71
|
+
|
|
72
|
+
var __decorate = void 0 && (void 0).__decorate || function (decorators, target, key, desc) {
|
|
73
|
+
var c = arguments.length,
|
|
74
|
+
r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc,
|
|
75
|
+
d;
|
|
76
|
+
if ((typeof Reflect === "undefined" ? "undefined" : _typeof(Reflect)) === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);else for (var i = decorators.length - 1; i >= 0; i--) {
|
|
77
|
+
if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
78
|
+
}
|
|
79
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
80
|
+
};
|
|
81
|
+
|
|
82
|
+
var __spreadArrays = void 0 && (void 0).__spreadArrays || function () {
|
|
83
|
+
for (var s = 0, i = 0, il = arguments.length; i < il; i++) {
|
|
84
|
+
s += arguments[i].length;
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
for (var r = Array(s), k = 0, i = 0; i < il; i++) {
|
|
88
|
+
for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++) {
|
|
89
|
+
r[k] = a[j];
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
return r;
|
|
94
|
+
};
|
|
95
|
+
|
|
96
|
+
var contentStyle = function contentStyle(content) {
|
|
97
|
+
return {
|
|
98
|
+
fontSize: content.fontSize,
|
|
99
|
+
fontFamily: content.fontFamily,
|
|
100
|
+
fontWeight: content.fontWeight,
|
|
101
|
+
fontStyle: content.fontStyle,
|
|
102
|
+
color: content.color,
|
|
103
|
+
backgroundColor: content.backgroundColor,
|
|
104
|
+
textAlign: content.textAlign,
|
|
105
|
+
width: window.magicDesign.device == 'mobile' ? '100%' : content.width || 'fit-content'
|
|
106
|
+
};
|
|
107
|
+
};
|
|
108
|
+
/** 从父级数组中 分离出 片段数组 */
|
|
109
|
+
|
|
110
|
+
|
|
111
|
+
exports.contentStyle = contentStyle;
|
|
112
|
+
|
|
113
|
+
var calcSplitRange = function calcSplitRange(parentRange, splitRange) {
|
|
114
|
+
if (parentRange[0] == splitRange[0]) {
|
|
115
|
+
if (parentRange[1] == splitRange[1]) {
|
|
116
|
+
return parentRange;
|
|
117
|
+
} else {
|
|
118
|
+
return [[parentRange[0], splitRange[1]], [splitRange[1], parentRange[1]]];
|
|
119
|
+
}
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
if (parentRange[1] == splitRange[1]) {
|
|
123
|
+
return [[parentRange[0], splitRange[0]], [splitRange[0], parentRange[1]]];
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
return [[parentRange[0], splitRange[0]], [splitRange[0], splitRange[1]], [splitRange[1], parentRange[1]]];
|
|
127
|
+
};
|
|
128
|
+
/** 驱动配置面板渲染 */
|
|
129
|
+
|
|
130
|
+
|
|
131
|
+
var triggerTextConfigRender = function triggerTextConfigRender() {
|
|
132
|
+
window.document.dispatchEvent(new Event('text-render', {
|
|
133
|
+
bubbles: false
|
|
134
|
+
}));
|
|
135
|
+
};
|
|
136
|
+
/** 初始化监听事件 */
|
|
137
|
+
|
|
138
|
+
|
|
139
|
+
var initSelectionEvent = function initSelectionEvent() {
|
|
140
|
+
if (!window.document.onselectionchange) {
|
|
141
|
+
window.document.onselectionchange = (0, _lodash.debounce)(function (e) {
|
|
142
|
+
var _a;
|
|
143
|
+
|
|
144
|
+
var _b, _c, _d, _e;
|
|
145
|
+
/** 找到选中的text区域 并且注册过事件 */
|
|
146
|
+
|
|
147
|
+
|
|
148
|
+
var findSelectionTarget = window._selectionTarget.find(function (_a) {
|
|
149
|
+
var target = _a.target;
|
|
150
|
+
return target == e.target.activeElement;
|
|
151
|
+
});
|
|
152
|
+
/** 所有选中状态清楚 */
|
|
153
|
+
|
|
154
|
+
|
|
155
|
+
var clearSelection = function clearSelection() {
|
|
156
|
+
_mobx.store.setState({
|
|
157
|
+
textSelection: null
|
|
158
|
+
});
|
|
159
|
+
|
|
160
|
+
triggerTextConfigRender();
|
|
161
|
+
};
|
|
162
|
+
|
|
163
|
+
if (findSelectionTarget) {
|
|
164
|
+
var range = window.getSelection().getRangeAt(0);
|
|
165
|
+
var startOffset = range.startOffset,
|
|
166
|
+
endOffset = range.endOffset,
|
|
167
|
+
startContainer_1 = range.startContainer,
|
|
168
|
+
endContainer = range.endContainer;
|
|
169
|
+
/** 起始点=终点 取消 */
|
|
170
|
+
|
|
171
|
+
if (startOffset == endOffset) {
|
|
172
|
+
clearSelection();
|
|
173
|
+
return;
|
|
174
|
+
}
|
|
175
|
+
/** 如果全部选中 取消 */
|
|
176
|
+
|
|
177
|
+
|
|
178
|
+
if (startOffset == 0 && endOffset == findSelectionTarget.data.text.length) {
|
|
179
|
+
clearSelection();
|
|
180
|
+
return;
|
|
181
|
+
}
|
|
182
|
+
/** 判断起始点和结束点是否相同 */
|
|
183
|
+
|
|
184
|
+
|
|
185
|
+
if (startContainer_1 == endContainer) {
|
|
186
|
+
/** 如果还没有选中区域 */
|
|
187
|
+
if (findSelectionTarget.data.specialContent.length == 0) {
|
|
188
|
+
var nowRange_1 = [startOffset, endOffset].sort(function (a, b) {
|
|
189
|
+
return a - b;
|
|
190
|
+
});
|
|
191
|
+
var rangeList = calcSplitRange([0, findSelectionTarget.data.text.length], nowRange_1);
|
|
192
|
+
findSelectionTarget.data.specialContent = rangeList.map(function (range) {
|
|
193
|
+
return {
|
|
194
|
+
range: range,
|
|
195
|
+
content: {}
|
|
196
|
+
};
|
|
197
|
+
});
|
|
198
|
+
var findSelectionRange = (_b = findSelectionTarget.data.specialContent) === null || _b === void 0 ? void 0 : _b.find(function (c) {
|
|
199
|
+
return JSON.stringify(c.range) == JSON.stringify(nowRange_1);
|
|
200
|
+
});
|
|
201
|
+
|
|
202
|
+
_mobx.store.setState({
|
|
203
|
+
textSelection: findSelectionRange.content
|
|
204
|
+
});
|
|
205
|
+
} else {
|
|
206
|
+
/** 如果已有选中区域 */
|
|
207
|
+
var nowRange_2 = [startOffset, endOffset].sort(function (a, b) {
|
|
208
|
+
return a - b;
|
|
209
|
+
});
|
|
210
|
+
var selectionRangeJSON_1 = Object.keys(findSelectionTarget.selectionRefMap).find(function (rangeTarget) {
|
|
211
|
+
return findSelectionTarget.selectionRefMap[rangeTarget] == startContainer_1.parentNode;
|
|
212
|
+
});
|
|
213
|
+
var findSelectionRangeTarget_1 = (_c = findSelectionTarget.data.specialContent) === null || _c === void 0 ? void 0 : _c.find(function (c) {
|
|
214
|
+
return JSON.stringify(c.range) == selectionRangeJSON_1;
|
|
215
|
+
});
|
|
216
|
+
/** 选中没配置过的区域 可以进行拆分 */
|
|
217
|
+
|
|
218
|
+
if ((0, _lodash.isEmpty)(findSelectionRangeTarget_1.content)) {
|
|
219
|
+
/** 计算偏移值 */
|
|
220
|
+
nowRange_2[0] += findSelectionRangeTarget_1.range[0];
|
|
221
|
+
nowRange_2[1] += findSelectionRangeTarget_1.range[0];
|
|
222
|
+
/** 补充新的选中区域 */
|
|
223
|
+
|
|
224
|
+
if (JSON.stringify(findSelectionRangeTarget_1.range) != JSON.stringify(nowRange_2)) {
|
|
225
|
+
var rangeList = calcSplitRange(findSelectionRangeTarget_1.range, nowRange_2);
|
|
226
|
+
var nowContentIndex = (_d = findSelectionTarget.data.specialContent) === null || _d === void 0 ? void 0 : _d.findIndex(function (c) {
|
|
227
|
+
return c == findSelectionRangeTarget_1;
|
|
228
|
+
});
|
|
229
|
+
|
|
230
|
+
(_a = findSelectionTarget.data.specialContent).splice.apply(_a, __spreadArrays([nowContentIndex, 1], rangeList.map(function (range) {
|
|
231
|
+
return {
|
|
232
|
+
range: range,
|
|
233
|
+
content: {}
|
|
234
|
+
};
|
|
235
|
+
})));
|
|
236
|
+
}
|
|
237
|
+
|
|
238
|
+
var findSelectionRange = (_e = findSelectionTarget.data.specialContent) === null || _e === void 0 ? void 0 : _e.find(function (c) {
|
|
239
|
+
return JSON.stringify(c.range) == JSON.stringify(nowRange_2);
|
|
240
|
+
});
|
|
241
|
+
|
|
242
|
+
_mobx.store.setState({
|
|
243
|
+
textSelection: findSelectionRange.content
|
|
244
|
+
});
|
|
245
|
+
} else {
|
|
246
|
+
/** 选中已经配置过的区域 不能拆分 */
|
|
247
|
+
_mobx.store.setState({
|
|
248
|
+
textSelection: findSelectionRangeTarget_1.content
|
|
249
|
+
});
|
|
250
|
+
}
|
|
251
|
+
}
|
|
252
|
+
} else {
|
|
253
|
+
_mobx.store.setState({
|
|
254
|
+
textSelection: null
|
|
255
|
+
});
|
|
256
|
+
}
|
|
257
|
+
|
|
258
|
+
findSelectionTarget.refresh();
|
|
259
|
+
}
|
|
260
|
+
|
|
261
|
+
triggerTextConfigRender();
|
|
262
|
+
}, 500);
|
|
263
|
+
}
|
|
264
|
+
};
|
|
265
|
+
/** 添加选择区域监听目标 */
|
|
266
|
+
|
|
267
|
+
|
|
268
|
+
var appendSelectionTarget = function appendSelectionTarget(data) {
|
|
269
|
+
if (!window._selectionTarget) {
|
|
270
|
+
window._selectionTarget = [__assign({}, data)];
|
|
271
|
+
} else {
|
|
272
|
+
window._selectionTarget.push(__assign({}, data));
|
|
273
|
+
}
|
|
274
|
+
};
|
|
275
|
+
/** 删除监听目标 */
|
|
276
|
+
|
|
277
|
+
|
|
278
|
+
var deleteSelectionTarget = function deleteSelectionTarget(deleteTarget) {
|
|
279
|
+
window._selectionTarget = window._selectionTarget.filter(function (_a) {
|
|
280
|
+
var target = _a.target;
|
|
281
|
+
return target != deleteTarget;
|
|
282
|
+
});
|
|
283
|
+
};
|
|
284
|
+
|
|
285
|
+
var Text =
|
|
286
|
+
/** @class */
|
|
287
|
+
function (_super) {
|
|
288
|
+
__extends(Text, _super);
|
|
289
|
+
|
|
290
|
+
function Text() {
|
|
291
|
+
var _this = _super !== null && _super.apply(this, arguments) || this;
|
|
292
|
+
|
|
293
|
+
_this.state = {};
|
|
294
|
+
/** 分割区域dom映射 */
|
|
295
|
+
|
|
296
|
+
_this.selectionRefMap = {};
|
|
297
|
+
_this.textRef = /*#__PURE__*/_react["default"].createRef();
|
|
298
|
+
/** 备份历史数据 比对不一致时渲染 */
|
|
299
|
+
|
|
300
|
+
_this.preData = '';
|
|
301
|
+
_this.preTextSelection = null;
|
|
302
|
+
/** 创建关闭图标按钮 */
|
|
303
|
+
|
|
304
|
+
_this.createHoverClose = function (node, onCloseClick) {
|
|
305
|
+
if (onCloseClick === void 0) {
|
|
306
|
+
onCloseClick = function onCloseClick() {};
|
|
307
|
+
}
|
|
308
|
+
|
|
309
|
+
node.className = 'select-container';
|
|
310
|
+
var closeNode = document.createElement('span');
|
|
311
|
+
closeNode.className = 'close-wrap';
|
|
312
|
+
closeNode.contentEditable = 'false';
|
|
313
|
+
var iconNode = document.createElement('span');
|
|
314
|
+
iconNode.contentEditable = 'false';
|
|
315
|
+
iconNode.className = (0, _Iconfont.convertIconClass)('icon-close-circle');
|
|
316
|
+
iconNode.onclick = onCloseClick;
|
|
317
|
+
closeNode.appendChild(iconNode);
|
|
318
|
+
node.appendChild(closeNode);
|
|
319
|
+
};
|
|
320
|
+
|
|
321
|
+
_this.renderText = function (data) {
|
|
322
|
+
if (!_this.textRef.current) return;
|
|
323
|
+
|
|
324
|
+
_this.textRef.current.blur();
|
|
325
|
+
/** 保留历史数据 */
|
|
326
|
+
|
|
327
|
+
|
|
328
|
+
_this.preData = JSON.stringify(data);
|
|
329
|
+
_this.preTextSelection = _mobx.store.textSelection;
|
|
330
|
+
/** 渲染html */
|
|
331
|
+
|
|
332
|
+
if (data.specialContent.length == 0) {
|
|
333
|
+
_this.textRef.current.innerHTML = data.text;
|
|
334
|
+
} else {
|
|
335
|
+
_this.textRef.current.innerHTML = '';
|
|
336
|
+
data.specialContent.forEach(function (c, index) {
|
|
337
|
+
var _a;
|
|
338
|
+
|
|
339
|
+
var node = document.createElement('span');
|
|
340
|
+
node.style = (0, _commonUtil.styleStringify)(contentStyle(c.content));
|
|
341
|
+
node.innerText = (_a = data.text).slice.apply(_a, c.range);
|
|
342
|
+
_this.selectionRefMap[JSON.stringify(c.range)] = node;
|
|
343
|
+
|
|
344
|
+
_this.textRef.current.appendChild(node);
|
|
345
|
+
/** 找到当前选中的区域 */
|
|
346
|
+
|
|
347
|
+
|
|
348
|
+
if (_mobx.store.textSelection == c.content) {
|
|
349
|
+
/** 添加删除按钮 */
|
|
350
|
+
_this.createHoverClose(node, function () {
|
|
351
|
+
/** 第一步去除选中区域 */
|
|
352
|
+
_mobx.store.setState({
|
|
353
|
+
textSelection: null
|
|
354
|
+
});
|
|
355
|
+
/** 清空区间配置 */
|
|
356
|
+
|
|
357
|
+
|
|
358
|
+
data.specialContent[index].content = {};
|
|
359
|
+
/** 合并区间无配置区间 */
|
|
360
|
+
|
|
361
|
+
for (var i = 0; i < data.specialContent.length - 1;) {
|
|
362
|
+
/** 如果本级和下级都是空值 那么合并 */
|
|
363
|
+
if ((0, _lodash.isEmpty)(data.specialContent[i].content) && (0, _lodash.isEmpty)(data.specialContent[i + 1].content)) {
|
|
364
|
+
data.specialContent[i].range = [data.specialContent[i].range[0], data.specialContent[i + 1].range[1]];
|
|
365
|
+
data.specialContent.splice(i + 1, 1);
|
|
366
|
+
} else {
|
|
367
|
+
i += 1;
|
|
368
|
+
}
|
|
369
|
+
}
|
|
370
|
+
|
|
371
|
+
triggerTextConfigRender();
|
|
372
|
+
});
|
|
373
|
+
}
|
|
374
|
+
});
|
|
375
|
+
}
|
|
376
|
+
/** 清除无用的node */
|
|
377
|
+
|
|
378
|
+
|
|
379
|
+
Object.keys(_this.selectionRefMap).forEach(function (key) {
|
|
380
|
+
if (!data.specialContent.find(function (c) {
|
|
381
|
+
return JSON.stringify(c.range) == key;
|
|
382
|
+
})) {
|
|
383
|
+
Reflect.deleteProperty(_this.selectionRefMap, key);
|
|
384
|
+
}
|
|
385
|
+
});
|
|
386
|
+
};
|
|
387
|
+
|
|
388
|
+
return _this;
|
|
389
|
+
}
|
|
390
|
+
|
|
391
|
+
Text.prototype.componentDidMount = function () {
|
|
392
|
+
var _this = this;
|
|
393
|
+
|
|
394
|
+
this.renderText(this.props.data);
|
|
395
|
+
initSelectionEvent();
|
|
396
|
+
appendSelectionTarget({
|
|
397
|
+
target: this.textRef.current,
|
|
398
|
+
data: this.props.data,
|
|
399
|
+
selectionRefMap: this.selectionRefMap,
|
|
400
|
+
refresh: function refresh() {
|
|
401
|
+
_this.renderText(_this.props.data);
|
|
402
|
+
}
|
|
403
|
+
});
|
|
404
|
+
};
|
|
405
|
+
|
|
406
|
+
Text.prototype.shouldComponentUpdate = function (nextProps) {
|
|
407
|
+
var should1 = JSON.stringify(nextProps.data) != this.preData;
|
|
408
|
+
var should2 = _mobx.store.textSelection != this.preTextSelection;
|
|
409
|
+
var result = should1 || should2;
|
|
410
|
+
|
|
411
|
+
if (result) {
|
|
412
|
+
this.renderText(nextProps.data);
|
|
413
|
+
}
|
|
414
|
+
|
|
415
|
+
return result;
|
|
416
|
+
};
|
|
417
|
+
|
|
418
|
+
Text.prototype.componentWillUnmount = function () {
|
|
419
|
+
deleteSelectionTarget(this.textRef.current);
|
|
420
|
+
};
|
|
421
|
+
|
|
422
|
+
Text.prototype.render = function () {
|
|
423
|
+
var _this = this;
|
|
424
|
+
|
|
425
|
+
var _a = this.props,
|
|
426
|
+
data = _a.data,
|
|
427
|
+
className = _a.className,
|
|
428
|
+
readonly = _a.readonly,
|
|
429
|
+
onTextInput = _a.onTextInput;
|
|
430
|
+
|
|
431
|
+
var style = __assign(__assign({}, contentStyle(data.content)), {
|
|
432
|
+
textDecorationLine: data.underline.open ? 'underline' : 'none',
|
|
433
|
+
textDecorationColor: data.underline.textDecorationColor,
|
|
434
|
+
textDecorationStyle: data.underline.textDecorationStyle
|
|
435
|
+
});
|
|
436
|
+
|
|
437
|
+
return /*#__PURE__*/_react["default"].createElement("div", {
|
|
438
|
+
ref: this.textRef,
|
|
439
|
+
className: (0, _classnames["default"])('m-meta-text', className),
|
|
440
|
+
contentEditable: (0, _coreUtil.isDesignMode)() && !readonly,
|
|
441
|
+
onInput: function onInput(e) {
|
|
442
|
+
var text = e.target.textContent;
|
|
443
|
+
data.text = text;
|
|
444
|
+
/** 主动更新历史数据避免render */
|
|
445
|
+
|
|
446
|
+
_this.preData = JSON.stringify(__assign(__assign({}, JSON.parse(_this.preData)), {
|
|
447
|
+
text: text
|
|
448
|
+
}));
|
|
449
|
+
/** 通知变更 */
|
|
450
|
+
|
|
451
|
+
onTextInput(text);
|
|
452
|
+
},
|
|
453
|
+
onKeyDown: function onKeyDown(e) {
|
|
454
|
+
e.stopPropagation();
|
|
455
|
+
},
|
|
456
|
+
style: style,
|
|
457
|
+
suppressContentEditableWarning: true
|
|
458
|
+
});
|
|
459
|
+
};
|
|
460
|
+
|
|
461
|
+
Text.defaultProps = {
|
|
462
|
+
readonly: false,
|
|
463
|
+
onTextInput: function onTextInput() {}
|
|
464
|
+
};
|
|
465
|
+
Text = __decorate([_decorator.metaDecorator], Text);
|
|
466
|
+
return Text;
|
|
467
|
+
}(_react["default"].Component);
|
|
468
|
+
|
|
469
|
+
var _default = Text;
|
|
470
|
+
exports["default"] = _default;
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
.m-meta-text {
|
|
2
|
+
display: block;
|
|
3
|
+
|
|
4
|
+
.select-container {
|
|
5
|
+
position: relative;
|
|
6
|
+
|
|
7
|
+
.close-wrap {
|
|
8
|
+
user-select: none;
|
|
9
|
+
position: absolute;
|
|
10
|
+
top: 0;
|
|
11
|
+
right: 0;
|
|
12
|
+
bottom: 0;
|
|
13
|
+
left: 0;
|
|
14
|
+
border: 1px dashed rgb(204, 204, 204);
|
|
15
|
+
|
|
16
|
+
.magic-box-iconfont {
|
|
17
|
+
position: absolute;
|
|
18
|
+
top: 0;
|
|
19
|
+
right: 0;
|
|
20
|
+
font-size: 21px;
|
|
21
|
+
transform: translate(50%, -50%);
|
|
22
|
+
color: rgb(255, 255, 255);
|
|
23
|
+
text-shadow: 1px 1px 4px #000;
|
|
24
|
+
|
|
25
|
+
&:hover {
|
|
26
|
+
color: rgb(244, 104, 104);
|
|
27
|
+
cursor: pointer;
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
// &.selected {
|
|
33
|
+
// .close-wrap {
|
|
34
|
+
// display: inline;
|
|
35
|
+
// }
|
|
36
|
+
// }
|
|
37
|
+
}
|
|
38
|
+
}
|