@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.
Files changed (339) hide show
  1. package/es/assets/fonts/magic-box-iconfont.css +24 -12
  2. package/es/assets/fonts/magic-box-iconfont.css.bak +24 -12
  3. package/es/assets/fonts/magic-box-iconfont.js +1 -1
  4. package/es/assets/fonts/magic-box-iconfont.js.bak +1 -1
  5. package/es/assets/fonts/magic-box-iconfont.ttf +0 -0
  6. package/es/assets/fonts/magic-box-iconfont.woff +0 -0
  7. package/es/assets/fonts/magic-box-iconfont.woff2 +0 -0
  8. package/es/assets/images/layout-icon/layout-navigation-normal.png +0 -0
  9. package/es/assets/less/common.less +2 -2
  10. package/es/assets/less/modal.less +7 -2
  11. package/es/common/Button/index.js +2 -1
  12. package/es/common/Button/index.less +5 -0
  13. package/es/common/ButtonIconLayout/index.less +4 -2
  14. package/es/common/Collapse/index.js +14 -4
  15. package/es/common/FontStyles/index.less +1 -1
  16. package/es/common/GroupList/index.js +4 -3
  17. package/es/common/ImageModal/index.js +31 -26
  18. package/es/common/ImageModal/index.less +6 -1
  19. package/es/common/ImgArea/components/Crop.js +267 -0
  20. package/es/common/ImgArea/components/Icons.js +44 -0
  21. package/es/common/ImgArea/components/MultiCrops.js +210 -0
  22. package/es/common/ImgArea/index.js +11 -0
  23. package/es/common/LinkModal/BundleCampaign/index.js +17 -17
  24. package/es/common/LinkModal/CustomTable/index.js +1 -0
  25. package/es/common/LinkModal/FilteredProductModal/index.js +3 -3
  26. package/es/common/LinkModal/FilteredProductModal/index.less +2 -3
  27. package/es/common/LinkModal/ProductDetailPage/index.js +3 -3
  28. package/es/common/LinkModal/index.less +1 -1
  29. package/es/common/MagicLink/index.js +89 -0
  30. package/es/common/MagicLink/index.less +0 -0
  31. package/es/common/ProductModal/index.js +1 -1
  32. package/es/common/ProductModal/index.less +12 -7
  33. package/es/common/UrlPicker/index.js +6 -2
  34. package/es/common/UrlPicker/index.less +12 -1
  35. package/es/common/index.js +8 -0
  36. package/es/composite-comp/bol/components/Banner/defaultJSON.js +10 -10
  37. package/es/composite-comp/bol/components/Banner/mobile/index.js +4 -10
  38. package/es/composite-comp/bol/components/Banner/pc/index.js +3 -6
  39. package/es/composite-comp/bol/components/Button/defaultJSON.js +40 -70
  40. package/es/composite-comp/bol/components/Button/index.js +8 -14
  41. package/es/composite-comp/bol/components/Button/index.less +1 -0
  42. package/es/composite-comp/bol/components/Carousel/defaultJSON.js +12 -16
  43. package/es/composite-comp/bol/components/Carousel/index.js +1 -6
  44. package/es/composite-comp/bol/components/Carousel/mobile/index.js +4 -8
  45. package/es/composite-comp/bol/components/Carousel/pc/index.js +15 -7
  46. package/es/composite-comp/bol/components/Carousel/pc/index.less +13 -5
  47. package/es/composite-comp/bol/components/ImageGallery/defaultJSON.js +2 -2
  48. package/es/composite-comp/bol/components/ImageText/defaultJSON.js +27 -167
  49. package/es/composite-comp/bol/components/ImageText/mobile/index.js +2 -5
  50. package/es/composite-comp/bol/components/ImageText/mobile/index.less +8 -8
  51. package/es/composite-comp/bol/components/ImageText/pc/index.js +46 -18
  52. package/es/composite-comp/bol/components/Newsletter/defaultJSON.js +2 -2
  53. package/es/composite-comp/bol/components/Newsletter/index.js +1 -6
  54. package/es/composite-comp/bol/components/Tag/defaultJSON.js +38 -48
  55. package/es/composite-comp/bol/components/Tag/index.js +8 -14
  56. package/es/composite-comp/bol/components/Tag/index.less +1 -0
  57. package/es/composite-comp/bol/components/Text/defaultJSON.js +4 -6
  58. package/es/composite-comp/bol/components/Text/index.js +4 -8
  59. package/es/composite-comp/bol/components/Text/index.less +3 -3
  60. package/es/composite-comp/bol/config-panels/BannerConfig/BannerConfigGroup/index.js +3 -1
  61. package/es/composite-comp/bol/config-panels/ButtonCompConfig/ButtonConfigGroup/index.js +141 -0
  62. package/es/composite-comp/bol/config-panels/ButtonCompConfig/ButtonConfigGroup/index.less +16 -0
  63. package/es/composite-comp/bol/config-panels/ButtonCompConfig/index.js +3 -3
  64. package/es/composite-comp/bol/config-panels/CarouselConfig/CarouselConfigImageGroup/index.js +4 -2
  65. package/es/composite-comp/bol/config-panels/CarouselConfig/index.js +1 -0
  66. package/es/composite-comp/bol/config-panels/ImageTextConfig/ImageTextConfigGroup/index.js +3 -1
  67. package/es/composite-comp/bol/config-panels/ImageTextConfig/index.js +2 -1
  68. package/es/composite-comp/bol/config-panels/NewsletterConfig/index.js +6 -4
  69. package/es/composite-comp/bol/config-panels/TagCompConfig/TagConfigContent/index.js +9 -17
  70. package/es/composite-comp/bol/config-panels/TagCompConfig/TagConfigGroup/index.js +141 -0
  71. package/es/composite-comp/bol/config-panels/TagCompConfig/TagConfigGroup/index.less +16 -0
  72. package/es/composite-comp/bol/config-panels/TagCompConfig/index.js +7 -4
  73. package/es/composite-comp/bol/config-panels/TextCompConfig/TextConfigGroup/index.js +3 -1
  74. package/es/composite-comp/bol/config-panels/TextCompConfig/imgs/layout1.png +0 -0
  75. package/es/composite-comp/bol/second-config-panels/ButtonSecondConfig/index.js +103 -0
  76. package/es/composite-comp/bol/second-config-panels/ButtonSecondConfig/index.less +3 -0
  77. package/es/composite-comp/bol/second-config-panels/CarouselSecondConfig/index.js +8 -13
  78. package/es/composite-comp/bol/second-config-panels/ImageTextSecondConfig/index.js +10 -5
  79. package/es/composite-comp/bol/second-config-panels/ImageTextSecondConfig/index.less +8 -0
  80. package/es/composite-comp/bol/{config-panels/ButtonCompConfig/ButtonConfigContent → second-config-panels/TagSecondConfig}/index.js +40 -38
  81. package/es/composite-comp/bol/second-config-panels/TagSecondConfig/index.less +3 -0
  82. package/es/composite-comp/common/components/ImageLabel/index.js +2 -2
  83. package/es/composite-comp/common/components/ImageLabel/index.less +6 -2
  84. package/es/composite-comp/common/components/ProductItem/index.js +1 -1
  85. package/es/composite-comp/common/components/ProductItem/index.less +9 -9
  86. package/es/composite-comp/common/config-panels/CustomizeConfig/index.js +24 -13
  87. package/es/composite-comp/common/config-panels/SpacingConfig/index.js +25 -25
  88. package/es/composite-comp/dito/components/FlashDeal/defaultJSON.js +62 -2
  89. package/es/composite-comp/dito/components/FlashDeal/index.js +5 -1
  90. package/es/composite-comp/dito/components/FlashDeal/mobile/index.less +0 -1
  91. package/es/composite-comp/dito/components/FlashDeal/pc/imgs/defImg1.png +0 -0
  92. package/es/composite-comp/dito/components/FlashDeal/pc/imgs/defImg2.png +0 -0
  93. package/es/composite-comp/dito/components/FlashDeal/pc/imgs/defImg3.png +0 -0
  94. package/es/composite-comp/dito/components/FlashDeal/pc/index.js +578 -0
  95. package/es/composite-comp/dito/components/FlashDeal/pc/index.less +121 -0
  96. package/es/composite-comp/dito/components/MobileNavigation/defaultJSON.js +5 -4
  97. package/es/composite-comp/dito/components/MobileNavigation/mobile/index.js +13 -3
  98. package/es/composite-comp/dito/components/MobileNavigation/mobile/index.less +3 -2
  99. package/es/composite-comp/dito/components/PcNavigation/defaultJSON.js +131 -0
  100. package/es/composite-comp/dito/components/PcNavigation/images/menu-icon.svg +6 -0
  101. package/es/composite-comp/dito/components/PcNavigation/index.js +85 -0
  102. package/es/composite-comp/dito/components/PcNavigation/pc/index.js +478 -0
  103. package/es/composite-comp/dito/components/PcNavigation/pc/index.less +98 -0
  104. package/es/composite-comp/dito/components/Recommend/defaultJSON.js +30 -12
  105. package/es/composite-comp/dito/components/Recommend/index.js +5 -6
  106. package/es/composite-comp/dito/components/Recommend/mobile/index.js +45 -37
  107. package/es/composite-comp/dito/components/Recommend/mobile/index.less +10 -2
  108. package/es/composite-comp/dito/components/Recommend/pc/index.js +134 -22
  109. package/es/composite-comp/dito/components/Recommend/pc/index.less +54 -12
  110. package/es/composite-comp/dito/components/SearchBar/defaultJSON.js +45 -19
  111. package/es/composite-comp/dito/components/SearchBar/index.js +7 -2
  112. package/es/composite-comp/dito/components/SearchBar/mobile/index.js +29 -26
  113. package/es/composite-comp/dito/components/SearchBar/mobile/index.less +13 -3
  114. package/es/composite-comp/dito/components/SearchBar/pc/index.js +151 -0
  115. package/es/composite-comp/dito/components/SearchBar/pc/index.less +59 -0
  116. package/es/composite-comp/dito/config-panels/FlashDealConfig/FlashDealConfigContent/index.js +16 -6
  117. package/es/composite-comp/dito/config-panels/FlashDealConfig/FlashDealConfigContent/index.less +20 -0
  118. package/es/composite-comp/dito/config-panels/FlashDealConfig/index.js +12 -2
  119. package/es/composite-comp/dito/config-panels/MobileNavigationConfig/MobileNavigationConfigGroup/index.js +3 -1
  120. package/es/composite-comp/dito/config-panels/PcNavigationConfig/PcNavConfigCategory/index.js +129 -0
  121. package/es/composite-comp/dito/config-panels/PcNavigationConfig/PcNavigationConfigGroup/index.js +128 -0
  122. package/es/composite-comp/dito/config-panels/PcNavigationConfig/TextOnlyFontConfig/index.js +222 -0
  123. package/es/composite-comp/dito/config-panels/PcNavigationConfig/index.js +194 -0
  124. package/es/composite-comp/dito/config-panels/RecommendConfig/index.js +16 -3
  125. package/es/composite-comp/dito/config-panels/SearchBarConfig/SearchBarConfigContent/index.js +140 -0
  126. package/es/composite-comp/dito/config-panels/SearchBarConfig/index.js +15 -51
  127. package/es/composite-comp/dito/second-config-panels/PcNavigationSecondConfig/index.js +102 -0
  128. package/es/composite-comp/dito/second-config-panels/RecommendSecondConfig/AIRecommendation/index.js +39 -29
  129. package/es/composite-comp/dito/second-config-panels/RecommendSecondConfig/index.js +80 -49
  130. package/es/composite-comp/dito/second-config-panels/RecommendSecondConfig/index.less +13 -1
  131. package/es/constants/component-types.js +13 -3
  132. package/es/constants/index.js +20 -2
  133. package/es/constants/layout.js +34 -8
  134. package/es/core/Designer/CompListPanel/index.js +8 -33
  135. package/es/core/Designer/ConfigPanel/TerminalSelect/index.js +73 -0
  136. package/es/core/Designer/ConfigPanel/TerminalSelect/index.less +29 -0
  137. package/es/core/Designer/ConfigPanel/index.js +72 -23
  138. package/es/core/Designer/ConfigPanel/index.less +4 -0
  139. package/es/core/Designer/History/index.js +34 -28
  140. package/es/core/Designer/PageCompList/index.js +13 -3
  141. package/es/core/Designer/PageCompList/index.less +10 -10
  142. package/es/core/Designer/QuickMenuBar/index.js +1 -1
  143. package/es/core/Designer/ViewArea/index.js +20 -6
  144. package/es/core/Designer/index.js +43 -37
  145. package/es/core/Renderer/index.js +21 -5
  146. package/es/decorator/compositeDecorator.js +45 -12
  147. package/es/decorator/index.js +8 -0
  148. package/es/decorator/metaDecorator.js +4 -3
  149. package/es/decorator/updateConfigDecorator.js +76 -0
  150. package/es/locale/en/en.json +14 -1
  151. package/es/locale/es/es.json +14 -1
  152. package/es/locale/id/id.json +14 -1
  153. package/es/meta-comp/components/Button/editable.js +114 -0
  154. package/es/meta-comp/components/Button/editable.less +6 -0
  155. package/es/meta-comp/components/Button/index.js +14 -33
  156. package/es/meta-comp/components/Button/index.less +3 -2
  157. package/es/meta-comp/components/Image/index.js +39 -8
  158. package/es/meta-comp/components/Image/index.less +7 -4
  159. package/es/meta-comp/components/Text/index.js +28 -11
  160. package/es/meta-comp/config-panels/BaseConfig.js +8 -10
  161. package/es/meta-comp/config-panels/ButtonConfig/index.js +2 -3
  162. package/es/meta-comp/config-panels/ImageConfig/AreaConfigModal/index.js +164 -0
  163. package/es/meta-comp/config-panels/ImageConfig/AreaConfigModal/index.less +26 -0
  164. package/es/meta-comp/config-panels/ImageConfig/HotAreaConfig/index.js +133 -0
  165. package/es/meta-comp/config-panels/ImageConfig/HotAreaConfig/index.less +17 -0
  166. package/es/meta-comp/config-panels/ImageConfig/index.js +17 -4
  167. package/es/meta-comp/config-panels/TextConfig/index.js +15 -6
  168. package/es/mobx/Store.js +6 -10
  169. package/es/utils/coreUtil.js +15 -2
  170. package/lib/assets/fonts/magic-box-iconfont.css +24 -12
  171. package/lib/assets/fonts/magic-box-iconfont.css.bak +24 -12
  172. package/lib/assets/fonts/magic-box-iconfont.js +1 -1
  173. package/lib/assets/fonts/magic-box-iconfont.js.bak +1 -1
  174. package/lib/assets/fonts/magic-box-iconfont.ttf +0 -0
  175. package/lib/assets/fonts/magic-box-iconfont.woff +0 -0
  176. package/lib/assets/fonts/magic-box-iconfont.woff2 +0 -0
  177. package/lib/assets/images/layout-icon/layout-navigation-normal.png +0 -0
  178. package/lib/assets/less/common.less +2 -2
  179. package/lib/assets/less/modal.less +7 -2
  180. package/lib/common/Button/index.js +2 -1
  181. package/lib/common/Button/index.less +5 -0
  182. package/lib/common/ButtonIconLayout/index.less +4 -2
  183. package/lib/common/Collapse/index.js +14 -4
  184. package/lib/common/FontStyles/index.less +1 -1
  185. package/lib/common/GroupList/index.js +4 -3
  186. package/lib/common/ImageModal/index.js +31 -26
  187. package/lib/common/ImageModal/index.less +6 -1
  188. package/lib/common/ImgArea/components/Crop.js +267 -0
  189. package/lib/common/ImgArea/components/Icons.js +44 -0
  190. package/lib/common/ImgArea/components/MultiCrops.js +210 -0
  191. package/lib/common/ImgArea/index.js +11 -0
  192. package/lib/common/LinkModal/BundleCampaign/index.js +17 -17
  193. package/lib/common/LinkModal/CustomTable/index.js +1 -0
  194. package/lib/common/LinkModal/FilteredProductModal/index.js +3 -3
  195. package/lib/common/LinkModal/FilteredProductModal/index.less +2 -3
  196. package/lib/common/LinkModal/ProductDetailPage/index.js +3 -3
  197. package/lib/common/LinkModal/index.less +1 -1
  198. package/lib/common/MagicLink/index.js +89 -0
  199. package/lib/common/MagicLink/index.less +0 -0
  200. package/lib/common/ProductModal/index.js +1 -1
  201. package/lib/common/ProductModal/index.less +12 -7
  202. package/lib/common/UrlPicker/index.js +6 -2
  203. package/lib/common/UrlPicker/index.less +12 -1
  204. package/lib/common/index.js +8 -0
  205. package/lib/composite-comp/bol/components/Banner/defaultJSON.js +10 -10
  206. package/lib/composite-comp/bol/components/Banner/mobile/index.js +4 -10
  207. package/lib/composite-comp/bol/components/Banner/pc/index.js +3 -6
  208. package/lib/composite-comp/bol/components/Button/defaultJSON.js +40 -70
  209. package/lib/composite-comp/bol/components/Button/index.js +8 -14
  210. package/lib/composite-comp/bol/components/Button/index.less +1 -0
  211. package/lib/composite-comp/bol/components/Carousel/defaultJSON.js +12 -16
  212. package/lib/composite-comp/bol/components/Carousel/index.js +1 -6
  213. package/lib/composite-comp/bol/components/Carousel/mobile/index.js +4 -8
  214. package/lib/composite-comp/bol/components/Carousel/pc/index.js +15 -7
  215. package/lib/composite-comp/bol/components/Carousel/pc/index.less +13 -5
  216. package/lib/composite-comp/bol/components/ImageGallery/defaultJSON.js +2 -2
  217. package/lib/composite-comp/bol/components/ImageText/defaultJSON.js +27 -167
  218. package/lib/composite-comp/bol/components/ImageText/mobile/index.js +2 -5
  219. package/lib/composite-comp/bol/components/ImageText/mobile/index.less +8 -8
  220. package/lib/composite-comp/bol/components/ImageText/pc/index.js +46 -18
  221. package/lib/composite-comp/bol/components/Newsletter/defaultJSON.js +2 -2
  222. package/lib/composite-comp/bol/components/Newsletter/index.js +1 -6
  223. package/lib/composite-comp/bol/components/Tag/defaultJSON.js +38 -48
  224. package/lib/composite-comp/bol/components/Tag/index.js +8 -14
  225. package/lib/composite-comp/bol/components/Tag/index.less +1 -0
  226. package/lib/composite-comp/bol/components/Text/defaultJSON.js +4 -6
  227. package/lib/composite-comp/bol/components/Text/index.js +4 -8
  228. package/lib/composite-comp/bol/components/Text/index.less +3 -3
  229. package/lib/composite-comp/bol/config-panels/BannerConfig/BannerConfigGroup/index.js +3 -1
  230. package/lib/composite-comp/bol/config-panels/ButtonCompConfig/ButtonConfigGroup/index.js +141 -0
  231. package/lib/composite-comp/bol/config-panels/ButtonCompConfig/ButtonConfigGroup/index.less +16 -0
  232. package/lib/composite-comp/bol/config-panels/ButtonCompConfig/index.js +3 -3
  233. package/lib/composite-comp/bol/config-panels/CarouselConfig/CarouselConfigImageGroup/index.js +4 -2
  234. package/lib/composite-comp/bol/config-panels/CarouselConfig/index.js +1 -0
  235. package/lib/composite-comp/bol/config-panels/ImageTextConfig/ImageTextConfigGroup/index.js +3 -1
  236. package/lib/composite-comp/bol/config-panels/ImageTextConfig/index.js +2 -1
  237. package/lib/composite-comp/bol/config-panels/NewsletterConfig/index.js +6 -4
  238. package/lib/composite-comp/bol/config-panels/TagCompConfig/TagConfigContent/index.js +9 -17
  239. package/lib/composite-comp/bol/config-panels/TagCompConfig/TagConfigGroup/index.js +141 -0
  240. package/lib/composite-comp/bol/config-panels/TagCompConfig/TagConfigGroup/index.less +16 -0
  241. package/lib/composite-comp/bol/config-panels/TagCompConfig/index.js +7 -4
  242. package/lib/composite-comp/bol/config-panels/TextCompConfig/TextConfigGroup/index.js +3 -1
  243. package/lib/composite-comp/bol/config-panels/TextCompConfig/imgs/layout1.png +0 -0
  244. package/lib/composite-comp/bol/second-config-panels/ButtonSecondConfig/index.js +103 -0
  245. package/lib/composite-comp/bol/second-config-panels/ButtonSecondConfig/index.less +3 -0
  246. package/lib/composite-comp/bol/second-config-panels/CarouselSecondConfig/index.js +8 -13
  247. package/lib/composite-comp/bol/second-config-panels/ImageTextSecondConfig/index.js +10 -5
  248. package/lib/composite-comp/bol/second-config-panels/ImageTextSecondConfig/index.less +8 -0
  249. package/lib/composite-comp/bol/{config-panels/ButtonCompConfig/ButtonConfigContent → second-config-panels/TagSecondConfig}/index.js +40 -38
  250. package/lib/composite-comp/bol/second-config-panels/TagSecondConfig/index.less +3 -0
  251. package/lib/composite-comp/common/components/ImageLabel/index.js +2 -2
  252. package/lib/composite-comp/common/components/ImageLabel/index.less +6 -2
  253. package/lib/composite-comp/common/components/ProductItem/index.js +1 -1
  254. package/lib/composite-comp/common/components/ProductItem/index.less +9 -9
  255. package/lib/composite-comp/common/config-panels/CustomizeConfig/index.js +24 -13
  256. package/lib/composite-comp/common/config-panels/SpacingConfig/index.js +25 -25
  257. package/lib/composite-comp/dito/components/FlashDeal/defaultJSON.js +62 -2
  258. package/lib/composite-comp/dito/components/FlashDeal/index.js +5 -1
  259. package/lib/composite-comp/dito/components/FlashDeal/mobile/index.less +0 -1
  260. package/lib/composite-comp/dito/components/FlashDeal/pc/imgs/defImg1.png +0 -0
  261. package/lib/composite-comp/dito/components/FlashDeal/pc/imgs/defImg2.png +0 -0
  262. package/lib/composite-comp/dito/components/FlashDeal/pc/imgs/defImg3.png +0 -0
  263. package/lib/composite-comp/dito/components/FlashDeal/pc/index.js +578 -0
  264. package/lib/composite-comp/dito/components/FlashDeal/pc/index.less +121 -0
  265. package/lib/composite-comp/dito/components/MobileNavigation/defaultJSON.js +5 -4
  266. package/lib/composite-comp/dito/components/MobileNavigation/mobile/index.js +13 -3
  267. package/lib/composite-comp/dito/components/MobileNavigation/mobile/index.less +3 -2
  268. package/lib/composite-comp/dito/components/PcNavigation/defaultJSON.js +131 -0
  269. package/lib/composite-comp/dito/components/PcNavigation/images/menu-icon.svg +6 -0
  270. package/lib/composite-comp/dito/components/PcNavigation/index.js +85 -0
  271. package/lib/composite-comp/dito/components/PcNavigation/pc/index.js +478 -0
  272. package/lib/composite-comp/dito/components/PcNavigation/pc/index.less +98 -0
  273. package/lib/composite-comp/dito/components/Recommend/defaultJSON.js +30 -12
  274. package/lib/composite-comp/dito/components/Recommend/index.js +5 -6
  275. package/lib/composite-comp/dito/components/Recommend/mobile/index.js +45 -37
  276. package/lib/composite-comp/dito/components/Recommend/mobile/index.less +10 -2
  277. package/lib/composite-comp/dito/components/Recommend/pc/index.js +134 -22
  278. package/lib/composite-comp/dito/components/Recommend/pc/index.less +54 -12
  279. package/lib/composite-comp/dito/components/SearchBar/defaultJSON.js +45 -19
  280. package/lib/composite-comp/dito/components/SearchBar/index.js +7 -2
  281. package/lib/composite-comp/dito/components/SearchBar/mobile/index.js +29 -26
  282. package/lib/composite-comp/dito/components/SearchBar/mobile/index.less +13 -3
  283. package/lib/composite-comp/dito/components/SearchBar/pc/index.js +151 -0
  284. package/lib/composite-comp/dito/components/SearchBar/pc/index.less +59 -0
  285. package/lib/composite-comp/dito/config-panels/FlashDealConfig/FlashDealConfigContent/index.js +16 -6
  286. package/lib/composite-comp/dito/config-panels/FlashDealConfig/FlashDealConfigContent/index.less +20 -0
  287. package/lib/composite-comp/dito/config-panels/FlashDealConfig/index.js +12 -2
  288. package/lib/composite-comp/dito/config-panels/MobileNavigationConfig/MobileNavigationConfigGroup/index.js +3 -1
  289. package/lib/composite-comp/dito/config-panels/PcNavigationConfig/PcNavConfigCategory/index.js +129 -0
  290. package/lib/composite-comp/dito/config-panels/PcNavigationConfig/PcNavigationConfigGroup/index.js +128 -0
  291. package/lib/composite-comp/dito/config-panels/PcNavigationConfig/TextOnlyFontConfig/index.js +222 -0
  292. package/lib/composite-comp/dito/config-panels/PcNavigationConfig/index.js +194 -0
  293. package/lib/composite-comp/dito/config-panels/RecommendConfig/index.js +16 -3
  294. package/lib/composite-comp/dito/config-panels/SearchBarConfig/SearchBarConfigContent/index.js +140 -0
  295. package/lib/composite-comp/dito/config-panels/SearchBarConfig/index.js +15 -51
  296. package/lib/composite-comp/dito/second-config-panels/PcNavigationSecondConfig/index.js +102 -0
  297. package/lib/composite-comp/dito/second-config-panels/RecommendSecondConfig/AIRecommendation/index.js +39 -29
  298. package/lib/composite-comp/dito/second-config-panels/RecommendSecondConfig/index.js +80 -49
  299. package/lib/composite-comp/dito/second-config-panels/RecommendSecondConfig/index.less +13 -1
  300. package/lib/constants/component-types.js +13 -3
  301. package/lib/constants/index.js +20 -2
  302. package/lib/constants/layout.js +34 -8
  303. package/lib/core/Designer/CompListPanel/index.js +8 -33
  304. package/lib/core/Designer/ConfigPanel/TerminalSelect/index.js +73 -0
  305. package/lib/core/Designer/ConfigPanel/TerminalSelect/index.less +29 -0
  306. package/lib/core/Designer/ConfigPanel/index.js +72 -23
  307. package/lib/core/Designer/ConfigPanel/index.less +4 -0
  308. package/lib/core/Designer/History/index.js +34 -28
  309. package/lib/core/Designer/PageCompList/index.js +13 -3
  310. package/lib/core/Designer/PageCompList/index.less +10 -10
  311. package/lib/core/Designer/QuickMenuBar/index.js +1 -1
  312. package/lib/core/Designer/ViewArea/index.js +20 -6
  313. package/lib/core/Designer/index.js +43 -37
  314. package/lib/core/Renderer/index.js +21 -5
  315. package/lib/decorator/compositeDecorator.js +45 -12
  316. package/lib/decorator/index.js +8 -0
  317. package/lib/decorator/metaDecorator.js +4 -3
  318. package/lib/decorator/updateConfigDecorator.js +76 -0
  319. package/lib/locale/en/en.json +14 -1
  320. package/lib/locale/es/es.json +14 -1
  321. package/lib/locale/id/id.json +14 -1
  322. package/lib/meta-comp/components/Button/editable.js +114 -0
  323. package/lib/meta-comp/components/Button/editable.less +6 -0
  324. package/lib/meta-comp/components/Button/index.js +14 -33
  325. package/lib/meta-comp/components/Button/index.less +3 -2
  326. package/lib/meta-comp/components/Image/index.js +39 -8
  327. package/lib/meta-comp/components/Image/index.less +7 -4
  328. package/lib/meta-comp/components/Text/index.js +28 -11
  329. package/lib/meta-comp/config-panels/BaseConfig.js +8 -10
  330. package/lib/meta-comp/config-panels/ButtonConfig/index.js +2 -3
  331. package/lib/meta-comp/config-panels/ImageConfig/AreaConfigModal/index.js +164 -0
  332. package/lib/meta-comp/config-panels/ImageConfig/AreaConfigModal/index.less +26 -0
  333. package/lib/meta-comp/config-panels/ImageConfig/HotAreaConfig/index.js +133 -0
  334. package/lib/meta-comp/config-panels/ImageConfig/HotAreaConfig/index.less +17 -0
  335. package/lib/meta-comp/config-panels/ImageConfig/index.js +17 -4
  336. package/lib/meta-comp/config-panels/TextConfig/index.js +15 -6
  337. package/lib/mobx/Store.js +6 -10
  338. package/lib/utils/coreUtil.js +15 -2
  339. package/package.json +5 -3
