pb-sxp-ui 1.0.0

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 (384) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +111 -0
  3. package/dist/index.cjs +10752 -0
  4. package/dist/index.cjs.map +1 -0
  5. package/dist/index.css +1782 -0
  6. package/dist/index.js +10721 -0
  7. package/dist/index.js.map +1 -0
  8. package/dist/index.min.cjs +9 -0
  9. package/dist/index.min.cjs.map +1 -0
  10. package/dist/index.min.js +9 -0
  11. package/dist/index.min.js.map +1 -0
  12. package/dist/pb-ui.js +10748 -0
  13. package/dist/pb-ui.js.map +1 -0
  14. package/dist/pb-ui.min.js +9 -0
  15. package/dist/pb-ui.min.js.map +1 -0
  16. package/es/core/Pagebuilder/PagebuilderClass.d.ts +15 -0
  17. package/es/core/Pagebuilder/PagebuilderClass.js +42 -0
  18. package/es/core/Pagebuilder/index.d.ts +3 -0
  19. package/es/core/Pagebuilder/index.js +96 -0
  20. package/es/core/Pagebuilder/type.d.ts +55 -0
  21. package/es/core/Pagebuilder/type.js +1 -0
  22. package/es/core/components/SxpPageCore/index.d.ts +11 -0
  23. package/es/core/components/SxpPageCore/index.js +26 -0
  24. package/es/core/components/SxpPageRender/ExpandableText.d.ts +12 -0
  25. package/es/core/components/SxpPageRender/ExpandableText.js +54 -0
  26. package/es/core/components/SxpPageRender/FingerSwipeTip/index.d.ts +6 -0
  27. package/es/core/components/SxpPageRender/FingerSwipeTip/index.js +19 -0
  28. package/es/core/components/SxpPageRender/Hashtag/index.d.ts +11 -0
  29. package/es/core/components/SxpPageRender/Hashtag/index.js +40 -0
  30. package/es/core/components/SxpPageRender/LikeButton/index.d.ts +10 -0
  31. package/es/core/components/SxpPageRender/LikeButton/index.js +58 -0
  32. package/es/core/components/SxpPageRender/Modal/index.d.ts +9 -0
  33. package/es/core/components/SxpPageRender/Modal/index.js +44 -0
  34. package/es/core/components/SxpPageRender/Navbar.d.ts +8 -0
  35. package/es/core/components/SxpPageRender/Navbar.js +9 -0
  36. package/es/core/components/SxpPageRender/PictureGroup/Picture.d.ts +8 -0
  37. package/es/core/components/SxpPageRender/PictureGroup/Picture.js +19 -0
  38. package/es/core/components/SxpPageRender/PictureGroup/index.d.ts +13 -0
  39. package/es/core/components/SxpPageRender/PictureGroup/index.js +27 -0
  40. package/es/core/components/SxpPageRender/Popup/index.d.ts +3 -0
  41. package/es/core/components/SxpPageRender/Popup/index.js +60 -0
  42. package/es/core/components/SxpPageRender/ProductInfo/index.d.ts +14 -0
  43. package/es/core/components/SxpPageRender/ProductInfo/index.js +55 -0
  44. package/es/core/components/SxpPageRender/RenderCard.d.ts +11 -0
  45. package/es/core/components/SxpPageRender/RenderCard.js +40 -0
  46. package/es/core/components/SxpPageRender/ToggleButton/index.d.ts +10 -0
  47. package/es/core/components/SxpPageRender/ToggleButton/index.js +13 -0
  48. package/es/core/components/SxpPageRender/VideoWidget/index.d.ts +12 -0
  49. package/es/core/components/SxpPageRender/VideoWidget/index.js +219 -0
  50. package/es/core/components/SxpPageRender/WaterFall/List.d.ts +3 -0
  51. package/es/core/components/SxpPageRender/WaterFall/List.js +173 -0
  52. package/es/core/components/SxpPageRender/WaterFall/WaterfallList.d.ts +3 -0
  53. package/es/core/components/SxpPageRender/WaterFall/WaterfallList.js +317 -0
  54. package/es/core/components/SxpPageRender/WaterFall/index.d.ts +6 -0
  55. package/es/core/components/SxpPageRender/WaterFall/index.js +100 -0
  56. package/es/core/components/SxpPageRender/fakeData.d.ts +130 -0
  57. package/es/core/components/SxpPageRender/fakeData.js +899 -0
  58. package/es/core/components/SxpPageRender/index.d.ts +35 -0
  59. package/es/core/components/SxpPageRender/index.js +345 -0
  60. package/es/core/components/SxpPageRender/typing.d.ts +65 -0
  61. package/es/core/components/SxpPageRender/typing.js +1 -0
  62. package/es/core/components/SxpPageRender/useIconLink.d.ts +1 -0
  63. package/es/core/components/SxpPageRender/useIconLink.js +8 -0
  64. package/es/core/context/DataSourceProvider.d.ts +17 -0
  65. package/es/core/context/DataSourceProvider.js +45 -0
  66. package/es/core/context/EditorContext.d.ts +76 -0
  67. package/es/core/context/EditorContext.js +142 -0
  68. package/es/core/context/EditorDataProvider.d.ts +18 -0
  69. package/es/core/context/EditorDataProvider.js +20 -0
  70. package/es/core/context/SxpDataSourceProvider.d.ts +90 -0
  71. package/es/core/context/SxpDataSourceProvider.js +204 -0
  72. package/es/core/create.d.ts +37 -0
  73. package/es/core/create.js +4 -0
  74. package/es/core/hoc/withBindDataSource.d.ts +6 -0
  75. package/es/core/hoc/withBindDataSource.js +61 -0
  76. package/es/core/hooks/index.d.ts +4 -0
  77. package/es/core/hooks/index.js +4 -0
  78. package/es/core/hooks/useCurrentNode.d.ts +10 -0
  79. package/es/core/hooks/useCurrentNode.js +11 -0
  80. package/es/core/hooks/useDataSource.d.ts +2 -0
  81. package/es/core/hooks/useDataSource.js +6 -0
  82. package/es/core/hooks/useEditor.d.ts +1 -0
  83. package/es/core/hooks/useEditor.js +5 -0
  84. package/es/core/hooks/useEventReport.d.ts +5 -0
  85. package/es/core/hooks/useEventReport.js +73 -0
  86. package/es/core/hooks/useOnScreen.d.ts +2 -0
  87. package/es/core/hooks/useOnScreen.js +19 -0
  88. package/es/core/hooks/useSxpDataSource.d.ts +1 -0
  89. package/es/core/hooks/useSxpDataSource.js +5 -0
  90. package/es/core/index.d.ts +3 -0
  91. package/es/core/index.js +1 -0
  92. package/es/core/schema.d.ts +58 -0
  93. package/es/core/schema.js +1 -0
  94. package/es/core/utils/event.d.ts +7 -0
  95. package/es/core/utils/event.js +8 -0
  96. package/es/core/utils/getDataByDS.d.ts +6 -0
  97. package/es/core/utils/getDataByDS.js +39 -0
  98. package/es/core/utils/getSxpTokenInfo.d.ts +2 -0
  99. package/es/core/utils/getSxpTokenInfo.js +26 -0
  100. package/es/core/utils/localStore.d.ts +3 -0
  101. package/es/core/utils/localStore.js +14 -0
  102. package/es/core/utils/materials.d.ts +11 -0
  103. package/es/core/utils/materials.js +31 -0
  104. package/es/core/utils/sessionStore.d.ts +3 -0
  105. package/es/core/utils/sessionStore.js +26 -0
  106. package/es/core/utils/tool.d.ts +5 -0
  107. package/es/core/utils/tool.js +48 -0
  108. package/es/core/utils/unzip.d.ts +1 -0
  109. package/es/core/utils/unzip.js +10 -0
  110. package/es/index.d.ts +10 -0
  111. package/es/index.js +12 -0
  112. package/es/materials/index.d.ts +1 -0
  113. package/es/materials/index.js +1 -0
  114. package/es/materials/sxp/index.d.ts +2 -0
  115. package/es/materials/sxp/index.js +2 -0
  116. package/es/materials/sxp/popup/AppointForm/index.d.ts +18 -0
  117. package/es/materials/sxp/popup/AppointForm/index.js +77 -0
  118. package/es/materials/sxp/popup/AppointForm/interactionRender.d.ts +8 -0
  119. package/es/materials/sxp/popup/AppointForm/interactionRender.js +11 -0
  120. package/es/materials/sxp/popup/AppointForm/material.d.ts +2 -0
  121. package/es/materials/sxp/popup/AppointForm/material.js +36 -0
  122. package/es/materials/sxp/popup/AppointForm/settingRender.d.ts +65 -0
  123. package/es/materials/sxp/popup/AppointForm/settingRender.js +90 -0
  124. package/es/materials/sxp/popup/CommodityDetail/index.d.ts +14 -0
  125. package/es/materials/sxp/popup/CommodityDetail/index.js +85 -0
  126. package/es/materials/sxp/popup/CommodityDetail/material.d.ts +2 -0
  127. package/es/materials/sxp/popup/CommodityDetail/material.js +16 -0
  128. package/es/materials/sxp/popup/CommodityDetailDiro/index.d.ts +18 -0
  129. package/es/materials/sxp/popup/CommodityDetailDiro/index.js +162 -0
  130. package/es/materials/sxp/popup/CommodityDetailDiro/material.d.ts +2 -0
  131. package/es/materials/sxp/popup/CommodityDetailDiro/material.js +16 -0
  132. package/es/materials/sxp/popup/CommodityDetailDiroNew/index.d.ts +22 -0
  133. package/es/materials/sxp/popup/CommodityDetailDiroNew/index.js +129 -0
  134. package/es/materials/sxp/popup/CommodityDetailDiroNew/material.d.ts +2 -0
  135. package/es/materials/sxp/popup/CommodityDetailDiroNew/material.js +16 -0
  136. package/es/materials/sxp/popup/Prompt/index.d.ts +11 -0
  137. package/es/materials/sxp/popup/Prompt/index.js +22 -0
  138. package/es/materials/sxp/popup/Prompt/interactionRender.d.ts +8 -0
  139. package/es/materials/sxp/popup/Prompt/interactionRender.js +11 -0
  140. package/es/materials/sxp/popup/Prompt/material.d.ts +2 -0
  141. package/es/materials/sxp/popup/Prompt/material.js +28 -0
  142. package/es/materials/sxp/popup/Prompt/settingRender.d.ts +12 -0
  143. package/es/materials/sxp/popup/Prompt/settingRender.js +18 -0
  144. package/es/materials/sxp/popup/index.d.ts +5 -0
  145. package/es/materials/sxp/popup/index.js +5 -0
  146. package/es/materials/sxp/template/Appoint/index.d.ts +11 -0
  147. package/es/materials/sxp/template/Appoint/index.js +30 -0
  148. package/es/materials/sxp/template/Appoint/interactionRender.d.ts +8 -0
  149. package/es/materials/sxp/template/Appoint/interactionRender.js +11 -0
  150. package/es/materials/sxp/template/Appoint/material.d.ts +2 -0
  151. package/es/materials/sxp/template/Appoint/material.js +29 -0
  152. package/es/materials/sxp/template/Commodity/index.d.ts +11 -0
  153. package/es/materials/sxp/template/Commodity/index.js +44 -0
  154. package/es/materials/sxp/template/Commodity/interactionRender.d.ts +8 -0
  155. package/es/materials/sxp/template/Commodity/interactionRender.js +11 -0
  156. package/es/materials/sxp/template/Commodity/material.d.ts +2 -0
  157. package/es/materials/sxp/template/Commodity/material.js +26 -0
  158. package/es/materials/sxp/template/CommodityDiro/index.d.ts +11 -0
  159. package/es/materials/sxp/template/CommodityDiro/index.js +46 -0
  160. package/es/materials/sxp/template/CommodityDiro/interactionRender.d.ts +8 -0
  161. package/es/materials/sxp/template/CommodityDiro/interactionRender.js +11 -0
  162. package/es/materials/sxp/template/CommodityDiro/material.d.ts +2 -0
  163. package/es/materials/sxp/template/CommodityDiro/material.js +26 -0
  164. package/es/materials/sxp/template/CommodityDiroNew/index.d.ts +11 -0
  165. package/es/materials/sxp/template/CommodityDiroNew/index.js +46 -0
  166. package/es/materials/sxp/template/CommodityDiroNew/interactionRender.d.ts +8 -0
  167. package/es/materials/sxp/template/CommodityDiroNew/interactionRender.js +11 -0
  168. package/es/materials/sxp/template/CommodityDiroNew/material.d.ts +2 -0
  169. package/es/materials/sxp/template/CommodityDiroNew/material.js +26 -0
  170. package/es/materials/sxp/template/Link/index.d.ts +11 -0
  171. package/es/materials/sxp/template/Link/index.js +41 -0
  172. package/es/materials/sxp/template/Link/material.d.ts +2 -0
  173. package/es/materials/sxp/template/Link/material.js +26 -0
  174. package/es/materials/sxp/template/MultiCommodity/index.d.ts +12 -0
  175. package/es/materials/sxp/template/MultiCommodity/index.js +58 -0
  176. package/es/materials/sxp/template/MultiCommodity/interactionRender.d.ts +8 -0
  177. package/es/materials/sxp/template/MultiCommodity/interactionRender.js +11 -0
  178. package/es/materials/sxp/template/MultiCommodity/material.d.ts +2 -0
  179. package/es/materials/sxp/template/MultiCommodity/material.js +26 -0
  180. package/es/materials/sxp/template/MultiCommodityDiro/index.d.ts +12 -0
  181. package/es/materials/sxp/template/MultiCommodityDiro/index.js +60 -0
  182. package/es/materials/sxp/template/MultiCommodityDiro/interactionRender.d.ts +8 -0
  183. package/es/materials/sxp/template/MultiCommodityDiro/interactionRender.js +11 -0
  184. package/es/materials/sxp/template/MultiCommodityDiro/material.d.ts +2 -0
  185. package/es/materials/sxp/template/MultiCommodityDiro/material.js +26 -0
  186. package/es/materials/sxp/template/MultiCommodityDiroNew/index.d.ts +12 -0
  187. package/es/materials/sxp/template/MultiCommodityDiroNew/index.js +59 -0
  188. package/es/materials/sxp/template/MultiCommodityDiroNew/interactionRender.d.ts +8 -0
  189. package/es/materials/sxp/template/MultiCommodityDiroNew/interactionRender.js +11 -0
  190. package/es/materials/sxp/template/MultiCommodityDiroNew/material.d.ts +2 -0
  191. package/es/materials/sxp/template/MultiCommodityDiroNew/material.js +26 -0
  192. package/es/materials/sxp/template/components/EventProvider.d.ts +10 -0
  193. package/es/materials/sxp/template/components/EventProvider.js +33 -0
  194. package/es/materials/sxp/template/components/Img.d.ts +9 -0
  195. package/es/materials/sxp/template/components/Img.js +19 -0
  196. package/es/materials/sxp/template/components/Scroll.d.ts +9 -0
  197. package/es/materials/sxp/template/components/Scroll.js +10 -0
  198. package/es/materials/sxp/template/index.d.ts +8 -0
  199. package/es/materials/sxp/template/index.js +8 -0
  200. package/lib/core/Pagebuilder/PagebuilderClass.d.ts +15 -0
  201. package/lib/core/Pagebuilder/PagebuilderClass.js +45 -0
  202. package/lib/core/Pagebuilder/index.d.ts +3 -0
  203. package/lib/core/Pagebuilder/index.js +99 -0
  204. package/lib/core/Pagebuilder/type.d.ts +55 -0
  205. package/lib/core/Pagebuilder/type.js +2 -0
  206. package/lib/core/components/SxpPageCore/index.d.ts +11 -0
  207. package/lib/core/components/SxpPageCore/index.js +29 -0
  208. package/lib/core/components/SxpPageRender/ExpandableText.d.ts +12 -0
  209. package/lib/core/components/SxpPageRender/ExpandableText.js +57 -0
  210. package/lib/core/components/SxpPageRender/FingerSwipeTip/index.d.ts +6 -0
  211. package/lib/core/components/SxpPageRender/FingerSwipeTip/index.js +22 -0
  212. package/lib/core/components/SxpPageRender/Hashtag/index.d.ts +11 -0
  213. package/lib/core/components/SxpPageRender/Hashtag/index.js +43 -0
  214. package/lib/core/components/SxpPageRender/LikeButton/index.d.ts +10 -0
  215. package/lib/core/components/SxpPageRender/LikeButton/index.js +60 -0
  216. package/lib/core/components/SxpPageRender/Modal/index.d.ts +9 -0
  217. package/lib/core/components/SxpPageRender/Modal/index.js +47 -0
  218. package/lib/core/components/SxpPageRender/Navbar.d.ts +8 -0
  219. package/lib/core/components/SxpPageRender/Navbar.js +12 -0
  220. package/lib/core/components/SxpPageRender/PictureGroup/Picture.d.ts +8 -0
  221. package/lib/core/components/SxpPageRender/PictureGroup/Picture.js +22 -0
  222. package/lib/core/components/SxpPageRender/PictureGroup/index.d.ts +13 -0
  223. package/lib/core/components/SxpPageRender/PictureGroup/index.js +30 -0
  224. package/lib/core/components/SxpPageRender/Popup/index.d.ts +3 -0
  225. package/lib/core/components/SxpPageRender/Popup/index.js +63 -0
  226. package/lib/core/components/SxpPageRender/ProductInfo/index.d.ts +14 -0
  227. package/lib/core/components/SxpPageRender/ProductInfo/index.js +58 -0
  228. package/lib/core/components/SxpPageRender/RenderCard.d.ts +11 -0
  229. package/lib/core/components/SxpPageRender/RenderCard.js +43 -0
  230. package/lib/core/components/SxpPageRender/ToggleButton/index.d.ts +10 -0
  231. package/lib/core/components/SxpPageRender/ToggleButton/index.js +16 -0
  232. package/lib/core/components/SxpPageRender/VideoWidget/index.d.ts +12 -0
  233. package/lib/core/components/SxpPageRender/VideoWidget/index.js +222 -0
  234. package/lib/core/components/SxpPageRender/WaterFall/List.d.ts +3 -0
  235. package/lib/core/components/SxpPageRender/WaterFall/List.js +177 -0
  236. package/lib/core/components/SxpPageRender/WaterFall/WaterfallList.d.ts +3 -0
  237. package/lib/core/components/SxpPageRender/WaterFall/WaterfallList.js +321 -0
  238. package/lib/core/components/SxpPageRender/WaterFall/index.d.ts +6 -0
  239. package/lib/core/components/SxpPageRender/WaterFall/index.js +103 -0
  240. package/lib/core/components/SxpPageRender/fakeData.d.ts +130 -0
  241. package/lib/core/components/SxpPageRender/fakeData.js +902 -0
  242. package/lib/core/components/SxpPageRender/index.d.ts +35 -0
  243. package/lib/core/components/SxpPageRender/index.js +348 -0
  244. package/lib/core/components/SxpPageRender/typing.d.ts +65 -0
  245. package/lib/core/components/SxpPageRender/typing.js +2 -0
  246. package/lib/core/components/SxpPageRender/useIconLink.d.ts +1 -0
  247. package/lib/core/components/SxpPageRender/useIconLink.js +12 -0
  248. package/lib/core/context/DataSourceProvider.d.ts +17 -0
  249. package/lib/core/context/DataSourceProvider.js +48 -0
  250. package/lib/core/context/EditorContext.d.ts +76 -0
  251. package/lib/core/context/EditorContext.js +146 -0
  252. package/lib/core/context/EditorDataProvider.d.ts +18 -0
  253. package/lib/core/context/EditorDataProvider.js +25 -0
  254. package/lib/core/context/SxpDataSourceProvider.d.ts +90 -0
  255. package/lib/core/context/SxpDataSourceProvider.js +207 -0
  256. package/lib/core/create.d.ts +37 -0
  257. package/lib/core/create.js +8 -0
  258. package/lib/core/hoc/withBindDataSource.d.ts +6 -0
  259. package/lib/core/hoc/withBindDataSource.js +63 -0
  260. package/lib/core/hooks/index.d.ts +4 -0
  261. package/lib/core/hooks/index.js +7 -0
  262. package/lib/core/hooks/useCurrentNode.d.ts +10 -0
  263. package/lib/core/hooks/useCurrentNode.js +14 -0
  264. package/lib/core/hooks/useDataSource.d.ts +2 -0
  265. package/lib/core/hooks/useDataSource.js +9 -0
  266. package/lib/core/hooks/useEditor.d.ts +1 -0
  267. package/lib/core/hooks/useEditor.js +9 -0
  268. package/lib/core/hooks/useEventReport.d.ts +5 -0
  269. package/lib/core/hooks/useEventReport.js +77 -0
  270. package/lib/core/hooks/useOnScreen.d.ts +2 -0
  271. package/lib/core/hooks/useOnScreen.js +22 -0
  272. package/lib/core/hooks/useSxpDataSource.d.ts +1 -0
  273. package/lib/core/hooks/useSxpDataSource.js +9 -0
  274. package/lib/core/index.d.ts +3 -0
  275. package/lib/core/index.js +5 -0
  276. package/lib/core/schema.d.ts +58 -0
  277. package/lib/core/schema.js +2 -0
  278. package/lib/core/utils/event.d.ts +7 -0
  279. package/lib/core/utils/event.js +12 -0
  280. package/lib/core/utils/getDataByDS.d.ts +6 -0
  281. package/lib/core/utils/getDataByDS.js +41 -0
  282. package/lib/core/utils/getSxpTokenInfo.d.ts +2 -0
  283. package/lib/core/utils/getSxpTokenInfo.js +30 -0
  284. package/lib/core/utils/localStore.d.ts +3 -0
  285. package/lib/core/utils/localStore.js +19 -0
  286. package/lib/core/utils/materials.d.ts +11 -0
  287. package/lib/core/utils/materials.js +37 -0
  288. package/lib/core/utils/sessionStore.d.ts +3 -0
  289. package/lib/core/utils/sessionStore.js +32 -0
  290. package/lib/core/utils/tool.d.ts +5 -0
  291. package/lib/core/utils/tool.js +54 -0
  292. package/lib/core/utils/unzip.d.ts +1 -0
  293. package/lib/core/utils/unzip.js +15 -0
  294. package/lib/index.d.ts +10 -0
  295. package/lib/index.js +20 -0
  296. package/lib/materials/index.d.ts +1 -0
  297. package/lib/materials/index.js +4 -0
  298. package/lib/materials/sxp/index.d.ts +2 -0
  299. package/lib/materials/sxp/index.js +5 -0
  300. package/lib/materials/sxp/popup/AppointForm/index.d.ts +18 -0
  301. package/lib/materials/sxp/popup/AppointForm/index.js +79 -0
  302. package/lib/materials/sxp/popup/AppointForm/interactionRender.d.ts +8 -0
  303. package/lib/materials/sxp/popup/AppointForm/interactionRender.js +13 -0
  304. package/lib/materials/sxp/popup/AppointForm/material.d.ts +2 -0
  305. package/lib/materials/sxp/popup/AppointForm/material.js +40 -0
  306. package/lib/materials/sxp/popup/AppointForm/settingRender.d.ts +65 -0
  307. package/lib/materials/sxp/popup/AppointForm/settingRender.js +92 -0
  308. package/lib/materials/sxp/popup/CommodityDetail/index.d.ts +14 -0
  309. package/lib/materials/sxp/popup/CommodityDetail/index.js +87 -0
  310. package/lib/materials/sxp/popup/CommodityDetail/material.d.ts +2 -0
  311. package/lib/materials/sxp/popup/CommodityDetail/material.js +20 -0
  312. package/lib/materials/sxp/popup/CommodityDetailDiro/index.d.ts +18 -0
  313. package/lib/materials/sxp/popup/CommodityDetailDiro/index.js +164 -0
  314. package/lib/materials/sxp/popup/CommodityDetailDiro/material.d.ts +2 -0
  315. package/lib/materials/sxp/popup/CommodityDetailDiro/material.js +20 -0
  316. package/lib/materials/sxp/popup/CommodityDetailDiroNew/index.d.ts +22 -0
  317. package/lib/materials/sxp/popup/CommodityDetailDiroNew/index.js +131 -0
  318. package/lib/materials/sxp/popup/CommodityDetailDiroNew/material.d.ts +2 -0
  319. package/lib/materials/sxp/popup/CommodityDetailDiroNew/material.js +20 -0
  320. package/lib/materials/sxp/popup/Prompt/index.d.ts +11 -0
  321. package/lib/materials/sxp/popup/Prompt/index.js +24 -0
  322. package/lib/materials/sxp/popup/Prompt/interactionRender.d.ts +8 -0
  323. package/lib/materials/sxp/popup/Prompt/interactionRender.js +13 -0
  324. package/lib/materials/sxp/popup/Prompt/material.d.ts +2 -0
  325. package/lib/materials/sxp/popup/Prompt/material.js +32 -0
  326. package/lib/materials/sxp/popup/Prompt/settingRender.d.ts +12 -0
  327. package/lib/materials/sxp/popup/Prompt/settingRender.js +20 -0
  328. package/lib/materials/sxp/popup/index.d.ts +5 -0
  329. package/lib/materials/sxp/popup/index.js +8 -0
  330. package/lib/materials/sxp/template/Appoint/index.d.ts +11 -0
  331. package/lib/materials/sxp/template/Appoint/index.js +32 -0
  332. package/lib/materials/sxp/template/Appoint/interactionRender.d.ts +8 -0
  333. package/lib/materials/sxp/template/Appoint/interactionRender.js +13 -0
  334. package/lib/materials/sxp/template/Appoint/material.d.ts +2 -0
  335. package/lib/materials/sxp/template/Appoint/material.js +33 -0
  336. package/lib/materials/sxp/template/Commodity/index.d.ts +11 -0
  337. package/lib/materials/sxp/template/Commodity/index.js +46 -0
  338. package/lib/materials/sxp/template/Commodity/interactionRender.d.ts +8 -0
  339. package/lib/materials/sxp/template/Commodity/interactionRender.js +13 -0
  340. package/lib/materials/sxp/template/Commodity/material.d.ts +2 -0
  341. package/lib/materials/sxp/template/Commodity/material.js +30 -0
  342. package/lib/materials/sxp/template/CommodityDiro/index.d.ts +11 -0
  343. package/lib/materials/sxp/template/CommodityDiro/index.js +48 -0
  344. package/lib/materials/sxp/template/CommodityDiro/interactionRender.d.ts +8 -0
  345. package/lib/materials/sxp/template/CommodityDiro/interactionRender.js +13 -0
  346. package/lib/materials/sxp/template/CommodityDiro/material.d.ts +2 -0
  347. package/lib/materials/sxp/template/CommodityDiro/material.js +30 -0
  348. package/lib/materials/sxp/template/CommodityDiroNew/index.d.ts +11 -0
  349. package/lib/materials/sxp/template/CommodityDiroNew/index.js +48 -0
  350. package/lib/materials/sxp/template/CommodityDiroNew/interactionRender.d.ts +8 -0
  351. package/lib/materials/sxp/template/CommodityDiroNew/interactionRender.js +13 -0
  352. package/lib/materials/sxp/template/CommodityDiroNew/material.d.ts +2 -0
  353. package/lib/materials/sxp/template/CommodityDiroNew/material.js +30 -0
  354. package/lib/materials/sxp/template/Link/index.d.ts +11 -0
  355. package/lib/materials/sxp/template/Link/index.js +43 -0
  356. package/lib/materials/sxp/template/Link/material.d.ts +2 -0
  357. package/lib/materials/sxp/template/Link/material.js +30 -0
  358. package/lib/materials/sxp/template/MultiCommodity/index.d.ts +12 -0
  359. package/lib/materials/sxp/template/MultiCommodity/index.js +60 -0
  360. package/lib/materials/sxp/template/MultiCommodity/interactionRender.d.ts +8 -0
  361. package/lib/materials/sxp/template/MultiCommodity/interactionRender.js +13 -0
  362. package/lib/materials/sxp/template/MultiCommodity/material.d.ts +2 -0
  363. package/lib/materials/sxp/template/MultiCommodity/material.js +30 -0
  364. package/lib/materials/sxp/template/MultiCommodityDiro/index.d.ts +12 -0
  365. package/lib/materials/sxp/template/MultiCommodityDiro/index.js +62 -0
  366. package/lib/materials/sxp/template/MultiCommodityDiro/interactionRender.d.ts +8 -0
  367. package/lib/materials/sxp/template/MultiCommodityDiro/interactionRender.js +13 -0
  368. package/lib/materials/sxp/template/MultiCommodityDiro/material.d.ts +2 -0
  369. package/lib/materials/sxp/template/MultiCommodityDiro/material.js +30 -0
  370. package/lib/materials/sxp/template/MultiCommodityDiroNew/index.d.ts +12 -0
  371. package/lib/materials/sxp/template/MultiCommodityDiroNew/index.js +61 -0
  372. package/lib/materials/sxp/template/MultiCommodityDiroNew/interactionRender.d.ts +8 -0
  373. package/lib/materials/sxp/template/MultiCommodityDiroNew/interactionRender.js +13 -0
  374. package/lib/materials/sxp/template/MultiCommodityDiroNew/material.d.ts +2 -0
  375. package/lib/materials/sxp/template/MultiCommodityDiroNew/material.js +30 -0
  376. package/lib/materials/sxp/template/components/EventProvider.d.ts +10 -0
  377. package/lib/materials/sxp/template/components/EventProvider.js +35 -0
  378. package/lib/materials/sxp/template/components/Img.d.ts +9 -0
  379. package/lib/materials/sxp/template/components/Img.js +22 -0
  380. package/lib/materials/sxp/template/components/Scroll.d.ts +9 -0
  381. package/lib/materials/sxp/template/components/Scroll.js +13 -0
  382. package/lib/materials/sxp/template/index.d.ts +8 -0
  383. package/lib/materials/sxp/template/index.js +11 -0
  384. package/package.json +113 -0
