@mpxjs/webpack-plugin 2.10.17 → 2.10.18

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 (238) hide show
  1. package/lib/config.js +60 -0
  2. package/lib/file-loader.js +4 -1
  3. package/lib/global.d.ts +231 -0
  4. package/lib/index.js +58 -73
  5. package/lib/init.js +3 -0
  6. package/lib/json-compiler/index.js +13 -4
  7. package/lib/loader.js +4 -0
  8. package/lib/platform/json/wx/index.js +6 -0
  9. package/lib/platform/style/wx/index.js +102 -72
  10. package/lib/platform/template/wx/component-config/ad.js +5 -0
  11. package/lib/platform/template/wx/component-config/button.js +10 -3
  12. package/lib/platform/template/wx/component-config/camera.js +13 -3
  13. package/lib/platform/template/wx/component-config/canvas.js +8 -1
  14. package/lib/platform/template/wx/component-config/cover-image.js +7 -2
  15. package/lib/platform/template/wx/component-config/cover-view.js +3 -1
  16. package/lib/platform/template/wx/component-config/form.js +27 -2
  17. package/lib/platform/template/wx/component-config/image.js +5 -0
  18. package/lib/platform/template/wx/component-config/input.js +10 -0
  19. package/lib/platform/template/wx/component-config/label.js +10 -2
  20. package/lib/platform/template/wx/component-config/map.js +11 -0
  21. package/lib/platform/template/wx/component-config/movable-area.js +4 -1
  22. package/lib/platform/template/wx/component-config/movable-view.js +17 -2
  23. package/lib/platform/template/wx/component-config/navigator.js +26 -0
  24. package/lib/platform/template/wx/component-config/picker-view.js +12 -0
  25. package/lib/platform/template/wx/component-config/picker.js +3 -1
  26. package/lib/platform/template/wx/component-config/progress.js +11 -1
  27. package/lib/platform/template/wx/component-config/rich-text.js +5 -0
  28. package/lib/platform/template/wx/component-config/scroll-view.js +12 -1
  29. package/lib/platform/template/wx/component-config/slider.js +8 -0
  30. package/lib/platform/template/wx/component-config/swiper-item.js +5 -2
  31. package/lib/platform/template/wx/component-config/swiper.js +10 -0
  32. package/lib/platform/template/wx/component-config/text.js +5 -0
  33. package/lib/platform/template/wx/component-config/textarea.js +19 -2
  34. package/lib/platform/template/wx/component-config/unsupported.js +9 -0
  35. package/lib/platform/template/wx/component-config/video.js +10 -0
  36. package/lib/platform/template/wx/index.js +21 -1
  37. package/lib/react/LoadAsyncChunkModule.js +1 -1
  38. package/lib/react/processStyles.js +21 -9
  39. package/lib/react/script-helper.js +2 -2
  40. package/lib/react/style-helper.js +76 -13
  41. package/lib/resolver/AddModePlugin.js +17 -7
  42. package/lib/runtime/components/react/animationHooks/index.ts +75 -0
  43. package/lib/runtime/components/react/animationHooks/useAnimationAPIHooks.ts +197 -0
  44. package/lib/runtime/components/react/animationHooks/useTransitionHooks.ts +301 -0
  45. package/lib/runtime/components/react/animationHooks/utils.ts +197 -0
  46. package/lib/runtime/components/react/context.ts +12 -3
  47. package/lib/runtime/components/react/dist/animationHooks/index.d.ts +15 -0
  48. package/lib/runtime/components/react/dist/animationHooks/index.js +67 -0
  49. package/lib/runtime/components/react/dist/animationHooks/useAnimationAPIHooks.d.ts +3 -0
  50. package/lib/runtime/components/react/dist/animationHooks/useAnimationAPIHooks.js +181 -0
  51. package/lib/runtime/components/react/dist/animationHooks/useTransitionHooks.d.ts +3 -0
  52. package/lib/runtime/components/react/dist/animationHooks/useTransitionHooks.js +279 -0
  53. package/lib/runtime/components/react/dist/animationHooks/utils.d.ts +109 -0
  54. package/lib/runtime/components/react/dist/animationHooks/utils.js +151 -0
  55. package/lib/runtime/components/react/dist/context.d.ts +10 -3
  56. package/lib/runtime/components/react/dist/context.js +1 -2
  57. package/lib/runtime/components/react/dist/event.config.d.ts +0 -1
  58. package/lib/runtime/components/react/dist/getInnerListeners.d.ts +0 -1
  59. package/lib/runtime/components/react/dist/mpx-async-suspense.d.ts +0 -1
  60. package/lib/runtime/components/react/dist/mpx-async-suspense.jsx +3 -1
  61. package/lib/runtime/components/react/dist/mpx-button.d.ts +0 -1
  62. package/lib/runtime/components/react/dist/mpx-canvas/Bus.d.ts +0 -1
  63. package/lib/runtime/components/react/dist/mpx-canvas/CanvasGradient.d.ts +0 -1
  64. package/lib/runtime/components/react/dist/mpx-canvas/CanvasRenderingContext2D.d.ts +0 -1
  65. package/lib/runtime/components/react/dist/mpx-canvas/Image.d.ts +0 -1
  66. package/lib/runtime/components/react/dist/mpx-canvas/ImageData.d.ts +0 -1
  67. package/lib/runtime/components/react/dist/mpx-canvas/constructorsRegistry.d.ts +0 -1
  68. package/lib/runtime/components/react/dist/mpx-canvas/html.d.ts +0 -1
  69. package/lib/runtime/components/react/dist/mpx-canvas/index.d.ts +0 -1
  70. package/lib/runtime/components/react/dist/mpx-canvas/utils.d.ts +0 -1
  71. package/lib/runtime/components/react/dist/mpx-checkbox-group.d.ts +0 -1
  72. package/lib/runtime/components/react/dist/mpx-checkbox.d.ts +0 -1
  73. package/lib/runtime/components/react/dist/mpx-form.d.ts +0 -1
  74. package/lib/runtime/components/react/dist/mpx-icon/index.d.ts +0 -1
  75. package/lib/runtime/components/react/dist/mpx-image.d.ts +0 -1
  76. package/lib/runtime/components/react/dist/mpx-image.jsx +2 -2
  77. package/lib/runtime/components/react/dist/mpx-inline-text.d.ts +0 -1
  78. package/lib/runtime/components/react/dist/mpx-input.d.ts +2 -1
  79. package/lib/runtime/components/react/dist/mpx-input.jsx +66 -50
  80. package/lib/runtime/components/react/dist/mpx-keyboard-avoiding-view.d.ts +0 -1
  81. package/lib/runtime/components/react/dist/mpx-keyboard-avoiding-view.jsx +35 -6
  82. package/lib/runtime/components/react/dist/mpx-label.d.ts +0 -1
  83. package/lib/runtime/components/react/dist/mpx-movable-area.d.ts +0 -1
  84. package/lib/runtime/components/react/dist/mpx-movable-view.d.ts +0 -1
  85. package/lib/runtime/components/react/dist/mpx-nav.d.ts +0 -1
  86. package/lib/runtime/components/react/dist/mpx-navigator.d.ts +0 -1
  87. package/lib/runtime/components/react/dist/mpx-picker/date.d.ts +0 -1
  88. package/lib/runtime/components/react/dist/mpx-picker/dateData.d.ts +0 -1
  89. package/lib/runtime/components/react/dist/mpx-picker/index.d.ts +0 -1
  90. package/lib/runtime/components/react/dist/mpx-picker/multiSelector.d.ts +0 -1
  91. package/lib/runtime/components/react/dist/mpx-picker/region.d.ts +0 -1
  92. package/lib/runtime/components/react/dist/mpx-picker/regionData.d.ts +0 -1
  93. package/lib/runtime/components/react/dist/mpx-picker/selector.d.ts +0 -1
  94. package/lib/runtime/components/react/dist/mpx-picker/time.d.ts +0 -1
  95. package/lib/runtime/components/react/dist/mpx-picker/type.d.ts +0 -1
  96. package/lib/runtime/components/react/dist/mpx-picker-view/index.d.ts +0 -1
  97. package/lib/runtime/components/react/dist/mpx-picker-view/pickerVIewContext.d.ts +0 -1
  98. package/lib/runtime/components/react/dist/mpx-picker-view-column/index.d.ts +0 -1
  99. package/lib/runtime/components/react/dist/mpx-picker-view-column/pickerViewColumnItem.d.ts +0 -1
  100. package/lib/runtime/components/react/dist/mpx-picker-view-column/pickerViewColumnItemLite.d.ts +0 -1
  101. package/lib/runtime/components/react/dist/mpx-picker-view-column/pickerViewFaces.d.ts +0 -1
  102. package/lib/runtime/components/react/dist/mpx-picker-view-column/pickerViewIndicator.d.ts +0 -1
  103. package/lib/runtime/components/react/dist/mpx-picker-view-column/pickerViewMask.d.ts +0 -1
  104. package/lib/runtime/components/react/dist/mpx-popup/index.d.ts +0 -1
  105. package/lib/runtime/components/react/dist/mpx-popup/popupBase.d.ts +0 -1
  106. package/lib/runtime/components/react/dist/mpx-portal/index.d.ts +0 -1
  107. package/lib/runtime/components/react/dist/mpx-portal/portal-host.d.ts +0 -1
  108. package/lib/runtime/components/react/dist/mpx-portal/portal-manager.d.ts +0 -1
  109. package/lib/runtime/components/react/dist/mpx-portal/portal-manager.jsx +2 -2
  110. package/lib/runtime/components/react/dist/mpx-progress.d.ts +0 -1
  111. package/lib/runtime/components/react/dist/mpx-radio-group.d.ts +0 -1
  112. package/lib/runtime/components/react/dist/mpx-radio.d.ts +0 -1
  113. package/lib/runtime/components/react/dist/mpx-rich-text/html.d.ts +0 -1
  114. package/lib/runtime/components/react/dist/mpx-rich-text/index.d.ts +0 -1
  115. package/lib/runtime/components/react/dist/mpx-root-portal.d.ts +0 -1
  116. package/lib/runtime/components/react/dist/mpx-scroll-view.d.ts +0 -1
  117. package/lib/runtime/components/react/dist/mpx-scroll-view.jsx +84 -78
  118. package/lib/runtime/components/react/dist/mpx-simple-text.d.ts +0 -1
  119. package/lib/runtime/components/react/dist/mpx-simple-view.d.ts +0 -1
  120. package/lib/runtime/components/react/dist/mpx-slider.d.ts +0 -1
  121. package/lib/runtime/components/react/dist/mpx-sticky-header.d.ts +0 -1
  122. package/lib/runtime/components/react/dist/mpx-sticky-header.jsx +20 -20
  123. package/lib/runtime/components/react/dist/mpx-sticky-section.d.ts +0 -1
  124. package/lib/runtime/components/react/dist/mpx-swiper-item.d.ts +0 -1
  125. package/lib/runtime/components/react/dist/mpx-swiper.d.ts +10 -1
  126. package/lib/runtime/components/react/dist/mpx-swiper.jsx +95 -61
  127. package/lib/runtime/components/react/dist/mpx-switch.d.ts +0 -1
  128. package/lib/runtime/components/react/dist/mpx-text.d.ts +0 -1
  129. package/lib/runtime/components/react/dist/mpx-textarea.d.ts +0 -1
  130. package/lib/runtime/components/react/dist/mpx-textarea.jsx +1 -0
  131. package/lib/runtime/components/react/dist/mpx-video.d.ts +0 -1
  132. package/lib/runtime/components/react/dist/mpx-view.d.ts +3 -3
  133. package/lib/runtime/components/react/dist/mpx-view.jsx +22 -8
  134. package/lib/runtime/components/react/dist/mpx-web-view.d.ts +0 -1
  135. package/lib/runtime/components/react/dist/parser.d.ts +0 -1
  136. package/lib/runtime/components/react/dist/useNodesRef.d.ts +0 -1
  137. package/lib/runtime/components/react/dist/utils.d.ts +10 -9
  138. package/lib/runtime/components/react/dist/utils.jsx +47 -24
  139. package/lib/runtime/components/react/mpx-async-suspense.tsx +3 -1
  140. package/lib/runtime/components/react/mpx-image.tsx +2 -2
  141. package/lib/runtime/components/react/mpx-input.tsx +77 -54
  142. package/lib/runtime/components/react/mpx-keyboard-avoiding-view.tsx +35 -6
  143. package/lib/runtime/components/react/mpx-portal/portal-manager.tsx +2 -2
  144. package/lib/runtime/components/react/mpx-scroll-view.tsx +110 -114
  145. package/lib/runtime/components/react/mpx-sticky-header.tsx +24 -24
  146. package/lib/runtime/components/react/mpx-swiper.tsx +115 -60
  147. package/lib/runtime/components/react/mpx-textarea.tsx +1 -0
  148. package/lib/runtime/components/react/mpx-view.tsx +27 -12
  149. package/lib/runtime/components/react/tsconfig.json +26 -0
  150. package/lib/runtime/components/react/types/global.d.ts +1 -0
  151. package/lib/runtime/components/react/utils.tsx +51 -27
  152. package/lib/runtime/optionProcessor.js +5 -0
  153. package/lib/runtime/optionProcessorReact.js +7 -0
  154. package/lib/runtime/stringify.wxs +2 -2
  155. package/lib/script-setup-compiler/index.js +1 -2
  156. package/lib/style-compiler/strip-conditional.js +243 -0
  157. package/lib/template-compiler/compiler.js +2 -5
  158. package/lib/utils/string.js +25 -1
  159. package/lib/wxss/loader.js +4 -1
  160. package/lib/wxss/utils.js +7 -2
  161. package/package.json +7 -14
  162. package/lib/runtime/components/react/dist/context.d.ts.map +0 -1
  163. package/lib/runtime/components/react/dist/event.config.d.ts.map +0 -1
  164. package/lib/runtime/components/react/dist/getInnerListeners.d.ts.map +0 -1
  165. package/lib/runtime/components/react/dist/mpx-async-suspense.d.ts.map +0 -1
  166. package/lib/runtime/components/react/dist/mpx-button.d.ts.map +0 -1
  167. package/lib/runtime/components/react/dist/mpx-canvas/Bus.d.ts.map +0 -1
  168. package/lib/runtime/components/react/dist/mpx-canvas/CanvasGradient.d.ts.map +0 -1
  169. package/lib/runtime/components/react/dist/mpx-canvas/CanvasRenderingContext2D.d.ts.map +0 -1
  170. package/lib/runtime/components/react/dist/mpx-canvas/Image.d.ts.map +0 -1
  171. package/lib/runtime/components/react/dist/mpx-canvas/ImageData.d.ts.map +0 -1
  172. package/lib/runtime/components/react/dist/mpx-canvas/constructorsRegistry.d.ts.map +0 -1
  173. package/lib/runtime/components/react/dist/mpx-canvas/html.d.ts.map +0 -1
  174. package/lib/runtime/components/react/dist/mpx-canvas/index.d.ts.map +0 -1
  175. package/lib/runtime/components/react/dist/mpx-canvas/utils.d.ts.map +0 -1
  176. package/lib/runtime/components/react/dist/mpx-checkbox-group.d.ts.map +0 -1
  177. package/lib/runtime/components/react/dist/mpx-checkbox.d.ts.map +0 -1
  178. package/lib/runtime/components/react/dist/mpx-form.d.ts.map +0 -1
  179. package/lib/runtime/components/react/dist/mpx-icon/index.d.ts.map +0 -1
  180. package/lib/runtime/components/react/dist/mpx-image.d.ts.map +0 -1
  181. package/lib/runtime/components/react/dist/mpx-inline-text.d.ts.map +0 -1
  182. package/lib/runtime/components/react/dist/mpx-input.d.ts.map +0 -1
  183. package/lib/runtime/components/react/dist/mpx-keyboard-avoiding-view.d.ts.map +0 -1
  184. package/lib/runtime/components/react/dist/mpx-label.d.ts.map +0 -1
  185. package/lib/runtime/components/react/dist/mpx-movable-area.d.ts.map +0 -1
  186. package/lib/runtime/components/react/dist/mpx-movable-view.d.ts.map +0 -1
  187. package/lib/runtime/components/react/dist/mpx-nav.d.ts.map +0 -1
  188. package/lib/runtime/components/react/dist/mpx-navigator.d.ts.map +0 -1
  189. package/lib/runtime/components/react/dist/mpx-picker/date.d.ts.map +0 -1
  190. package/lib/runtime/components/react/dist/mpx-picker/dateData.d.ts.map +0 -1
  191. package/lib/runtime/components/react/dist/mpx-picker/index.d.ts.map +0 -1
  192. package/lib/runtime/components/react/dist/mpx-picker/multiSelector.d.ts.map +0 -1
  193. package/lib/runtime/components/react/dist/mpx-picker/region.d.ts.map +0 -1
  194. package/lib/runtime/components/react/dist/mpx-picker/regionData.d.ts.map +0 -1
  195. package/lib/runtime/components/react/dist/mpx-picker/selector.d.ts.map +0 -1
  196. package/lib/runtime/components/react/dist/mpx-picker/time.d.ts.map +0 -1
  197. package/lib/runtime/components/react/dist/mpx-picker/type.d.ts.map +0 -1
  198. package/lib/runtime/components/react/dist/mpx-picker-view/index.d.ts.map +0 -1
  199. package/lib/runtime/components/react/dist/mpx-picker-view/pickerVIewContext.d.ts.map +0 -1
  200. package/lib/runtime/components/react/dist/mpx-picker-view-column/index.d.ts.map +0 -1
  201. package/lib/runtime/components/react/dist/mpx-picker-view-column/pickerViewColumnItem.d.ts.map +0 -1
  202. package/lib/runtime/components/react/dist/mpx-picker-view-column/pickerViewColumnItemLite.d.ts.map +0 -1
  203. package/lib/runtime/components/react/dist/mpx-picker-view-column/pickerViewFaces.d.ts.map +0 -1
  204. package/lib/runtime/components/react/dist/mpx-picker-view-column/pickerViewIndicator.d.ts.map +0 -1
  205. package/lib/runtime/components/react/dist/mpx-picker-view-column/pickerViewMask.d.ts.map +0 -1
  206. package/lib/runtime/components/react/dist/mpx-popup/index.d.ts.map +0 -1
  207. package/lib/runtime/components/react/dist/mpx-popup/popupBase.d.ts.map +0 -1
  208. package/lib/runtime/components/react/dist/mpx-portal/index.d.ts.map +0 -1
  209. package/lib/runtime/components/react/dist/mpx-portal/portal-host.d.ts.map +0 -1
  210. package/lib/runtime/components/react/dist/mpx-portal/portal-manager.d.ts.map +0 -1
  211. package/lib/runtime/components/react/dist/mpx-progress.d.ts.map +0 -1
  212. package/lib/runtime/components/react/dist/mpx-radio-group.d.ts.map +0 -1
  213. package/lib/runtime/components/react/dist/mpx-radio.d.ts.map +0 -1
  214. package/lib/runtime/components/react/dist/mpx-rich-text/html.d.ts.map +0 -1
  215. package/lib/runtime/components/react/dist/mpx-rich-text/index.d.ts.map +0 -1
  216. package/lib/runtime/components/react/dist/mpx-root-portal.d.ts.map +0 -1
  217. package/lib/runtime/components/react/dist/mpx-scroll-view.d.ts.map +0 -1
  218. package/lib/runtime/components/react/dist/mpx-simple-text.d.ts.map +0 -1
  219. package/lib/runtime/components/react/dist/mpx-simple-view.d.ts.map +0 -1
  220. package/lib/runtime/components/react/dist/mpx-slider.d.ts.map +0 -1
  221. package/lib/runtime/components/react/dist/mpx-sticky-header.d.ts.map +0 -1
  222. package/lib/runtime/components/react/dist/mpx-sticky-section.d.ts.map +0 -1
  223. package/lib/runtime/components/react/dist/mpx-swiper-item.d.ts.map +0 -1
  224. package/lib/runtime/components/react/dist/mpx-swiper.d.ts.map +0 -1
  225. package/lib/runtime/components/react/dist/mpx-switch.d.ts.map +0 -1
  226. package/lib/runtime/components/react/dist/mpx-text.d.ts.map +0 -1
  227. package/lib/runtime/components/react/dist/mpx-textarea.d.ts.map +0 -1
  228. package/lib/runtime/components/react/dist/mpx-video.d.ts.map +0 -1
  229. package/lib/runtime/components/react/dist/mpx-view.d.ts.map +0 -1
  230. package/lib/runtime/components/react/dist/mpx-web-view.d.ts.map +0 -1
  231. package/lib/runtime/components/react/dist/parser.d.ts.map +0 -1
  232. package/lib/runtime/components/react/dist/useAnimationHooks.d.ts +0 -33
  233. package/lib/runtime/components/react/dist/useAnimationHooks.d.ts.map +0 -1
  234. package/lib/runtime/components/react/dist/useAnimationHooks.js +0 -289
  235. package/lib/runtime/components/react/dist/useNodesRef.d.ts.map +0 -1
  236. package/lib/runtime/components/react/dist/utils.d.ts.map +0 -1
  237. package/lib/runtime/components/react/useAnimationHooks.ts +0 -320
  238. package/lib/style-compiler/strip-conditional-loader.js +0 -289