@@ -1,3 +1,15 @@
1
1
  .recommend_second_conf_wrap {
2
- width: 354px;
2
+
3
+ .sourceOfProduct {
4
+ border-top: 1px solid #D2D9E5;
5
+ padding-top: 20px;
6
+ padding-bottom: 10px;
7
+
8
+ .greyBg {
9
+ background: #F5F6F7;
10
+ border-radius: 6px;
11
+ padding: 12px;
12
+ padding-bottom: 1px;
13
+ }
14
+ }
3
15
  }
@@ -31,6 +31,8 @@ var _Recommend = _interopRequireDefault(require("../composite-comp/dito/componen
31
31
 
32
32
  var _MobileNavigation = _interopRequireDefault(require("../composite-comp/dito/components/MobileNavigation"));
33
33
 
34
+ var _PcNavigation = _interopRequireDefault(require("../composite-comp/dito/components/PcNavigation"));
35
+
34
36
  var _BannerConfig = _interopRequireDefault(require("../composite-comp/bol/config-panels/BannerConfig"));
35
37
 
36
38
  var _DividerConfig = _interopRequireDefault(require("../composite-comp/bol/config-panels/DividerConfig"));
@@ -57,6 +59,8 @@ var _RecommendConfig = _interopRequireDefault(require("../composite-comp/dito/co
57
59
 
58
60
  var _MobileNavigationConfig = _interopRequireDefault(require("../composite-comp/dito/config-panels/MobileNavigationConfig"));
59
61
 
62
+ var _PcNavigationConfig = _interopRequireDefault(require("../composite-comp/dito/config-panels/PcNavigationConfig"));
63
+
60
64
  var _BannerSecondConfig = _interopRequireDefault(require("../composite-comp/bol/second-config-panels/BannerSecondConfig"));
61
65
 
62
66
  var _TextSecondConfig = _interopRequireDefault(require("../composite-comp/bol/second-config-panels/TextSecondConfig"));
@@ -69,6 +73,12 @@ var _RecommendSecondConfig = _interopRequireDefault(require("../composite-comp/d
69
73
 
70
74
  var _MobileNavigationSecondConfig = _interopRequireDefault(require("../composite-comp/dito/second-config-panels/MobileNavigationSecondConfig"));
71
75
 
76
+ var _TagSecondConfig = _interopRequireDefault(require("../composite-comp/bol/second-config-panels/TagSecondConfig"));
77
+
78
+ var _ButtonSecondConfig = _interopRequireDefault(require("../composite-comp/bol/second-config-panels/ButtonSecondConfig"));
79
+
80
+ var _PcNavigationSecondConfig = _interopRequireDefault(require("../composite-comp/dito/second-config-panels/PcNavigationSecondConfig"));
81
+
72
82
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
73
83
 
74
84
  var _a, _b, _c; // 组件
@@ -77,17 +87,17 @@ var _a, _b, _c; // 组件
77
87
  /**
78
88
  * 渲染组件索引
79
89
  */
80
- var componentMap = (_a = {}, _a[_Banner["default"].type] = _Banner["default"], _a[_Text["default"].type] = _Text["default"], _a[_FlashDeal["default"].type] = _FlashDeal["default"], _a[_SearchBar["default"].type] = _SearchBar["default"], _a[_ImageText["default"].type] = _ImageText["default"], _a[_Recommend["default"].type] = _Recommend["default"], _a[_MobileNavigation["default"].type] = _MobileNavigation["default"], _a[_Divider["default"].type] = _Divider["default"], _a[_ImageGallery["default"].type] = _ImageGallery["default"], _a[_Newsletter["default"].type] = _Newsletter["default"], _a[_Carousel["default"].type] = _Carousel["default"], _a[_Button["default"].type] = _Button["default"], _a[_Tag["default"].type] = _Tag["default"], _a);
90
+ var componentMap = (_a = {}, _a[_Banner["default"].type] = _Banner["default"], _a[_Text["default"].type] = _Text["default"], _a[_FlashDeal["default"].type] = _FlashDeal["default"], _a[_SearchBar["default"].type] = _SearchBar["default"], _a[_ImageText["default"].type] = _ImageText["default"], _a[_Recommend["default"].type] = _Recommend["default"], _a[_MobileNavigation["default"].type] = _MobileNavigation["default"], _a[_PcNavigation["default"].type] = _PcNavigation["default"], _a[_Divider["default"].type] = _Divider["default"], _a[_ImageGallery["default"].type] = _ImageGallery["default"], _a[_Newsletter["default"].type] = _Newsletter["default"], _a[_Carousel["default"].type] = _Carousel["default"], _a[_Button["default"].type] = _Button["default"], _a[_Tag["default"].type] = _Tag["default"], _a);
81
91
  /**
82
92
  * 一级配置面板索引
83
93
  */
84
94
 
85
95
  exports.componentMap = componentMap;
86
- var configPanelMap = (_b = {}, _b[_Banner["default"].type] = _BannerConfig["default"], _b[_Text["default"].type] = _TextCompConfig["default"], _b[_FlashDeal["default"].type] = _FlashDealConfig["default"], _b[_SearchBar["default"].type] = _SearchBarConfig["default"], _b[_ImageText["default"].type] = _ImageTextConfig["default"], _b[_Recommend["default"].type] = _RecommendConfig["default"], _b[_MobileNavigation["default"].type] = _MobileNavigationConfig["default"], _b[_Divider["default"].type] = _DividerConfig["default"], _b[_ImageGallery["default"].type] = _ImageGalleryConfig["default"], _b[_Newsletter["default"].type] = _NewsletterConfig["default"], _b[_Carousel["default"].type] = _CarouselConfig["default"], _b[_Button["default"].type] = _ButtonCompConfig["default"], _b[_Tag["default"].type] = _TagCompConfig["default"], _b);
96
+ var configPanelMap = (_b = {}, _b[_Banner["default"].type] = _BannerConfig["default"], _b[_Text["default"].type] = _TextCompConfig["default"], _b[_FlashDeal["default"].type] = _FlashDealConfig["default"], _b[_SearchBar["default"].type] = _SearchBarConfig["default"], _b[_ImageText["default"].type] = _ImageTextConfig["default"], _b[_Recommend["default"].type] = _RecommendConfig["default"], _b[_MobileNavigation["default"].type] = _MobileNavigationConfig["default"], _b[_PcNavigation["default"].type] = _PcNavigationConfig["default"], _b[_Divider["default"].type] = _DividerConfig["default"], _b[_ImageGallery["default"].type] = _ImageGalleryConfig["default"], _b[_Newsletter["default"].type] = _NewsletterConfig["default"], _b[_Carousel["default"].type] = _CarouselConfig["default"], _b[_Button["default"].type] = _ButtonCompConfig["default"], _b[_Tag["default"].type] = _TagCompConfig["default"], _b);
87
97
  /**
88
98
  * 二级配置面板索引
89
99
  */
90
100
 
91
101
  exports.configPanelMap = configPanelMap;
92
- var secondConfigPanelMap = (_c = {}, _c[_Banner["default"].type] = _BannerSecondConfig["default"], _c[_Text["default"].type] = _TextSecondConfig["default"], _c[_ImageText["default"].type] = _ImageTextSecondConfig["default"], _c[_Recommend["default"].type] = _RecommendSecondConfig["default"], _c[_MobileNavigation["default"].type] = _MobileNavigationSecondConfig["default"], _c[_Carousel["default"].type] = _CarouselSecondConfig["default"], _c);
102
+ var secondConfigPanelMap = (_c = {}, _c[_Banner["default"].type] = _BannerSecondConfig["default"], _c[_Text["default"].type] = _TextSecondConfig["default"], _c[_ImageText["default"].type] = _ImageTextSecondConfig["default"], _c[_Recommend["default"].type] = _RecommendSecondConfig["default"], _c[_MobileNavigation["default"].type] = _MobileNavigationSecondConfig["default"], _c[_PcNavigation["default"].type] = _PcNavigationSecondConfig["default"], _c[_Carousel["default"].type] = _CarouselSecondConfig["default"], _c[_Tag["default"].type] = _TagSecondConfig["default"], _c[_Button["default"].type] = _ButtonSecondConfig["default"], _c);
93
103
  exports.secondConfigPanelMap = secondConfigPanelMap;
@@ -3,7 +3,7 @@
3
3
  Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
- exports.urlType = exports.respCodeMap = exports.quickMenuCode = exports.metaType = exports.metaInst = exports.metaInsType = exports.magicMode = exports.deviceTypeMap = exports.compInfoMap = exports.STORAGE_KEY = void 0;
6
+ exports.urlType = exports.respCodeMap = exports.quickMenuCode = exports.metaType = exports.metaInst = exports.metaInsType = exports.magicMode = exports.eventType = exports.deviceTypeWidthMap = exports.deviceTypeMap = exports.compInfoMap = exports.STORAGE_KEY = void 0;
7
7
  var STORAGE_KEY = {
8
8
  LOCALE: 'magicLocale'
9
9
  };
@@ -27,6 +27,11 @@ var deviceTypeMap = {
27
27
  PHONE: 'mobile'
28
28
  };
29
29
  exports.deviceTypeMap = deviceTypeMap;
30
+ var deviceTypeWidthMap = {
31
+ pc: 1240,
32
+ mobile: 375
33
+ };
34
+ exports.deviceTypeWidthMap = deviceTypeWidthMap;
30
35
  var magicMode = {
31
36
  DESIGNER: 'designer',
32
37
  RENDERER: 'renderer'
@@ -94,6 +99,10 @@ var compInfoMap = {
94
99
  MOBILE_NAVIGATION: {
95
100
  name: 'Mobile Navigation',
96
101
  icon: 'icon-navigation'
102
+ },
103
+ PC_NAVIGATION: {
104
+ name: 'PC Navigation',
105
+ icon: 'icon-navigation'
97
106
  }
98
107
  };
99
108
  /**
@@ -149,4 +158,13 @@ var metaInst = {
149
158
  type: metaType.BUTTON
150
159
  }
151
160
  };
152
- exports.metaInst = metaInst;
161
+ /**
162
+ * 全局事件类型
163
+ */
164
+
165
+ exports.metaInst = metaInst;
166
+ var eventType = {
167
+ // 二级配置面板返回时,更新一级面板事件
168
+ UPDATE_FIRST_CONFIG: 'update-first-config'
169
+ };
170
+ exports.eventType = eventType;
@@ -3,7 +3,7 @@
3
3
  Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
- exports.searchLayout = exports.recommendLayoutPc = exports.recommendLayoutMobile = exports.newsletterLayout = exports.mobileNavigationLayout = exports.imageTextLayoutPc = exports.imageTextLayoutMobile = exports.imageGalleryLayout = exports.dividerLayout = exports.carouselLayout = void 0;
6
+ exports.searchLayout = exports.recommendLayoutPc = exports.recommendLayoutMobile = exports.pcNavigationLayout = exports.newsletterLayout = exports.mobileNavigationLayout = exports.imageTextLayoutPc = exports.imageTextLayoutMobile = exports.imageGalleryLayout = exports.dividerLayout = exports.carouselLayout = void 0;
7
7
 
8
8
  var _dividerLayout = _interopRequireDefault(require("../assets/images/layout-icon/dividerLayout.svg"));
9
9
 
@@ -39,16 +39,20 @@ var _newsletter = _interopRequireDefault(require("../assets/images/layout-icon/n
39
39
 
40
40
  var _layoutRecommend = _interopRequireDefault(require("../assets/images/layout-icon/layout-recommend-1.png"));
41
41
 
42
- var _layoutRecommend2 = _interopRequireDefault(require("../assets/images/layout-icon/layout-recommend-3.png"));
42
+ var _layoutRecommend2 = _interopRequireDefault(require("../assets/images/layout-icon/layout-recommend-2.png"));
43
43
 
44
- var _layoutRecommend3 = _interopRequireDefault(require("../assets/images/layout-icon/layout-recommend-4.png"));
44
+ var _layoutRecommend3 = _interopRequireDefault(require("../assets/images/layout-icon/layout-recommend-3.png"));
45
45
 
46
- var _layoutRecommend4 = _interopRequireDefault(require("../assets/images/layout-icon/layout-recommend-5.png"));
46
+ var _layoutRecommend4 = _interopRequireDefault(require("../assets/images/layout-icon/layout-recommend-4.png"));
47
+
48
+ var _layoutRecommend5 = _interopRequireDefault(require("../assets/images/layout-icon/layout-recommend-5.png"));
47
49
 
48
50
  var _layoutNavigationNewline = _interopRequireDefault(require("../assets/images/layout-icon/layout-navigation-newline.png"));
49
51
 
50
52
  var _layoutNavigationTile = _interopRequireDefault(require("../assets/images/layout-icon/layout-navigation-tile.png"));
51
53
 
54
+ var _layoutNavigationNormal = _interopRequireDefault(require("../assets/images/layout-icon/layout-navigation-normal.png"));
55
+
52
56
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
53
57
 
54
58
  // import p3 from '../assets/images/layout-icon/layout-imagetext-p3.png';
@@ -134,20 +138,36 @@ var recommendLayoutMobile = [{
134
138
  id: 'layout1',
135
139
  name: 'layout1',
136
140
  image: _layoutRecommend["default"]
141
+ }, {
142
+ id: 'layout2',
143
+ name: 'layout2',
144
+ image: _layoutRecommend2["default"]
145
+ }, {
146
+ id: 'layout3',
147
+ name: 'layout3',
148
+ image: _layoutRecommend3["default"]
149
+ }, {
150
+ id: 'layout4',
151
+ name: 'layout4',
152
+ image: _layoutRecommend4["default"]
153
+ }, {
154
+ id: 'layout5',
155
+ name: 'layout5',
156
+ image: _layoutRecommend5["default"]
137
157
  }];
138
158
  exports.recommendLayoutMobile = recommendLayoutMobile;
139
159
  var recommendLayoutPc = [{
140
160
  id: 'layout1',
141
161
  name: 'layout1',
142
- image: _layoutRecommend2["default"]
162
+ image: _layoutRecommend3["default"]
143
163
  }, {
144
164
  id: 'layout2',
145
165
  name: 'layout2',
146
- image: _layoutRecommend3["default"]
166
+ image: _layoutRecommend4["default"]
147
167
  }, {
148
168
  id: 'layout3',
149
169
  name: 'layout3',
150
- image: _layoutRecommend4["default"]
170
+ image: _layoutRecommend5["default"]
151
171
  }];
152
172
  exports.recommendLayoutPc = recommendLayoutPc;
153
173
  var mobileNavigationLayout = [{
@@ -159,4 +179,10 @@ var mobileNavigationLayout = [{
159
179
  name: 'tile',
160
180
  image: _layoutNavigationTile["default"]
161
181
  }];
162
- exports.mobileNavigationLayout = mobileNavigationLayout;
182
+ exports.mobileNavigationLayout = mobileNavigationLayout;
183
+ var pcNavigationLayout = [{
184
+ id: 'normal',
185
+ name: 'normal',
186
+ image: _layoutNavigationNormal["default"]
187
+ }];
188
+ exports.pcNavigationLayout = pcNavigationLayout;
@@ -19,6 +19,8 @@ require("./index.less");
19
19
 
20
20
  var _locale = require("../../../locale");
21
21
 
22
+ var _coreUtil = require("../../../utils/coreUtil");
23
+
22
24
  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); }
23
25
 
24
26
  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; }
@@ -114,10 +116,12 @@ function (_super) {
114
116
  }, /*#__PURE__*/_react["default"].createElement("h5", {
115
117
  className: "cat-name"
116
118
  }, compCat, "(", "" + compSource[compCat].length, ")"), compSource[compCat].map(function (comp) {
117
- return /*#__PURE__*/_react["default"].createElement(_CompCard["default"], _extends({}, comp, {
119
+ return (0, _coreUtil.isActiveFloor)(comp.terminalType) ? /*#__PURE__*/_react["default"].createElement(_CompCard["default"], _extends({}, comp, {
118
120
  key: comp.moduleId,
119
- onAdd: _this.onAddClick
120
- }));
121
+ onAdd: function onAdd() {
122
+ return _this.onAddClick(comp);
123
+ }
124
+ })) : null;
121
125
  }));
122
126
  })));
123
127
  };
@@ -125,34 +129,5 @@ function (_super) {
125
129
  return CompListPanel;
126
130
  }(_react.Component);
127
131
 
128
- var _default = CompListPanel; // export default function CompListPanel({ visible, onClose, compSource, onAdd }) {
129
- // useEffect(() => {
130
- // if (visible) {
131
- // document.getElementsByClassName('component-list')[0].scrollTop = 0;
132
- // }
133
- // }, [visible]);
134
- // return (
135
- // <div className={classNames('compListPanel', { visible })}>
136
- // <header className="header">
137
- // <Button icon="icon-close" onClick={onClose} type="icon" />
138
- // </header>
139
- // <h2 className="title">{i18n('ADD_COMPONENT')}</h2>
140
- // <div className="component-list">
141
- // {
142
- // Object.keys(compSource).map(compCat => (
143
- // <div key={compCat} className="cat-list">
144
- // <h5 className="cat-name">{compCat}({`${compSource[compCat].length}`})</h5>
145
- // {
146
- // compSource[compCat].map(comp => (
147
- // <CompCard {...comp} key={comp.moduleId} onAdd={onAdd} />
148
- // ))
149
- // }
150
- // </div>
151
- // ))
152
- // }
153
- // </div>
154
- // </div>
155
- // );
156
- // }
157
-
132
+ var _default = CompListPanel;
158
133
  exports["default"] = _default;
@@ -0,0 +1,73 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports["default"] = TerminalSelect;
7
+
8
+ var _react = _interopRequireDefault(require("react"));
9
+
10
+ var _common = require("../../../../common");
11
+
12
+ require("./index.less");
13
+
14
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
15
+
16
+ function TerminalSelect(_a) {
17
+ var value = _a.value,
18
+ onChange = _a.onChange,
19
+ terminalType = _a.terminalType;
20
+ var isActiveMobile = !value || ['MOBILE', 'ALL'].includes(value);
21
+ var isActivePc = !value || ['PC', 'ALL'].includes(value);
22
+
23
+ var onTerminalClick = function onTerminalClick(terminal) {
24
+ // 至少选中一种终端
25
+ if (value === terminal) {
26
+ return;
27
+ }
28
+
29
+ if (!value || value === 'ALL') {
30
+ if (terminal === 'PC') {
31
+ onChange('MOBILE');
32
+ } else {
33
+ onChange('PC');
34
+ }
35
+ } else {
36
+ onChange('ALL');
37
+ }
38
+ };
39
+
40
+ return /*#__PURE__*/_react["default"].createElement("div", {
41
+ className: "terminal_wrap"
42
+ }, ['MOBILE', 'ALL', undefined, null].includes(terminalType) && /*#__PURE__*/_react["default"].createElement("div", {
43
+ className: "terminal_item",
44
+ onClick: function onClick() {
45
+ return onTerminalClick('MOBILE');
46
+ }
47
+ }, /*#__PURE__*/_react["default"].createElement(_common.Iconfont, {
48
+ color: isActiveMobile ? '#2F54EB' : '#C4C4C4',
49
+ size: 20,
50
+ type: "icon-mobile"
51
+ }), /*#__PURE__*/_react["default"].createElement("span", {
52
+ className: "select"
53
+ }, /*#__PURE__*/_react["default"].createElement(_common.Iconfont, {
54
+ color: isActiveMobile ? '#00AC5A' : '#A3AEC3',
55
+ size: 9,
56
+ type: "icon-select"
57
+ }))), ['PC', 'ALL', undefined, null].includes(terminalType) && /*#__PURE__*/_react["default"].createElement("div", {
58
+ className: "terminal_item",
59
+ onClick: function onClick() {
60
+ return onTerminalClick('PC');
61
+ }
62
+ }, /*#__PURE__*/_react["default"].createElement(_common.Iconfont, {
63
+ color: isActivePc ? '#2F54EB' : '#C4C4C4',
64
+ size: 20,
65
+ type: "icon-pc"
66
+ }), /*#__PURE__*/_react["default"].createElement("span", {
67
+ className: "select"
68
+ }, /*#__PURE__*/_react["default"].createElement(_common.Iconfont, {
69
+ color: isActivePc ? '#00AC5A' : '#A3AEC3',
70
+ size: 9,
71
+ type: "icon-select"
72
+ }))));
73
+ }
@@ -0,0 +1,29 @@
1
+ .terminal_wrap {
2
+ display: flex;
3
+ .terminal_item {
4
+ position: relative;
5
+ display: flex;
6
+ align-items: center;
7
+ justify-content: center;
8
+ width: 24px;
9
+ height: 24px;
10
+ background-color: #EDF0F4;
11
+ border-radius: 2px;
12
+ cursor: pointer;
13
+ .select {
14
+ position: absolute;
15
+ right: -4px;
16
+ top: -4px;
17
+ line-height: 0;
18
+ }
19
+ }
20
+ .terminal_item + .terminal_item {
21
+ margin-left: 16px;
22
+ }
23
+ .active {
24
+ background-color: #2F54EB;
25
+ }
26
+ }
27
+ .terminal_wrap+ span {
28
+ margin-left: 14px;
29
+ }
@@ -9,6 +9,8 @@ exports["default"] = void 0;
9
9
 
10
10
  var _react = _interopRequireWildcard(require("react"));
11
11
 
12
+ var _TerminalSelect = _interopRequireDefault(require("./TerminalSelect"));
13
+
12
14
  var _coreUtil = require("../../../utils/coreUtil");
13
15
 
14
16
  var _commonUtil = require("../../../utils/commonUtil");
@@ -72,6 +74,34 @@ function (_super) {
72
74
  selectedNode: {}
73
75
  };
74
76
 
77
+ _this.resetState = function (propsData, clickedFloor) {
78
+ var pageData = propsData.pageData;
79
+ var selectedNode = pageData.find(function (floor) {
80
+ return floor.id === clickedFloor;
81
+ });
82
+
83
+ _this.setState({
84
+ clickedGroup: _mobx.store.clickedGroup,
85
+ selectedNode: selectedNode
86
+ }); // 展开一级面板
87
+
88
+
89
+ if (selectedNode) {
90
+ _this.openConfig();
91
+ } else {
92
+ _this.closeConfig();
93
+ } // 展开二级面板
94
+
95
+
96
+ if (!_mobx.store.clickedGroup && _this.preClickedGroup) {
97
+ _this.closeSecConfig();
98
+ } else if (Boolean(_mobx.store.clickedGroup) != Boolean(_this.preClickedGroup)) {
99
+ _this.openSecConfig();
100
+ }
101
+
102
+ _this.preClickedGroup = _mobx.store.clickedGroup;
103
+ };
104
+
75
105
  _this.animation = function (type) {
76
106
  document.getElementsByClassName('config_wrap')[0].setAttribute('style', "animation-name:" + type + ";animation-duration: 0.3s;animation-fill-mode:both");
77
107
  };
@@ -157,6 +187,13 @@ function (_super) {
157
187
  device: device
158
188
  };
159
189
  var instance = Clazz ? /*#__PURE__*/_react["default"].createElement(Clazz, panelProps) : null;
190
+
191
+ if (!instance) {
192
+ _mobx.store.setState({
193
+ clickedFloor: null
194
+ });
195
+ }
196
+
160
197
  return instance;
161
198
  };
162
199
 
@@ -209,11 +246,15 @@ function (_super) {
209
246
  break;
210
247
 
211
248
  case 'MOBILE_NAVIGATION':
249
+ case 'PC_NAVIGATION':
212
250
  groupName = ((_f = panelProps.groupName) === null || _f === void 0 ? void 0 : _f.title.text) || (0, _locale.i18n)('NAVIGATION_NAME');
213
251
  break;
214
252
 
215
253
  case 'RECOMMEND':
216
254
  groupName = panelProps.groupName.text;
255
+
256
+ case 'TAG':
257
+ groupName = '';
217
258
  }
218
259
 
219
260
  return groupName || 'Group Name';
@@ -223,40 +264,41 @@ function (_super) {
223
264
  _mobx.store.setState({
224
265
  clickedGroup: null
225
266
  });
226
- };
227
267
 
228
- return _this;
229
- }
230
-
231
- ConfigPanel.prototype.componentDidMount = function () {
232
- var _this = this;
268
+ window.document.dispatchEvent(new Event(_constants.eventType.UPDATE_FIRST_CONFIG, {
269
+ bubbles: false
270
+ }));
271
+ };
233
272
 
