pixuireactcomponents 1.2.0 → 1.2.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (399) hide show
  1. package/README.md +5 -6
  2. package/package.json +9 -66
  3. package/tsconfig.json +27 -13
  4. package/.eslintignore +0 -7
  5. package/.eslintrc.js +0 -48
  6. package/.pixiderc/apps.json +0 -12
  7. package/.pixiderc/devel-config.meta.json +0 -23
  8. package/.pixiderc/postinstall.js +0 -17
  9. package/.pixiderc/util.js +0 -136
  10. package/.pixiderc/webpack.js +0 -180
  11. package/faas/helloworld.js +0 -8
  12. package/gen/pbo/pandora_pb.d.ts +0 -1179
  13. package/gen/pbo/pandora_pb.js +0 -10475
  14. package/gen/pbo/pandora_pb_service.d.ts +0 -1317
  15. package/gen/pbo/pandora_pb_service.js +0 -2307
  16. package/gen/pbo/test_pb.d.ts +0 -99
  17. package/gen/pbo/test_pb.js +0 -889
  18. package/gen/pbo/test_pb_service.d.ts +0 -82
  19. package/gen/pbo/test_pb_service.js +0 -117
  20. package/lib/assets/border.png +0 -0
  21. package/lib/assets/check.html +0 -54
  22. package/lib/assets/pixui.png +0 -0
  23. package/lib/assets/preact.png +0 -0
  24. package/lib/check/main.less +0 -63
  25. package/lib/check/main.tsx +0 -42
  26. package/lib/check/tool.js +0 -3
  27. package/lib/check/util.tsx +0 -107
  28. package/lib/dom.ts +0 -16
  29. package/lib/ext.d.ts +0 -95
  30. package/lib/grpc-web/dist/ChunkParser.js +0 -115
  31. package/lib/grpc-web/dist/ChunkParser.js.map +0 -1
  32. package/lib/grpc-web/dist/Code.js +0 -58
  33. package/lib/grpc-web/dist/Code.js.map +0 -1
  34. package/lib/grpc-web/dist/client.js +0 -299
  35. package/lib/grpc-web/dist/client.js.map +0 -1
  36. package/lib/grpc-web/dist/debug.js +0 -16
  37. package/lib/grpc-web/dist/debug.js.map +0 -1
  38. package/lib/grpc-web/dist/detach.js +0 -7
  39. package/lib/grpc-web/dist/detach.js.map +0 -1
  40. package/lib/grpc-web/dist/index.js +0 -29
  41. package/lib/grpc-web/dist/index.js.map +0 -1
  42. package/lib/grpc-web/dist/invoke.js +0 -32
  43. package/lib/grpc-web/dist/invoke.js.map +0 -1
  44. package/lib/grpc-web/dist/message.js +0 -3
  45. package/lib/grpc-web/dist/message.js.map +0 -1
  46. package/lib/grpc-web/dist/metadata.js +0 -5
  47. package/lib/grpc-web/dist/metadata.js.map +0 -1
  48. package/lib/grpc-web/dist/service.js +0 -3
  49. package/lib/grpc-web/dist/service.js.map +0 -1
  50. package/lib/grpc-web/dist/transports/Transport.js +0 -13
  51. package/lib/grpc-web/dist/transports/Transport.js.map +0 -1
  52. package/lib/grpc-web/dist/transports/http/fetch.js +0 -112
  53. package/lib/grpc-web/dist/transports/http/fetch.js.map +0 -1
  54. package/lib/grpc-web/dist/transports/http/http.js +0 -15
  55. package/lib/grpc-web/dist/transports/http/http.js.map +0 -1
  56. package/lib/grpc-web/dist/transports/http/xhr.js +0 -127
  57. package/lib/grpc-web/dist/transports/http/xhr.js.map +0 -1
  58. package/lib/grpc-web/dist/transports/http/xhrUtil.js +0 -37
  59. package/lib/grpc-web/dist/transports/http/xhrUtil.js.map +0 -1
  60. package/lib/grpc-web/dist/transports/websocket/websocket.js +0 -95
  61. package/lib/grpc-web/dist/transports/websocket/websocket.js.map +0 -1
  62. package/lib/grpc-web/dist/typings/ChunkParser.d.ts +0 -17
  63. package/lib/grpc-web/dist/typings/Code.d.ts +0 -20
  64. package/lib/grpc-web/dist/typings/client.d.ts +0 -22
  65. package/lib/grpc-web/dist/typings/debug.d.ts +0 -1
  66. package/lib/grpc-web/dist/typings/detach.d.ts +0 -1
  67. package/lib/grpc-web/dist/typings/index.d.ts +0 -60
  68. package/lib/grpc-web/dist/typings/invoke.d.ts +0 -17
  69. package/lib/grpc-web/dist/typings/message.d.ts +0 -8
  70. package/lib/grpc-web/dist/typings/metadata.d.ts +0 -2
  71. package/lib/grpc-web/dist/typings/service.d.ts +0 -16
  72. package/lib/grpc-web/dist/typings/transports/Transport.d.ts +0 -22
  73. package/lib/grpc-web/dist/typings/transports/http/fetch.d.ts +0 -6
  74. package/lib/grpc-web/dist/typings/transports/http/http.d.ts +0 -5
  75. package/lib/grpc-web/dist/typings/transports/http/xhr.d.ts +0 -27
  76. package/lib/grpc-web/dist/typings/transports/http/xhrUtil.d.ts +0 -3
  77. package/lib/grpc-web/dist/typings/transports/websocket/websocket.d.ts +0 -2
  78. package/lib/grpc-web/dist/typings/unary.d.ts +0 -20
  79. package/lib/grpc-web/dist/typings/util.d.ts +0 -2
  80. package/lib/grpc-web/dist/unary.js +0 -44
  81. package/lib/grpc-web/dist/unary.js.map +0 -1
  82. package/lib/grpc-web/dist/util.js +0 -11
  83. package/lib/grpc-web/dist/util.js.map +0 -1
  84. package/lib/grpcTransport/PixHttp2Transport.ts +0 -104
  85. package/lib/grpcTransport/PixLuaTransport.ts +0 -80
  86. package/lib/pi_component/tinyList/tinyList.js +0 -573
  87. package/lib/pi_component/tinyList/tinyList.tsx +0 -586
  88. package/lib/preact/compat/src/Children.js +0 -26
  89. package/lib/preact/compat/src/PureComponent.js +0 -19
  90. package/lib/preact/compat/src/events.js +0 -36
  91. package/lib/preact/compat/src/forwardRef.js +0 -29
  92. package/lib/preact/compat/src/index.d.ts +0 -121
  93. package/lib/preact/compat/src/index.js +0 -159
  94. package/lib/preact/compat/src/internal.d.ts +0 -45
  95. package/lib/preact/compat/src/memo.js +0 -34
  96. package/lib/preact/compat/src/portals.js +0 -85
  97. package/lib/preact/compat/src/render.js +0 -166
  98. package/lib/preact/compat/src/suspense-list.d.ts +0 -14
  99. package/lib/preact/compat/src/suspense-list.js +0 -127
  100. package/lib/preact/compat/src/suspense.d.ts +0 -15
  101. package/lib/preact/compat/src/suspense.js +0 -165
  102. package/lib/preact/compat/src/util.js +0 -23
  103. package/lib/preact/hooks/src/index.d.ts +0 -133
  104. package/lib/preact/hooks/src/index.js +0 -339
  105. package/lib/preact/hooks/src/internal.d.ts +0 -55
  106. package/lib/preact/src/clone-element.js +0 -27
  107. package/lib/preact/src/compat.ts +0 -0
  108. package/lib/preact/src/component.js +0 -219
  109. package/lib/preact/src/constants.js +0 -3
  110. package/lib/preact/src/create-context.js +0 -55
  111. package/lib/preact/src/create-element.js +0 -102
  112. package/lib/preact/src/css.d.ts +0 -30341
  113. package/lib/preact/src/diff/catch-error.js +0 -41
  114. package/lib/preact/src/diff/children.js +0 -259
  115. package/lib/preact/src/diff/index.js +0 -445
  116. package/lib/preact/src/diff/props.js +0 -163
  117. package/lib/preact/src/index.d.ts +0 -275
  118. package/lib/preact/src/index.js +0 -14
  119. package/lib/preact/src/internal.d.ts +0 -94
  120. package/lib/preact/src/jsx.d.ts +0 -884
  121. package/lib/preact/src/options.js +0 -16
  122. package/lib/preact/src/render.js +0 -98
  123. package/lib/preact/src/util.js +0 -25
  124. package/lib/preact-router/.travis.yml +0 -3
  125. package/lib/preact-router/LICENSE +0 -21
  126. package/lib/preact-router/README.md +0 -254
  127. package/lib/preact-router/index.d.ts +0 -71
  128. package/lib/preact-router/match/index.d.ts +0 -16
  129. package/lib/preact-router/match/package.json +0 -13
  130. package/lib/preact-router/match/src/cjs.js +0 -4
  131. package/lib/preact-router/match/src/index.js +0 -36
  132. package/lib/preact-router/package-lock.json +0 -12330
  133. package/lib/preact-router/package.json +0 -78
  134. package/lib/preact-router/src/cjs.js +0 -11
  135. package/lib/preact-router/src/index.js +0 -270
  136. package/lib/preact-router/src/util.js +0 -87
  137. package/lib/react-window/src/FixedSizeGrid.js +0 -244
  138. package/lib/react-window/src/FixedSizeList.js +0 -130
  139. package/lib/react-window/src/VariableSizeGrid.js +0 -507
  140. package/lib/react-window/src/VariableSizeList.js +0 -316
  141. package/lib/react-window/src/__tests__/FixedSizeGrid.js +0 -1336
  142. package/lib/react-window/src/__tests__/FixedSizeList.js +0 -966
  143. package/lib/react-window/src/__tests__/VariableSizeGrid.js +0 -779
  144. package/lib/react-window/src/__tests__/VariableSizeList.js +0 -442
  145. package/lib/react-window/src/__tests__/__snapshots__/FixedSizeGrid.js.snap +0 -912
  146. package/lib/react-window/src/__tests__/__snapshots__/FixedSizeList.js.snap +0 -568
  147. package/lib/react-window/src/__tests__/__snapshots__/VariableSizeGrid.js.snap +0 -542
  148. package/lib/react-window/src/__tests__/__snapshots__/VariableSizeList.js.snap +0 -331
  149. package/lib/react-window/src/__tests__/areEqual.js +0 -32
  150. package/lib/react-window/src/__tests__/shouldComponentUpdate.js +0 -36
  151. package/lib/react-window/src/areEqual.js +0 -18
  152. package/lib/react-window/src/createGridComponent.js +0 -919
  153. package/lib/react-window/src/createListComponent.js +0 -729
  154. package/lib/react-window/src/domHelpers.js +0 -72
  155. package/lib/react-window/src/index.js +0 -9
  156. package/lib/react-window/src/shallowDiffers.js +0 -17
  157. package/lib/react-window/src/shouldComponentUpdate.js +0 -16
  158. package/lib/react-window/src/test.js.flow +0 -382
  159. package/lib/react-window/src/timer.js +0 -36
  160. package/src/app/demopage.tsx +0 -77
  161. package/src/app/index.html +0 -48
  162. package/src/app/main.tsx +0 -30
  163. package/src/asset/Textures/Alert/bg_tips.png +0 -0
  164. package/src/asset/Textures/Alert/btn_zhedie_a.png +0 -0
  165. package/src/asset/Textures/Alert/com_home_bg_left.png +0 -0
  166. package/src/asset/Textures/Alert/com_home_bg_rightbar.png +0 -0
  167. package/src/asset/Textures/Commons/com_home_bg_a.png +0 -0
  168. package/src/asset/Textures/Commons/com_home_bg_back_top.png +0 -0
  169. package/src/asset/Textures/Commons/com_home_bg_bottombar_sheet.png +0 -0
  170. package/src/asset/Textures/Commons/com_home_bg_list_xiala.png +0 -0
  171. package/src/asset/Textures/Commons/com_home_bg_rightbar_line.png +0 -0
  172. package/src/asset/Textures/Commons/com_home_bg_rightbar_selected.png +0 -0
  173. package/src/asset/Textures/Commons/com_home_bg_touxiang_140.png +0 -0
  174. package/src/asset/Textures/Commons/com_home_bg_touxiang_60.png +0 -0
  175. package/src/asset/Textures/Commons/com_home_bg_touxiang_80.png +0 -0
  176. package/src/asset/Textures/Commons/com_home_btn_back.png +0 -0
  177. package/src/asset/Textures/Commons/com_home_btn_bottombar.png +0 -0
  178. package/src/asset/Textures/Commons/com_home_btn_bottombar_fadongtai.png +0 -0
  179. package/src/asset/Textures/Commons/com_home_btn_close.png +0 -0
  180. package/src/asset/Textures/Commons/com_home_btn_guanzhu_126.png +0 -0
  181. package/src/asset/Textures/Commons/com_home_btn_guanzhu_86.png +0 -0
  182. package/src/asset/Textures/Commons/com_home_btn_left_bianji.png +0 -0
  183. package/src/asset/Textures/Commons/com_home_btn_left_dongtai.png +0 -0
  184. package/src/asset/Textures/Commons/com_home_btn_left_touxiang.png +0 -0
  185. package/src/asset/Textures/Commons/com_home_btn_selet.png +0 -0
  186. package/src/asset/Textures/Commons/com_home_btn_yiguanzhu_126.png +0 -0
  187. package/src/asset/Textures/Commons/com_home_btn_yiguanzhu_86.png +0 -0
  188. package/src/asset/Textures/Commons/com_home_icon_bottombar_fadongtai.png +0 -0
  189. package/src/asset/Textures/Commons/com_home_icon_bottombar_red.png +0 -0
  190. package/src/asset/Textures/Commons/com_home_icon_loading.png +0 -0
  191. package/src/asset/Textures/Commons/com_home_pic_touxiang_moren.png +0 -0
  192. package/src/asset/Textures/Commons/com_home_tab_left_a.png +0 -0
  193. package/src/asset/Textures/Commons/com_home_tab_left_b.png +0 -0
  194. package/src/asset/Textures/Commons/com_home_tab_left_c.png +0 -0
  195. package/src/asset/Textures/Commons/feedItems/gc1_huati_icon_middle_v.png +0 -0
  196. package/src/asset/Textures/Commons/feedItems/gc1_huati_icon_middle_yonghurenzheng.png +0 -0
  197. package/src/asset/Textures/Commons/feedItems/pinglun_bg.png +0 -0
  198. package/src/asset/Textures/Commons/feedItems/pinglun_bg_line.png +0 -0
  199. package/src/asset/Textures/Commons/feedItems/pinglun_bg_middle_chakan.png +0 -0
  200. package/src/asset/Textures/Commons/feedItems/pinglun_bg_middle_input.png +0 -0
  201. package/src/asset/Textures/Commons/feedItems/pinglun_bg_zan.png +0 -0
  202. package/src/asset/Textures/Commons/feedItems/pinglun_btn_middle_input.png +0 -0
  203. package/src/asset/Textures/Commons/feedItems/pinglun_btn_more.png +0 -0
  204. package/src/asset/Textures/Commons/feedItems/pinglun_btn_normal.png +0 -0
  205. package/src/asset/Textures/Commons/feedItems/pinglun_btn_photo_more.png +0 -0
  206. package/src/asset/Textures/Commons/feedItems/pinglun_btn_zhedie_a.png +0 -0
  207. package/src/asset/Textures/Commons/feedItems/pinglun_btn_zhedie_a_shadow.png +0 -0
  208. package/src/asset/Textures/Commons/feedItems/pinglun_btn_zhedie_b_normal.png +0 -0
  209. package/src/asset/Textures/Commons/feedItems/pinglun_btn_zhedie_b_pressed.png +0 -0
  210. package/src/asset/Textures/Commons/feedItems/pinglun_icon_a_normal.png +0 -0
  211. package/src/asset/Textures/Commons/feedItems/pinglun_icon_a_pressed.png +0 -0
  212. package/src/asset/Textures/Commons/feedItems/pinglun_icon_b_normal.png +0 -0
  213. package/src/asset/Textures/Commons/feedItems/pinglun_icon_c_normal.png +0 -0
  214. package/src/asset/Textures/Commons/feedItems/pinglun_icon_d.png +0 -0
  215. package/src/asset/Textures/Commons/feedItems/pinglun_icon_e.png +0 -0
  216. package/src/asset/Textures/Commons/feedItems/pinglun_icon_f_share.png +0 -0
  217. package/src/asset/Textures/Commons/feedItems/pinglun_icon_middle_input_back.png +0 -0
  218. package/src/asset/Textures/Commons/gc1_huati_bg_middle_topbtn.png +0 -0
  219. package/src/asset/Textures/Commons/gc1_huati_bg_middle_topbtn_pressd.png +0 -0
  220. package/src/asset/Textures/Commons/karaoke/rukou_bg_music.png +0 -0
  221. package/src/asset/Textures/Commons/karaoke/rukou_btn_a.png +0 -0
  222. package/src/asset/Textures/Commons/karaoke/rukou_btn_b.png +0 -0
  223. package/src/asset/Textures/Commons/karaoke/rukou_icon_b.png +0 -0
  224. package/src/asset/Textures/Commons/karaoke/rukou_icon_d.png +0 -0
  225. package/src/asset/Textures/Commons/karaoke/rukou_icon_e.png +0 -0
  226. package/src/asset/Textures/Commons/rukou_bg_bottombar_line.png +0 -0
  227. package/src/asset/Textures/Commons/rukou_icon_a.png +0 -0
  228. package/src/asset/Textures/Commons/tc_bianji_tab_a.png +0 -0
  229. package/src/asset/Textures/Commons/tc_zanshang_bg_line.png +0 -0
  230. package/src/asset/Textures/Commons/touxiang_bg_tishikuang.png +0 -0
  231. package/src/asset/Textures/Commons/video/rukou_icon_shipin.png +0 -0
  232. package/src/asset/Textures/Commons/video/xiangce_btn_bofang.png +0 -0
  233. package/src/asset/Textures/Commons/voice/rukou_icon_yuyin.png +0 -0
  234. package/src/asset/Textures/Commons/voice/tc_yuyin_bg.png +0 -0
  235. package/src/asset/Textures/Commons/voice/tc_yuyin_bg_load.png +0 -0
  236. package/src/asset/Textures/Commons/voice/tc_yuyin_bg_xinhao_a.png +0 -0
  237. package/src/asset/Textures/Commons/voice/tc_yuyin_bg_xinhao_b.png +0 -0
  238. package/src/asset/Textures/Commons/xiangce_icon_bottombar_gulita.png +0 -0
  239. package/src/asset/Textures/SocialSecond/com_tc_bg.png +0 -0
  240. package/src/asset/Textures/SocialSecond/com_tc_bg_bottom.png +0 -0
  241. package/src/asset/Textures/SocialSecond/com_tc_bg_input.png +0 -0
  242. package/src/asset/Textures/SocialSecond/com_tc_bg_tips.png +0 -0
  243. package/src/asset/Textures/SocialSecond/com_tc_bg_topbar_a.png +0 -0
  244. package/src/asset/Textures/SocialSecond/com_tc_bg_topbar_line.png +0 -0
  245. package/src/asset/Textures/SocialSecond/com_tc_bg_upload_photo.png +0 -0
  246. package/src/asset/Textures/SocialSecond/com_tc_bg_upload_photo_line.png +0 -0
  247. package/src/asset/Textures/SocialSecond/com_tc_bg_zhaopian_line.png +0 -0
  248. package/src/asset/Textures/SocialSecond/com_tc_btn.png +0 -0
  249. package/src/asset/Textures/SocialSecond/com_tc_btn_close.png +0 -0
  250. package/src/asset/Textures/SocialSecond/com_tc_btn_upload_photo.png +0 -0
  251. package/src/asset/Textures/SocialSecond/com_tc_radio_normal.png +0 -0
  252. package/src/asset/Textures/SocialSecond/com_tc_radio_normal_@slice_0.png +0 -0
  253. package/src/asset/Textures/SocialSecond/com_tc_radio_selected.png +0 -0
  254. package/src/asset/Textures/SocialSecond/com_tc_tab_a.png +0 -0
  255. package/src/asset/Textures/SocialSecond/gc1_huati_bg_middle_topbar.png +0 -0
  256. package/src/asset/Textures/SocialSecond/gc1_huati_bg_middle_topbar_pre.png +0 -0
  257. package/src/asset/Textures/SocialSecond/newmessage_bg_left_line.png +0 -0
  258. package/src/asset/Textures/SocialSecond/newmessage_bg_left_normal.png +0 -0
  259. package/src/asset/Textures/SocialSecond/newmessage_bg_left_selected.png +0 -0
  260. package/src/asset/Textures/SocialSecond/newmessage_bg_middle_new.png +0 -0
  261. package/src/asset/Textures/SocialSecond/paihang_bg_list.png +0 -0
  262. package/src/asset/Textures/SocialSecond/paihang_bg_list_line.png +0 -0
  263. package/src/asset/Textures/SocialSecond/paihang_bg_list_my.png +0 -0
  264. package/src/asset/Textures/SocialSecond/paihang_bg_list_top.png +0 -0
  265. package/src/asset/Textures/SocialSecond/paihang_bg_topbar_a.png +0 -0
  266. package/src/asset/Textures/SocialSecond/paihang_icon_topbar_selected.png +0 -0
  267. package/src/asset/Textures/SocialSecond/paihang_pic_1.png +0 -0
  268. package/src/asset/Textures/SocialSecond/paihang_pic_2.png +0 -0
  269. package/src/asset/Textures/SocialSecond/tc_fadongtai_btn_close.png +0 -0
  270. package/src/asset/Textures/SocialSecond/tc_guanzhu_bg_topbar.png +0 -0
  271. package/src/asset/Textures/SocialSecond/tc_guanzhu_bg_topbar_selected.png +0 -0
  272. package/src/asset/Textures/SocialSecond/tc_liwu_bg.png +0 -0
  273. package/src/asset/Textures/SocialSecond/tc_liwu_bg_daoju.png +0 -0
  274. package/src/asset/Textures/SocialSecond/tc_liwu_btn_a.png +0 -0
  275. package/src/asset/Textures/SocialSecond/tc_liwu_btn_b.png +0 -0
  276. package/src/asset/Textures/SocialSecond/tc_liwu_btn_c.png +0 -0
  277. package/src/asset/Textures/SocialSecond/tc_liwu_pic_daoju1.png +0 -0
  278. package/src/asset/Textures/SocialSecond/tc_liwu_pic_daoju2.png +0 -0
  279. package/src/asset/Textures/SocialSecond/tc_liwu_pic_daoju3.png +0 -0
  280. package/src/asset/Textures/SocialSecond/tc_pinglun_bg.png +0 -0
  281. package/src/asset/Textures/SocialSecond/tc_shipin_tianjiashipin.png +0 -0
  282. package/src/asset/Textures/SocialSecond/tc_yuyin_bg.png +0 -0
  283. package/src/asset/Textures/SocialSecond/tc_yuyin_bg_delete.png +0 -0
  284. package/src/asset/Textures/SocialSecond/tc_yuyin_bg_xinhao_a.png +0 -0
  285. package/src/asset/Textures/SocialSecond/tc_yuyin_bg_xinhao_b.png +0 -0
  286. package/src/asset/Textures/SocialSecond/tc_yuyin_star.png +0 -0
  287. package/src/asset/Textures/SocialSecond/tc_yuyin_stop.png +0 -0
  288. package/src/asset/Textures/SocialSecond/tc_zanshang_bg_line.png +0 -0
  289. package/src/asset/Textures/SocialSecond/touxiang_bg_tishikuang.png +0 -0
  290. package/src/asset/Textures/SocialSecond/xiangce_huadong.png +0 -0
  291. package/src/asset/Textures/SocialSecond/xiangce_huadong_xuanzhong.png +0 -0
  292. package/src/asset/Textures/SocialSecond/xiangce_icon_xiazai.png +0 -0
  293. package/src/asset/Textures/SocialVideo/com_home_btn_close.png +0 -0
  294. package/src/asset/Textures/SocialVideo/tc_shipin_bg_guodu.png +0 -0
  295. package/src/asset/Textures/SocialVideo/tc_shipin_jinduanjian.png +0 -0
  296. package/src/asset/Textures/SocialVideo/tc_shipin_jindutiao.png +0 -0
  297. package/src/asset/Textures/SocialVideo/tc_shipin_jindutiao_hui.png +0 -0
  298. package/src/asset/Textures/SocialVideo/tc_shipin_play.png +0 -0
  299. package/src/asset/Textures/SocialVideo/tc_shipin_play_big.png +0 -0
  300. package/src/asset/Textures/SocialVideo/tc_shipin_stop.png +0 -0
  301. package/src/asset/laugh.gif +0 -0
  302. package/src/asset/npms.png +0 -0
  303. package/src/asset/pixui.png +0 -0
  304. package/src/asset/preact.png +0 -0
  305. package/src/asset/template.html +0 -47
  306. package/src/common/frame/appsettings.js +0 -111
  307. package/src/common/frame/common.js +0 -17
  308. package/src/common/frame/platform-api-callback.js +0 -341
  309. package/src/common/frame/platform-api.d.ts +0 -156
  310. package/src/common/frame/platform-api.js +0 -479
  311. package/src/common/main.less +0 -119
  312. package/src/pixUIReactComponents/README.md +0 -8
  313. package/src/pixUIReactComponents/package.json +0 -11
  314. package/src/pixUIReactComponents/tsconfig.json +0 -45
  315. package/src/pixUIReactUtils/GenerateConstructorAndGeterSeter.js +0 -227
  316. package/src/pixUIReactUtils/MakeImage.js +0 -207
  317. package/src/pixUIReactUtils/README.md +0 -124
  318. package/src/pixUIReactUtils/Version.js +0 -3
  319. package/src/pixUIReactUtils/img/makeImage.png +0 -0
  320. package/src/pixUIReactUtils/index.js +0 -1
  321. package/src/pixUIReactUtils/package.json +0 -16
  322. package/src/preprocess/index.html +0 -48
  323. package/src/preprocess/main.tsx +0 -17
  324. package/src/preprocess/preprocesspage.tsx +0 -41
  325. /package/{src/pixUIReactComponents/cmdAfterTsBuild.js → cmdAfterTsBuild.js} +0 -0
  326. /package/{src/pixUIReactComponents/index.js → index.js} +0 -0
  327. /package/{src/pixUIReactComponents/tools → tools}/EventDispatcherJs.tsx +0 -0
  328. /package/{src/pixUIReactComponents/tools → tools}/Logger.tsx +0 -0
  329. /package/{src/pixUIReactComponents/tools → tools}/img/logger.png +0 -0
  330. /package/{src/pixUIReactComponents/tools → tools}/tools.md +0 -0
  331. /package/{src/pixUIReactComponents/ui → ui}/components/bulletscreen/BulletItemAnimation.tsx +0 -0
  332. /package/{src/pixUIReactComponents/ui → ui}/components/bulletscreen/BulletScreenAnimation.tsx +0 -0
  333. /package/{src/pixUIReactComponents/ui → ui}/components/bulletscreen/bullet.less +0 -0
  334. /package/{src/pixUIReactComponents/ui → ui}/components/button/Button.tsx +0 -0
  335. /package/{src/pixUIReactComponents/ui → ui}/components/carousel/Carousel.tsx +0 -0
  336. /package/{src/pixUIReactComponents/ui → ui}/components/checkBox/CheckBox.tsx +0 -0
  337. /package/{src/pixUIReactComponents/ui → ui}/components/dropdown/Dropdown.tsx +0 -0
  338. /package/{src/pixUIReactComponents/ui → ui}/components/dropdown/DropdownOptionUI.tsx +0 -0
  339. /package/{src/pixUIReactComponents/ui → ui}/components/dropdown/DropdownSpreadMainUI.tsx +0 -0
  340. /package/{src/pixUIReactComponents/ui → ui}/components/dropdown/DropdownUnspreadMainUI.tsx +0 -0
  341. /package/{src/pixUIReactComponents/ui → ui}/components/gradient/GradientText.tsx +0 -0
  342. /package/{src/pixUIReactComponents/ui → ui}/components/outlinetext/OutlineText.tsx +0 -0
  343. /package/{src/pixUIReactComponents/ui → ui}/components/progress/Progress.tsx +0 -0
  344. /package/{src/pixUIReactComponents/ui → ui}/components/slapface/Slapface.tsx +0 -0
  345. /package/{src/pixUIReactComponents/ui → ui}/components/slapface/less/Slapface.less +0 -0
  346. /package/{src/pixUIReactComponents/ui → ui}/components/slider/Slider.tsx +0 -0
  347. /package/{src/pixUIReactComponents/ui → ui}/components/tab/Tab.tsx +0 -0
  348. /package/{src/pixUIReactComponents/ui → ui}/components/tab/Tabs.tsx +0 -0
  349. /package/{src/pixUIReactComponents/ui → ui}/components/togglegroup/ToggleGroup.tsx +0 -0
  350. /package/{src/pixUIReactComponents/ui → ui}/components/videoplayer/VideoPlayer.tsx +0 -0
  351. /package/{src/pixUIReactComponents/ui → ui}/components/waterfallcomponent/WaterfallComponent.jsx +0 -0
  352. /package/{src/pixUIReactComponents/ui → ui}/components/waterfallcomponent/less/WaterfallComponent.less +0 -0
  353. /package/{src/pixUIReactComponents/ui → ui}/sample/Images.tsx +0 -0
  354. /package/{src/pixUIReactComponents/ui → ui}/sample/OutlineText/OutlineDemo.tsx +0 -0
  355. /package/{src/pixUIReactComponents/ui → ui}/sample/Slapface/SlapfaceDemo.tsx +0 -0
  356. /package/{src/pixUIReactComponents/ui → ui}/sample/asset/btn_close.png +0 -0
  357. /package/{src/pixUIReactComponents/ui → ui}/sample/asset/changtai_button.jpg +0 -0
  358. /package/{src/pixUIReactComponents/ui → ui}/sample/asset/checkbox0.png +0 -0
  359. /package/{src/pixUIReactComponents/ui → ui}/sample/asset/checkbox1.png +0 -0
  360. /package/{src/pixUIReactComponents/ui → ui}/sample/asset/data_arrow_down.png +0 -0
  361. /package/{src/pixUIReactComponents/ui → ui}/sample/asset/data_arrow_up.png +0 -0
  362. /package/{src/pixUIReactComponents/ui → ui}/sample/asset/dot.png +0 -0
  363. /package/{src/pixUIReactComponents/ui → ui}/sample/asset/inner.png +0 -0
  364. /package/{src/pixUIReactComponents/ui → ui}/sample/asset/item_reddot.png +0 -0
  365. /package/{src/pixUIReactComponents/ui → ui}/sample/asset/loading.png +0 -0
  366. /package/{src/pixUIReactComponents/ui → ui}/sample/asset/money_dropdown.png +0 -0
  367. /package/{src/pixUIReactComponents/ui → ui}/sample/asset/money_dropdownall.png +0 -0
  368. /package/{src/pixUIReactComponents/ui → ui}/sample/asset/outer.png +0 -0
  369. /package/{src/pixUIReactComponents/ui → ui}/sample/asset/slapface_samplepic1.png +0 -0
  370. /package/{src/pixUIReactComponents/ui → ui}/sample/asset/slapface_samplepic2.png +0 -0
  371. /package/{src/pixUIReactComponents/ui → ui}/sample/asset/slapface_samplepic3.png +0 -0
  372. /package/{src/pixUIReactComponents/ui → ui}/sample/asset/slapface_samplepic4.png +0 -0
  373. /package/{src/pixUIReactComponents/ui → ui}/sample/asset/slapface_samplepic5.png +0 -0
  374. /package/{src/pixUIReactComponents/ui → ui}/sample/asset/slapface_samplepic6.png +0 -0
  375. /package/{src/pixUIReactComponents/ui → ui}/sample/asset/tab_choosed.png +0 -0
  376. /package/{src/pixUIReactComponents/ui → ui}/sample/asset/tabs_bg.png +0 -0
  377. /package/{src/pixUIReactComponents/ui → ui}/sample/asset/video_pause.png +0 -0
  378. /package/{src/pixUIReactComponents/ui → ui}/sample/asset/video_play.png +0 -0
  379. /package/{src/pixUIReactComponents/ui → ui}/sample/asset/video_reload.png +0 -0
  380. /package/{src/pixUIReactComponents/ui → ui}/sample/asset/xuanfu_button.jpg +0 -0
  381. /package/{src/pixUIReactComponents/ui → ui}/sample/asset/yaxia_button.jpg +0 -0
  382. /package/{src/pixUIReactComponents/ui → ui}/sample/bulletscreen/BulletDemo.tsx +0 -0
  383. /package/{src/pixUIReactComponents/ui → ui}/sample/button/ButtonDemo.tsx +0 -0
  384. /package/{src/pixUIReactComponents/ui → ui}/sample/carousel/carouselDemo.tsx +0 -0
  385. /package/{src/pixUIReactComponents/ui → ui}/sample/checkBox/checkBoxDemo.tsx +0 -0
  386. /package/{src/pixUIReactComponents/ui → ui}/sample/dropdown/DropdownDemo.tsx +0 -0
  387. /package/{src/pixUIReactComponents/ui → ui}/sample/dropdown/MoneyDropdownOption.tsx +0 -0
  388. /package/{src/pixUIReactComponents/ui → ui}/sample/dropdown/MoneyDropdownSpreadMain.tsx +0 -0
  389. /package/{src/pixUIReactComponents/ui → ui}/sample/dropdown/MoneyDropdownUnspreadMain.tsx +0 -0
  390. /package/{src/pixUIReactComponents/ui → ui}/sample/gradient/GradientDemo.tsx +0 -0
  391. /package/{src/pixUIReactComponents/ui → ui}/sample/less/video.less +0 -0
  392. /package/{src/pixUIReactComponents/ui → ui}/sample/progress/ProgressDemo.tsx +0 -0
  393. /package/{src/pixUIReactComponents/ui → ui}/sample/slider/SliderDemo.tsx +0 -0
  394. /package/{src/pixUIReactComponents/ui → ui}/sample/tab/TabDemo.tsx +0 -0
  395. /package/{src/pixUIReactComponents/ui → ui}/sample/tab/TopTab.tsx +0 -0
  396. /package/{src/pixUIReactComponents/ui → ui}/sample/togglegroup/ToggleGroupDemo.tsx +0 -0
  397. /package/{src/pixUIReactComponents/ui → ui}/sample/videoplayer/VideoPlayerDemo.tsx +0 -0
  398. /package/{src/pixUIReactComponents/ui → ui}/sample/waterfallcomponent/WaterfallComponentDemo.jsx +0 -0
  399. /package/{src/pixUIReactComponents/ui → ui}/ui.md +0 -0
