@tarojs/components 3.5.6 → 3.5.7-alpha.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 (240) hide show
  1. package/dist/cjs/helper-db78e01a.js +19 -0
  2. package/dist/cjs/loader.cjs.js +1 -1
  3. package/dist/cjs/taro-ad-core.cjs.entry.js +3 -1
  4. package/dist/cjs/taro-ad-custom-core.cjs.entry.js +3 -1
  5. package/dist/cjs/taro-camera-core.cjs.entry.js +3 -1
  6. package/dist/cjs/taro-components.cjs.js +1 -1
  7. package/dist/cjs/taro-editor-core.cjs.entry.js +3 -1
  8. package/dist/cjs/taro-functional-page-navigator-core.cjs.entry.js +3 -1
  9. package/dist/cjs/taro-keyboard-accessory-core.cjs.entry.js +3 -1
  10. package/dist/cjs/taro-live-player-core.cjs.entry.js +3 -1
  11. package/dist/cjs/taro-live-pusher-core.cjs.entry.js +3 -1
  12. package/dist/cjs/taro-map-core.cjs.entry.js +3 -1
  13. package/dist/cjs/taro-match-media-core.cjs.entry.js +3 -1
  14. package/dist/cjs/taro-movable-area-core.cjs.entry.js +1 -1
  15. package/dist/cjs/taro-movable-view-core.cjs.entry.js +2 -2
  16. package/dist/cjs/taro-navigation-bar-core.cjs.entry.js +3 -1
  17. package/dist/cjs/taro-official-account-core.cjs.entry.js +3 -1
  18. package/dist/cjs/taro-open-data-core.cjs.entry.js +3 -1
  19. package/dist/cjs/taro-page-container-core.cjs.entry.js +3 -1
  20. package/dist/cjs/taro-page-meta-core.cjs.entry.js +3 -1
  21. package/dist/cjs/taro-root-portal-core.cjs.entry.js +3 -1
  22. package/dist/cjs/taro-share-element-core.cjs.entry.js +3 -1
  23. package/dist/cjs/taro-slot-core.cjs.entry.js +3 -1
  24. package/dist/cjs/taro-voip-room-core.cjs.entry.js +3 -1
  25. package/dist/collection/components/ad/ad.js +2 -2
  26. package/dist/collection/components/ad-custom/ad-custom.js +2 -2
  27. package/dist/collection/components/camera/camera.js +2 -2
  28. package/dist/collection/components/editor/editor.js +2 -2
  29. package/dist/collection/components/functional-page-navigator/functional-page-navigator.js +2 -2
  30. package/dist/collection/components/keyboard-accessory/keyboard-accessory.js +2 -2
  31. package/dist/collection/components/live-player/live-player.js +2 -2
  32. package/dist/collection/components/live-pusher/live-pusher.js +2 -2
  33. package/dist/collection/components/map/map.js +2 -2
  34. package/dist/collection/components/match-media/match-media.js +2 -2
  35. package/dist/collection/components/movable-area/area.css +2 -2
  36. package/dist/collection/components/movable-area/movable-view.js +2 -4
  37. package/dist/collection/components/navigation-bar/navigation-bar.js +2 -2
  38. package/dist/collection/components/official-account/official-account.js +2 -2
  39. package/dist/collection/components/open-data/open-data.js +2 -2
  40. package/dist/collection/components/page-container/page-container.js +2 -2
  41. package/dist/collection/components/page-meta/page-meta.js +2 -2
  42. package/dist/collection/components/root-portal/root-portal.js +2 -2
  43. package/dist/collection/components/share-element/share-element.js +2 -2
  44. package/dist/collection/components/slot/slot.js +2 -2
  45. package/dist/collection/components/voip-room/voip-room.js +2 -2
  46. package/dist/collection/utils/helper.js +10 -0
  47. package/dist/collection/utils/index.js +1 -0
  48. package/dist/esm/helper-3d0ecf0f.js +13 -0
  49. package/dist/esm/loader.js +1 -1
  50. package/dist/esm/taro-ad-core.entry.js +3 -1
  51. package/dist/esm/taro-ad-custom-core.entry.js +3 -1
  52. package/dist/esm/taro-camera-core.entry.js +3 -1
  53. package/dist/esm/taro-components.js +1 -1
  54. package/dist/esm/taro-editor-core.entry.js +3 -1
  55. package/dist/esm/taro-functional-page-navigator-core.entry.js +3 -1
  56. package/dist/esm/taro-keyboard-accessory-core.entry.js +3 -1
  57. package/dist/esm/taro-live-player-core.entry.js +3 -1
  58. package/dist/esm/taro-live-pusher-core.entry.js +3 -1
  59. package/dist/esm/taro-map-core.entry.js +3 -1
  60. package/dist/esm/taro-match-media-core.entry.js +3 -1
  61. package/dist/esm/taro-movable-area-core.entry.js +1 -1
  62. package/dist/esm/taro-movable-view-core.entry.js +3 -3
  63. package/dist/esm/taro-navigation-bar-core.entry.js +3 -1
  64. package/dist/esm/taro-official-account-core.entry.js +3 -1
  65. package/dist/esm/taro-open-data-core.entry.js +3 -1
  66. package/dist/esm/taro-page-container-core.entry.js +3 -1
  67. package/dist/esm/taro-page-meta-core.entry.js +3 -1
  68. package/dist/esm/taro-root-portal-core.entry.js +3 -1
  69. package/dist/esm/taro-share-element-core.entry.js +3 -1
  70. package/dist/esm/taro-slot-core.entry.js +3 -1
  71. package/dist/esm/taro-voip-room-core.entry.js +3 -1
  72. package/dist/esm-es5/helper-3d0ecf0f.js +1 -0
  73. package/dist/esm-es5/loader.js +1 -1
  74. package/dist/esm-es5/taro-ad-core.entry.js +1 -1
  75. package/dist/esm-es5/taro-ad-custom-core.entry.js +1 -1
  76. package/dist/esm-es5/taro-camera-core.entry.js +1 -1
  77. package/dist/esm-es5/taro-components.js +1 -1
  78. package/dist/esm-es5/taro-editor-core.entry.js +1 -1
  79. package/dist/esm-es5/taro-functional-page-navigator-core.entry.js +1 -1
  80. package/dist/esm-es5/taro-keyboard-accessory-core.entry.js +1 -1
  81. package/dist/esm-es5/taro-live-player-core.entry.js +1 -1
  82. package/dist/esm-es5/taro-live-pusher-core.entry.js +1 -1
  83. package/dist/esm-es5/taro-map-core.entry.js +1 -1
  84. package/dist/esm-es5/taro-match-media-core.entry.js +1 -1
  85. package/dist/esm-es5/taro-movable-area-core.entry.js +1 -1
  86. package/dist/esm-es5/taro-movable-view-core.entry.js +1 -1
  87. package/dist/esm-es5/taro-navigation-bar-core.entry.js +1 -1
  88. package/dist/esm-es5/taro-official-account-core.entry.js +1 -1
  89. package/dist/esm-es5/taro-open-data-core.entry.js +1 -1
  90. package/dist/esm-es5/taro-page-container-core.entry.js +1 -1
  91. package/dist/esm-es5/taro-page-meta-core.entry.js +1 -1
  92. package/dist/esm-es5/taro-root-portal-core.entry.js +1 -1
  93. package/dist/esm-es5/taro-share-element-core.entry.js +1 -1
  94. package/dist/esm-es5/taro-slot-core.entry.js +1 -1
  95. package/dist/esm-es5/taro-voip-room-core.entry.js +1 -1
  96. package/dist/taro-components/p-028e2728.entry.js +1 -0
  97. package/dist/taro-components/p-0380841f.system.js +1 -1
  98. package/dist/taro-components/p-06178a0c.entry.js +1 -0
  99. package/dist/taro-components/p-07294134.system.entry.js +1 -0
  100. package/dist/taro-components/p-075458e5.system.entry.js +1 -0
  101. package/dist/taro-components/p-15e45ed6.system.js +1 -0
  102. package/dist/taro-components/p-2ec47545.entry.js +1 -0
  103. package/dist/taro-components/p-3e11c8cc.system.entry.js +1 -0
  104. package/dist/taro-components/{p-f8b9c4b0.entry.js → p-42630f45.entry.js} +1 -1
  105. package/dist/taro-components/p-4cf436f9.entry.js +1 -0
  106. package/dist/taro-components/p-4d826fb7.entry.js +1 -0
  107. package/dist/taro-components/p-55266a1f.entry.js +1 -0
  108. package/dist/taro-components/p-57a2a441.entry.js +1 -0
  109. package/dist/taro-components/p-59d93770.entry.js +1 -0
  110. package/dist/taro-components/p-5a374cb9.entry.js +1 -0
  111. package/dist/taro-components/p-62fc514e.entry.js +1 -0
  112. package/dist/taro-components/p-6800ac6f.entry.js +1 -0
  113. package/dist/taro-components/p-6a96da58.js +1 -0
  114. package/dist/taro-components/p-6aa557f0.entry.js +1 -0
  115. package/dist/taro-components/p-6ad59489.system.entry.js +1 -0
  116. package/dist/taro-components/p-733cc64a.system.entry.js +1 -0
  117. package/dist/taro-components/p-7374537f.entry.js +1 -0
  118. package/dist/taro-components/p-7d329ab0.entry.js +1 -0
  119. package/dist/taro-components/p-7e960ac3.system.entry.js +1 -0
  120. package/dist/taro-components/p-8e2b048e.system.entry.js +1 -0
  121. package/dist/taro-components/p-9234cc1d.entry.js +1 -0
  122. package/dist/taro-components/p-93eed5d7.system.entry.js +1 -0
  123. package/dist/taro-components/p-9e1572c5.system.entry.js +1 -0
  124. package/dist/taro-components/p-afbcd093.entry.js +1 -0
  125. package/dist/taro-components/p-b11aaf69.system.entry.js +1 -0
  126. package/dist/taro-components/p-b1ae9401.entry.js +1 -0
  127. package/dist/taro-components/p-b60820b4.entry.js +1 -0
  128. package/dist/taro-components/p-b7681c76.system.entry.js +1 -0
  129. package/dist/taro-components/p-c5fd5c7f.system.entry.js +1 -0
  130. package/dist/taro-components/p-c92bafb6.system.entry.js +1 -0
  131. package/dist/taro-components/p-c93bb915.system.entry.js +1 -0
  132. package/dist/taro-components/p-cf048af9.entry.js +1 -0
  133. package/dist/taro-components/p-d075934f.system.entry.js +1 -0
  134. package/dist/taro-components/p-d4da725f.system.entry.js +1 -0
  135. package/dist/taro-components/p-d5f3080c.entry.js +1 -0
  136. package/dist/taro-components/p-d6662ab3.system.entry.js +1 -0
  137. package/dist/taro-components/p-f2803c2e.system.entry.js +1 -0
  138. package/dist/taro-components/p-f4ea8a56.system.entry.js +1 -0
  139. package/dist/taro-components/{p-1c775a11.system.entry.js → p-f5f1c3b7.system.entry.js} +1 -1
  140. package/dist/taro-components/p-f7c80795.system.entry.js +1 -0
  141. package/dist/taro-components/taro-components.esm.js +1 -1
  142. package/dist/types/components/ad/ad.d.ts +2 -1
  143. package/dist/types/components/ad-custom/ad-custom.d.ts +2 -1
  144. package/dist/types/components/camera/camera.d.ts +2 -1
  145. package/dist/types/components/editor/editor.d.ts +2 -1
  146. package/dist/types/components/functional-page-navigator/functional-page-navigator.d.ts +2 -1
  147. package/dist/types/components/keyboard-accessory/keyboard-accessory.d.ts +2 -1
  148. package/dist/types/components/live-player/live-player.d.ts +2 -1
  149. package/dist/types/components/live-pusher/live-pusher.d.ts +2 -1
  150. package/dist/types/components/map/map.d.ts +2 -1
  151. package/dist/types/components/match-media/match-media.d.ts +2 -1
  152. package/dist/types/components/navigation-bar/navigation-bar.d.ts +2 -1
  153. package/dist/types/components/official-account/official-account.d.ts +2 -1
  154. package/dist/types/components/open-data/open-data.d.ts +2 -1
  155. package/dist/types/components/page-container/page-container.d.ts +2 -1
  156. package/dist/types/components/page-meta/page-meta.d.ts +2 -1
  157. package/dist/types/components/root-portal/root-portal.d.ts +2 -1
  158. package/dist/types/components/share-element/share-element.d.ts +2 -1
  159. package/dist/types/components/slot/slot.d.ts +2 -1
  160. package/dist/types/components/voip-room/voip-room.d.ts +2 -1
  161. package/dist/types/utils/helper.d.ts +1 -0
  162. package/dist/types/utils/index.d.ts +1 -0
  163. package/mini/index.js +1 -0
  164. package/package.json +8 -7
  165. package/types/Ad.d.ts +20 -21
  166. package/types/Audio.d.ts +5 -5
  167. package/types/Button.d.ts +67 -71
  168. package/types/Camera.d.ts +39 -8
  169. package/types/Canvas.d.ts +22 -38
  170. package/types/Checkbox.d.ts +7 -7
  171. package/types/CoverImage.d.ts +15 -16
  172. package/types/CoverView.d.ts +5 -6
  173. package/types/Form.d.ts +10 -10
  174. package/types/Image.d.ts +20 -31
  175. package/types/Input.d.ts +23 -24
  176. package/types/LivePlayer.d.ts +31 -25
  177. package/types/LivePusher.d.ts +5 -5
  178. package/types/Map.d.ts +66 -99
  179. package/types/MovableView.d.ts +21 -33
  180. package/types/NavigationBar.d.ts +1 -1
  181. package/types/Navigator.d.ts +10 -10
  182. package/types/OpenData.d.ts +5 -5
  183. package/types/PageContainer.d.ts +7 -10
  184. package/types/PageMeta.d.ts +14 -14
  185. package/types/Picker.d.ts +1 -5
  186. package/types/PickerView.d.ts +11 -23
  187. package/types/Progress.d.ts +5 -5
  188. package/types/RadioGroup.d.ts +5 -5
  189. package/types/RichText.d.ts +17 -17
  190. package/types/ScrollView.d.ts +46 -48
  191. package/types/Slider.d.ts +10 -10
  192. package/types/Swiper.d.ts +20 -29
  193. package/types/Switch.d.ts +5 -6
  194. package/types/Textarea.d.ts +32 -34
  195. package/types/Video.d.ts +119 -123
  196. package/types/View.d.ts +13 -32
  197. package/types/VoipRoom.d.ts +5 -5
  198. package/types/WebView.d.ts +11 -5
  199. package/dist/collection/utils/json-schema-to-types.js +0 -224
  200. package/dist/taro-components/p-0414632d.system.entry.js +0 -1
  201. package/dist/taro-components/p-10e5df98.system.entry.js +0 -1
  202. package/dist/taro-components/p-14058364.system.entry.js +0 -1
  203. package/dist/taro-components/p-1a638246.system.entry.js +0 -1
  204. package/dist/taro-components/p-1e530acd.entry.js +0 -1
  205. package/dist/taro-components/p-22e33350.entry.js +0 -1
  206. package/dist/taro-components/p-24a66088.system.entry.js +0 -1
  207. package/dist/taro-components/p-2fd0250d.system.entry.js +0 -1
  208. package/dist/taro-components/p-3c7cdf6f.entry.js +0 -1
  209. package/dist/taro-components/p-410d449f.entry.js +0 -1
  210. package/dist/taro-components/p-443fb8b0.entry.js +0 -1
  211. package/dist/taro-components/p-44fa48b9.system.entry.js +0 -1
  212. package/dist/taro-components/p-481a8bc1.system.entry.js +0 -1
  213. package/dist/taro-components/p-49b64020.entry.js +0 -1
  214. package/dist/taro-components/p-4e8d4a72.system.entry.js +0 -1
  215. package/dist/taro-components/p-4f0e98c0.system.entry.js +0 -1
  216. package/dist/taro-components/p-4f805045.entry.js +0 -1
  217. package/dist/taro-components/p-5e3bd0db.system.entry.js +0 -1
  218. package/dist/taro-components/p-6da73376.entry.js +0 -1
  219. package/dist/taro-components/p-7325d380.entry.js +0 -1
  220. package/dist/taro-components/p-77ad7941.entry.js +0 -1
  221. package/dist/taro-components/p-7ab91097.entry.js +0 -1
  222. package/dist/taro-components/p-7b96cec3.system.entry.js +0 -1
  223. package/dist/taro-components/p-7e23b551.entry.js +0 -1
  224. package/dist/taro-components/p-7f0a12a9.entry.js +0 -1
  225. package/dist/taro-components/p-840ef0c3.system.entry.js +0 -1
  226. package/dist/taro-components/p-89c876a6.system.entry.js +0 -1
  227. package/dist/taro-components/p-90a6c15a.entry.js +0 -1
  228. package/dist/taro-components/p-95a36917.entry.js +0 -1
  229. package/dist/taro-components/p-9965cf11.system.entry.js +0 -1
  230. package/dist/taro-components/p-9fcb40a3.entry.js +0 -1
  231. package/dist/taro-components/p-a8c9b126.system.entry.js +0 -1
  232. package/dist/taro-components/p-aa5d45de.system.entry.js +0 -1
  233. package/dist/taro-components/p-b3693ca2.system.entry.js +0 -1
  234. package/dist/taro-components/p-b83c3eca.system.entry.js +0 -1
  235. package/dist/taro-components/p-c0c8b2be.entry.js +0 -1
  236. package/dist/taro-components/p-c8da5c10.entry.js +0 -1
  237. package/dist/taro-components/p-d72075ef.system.entry.js +0 -1
  238. package/dist/taro-components/p-db1f2db7.entry.js +0 -1
  239. package/dist/taro-components/p-e3f39099.entry.js +0 -1
  240. package/dist/types/utils/json-schema-to-types.d.ts +0 -25