@@ -0,0 +1,60 @@
1
+ import React, { useEffect, useMemo, useRef, useState } from 'react';
2
+ import Modal from '../Modal';
3
+ import { useEditor, useSxpDataSource } from '../../../../core/hooks';
4
+ import withBindDataSource from '../../../../core/hoc/withBindDataSource';
5
+ import { useEventReport } from '../../../../core/hooks/useEventReport';
6
+ const Popup = () => {
7
+ const { schema, resolver, popup } = useEditor();
8
+ const { setPopupDetailData, popupDetailData, bffEventReport } = useSxpDataSource();
9
+ const { productView } = useEventReport();
10
+ const [visible, setVisible] = useState(false);
11
+ const curTimeRef = useRef(null);
12
+ useEffect(() => {
13
+ const initTime = () => {
14
+ curTimeRef.current = new Date();
15
+ };
16
+ initTime();
17
+ window.addEventListener('pageshow', initTime);
18
+ return () => {
19
+ window.removeEventListener('pageshow', initTime);
20
+ };
21
+ }, []);
22
+ useEffect(() => {
23
+ if (popup && popup !== '') {
24
+ curTimeRef.current = new Date();
25
+ setVisible(true);
26
+ }
27
+ }, [popup]);
28
+ const handleClose = () => {
29
+ var _a, _b, _c;
30
+ if (!popup || popup === '' || !visible || new Date() - curTimeRef.current < 1200) {
31
+ return;
32
+ }
33
+ setVisible(false);
34
+ const data = popupDetailData;
35
+ const product = (_a = data === null || data === void 0 ? void 0 : data.video) === null || _a === void 0 ? void 0 : _a.bindProduct;
36
+ const cta = (_c = (_b = data === null || data === void 0 ? void 0 : data.video) === null || _b === void 0 ? void 0 : _b.bindProduct) === null || _c === void 0 ? void 0 : _c.bindCta;
37
+ if (product && cta) {
38
+ productView(data, product, cta, curTimeRef.current);
39
+ }
40
+ setTimeout(() => {
41
+ window === null || window === void 0 ? void 0 : window.sxpPopup('');
42
+ setPopupDetailData === null || setPopupDetailData === void 0 ? void 0 : setPopupDetailData(null);
43
+ }, 1200);
44
+ };
45
+ const renderPopupDetail = useMemo(() => {
46
+ var _a, _b, _c;
47
+ return (_c = (_b = (_a = schema === null || schema === void 0 ? void 0 : schema.sxpPageConf) === null || _a === void 0 ? void 0 : _a.globalConfig) === null || _b === void 0 ? void 0 : _b.popupList) === null || _c === void 0 ? void 0 : _c.map((value, index) => {
48
+ var _a, _b, _c, _d, _e, _f, _g;
49
+ if ((value === null || value === void 0 ? void 0 : value.id) === popup) {
50
+ const Component = withBindDataSource(resolver[(_a = value === null || value === void 0 ? void 0 : value.item) === null || _a === void 0 ? void 0 : _a.type]);
51
+ return (React.createElement(Component, Object.assign({ key: index, style: Object.assign(Object.assign({}, (_b = value === null || value === void 0 ? void 0 : value.item) === null || _b === void 0 ? void 0 : _b.style), { width: '100%', height: '80vh', overflow: 'auto' }), textStyle: (_c = value === null || value === void 0 ? void 0 : value.item) === null || _c === void 0 ? void 0 : _c.textStyle, bindDatas: (_e = (_d = value === null || value === void 0 ? void 0 : value.item) === null || _d === void 0 ? void 0 : _d.bindDatas) !== null && _e !== void 0 ? _e : [] }, (_f = value === null || value === void 0 ? void 0 : value.item) === null || _f === void 0 ? void 0 : _f.props, { event: ((_g = value === null || value === void 0 ? void 0 : value.item) === null || _g === void 0 ? void 0 : _g.event) || {}, schema: schema, id: value === null || value === void 0 ? void 0 : value.id })));
52
+ }
53
+ else {
54
+ return React.createElement(React.Fragment, null);
55
+ }
56
+ });
57
+ }, [schema, popup, resolver]);
58
+ return (React.createElement(Modal, { visible: !!visible, onClose: handleClose, padding: 0, modalStyle: { position: 'fixed' } }, renderPopupDetail));
59
+ };
60
+ export default Popup;
@@ -0,0 +1,14 @@
1
+ import React from 'react';
2
+ import { RecItemType } from '../typing';
3
+ interface IProductInfoProps {
4
+ data: RecItemType;
5
+ height: number;
6
+ width: number;
7
+ viewTime: any;
8
+ tipText?: {
9
+ foldText?: string;
10
+ unfoldText?: string;
11
+ };
12
+ }
13
+ declare const _default: React.NamedExoticComponent<IProductInfoProps>;
14
+ export default _default;
@@ -0,0 +1,55 @@
1
+ import React, { useMemo, useState } from 'react';
2
+ import { Pagination, Autoplay } from 'swiper/modules';
3
+ import { SwiperSlide, Swiper } from 'swiper/react';
4
+ import ExpandableText from '../ExpandableText';
5
+ import Modal from '../Modal';
6
+ import { useEventReport } from '../../../../core/hooks/useEventReport';
7
+ const ProductInfo = ({ data, height, width, viewTime, tipText }) => {
8
+ var _a, _b;
9
+ const product = data === null || data === void 0 ? void 0 : data.product;
10
+ const cta = (_a = data === null || data === void 0 ? void 0 : data.product) === null || _a === void 0 ? void 0 : _a.bindCta;
11
+ const [showModal, setShowModal] = useState(false);
12
+ const { jumpToWeb } = useEventReport();
13
+ const priceText = useMemo(() => {
14
+ var _a, _b, _c, _d, _e;
15
+ if ((product === null || product === void 0 ? void 0 : product.currency) && (product === null || product === void 0 ? void 0 : product.price)) {
16
+ return `${(_c = (_b = (_a = product === null || product === void 0 ? void 0 : product.currency) === null || _a === void 0 ? void 0 : _a.split('-')[1]) === null || _b === void 0 ? void 0 : _b.toUpperCase()) !== null && _c !== void 0 ? _c : ''}${(_e = (_d = product === null || product === void 0 ? void 0 : product.price) === null || _d === void 0 ? void 0 : _d.toLocaleString('zh', {
17
+ minimumFractionDigits: 0
18
+ })) !== null && _e !== void 0 ? _e : ''}`;
19
+ }
20
+ else {
21
+ return '$7,000';
22
+ }
23
+ }, [product === null || product === void 0 ? void 0 : product.price, product === null || product === void 0 ? void 0 : product.currency]);
24
+ const handleLInk = (link) => {
25
+ if (link) {
26
+ jumpToWeb(data, product, cta);
27
+ window.location.href = window.getJointUtmLink(link);
28
+ }
29
+ };
30
+ return (React.createElement("div", { style: { height, width: '100%' } },
31
+ React.createElement(Swiper, { height: height * 0.5, modules: [Pagination, Autoplay], pagination: { clickable: true, bulletActiveClass: 'swipe-item-active-bullet' }, loop: true, autoplay: {
32
+ delay: 3000
33
+ } }, (_b = product === null || product === void 0 ? void 0 : product.homePage) === null || _b === void 0 ? void 0 : _b.map((src) => {
34
+ return (React.createElement(SwiperSlide, { key: src },
35
+ React.createElement("div", { style: {
36
+ overflow: 'hidden',
37
+ width,
38
+ height: height * 0.5
39
+ } },
40
+ React.createElement("img", { src: src, style: { height: '100%', width: '100%', objectFit: 'cover' } }))));
41
+ })),
42
+ React.createElement("div", { className: 'product-info' },
43
+ React.createElement("div", { className: 'collection' }, product === null || product === void 0 ? void 0 : product.collection),
44
+ React.createElement("div", { className: 'title' }, product === null || product === void 0 ? void 0 : product.title),
45
+ React.createElement("div", { className: 'price' }, priceText),
46
+ React.createElement(ExpandableText, { foldText: tipText === null || tipText === void 0 ? void 0 : tipText.foldText, unfoldText: tipText === null || tipText === void 0 ? void 0 : tipText.unfoldText, onClick: () => setShowModal(true), className: 'info', text: (product === null || product === void 0 ? void 0 : product.info) || '', maxStr: 79 }),
47
+ React.createElement("a", { target: '_blank', className: 'pb-modal-btn', onClick: () => handleLInk(product === null || product === void 0 ? void 0 : product.link) }, cta === null || cta === void 0 ? void 0 : cta.enTitle)),
48
+ React.createElement(Modal, { visible: showModal, onClose: () => setShowModal(false) },
49
+ React.createElement("div", { className: 'modal-collection' }, product === null || product === void 0 ? void 0 : product.collection),
50
+ React.createElement("div", { className: 'modal-title' }, product === null || product === void 0 ? void 0 : product.title),
51
+ React.createElement("div", { className: 'modal-price' }, priceText),
52
+ React.createElement("div", { className: 'modal-info' }, product === null || product === void 0 ? void 0 : product.info),
53
+ (product === null || product === void 0 ? void 0 : product.link) && (React.createElement("a", { target: '_blank', className: 'pb-modal-btn', onClick: () => handleLInk(product === null || product === void 0 ? void 0 : product.link) }, cta === null || cta === void 0 ? void 0 : cta.enTitle)))));
54
+ };
55
+ export default React.memo(ProductInfo);
@@ -0,0 +1,11 @@
1
+ import React from 'react';
2
+ import './index.less';
3
+ import { RecItemType } from './typing';
4
+ interface IRenderCardProps {
5
+ index: number;
6
+ rec: RecItemType;
7
+ tempMap?: Record<string, any>;
8
+ resolver: any;
9
+ }
10
+ declare const _default: React.NamedExoticComponent<IRenderCardProps>;
11
+ export default _default;
@@ -0,0 +1,40 @@
1
+ import React, { memo, useMemo } from 'react';
2
+ import './index.less';
3
+ import withBindDataSource from '../../../core/hoc/withBindDataSource';
4
+ import { useEditor } from '../../../core/hooks';
5
+ const RenderCard = ({ rec, index, tempMap, resolver }) => {
6
+ const { schema } = useEditor();
7
+ const renderComp = useMemo(() => {
8
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _0, _1, _2;
9
+ if (!(rec === null || rec === void 0 ? void 0 : rec.video))
10
+ return null;
11
+ let cta = null;
12
+ if ((_b = (_a = rec === null || rec === void 0 ? void 0 : rec.video) === null || _a === void 0 ? void 0 : _a.bindProducts) === null || _b === void 0 ? void 0 : _b.length) {
13
+ cta = '多商品CTA';
14
+ }
15
+ else if ((_c = rec === null || rec === void 0 ? void 0 : rec.video) === null || _c === void 0 ? void 0 : _c.bindProduct) {
16
+ cta = '商品CTA';
17
+ }
18
+ else {
19
+ cta = (_e = (_d = rec === null || rec === void 0 ? void 0 : rec.video) === null || _d === void 0 ? void 0 : _d.bindCta) === null || _e === void 0 ? void 0 : _e.itemId;
20
+ }
21
+ const value = tempMap === null || tempMap === void 0 ? void 0 : tempMap[cta];
22
+ if ((((_f = value === null || value === void 0 ? void 0 : value.item) === null || _f === void 0 ? void 0 : _f.type) === 'CommodityDiro' && !((_g = rec === null || rec === void 0 ? void 0 : rec.video) === null || _g === void 0 ? void 0 : _g.bindProduct)) ||
23
+ (((_h = value === null || value === void 0 ? void 0 : value.item) === null || _h === void 0 ? void 0 : _h.type) === 'Commodity' && !((_j = rec === null || rec === void 0 ? void 0 : rec.video) === null || _j === void 0 ? void 0 : _j.bindProduct)) ||
24
+ (((_k = value === null || value === void 0 ? void 0 : value.item) === null || _k === void 0 ? void 0 : _k.type) === 'CommodityDiroNew' && !((_l = rec === null || rec === void 0 ? void 0 : rec.video) === null || _l === void 0 ? void 0 : _l.bindProduct)) ||
25
+ (((_m = value === null || value === void 0 ? void 0 : value.item) === null || _m === void 0 ? void 0 : _m.type) === 'MultiCommodity' && !((_p = (_o = rec === null || rec === void 0 ? void 0 : rec.video) === null || _o === void 0 ? void 0 : _o.bindProducts) === null || _p === void 0 ? void 0 : _p.length)) ||
26
+ (((_q = value === null || value === void 0 ? void 0 : value.item) === null || _q === void 0 ? void 0 : _q.type) === 'MultiCommodityDiro' && !((_s = (_r = rec === null || rec === void 0 ? void 0 : rec.video) === null || _r === void 0 ? void 0 : _r.bindProducts) === null || _s === void 0 ? void 0 : _s.length)) ||
27
+ (((_t = value === null || value === void 0 ? void 0 : value.item) === null || _t === void 0 ? void 0 : _t.type) === 'MultiCommodityDiroNew' && !((_v = (_u = rec === null || rec === void 0 ? void 0 : rec.video) === null || _u === void 0 ? void 0 : _u.bindProducts) === null || _v === void 0 ? void 0 : _v.length))) {
28
+ return null;
29
+ }
30
+ if (value && resolver) {
31
+ const Component = withBindDataSource(resolver[(_w = value === null || value === void 0 ? void 0 : value.item) === null || _w === void 0 ? void 0 : _w.type]);
32
+ return (React.createElement(Component, Object.assign({ style: Object.assign(Object.assign({}, (_x = value === null || value === void 0 ? void 0 : value.item) === null || _x === void 0 ? void 0 : _x.style), { zIndex: 50, marginLeft: '20px' }), textStyle: (_y = value === null || value === void 0 ? void 0 : value.item) === null || _y === void 0 ? void 0 : _y.textStyle, bindDatas: (_0 = (_z = value === null || value === void 0 ? void 0 : value.item) === null || _z === void 0 ? void 0 : _z.bindDatas) !== null && _0 !== void 0 ? _0 : [] }, (_1 = value === null || value === void 0 ? void 0 : value.item) === null || _1 === void 0 ? void 0 : _1.props, { event: ((_2 = value === null || value === void 0 ? void 0 : value.item) === null || _2 === void 0 ? void 0 : _2.event) || {}, schema: schema, id: value === null || value === void 0 ? void 0 : value.id, key: value === null || value === void 0 ? void 0 : value.id, recData: rec })));
33
+ }
34
+ else {
35
+ return null;
36
+ }
37
+ }, [rec, resolver, tempMap, schema]);
38
+ return React.createElement(React.Fragment, null, renderComp);
39
+ };
40
+ export default memo(RenderCard);
@@ -0,0 +1,10 @@
1
+ import React, { CSSProperties } from 'react';
2
+ interface IToggleButtonProps {
3
+ activeIcon?: string;
4
+ unactiveIcon?: string;
5
+ onChange?: (result: boolean) => void;
6
+ defaultValue?: boolean;
7
+ style?: CSSProperties;
8
+ }
9
+ declare const _default: React.NamedExoticComponent<IToggleButtonProps>;
10
+ export default _default;
@@ -0,0 +1,13 @@
1
+ import React, { memo, useState } from 'react';
2
+ const ToggleButton = ({ defaultValue, activeIcon, unactiveIcon, onChange, style }) => {
3
+ const [isTrue, setIsTure] = useState(defaultValue);
4
+ const handleClick = (e) => {
5
+ e.stopPropagation();
6
+ const result = !isTrue;
7
+ setIsTure(result);
8
+ onChange === null || onChange === void 0 ? void 0 : onChange(result);
9
+ };
10
+ return (React.createElement("button", { style: style, className: 'pb-toggle-button', onClick: handleClick },
11
+ React.createElement("img", { className: 'pb-toggle-button-icon', src: isTrue ? activeIcon : unactiveIcon })));
12
+ };
13
+ export default memo(ToggleButton);
@@ -0,0 +1,12 @@
1
+ import React from 'react';
2
+ import { RecItemType } from '../typing';
3
+ interface IVideoWidgetProps {
4
+ rec: RecItemType;
5
+ index: number;
6
+ height: number;
7
+ data: RecItemType[];
8
+ muted: boolean;
9
+ activeIndex?: number;
10
+ }
11
+ declare const _default: React.NamedExoticComponent<IVideoWidgetProps>;
12
+ export default _default;
@@ -0,0 +1,219 @@
1
+ import React, { memo, useCallback, useEffect, useMemo, useRef, useState } from 'react';
2
+ import { useSwiperSlide } from 'swiper/react';
3
+ import { useIconLink } from '../useIconLink';
4
+ import { useSxpDataSource } from '../../../../core/hooks';
5
+ import SXP_EVENT_BUS, { SXP_EVENT_TYPE } from '../../../../core/utils/event';
6
+ const VideoWidget = ({ rec, index, height, data, muted, activeIndex }) => {
7
+ const [isPauseVideo, setIsPauseVideo] = useState(false);
8
+ const videoRef = useRef(null);
9
+ const { bffEventReport, sxpParameter, waterFallData, openHashtag } = useSxpDataSource();
10
+ const videoStartTime = useRef(0);
11
+ const [isLoad, setIsLoad] = useState(false);
12
+ const { isActive } = useSwiperSlide();
13
+ useEffect(() => {
14
+ if (!videoRef.current)
15
+ return;
16
+ videoRef.current.muted = muted;
17
+ }, [muted]);
18
+ const handleVideoStart = useCallback(() => {
19
+ var _a;
20
+ (_a = videoRef.current) === null || _a === void 0 ? void 0 : _a.play();
21
+ }, []);
22
+ const PAUSE_ICON = useIconLink('/pb_static/06f28a2025c74c1cb49be6767316d827.png');
23
+ const handlePlaying = useCallback(() => {
24
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o;
25
+ setIsPauseVideo(false);
26
+ const item = data[index];
27
+ if (item && isLoad && ((_a = videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) === null || _a === void 0 ? void 0 : _a.duration)) {
28
+ videoStartTime.current = ((_b = videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) === null || _b === void 0 ? void 0 : _b.currentTime) || 0;
29
+ const videoDuration = ((_d = (_c = videoRef.current) === null || _c === void 0 ? void 0 : _c.duration) !== null && _d !== void 0 ? _d : 0).toFixed(2);
30
+ const videoCurrentTime = ((_f = (_e = videoRef.current) === null || _e === void 0 ? void 0 : _e.currentTime) !== null && _f !== void 0 ? _f : 0).toFixed(2);
31
+ const playType = '1';
32
+ bffEventReport === null || bffEventReport === void 0 ? void 0 : bffEventReport({
33
+ eventInfo: {
34
+ eventSubject: 'playVideo',
35
+ eventDescription: 'User played the video',
36
+ contentId: (_h = (_g = item.video) === null || _g === void 0 ? void 0 : _g.itemId) !== null && _h !== void 0 ? _h : '',
37
+ contentName: (_k = (_j = item.video) === null || _j === void 0 ? void 0 : _j.title) !== null && _k !== void 0 ? _k : '',
38
+ playType,
39
+ startTime: videoCurrentTime,
40
+ videoDuration,
41
+ contentTags: JSON.stringify((_m = (_l = item.video) === null || _l === void 0 ? void 0 : _l.tags) !== null && _m !== void 0 ? _m : []),
42
+ position: item.position,
43
+ contentFormat: 'video',
44
+ traceInfo: (_o = item.video) === null || _o === void 0 ? void 0 : _o.traceInfo
45
+ }
46
+ });
47
+ }
48
+ if (!isLoad) {
49
+ setIsLoad(true);
50
+ }
51
+ }, [bffEventReport, data, index, isLoad]);
52
+ const handleLoadedMetadata = useCallback(() => {
53
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o;
54
+ const item = data[index];
55
+ if (item && !isLoad && ((_a = videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) === null || _a === void 0 ? void 0 : _a.duration)) {
56
+ videoStartTime.current = ((_b = videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) === null || _b === void 0 ? void 0 : _b.currentTime) || 0;
57
+ const videoDuration = ((_d = (_c = videoRef.current) === null || _c === void 0 ? void 0 : _c.duration) !== null && _d !== void 0 ? _d : 0).toFixed(2);
58
+ const videoCurrentTime = ((_f = (_e = videoRef.current) === null || _e === void 0 ? void 0 : _e.currentTime) !== null && _f !== void 0 ? _f : 0).toFixed(2);
59
+ const playType = '0';
60
+ bffEventReport === null || bffEventReport === void 0 ? void 0 : bffEventReport({
61
+ eventInfo: {
62
+ eventSubject: 'playVideo',
63
+ eventDescription: 'User played the video',
64
+ contentId: (_h = (_g = item.video) === null || _g === void 0 ? void 0 : _g.itemId) !== null && _h !== void 0 ? _h : '',
65
+ contentName: (_k = (_j = item.video) === null || _j === void 0 ? void 0 : _j.title) !== null && _k !== void 0 ? _k : '',
66
+ playType,
67
+ startTime: videoCurrentTime,
68
+ videoDuration,
69
+ contentTags: JSON.stringify((_m = (_l = item.video) === null || _l === void 0 ? void 0 : _l.tags) !== null && _m !== void 0 ? _m : []),
70
+ position: item.position,
71
+ contentFormat: 'video',
72
+ traceInfo: (_o = item.video) === null || _o === void 0 ? void 0 : _o.traceInfo
73
+ }
74
+ });
75
+ }
76
+ setTimeout(() => {
77
+ var _a;
78
+ (_a = videoRef.current) === null || _a === void 0 ? void 0 : _a.play();
79
+ }, 0);
80
+ }, [index, bffEventReport, data, isLoad]);
81
+ const handleClickVideo = useCallback((type) => () => {
82
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j;
83
+ if (!isLoad)
84
+ return;
85
+ const item = data[index];
86
+ const videoDuration = ((_b = (_a = videoRef.current) === null || _a === void 0 ? void 0 : _a.duration) !== null && _b !== void 0 ? _b : 0).toFixed(2);
87
+ const videoCurrentTime = ((_d = (_c = videoRef.current) === null || _c === void 0 ? void 0 : _c.currentTime) !== null && _d !== void 0 ? _d : 0).toFixed(2);
88
+ const isPause = (_e = videoRef.current) === null || _e === void 0 ? void 0 : _e.paused;
89
+ switch (type) {
90
+ case 'start':
91
+ if (!isPause)
92
+ return;
93
+ (_f = videoRef.current) === null || _f === void 0 ? void 0 : _f.play();
94
+ setIsPauseVideo(false);
95
+ break;
96
+ case 'pause':
97
+ if (isPause)
98
+ return;
99
+ (_g = videoRef.current) === null || _g === void 0 ? void 0 : _g.pause();
100
+ setIsPauseVideo(true);
101
+ break;
102
+ default:
103
+ if (isPause) {
104
+ (_h = videoRef.current) === null || _h === void 0 ? void 0 : _h.play();
105
+ }
106
+ else {
107
+ (_j = videoRef.current) === null || _j === void 0 ? void 0 : _j.pause();
108
+ }
109
+ setIsPauseVideo(!isPause);
110
+ break;
111
+ }
112
+ }, [data, index, isLoad]);
113
+ const onPause = useCallback(() => {
114
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o;
115
+ const item = data[index];
116
+ const videoDuration = ((_b = (_a = videoRef.current) === null || _a === void 0 ? void 0 : _a.duration) !== null && _b !== void 0 ? _b : 0).toFixed(2);
117
+ const videoCurrentTime = ((_d = (_c = videoRef.current) === null || _c === void 0 ? void 0 : _c.currentTime) !== null && _d !== void 0 ? _d : 0).toFixed(2);
118
+ if ((_e = videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) === null || _e === void 0 ? void 0 : _e.duration) {
119
+ const playDuration = (((_f = videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) === null || _f === void 0 ? void 0 : _f.currentTime) - videoStartTime.current).toFixed(2);
120
+ bffEventReport === null || bffEventReport === void 0 ? void 0 : bffEventReport({
121
+ eventInfo: {
122
+ eventSubject: 'playOverVideo',
123
+ eventDescription: 'User finished playing the video',
124
+ contentId: (_h = (_g = item.video) === null || _g === void 0 ? void 0 : _g.itemId) !== null && _h !== void 0 ? _h : '',
125
+ contentName: (_k = (_j = item.video) === null || _j === void 0 ? void 0 : _j.title) !== null && _k !== void 0 ? _k : '',
126
+ endTime: videoCurrentTime,
127
+ videoDuration,
128
+ playDuration,
129
+ contentTags: JSON.stringify((_m = (_l = item.video) === null || _l === void 0 ? void 0 : _l.tags) !== null && _m !== void 0 ? _m : []),
130
+ position: item.position,
131
+ contentFormat: 'video',
132
+ traceInfo: (_o = item.video) === null || _o === void 0 ? void 0 : _o.traceInfo
133
+ }
134
+ });
135
+ }
136
+ }, [data, index, bffEventReport]);
137
+ useEffect(() => {
138
+ var _a, _b, _c;
139
+ if (data.length <= 0)
140
+ return;
141
+ if (!videoRef.current)
142
+ return;
143
+ setIsPauseVideo(false);
144
+ if (!isActive) {
145
+ (_a = videoRef.current) === null || _a === void 0 ? void 0 : _a.pause();
146
+ return;
147
+ }
148
+ if (!videoRef.current.src) {
149
+ const videoSrc = rec.video.url;
150
+ videoRef.current.src = videoSrc;
151
+ videoRef.current.setAttribute('x5-playsinline', 'true');
152
+ videoRef.current.setAttribute('webkit-playsinline', 'true');
153
+ }
154
+ else {
155
+ videoRef.current.play();
156
+ }
157
+ (_b = videoRef.current) === null || _b === void 0 ? void 0 : _b.addEventListener('canplay', handleLoadedMetadata);
158
+ (_c = videoRef.current) === null || _c === void 0 ? void 0 : _c.addEventListener('playing', handlePlaying);
159
+ return () => {
160
+ var _a, _b;
161
+ (_a = videoRef.current) === null || _a === void 0 ? void 0 : _a.removeEventListener('canplay', handleLoadedMetadata);
162
+ (_b = videoRef.current) === null || _b === void 0 ? void 0 : _b.removeEventListener('playing', handlePlaying);
163
+ };
164
+ }, [data, handleLoadedMetadata, handlePlaying, isActive, isLoad, rec.video]);
165
+ useEffect(() => {
166
+ var _a, _b, _c;
167
+ const isPause = (_a = videoRef.current) === null || _a === void 0 ? void 0 : _a.paused;
168
+ if (!isActive)
169
+ return;
170
+ if (!isPause && openHashtag) {
171
+ (_b = videoRef.current) === null || _b === void 0 ? void 0 : _b.pause();
172
+ }
173
+ else if (!openHashtag) {
174
+ (_c = videoRef.current) === null || _c === void 0 ? void 0 : _c.play();
175
+ }
176
+ }, [openHashtag, isActive]);
177
+ useEffect(() => {
178
+ if (!isActive)
179
+ return;
180
+ const onShow = handleClickVideo('start');
181
+ const onHide = handleClickVideo('pause');
182
+ SXP_EVENT_BUS.on(SXP_EVENT_TYPE.PAGE_DID_SHOW, onShow);
183
+ SXP_EVENT_BUS.on(SXP_EVENT_TYPE.PAGE_DID_HIDE, onHide);
184
+ return () => {
185
+ SXP_EVENT_BUS.off(SXP_EVENT_TYPE.PAGE_DID_SHOW, onShow);
186
+ SXP_EVENT_BUS.off(SXP_EVENT_TYPE.PAGE_DID_HIDE, onHide);
187
+ };
188
+ }, [handleClickVideo, isActive]);
189
+ const renderPoster = useMemo(() => {
190
+ if (!(sxpParameter === null || sxpParameter === void 0 ? void 0 : sxpParameter.placeholder_image)) {
191
+ return null;
192
+ }
193
+ return (React.createElement("img", { hidden: isLoad, style: { position: 'absolute', left: 0, top: 0, width: '100%', height: '100%', objectFit: 'cover' }, src: sxpParameter === null || sxpParameter === void 0 ? void 0 : sxpParameter.placeholder_image }));
194
+ }, [isLoad, sxpParameter === null || sxpParameter === void 0 ? void 0 : sxpParameter.placeholder_image]);
195
+ useEffect(() => {
196
+ const handleBeforeUnload = () => {
197
+ var _a, _b;
198
+ if (activeIndex === index && ((_a = rec === null || rec === void 0 ? void 0 : rec.video) === null || _a === void 0 ? void 0 : _a.url) && ((_b = videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) === null || _b === void 0 ? void 0 : _b.src) && !isPauseVideo) {
199
+ handleClickVideo('pause')();
200
+ }
201
+ };
202
+ window.addEventListener('beforeunload', handleBeforeUnload);
203
+ return () => {
204
+ window.removeEventListener('beforeunload', handleBeforeUnload);
205
+ };
206
+ }, [activeIndex, index, rec, videoRef, handleClickVideo, isPauseVideo]);
207
+ if (!rec.video) {
208
+ return null;
209
+ }
210
+ return (React.createElement("div", { className: 'video-container', key: rec.video.itemId, onClick: handleClickVideo(), style: {
211
+ position: 'relative',
212
+ width: '100%',
213
+ height
214
+ } },
215
+ React.createElement("video", { id: `pb-video-${index}`, className: 'clc-pb-video', ref: videoRef, poster: sxpParameter === null || sxpParameter === void 0 ? void 0 : sxpParameter.placeholder_image, muted: true, controls: false, playsInline: true, preload: 'auto', onPause: onPause, onEnded: handleVideoStart }),
216
+ renderPoster,
217
+ React.createElement("img", { hidden: !isPauseVideo, className: 'clc-pb-video-pause', src: PAUSE_ICON })));
218
+ };
219
+ export default memo(VideoWidget);
@@ -0,0 +1,3 @@
1
+ import React from 'react';
2
+ import './List.less';
3
+ export default function WaterfallList({ reportTagsView }: any): React.JSX.Element;
@@ -0,0 +1,173 @@
1
+ import React, { useState, useEffect, useMemo, useRef, useCallback } from 'react';
2
+ import './List.less';
3
+ import { useSxpDataSource } from '../../../../core/hooks';
4
+ const WaterfallFlowItem = (props) => {
5
+ const { rec, index, list, reportTagsView } = props;
6
+ const { swiperRef, setRtcList, setOpenHashtag, bffEventReport, sxpParameter } = useSxpDataSource();
7
+ const [showVideo, setShowVideo] = useState(false);
8
+ const imgDom = useRef(null);
9
+ const videoDom = useRef(null);
10
+ const canvasRef = useRef(null);
11
+ const [firstFrameSrc, setFirstFrameSrc] = useState('');
12
+ const src = useMemo(() => {
13
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m;
14
+ if ((_a = rec === null || rec === void 0 ? void 0 : rec.video) === null || _a === void 0 ? void 0 : _a.cover) {
15
+ return (_b = rec === null || rec === void 0 ? void 0 : rec.video) === null || _b === void 0 ? void 0 : _b.cover;
16
+ }
17
+ else if ((_c = rec === null || rec === void 0 ? void 0 : rec.video) === null || _c === void 0 ? void 0 : _c.url) {
18
+ setShowVideo(true);
19
+ return (_d = rec === null || rec === void 0 ? void 0 : rec.video) === null || _d === void 0 ? void 0 : _d.url;
20
+ }
21
+ else if ((_f = (_e = rec === null || rec === void 0 ? void 0 : rec.video) === null || _e === void 0 ? void 0 : _e.imgUrls) === null || _f === void 0 ? void 0 : _f.length) {
22
+ return (_h = (_g = rec === null || rec === void 0 ? void 0 : rec.video) === null || _g === void 0 ? void 0 : _g.imgUrls) === null || _h === void 0 ? void 0 : _h[0];
23
+ }
24
+ else if ((_k = (_j = rec === null || rec === void 0 ? void 0 : rec.product) === null || _j === void 0 ? void 0 : _j.homePage) === null || _k === void 0 ? void 0 : _k.length) {
25
+ return (_m = (_l = rec === null || rec === void 0 ? void 0 : rec.product) === null || _l === void 0 ? void 0 : _l.homePage) === null || _m === void 0 ? void 0 : _m[0];
26
+ }
27
+ else {
28
+ return (sxpParameter === null || sxpParameter === void 0 ? void 0 : sxpParameter.bottom_image) || '';
29
+ }
30
+ }, [rec, sxpParameter === null || sxpParameter === void 0 ? void 0 : sxpParameter.bottom_image]);
31
+ const title = useMemo(() => {
32
+ var _a, _b;
33
+ return ((_a = rec === null || rec === void 0 ? void 0 : rec.product) === null || _a === void 0 ? void 0 : _a.title) || ((_b = rec === null || rec === void 0 ? void 0 : rec.video) === null || _b === void 0 ? void 0 : _b.title) || null;
34
+ }, [rec]);
35
+ const priceText = useMemo(() => {
36
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j;
37
+ if (((_a = rec === null || rec === void 0 ? void 0 : rec.product) === null || _a === void 0 ? void 0 : _a.currency) && ((_b = rec === null || rec === void 0 ? void 0 : rec.product) === null || _b === void 0 ? void 0 : _b.price)) {
38
+ return `${(_f = (_e = (_d = (_c = rec === null || rec === void 0 ? void 0 : rec.product) === null || _c === void 0 ? void 0 : _c.currency) === null || _d === void 0 ? void 0 : _d.split('-')[1]) === null || _e === void 0 ? void 0 : _e.toUpperCase()) !== null && _f !== void 0 ? _f : ''}${(_j = (_h = (_g = rec === null || rec === void 0 ? void 0 : rec.product) === null || _g === void 0 ? void 0 : _g.price) === null || _h === void 0 ? void 0 : _h.toLocaleString('zh', {
39
+ minimumFractionDigits: 0
40
+ })) !== null && _j !== void 0 ? _j : ''}`;
41
+ }
42
+ else {
43
+ return null;
44
+ }
45
+ }, [rec]);
46
+ useEffect(() => {
47
+ const observer = new IntersectionObserver((entries) => {
48
+ entries.forEach((entry) => {
49
+ if (entry.isIntersecting) {
50
+ if (imgDom.current === null || src === '') {
51
+ return;
52
+ }
53
+ if (showVideo && firstFrameSrc) {
54
+ imgDom.current.src = firstFrameSrc;
55
+ }
56
+ else {
57
+ imgDom.current.src = src;
58
+ }
59
+ observer.unobserve(imgDom.current);
60
+ }
61
+ });
62
+ });
63
+ observer.observe(imgDom.current);
64
+ return () => {
65
+ observer.disconnect();
66
+ };
67
+ }, [src, showVideo, firstFrameSrc]);
68
+ const calculateHeightForWidth = (videoWidth, videoHeight, targetWidth) => {
69
+ const aspectRatio = videoWidth / videoHeight;
70
+ const targetHeight = targetWidth / aspectRatio;
71
+ return targetHeight;
72
+ };
73
+ useEffect(() => {
74
+ const video = videoDom === null || videoDom === void 0 ? void 0 : videoDom.current;
75
+ if (video === null || src === '' || !showVideo) {
76
+ return;
77
+ }
78
+ video.src = src;
79
+ video.currentTime = 1;
80
+ video.crossOrigin = 'anonymous';
81
+ video.onloadeddata = () => {
82
+ const canvas = canvasRef === null || canvasRef === void 0 ? void 0 : canvasRef.current;
83
+ if (!canvas)
84
+ return;
85
+ const ctx = canvas.getContext('2d');
86
+ const targetWidth = (window === null || window === void 0 ? void 0 : window.innerWidth) / 2;
87
+ const targetHeight = calculateHeightForWidth(video.videoWidth, video.videoHeight, targetWidth);
88
+ canvas.height = targetHeight;
89
+ canvas.width = targetWidth;
90
+ ctx === null || ctx === void 0 ? void 0 : ctx.drawImage(video, 0, 0, canvas.width, canvas.height);
91
+ setFirstFrameSrc(canvas.toDataURL());
92
+ video.remove();
93
+ canvas.remove();
94
+ };
95
+ }, [src, showVideo]);
96
+ const handleClickToDetail = () => {
97
+ reportTagsView();
98
+ setRtcList === null || setRtcList === void 0 ? void 0 : setRtcList(list);
99
+ setTimeout(() => {
100
+ var _a;
101
+ (_a = swiperRef === null || swiperRef === void 0 ? void 0 : swiperRef.current) === null || _a === void 0 ? void 0 : _a.swiper.slideTo(index, 0, false);
102
+ setOpenHashtag === null || setOpenHashtag === void 0 ? void 0 : setOpenHashtag(false);
103
+ }, 0);
104
+ };
105
+ return (React.createElement("div", { className: 'list-content-listItem', key: index, onClick: handleClickToDetail },
106
+ React.createElement("div", { className: 'list-content-listItem-picture' },
107
+ showVideo && (React.createElement("div", { style: { display: 'none' } },
108
+ React.createElement("video", { ref: videoDom, crossOrigin: 'anonymous', className: 'list-content-listItem-picture-img' }),
109
+ React.createElement("canvas", { ref: canvasRef }))),
110
+ React.createElement("img", { className: 'list-content-listItem-picture-img', loading: 'lazy', ref: imgDom })),
111
+ React.createElement("div", { className: 'list-content-listItem-info' },
112
+ React.createElement("div", { className: `${'list-content-listItem-info-title'} ${priceText ? 'list-content-listItem-info-nowrap' : ''}` }, title && title),
113
+ React.createElement("div", { className: 'list-content-listItem-info-price', hidden: !priceText }, priceText))));
114
+ };
115
+ export default function WaterfallList({ reportTagsView }) {
116
+ var _a, _b, _c, _d, _e, _f;
117
+ const { waterFallData, getRecommendVideos, hashTagSize, loadingImage } = useSxpDataSource();
118
+ const [list, setList] = useState();
119
+ const [data, setData] = useState();
120
+ const [isLoadingData, setIsLoadingData] = useState(false);
121
+ const containerRef = useRef(null);
122
+ const [isLoadMore, setIsLoadMore] = useState(false);
123
+ const loadMoreData = useCallback(() => {
124
+ if (isLoadMore)
125
+ return;
126
+ setIsLoadMore(true);
127
+ waterFallData &&
128
+ (getRecommendVideos === null || getRecommendVideos === void 0 ? void 0 : getRecommendVideos({
129
+ hashTag: waterFallData === null || waterFallData === void 0 ? void 0 : waterFallData.hashTag,
130
+ 'itemFilter.itemId': waterFallData === null || waterFallData === void 0 ? void 0 : waterFallData.itemId,
131
+ 'itemFilter.itemType': waterFallData === null || waterFallData === void 0 ? void 0 : waterFallData.itemType
132
+ }).then((res) => {
133
+ var _a;
134
+ setList(list === null || list === void 0 ? void 0 : list.concat((_a = res === null || res === void 0 ? void 0 : res.recList) !== null && _a !== void 0 ? _a : []));
135
+ setIsLoadMore(false);
136
+ }));
137
+ }, [waterFallData, getRecommendVideos, list, isLoadMore]);
138
+ useEffect(() => {
139
+ setIsLoadingData(true);
140
+ waterFallData &&
141
+ (getRecommendVideos === null || getRecommendVideos === void 0 ? void 0 : getRecommendVideos({
142
+ hashTag: waterFallData === null || waterFallData === void 0 ? void 0 : waterFallData.hashTag,
143
+ 'itemFilter.itemId': waterFallData === null || waterFallData === void 0 ? void 0 : waterFallData.itemId,
144
+ 'itemFilter.itemType': waterFallData === null || waterFallData === void 0 ? void 0 : waterFallData.itemType,
145
+ defaultSize: hashTagSize
146
+ }).then((res) => {
147
+ var _a, _b;
148
+ setData(res);
149
+ setList((_b = (_a = res === null || res === void 0 ? void 0 : res.recList) === null || _a === void 0 ? void 0 : _a.filter((item) => (item === null || item === void 0 ? void 0 : item.video) !== null || (item === null || item === void 0 ? void 0 : item.product) !== null)) !== null && _b !== void 0 ? _b : []);
150
+ setIsLoadingData(false);
151
+ }));
152
+ }, [waterFallData, getRecommendVideos, hashTagSize]);
153
+ const handleClickLink = () => {
154
+ var _a, _b;
155
+ if ((_a = data === null || data === void 0 ? void 0 : data.tag) === null || _a === void 0 ? void 0 : _a.link) {
156
+ reportTagsView();
157
+ window.location.href = (_b = data === null || data === void 0 ? void 0 : data.tag) === null || _b === void 0 ? void 0 : _b.link;
158
+ }
159
+ };
160
+ return (React.createElement(React.Fragment, null, isLoadingData ? (React.createElement("div", { style: { height: '100%', width: '100%', display: 'flex', justifyContent: 'center', alignItems: 'center' } },
161
+ React.createElement("img", { width: 64, height: 64, src: loadingImage, alt: 'loading...', style: { objectFit: 'contain' } }))) : (React.createElement("div", { className: 'list' },
162
+ React.createElement("div", { className: 'list-scroll', ref: containerRef, style: {
163
+ bottom: ((_a = data === null || data === void 0 ? void 0 : data.tag) === null || _a === void 0 ? void 0 : _a.link) ? '100px' : 0
164
+ } },
165
+ React.createElement("div", { className: 'list-info' }, (_b = data === null || data === void 0 ? void 0 : data.tag) === null || _b === void 0 ? void 0 : _b.info),
166
+ React.createElement("div", { hidden: !((_c = data === null || data === void 0 ? void 0 : data.tag) === null || _c === void 0 ? void 0 : _c.link), className: 'list-collection', onClick: handleClickLink }, ((_d = data === null || data === void 0 ? void 0 : data.tag) === null || _d === void 0 ? void 0 : _d.linkTitle) || 'Shop the collection'),
167
+ React.createElement("div", { className: 'list-content' }, list === null || list === void 0 ? void 0 : list.map((item, ind) => {
168
+ return (React.createElement(WaterfallFlowItem, { key: ind, index: ind, rec: item, list: list, reportTagsView: reportTagsView }));
169
+ })),
170
+ React.createElement("div", { hidden: !isLoadMore, style: { textAlign: 'center' } }, "loading...")),
171
+ React.createElement("div", { className: 'list-bottom', hidden: !((_e = data === null || data === void 0 ? void 0 : data.tag) === null || _e === void 0 ? void 0 : _e.link) },
172
+ React.createElement("button", { className: 'list-bottom-btn', onClick: handleClickLink }, ((_f = data === null || data === void 0 ? void 0 : data.tag) === null || _f === void 0 ? void 0 : _f.linkTitle) || 'Shop the collection'))))));
173
+ }
@@ -0,0 +1,3 @@
1
+ import React from 'react';
2
+ import './WaterfallList.less';
3
+ export default function WaterfallList({ reportTagsView }: any): React.JSX.Element;