@fonixtree/magic-design 0.1.93 → 0.2.2

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 (247) hide show
  1. package/es/assets/fonts/magic-box-iconfont.css +7 -35
  2. package/es/assets/fonts/magic-box-iconfont.css.bak +4 -8
  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/less/button.less +0 -5
  9. package/es/common/AffiliateProductModal/index.js +1 -1
  10. package/es/common/AffiliateProductModal/index.less +1 -1
  11. package/es/common/Button/index.less +1 -0
  12. package/es/common/CountDown/index.js +11 -20
  13. package/es/common/GroupList/index.js +2 -7
  14. package/es/common/LinkModal/BundleCampaign/index.js +2 -2
  15. package/es/common/LinkModal/CouponTable/index.js +1 -1
  16. package/es/common/LinkModal/CustomTable/index.js +0 -1
  17. package/es/common/LinkModal/FilteredProductModal/index.js +106 -82
  18. package/es/common/LinkModal/FilteredProductModal/index.less +0 -1
  19. package/es/common/LinkModal/ProductDetailPage/index.js +60 -115
  20. package/es/common/LinkModal/ProductDetailPage/index.less +1 -6
  21. package/es/common/LinkModal/SelectVideoModal/index.js +2 -3
  22. package/es/common/LinkModal/index.js +5 -20
  23. package/es/common/MagicLink/index.js +2 -2
  24. package/es/common/ProductModal/index.js +124 -181
  25. package/es/common/ProductModal/index.less +1 -7
  26. package/es/common/ProductSource/index.js +21 -81
  27. package/es/common/UrlPicker/index.js +10 -51
  28. package/es/common/Video/index.js +86 -142
  29. package/es/common/VideoUpload/index.js +1 -1
  30. package/es/common/index.js +0 -8
  31. package/es/composite-comp/bol/components/Banner/mobile/index.js +2 -4
  32. package/es/composite-comp/bol/components/WalletNuri/mobile/index.js +8 -4
  33. package/es/composite-comp/bol/second-config-panels/VideoSecondConfig/index.js +1 -3
  34. package/es/composite-comp/common/components/AffiliateProductItem/index.js +20 -22
  35. package/es/composite-comp/common/components/AffiliateProductItem/index.less +1 -31
  36. package/es/composite-comp/common/config-panels/SpacingConfig/index.js +0 -1
  37. package/{lib/composite-comp/nuri → es/composite-comp/dito}/components/AffiliateRecommend/mobile/index.js +10 -12
  38. package/es/composite-comp/{nuri → dito}/components/AffiliateRecommend/pc/index.js +10 -12
  39. package/es/composite-comp/dito/components/FlashDeal/mobile/index.js +1 -8
  40. package/es/composite-comp/dito/components/HeadNavigation/defaultJSON.js +17 -22
  41. package/es/composite-comp/dito/components/HeadNavigation/mobile/index.js +2 -2
  42. package/es/composite-comp/dito/components/MobileNavigation/mobile/index.js +0 -11
  43. package/es/composite-comp/dito/components/Recommend/mobile/index.js +26 -31
  44. package/es/composite-comp/dito/components/Recommend/pc/index.js +1 -1
  45. package/es/composite-comp/dito/components/SearchBar/mobile/index.js +1 -13
  46. package/{lib/composite-comp/nuri → es/composite-comp/dito}/config-panels/AffiliateRecommendConfig/RecommendConfigGroup/index.js +1 -1
  47. package/es/composite-comp/dito/config-panels/HeadNavigationConfig/index.js +27 -25
  48. package/es/composite-comp/dito/second-config-panels/HeadNavigationSecondConfig/index.js +1 -1
  49. package/es/composite-comp/dito/second-config-panels/MenuNavigationSecondConfig/index.js +1 -1
  50. package/es/composite-comp/dito/second-config-panels/RecommendSecondConfig/index.js +2 -4
  51. package/es/constants/component-types.js +6 -24
  52. package/es/constants/index.js +5 -52
  53. package/es/core/Designer/ChatRobot/components/SearchCondition/index.js +16 -34
  54. package/es/core/Designer/ChatRobot/index.js +4 -49
  55. package/es/core/Designer/ConfigPanel/index.js +0 -6
  56. package/es/core/Designer/FonixtreeGpt/index.js +29 -222
  57. package/es/core/Designer/PageCompList/index.js +1 -1
  58. package/es/core/Designer/QuickMenuBar/index.js +2 -6
  59. package/es/core/Designer/ToolBarModal/index.js +1 -5
  60. package/es/core/Designer/index.js +1 -12
  61. package/es/core/Renderer/index.js +2 -6
  62. package/es/decorator/compositeDecorator.js +6 -10
  63. package/es/decorator/index.js +1 -4
  64. package/es/decorator/metaDecorator.js +3 -7
  65. package/es/locale/en/en.json +2 -20
  66. package/es/locale/es/es.json +2 -20
  67. package/es/locale/id/id.json +2 -20
  68. package/es/meta-comp/config-panels/TextConfig/index.js +1 -1
  69. package/es/mobx/index.js +3 -9
  70. package/es/utils/androidUtil.js +2 -17
  71. package/es/utils/businessUtil.js +5 -54
  72. package/es/utils/commonUtil.js +13 -151
  73. package/es/utils/coreUtil.js +24 -89
  74. package/lib/assets/fonts/magic-box-iconfont.css +7 -35
  75. package/lib/assets/fonts/magic-box-iconfont.css.bak +4 -8
  76. package/lib/assets/fonts/magic-box-iconfont.js +1 -1
  77. package/lib/assets/fonts/magic-box-iconfont.js.bak +1 -1
  78. package/lib/assets/fonts/magic-box-iconfont.ttf +0 -0
  79. package/lib/assets/fonts/magic-box-iconfont.woff +0 -0
  80. package/lib/assets/fonts/magic-box-iconfont.woff2 +0 -0
  81. package/lib/assets/less/button.less +0 -5
  82. package/lib/common/AffiliateProductModal/index.js +1 -1
  83. package/lib/common/AffiliateProductModal/index.less +1 -1
  84. package/lib/common/Button/index.less +1 -0
  85. package/lib/common/CountDown/index.js +11 -20
  86. package/lib/common/GroupList/index.js +2 -7
  87. package/lib/common/LinkModal/BundleCampaign/index.js +2 -2
  88. package/lib/common/LinkModal/CouponTable/index.js +1 -1
  89. package/lib/common/LinkModal/CustomTable/index.js +0 -1
  90. package/lib/common/LinkModal/FilteredProductModal/index.js +106 -82
  91. package/lib/common/LinkModal/FilteredProductModal/index.less +0 -1
  92. package/lib/common/LinkModal/ProductDetailPage/index.js +60 -115
  93. package/lib/common/LinkModal/ProductDetailPage/index.less +1 -6
  94. package/lib/common/LinkModal/SelectVideoModal/index.js +2 -3
  95. package/lib/common/LinkModal/index.js +5 -20
  96. package/lib/common/MagicLink/index.js +2 -2
  97. package/lib/common/ProductModal/index.js +124 -181
  98. package/lib/common/ProductModal/index.less +1 -7
  99. package/lib/common/ProductSource/index.js +21 -81
  100. package/lib/common/UrlPicker/index.js +10 -51
  101. package/lib/common/Video/index.js +86 -142
  102. package/lib/common/VideoUpload/index.js +1 -1
  103. package/lib/common/index.js +0 -8
  104. package/lib/composite-comp/bol/components/Banner/mobile/index.js +2 -4
  105. package/lib/composite-comp/bol/components/WalletNuri/mobile/index.js +8 -4
  106. package/lib/composite-comp/bol/second-config-panels/VideoSecondConfig/index.js +1 -3
  107. package/lib/composite-comp/common/components/AffiliateProductItem/index.js +20 -22
  108. package/lib/composite-comp/common/components/AffiliateProductItem/index.less +1 -31
  109. package/lib/composite-comp/common/config-panels/SpacingConfig/index.js +0 -1
  110. package/{es/composite-comp/nuri → lib/composite-comp/dito}/components/AffiliateRecommend/mobile/index.js +10 -12
  111. package/lib/composite-comp/{nuri → dito}/components/AffiliateRecommend/pc/index.js +10 -12
  112. package/lib/composite-comp/dito/components/FlashDeal/mobile/index.js +1 -8
  113. package/lib/composite-comp/dito/components/HeadNavigation/defaultJSON.js +17 -22
  114. package/lib/composite-comp/dito/components/HeadNavigation/mobile/index.js +2 -2
  115. package/lib/composite-comp/dito/components/MobileNavigation/mobile/index.js +0 -11
  116. package/lib/composite-comp/dito/components/Recommend/mobile/index.js +26 -31
  117. package/lib/composite-comp/dito/components/Recommend/pc/index.js +1 -1
  118. package/lib/composite-comp/dito/components/SearchBar/mobile/index.js +1 -13
  119. package/{es/composite-comp/nuri → lib/composite-comp/dito}/config-panels/AffiliateRecommendConfig/RecommendConfigGroup/index.js +1 -1
  120. package/lib/composite-comp/dito/config-panels/HeadNavigationConfig/index.js +27 -25
  121. package/lib/composite-comp/dito/second-config-panels/HeadNavigationSecondConfig/index.js +1 -1
  122. package/lib/composite-comp/dito/second-config-panels/MenuNavigationSecondConfig/index.js +1 -1
  123. package/lib/composite-comp/dito/second-config-panels/RecommendSecondConfig/index.js +2 -4
  124. package/lib/constants/component-types.js +6 -24
  125. package/lib/constants/index.js +5 -52
  126. package/lib/core/Designer/ChatRobot/components/SearchCondition/index.js +16 -34
  127. package/lib/core/Designer/ChatRobot/index.js +4 -49
  128. package/lib/core/Designer/ConfigPanel/index.js +0 -6
  129. package/lib/core/Designer/FonixtreeGpt/index.js +29 -222
  130. package/lib/core/Designer/PageCompList/index.js +1 -1
  131. package/lib/core/Designer/QuickMenuBar/index.js +2 -6
  132. package/lib/core/Designer/ToolBarModal/index.js +1 -5
  133. package/lib/core/Designer/index.js +1 -12
  134. package/lib/core/Renderer/index.js +2 -6
  135. package/lib/decorator/compositeDecorator.js +6 -10
  136. package/lib/decorator/index.js +1 -4
  137. package/lib/decorator/metaDecorator.js +3 -7
  138. package/lib/locale/en/en.json +2 -20
  139. package/lib/locale/es/es.json +2 -20
  140. package/lib/locale/id/id.json +2 -20
  141. package/lib/meta-comp/config-panels/TextConfig/index.js +1 -1
  142. package/lib/mobx/index.js +3 -9
  143. package/lib/utils/androidUtil.js +2 -17
  144. package/lib/utils/businessUtil.js +5 -54
  145. package/lib/utils/commonUtil.js +13 -151
  146. package/lib/utils/coreUtil.js +24 -89
  147. package/package.json +1 -2
  148. package/es/common/CropperModal/index.js +0 -126
  149. package/es/common/CropperModal/index.less +0 -29
  150. package/es/common/LinkModal/AffiliatePlatform/index.js +0 -326
  151. package/es/common/LinkModal/AffiliateStore/index.js +0 -332
  152. package/es/common/ProductModal/SortableImageList/index.js +0 -118
  153. package/es/common/ProductModal/SortableImageList/index.less +0 -3
  154. package/es/common/UrlPicker/AnchorModal/index.js +0 -170
  155. package/es/common/UrlPicker/AnchorModal/index.less +0 -21
  156. package/es/common/Video/QualityComponent/index.js +0 -169
  157. package/es/common/Video/QualityComponent/index.less +0 -78
  158. package/es/composite-comp/common/components/AffiliateProductItem/imgs/icon-cashback.svg +0 -9
  159. package/es/composite-comp/dito/components/CommonFunctions/defaultJSON.js +0 -92
  160. package/es/composite-comp/dito/components/CommonFunctions/index.js +0 -84
  161. package/es/composite-comp/dito/components/CommonFunctions/mobile/index.js +0 -113
  162. package/es/composite-comp/dito/components/CommonFunctions/mobile/index.less +0 -30
  163. package/es/composite-comp/dito/components/Orders/defaultJSON.js +0 -89
  164. package/es/composite-comp/dito/components/Orders/index.js +0 -84
  165. package/es/composite-comp/dito/components/Orders/mobile/index.js +0 -350
  166. package/es/composite-comp/dito/components/Orders/mobile/index.less +0 -86
  167. package/es/composite-comp/dito/components/PersonalInformation/defaultJSON.js +0 -95
  168. package/es/composite-comp/dito/components/PersonalInformation/index.js +0 -84
  169. package/es/composite-comp/dito/components/PersonalInformation/mobile/images/avatar.png +0 -0
  170. package/es/composite-comp/dito/components/PersonalInformation/mobile/index.js +0 -592
  171. package/es/composite-comp/dito/components/PersonalInformation/mobile/index.less +0 -135
  172. package/es/composite-comp/dito/config-panels/CommonFunctionsConfig/ConfigGroup/index.js +0 -128
  173. package/es/composite-comp/dito/config-panels/CommonFunctionsConfig/index.js +0 -113
  174. package/es/composite-comp/dito/config-panels/OrdersConfig/ConfigGroup/index.js +0 -131
  175. package/es/composite-comp/dito/config-panels/OrdersConfig/index.js +0 -114
  176. package/es/composite-comp/dito/config-panels/PersonalInformationConfig/ConfigGroup/index.js +0 -131
  177. package/es/composite-comp/dito/config-panels/PersonalInformationConfig/index.js +0 -118
  178. package/es/composite-comp/dito/second-config-panels/CommonFunctionsSecondConfig/index.js +0 -121
  179. package/es/composite-comp/dito/second-config-panels/OrdersSecondConfig/index.js +0 -148
  180. package/es/composite-comp/dito/second-config-panels/OrdersSecondConfig/index.less +0 -9
  181. package/es/composite-comp/dito/second-config-panels/PersonalInformationSecondConfig/index.js +0 -143
  182. package/es/composite-comp/dito/second-config-panels/PersonalInformationSecondConfig/index.less +0 -9
  183. package/es/mobx/UserState.js +0 -144
  184. package/lib/common/CropperModal/index.js +0 -126
  185. package/lib/common/CropperModal/index.less +0 -29
  186. package/lib/common/LinkModal/AffiliatePlatform/index.js +0 -326
  187. package/lib/common/LinkModal/AffiliateStore/index.js +0 -332
  188. package/lib/common/ProductModal/SortableImageList/index.js +0 -118
  189. package/lib/common/ProductModal/SortableImageList/index.less +0 -3
  190. package/lib/common/UrlPicker/AnchorModal/index.js +0 -170
  191. package/lib/common/UrlPicker/AnchorModal/index.less +0 -21
  192. package/lib/common/Video/QualityComponent/index.js +0 -169
  193. package/lib/common/Video/QualityComponent/index.less +0 -78
  194. package/lib/composite-comp/common/components/AffiliateProductItem/imgs/icon-cashback.svg +0 -9
  195. package/lib/composite-comp/dito/components/CommonFunctions/defaultJSON.js +0 -92
  196. package/lib/composite-comp/dito/components/CommonFunctions/index.js +0 -84
  197. package/lib/composite-comp/dito/components/CommonFunctions/mobile/index.js +0 -113
  198. package/lib/composite-comp/dito/components/CommonFunctions/mobile/index.less +0 -30
  199. package/lib/composite-comp/dito/components/Orders/defaultJSON.js +0 -89
  200. package/lib/composite-comp/dito/components/Orders/index.js +0 -84
  201. package/lib/composite-comp/dito/components/Orders/mobile/index.js +0 -350
  202. package/lib/composite-comp/dito/components/Orders/mobile/index.less +0 -86
  203. package/lib/composite-comp/dito/components/PersonalInformation/defaultJSON.js +0 -95
  204. package/lib/composite-comp/dito/components/PersonalInformation/index.js +0 -84
  205. package/lib/composite-comp/dito/components/PersonalInformation/mobile/images/avatar.png +0 -0
  206. package/lib/composite-comp/dito/components/PersonalInformation/mobile/index.js +0 -592
  207. package/lib/composite-comp/dito/components/PersonalInformation/mobile/index.less +0 -135
  208. package/lib/composite-comp/dito/config-panels/CommonFunctionsConfig/ConfigGroup/index.js +0 -128
  209. package/lib/composite-comp/dito/config-panels/CommonFunctionsConfig/index.js +0 -113
  210. package/lib/composite-comp/dito/config-panels/OrdersConfig/ConfigGroup/index.js +0 -131
  211. package/lib/composite-comp/dito/config-panels/OrdersConfig/index.js +0 -114
  212. package/lib/composite-comp/dito/config-panels/PersonalInformationConfig/ConfigGroup/index.js +0 -131
  213. package/lib/composite-comp/dito/config-panels/PersonalInformationConfig/index.js +0 -118
  214. package/lib/composite-comp/dito/second-config-panels/CommonFunctionsSecondConfig/index.js +0 -121
  215. package/lib/composite-comp/dito/second-config-panels/OrdersSecondConfig/index.js +0 -148
  216. package/lib/composite-comp/dito/second-config-panels/OrdersSecondConfig/index.less +0 -9
  217. package/lib/composite-comp/dito/second-config-panels/PersonalInformationSecondConfig/index.js +0 -143
  218. package/lib/composite-comp/dito/second-config-panels/PersonalInformationSecondConfig/index.less +0 -9
  219. package/lib/mobx/UserState.js +0 -144
  220. /package/es/common/Video/{RateComponent → components}/index.js +0 -0
  221. /package/es/common/Video/{RateComponent → components}/index.less +0 -0
  222. /package/es/composite-comp/{nuri → dito}/components/AffiliateRecommend/defaultJSON.js +0 -0
  223. /package/es/composite-comp/{nuri → dito}/components/AffiliateRecommend/index.js +0 -0
  224. /package/es/composite-comp/{nuri → dito}/components/AffiliateRecommend/mobile/index.less +0 -0
  225. /package/es/composite-comp/{nuri → dito}/components/AffiliateRecommend/pc/index.less +0 -0
  226. /package/es/composite-comp/{nuri → dito}/config-panels/AffiliateRecommendConfig/RecommendConfigContent/index.js +0 -0
  227. /package/es/composite-comp/{nuri → dito}/config-panels/AffiliateRecommendConfig/RecommendConfigContent/index.less +0 -0
  228. /package/es/composite-comp/{nuri → dito}/config-panels/AffiliateRecommendConfig/RecommendConfigGroup/index.less +0 -0
  229. /package/es/composite-comp/{nuri → dito}/config-panels/AffiliateRecommendConfig/imgs/defaultImg.png +0 -0
  230. /package/es/composite-comp/{nuri → dito}/config-panels/AffiliateRecommendConfig/index.js +0 -0
  231. /package/es/composite-comp/{nuri → dito}/second-config-panels/AffiliateRecommendSecondConfig/AIRecommendation/index.js +0 -0
  232. /package/es/composite-comp/{nuri → dito}/second-config-panels/AffiliateRecommendSecondConfig/index.js +0 -0
  233. /package/es/composite-comp/{nuri → dito}/second-config-panels/AffiliateRecommendSecondConfig/index.less +0 -0
  234. /package/lib/common/Video/{RateComponent → components}/index.js +0 -0
  235. /package/lib/common/Video/{RateComponent → components}/index.less +0 -0
  236. /package/lib/composite-comp/{nuri → dito}/components/AffiliateRecommend/defaultJSON.js +0 -0
  237. /package/lib/composite-comp/{nuri → dito}/components/AffiliateRecommend/index.js +0 -0
  238. /package/lib/composite-comp/{nuri → dito}/components/AffiliateRecommend/mobile/index.less +0 -0
  239. /package/lib/composite-comp/{nuri → dito}/components/AffiliateRecommend/pc/index.less +0 -0
  240. /package/lib/composite-comp/{nuri → dito}/config-panels/AffiliateRecommendConfig/RecommendConfigContent/index.js +0 -0
  241. /package/lib/composite-comp/{nuri → dito}/config-panels/AffiliateRecommendConfig/RecommendConfigContent/index.less +0 -0
  242. /package/lib/composite-comp/{nuri → dito}/config-panels/AffiliateRecommendConfig/RecommendConfigGroup/index.less +0 -0
  243. /package/lib/composite-comp/{nuri → dito}/config-panels/AffiliateRecommendConfig/imgs/defaultImg.png +0 -0
  244. /package/lib/composite-comp/{nuri → dito}/config-panels/AffiliateRecommendConfig/index.js +0 -0
  245. /package/lib/composite-comp/{nuri → dito}/second-config-panels/AffiliateRecommendSecondConfig/AIRecommendation/index.js +0 -0
  246. /package/lib/composite-comp/{nuri → dito}/second-config-panels/AffiliateRecommendSecondConfig/index.js +0 -0
  247. /package/lib/composite-comp/{nuri → dito}/second-config-panels/AffiliateRecommendSecondConfig/index.less +0 -0