234
- this.distroy = (0, _mobx.autorun)(function () {
235
- var selectedNode = _mobx.store.getFloorInfo();
273
+ _this.onTerminalChange = function (terminal) {
274
+ var selectedNode = _this.state.selectedNode;
275
+ selectedNode.activeTerminal = terminal;
236
276
 
237
277
  _this.setState({
238
- clickedGroup: _mobx.store.clickedGroup,
239
278
  selectedNode: selectedNode
240
- }); // 展开以及面板
279
+ }); // 刷新页面组件列表 和 viewArea
241
280
 
242
281
 
243
- if (selectedNode) {
244
- _this.openConfig();
245
- } else {
246
- _this.closeConfig();
247
- } // 展开首期二级面板
282
+ (0, _coreUtil.renderPreview)();
283
+ };
248
284
 
285
+ return _this;
286
+ }
249
287
 
250
- if (!_mobx.store.clickedGroup) {
251
- _this.closeSecConfig();
252
- } else if (_mobx.store.clickedGroup !== _this.preClickedGroup) {
253
- _this.openSecConfig();
254
- }
288
+ ConfigPanel.prototype.componentDidMount = function () {
289
+ var _this = this;
255
290
 
256
- _this.preClickedGroup = _mobx.store.clickedGroup;
291
+ this.distroy = (0, _mobx.autorun)(function () {
292
+ _this.resetState(_this.props, _mobx.store.clickedFloor);
257
293
  });
258
294
  };