@@ -1,121 +0,0 @@
1
- import * as _hooks from '../../hooks';
2
- import * as preact from '../../src';
3
- import { JSXInternal } from '../../src/jsx';
4
- import * as _Suspense from './suspense';
5
-
6
- // export default React;
7
- export = React;
8
- export as namespace React;
9
- declare namespace React {
10
- // Export JSX
11
- export import JSX = JSXInternal;
12
-
13
- // Hooks
14
- export import CreateHandle = _hooks.CreateHandle;
15
- export import EffectCallback = _hooks.EffectCallback;
16
- export import Inputs = _hooks.Inputs;
17
- export import PropRef = _hooks.PropRef;
18
- export import Reducer = _hooks.Reducer;
19
- export import Ref = _hooks.Ref;
20
- export import StateUpdater = _hooks.StateUpdater;
21
- export import useCallback = _hooks.useCallback;
22
- export import useContext = _hooks.useContext;
23
- export import useDebugValue = _hooks.useDebugValue;
24
- export import useEffect = _hooks.useEffect;
25
- export import useImperativeHandle = _hooks.useImperativeHandle;
26
- export import useLayoutEffect = _hooks.useLayoutEffect;
27
- export import useMemo = _hooks.useMemo;
28
- export import useReducer = _hooks.useReducer;
29
- export import useRef = _hooks.useRef;
30
- export import useState = _hooks.useState;
31
-
32
- // Preact Defaults
33
- export import Component = preact.Component;
34
- export import FunctionComponent = preact.FunctionComponent;
35
- export import FC = preact.FunctionComponent;
36
- export import createContext = preact.createContext;
37
- export import createRef = preact.createRef;
38
- export import Fragment = preact.Fragment;
39
- export import createElement = preact.createElement;
40
- export import cloneElement = preact.cloneElement;
41
-
42
- // Suspense
43
- export import Suspense = _Suspense.Suspense;
44
- export import lazy = _Suspense.lazy;
45
-
46
- // Compat
47
- export const version: string;
48
-
49
- export function createPortal(
50
- vnode: preact.VNode,
51
- container: Element
52
- ): preact.VNode<any>;
53
-
54
- export function render(
55
- vnode: preact.VNode<any>,
56
- parent: Element,
57
- callback?: () => void
58
- ): Component | null;
59
-
60
- export function hydrate(
61
- vnode: preact.VNode<any>,
62
- parent: Element,
63
- callback?: () => void
64
- ): Component | null;
65
-
66
- export function unmountComponentAtNode(
67
- container: Element | Document | ShadowRoot | DocumentFragment
68
- ): boolean;
69
-
70
- export function createFactory(
71
- type: preact.VNode<any>['type']
72
- ): (
73
- props?: any,
74
- ...children: preact.ComponentChildren[]
75
- ) => preact.VNode<any>;
76
- export function isValidElement(element: any): boolean;
77
- export function findDOMNode(component: preact.Component): Element | null;
78
-
79
- export abstract class PureComponent<P = {}, S = {}> extends preact.Component<
80
- P,
81
- S
82
- > {
83
- isPureReactComponent: boolean;
84
- }
85
-
86
- export function memo<C extends preact.FunctionalComponent<any>>(
87
- component: C,
88
- comparer?: (
89
- prev: preact.ComponentProps<C>,
90
- next: preact.ComponentProps<C>
91
- ) => boolean
92
- ): C;
93
-
94
- export interface ForwardFn<P = {}, T = any> {
95
- (props: P, ref: Ref<T>): preact.ComponentChild;
96
- displayName?: string;
97
- }
98
-
99
- export function forwardRef<R, P = {}>(
100
- fn: ForwardFn<P, R>
101
- ): preact.FunctionalComponent<P>;
102
-
103
- export function unstable_batchedUpdates(
104
- callback: (arg?: any) => void,
105
- arg?: any
106
- ): void;
107
-
108
- export const Children: {
109
- map<T extends preact.ComponentChild, R>(
110
- children: T | T[],
111
- fn: (child: T, i: number) => R
112
- ): R[];
113
- forEach<T extends preact.ComponentChild>(
114
- children: T | T[],
115
- fn: (child: T, i: number) => void
116
- ): void;
117
- count: (children: preact.ComponentChildren) => number;
118
- only: (children: preact.ComponentChildren) => preact.ComponentChild;
119
- toArray: (children: preact.ComponentChildren) => preact.VNode<{}>[];
120
- };
121
- }
@@ -1,159 +0,0 @@
1
- import {
2
- createElement,
3
- render as preactRender,
4
- cloneElement as preactCloneElement,
5
- createRef,
6
- Component,
7
- createContext,
8
- Fragment
9
- } from 'preact';
10
- import {
11
- useState,
12
- useReducer,
13
- useEffect,
14
- useLayoutEffect,
15
- useRef,
16
- useImperativeHandle,
17
- useMemo,
18
- useCallback,
19
- useContext,
20
- useDebugValue
21
- } from 'preact/hooks';
22
- import { PureComponent } from './PureComponent';
23
- import { memo } from './memo';
24
- import { forwardRef } from './forwardRef';
25
- import { Children } from './Children';
26
- import { Suspense, lazy } from './suspense';
27
- import { SuspenseList } from './suspense-list';
28
- import { createPortal } from './portals';
29
- import { hydrate, render, REACT_ELEMENT_TYPE } from './render';
30
-
31
- const version = '16.8.0'; // trick libraries to think we are react
32
-
33
- /**
34
- * Legacy version of createElement.
35
- * @param {import('./internal').VNode["type"]} type The node name or Component constructor
36
- */
37
- function createFactory(type) {
38
- return createElement.bind(null, type);
39
- }
40
-
41
- /**
42
- * Check if the passed element is a valid (p)react node.
43
- * @param {*} element The element to check
44
- * @returns {boolean}
45
- */
46
- function isValidElement(element) {
47
- return !!element && element.$$typeof === REACT_ELEMENT_TYPE;
48
- }
49
-
50
- /**
51
- * Wrap `cloneElement` to abort if the passed element is not a valid element and apply
52
- * all vnode normalizations.
53
- * @param {import('./internal').VNode} element The vnode to clone
54
- * @param {object} props Props to add when cloning
55
- * @param {Array<import('./internal').ComponentChildren>} rest Optional component children
56
- */
57
- function cloneElement(element) {
58
- if (!isValidElement(element)) return element;
59
- return preactCloneElement.apply(null, arguments);
60
- }
61
-
62
- /**
63
- * Remove a component tree from the DOM, including state and event handlers.
64
- * @param {import('./internal').PreactElement} container
65
- * @returns {boolean}
66
- */
67
- function unmountComponentAtNode(container) {
68
- if (container._children) {
69
- preactRender(null, container);
70
- return true;
71
- }
72
- return false;
73
- }
74
-
75
- /**
76
- * Get the matching DOM node for a component
77
- * @param {import('./internal').Component} component
78
- * @returns {import('./internal').PreactElement | null}
79
- */
80
- function findDOMNode(component) {
81
- return (
82
- (component &&
83
- (component.base || (component.nodeType === 1 && component))) ||
84
- null
85
- );
86
- }
87
-
88
- /**
89
- * Deprecated way to control batched rendering inside the reconciler, but we
90
- * already schedule in batches inside our rendering code
91
- * @template Arg
92
- * @param {(arg: Arg) => void} callback function that triggers the updated
93
- * @param {Arg} [arg] Optional argument that can be passed to the callback
94
- */
95
- // eslint-disable-next-line camelcase
96
- const unstable_batchedUpdates = (callback, arg) => callback(arg);
97
-
98
- export * from 'preact/hooks';
99
- export {
100
- version,
101
- Children,
102
- render,
103
- hydrate,
104
- unmountComponentAtNode,
105
- createPortal,
106
- createElement,
107
- createContext,
108
- createFactory,
109
- cloneElement,
110
- createRef,
111
- Fragment,
112
- isValidElement,
113
- findDOMNode,
114
- Component,
115
- PureComponent,
116
- memo,
117
- forwardRef,
118
- // eslint-disable-next-line camelcase
119
- unstable_batchedUpdates,
120
- Suspense,
121
- SuspenseList,
122
- lazy
123
- };
124
-
125
- // React copies the named exports to the default one.
126
- export default {
127
- useState,
128
- useReducer,
129
- useEffect,
130
- useLayoutEffect,
131
- useRef,
132
- useImperativeHandle,
133
- useMemo,
134
- useCallback,
135
- useContext,
136
- useDebugValue,
137
- version,
138
- Children,
139
- render,
140
- hydrate: render,
141
- unmountComponentAtNode,
142
- createPortal,
143
- createElement,
144
- createContext,
145
- createFactory,
146
- cloneElement,
147
- createRef,
148
- Fragment,
149
- isValidElement,
150
- findDOMNode,
151
- Component,
152
- PureComponent,
153
- memo,
154
- forwardRef,
155
- unstable_batchedUpdates,
156
- Suspense,
157
- SuspenseList,
158
- lazy
159
- };
@@ -1,45 +0,0 @@
1
- import {
2
- Component as PreactComponent,
3
- VNode as PreactVNode,
4
- FunctionalComponent as PreactFunctionalComponent
5
- } from '../../src/internal';
6
- import { SuspenseProps } from './suspense';
7
-
8
- export { ComponentChildren } from '../..';
9
-
10
- export { PreactElement } from '../../src/internal';
11
-
12
- export interface Component<P = {}, S = {}> extends PreactComponent<P, S> {
13
- isReactComponent?: object;
14
- isPureReactComponent?: true;
15
- _patchedLifecycles?: true;
16
-
17
- _childDidSuspend?(
18
- error: Promise<void>,
19
- suspendingComponent: Component<any, any>
20
- ): void;
21
- _suspendedComponentWillUnmount?(): void;
22
- }
23
-
24
- export interface FunctionalComponent<P = {}>
25
- extends PreactFunctionalComponent<P> {
26
- shouldComponentUpdate?(nextProps: Readonly<P>): boolean;
27
- _forwarded?: boolean;
28
- _patchedLifecycles?: true;
29
- }
30
-
31
- export interface VNode<T = any> extends PreactVNode<T> {
32
- $$typeof?: symbol | string;
33
- preactCompatNormalized?: boolean;
34
- }
35
-
36
- export interface SuspenseState {
37
- _suspended?: null | VNode<any>;
38
- }
39
-
40
- export interface SuspenseComponent
41
- extends PreactComponent<SuspenseProps, SuspenseState> {
42
- _pendingSuspensionCount: number;
43
- _suspenders: Component[];
44
- _detachOnNextRender: null | VNode<any>;
45
- }
@@ -1,34 +0,0 @@
1
- import { createElement } from 'preact';
2
- import { shallowDiffers, assign } from './util';
3
-
4
- /**
5
- * Memoize a component, so that it only updates when the props actually have
6
- * changed. This was previously known as `React.pure`.
7
- * @param {import('./internal').FunctionalComponent} c functional component
8
- * @param {(prev: object, next: object) => boolean} [comparer] Custom equality function
9
- * @returns {import('./internal').FunctionalComponent}
10
- */
11
- export function memo(c, comparer) {
12
- function shouldUpdate(nextProps) {
13
- let ref = this.props.ref;
14
- let updateRef = ref == nextProps.ref;
15
- if (!updateRef && ref) {
16
- ref.call ? ref(null) : (ref.current = null);
17
- }
18
-
19
- if (!comparer) {
20
- return shallowDiffers(this.props, nextProps);
21
- }
22
-
23
- return !comparer(this.props, nextProps) || !updateRef;
24
- }
25
-
26
- function Memoed(props) {
27
- this.shouldComponentUpdate = shouldUpdate;
28
- return createElement(c, assign({}, props));
29
- }
30
- Memoed.prototype.isReactComponent = true;
31
- Memoed.displayName = 'Memo(' + (c.displayName || c.name) + ')';
32
- Memoed._forwarded = true;
33
- return Memoed;
34
- }
@@ -1,85 +0,0 @@
1
- import { createElement, hydrate, render, _unmount } from 'preact';
2
-
3
- class ContextProvider {
4
- getChildContext() {
5
- return this.props.context;
6
- }
7
- render(props) {
8
- return props.children;
9
- }
10
- }
11
-
12
- /**
13
- * Portal component
14
- * @param {object | null | undefined} props
15
- */
16
- function Portal(props) {
17
- let _this = this;
18
- let container = props.container;
19
- let wrap = createElement(
20
- ContextProvider,
21
- { context: _this.context },
22
- props.vnode
23
- );
24
-
25
- // When we change container we should clear our old container and
26
- // indicate a new mount.
27
- if (_this._container && _this._container !== container) {
28
- if (_this._temp.parentNode) _this._container.removeChild(_this._temp);
29
- _unmount(_this._wrap);
30
- _this._hasMounted = false;
31
- }
32
-
33
- // When props.vnode is undefined/false/null we are dealing with some kind of
34
- // conditional vnode. This should not trigger a render.
35
- if (props.vnode) {
36
- if (!_this._hasMounted) {
37
- // Create a placeholder that we can use to insert into.
38
- _this._temp = document.createTextNode('');
39
- // Hydrate existing nodes to keep the dom intact, when rendering
40
- // wrap into the container.
41
- hydrate('', container);
42
- // Append to the container (this matches React's behavior)
43
- container.appendChild(_this._temp);
44
- // At this point we have mounted and should set our container.
45
- _this._hasMounted = true;
46
- _this._container = container;
47
- // Render our wrapping element into temp.
48
- render(wrap, container, _this._temp);
49
- _this._children = _this._temp._children;
50
- } else {
51
- // When we have mounted and the vnode is present it means the
52
- // props have changed or a parent is triggering a rerender.
53
- // This implies we only need to call render. But we need to keep
54
- // the old tree around, otherwise will treat the vnodes as new and
55
- // will wrongly call `componentDidMount` on them
56
- container._children = _this._children;
57
- render(wrap, container);
58
- _this._children = container._children;
59
- }
60
- }
61
- // When we come from a conditional render, on a mounted
62
- // portal we should clear the DOM.
63
- else if (_this._hasMounted) {
64
- if (_this._temp.parentNode) _this._container.removeChild(_this._temp);
65
- _unmount(_this._wrap);
66
- }
67
- // Set the wrapping element for future unmounting.
68
- _this._wrap = wrap;
69
-
70
- _this.componentWillUnmount = () => {
71
- if (_this._temp.parentNode) _this._container.removeChild(_this._temp);
72
- _unmount(_this._wrap);
73
- };
74
-
75
- return null;
76
- }
77
-
78
- /**
79
- * Create a `Portal` to continue rendering the vnode tree at a different DOM node
80
- * @param {import('./internal').VNode} vnode The vnode to render
81
- * @param {import('./internal').PreactElement} container The DOM node to continue rendering in to.
82
- */
83
- export function createPortal(vnode, container) {
84
- return createElement(Portal, { vnode, container });
85
- }
@@ -1,166 +0,0 @@
1
- import {
2
- render as preactRender,
3
- hydrate as preactHydrate,
4
- options,
5
- toChildArray,
6
- Component
7
- } from 'preact';
8
- import { applyEventNormalization } from './events';
9
-
10
- const CAMEL_PROPS = /^(?:accent|alignment|arabic|baseline|cap|clip(?!PathU)|color|fill|flood|font|glyph(?!R)|horiz|marker(?!H|W|U)|overline|paint|stop|strikethrough|stroke|text(?!L)|underline|unicode|units|v|vector|vert|word|writing|x(?!C))[A-Z]/;
11
-
12
- // Some libraries like `react-virtualized` explicitly check for this.
13
- Component.prototype.isReactComponent = {};
14
-
15
- export const REACT_ELEMENT_TYPE =
16
- (typeof Symbol != 'undefined' && Symbol.for && Symbol.for('react.element')) ||
17
- 0xeac7;
18
-
19
- /**
20
- * Proxy render() since React returns a Component reference.
21
- * @param {import('./internal').VNode} vnode VNode tree to render
22
- * @param {import('./internal').PreactElement} parent DOM node to render vnode tree into
23
- * @param {() => void} [callback] Optional callback that will be called after rendering
24
- * @returns {import('./internal').Component | null} The root component reference or null
25
- */
26
- export function render(vnode, parent, callback) {
27
- // React destroys any existing DOM nodes, see #1727
28
- // ...but only on the first render, see #1828
29
- if (parent._children == null) {
30
- while (parent.firstChild) {
31
- parent.removeChild(parent.firstChild);
32
- }
33
- }
34
-
35
- preactRender(vnode, parent);
36
- if (typeof callback == 'function') callback();
37
-
38
- return vnode ? vnode._component : null;
39
- }
40
-
41
- export function hydrate(vnode, parent, callback) {
42
- preactHydrate(vnode, parent);
43
- if (typeof callback == 'function') callback();
44
-
45
- return vnode ? vnode._component : null;
46
- }
47
-
48
- let oldEventHook = options.event;
49
- options.event = e => {
50
- if (oldEventHook) e = oldEventHook(e);
51
- e.persist = () => {};
52
- let stoppedPropagating = false,
53
- defaultPrevented = false;
54
-
55
- const origStopPropagation = e.stopPropagation;
56
- e.stopPropagation = () => {
57
- origStopPropagation.call(e);
58
- stoppedPropagating = true;
59
- };
60
-
61
- const origPreventDefault = e.preventDefault;
62
- e.preventDefault = () => {
63
- origPreventDefault.call(e);
64
- defaultPrevented = true;
65
- };
66
-
67
- e.isPropagationStopped = () => stoppedPropagating;
68
- e.isDefaultPrevented = () => defaultPrevented;
69
- return (e.nativeEvent = e);
70
- };
71
-
72
- // Patch in `UNSAFE_*` lifecycle hooks
73
- function setSafeDescriptor(proto, key) {
74
- if (proto['UNSAFE_' + key] && !proto[key]) {
75
- Object.defineProperty(proto, key, {
76
- configurable: false,
77
- get() {
78
- return this['UNSAFE_' + key];
79
- },
80
- // This `set` is only used if a user sets a lifecycle like cWU
81
- // after setting a lifecycle like UNSAFE_cWU. I doubt anyone
82
- // actually does this in practice so not testing it
83
- /* istanbul ignore next */
84
- set(v) {
85
- this['UNSAFE_' + key] = v;
86
- }
87
- });
88
- }
89
- }
90
-
91
- let classNameDescriptor = {
92
- configurable: true,
93
- get() {
94
- return this.class;
95
- }
96
- };
97
-
98
- let oldVNodeHook = options.vnode;
99
- options.vnode = vnode => {
100
- vnode.$$typeof = REACT_ELEMENT_TYPE;
101
-
102
- let type = vnode.type;
103
- let props = vnode.props;
104
-
105
- if (type) {
106
- // Alias `class` prop to `className` if available
107
- if (props.class && props.class != props.className) {
108
- classNameDescriptor.enumerable = 'className' in props;
109
- if (props.className != null) props.class = props.className;
110
- Object.defineProperty(props, 'className', classNameDescriptor);
111
- }
112
-
113
- // Apply DOM VNode compat
114
- if (typeof type != 'function') {
115
- // Apply defaultValue to value
116
- if (props.defaultValue && props.value !== undefined) {
117
- if (!props.value && props.value !== 0) {
118
- props.value = props.defaultValue;
119
- }
120
- delete props.defaultValue;
121
- }
122
-
123
- // Add support for array select values: <select value={[]} />
124
- if (Array.isArray(props.value) && props.multiple && type === 'select') {
125
- toChildArray(props.children).forEach(child => {
126
- if (props.value.indexOf(child.props.value) != -1) {
127
- child.props.selected = true;
128
- }
129
- });
130
- delete props.value;
131
- }
132
-
133
- // Normalize DOM vnode properties.
134
- let shouldSanitize, attrs, i;
135
- for (i in props) if ((shouldSanitize = CAMEL_PROPS.test(i))) break;
136
- if (shouldSanitize) {
137
- attrs = vnode.props = {};
138
- for (i in props) {
139
- attrs[
140
- CAMEL_PROPS.test(i) ? i.replace(/[A-Z0-9]/, '-$&').toLowerCase() : i
141
- ] = props[i];
142
- }
143
- }
144
- }
145
-
146
- // Events
147
- applyEventNormalization(vnode);
148
-
149
- // Component base class compat
150
- // We can't just patch the base component class, because components that use
151
- // inheritance and are transpiled down to ES5 will overwrite our patched
152
- // getters and setters. See #1941
153
- if (
154
- typeof type == 'function' &&
155
- !type._patchedLifecycles &&
156
- type.prototype
157
- ) {
158
- setSafeDescriptor(type.prototype, 'componentWillMount');
159
- setSafeDescriptor(type.prototype, 'componentWillReceiveProps');
160
- setSafeDescriptor(type.prototype, 'componentWillUpdate');
161
- type._patchedLifecycles = true;
162
- }
163
- }
164
-
165
- if (oldVNodeHook) oldVNodeHook(vnode);
166
- };
@@ -1,14 +0,0 @@
1
- import { Component, ComponentChild } from '../../src';
2
-
3
- //
4
- // SuspenseList
5
- // -----------------------------------
6
-
7
- export interface SuspenseListProps {
8
- children?: preact.ComponentChildren;
9
- revealOrder?: 'forwards' | 'backwards' | 'together';
10
- }
11
-
12
- export class SuspenseList extends Component<SuspenseListProps> {
13
- render(): ComponentChild;
14
- }