@@ -3,7 +3,7 @@
3
3
  Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
- exports.sendToJs = exports.sendToIos = exports.sendToApp = exports.sendToAndroid = exports.iosSendToJs = exports.goToLoginApp = exports.connectWebViewJavascriptBridge = exports.browserVersion = void 0;
6
+ exports.sendToJs = exports.sendToIos = exports.sendToApp = exports.sendToAndroid = exports.iosSendToJs = exports.connectWebViewJavascriptBridge = exports.browserVersion = void 0;
7
7
 
8
8
  // 判断访问终端
9
9
  var browserVersion = function browserVersion() {
@@ -22,10 +22,6 @@ var browserVersion = function browserVersion() {
22
22
  weixin: u.indexOf('MicroMessenger') > -1,
23
23
  qq: u.match(/\sQQ/i) == ' qq',
24
24
  isApp: u.indexOf('app/CYLON-APP') > -1,
25
- isNuriApp: u.indexOf('app/NURI-APP') > -1,
26
- isDitoApp: u.indexOf('mydito') > -1,
27
- ditoAndroidApp: u.indexOf('mydito') > -1 && (u.indexOf('Android') > -1 || u.indexOf('Adr') > -1),
28
- ditoIosApp: u.indexOf('mydito') > -1 && !!u.match(/\(i[^;]+;( U;)? CPU.+Mac OS X/),
29
25
  isAshitaApp: u.indexOf('app/ASHITA-APP') > -1
30
26
  };
31
27
  };
@@ -133,17 +129,6 @@ var sendToApp = function sendToApp(params) {
133
129
  if (AlipayJSBridge) {
134
130
  AlipayJSBridge.call('mpaasAction', params);
135
131
  }
136
- }; // 拉起APP登录
137
-
138
-
139
- exports.sendToApp = sendToApp;
140
-
141
- var goToLoginApp = function goToLoginApp() {
142
- if (browserVersion().androidApp) {
143
- window.dito.goToLogin();
144
- } else if (browserVersion().iosApp) {
145
- window.dito.goToLogin();
146
- }
147
132
  };
148
133
 
149
- exports.goToLoginApp = goToLoginApp;
134
+ exports.sendToApp = sendToApp;
@@ -28,22 +28,10 @@ var newParseUrl = function newParseUrl(urlObj) {
28
28
  var type = urlObj.type,
29
29
  value = urlObj.value,
30
30
  offerId = urlObj.offerId,
31
- productId = urlObj.productId,
32
- name = urlObj.name;
31
+ productId = urlObj.productId;
33
32
 
34
33
  switch (type) {
35
- // 锚点跳转
36
- case _constants.urlTypeMap.ANCHOR:
37
- params = {
38
- action: 'operation',
39
- params: {
40
- type: 'ANCHOR',
41
- data: value
42
- }
43
- };
44
- break;
45
34
  // 商品详情
46
-
47
35
  case _constants.urlTypeMap.PRODUCT_DETAIL_PAGE:
48
36
  if (offerId) {
49
37
  link = "/product/detail/" + offerId + "?productId=" + (productId !== null && productId !== void 0 ? productId : '');
@@ -99,7 +87,7 @@ var newParseUrl = function newParseUrl(urlObj) {
99
87
  // 商品列表
100
88
 
101
89
  case _constants.urlTypeMap.FILTERED_PRODUCT:
102
- link = "/product/list/?" + value;
90
+ link = "/product/list?" + value;
103
91
  params = {
104
92
  action: 'jump',
105
93
  params: {
@@ -183,42 +171,6 @@ var newParseUrl = function newParseUrl(urlObj) {
183
171
  };
184
172
  break;
185
173
 
186
- case _constants.urlTypeMap.AFFILIATE_STORE:
187
- // 分销店铺
188
- link = "/storeDetail/" + value;
189
- params = {
190
- action: 'jump',
191
- params: {
192
- type: 'AFFILIATE_STORE',
193
- url: value
194
- }
195
- };
196
- break;
197
-
198
- case _constants.urlTypeMap.MINI_API:
199
- // 小程序API,演示使用
200
- link = "mpaas://miniapp?api=" + value.replace('my.', '');
201
- params = {
202
- action: 'jump',
203
- params: {
204
- type: 'MINI_API',
205
- url: value
206
- }
207
- };
208
- break;
209
-
210
- case _constants.urlTypeMap.AFFILIATE_PLATFORM:
211
- // affiliate platform
212
- link = "/platformDetail/" + value;
213
- params = {
214
- action: 'jump',
215
- params: {
216
- type: 'AFFILIATE_PLATFORM',
217
- url: value
218
- }
219
- };
220
- break;
221
-
222
174
  default:
223
175
  var map = {
224
176
  '/main/cart': 'CART',
@@ -241,9 +193,8 @@ var newParseUrl = function newParseUrl(urlObj) {
241
193
  params = {
242
194
  action: 'jump',
243
195
  params: {
244
- type: map[link] || name,
245
- link: link,
246
- url: link
196
+ type: map[link],
197
+ link: link
247
198
  }
248
199
  };
249
200
  }
@@ -310,7 +261,7 @@ var parseUrl = function parseUrl(url) {
310
261
  // 商品列表
311
262
 
312
263
  case _constants.urlType.PROD_FILTER:
313
- link = "/product/list/?" + arg1;
264
+ link = "/product/list?" + arg1;
314
265
  params = {
315
266
  action: 'jump',
316
267
  params: {
@@ -5,7 +5,7 @@ Object.defineProperty(exports, "__esModule", {
5
5
  });
6
6
  exports.addZero = exports.addUrlQuery = void 0;
7
7
  exports.asyncDataURLtoImage = asyncDataURLtoImage;
8
- exports.checkLogin = exports.checkFileName = exports.calcLastTime = exports.asyncNextTick = void 0;
8
+ exports.checkFileName = exports.calcLastTime = exports.asyncNextTick = void 0;
9
9
  exports.commonFetch = commonFetch;
10
10
  exports.convertCount = exports.compatibleNewPageData = void 0;
11
11
  exports.convertImageUrl = convertImageUrl;
@@ -16,19 +16,14 @@ exports.dragSource = exports.downloadBase64Image = void 0;
16
16
  exports.ensure = ensure;
17
17
  exports.getGAData = exports.getColorRgba = void 0;
18
18
  exports.getPageDataMap = getPageDataMap;
19
- exports.getUrlParams = void 0;
20
- exports.goLogin = goLogin;
21
- exports.importAsync = void 0;
22
- exports.isLogin = isLogin;
23
- exports.onListenTouch = exports.nextTick = exports.navigateTo = void 0;
19
+ exports.onListenTouch = exports.nextTick = exports.navigateTo = exports.importAsync = exports.getUrlParams = void 0;
24
20
  exports.pushGA = pushGA;
25
- exports.setDefaultAddressFromIP = exports.pxToRem = void 0;
21
+ exports.pxToRem = void 0;
26
22
  exports.shareFacebook = shareFacebook;
27
23
  exports.shareLinkedin = shareLinkedin;
28
24
  exports.shareTwitter = shareTwitter;
29
25
  exports.sleep = sleep;
30
26
  exports.styleStringify = void 0;
31
- exports.triggerBuryingPointEvent = triggerBuryingPointEvent;
32
27
 
33
28
  var _axios = _interopRequireDefault(require("axios"));
34
29
 
@@ -38,14 +33,8 @@ var _uuid = require("uuid");
38
33
 
39
34
  var _qs = _interopRequireDefault(require("qs"));
40
35
 
41
- var _androidUtil = require("./androidUtil");
42
-
43
- var _storeUtil = require("./storeUtil");
44
-
45
36
  var _constants = require("../constants");
46
37
 
47
- var _mobx = require("../mobx");
48
-
49
38
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
50
39
 
51
40
  var __assign = void 0 && (void 0).__assign || function () {
@@ -297,135 +286,23 @@ function commonFetch(url, data, method) {
297
286
  });
298
287
  }
299
288
 
300
- var navigateTo = function navigateTo(url, state) {
301
- console.log('navigateTo', url);
302
-
289
+ var navigateTo = function navigateTo(url) {
303
290
  if (!url) {
304
291
  return;
305
292
  }
306
293
 
307
- var _a = url.split(';'),
308
- h5Url = _a[0],
309
- appUrl = _a[1]; // 未配置App路径并且h5绝对路径时直接跳转,其他情况让业务层处理
310
-
311
-
312
- if (!appUrl && !h5Url.startsWith('/')) {
313
- window.location.href = h5Url;
314
- } else if (window.magicDesign.history) {
315
- window.magicDesign.history.push(url, state);
316
- } else if (window.magicDesign.navigatePreUrl) {
317
- // 预览模式跳转
318
- if (h5Url.startsWith('/')) {
319
- window.location.href = "" + window.magicDesign.navigatePreUrl + url;
294
+ if (url.startsWith('/')) {
295
+ if (window.magicDesign.history && !window.magicDesign.navigatePreUrl) {
296
+ window.magicDesign.history.push(url);
320
297
  } else {
321
- window.location.href = h5Url;
298
+ window.location.href = "" + window.magicDesign.navigatePreUrl + url;
322
299
  }
323
- }
324
- };
325
- /** 判断是否登录状态 */
326
-
327
-
328
- exports.navigateTo = navigateTo;
329
-
330
- function isLogin() {
331
- return localStorage.getItem('isLogin') === 'Y';
332
- }
333
- /**
334
- * 跳转登陆页面
335
- * SF打开的页面,需要跳转到手机验证码登陆页面
336
- * @param {*} state
337
- */
338
-
339
-
340
- function goLogin(state, replaceFlag) {
341
- if (state === void 0) {
342
- state = {};
343
- }
344
-
345
- if (replaceFlag === void 0) {
346
- replaceFlag = false;
347
- }
348
-
349
- var isFromSf = (0, _storeUtil.getStore)(_constants.STORE_KEY.IS_FROM_SF);
350
- var signUrl = isFromSf === 'Y' ? '/sign-in-opt' : '/sign-in';
351
-
352
- if (replaceFlag) {
353
- window.magicDesign.history.replace({
354
- pathname: signUrl,
355
- state: state
356
- });
357
300
  } else {
358
- navigateTo(signUrl, state);
359
- }
360
- }
361
- /**
362
- * 检查是否登录 未登录返回登录页
363
- * @param {boolean?} isLead 是否引导登录
364
- * @returns boolean
365
- */
366
-
367
-
368
- var checkLogin = function checkLogin(isLead, redirectUrl, replaceFlag) {
369
- if (isLead === void 0) {
370
- isLead = true;
301
+ window.location.href = url;
371
302
  }
372
-
373
- if (!isLogin()) {
374
- if (isLead) {
375
- if ((0, _androidUtil.browserVersion)().isApp) {
376
- goToLoginApp();
377
- } else {
378
- var _a = window.location,
379
- pathname = _a.pathname,
380
- search = _a.search,
381
- hash = _a.hash;
382
-
383
- var _redirectUrl = pathname + search + hash;
384
-
385
- goLogin({
386
- redirectUrl: redirectUrl || _redirectUrl
387
- }, replaceFlag);
388
- }
389
- }
390
-
391
- return false;
392
- }
393
-
394
- return true;
395
303
  };
396
- /**
397
- * TODO 根据IP获取地址信息
398
- */
399
304
 
400
-
401
- exports.checkLogin = checkLogin;
402
-
403
- var setDefaultAddressFromIP = function setDefaultAddressFromIP() {
404
- /** 设置初始地址 */
405
-
406
- /** 接口返回数据addrPath: "1|2|137088|137089|137090" 保留后两个再拼上contactStdId
407
- * 未登陆造数据和真实数据一致使用countryId占位
408
- */
409
-
410
- /** 138375,138376,126065,126066 */
411
- if (!_mobx.userState.state.userAddress) {
412
- _mobx.userState.setState({
413
- userAddress: {
414
- _FROM: 'ip',
415
- addrPath: 'countryId|countryId1T|countryId2T|138375|138376|126065',
416
- city: 'CITY OF MANILA',
417
- contactStdId: 126066,
418
- // country: 'CITY OF MANILA',
419
- district: 'SAN MIGUEL',
420
- street: 'Barangay 637',
421
- province: 'NCR, CITY OF MANILA, FIRST DISTRICT',
422
- type: 'address'
423
- }
424
- });
425
- }
426
- };
427
-
428
- exports.setDefaultAddressFromIP = setDefaultAddressFromIP;
305
+ exports.navigateTo = navigateTo;
429
306
 
430
307
  var addUrlQuery = function addUrlQuery(url, queryObj) {
431
308
  if (/\?/.test(url)) {
@@ -751,29 +628,14 @@ function pushGA(data, eventName) {
751
628
  groupName: data.groupName,
752
629
  elementId: data.elementId,
753
630
  elementName: data.elementName
754
- }; // console.log('GA push', eventName, eventData);
755
-
756
- if (window.gtag) window.gtag('event', eventName, eventData);
631
+ };
632
+ console.log('GA push', eventName, eventData);
633
+ window.gtag('event', eventName, eventData);
757
634
  }
758
635
  } catch (error) {
759
636
  console.error(error);
760
637
  }
761
638
  }
762
- /** 触发埋点事件
763
- *
764
- window.document.addEventListener('magic-design-burying-point', e => {
765
- console.log(e.data);
766
- });
767
- */
768
-
769
-
770
- function triggerBuryingPointEvent(data) {
771
- var evt = new Event('magic-design-burying-point', {
772
- bubbles: false
773
- });
774
- evt.data = data;
775
- window.document.dispatchEvent(evt);
776
- }
777
639
  /** react key 计算 */
778
640
 
779
641
 
@@ -3,7 +3,7 @@
3
3
  Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
- exports.setMagicDesign = exports.renderPreview = exports.isPc = exports.isDesignMode = exports.isAutoAudit = exports.isActiveFloor = exports.getVideoCover = exports.copyNode = exports.clickUrl = void 0;
6
+ exports.setMagicDesign = exports.renderPreview = exports.isPc = exports.isDesignMode = exports.isActiveFloor = exports.getVideoCover = exports.copyNode = exports.clickUrl = void 0;
7
7
 
8
8
  var _uuid = require("uuid");
9
9
 
@@ -286,25 +286,7 @@ var getCoupon = function getCoupon(couponId) {
286
286
  });
287
287
  };
288
288
 
289
- function isUrl(string) {
290
- // var pattern = new RegExp('^(https?:\\/\\/)?' + // 协议
291
- // '((([a-z\\d]([a-z\\d-]*[a-z\\d])*)\\.)+[a-z]{2,}|' + // 域名
292
- // '((\\d{1,3}\\.){3}\\d{1,3}))' + // 或者 IP (v4) 地址
293
- // '(\\:\\d+)?(\\/[-a-z\\d%_.~+]*)*' + // 端口和路径
294
- // '(\\?[;&a-z\\d%_.~+=-]*)?' + // 查询字符串
295
- // '(\\#[-a-z\\d_]*)?$', 'i'); // fragment locator
296
- // return !!pattern.test(string);
297
- try {
298
- new URL(string);
299
- return true;
300
- } catch (_) {
301
- return false;
302
- }
303
- }
304
-
305
289
  var clickUrl = function clickUrl(url) {
306
- var _a;
307
-
308
290
  if (url === void 0) {
309
291
  url = '';
310
292
  }
@@ -315,43 +297,30 @@ var clickUrl = function clickUrl(url) {
315
297
  return;
316
298
  }
317
299
 
318
- var _b = _typeof(url) === 'object' ? (0, _businessUtil.newParseUrl)(url) : (0, _businessUtil.parseUrl)(url),
319
- link = _b.link,
320
- data = _b.data;
321
-
322
- var _c = data.params,
323
- params = _c === void 0 ? {} : _c; // console.log('clicked data:', data);
324
- // console.log({ type: 'jumpBrowser', params: { url: params.link } });
325
-
326
- /** 锚点跳转 */
327
-
328
- if (params.type === 'ANCHOR') {
329
- (0, _commonUtil.ensure)(function () {
330
- var nodeId = isPc() ? params.data.pcNodeId : params.data.mobileNodeId;
331
- document.querySelector("#node-" + nodeId).scrollIntoView({
332
- behavior: 'smooth'
333
- });
334
- });
335
- return;
336
- }
300
+ var _a = _typeof(url) === 'object' ? (0, _businessUtil.newParseUrl)(url) : (0, _businessUtil.parseUrl)(url),
301
+ link = _a.link,
302
+ data = _a.data;
303
+
304
+ var _b = data.params,
305
+ params = _b === void 0 ? {} : _b;
306
+ console.log('clicked data:', data);
307
+ console.log({
308
+ type: 'jumpBrowser',
309
+ params: {
310
+ url: params.link
311
+ }
312
+ });
337
313
 
338
314
  if ((0, _androidUtil.browserVersion)().isAshitaApp) {
339
315
  (0, _androidUtil.sendToApp)(data);
340
316
  } else if ((0, _androidUtil.browserVersion)().isApp && params.link && params.link.startsWith('http')) {
341
- // 跳转链接是个绝对路径
342
- if (params.type === 'Gamezop') {
343
- // Nuri 对接 Gamezop 特殊情况
344
- (0, _androidUtil.sendToApp)(data);
345
- } else {
346
- // Nuri 抽奖系统对接
347
- var urlTemp = "" + params.link + (params.link.includes('?') ? '&' : '?') + "userToken=" + (localStorage.getItem('h5Token') || '');
348
- (0, _androidUtil.sendToApp)({
349
- type: 'jumpBrowser',
350
- params: {
351
- url: urlTemp
352
- }
353
- });
354
- }
317
+ // 兼容Nuri的 绝对路径跳转
318
+ (0, _androidUtil.sendToAndroid)({
319
+ type: 'jumpBrowser',
320
+ params: {
321
+ url: params.link
322
+ }
323
+ });
355
324
  } else {
356
325
  // 视频
357
326
  if (params.type === 'VIDEO') {
@@ -373,33 +342,9 @@ var clickUrl = function clickUrl(url) {
373
342
  }
374
343
 
375
344
  return;
376
- } // 判断是否是nuri, nuri跳外链需要带token
377
-
378
-
379
- if (((_a = window === null || window === void 0 ? void 0 : window.magicDesign) === null || _a === void 0 ? void 0 : _a.projectCode) === 'nuri') {
380
- // 输入的是完整的跳转地址
381
- if (isUrl(link)) {
382
- if (params.type === 'Gamezop') {
383
- // Nuri 对接游戏页面
384
- window.open(link);
385
- } else if (!link.includes(window.location.host)) {
386
- // 跳转外链 需要把userToken带上
387
- if (link.includes('?')) {
388
- var a = link + "&userToken=" + (localStorage.getItem('h5Token') || '');
389
- window.open(a);
390
- } else {
391
- var a = link + "?userToken=" + (localStorage.getItem('h5Token') || '');
392
- window.open(a);
393
- }
394
- } else {
395
- window.open(link);
396
- }
397
- } else {
398
- (0, _commonUtil.navigateTo)(link);
399
- }
400
- } else {
401
- (0, _commonUtil.navigateTo)(link);
402
345
  }
346
+
347
+ (0, _commonUtil.navigateTo)(link);
403
348
  }
404
349
  };
405
350
 
@@ -445,15 +390,5 @@ var copyNode = function copyNode(value, parentId) {
445
390
  });
446
391
  return newNode;
447
392
  };
448
- /**
449
- * 是否开启自动审核
450
- */
451
-
452
-
453
- exports.copyNode = copyNode;
454
-
455
- var isAutoAudit = function isAutoAudit() {
456
- return window.magicDesign.autoAudit || window.partyType === partyTypeMap.PLATFORM;
457
- };
458
393
 
459
- exports.isAutoAudit = isAutoAudit;
394
+ exports.copyNode = copyNode;
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@fonixtree/magic-design",
3
3
  "author": "Cylon Team",
4
- "version": "0.1.93",
4
+ "version": "0.2.2",
5
5
  "description": "Magic Design",
6
6
  "license": "MIT",
7
7
  "module": "es/index.js",
@@ -36,7 +36,6 @@
36
36
  "ramda": "^0.28.0",
37
37
  "react-ace": "^10.1.0",
38
38
  "react-color": "2.17.0",
39
- "react-cropper": "^2.3.3",
40
39
  "react-router-dom": "5.3.0",
41
40
  "react-slick": "^0.29.0",
42
41
  "replace": "^1.2.1",
@@ -1,126 +0,0 @@
1
- "use strict";
2
-
3
- function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
4
-
5
- Object.defineProperty(exports, "__esModule", {
6
- value: true
7
- });
8
- exports["default"] = void 0;
9
-
10
- var _react = _interopRequireWildcard(require("react"));
11
-
12
- var _reactCropper = _interopRequireDefault(require("react-cropper"));
13
-
14
- require("cropperjs/dist/cropper.css");
15
-
16
- require("./index.less");
17
-
18
- var _locale = require("../../locale");
19
-
20
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
21
-
22
- 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
-
24
- 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; }
25
-
26
- var __extends = void 0 && (void 0).__extends || function () {
27
- var _extendStatics = function extendStatics(d, b) {
28
- _extendStatics = Object.setPrototypeOf || {
29
- __proto__: []
30
- } instanceof Array && function (d, b) {
31
- d.__proto__ = b;
32
- } || function (d, b) {
33
- for (var p in b) {
34
- if (b.hasOwnProperty(p)) d[p] = b[p];
35
- }
36
- };
37
-
38
- return _extendStatics(d, b);
39
- };
40
-
41
- return function (d, b) {
42
- _extendStatics(d, b);
43
-
44
- function __() {
45
- this.constructor = d;
46
- }
47
-
48
- d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
49
- };
50
- }();
51
-
52
- var AComponent =
53
- /** @class */
54
- function (_super) {
55
- __extends(AComponent, _super);
56
-
57
- function AComponent() {
58
- var _this = _super !== null && _super.apply(this, arguments) || this;
59
-
60
- _this.state = {
61
- src: ''
62
- };
63
-
64
- _this.onSubmit = function () {
65
- _this.cropper.getCroppedCanvas().toBlob(function (blob) {
66
- var fileName = _this.props.uploadedImageFile.name; // Vovi手机没有图片后缀
67
-
68
- if (fileName && fileName.lastIndexOf('.') === -1) {
69
- fileName = "file_" + new Date().getTime() + ".jpg";
70
- }
71
-
72
- var formData = new FormData();
73
- formData.append('file', blob, fileName);
74
-
75
- _this.props.onSubmit(formData);
76
- });
77
- };
78
-
79
- return _this;
80
- }
81
-
82
- AComponent.prototype.componentDidMount = function () {
83
- var _this = this;
84
-
85
- var fileReader = new FileReader();
86
-
87
- fileReader.onload = function (e) {
88
- var dataURL = e.target.result;
89
-
90
- _this.setState({
91
- src: dataURL
92
- });
93
- };
94
-
95
- fileReader.readAsDataURL(this.props.uploadedImageFile);
96
- };
97
-
98
- AComponent.prototype.render = function () {
99
- var _this = this;
100
-
101
- return /*#__PURE__*/_react["default"].createElement("div", {
102
- className: "cropperModalWrap"
103
- }, /*#__PURE__*/_react["default"].createElement(_reactCropper["default"], {
104
- aspectRatio: 1,
105
- className: "company-logo-cropper",
106
- guides: false,
107
- onInitialized: function onInitialized(cop) {
108
- _this.cropper = cop;
109
- },
110
- src: this.state.src,
111
- viewMode: 1,
112
- zoomable: false
113
- }), /*#__PURE__*/_react["default"].createElement("div", {
114
- className: "btnWrap"
115
- }, /*#__PURE__*/_react["default"].createElement("span", {
116
- onClick: this.props.onClose
117
- }, (0, _locale.i18n)('CANCEL')), /*#__PURE__*/_react["default"].createElement("span", {
118
- onClick: this.onSubmit
119
- }, (0, _locale.i18n)('SUBMIT'))));
120
- };
121
-
122
- return AComponent;
123
- }(_react.Component);
124
-
125
- var _default = AComponent;
126
- exports["default"] = _default;
@@ -1,29 +0,0 @@
1
- .cropperModalWrap {
2
- background: #000;
3
- position: fixed;
4
- z-index: 1000;
5
- top: 0;
6
- bottom: 0;
7
- left: 0;
8
- right: 0;
9
- display: flex;
10
- justify-content: center;
11
- align-items: center;
12
-
13
- .btnWrap {
14
- span {
15
- color: #fff;
16
- font-size: 18px;
17
- position: absolute;
18
- bottom: 10px;
19
-
20
- &:first-child {
21
- left: 12px;
22
- }
23
-
24
- &:last-child {
25
- right: 12px;
26
- }
27
- }
28
- }
29
- }