259
295
 
296
+ ConfigPanel.prototype.componentWillReceiveProps = function (nextProps) {
297
+ if (JSON.stringify(this.props) !== JSON.stringify(nextProps)) {
298
+ this.resetState(nextProps, _mobx.store.clickedFloor);
299
+ }
300
+ };
301
+
260
302
  ConfigPanel.prototype.componentWillUnmount = function () {
261
303
  this.distroy();
262
304
  };
@@ -275,10 +317,17 @@ function (_super) {
275
317
  }, /*#__PURE__*/_react["default"].createElement("span", {
276
318
  className: "title",
277
319
  title: (_a = _constants.compInfoMap[selectedNode === null || selectedNode === void 0 ? void 0 : selectedNode.type]) === null || _a === void 0 ? void 0 : _a.name
278
- }, (_b = _constants.compInfoMap[selectedNode === null || selectedNode === void 0 ? void 0 : selectedNode.type]) === null || _b === void 0 ? void 0 : _b.name), device === _constants.deviceTypeMap.PC && /*#__PURE__*/_react["default"].createElement(_Button["default"], {
320
+ }, (_b = _constants.compInfoMap[selectedNode === null || selectedNode === void 0 ? void 0 : selectedNode.type]) === null || _b === void 0 ? void 0 : _b.name), /*#__PURE__*/_react["default"].createElement("div", {
321
+ className: "right_wrap"
322
+ }, /*#__PURE__*/_react["default"].createElement(_TerminalSelect["default"], {
323
+ onChange: this.onTerminalChange,
324
+ terminalType: selectedNode === null || selectedNode === void 0 ? void 0 : selectedNode.terminalType,
325
+ value: selectedNode === null || selectedNode === void 0 ? void 0 : selectedNode.activeTerminal
326
+ }), device === _constants.deviceTypeMap.PC && /*#__PURE__*/_react["default"].createElement(_Button["default"], {
279
327
  onClick: this.onDoneClick,
328
+ size: "small",
280
329
  type: "light"
281
- }, (0, _locale.i18n)('DONE'))), this.getConfigPanelInstance()), /*#__PURE__*/_react["default"].createElement("div", {
330
+ }, (0, _locale.i18n)('DONE')))), this.getConfigPanelInstance()), /*#__PURE__*/_react["default"].createElement("div", {
282
331
  className: "sec_config_wrap"
283
332
  }, /*#__PURE__*/_react["default"].createElement("div", {
284
333
  className: "config_header"
@@ -39,6 +39,10 @@
39
39
  line-height: 32px;
40
40
  color: #232F46;
41
41
  }
42
+ .right_wrap {
43
+ display: flex;
44
+ align-items: center;
45
+ }
42
46
  }
43
47
  }