package/types/Video.d.ts CHANGED
@@ -221,71 +221,6 @@ interface VideoProps extends StandardProps {
221
221
  */
222
222
  backgroundPoster?: string
223
223
 
224
- /** 当开始/继续播放时触发 play 事件
225
- * @supported weapp, alipay, swan, tt, qq, jd, h5, rn
226
- */
227
- onPlay?: CommonEventFunction
228
-
229
- /** 当暂停播放时触发 pause 事件
230
- * @supported weapp, alipay, swan, tt, qq, jd, h5, rn
231
- */
232
- onPause?: CommonEventFunction
233
-
234
- /** 当播放到末尾时触发 ended 事件
235
- * @supported weapp, alipay, swan, tt, qq, jd, h5, rn
236
- */
237
- onEnded?: CommonEventFunction
238
-
239
- /** 播放进度变化时触发, 触发频率 250ms 一次
240
- * @supported weapp, alipay, swan, tt, qq, jd, h5, rn
241
- */
242
- onTimeUpdate?: CommonEventFunction<VideoProps.onTimeUpdateEventDetail>
243
-
244
- /** 当视频进入和退出全屏时触发
245
- *
246
- * @supported h5, rn
247
- */
248
- onFullscreenChange?: CommonEventFunction<VideoProps.onFullscreenChangeEventDetail>
249
-
250
- /** 视频出现缓冲时触发
251
- *
252
- * @supported weapp, swan, tt, qq, jd
253
- */
254
- onWaiting?: CommonEventFunction<VideoProps.onWaitingEventDetail>
255
-
256
- /** 视频播放出错时触发
257
- * @supported weapp, alipay, swan, tt, qq, jd, h5, rn
258
- */
259
- onError?: CommonEventFunction
260
-
261
- /** 加载进度变化时触发,只支持一段加载
262
- * @supported weapp, tt, qq, h5
263
- */
264
- onProgress?: CommonEventFunction<VideoProps.onProgressEventDetail>
265
-
266
- /** 视频元数据加载完成时触发
267
- * @supported weapp, swan, tt, jd, rn
268
- */
269
- onLoadedMetaData?: CommonEventFunction<VideoProps.onLoadedMetaDataEventDetail>
270
-
271
- /**
272
- * 播放器进入小窗
273
- * @supported weapp
274
- */
275
- onEnterPictureInPicture?: CommonEventFunction
276
-
277
- /**
278
- * 播放器退出小窗
279
- * @supported weapp
280
- */
281
- onLeavePictureInPicture?: CommonEventFunction
282
-
283
- /**
284
- * seek 完成时触发
285
- * @supported weapp, tt
286
- */
287
- onSeekComplete?: CommonEventFunction
288
-
289
224
  /** 用于透传 `WebComponents` 上的属性到内部 H5 标签上
290
225
  * @supported h5
291
226
  */
@@ -326,33 +261,12 @@ interface VideoProps extends StandardProps {
326
261
  */
327
262
  licenseUrl?: string
328
263
 
329
- /** 视频进入和退出全屏时触发
330
- * @supported weapp, alipay, swan, tt, qq, jd
331
- */
332
- onFullScreenChange?: CommonEventFunction<VideoProps.onFullscreenChangeEventDetail>
333
-
334
- /** 切换 controls 显示隐藏时触发。
335
- * @supported weapp
336
- */
337
- onControlsToggle?: CommonEventFunction<VideoProps.onControlsToggleEventDetail>
338
-
339
- /** 内联样式。
340
- * @supported alipay
341
- */
342
- style?: string
343
-
344
- /** 外部样式名。
345
- * @supported alipay
346
- */
347
- class?: string
348
-
349
264
  /** 当 poster 高宽比跟视频高宽不匹配时,如何显示 poster,设置规则同 background-size 一致。
350
265
  * @supported alipay
351
266
  */
352
267
  posterSize?: string
353
268
 
354
269
  /** 当底部工具条隐藏时,是否显示细进度条(controls=false 时设置无效)。
355
- * 版本要求: 基础库 1.15.0 及以上
356
270
  * @supported alipay
357
271
  */
358
272
  showThinProgressBar?: string
@@ -364,44 +278,15 @@ interface VideoProps extends StandardProps {
364
278
  * 2 - 阻塞提醒(无消耗流量大小)
365
279
  * 3 - 阻塞提醒(有消耗流量大小提醒)
366
280
  *
367
- * 版本要求: 基础库 1.13.0 及以上
368
281
  * @supported alipay, jd
369
282
  */
370
283
  mobilenetHintType?: string
371
284
 
372
- /** 视频出现缓冲时触发。
373
- * @supported alipay
374
- */
375
- onLoading?: CommonEventFunction
376
-
377
- /** 点击视频 view 时触发
378
- * @supported alipay
379
- */
380
- onTap?: CommonEventFunction<VideoProps.onTapEventDetail>
381
-
382
- /** 用户操作事件
383
- * @supported alipay
384
- */
385
- onUserAction?: CommonEventFunction<VideoProps.onUserActionEventDetail>
386
-
387
- /** 视频播放终止。
388
- * 版本要求: 基础库 1.9.0 及以上
389
- * @supported alipay
390
- */
391
- onStop?: CommonEventFunction
392
-
393
- /** 当视频加载完真正开始播放时触发。
394
- * 版本要求: 基础库 1.13.6 及以上
395
- * @supported alipay
396
- */
397
- onRenderStart?: CommonEventFunction
398
-
399
285
  /** 浮窗设置。暂时不支持全局浮窗。
400
286
  * 可选值:
401
287
  *
402
288
  * none:无浮窗。
403
289
  * page:页面内浮窗。
404
- * 版本要求:基础库 1.24.6 及以上
405
290
  * @supported alipay
406
291
  */
407
292
  floatingMode?: string
@@ -456,6 +341,111 @@ interface VideoProps extends StandardProps {
456
341
  */
457
342
  signature?: string
458
343
 
344
+ /** 指定码率上界,单位为比特每秒
345
+ * @supported weapp
346
+ */
347
+ preferredPeakBitRate?: number
348
+
349
+ /** 当开始/继续播放时触发 play 事件
350
+ * @supported weapp, alipay, swan, tt, qq, jd, h5, rn
351
+ */
352
+ onPlay?: CommonEventFunction
353
+
354
+ /** 当暂停播放时触发 pause 事件
355
+ * @supported weapp, alipay, swan, tt, qq, jd, h5, rn
356
+ */
357
+ onPause?: CommonEventFunction
358
+
359
+ /** 当播放到末尾时触发 ended 事件
360
+ * @supported weapp, alipay, swan, tt, qq, jd, h5, rn
361
+ */
362
+ onEnded?: CommonEventFunction
363
+
364
+ /** 播放进度变化时触发, 触发频率 250ms 一次
365
+ * @supported weapp, alipay, swan, tt, qq, jd, h5, rn
366
+ */
367
+ onTimeUpdate?: CommonEventFunction<VideoProps.onTimeUpdateEventDetail>
368
+
369
+ /** 当视频进入和退出全屏时触发
370
+ *
371
+ * @supported h5, rn
372
+ */
373
+ onFullscreenChange?: CommonEventFunction<VideoProps.onFullscreenChangeEventDetail>
374
+
375
+ /** 视频出现缓冲时触发
376
+ *
377
+ * @supported weapp, swan, tt, qq, jd
378
+ */
379
+ onWaiting?: CommonEventFunction<VideoProps.onWaitingEventDetail>
380
+
381
+ /** 视频播放出错时触发
382
+ * @supported weapp, alipay, swan, tt, qq, jd, h5, rn
383
+ */
384
+ onError?: CommonEventFunction
385
+
386
+ /** 加载进度变化时触发,只支持一段加载
387
+ * @supported weapp, tt, qq, h5
388
+ */
389
+ onProgress?: CommonEventFunction<VideoProps.onProgressEventDetail>
390
+
391
+ /** 视频元数据加载完成时触发
392
+ * @supported weapp, swan, tt, jd, rn
393
+ */
394
+ onLoadedMetaData?: CommonEventFunction<VideoProps.onLoadedMetaDataEventDetail>
395
+
396
+ /**
397
+ * 播放器进入小窗
398
+ * @supported weapp
399
+ */
400
+ onEnterPictureInPicture?: CommonEventFunction
401
+
402
+ /**
403
+ * 播放器退出小窗
404
+ * @supported weapp
405
+ */
406
+ onLeavePictureInPicture?: CommonEventFunction
407
+
408
+ /**
409
+ * seek 完成时触发
410
+ * @supported weapp, tt
411
+ */
412
+ onSeekComplete?: CommonEventFunction
413
+
414
+ /** 视频进入和退出全屏时触发
415
+ * @supported weapp, alipay, swan, tt, qq, jd
416
+ */
417
+ onFullScreenChange?: CommonEventFunction<VideoProps.onFullscreenChangeEventDetail>
418
+
419
+ /** 切换 controls 显示隐藏时触发。
420
+ * @supported weapp
421
+ */
422
+ onControlsToggle?: CommonEventFunction<VideoProps.onControlsToggleEventDetail>
423
+
424
+ /** 视频出现缓冲时触发。
425
+ * @supported alipay
426
+ */
427
+ onLoading?: CommonEventFunction
428
+
429
+ /** 点击视频 view 时触发
430
+ * @supported alipay
431
+ */
432
+ onTap?: CommonEventFunction<VideoProps.onTapEventDetail>
433
+
434
+ /** 用户操作事件
435
+ * @supported alipay
436
+ */
437
+ onUserAction?: CommonEventFunction<VideoProps.onUserActionEventDetail>
438
+
439
+ /** 视频播放终止。
440
+ * @supported alipay
441
+ */
442
+ onStop?: CommonEventFunction
443
+
444
+ /** 当视频加载完真正开始播放时触发。
445
+ * @supported alipay
446
+ */
447
+ onRenderStart?: CommonEventFunction
448
+
459
449
  /** 贴片广告开始播放时触发
460
450
  * @supported tt
461
451
  */
@@ -479,17 +469,23 @@ interface VideoProps extends StandardProps {
479
469
  /** 视频倍速改变完成时触发。返回改变后的倍速值
480
470
  * @supported tt
481
471
  */
482
- onPlayBackRateChange?: CommonEventFunction<{ playbackRate: string }>
472
+ onPlayBackRateChange?: CommonEventFunction<{
473
+ playbackRate: string
474
+ }>
483
475
 
484
476
  /** 静音状态改变完成时触发。返回当前是否静音
485
477
  * @supported tt
486
478
  */
487
- onMuteChange?: CommonEventFunction<{ isMuted: boolean }>
479
+ onMuteChange?: CommonEventFunction<{
480
+ isMuted: boolean
481
+ }>
488
482
 
489
483
  /** 点击控件时触发。返回当前点击的控件类型
490
484
  * @supported tt
491
485
  */
492
- onControlTap?: CommonEventFunction<{ controlType }>
486
+ onControlTap?: CommonEventFunction<{
487
+ controlType
488
+ }>
493
489
 
494
490
  /** 进入小窗播放时触发
495
491
  * @supported tt
@@ -526,11 +522,6 @@ interface VideoProps extends StandardProps {
526
522
  */
527
523
  onSeeking?: CommonEventFunction
528
524
 
529
- /** 指定码率上界,单位为比特每秒
530
- * @supported weapp
531
- */
532
- preferredPeakBitRate?: number
533
-
534
525
  /** 贴片广告加载成功时触发,event.detail = { adType: 'preRollAd' | 'postRollAd' }
535
526
  * @supported tt
536
527
  */
@@ -622,14 +613,19 @@ declare namespace VideoProps {
622
613
  interface UserActionTag {
623
614
  /** 底部播放按钮 */
624
615
  play
616
+
625
617
  /** 中心播放按钮 */
626
618
  centerplay
619
+
627
620
  /** 静音按钮 */
628
621
  mute
622
+
629
623
  /** 全屏按钮 */
630
624
  fullscreen
625
+
631
626
  /** 重试按钮 */
632
627
  retry
628
+
633
629
  /** 网络提醒的播放按钮 */
634
630
  mobilenetplay
635
631
  }
package/types/View.d.ts CHANGED
@@ -34,7 +34,6 @@ interface ViewProps extends StandardProps {
34
34
  hoverStayTime?: number
35
35
 
36
36
  /** 是否阻止区域内滚动页面。
37
- * 默认值: false
38
37
  * 说明: 如果 view 中嵌套 view,外层 view 设置 disable-scroll 为 true 时禁止内部的滚动。
39
38
  * @supported alipay
40
39
  * @default false
@@ -42,27 +41,31 @@ interface ViewProps extends StandardProps {
42
41
  disableScroll?: string
43
42
 
44
43
  /** 是否隐藏。
45
- * 默认值: false
46
44
  * @supported alipay
47
45
  * @default false
48
46
  */
49
47
  hidden?: boolean
50
48
 
51
- /** 自定义样式名。
49
+ /** 用于动画,详见 my.createAnimation 。使用 my.createAnimation 生成的动画是通过过渡(Transition)实现的,只会触发 onTransitionEnd,不会触发 onAnimationStart, onAnimationIteration, onAnimationEnd。
52
50
  * @supported alipay
51
+ * @default {}
53
52
  */
54
- class?: string
53
+ animation?: TaroGeneral.IAnyObject
55
54
 
56
- /** 内联样式。
55
+ /** 表示组件的语义角色。设置为 img 时,组件聚焦后读屏软件会朗读出 图像 ;设置为 button 时,聚焦后读屏软件会朗读出 按钮 。详情请参见 aria-component。
57
56
  * @supported alipay
58
57
  */
59
- style?: string
58
+ role?: string
60
59
 
61
- /** 用于动画,详见 my.createAnimation 。使用 my.createAnimation 生成的动画是通过过渡(Transition)实现的,只会触发 onTransitionEnd,不会触发 onAnimationStart, onAnimationIteration, onAnimationEnd。
62
- * 默认值:{}
63
- * @supported alipay
60
+ /** 无障碍访问,(角色)标识元素的作用
61
+ * @supported qq
64
62
  */
65
- animation?: TaroGeneral.IAnyObject
63
+ ariaRole?: string
64
+
65
+ /** 无障碍访问,(属性)元素的额外描述
66
+ * @supported qq
67
+ */
68
+ ariaLabel?: string
66
69
 
67
70
  /** 点击。
68
71
  * @supported alipay
@@ -95,61 +98,39 @@ interface ViewProps extends StandardProps {
95
98
  onLongTap?: CommonEventFunction
96
99
 
97
100
  /** 过渡(Transition)结束时触发。
98
- * 版本要求: 基础库 1.8.0 及以上
99
101
  * @supported alipay
100
102
  */
101
103
  onTransitionEnd?: CommonEventFunction
102
104
 
103
105
  /** 每开启一次新的动画过程时触发。(第一次不触发)
104
- * 版本要求: 基础库 1.8.0 及以上
105
106
  * @supported alipay
106
107
  */
107
108
  onAnimationIteration?: CommonEventFunction
108
109
 
109
110
  /** 动画开始时触发。
110
- * 版本要求: 基础库 1.8.0 及以上
111
111
  * @supported alipay
112
112
  */
113
113
  onAnimationStart?: CommonEventFunction
114
114
 
115
115
  /** 动画结束时触发。
116
- * 版本要求: 基础库 1.8.0 及以上
117
116
  * @supported alipay
118
117
  */
119
118
  onAnimationEnd?: CommonEventFunction
120
119
 
121
120
  /** 当前元素可见面积超过50%时触发。
122
- * 版本要求: 基础库 1.9.0 及以上
123
121
  * @supported alipay
124
122
  */
125
123
  onAppear?: CommonEventFunction
126
124
 
127
125
  /** 当前元素不可见面积超过50%时触发。
128
- * 版本要求: 基础库 1.9.0 及以上
129
126
  * @supported alipay
130
127
  */
131
128
  onDisappear?: CommonEventFunction
132
129
 
133
130
  /** 当前元素首次可见面积达到50%时触发。
134
- * 版本要求: 基础库 1.9.4 及以上
135
131
  * @supported alipay
136
132
  */
137
133
  onFirstAppear?: CommonEventFunction
138
-
139
- /** 表示组件的语义角色。设置为 img 时,组件聚焦后读屏软件会朗读出 图像 ;设置为 button 时,聚焦后读屏软件会朗读出 按钮 。详情请参见 aria-component。
140
- * @supported alipay
141
- */
142
- role?: string
143
-
144
- /** 无障碍访问,(角色)标识元素的作用
145
- * @supported qq
146
- */
147
- ariaRole?: string
148
-
149
- /** 无障碍访问,(属性)元素的额外描述
150
- * @supported qq
151
- */
152
- ariaLabel?: string
153
134
  }
154
135
 
155
136
  /** 视图容器
@@ -13,16 +13,16 @@ interface VoipRoomProps extends StandardProps {
13
13
  */
14
14
  devicePosition?: keyof VoipRoomProps.DevicePosition
15
15
 
16
- /** 创建对话窗口失败时触发
16
+ /** 进入房间用户的 openid
17
+ * @default none
17
18
  * @supported weapp
18
19
  */
19
- onError?: CommonEventFunction
20
+ openId?: string
20
21
 
21
- /** 进入房间用户的 openid
22
- * @default none
22
+ /** 创建对话窗口失败时触发
23
23
  * @supported weapp
24
24
  */
25
- openid?: string
25
+ onError?: CommonEventFunction
26
26
  }
27
27
  declare namespace VoipRoomProps {
28
28
  /** 对话窗口类型 */
@@ -6,6 +6,17 @@ interface WebViewProps extends StandardProps {
6
6
  */
7
7
  src: string
8
8
 
9
+ /** webview 的进度条颜色
10
+ * @supported tt
11
+ */
12
+ progressbarColor?: string
13
+
14
+ /** 若使用web-view组件引入第三方客服,必须填写type="im"
15
+ * @supported tt
16
+ * @default default
17
+ */
18
+ type?: string
19
+
9
20
  /** 网页向小程序 postMessage 时,会在特定时机(小程序后退、组件销毁、分享)触发并收到消息。e.detail = { data }
10
21
  * @supported weapp, alipay, swan, tt, qq, jd
11
22
  */
@@ -20,11 +31,6 @@ interface WebViewProps extends StandardProps {
20
31
  * @supported weapp, alipay, tt, qq, h5, rn
21
32
  */
22
33
  onError?: CommonEventFunction<WebViewProps.onErrorEventDetail>
23
-
24
- /** webview 的进度条颜色
25
- * @supported tt
26
- */
27
- progressbarColor?: string
28
34
  }
29
35
  declare namespace WebViewProps {
30
36
  interface onMessageEventDetail {
@@ -1,224 +0,0 @@
1
- import generator from '@babel/generator';
2
- import * as parser from '@babel/parser';
3
- import traverse from '@babel/traverse';
4
- import * as t from '@babel/types';
5
- import * as fs from 'fs';
6
- import * as humps from 'humps';
7
- import { flattenDeep, isEmpty, toArray, xorWith } from 'lodash';
8
- import * as path from 'path';
9
- import { format as prettify } from 'prettier';
10
- const MINI_APP_TYPES = ['weapp', 'alipay', 'swan', 'tt', 'qq', 'jd'];
11
- const OMIT_PROPS = ['generic:simple-component'];
12
- class GenerateTypes {
13
- constructor(componentName) {
14
- this.jsonSchemas = {};
15
- this.componentName = componentName;
16
- MINI_APP_TYPES.forEach((type) => {
17
- try {
18
- const json = require(`miniapp-types/dist/schema/${type}/${componentName === 'AD' ? 'ad' : humps.decamelize(componentName, { separator: '-' })}.json`);
19
- if (!json) {
20
- return;
21
- }
22
- if (!this.jsonSchemas[componentName]) {
23
- this.jsonSchemas[componentName] = {};
24
- }
25
- this.jsonSchemas[componentName][type] = json;
26
- }
27
- catch (error) {
28
- // console.log(error)
29
- if (!this.jsonSchemas[componentName]) {
30
- this.jsonSchemas[componentName] = {};
31
- }
32
- }
33
- });
34
- }
35
- // 获取不存在的属性
36
- getMissingProps(props) {
37
- const obj = {};
38
- const jsonSchema = this.jsonSchemas[this.componentName];
39
- if (!jsonSchema) {
40
- return obj;
41
- }
42
- Object.keys(this.jsonSchemas[this.componentName]).forEach((key) => {
43
- const filteredList = xorWith(props[key], Object.keys(this.jsonSchemas[this.componentName][key].properties));
44
- if (filteredList.length > 0) {
45
- obj[key] = filteredList.map((item) => item.match(/^bind/) ? humps.camelize(item.replace(/^bind/, 'on')) : item);
46
- }
47
- });
48
- return obj;
49
- }
50
- // 转换不存在的属性,便于添加到已有的类型声明中
51
- convertProps(props) {
52
- const array = [...new Set(flattenDeep(toArray(props)))];
53
- const reverseProps = {};
54
- array.forEach((prop) => {
55
- reverseProps[prop] = Object.keys(props).filter((key) => props[key].includes(prop));
56
- });
57
- return reverseProps;
58
- }
59
- updateComment(ast) {
60
- const componentName = this.componentName;
61
- const jsonSchemas = this.jsonSchemas[this.componentName];
62
- const existProps = {};
63
- traverse(ast, {
64
- TSInterfaceDeclaration(astPath) {
65
- if (astPath.node.id.name !== `${componentName}Props`) {
66
- return;
67
- }
68
- astPath.traverse({
69
- TSPropertySignature(astPath) {
70
- var _a, _b, _c, _d;
71
- const { name } = astPath.node.key;
72
- if (!name) {
73
- return;
74
- }
75
- const supportedPlatforms = [];
76
- const covertedName = name.match(/^on/)
77
- ? name.replace(/^on/, 'bind')
78
- : humps.decamelize(name, { separator: '-' });
79
- MINI_APP_TYPES.forEach((type) => {
80
- var _a, _b, _c, _d;
81
- if ((_a = jsonSchemas[type]) === null || _a === void 0 ? void 0 : _a.properties[name]) {
82
- if (isEmpty(existProps[type])) {
83
- existProps[type] = [name];
84
- }
85
- (_b = existProps[type]) === null || _b === void 0 ? void 0 : _b.push(name);
86
- supportedPlatforms.push(type);
87
- }
88
- if (name !== covertedName && ((_c = jsonSchemas[type]) === null || _c === void 0 ? void 0 : _c.properties[covertedName])) {
89
- if (isEmpty(existProps[type])) {
90
- existProps[type] = [covertedName];
91
- }
92
- (_d = existProps[type]) === null || _d === void 0 ? void 0 : _d.push(covertedName);
93
- supportedPlatforms.push(type);
94
- }
95
- });
96
- if (isEmpty(astPath.node.leadingComments) || !((_b = (_a = astPath.node.leadingComments) === null || _a === void 0 ? void 0 : _a[0]) === null || _b === void 0 ? void 0 : _b.value)) {
97
- return;
98
- }
99
- const value = (_d = (_c = astPath.node.leadingComments) === null || _c === void 0 ? void 0 : _c[0]) === null || _d === void 0 ? void 0 : _d.value;
100
- // 保留原有 h5 类型
101
- if (value.toLowerCase().indexOf('h5') > -1) {
102
- supportedPlatforms.push('h5');
103
- }
104
- // 保留原有 rn 类型
105
- if (value.toLowerCase().indexOf('rn') > -1) {
106
- supportedPlatforms.push('rn');
107
- }
108
- if (isEmpty(supportedPlatforms)) {
109
- astPath.remove();
110
- }
111
- else {
112
- astPath.node.leadingComments[0].value = value.replace(/@supported .*?\n/, `@supported ${supportedPlatforms.join(', ')}\n`);
113
- if (value.match(/@deprecated/)) {
114
- astPath.node.leadingComments[0].value = value.replace(/\* @deprecated.*?\n/, '');
115
- }
116
- }
117
- },
118
- });
119
- },
120
- });
121
- return {
122
- existProps,
123
- ast,
124
- };
125
- }
126
- // 添加不存在的属性
127
- addProps(ast, props) {
128
- const componentName = this.componentName;
129
- const jsonSchemas = this.jsonSchemas[this.componentName];
130
- traverse(ast, {
131
- TSInterfaceDeclaration(astPath) {
132
- if (astPath.node.id.name !== `${componentName}Props`) {
133
- return;
134
- }
135
- const addedProps = [];
136
- astPath.traverse({
137
- TSInterfaceBody(astPath) {
138
- Object.keys(props).forEach((prop) => {
139
- var _a, _b, _c;
140
- if (OMIT_PROPS.includes(prop)) {
141
- return;
142
- }
143
- const node = t.cloneNode(astPath.node.body[0]);
144
- node.key = t.identifier(humps.camelize(prop, { separator: '-' }));
145
- const platform = props[prop][0];
146
- const json = jsonSchemas[platform];
147
- const propSchema = json.properties[prop] || json.properties[prop.replace(/^on/, 'bind')];
148
- const { type, tsType, enum: enumArray } = propSchema;
149
- let value;
150
- if (type === 'string') {
151
- if (!enumArray) {
152
- value = t.tsTypeReference(t.identifier(type));
153
- }
154
- else {
155
- value = t.tsUnionType(enumArray.map((item) => t.tsLiteralType(t.stringLiteral(item))));
156
- }
157
- }
158
- else if (type instanceof Array) {
159
- value = t.tsTypeReference(t.identifier(type.join('|')));
160
- }
161
- else if (tsType === '() => void') {
162
- value = t.tsTypeReference(t.identifier('CommonEventFunction'));
163
- }
164
- else {
165
- value = t.tsTypeReference(t.identifier('string'));
166
- }
167
- node.typeAnnotation = t.tsTypeAnnotation(value);
168
- node.optional = !((_a = json.required) === null || _a === void 0 ? void 0 : _a[prop]) || !((_b = json.required) === null || _b === void 0 ? void 0 : _b[prop.replace(/^on/, 'bind')]);
169
- if (node.leadingComments) {
170
- let commentValue = `* ${(_c = propSchema.description) === null || _c === void 0 ? void 0 : _c.replace(/\n/g, '\n * ')} \n`;
171
- commentValue += `* @supported ${props[prop].join(', ')}\n`;
172
- const defaultValue = propSchema.defaultValue;
173
- if (defaultValue) {
174
- if (defaultValue instanceof Array) {
175
- commentValue += `* @default ${propSchema.defaultValue.join(',')}\n`;
176
- }
177
- else {
178
- commentValue += `* @default ${propSchema.defaultValue}\n`;
179
- }
180
- }
181
- node.leadingComments[0].value = commentValue;
182
- }
183
- astPath.node.body.push(node);
184
- addedProps.push(prop);
185
- });
186
- },
187
- });
188
- },
189
- });
190
- }
191
- formatJSDoc(ast) {
192
- traverse(ast, {
193
- enter(astPath) {
194
- if (astPath.node.trailingComments) {
195
- astPath.node.trailingComments = [];
196
- }
197
- },
198
- });
199
- }
200
- exec() {
201
- const filePath = path.join(process.cwd(), 'types', `${this.componentName}.d.ts`);
202
- const codeStr = fs.readFileSync(filePath, 'utf8');
203
- const ast = parser.parse(codeStr, {
204
- sourceType: 'module',
205
- strictMode: false,
206
- plugins: ['typescript'],
207
- });
208
- const { existProps } = this.updateComment(ast);
209
- const missingProps = this.getMissingProps(existProps);
210
- const props = this.convertProps(missingProps);
211
- this.addProps(ast, props);
212
- this.formatJSDoc(ast);
213
- const result = generator(ast);
214
- const code = prettify(result.code, { parser: 'typescript', singleQuote: true, semi: false });
215
- fs.writeFileSync(filePath, code);
216
- }
217
- }
218
- const typesFiles = fs.readdirSync(path.join(process.cwd(), 'types'));
219
- typesFiles.forEach((fileName) => {
220
- const componentName = fileName.replace(/\.d\.ts$/, '');
221
- const generateTypes = new GenerateTypes(componentName);
222
- generateTypes.exec();
223
- });
224
- export default GenerateTypes;