@@ -1,8 +1,9 @@
1
1
  const { hump2dash } = require('../../../utils/hump-dash')
2
+ const { parseValues } = require('../../../utils/string')
2
3
 
3
- module.exports = function getSpec ({ warn, error }) {
4
+ module.exports = function getSpec({ warn, error }) {
4
5
  // React Native 双端都不支持的 CSS property
5
- const unsupportedPropExp = /^(white-space|text-overflow|animation|transition|font-variant-caps|font-variant-numeric|font-variant-east-asian|font-variant-alternates|font-variant-ligatures|background-position|caret-color)$/
6
+ const unsupportedPropExp = /^(white-space|text-overflow|animation|font-variant-caps|font-variant-numeric|font-variant-east-asian|font-variant-alternates|font-variant-ligatures|background-position|caret-color)$/
6
7
  const unsupportedPropMode = {
7
8
  // React Native ios 不支持的 CSS property
8
9
  ios: /^(vertical-align)$/,
@@ -32,13 +33,14 @@ module.exports = function getSpec ({ warn, error }) {
32
33
  }
33
34
  // 值类型
34
35
  const ValueType = {
35
- number: 'number',
36
+ integer: 'integer',
37
+ length: 'length',
36
38
  color: 'color',
37
39
  enum: 'enum'
38
40
  }
39
41
  // React 属性支持的枚举值
40
42
  const SUPPORTED_PROP_VAL_ARR = {
41
- 'box-sizing': ['border-box'],
43
+ 'box-sizing': ['border-box', 'content-box'],
42
44
  'backface-visibility': ['visible', 'hidden'],
43
45
  overflow: ['visible', 'hidden', 'scroll'],
44
46
  'border-style': ['solid', 'dotted', 'dashed'],
@@ -62,100 +64,126 @@ module.exports = function getSpec ({ warn, error }) {
62
64
  'align-items': ['flex-start', 'flex-end', 'center', 'stretch', 'baseline'],
63
65
  'align-self': ['auto', 'flex-start', 'flex-end', 'center', 'stretch', 'baseline'],
64
66
  'justify-content': ['flex-start', 'flex-end', 'center', 'space-between', 'space-around', 'space-evenly'],
65
- 'background-size': ['contain', 'cover', 'auto', ValueType.number],
66
- 'background-position': ['left', 'right', 'top', 'bottom', 'center', ValueType.number],
67
+ 'background-size': ['contain', 'cover', 'auto', ValueType.length],
68
+ 'background-position': ['left', 'right', 'top', 'bottom', 'center', ValueType.length],
67
69
  'background-repeat': ['no-repeat'],
68
- width: ['auto', ValueType.number],
69
- height: ['auto', ValueType.number],
70
- 'flex-basis': ['auto', ValueType.number],
71
- margin: ['auto', ValueType.number],
72
- 'margin-top': ['auto', ValueType.number],
73
- 'margin-left': ['auto', ValueType.number],
74
- 'margin-bottom': ['auto', ValueType.number],
75
- 'margin-right': ['auto', ValueType.number],
76
- 'margin-horizontal': ['auto', ValueType.number],
77
- 'margin-vertical': ['auto', ValueType.number]
70
+ width: ['auto', ValueType.length],
71
+ height: ['auto', ValueType.length],
72
+ 'flex-basis': ['auto', ValueType.length],
73
+ margin: ['auto', ValueType.length],
74
+ 'margin-top': ['auto', ValueType.length],
75
+ 'margin-left': ['auto', ValueType.length],
76
+ 'margin-bottom': ['auto', ValueType.length],
77
+ 'margin-right': ['auto', ValueType.length],
78
+ 'margin-horizontal': ['auto', ValueType.length],
79
+ 'margin-vertical': ['auto', ValueType.length]
78
80
  }
79
81
  // 获取值类型
80
82
  const getValueType = (prop) => {
81
83
  const propValueTypeRules = [
82
84
  // 重要!!优先判断是不是枚举类型
83
85
  [ValueType.enum, new RegExp('^(' + Object.keys(SUPPORTED_PROP_VAL_ARR).join('|') + ')$')],
84
- [ValueType.number, /^((opacity|flex-grow|flex-shrink|gap|left|right|top|bottom)|(.+-(width|height|left|right|top|bottom|radius|spacing|size|gap|index|offset|opacity)))$/],
86
+ [ValueType.length, /^((gap|left|right|top|bottom)|(.+-(width|height|left|right|top|bottom|radius|spacing|size|gap|offset)))$/],
87
+ [ValueType.integer, /^((opacity|flex-grow|flex-shrink|z-index)|(.+-(index|opacity)))$/],
85
88
  [ValueType.color, /^(color|(.+-color))$/]
86
89
  ]
87
90
  for (const rule of propValueTypeRules) {
88
91
  if (rule[1].test(prop)) return rule[0]
89
92
  }
90
93
  }
91
- // 多value解析
92
- const parseValues = (str, char = ' ') => {
93
- let stack = 0
94
- let temp = ''
95
- const result = []
96
- for (let i = 0; i < str.length; i++) {
97
- if (str[i] === '(') {
98
- stack++
99
- } else if (str[i] === ')') {
100
- stack--
101
- }
102
- // 非括号内 或者 非分隔字符且非空
103
- if (stack !== 0 || (str[i] !== char && str[i] !== ' ')) {
104
- temp += str[i]
105
- }
106
- if ((stack === 0 && str[i] === char) || i === str.length - 1) {
107
- result.push(temp)
108
- temp = ''
109
- }
110
- }
111
- return result
94
+
95
+ // CSS 变量中提取 fallback 值进行验证
96
+ // 返回值:fallback | null(没有 fallback)| undefined(循环引用)
97
+ const getDefaultValueFromVar = (str, visited = new Set()) => {
98
+ const totalVarExp = /^var\((.+)\)$/
99
+ if (!totalVarExp.test(str)) return str
100
+
101
+ // 防止循环引用 - 返回 undefined 表示检测到循环
102
+ if (visited.has(str)) return undefined
103
+ visited.add(str)
104
+
105
+ const newVal = parseValues((str.match(totalVarExp)?.[1] || ''), ',')
106
+ if (newVal.length <= 1) return null // 没有 fallback
107
+ // fallback 可能本身包含逗号(如多 font-family 兜底、渐变等),这里取第2段及之后并 join 回去
108
+ const fallback = newVal.slice(1).join(',').trim()
109
+ // 如果 fallback 也是 var(),递归提取
110
+ if (totalVarExp.test(fallback)) return getDefaultValueFromVar(fallback, visited)
111
+ return fallback
112
112
  }
113
- // const getDefaultValueFromVar = (str) => {
114
- // const totalVarExp = /^var\((.+)\)$/
115
- // if (!totalVarExp.test(str)) return str
116
- // const newVal = parseValues((str.match(totalVarExp)?.[1] || ''), ',')
117
- // if (newVal.length <= 1) return ''
118
- // if (!totalVarExp.test(newVal[1])) return newVal[1]
119
- // return getDefaultValueFromVar(newVal[1])
120
- // }
113
+
121
114
  // 属性值校验
115
+ // 返回值:
116
+ // - 通过:返回 true
117
+ // - 失败:返回 false
122
118
  const verifyValues = ({ prop, value, selector }, isError = true) => {
123
119
  prop = prop.trim()
124
- value = value.trim()
120
+ const rawValue = value.trim()
125
121
  const tips = isError ? error : warn
126
- if (cssVariableExp.test(value) || calcExp.test(value) || envExp.test(value)) return true
122
+
123
+ // CSS 自定义属性(--xxx)是变量定义,不属于 RN 样式属性:
124
+ // 不能按 `-height/-color` 等后缀推断类型去校验,否则会把变量定义错误过滤,导致运行时 var() 取值失败
125
+ if (/^--/.test(prop)) return true
126
+
127
+ // 校验阶段允许使用 fallback 作为最坏情况(避免 RN crash),但输出必须保留 rawValue
128
+ let valueForVerify = rawValue
129
+
130
+ if (cssVariableExp.test(valueForVerify)) {
131
+ const fallback = getDefaultValueFromVar(valueForVerify)
132
+ // undefined 表示检测到循环引用
133
+ if (fallback === undefined) {
134
+ tips(`CSS variable circular reference in fallback chain detected in ${selector} for property ${prop}, value: ${rawValue}`)
135
+ return false
136
+ }
137
+ // null 表示没有 fallback,CSS 变量本身是合法的(运行时会解析)
138
+ if (fallback === null) {
139
+ return true
140
+ }
141
+ // 有 fallback 值:使用 fallback 继续做值校验
142
+ valueForVerify = fallback.trim()
143
+ }
144
+
145
+ // calc() / env() 跳过值校验,但保留 rawValue 输出
146
+ if (calcExp.test(valueForVerify) || envExp.test(valueForVerify)) return true
127
147
  const namedColor = ['transparent', 'aliceblue', 'antiquewhite', 'aqua', 'aquamarine', 'azure', 'beige', 'bisque', 'black', 'blanchedalmond', 'blue', 'blueviolet', 'brown', 'burlywood', 'cadetblue', 'chartreuse', 'chocolate', 'coral', 'cornflowerblue', 'cornsilk', 'crimson', 'cyan', 'darkblue', 'darkcyan', 'darkgoldenrod', 'darkgray', 'darkgreen', 'darkgrey', 'darkkhaki', 'darkmagenta', 'darkolivegreen', 'darkorange', 'darkorchid', 'darkred', 'darksalmon', 'darkseagreen', 'darkslateblue', 'darkslategrey', 'darkturquoise', 'darkviolet', 'deeppink', 'deepskyblue', 'dimgray', 'dimgrey', 'dodgerblue', 'firebrick', 'floralwhite', 'forestgreen', 'fuchsia', 'gainsboro', 'ghostwhite', 'gold', 'goldenrod', 'gray', 'green', 'greenyellow', 'grey', 'honeydew', 'hotpink', 'indianred', 'indigo', 'ivory', 'khaki', 'lavender', 'lavenderblush', 'lawngreen', 'lemonchiffon', 'lightblue', 'lightcoral', 'lightcyan', 'lightgoldenrodyellow', 'lightgray', 'lightgreen', 'lightgrey', 'lightpink', 'lightsalmon', 'lightseagreen', 'lightskyblue', 'lightslategrey', 'lightsteelblue', 'lightyellow', 'lime', 'limegreen', 'linen', 'magenta', 'maroon', 'mediumaquamarine', 'mediumblue', 'mediumorchid', 'mediumpurple', 'mediumseagreen', 'mediumslateblue', 'mediumspringgreen', 'mediumturquoise', 'mediumvioletred', 'midnightblue', 'mintcream', 'mistyrose', 'moccasin', 'navajowhite', 'navy', 'oldlace', 'olive', 'olivedrab', 'orange', 'orangered', 'orchid', 'palegoldenrod', 'palegreen', 'paleturquoise', 'palevioletred', 'papayawhip', 'peachpuff', 'peru', 'pink', 'plum', 'powderblue', 'purple', 'rebeccapurple', 'red', 'rosybrown', 'royalblue', 'saddlebrown', 'salmon', 'sandybrown', 'seagreen', 'seashell', 'sienna', 'silver', 'skyblue', 'slateblue', 'slategray', 'snow', 'springgreen', 'steelblue', 'tan', 'teal', 'thistle', 'tomato', 'turquoise', 'violet', 'wheat', 'white', 'whitesmoke', 'yellow', 'yellowgreen']
128
148
  const valueExp = {
129
- number: /^((-?(\d+(\.\d+)?|\.\d+))(rpx|px|%|vw|vh)?|hairlineWidth)$/,
149
+ integer: /^(-?(\d+(\.\d+)?|\.\d+))$/,
150
+ length: /^((-?(\d+(\.\d+)?|\.\d+))(rpx|px|%|vw|vh)?|hairlineWidth)$/,
130
151
  color: new RegExp(('^(' + namedColor.join('|') + ')$') + '|(^#([0-9a-fA-f]{3}|[0-9a-fA-f]{6})$)|^(rgb|rgba|hsl|hsla|hwb)\\(.+\\)$')
131
152
  }
132
153
  const type = getValueType(prop)
133
154
  const tipsType = (type) => {
134
155
  const info = {
135
- [ValueType.number]: '2rpx,10%,30rpx',
156
+ [ValueType.length]: '2rpx,10%,30rpx',
136
157
  [ValueType.color]: 'rgb,rgba,hsl,hsla,hwb,named color,#000000',
137
158
  [ValueType.enum]: `${SUPPORTED_PROP_VAL_ARR[prop]?.join(',')}`
138
159
  }
139
- tips(`Value of ${prop} in ${selector} should be ${type}, eg ${info[type]}, received [${value}], please check again!`)
160
+ tips(`Value of ${prop} in ${selector} should be ${type}${info[type] ? `, eg ${info[type]}` : ''}, received [${rawValue}], please check again!`)
140
161
  }
141
162
  switch (type) {
142
- case ValueType.number: {
143
- if (!valueExp.number.test(value)) {
163
+ case ValueType.length: {
164
+ if (!valueExp.length.test(valueForVerify)) {
165
+ tipsType(type)
166
+ return false
167
+ }
168
+ return true
169
+ }
170
+ case ValueType.integer: {
171
+ if (!valueExp.integer.test(valueForVerify)) {
144
172
  tipsType(type)
145
173
  return false
146
174
  }
147
175
  return true
148
176
  }
149
177
  case ValueType.color: {
150
- if (!valueExp.color.test(value)) {
178
+ if (!valueExp.color.test(valueForVerify)) {
151
179
  tipsType(type)
152
180
  return false
153
181
  }
154
182
  return true
155
183
  }
156
184
  case ValueType.enum: {
157
- const isIn = SUPPORTED_PROP_VAL_ARR[prop].includes(value)
158
- const isType = Object.keys(valueExp).some(item => valueExp[item].test(value) && SUPPORTED_PROP_VAL_ARR[prop].includes(ValueType[item]))
185
+ const isIn = SUPPORTED_PROP_VAL_ARR[prop].includes(valueForVerify)
186
+ const isType = Object.keys(valueExp).some(item => valueExp[item].test(valueForVerify) && SUPPORTED_PROP_VAL_ARR[prop].includes(ValueType[item]))
159
187
  if (!isIn && !isType) {
160
188
  tipsType(type)
161
189
  return false
@@ -393,6 +421,8 @@ module.exports = function getSpec ({ warn, error }) {
393
421
  // css var & 数组直接返回
394
422
  if (Array.isArray(value) || cssVariableExp.test(value)) return { prop, value }
395
423
  const values = parseValues(value)
424
+ // Todo transform 排序不一致时,transform动画会闪烁,故这里同样的排序输出 transform
425
+ values.sort()
396
426
  const transform = []
397
427
  values.forEach(item => {
398
428
  const match = item.match(/([/\w]+)\((.+)\)/)
@@ -424,23 +454,23 @@ module.exports = function getSpec ({ warn, error }) {
424
454
  case 'skew':
425
455
  case 'translate3d': // x y 支持 z不支持
426
456
  case 'scale3d': // x y 支持 z不支持
427
- {
428
- // 2 个以上的值处理
429
- key = key.replace('3d', '')
430
- const vals = parseValues(val, ',').splice(0, 3)
431
- // scale(.5) === scaleX(.5) scaleY(.5)
432
- if (vals.length === 1 && key === 'scale') {
433
- vals.push(vals[0])
434
- }
435
- const xyz = ['X', 'Y', 'Z']
436
- transform.push(...vals.map((v, index) => {
437
- if (key !== 'rotate' && index > 1) {
438
- unsupportedPropError({ prop: `${key}Z`, value, selector }, { mode })
457
+ {
458
+ // 2 个以上的值处理
459
+ key = key.replace('3d', '')
460
+ const vals = parseValues(val, ',').splice(0, 3)
461
+ // scale(.5) === scaleX(.5) scaleY(.5)
462
+ if (vals.length === 1 && key === 'scale') {
463
+ vals.push(vals[0])
439
464
  }
440
- return { [`${key}${xyz[index] || ''}`]: v.trim() }
441
- }))
442
- break
443
- }
465
+ const xyz = ['X', 'Y', 'Z']
466
+ transform.push(...vals.map((v, index) => {
467
+ if (key !== 'rotate' && index > 1) {
468
+ unsupportedPropError({ prop: `${key}Z`, value, selector }, { mode })
469
+ }
470
+ return { [`${key}${xyz[index] || ''}`]: v.trim() }
471
+ }))
472
+ break
473
+ }
444
474
  case 'translateZ':
445
475
  case 'scaleZ':
446
476
  case 'rotate3d': // x y z angle
@@ -8,6 +8,7 @@ module.exports = function ({ print }) {
8
8
  const qqValueWarningLog = print({ platform: 'qq', type: 'value', tag: TAG_NAME, isError: false })
9
9
  const qqPropLog = print({ platform: 'qq', tag: TAG_NAME, isError: false })
10
10
  const qqEventLog = print({ platform: 'qq', tag: TAG_NAME, isError: false, type: 'event' })
11
+ const ksPropLog = print({ platform: 'ks', tag: TAG_NAME, isError: false })
11
12
  return {
12
13
  test: TAG_NAME,
13
14
  props: [
@@ -43,6 +44,10 @@ module.exports = function ({ print }) {
43
44
  test: /^(ad-intervals|ad-theme)$/,
44
45
  qq: qqPropLog,
45
46
  swan: baiduPropLog
47
+ },
48
+ {
49
+ test: /^(ad-intervals|ad-type|ad-params)$/,
50
+ ks: ksPropLog
46
51
  }
47
52
  ],
48
53
  event: [
@@ -29,6 +29,8 @@ module.exports = function ({ print }) {
29
29
  const webPropLog = print({ platform: 'web', tag: TAG_NAME, isError: false })
30
30
  const webEventLog = print({ platform: 'web', tag: TAG_NAME, isError: false, type: 'event' })
31
31
  const qaPropLog = print({ platform: 'qa', tag: TAG_NAME, isError: false })
32
+ const ksPropLog = print({ platform: 'ks', tag: TAG_NAME, isError: false })
33
+ const ksEventLog = print({ platform: 'ks', tag: TAG_NAME, isError: false, type: 'event' })
32
34
  const wxPropValueLog = print({ platform: 'wx', tag: TAG_NAME, isError: false, type: 'value' })
33
35
  const iosValueLogError = print({ platform: 'ios', tag: TAG_NAME, isError: true, type: 'value' })
34
36
  const iosValueLog = print({ platform: 'ios', tag: TAG_NAME, isError: false, type: 'value' })
@@ -195,10 +197,14 @@ module.exports = function ({ print }) {
195
197
  qa: qaPropLog
196
198
  },
197
199
  {
198
- test: /^(lang|from-type|hover-class|send-message-title|send-message-path|send-message-img|app-parameter|show-message-card|phone-number-no-quota-toast|bindgetuserinfo|bindcontact|createliveactivity|bindgetphonenumber|bindgetrealtimephonenumber|binderror|bindopensetting|bindlaunchapp|bindchooseavatar|bindagreeprivacyauthorization)$/,
200
+ test: /^(lang|from-type|send-message-title|send-message-path|send-message-img|app-parameter|show-message-card|phone-number-no-quota-toast|bindgetuserinfo|bindcontact|createliveactivity|bindgetphonenumber|bindgetrealtimephonenumber|binderror|bindopensetting|bindlaunchapp|bindchooseavatar|bindagreeprivacyauthorization)$/,
199
201
  ios: iosPropLog,
200
202
  android: androidPropLog,
201
203
  harmony: harmonyPropLog
204
+ },
205
+ {
206
+ test: /^(hover-stop-propagation|session-from|send-message-title|send-message-path|send-message-img|app-parameter|show-message-card|app-parameter|phone-number-no-quota-toast|need-show-entrance|entrance-path)$/,
207
+ ks: ksPropLog
202
208
  }
203
209
  ],
204
210
  event: [
@@ -233,10 +239,11 @@ module.exports = function ({ print }) {
233
239
  web: webEventLog
234
240
  },
235
241
  {
236
- test: /^(getuserinfo|contact|getphonenumber|bindgetrealtimephonenumber|error|opensetting|launchapp|chooseavatar|agreeprivacyauthorization)$/,
242
+ test: /^(getuserinfo|contact|getphonenumber|getrealtimephonenumber|error|opensetting|launchapp|chooseavatar|agreeprivacyauthorization)$/,
237
243
  ios: iosEventLog,
238
244
  android: androidEventLog,
239
- harmony: harmonyEventLog
245
+ harmony: harmonyEventLog,
246
+ ks: ksEventLog
240
247
  }
241
248
  ]
242
249
  }
@@ -13,6 +13,9 @@ module.exports = function ({ print }) {
13
13
  const qqEventLog = print({ platform: 'qq', tag: TAG_NAME, isError: false, type: 'event' })
14
14
  const qaPropLog = print({ platform: 'qa', tag: TAG_NAME, isError: false })
15
15
  const qaEventLog = print({ platform: 'qa', tag: TAG_NAME, isError: false, type: 'event' })
16
+ const ksPropLog = print({ platform: 'ks', tag: TAG_NAME, isError: false })
17
+ const ksEventLog = print({ platform: 'ks', tag: TAG_NAME, isError: false, type: 'event' })
18
+
16
19
  return {
17
20
  test: TAG_NAME,
18
21
  props: [
@@ -46,7 +49,8 @@ module.exports = function ({ print }) {
46
49
  },
47
50
  {
48
51
  test: /^(resolution|frame-size)$/,
49
- qq: qqPropLog
52
+ qq: qqPropLog,
53
+ ks: ksPropLog
50
54
  },
51
55
  {
52
56
  test: /^(frame-size|device-position)$/,
@@ -73,11 +77,17 @@ module.exports = function ({ print }) {
73
77
  test: /^(scancode)$/,
74
78
  swan: baiduEventLog,
75
79
  tt: ttEventLog,
76
- qa: qaEventLog
80
+ qa: qaEventLog,
81
+ ks: ksEventLog
77
82
  },
78
83
  {
79
84
  test: /^(initdone)$/,
80
- qq: qqEventLog
85
+ qq: qqEventLog,
86
+ ks: ksEventLog
87
+ },
88
+ {
89
+ test: /^(stop|error)$/,
90
+ ks: ksEventLog
81
91
  }
82
92
  ]
83
93
  }
@@ -6,6 +6,8 @@ module.exports = function ({ print }) {
6
6
  const ttEventLog = print({ platform: 'bytedance', tag: TAG_NAME, isError: false, type: 'event' })
7
7
  const jdPropLog = print({ platform: 'jd', tag: TAG_NAME, isError: false })
8
8
  const qaEventLog = print({ platform: 'qa', tag: TAG_NAME, isError: false, type: 'event' })
9
+ const ksPropLog = print({ platform: 'ks', tag: TAG_NAME, isError: false })
10
+ const ksEventLog = print({ platform: 'ks', tag: TAG_NAME, isError: false, type: 'event' })
9
11
  return {
10
12
  test: TAG_NAME,
11
13
  android (tag, { el }) {
@@ -37,6 +39,10 @@ module.exports = function ({ print }) {
37
39
  {
38
40
  test: 'type',
39
41
  jd: jdPropLog
42
+ },
43
+ {
44
+ test: /^(type|disable-scroll)$/,
45
+ ks: ksPropLog
40
46
  }
41
47
  ],
42
48
  // 组件事件中的差异部分
@@ -63,7 +69,8 @@ module.exports = function ({ print }) {
63
69
  {
64
70
  test: /^(longtap|error)$/,
65
71
  tt: ttEventLog,
66
- qa: qaEventLog
72
+ qa: qaEventLog,
73
+ ks: ksEventLog
67
74
  }
68
75
  ]
69
76
  }
@@ -2,9 +2,12 @@ const TAG_NAME = 'cover-image'
2
2
 
3
3
  module.exports = function ({ print }) {
4
4
  const aliEventLog = print({ platform: 'ali', tag: TAG_NAME, isError: false, type: 'event' })
5
+ const ksEventLog = print({ platform: 'ks', tag: TAG_NAME, isError: false, type: 'event' })
5
6
  const iosPropLog = print({ platform: 'ios', tag: TAG_NAME, isError: false })
6
7
  const androidPropLog = print({ platform: 'android', tag: TAG_NAME, isError: false })
7
8
  const harmonyPropLog = print({ platform: 'harmony', tag: TAG_NAME, isError: false })
9
+ const ksPropLog = print({ platform: 'ks', tag: TAG_NAME, isError: false })
10
+
8
11
  return {
9
12
  test: TAG_NAME,
10
13
  web (tag, { el }) {
@@ -37,13 +40,15 @@ module.exports = function ({ print }) {
37
40
  test: /^(referrer-policy)$/,
38
41
  ios: iosPropLog,
39
42
  android: androidPropLog,
40
- harmony: harmonyPropLog
43
+ harmony: harmonyPropLog,
44
+ ks: ksPropLog
41
45
  }
42
46
  ],
43
47
  event: [
44
48
  {
45
49
  test: /^(load|error)$/,
46
- ali: aliEventLog
50
+ ali: aliEventLog,
51
+ ks: ksEventLog
47
52
  }
48
53
  ]
49
54
  }
@@ -4,6 +4,7 @@ module.exports = function ({ print }) {
4
4
  const aliPropLog = print({ platform: 'ali', tag: TAG_NAME, isError: false })
5
5
  const baiduValueLogError = print({ platform: 'baidu', tag: TAG_NAME, isError: true, type: 'value' })
6
6
  const webPropLog = print({ platform: 'web', tag: TAG_NAME, isError: false })
7
+ const ksPropLog = print({ platform: 'ks', tag: TAG_NAME, isError: false })
7
8
 
8
9
  return {
9
10
  test: TAG_NAME,
@@ -41,7 +42,8 @@ module.exports = function ({ print }) {
41
42
  baiduValueLogError({ name, value })
42
43
  }
43
44
  },
44
- web: webPropLog
45
+ web: webPropLog,
46
+ ks: ksPropLog
45
47
  },
46
48
  {
47
49
  test: 'use-built-in',
@@ -10,6 +10,16 @@ module.exports = function ({ print }) {
10
10
  const iosPropLog = print({ platform: 'ios', tag: TAG_NAME, isError: false })
11
11
  const androidPropLog = print({ platform: 'android', tag: TAG_NAME, isError: false })
12
12
  const harmonyPropLog = print({ platform: 'harmony', tag: TAG_NAME, isError: false })
13
+ const ksPropLog = print({ platform: 'ks', tag: TAG_NAME, isError: false })
14
+ const ksEventLog = print({ platform: 'ks', tag: TAG_NAME, isError: false, type: 'event' })
15
+ const iosEventLog = print({ platform: 'ios', tag: TAG_NAME, isError: false, type: 'event' })
16
+ const androidEventLog = print({ platform: 'android', tag: TAG_NAME, isError: false, type: 'event' })
17
+ const harmonyEventLog = print({ platform: 'harmony', tag: TAG_NAME, isError: false, type: 'event' })
18
+ const webEventLog = print({ platform: 'web', tag: TAG_NAME, isError: false, type: 'event' })
19
+ const aliEventLog = print({ platform: 'ali', tag: TAG_NAME, isError: false, type: 'event' })
20
+ const qaEventLog = print({ platform: 'qa', tag: TAG_NAME, isError: false, type: 'event' })
21
+ const qqEventLog = print({ platform: 'qq', tag: TAG_NAME, isError: false, type: 'event' })
22
+ const jdEventLog = print({ platform: 'jd', tag: TAG_NAME, isError: false, type: 'event' })
13
23
 
14
24
  return {
15
25
  test: TAG_NAME,
@@ -39,12 +49,27 @@ module.exports = function ({ print }) {
39
49
  qq: qqPropLog
40
50
  },
41
51
  {
42
- test: /^(report-submit|report-submit-timeout)$/,
52
+ test: /^(report-submit|report-submit-timeout|submitToGroup)$/,
43
53
  web: webPropLog,
44
54
  qa: qaPropLog,
45
55
  ios: iosPropLog,
46
56
  android: androidPropLog,
47
- harmony: harmonyPropLog
57
+ harmony: harmonyPropLog,
58
+ ks: ksPropLog
59
+ }
60
+ ],
61
+ event: [
62
+ {
63
+ test: /^(submitToGroup)$/,
64
+ ks: ksEventLog,
65
+ ios: iosEventLog,
66
+ android: androidEventLog,
67
+ harmony: harmonyEventLog,
68
+ web: webEventLog,
69
+ ali: aliEventLog,
70
+ qa: qaEventLog,
71
+ qq: qqEventLog,
72
+ jd: jdEventLog
48
73
  }
49
74
  ]
50
75
  }
@@ -9,6 +9,7 @@ module.exports = function ({ print }) {
9
9
  const iosPropLog = print({ platform: 'ios', tag: TAG_NAME, isError: false })
10
10
  const androidPropLog = print({ platform: 'android', tag: TAG_NAME, isError: false })
11
11
  const harmonyPropLog = print({ platform: 'harmony', tag: TAG_NAME, isError: false })
12
+ const ksPropLog = print({ platform: 'ks', tag: TAG_NAME, isError: false })
12
13
 
13
14
  return {
14
15
  test: TAG_NAME,
@@ -55,6 +56,10 @@ module.exports = function ({ print }) {
55
56
  ios: iosPropLog,
56
57
  android: androidPropLog,
57
58
  harmony: harmonyPropLog
59
+ },
60
+ {
61
+ test: /^(webp|forceHttps|show-menu-by-longpress|fade-in)$/,
62
+ ks: ksPropLog
58
63
  }
59
64
  ]
60
65
  }
@@ -12,6 +12,8 @@ module.exports = function ({ print }) {
12
12
  const webPropLog = print({ platform: 'web', tag: TAG_NAME, isError: false })
13
13
  const webEventLog = print({ platform: 'web', tag: TAG_NAME, isError: false, type: 'event' })
14
14
  const webValueLog = print({ platform: 'web', tag: TAG_NAME, isError: false, type: 'value' })
15
+ const ksPropLog = print({ platform: 'ks', tag: TAG_NAME, isError: false })
16
+ const ksEventLog = print({ platform: 'ks', tag: TAG_NAME, isError: false, type: 'event' })
15
17
  const qaPropLog = print({ platform: 'qa', tag: TAG_NAME, isError: false })
16
18
  const iosValueLogError = print({ platform: 'ios', tag: TAG_NAME, isError: true, type: 'value' })
17
19
  const iosPropLog = print({ platform: 'ios', tag: TAG_NAME, isError: false })
@@ -109,6 +111,10 @@ module.exports = function ({ print }) {
109
111
  ios: iosPropLog,
110
112
  android: androidPropLog,
111
113
  harmony: harmonyPropLog
114
+ },
115
+ {
116
+ test: /^(cursor-spacing|always-embed|cursor|selection-start|selection-end|adjust-position|hold-keyboard|safe-password-cert-path|safe-password-length|safe-password-time-stamp|safe-password-nonce|safe-password-salt|safe-password-custom-hash|placeholder-class)$/,
117
+ ks: ksPropLog
112
118
  }
113
119
  ],
114
120
  event: [
@@ -129,6 +135,10 @@ module.exports = function ({ print }) {
129
135
  ios: iosEventLog,
130
136
  android: androidEventLog,
131
137
  harmony: harmonyEventLog
138
+ },
139
+ {
140
+ test: /^(change|nicknamereview|selectionchange|keyboardcompositionstart|keyboardcompositionupdate|keyboardcompositionend|onkeyboardheightchange)$/,
141
+ ks: ksEventLog
132
142
  }
133
143
  ]
134
144
  }
@@ -1,6 +1,8 @@
1
1
  const TAG_NAME = 'label'
2
2
 
3
- module.exports = function () {
3
+ module.exports = function ({ print }) {
4
+ const ksPropLog = print({ platform: 'ks', tag: TAG_NAME, isError: false })
5
+
4
6
  return {
5
7
  test: TAG_NAME,
6
8
  ios (tag, { el }) {
@@ -14,6 +16,12 @@ module.exports = function () {
14
16
  harmony (tag, { el }) {
15
17
  el.isBuiltIn = true
16
18
  return 'mpx-label'
17
- }
19
+ },
20
+ props: [
21
+ {
22
+ test: /^(for)$/,
23
+ ks: ksPropLog
24
+ }
25
+ ]
18
26
  }
19
27
  }
@@ -12,6 +12,9 @@ module.exports = function ({ print }) {
12
12
  const ttPropLog = print({ platform: 'bytedance', tag: TAG_NAME, isError: false })
13
13
  const qaPropLog = print({ platform: 'qa', tag: TAG_NAME, isError: false })
14
14
  const qaEventLogError = print({ platform: 'qa', tag: TAG_NAME, isError: true, type: 'event' })
15
+ const ksPropLog = print({ platform: 'ks', tag: TAG_NAME, isError: false })
16
+ const ksEventLogError = print({ platform: 'ks', tag: TAG_NAME, isError: true, type: 'event' })
17
+
15
18
  return {
16
19
  // 匹配标签名,可传递正则
17
20
  test: TAG_NAME,
@@ -55,6 +58,10 @@ module.exports = function ({ print }) {
55
58
  {
56
59
  test: /^(min-scale|max-scale|covers|polyline|include-points|show-location|subkey|layer-style|skew|enable-3D|show-compass|show-scale|enable-overlooking|enable-zoom|enable-scroll|enable-rotate|enable-satellite|enable-traffic|enable-poi|enable-building|setting)$/,
57
60
  qa: qaPropLog
61
+ },
62
+ {
63
+ test: /^(min-scale|max-scale|covers|polyline|controls|include-points|show-location|polygons|subkey|layer-style|skew|enable-3D|show-compass|show-scale|enable-overlooking|enable-auto-max-overlooking|enable-zoom|enable-scroll|enable-rotate|enable-satellite|enable-traffic|enable-poi|enable-building|setting)$/,
64
+ ks: ksPropLog
58
65
  }
59
66
  ],
60
67
  // 组件事件中的差异部分
@@ -93,6 +100,10 @@ module.exports = function ({ print }) {
93
100
  {
94
101
  test: /^(labeltap|anchorpointtap)$/,
95
102
  qa: qaEventLogError
103
+ },
104
+ {
105
+ test: /^(updated|regionchange|poitap|polylinetap|abilitysuccess|abilityfail|authsuccess|interpolatepoint|error)$/,
106
+ ks: ksEventLogError
96
107
  }
97
108
  ]
98
109
  }
@@ -4,6 +4,8 @@ module.exports = function ({ print }) {
4
4
  const androidPropLog = print({ platform: 'android', tag: TAG_NAME, isError: false })
5
5
  const harmonyPropLog = print({ platform: 'harmony', tag: TAG_NAME, isError: false })
6
6
  const iosPropLog = print({ platform: 'ios', tag: TAG_NAME, isError: false })
7
+ const ksPropLog = print({ platform: 'ks', tag: TAG_NAME, isError: false })
8
+
7
9
  return {
8
10
  test: TAG_NAME,
9
11
  web (tag, { el }) {
@@ -27,7 +29,8 @@ module.exports = function ({ print }) {
27
29
  test: /^(scale-area)$/,
28
30
  ios: iosPropLog,
29
31
  android: androidPropLog,
30
- harmony: harmonyPropLog
32
+ harmony: harmonyPropLog,
33
+ ks: ksPropLog
31
34
  }
32
35
  ]
33
36
  }
@@ -9,6 +9,9 @@ module.exports = function ({ print }) {
9
9
  const androidPropLog = print({ platform: 'android', tag: TAG_NAME, isError: false })
10
10
  const harmonyPropLog = print({ platform: 'harmony', tag: TAG_NAME, isError: false })
11
11
  const iosPropLog = print({ platform: 'ios', tag: TAG_NAME, isError: false })
12
+ const ksPropLog = print({ platform: 'ks', tag: TAG_NAME, isError: false })
13
+ const ksEventLog = print({ platform: 'ks', tag: TAG_NAME, isError: false, type: 'event' })
14
+
12
15
  return {
13
16
  test: TAG_NAME,
14
17
  web (tag, { el }) {
@@ -36,7 +39,18 @@ module.exports = function ({ print }) {
36
39
  harmony: harmonyPropLog
37
40
  },
38
41
  {
39
- test: /^(damping|friction|scale|scale-min|scale-max|scale-value)$/,
42
+ test: /^(inertia)$/,
43
+ ks: ksPropLog
44
+ },
45
+ {
46
+ test: /^(damping|friction)$/,
47
+ ios: iosPropLog,
48
+ android: androidPropLog,
49
+ harmony: harmonyPropLog,
50
+ ks: ksPropLog
51
+ },
52
+ {
53
+ test: /^(scale|scale-min|scale-max|scale-value)$/,
40
54
  ios: iosPropLog,
41
55
  android: androidPropLog,
42
56
  harmony: harmonyPropLog
@@ -45,7 +59,8 @@ module.exports = function ({ print }) {
45
59
  event: [
46
60
  {
47
61
  test: /^(htouchmove|vtouchmove)$/,
48
- ali: aliEventLog
62
+ ali: aliEventLog,
63
+ ks: ksEventLog
49
64
  },
50
65
  {
51
66
  test: /^(bindscale)$/,