44
48
 
@@ -7,6 +7,8 @@ exports["default"] = void 0;
7
7
 
8
8
  var _cloneDeep = _interopRequireDefault(require("lodash/cloneDeep"));
9
9
 
10
+ var _lodash = require("lodash");
11
+
10
12
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
11
13
 
12
14
  /**
@@ -14,24 +16,25 @@ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "d
14
16
  * 有新的操作时存入数组的0位置,游标设置为0
15
17
  *
16
18
  */
17
- var debug = require('debug')('worker:History');
18
-
19
19
  var History =
20
20
  /** @class */
21
21
  function () {
22
22
  function History(hist) {
23
23
  var _this = this;
24
24
  /**
25
- * 游标位置
26
- */
25
+ * 游标位置
26
+ */
27
27
 
28
28
 
29
29
  this.cursor = 0;
30
30
  /**
31
- * 历史数据
32
- */
31
+ * 历史数据
32
+ */
33
33
 
34
34
  this.list = [];
35
+ /** 前进或者后退步数 */
36
+
37
+ this.step = 0;
35
38
 
36
39
  this.redoAble = function () {
37
40
  return _this.cursor !== 0;
@@ -41,47 +44,50 @@ function () {
41
44
  return _this.cursor !== _this.list.length - 1;
42
45
  };
43
46
  /**
44
- * 清空0~cursor之间的数据,将data插入 位置0
45
- */
47
+ * 清空0~cursor之间的数据,将data插入 位置0
48
+ */
46
49
 
47
50
 
48
51
  this.push = function (data) {
49
- debug('push data', data);
50
52
  var cloneData = (0, _cloneDeep["default"])(data);
51
53
 
52
54
  _this.list.splice(0, _this.cursor, cloneData);
53
55
 
56
+ _this.cursor = 0;
54
57
  return data;
55
58
  };
56
59
  /**
57
- * redu操作只修改当前游标-1
58
- * 并且返回后一步的json对象
59
- */
60
+ * redu操作只修改当前游标-1
61
+ * 并且返回后一步的json对象
62
+ */
60
63
 
61
64
 
62
- this.redo = function () {
63
- debug('redo click');
64
- var newCursor = _this.cursor - 1;
65
- _this.cursor = newCursor;
66
- var newData = _this.list[newCursor];
67
- return newData;
65
+ this.redo = function (callback) {
66
+ _this.step -= 1;
67
+
68
+ _this.doAction(callback);
68
69
  };
69
70
  /**
70
- * undo操作只修改当前的游标+1
71
- * 并且返回前一步的json对象
72
- */
71
+ * undo操作只修改当前的游标+1
72
+ * 并且返回前一步的json对象
73
+ */
73
74
 
74
75
 
75
- this.undo = function () {
76
- debug('undo click');
77
- var newCursor = _this.cursor + 1;
78
- _this.cursor = newCursor;
79
- var newData = _this.list[newCursor];
80
- return newData;
76
+ this.undo = function (callback) {
77
+ _this.step += 1;
78
+
79
+ _this.doAction(callback);
81
80
  };
82
81
 
82
+ this.doAction = (0, _lodash.debounce)(function (callback) {
83
+ var newCursor = _this.cursor + _this.step;
84
+ _this.cursor = newCursor;
85
+ var newData = (0, _cloneDeep["default"])(_this.list[newCursor]);
86
+ _this.step = 0;
87
+ callback(newData);
88
+ }, 300);
83
89
  this.cursor = 0;
84
- this.list = [hist];
90
+ this.list = [(0, _cloneDeep["default"])(hist)];
85
91
  }
86
92
 
87
93
  return History;