@mpxjs/webpack-plugin 2.9.67 → 2.9.69-beta.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 (150) hide show
  1. package/lib/index.js +30 -9
  2. package/lib/platform/json/wx/index.js +21 -8
  3. package/lib/platform/style/wx/index.js +51 -54
  4. package/lib/platform/template/wx/component-config/canvas.js +8 -0
  5. package/lib/platform/template/wx/component-config/fix-component-name.js +15 -12
  6. package/lib/platform/template/wx/component-config/index.js +1 -1
  7. package/lib/platform/template/wx/component-config/input.js +1 -1
  8. package/lib/platform/template/wx/component-config/movable-view.js +8 -1
  9. package/lib/platform/template/wx/component-config/rich-text.js +8 -0
  10. package/lib/platform/template/wx/component-config/scroll-view.js +1 -1
  11. package/lib/platform/template/wx/component-config/swiper.js +1 -1
  12. package/lib/platform/template/wx/component-config/textarea.js +1 -1
  13. package/lib/platform/template/wx/component-config/unsupported.js +1 -1
  14. package/lib/react/processStyles.js +14 -4
  15. package/lib/react/processTemplate.js +3 -0
  16. package/lib/resolver/AddEnvPlugin.js +1 -0
  17. package/lib/resolver/AddModePlugin.js +9 -8
  18. package/lib/runtime/components/react/context.ts +14 -0
  19. package/lib/runtime/components/react/dist/context.js +4 -0
  20. package/lib/runtime/components/react/dist/event.config.js +24 -24
  21. package/lib/runtime/components/react/dist/getInnerListeners.js +183 -175
  22. package/lib/runtime/components/react/dist/mpx-button.jsx +77 -49
  23. package/lib/runtime/components/react/dist/mpx-canvas/Bus.js +60 -0
  24. package/lib/runtime/components/react/dist/mpx-canvas/CanvasGradient.js +15 -0
  25. package/lib/runtime/components/react/dist/mpx-canvas/CanvasRenderingContext2D.js +84 -0
  26. package/lib/runtime/components/react/dist/mpx-canvas/Image.js +87 -0
  27. package/lib/runtime/components/react/dist/mpx-canvas/ImageData.js +15 -0
  28. package/lib/runtime/components/react/dist/mpx-canvas/constructorsRegistry.js +28 -0
  29. package/lib/runtime/components/react/dist/mpx-canvas/html.js +343 -0
  30. package/lib/runtime/components/react/dist/mpx-canvas/index.jsx +232 -0
  31. package/lib/runtime/components/react/dist/mpx-canvas/utils.jsx +89 -0
  32. package/lib/runtime/components/react/dist/mpx-checkbox-group.jsx +13 -19
  33. package/lib/runtime/components/react/dist/mpx-checkbox.jsx +29 -38
  34. package/lib/runtime/components/react/dist/mpx-form.jsx +16 -19
  35. package/lib/runtime/components/react/dist/mpx-icon.jsx +8 -16
  36. package/lib/runtime/components/react/dist/mpx-image.jsx +291 -0
  37. package/lib/runtime/components/react/dist/mpx-input.jsx +54 -27
  38. package/lib/runtime/components/react/dist/mpx-label.jsx +15 -22
  39. package/lib/runtime/components/react/dist/mpx-movable-area.jsx +13 -16
  40. package/lib/runtime/components/react/dist/mpx-movable-view.jsx +14 -14
  41. package/lib/runtime/components/react/dist/mpx-navigator.jsx +2 -4
  42. package/lib/runtime/components/react/dist/mpx-picker/date.jsx +6 -2
  43. package/lib/runtime/components/react/dist/mpx-picker/index.jsx +5 -3
  44. package/lib/runtime/components/react/dist/mpx-picker/multiSelector.jsx +6 -2
  45. package/lib/runtime/components/react/dist/mpx-picker/region.jsx +6 -2
  46. package/lib/runtime/components/react/dist/mpx-picker/selector.jsx +6 -2
  47. package/lib/runtime/components/react/dist/mpx-picker/time.jsx +10 -15
  48. package/lib/runtime/components/react/dist/mpx-picker-view-column-item.jsx +39 -0
  49. package/lib/runtime/components/react/dist/mpx-picker-view-column.jsx +171 -88
  50. package/lib/runtime/components/react/dist/mpx-picker-view.jsx +80 -121
  51. package/lib/runtime/components/react/dist/mpx-radio-group.jsx +11 -19
  52. package/lib/runtime/components/react/dist/mpx-radio.jsx +27 -42
  53. package/lib/runtime/components/react/dist/mpx-rich-text/html.js +39 -0
  54. package/lib/runtime/components/react/dist/mpx-rich-text/index.jsx +62 -0
  55. package/lib/runtime/components/react/dist/mpx-root-portal.jsx +6 -4
  56. package/lib/runtime/components/react/dist/mpx-scroll-view.jsx +53 -42
  57. package/lib/runtime/components/react/dist/mpx-simple-text.jsx +11 -0
  58. package/lib/runtime/components/react/dist/mpx-swiper-item.jsx +28 -9
  59. package/lib/runtime/components/react/dist/mpx-swiper.jsx +608 -0
  60. package/lib/runtime/components/react/dist/mpx-switch.jsx +20 -10
  61. package/lib/runtime/components/react/dist/mpx-text.jsx +11 -10
  62. package/lib/runtime/components/react/dist/mpx-textarea.jsx +8 -3
  63. package/lib/runtime/components/react/dist/mpx-view.jsx +67 -94
  64. package/lib/runtime/components/react/dist/mpx-web-view.jsx +152 -37
  65. package/lib/runtime/components/react/dist/pickerFaces.js +81 -0
  66. package/lib/runtime/components/react/dist/pickerVIewContext.js +9 -0
  67. package/lib/runtime/components/react/dist/pickerViewMask.jsx +18 -0
  68. package/lib/runtime/components/react/dist/pickerViewOverlay.jsx +23 -0
  69. package/lib/runtime/components/react/dist/useAnimationHooks.js +36 -10
  70. package/lib/runtime/components/react/dist/utils.jsx +129 -24
  71. package/lib/runtime/components/react/event.config.ts +25 -26
  72. package/lib/runtime/components/react/getInnerListeners.ts +238 -202
  73. package/lib/runtime/components/react/mpx-button.tsx +104 -57
  74. package/lib/runtime/components/react/mpx-canvas/Bus.ts +70 -0
  75. package/lib/runtime/components/react/mpx-canvas/CanvasGradient.ts +18 -0
  76. package/lib/runtime/components/react/mpx-canvas/CanvasRenderingContext2D.ts +87 -0
  77. package/lib/runtime/components/react/mpx-canvas/Image.ts +102 -0
  78. package/lib/runtime/components/react/mpx-canvas/ImageData.ts +23 -0
  79. package/lib/runtime/components/react/mpx-canvas/constructorsRegistry.ts +38 -0
  80. package/lib/runtime/components/react/mpx-canvas/html.ts +343 -0
  81. package/lib/runtime/components/react/mpx-canvas/index.tsx +296 -0
  82. package/lib/runtime/components/react/mpx-canvas/utils.tsx +150 -0
  83. package/lib/runtime/components/react/mpx-checkbox-group.tsx +28 -25
  84. package/lib/runtime/components/react/mpx-checkbox.tsx +48 -49
  85. package/lib/runtime/components/react/mpx-form.tsx +25 -28
  86. package/lib/runtime/components/react/mpx-icon.tsx +12 -17
  87. package/lib/runtime/components/react/mpx-image.tsx +436 -0
  88. package/lib/runtime/components/react/mpx-input.tsx +77 -57
  89. package/lib/runtime/components/react/mpx-label.tsx +26 -27
  90. package/lib/runtime/components/react/mpx-movable-area.tsx +18 -23
  91. package/lib/runtime/components/react/mpx-movable-view.tsx +22 -26
  92. package/lib/runtime/components/react/mpx-navigator.tsx +2 -8
  93. package/lib/runtime/components/react/mpx-picker/date.tsx +5 -2
  94. package/lib/runtime/components/react/mpx-picker/index.tsx +3 -2
  95. package/lib/runtime/components/react/mpx-picker/multiSelector.tsx +5 -2
  96. package/lib/runtime/components/react/mpx-picker/region.tsx +5 -2
  97. package/lib/runtime/components/react/mpx-picker/selector.tsx +5 -2
  98. package/lib/runtime/components/react/mpx-picker/time.tsx +10 -15
  99. package/lib/runtime/components/react/mpx-picker/type.ts +48 -43
  100. package/lib/runtime/components/react/mpx-picker-view-column-item.tsx +88 -0
  101. package/lib/runtime/components/react/mpx-picker-view-column.tsx +276 -112
  102. package/lib/runtime/components/react/mpx-picker-view.tsx +137 -129
  103. package/lib/runtime/components/react/mpx-radio-group.tsx +24 -27
  104. package/lib/runtime/components/react/mpx-radio.tsx +45 -54
  105. package/lib/runtime/components/react/mpx-rich-text/html.ts +40 -0
  106. package/lib/runtime/components/react/mpx-rich-text/index.tsx +115 -0
  107. package/lib/runtime/components/react/mpx-root-portal.tsx +3 -5
  108. package/lib/runtime/components/react/mpx-scroll-view.tsx +83 -73
  109. package/lib/runtime/components/react/mpx-simple-text.tsx +18 -0
  110. package/lib/runtime/components/react/mpx-swiper-item.tsx +41 -12
  111. package/lib/runtime/components/react/mpx-swiper.tsx +690 -0
  112. package/lib/runtime/components/react/mpx-switch.tsx +29 -23
  113. package/lib/runtime/components/react/mpx-text.tsx +14 -18
  114. package/lib/runtime/components/react/mpx-textarea.tsx +11 -10
  115. package/lib/runtime/components/react/mpx-view.tsx +93 -117
  116. package/lib/runtime/components/react/mpx-web-view.tsx +162 -56
  117. package/lib/runtime/components/react/pickerFaces.ts +112 -0
  118. package/lib/runtime/components/react/pickerVIewContext.ts +18 -0
  119. package/lib/runtime/components/react/pickerViewMask.tsx +30 -0
  120. package/lib/runtime/components/react/pickerViewOverlay.tsx +34 -0
  121. package/lib/runtime/components/react/types/common.ts +2 -0
  122. package/lib/runtime/components/react/types/global.d.ts +7 -17
  123. package/lib/runtime/components/react/useAnimationHooks.ts +37 -12
  124. package/lib/runtime/components/react/utils.tsx +169 -29
  125. package/lib/runtime/components/web/getInnerListeners.js +6 -6
  126. package/lib/runtime/components/web/mpx-movable-view.vue +334 -344
  127. package/lib/runtime/components/web/mpx-picker-view-column.vue +75 -75
  128. package/lib/runtime/components/web/mpx-picker.vue +382 -385
  129. package/lib/runtime/components/web/mpx-web-view.vue +175 -161
  130. package/lib/runtime/optionProcessor.js +7 -38
  131. package/lib/runtime/utils.js +2 -0
  132. package/lib/style-compiler/index.js +3 -4
  133. package/lib/style-compiler/plugins/scope-id.js +30 -2
  134. package/lib/style-compiler/strip-conditional-loader.js +118 -0
  135. package/lib/template-compiler/bind-this.js +7 -2
  136. package/lib/template-compiler/compiler.js +66 -39
  137. package/lib/template-compiler/gen-node-react.js +3 -3
  138. package/package.json +6 -4
  139. package/LICENSE +0 -433
  140. package/lib/runtime/components/react/dist/mpx-image/index.jsx +0 -226
  141. package/lib/runtime/components/react/dist/mpx-image/svg.jsx +0 -7
  142. package/lib/runtime/components/react/dist/mpx-swiper/carouse.jsx +0 -478
  143. package/lib/runtime/components/react/dist/mpx-swiper/index.jsx +0 -68
  144. package/lib/runtime/components/react/dist/mpx-swiper/type.js +0 -1
  145. package/lib/runtime/components/react/mpx-image/index.tsx +0 -345
  146. package/lib/runtime/components/react/mpx-image/svg.tsx +0 -22
  147. package/lib/runtime/components/react/mpx-swiper/carouse.tsx +0 -525
  148. package/lib/runtime/components/react/mpx-swiper/index.tsx +0 -80
  149. package/lib/runtime/components/react/mpx-swiper/type.ts +0 -87
  150. package/lib/runtime/components/web/event.js +0 -105
@@ -725,7 +725,7 @@ function parse (template, options) {
725
725
  stack.push(element)
726
726
  } else {
727
727
  element.unary = true
728
- closeElement(element, meta, options)
728
+ closeElement(element, options, meta)
729
729
  }
730
730
  },
731
731
 
@@ -740,7 +740,7 @@ function parse (template, options) {
740
740
  // pop stack
741
741
  stack.pop()
742
742
  currentParent = stack[stack.length - 1]
743
- closeElement(element, meta, options)
743
+ closeElement(element, options, meta)
744
744
  }
745
745
  },
746
746
 
@@ -765,7 +765,7 @@ function parse (template, options) {
765
765
  parent: currentParent
766
766
  }
767
767
  children.push(el)
768
- runtimeCompile ? processTextDynamic(el) : processText(el)
768
+ runtimeCompile ? processTextDynamic(el) : processText(el, options, meta)
769
769
  }
770
770
  },
771
771
  comment: function comment (text) {
@@ -1164,7 +1164,7 @@ function processEventReact (el) {
1164
1164
  configs: []
1165
1165
  }
1166
1166
  }
1167
- eventConfigMap[type].configs.push(Object.assign({ name }, parsedFunc))
1167
+ eventConfigMap[type].configs.push(Object.assign({ name, value }, parsedFunc))
1168
1168
  }
1169
1169
  }
1170
1170
  })
@@ -1205,26 +1205,32 @@ function processEventReact (el) {
1205
1205
 
1206
1206
  // let wrapper
1207
1207
  for (const type in eventConfigMap) {
1208
- let { configs } = eventConfigMap[type]
1209
- configs.forEach(({ name }) => {
1210
- if (name) {
1211
- // 清空原始事件绑定
1212
- let has
1213
- do {
1214
- has = getAndRemoveAttr(el, name).has
1215
- } while (has)
1216
- }
1217
- })
1218
- configs = configs.map((item) => {
1219
- return item.expStr
1220
- })
1221
- const value = `{{(e)=>this.__invoke(e, [${configs}])}}`
1222
- addAttrs(el, [
1223
- {
1224
- name: type,
1225
- value
1226
- }
1227
- ])
1208
+ const { configs } = eventConfigMap[type]
1209
+ if (!configs.length) continue
1210
+ const needBind = configs.length > 1 || configs[0].hasArgs || tagRE.test(configs[0].value)
1211
+ if (needBind) {
1212
+ configs.forEach(({ name }) => {
1213
+ if (name) {
1214
+ // 清空原始事件绑定
1215
+ let has
1216
+ do {
1217
+ has = getAndRemoveAttr(el, name).has
1218
+ } while (has)
1219
+ }
1220
+ })
1221
+ const value = `{{(e)=>this.__invoke(e, [${configs.map(item => item.expStr)}])}}`
1222
+ addAttrs(el, [
1223
+ {
1224
+ name: type,
1225
+ value
1226
+ }
1227
+ ])
1228
+ } else {
1229
+ const { name, value } = configs[0]
1230
+ const { result } = parseMustacheWithContext(value)
1231
+ modifyAttr(el, name, `{{this[${result}]}}`)
1232
+ }
1233
+
1228
1234
  // 非button的情况下,press/longPress时间需要包裹TouchableWithoutFeedback进行响应,后续可支持配置
1229
1235
  // if ((type === 'press' || type === 'longPress') && el.tag !== 'mpx-button') {
1230
1236
  // if (!wrapper) {
@@ -1374,7 +1380,8 @@ function processEvent (el, options) {
1374
1380
  function processSlotReact (el, meta) {
1375
1381
  if (el.tag === 'slot') {
1376
1382
  el.slot = {
1377
- name: getAndRemoveAttr(el, 'name').val
1383
+ name: getAndRemoveAttr(el, 'name').val,
1384
+ slot: getAndRemoveAttr(el, 'slot').val
1378
1385
  }
1379
1386
  meta.options = meta.options || {}
1380
1387
  meta.options.disableMemo = true
@@ -1921,7 +1928,7 @@ function postProcessFor (el) {
1921
1928
  function postProcessForReact (el) {
1922
1929
  if (el.for) {
1923
1930
  if (el.for.key) {
1924
- addExp(el, `this.__getWxKey(${el.for.item || 'item'}, ${stringify(el.for.key)})`, false, 'key')
1931
+ addExp(el, `this.__getWxKey(${el.for.item || 'item'}, ${stringify(el.for.key)}, ${el.for.index || 'index'})`, false, 'key')
1925
1932
  addAttrs(el, [{
1926
1933
  name: 'key',
1927
1934
  value: el.for.key
@@ -2035,7 +2042,7 @@ function postProcessIfReact (el) {
2035
2042
  }
2036
2043
  }
2037
2044
 
2038
- function processText (el) {
2045
+ function processText (el, options, meta) {
2039
2046
  if (el.type !== 3 || el.isComment) {
2040
2047
  return
2041
2048
  }
@@ -2045,17 +2052,38 @@ function processText (el) {
2045
2052
  }
2046
2053
  el.text = parsed.val
2047
2054
  if (isReact(mode)) {
2048
- processWrapTextReact(el)
2055
+ processWrapTextReact(el, options, meta)
2049
2056
  }
2050
2057
  }
2051
2058
 
2052
- // RN中文字需被Text包裹
2053
- function processWrapTextReact (el) {
2054
- const parentTag = el.parent.tag
2059
+ // RN中裸文字需被Text包裹
2060
+ // 为了批量修改Text默认属性,如allowFontScaling,使用mpx-simple-text进行包裹
2061
+ function processWrapTextReact (el, options, meta) {
2062
+ const parent = el.parent
2063
+ const parentTag = parent.tag
2055
2064
  if (parentTag !== 'mpx-text' && parentTag !== 'Text' && parentTag !== 'wxs') {
2056
- const wrapper = createASTElement('Text')
2065
+ const wrapper = createASTElement('mpx-simple-text')
2066
+ wrapper.isBuiltIn = true
2067
+ const inheritAttrs = []
2068
+ parent.attrsList.forEach(({ name, value }) => {
2069
+ if (/^data-/.test(name)) {
2070
+ inheritAttrs.push({
2071
+ name,
2072
+ value
2073
+ })
2074
+ }
2075
+ if (/^id$/.test(name)) {
2076
+ inheritAttrs.push({
2077
+ name: 'parentId',
2078
+ value
2079
+ })
2080
+ }
2081
+ })
2082
+ addAttrs(wrapper, inheritAttrs)
2057
2083
  replaceNode(el, wrapper, true)
2058
2084
  addChild(wrapper, el)
2085
+ processBuiltInComponents(wrapper, meta)
2086
+ processAttrs(wrapper, options)
2059
2087
  }
2060
2088
  }
2061
2089
 
@@ -2360,12 +2388,11 @@ function getVirtualHostRoot (options, meta) {
2360
2388
  {
2361
2389
  name: 'class',
2362
2390
  value: `${MPX_ROOT_VIEW} host-${moduleId}`
2391
+ },
2392
+ {
2393
+ name: 'ishost',
2394
+ value: '{{true}}'
2363
2395
  }
2364
- // todo 运行时通过root标识确定是否合并rootProps
2365
- // {
2366
- // name: 'is-root',
2367
- // value: '{{true}}'
2368
- // }
2369
2396
  ])
2370
2397
  processElement(rootView, rootView, options, meta)
2371
2398
  return rootView
@@ -2619,8 +2646,8 @@ function processElement (el, root, options, meta) {
2619
2646
  // 预处理代码维度条件编译
2620
2647
  processIf(el)
2621
2648
  processFor(el)
2649
+ processRefReact(el, meta)
2622
2650
  if (!pass) {
2623
- processRefReact(el, meta)
2624
2651
  processStyleReact(el, options)
2625
2652
  processEventReact(el)
2626
2653
  processComponentIs(el, options)
@@ -2662,7 +2689,7 @@ function processElement (el, root, options, meta) {
2662
2689
  processAttrs(el, options)
2663
2690
  }
2664
2691
 
2665
- function closeElement (el, meta, options) {
2692
+ function closeElement (el, options, meta) {
2666
2693
  postProcessAtMode(el)
2667
2694
  postProcessWxs(el, meta)
2668
2695
 
@@ -19,7 +19,7 @@ function genFor (node) {
19
19
  node.forProcessed = true
20
20
  const index = node.for.index || 'index'
21
21
  const item = node.for.item || 'item'
22
- return `_i(${node.for.exp}, function(${item},${index}){return ${genNode(node)}})`
22
+ return `this.__iter(${node.for.exp}, function(${item},${index}){return ${genNode(node)}})`
23
23
  }
24
24
 
25
25
  const s = JSON.stringify
@@ -56,8 +56,8 @@ function genNode (node) {
56
56
  return map
57
57
  }, {})
58
58
  if (node.slot) {
59
- const name = node.slot.name
60
- exp += `__getSlot(${name ? s(name) : ''})`
59
+ const { name, slot } = node.slot
60
+ exp += `this.__getSlot(${name ? s(name) : ''}${slot ? `, ${s(slot)}` : ''})`
61
61
  } else {
62
62
  exp += `createElement(${`getComponent(${node.is || s(node.tag)})`}`
63
63
  if (node.attrsList.length) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mpxjs/webpack-plugin",
3
- "version": "2.9.67",
3
+ "version": "2.9.69-beta.1",
4
4
  "description": "mpx compile core",
5
5
  "keywords": [
6
6
  "mpx"
@@ -28,7 +28,7 @@
28
28
  "@better-scroll/wheel": "^2.5.1",
29
29
  "@better-scroll/zoom": "^2.5.1",
30
30
  "@mpxjs/template-engine": "^2.8.7",
31
- "@mpxjs/utils": "^2.9.67",
31
+ "@mpxjs/utils": "^2.9.69",
32
32
  "acorn": "^8.11.3",
33
33
  "acorn-walk": "^7.2.0",
34
34
  "async": "^2.6.0",
@@ -82,7 +82,8 @@
82
82
  },
83
83
  "devDependencies": {
84
84
  "@ant-design/react-native": "^5.2.2",
85
- "@mpxjs/api-proxy": "^2.9.67",
85
+ "@d11/react-native-fast-image": "^8.6.12",
86
+ "@mpxjs/api-proxy": "^2.9.69",
86
87
  "@types/babel-traverse": "^6.25.4",
87
88
  "@types/babel-types": "^7.0.4",
88
89
  "@types/react": "^18.2.79",
@@ -90,6 +91,7 @@
90
91
  "react-native-gesture-handler": "^2.18.1",
91
92
  "react-native-linear-gradient": "^2.8.3",
92
93
  "react-native-reanimated": "^3.15.2",
94
+ "react-native-svg": "^15.8.0",
93
95
  "react-native-safe-area-context": "^4.12.0",
94
96
  "react-native-webview": "^13.12.2",
95
97
  "rimraf": "^6.0.1"
@@ -97,5 +99,5 @@
97
99
  "engines": {
98
100
  "node": ">=14.14.0"
99
101
  },
100
- "gitHead": "b23d3850c16543c5998811b8d1d8e6ee7988c0f8"
102
+ "gitHead": "2d37697869b9bdda3efab92dda8c910b68fd05c0"
101
103
  }
package/LICENSE DELETED
@@ -1,433 +0,0 @@
1
- Apache License
2
-
3
- Version 2.0, January 2004
4
-
5
- http://www.apache.org/licenses/
6
-
7
-
8
-
9
-
10
- TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
11
-
12
-
13
-
14
-
15
- 1. Definitions.
16
-
17
-
18
-
19
-
20
- "License" shall mean the terms and conditions for use, reproduction,
21
-
22
- and distribution as defined by Sections 1 through 9 of this document.
23
-
24
-
25
-
26
-
27
- "Licensor" shall mean the copyright owner or entity authorized by
28
-
29
- the copyright owner that is granting the License.
30
-
31
-
32
-
33
-
34
- "Legal Entity" shall mean the union of the acting entity and all
35
-
36
- other entities that control, are controlled by, or are under common
37
-
38
- control with that entity. For the purposes of this definition,
39
-
40
- "control" means (i) the power, direct or indirect, to cause the
41
-
42
- direction or management of such entity, whether by contract or
43
-
44
- otherwise, or (ii) ownership of fifty percent (50%) or more of the
45
-
46
- outstanding shares, or (iii) beneficial ownership of such entity.
47
-
48
-
49
-
50
-
51
- "You" (or "Your") shall mean an individual or Legal Entity
52
-
53
- exercising permissions granted by this License.
54
-
55
-
56
-
57
-
58
- "Source" form shall mean the preferred form for making modifications,
59
-
60
- including but not limited to software source code, documentation
61
-
62
- source, and configuration files.
63
-
64
-
65
-
66
-
67
- "Object" form shall mean any form resulting from mechanical
68
-
69
- transformation or translation of a Source form, including but
70
-
71
- not limited to compiled object code, generated documentation,
72
-
73
- and conversions to other media types.
74
-
75
-
76
-
77
-
78
- "Work" shall mean the work of authorship, whether in Source or
79
-
80
- Object form, made available under the License, as indicated by a
81
-
82
- copyright notice that is included in or attached to the work
83
-
84
- (an example is provided in the Appendix below).
85
-
86
-
87
-
88
-
89
- "Derivative Works" shall mean any work, whether in Source or Object
90
-
91
- form, that is based on (or derived from) the Work and for which the
92
-
93
- editorial revisions, annotations, elaborations, or other modifications
94
-
95
- represent, as a whole, an original work of authorship. For the purposes
96
-
97
- of this License, Derivative Works shall not include works that remain
98
-
99
- separable from, or merely link (or bind by name) to the interfaces of,
100
-
101
- the Work and Derivative Works thereof.
102
-
103
-
104
-
105
-
106
- "Contribution" shall mean any work of authorship, including
107
-
108
- the original version of the Work and any modifications or additions
109
-
110
- to that Work or Derivative Works thereof, that is intentionally
111
-
112
- submitted to Licensor for inclusion in the Work by the copyright owner
113
-
114
- or by an individual or Legal Entity authorized to submit on behalf of
115
-
116
- the copyright owner. For the purposes of this definition, "submitted"
117
-
118
- means any form of electronic, verbal, or written communication sent
119
-
120
- to the Licensor or its representatives, including but not limited to
121
-
122
- communication on electronic mailing lists, source code control systems,
123
-
124
- and issue tracking systems that are managed by, or on behalf of, the
125
-
126
- Licensor for the purpose of discussing and improving the Work, but
127
-
128
- excluding communication that is conspicuously marked or otherwise
129
-
130
- designated in writing by the copyright owner as "Not a Contribution."
131
-
132
-
133
-
134
-
135
- "Contributor" shall mean Licensor and any individual or Legal Entity
136
-
137
- on behalf of whom a Contribution has been received by Licensor and
138
-
139
- subsequently incorporated within the Work.
140
-
141
-
142
-
143
-
144
- 2. Grant of Copyright License. Subject to the terms and conditions of
145
-
146
- this License, each Contributor hereby grants to You a perpetual,
147
-
148
- worldwide, non-exclusive, no-charge, royalty-free, irrevocable
149
-
150
- copyright license to reproduce, prepare Derivative Works of,
151
-
152
- publicly display, publicly perform, sublicense, and distribute the
153
-
154
- Work and such Derivative Works in Source or Object form.
155
-
156
-
157
-
158
-
159
- 3. Grant of Patent License. Subject to the terms and conditions of
160
-
161
- this License, each Contributor hereby grants to You a perpetual,
162
-
163
- worldwide, non-exclusive, no-charge, royalty-free, irrevocable
164
-
165
- (except as stated in this section) patent license to make, have made,
166
-
167
- use, offer to sell, sell, import, and otherwise transfer the Work,
168
-
169
- where such license applies only to those patent claims licensable
170
-
171
- by such Contributor that are necessarily infringed by their
172
-
173
- Contribution(s) alone or by combination of their Contribution(s)
174
-
175
- with the Work to which such Contribution(s) was submitted. If You
176
-
177
- institute patent litigation against any entity (including a
178
-
179
- cross-claim or counterclaim in a lawsuit) alleging that the Work
180
-
181
- or a Contribution incorporated within the Work constitutes direct
182
-
183
- or contributory patent infringement, then any patent licenses
184
-
185
- granted to You under this License for that Work shall terminate
186
-
187
- as of the date such litigation is filed.
188
-
189
-
190
-
191
-
192
- 4. Redistribution. You may reproduce and distribute copies of the
193
-
194
- Work or Derivative Works thereof in any medium, with or without
195
-
196
- modifications, and in Source or Object form, provided that You
197
-
198
- meet the following conditions:
199
-
200
-
201
-
202
-
203
- (a) You must give any other recipients of the Work or
204
-
205
- Derivative Works a copy of this License; and
206
-
207
-
208
-
209
-
210
- (b) You must cause any modified files to carry prominent notices
211
-
212
- stating that You changed the files; and
213
-
214
-
215
-
216
-
217
- (c) You must retain, in the Source form of any Derivative Works
218
-
219
- that You distribute, all copyright, patent, trademark, and
220
-
221
- attribution notices from the Source form of the Work,
222
-
223
- excluding those notices that do not pertain to any part of
224
-
225
- the Derivative Works; and
226
-
227
-
228
-
229
-
230
- (d) If the Work includes a "NOTICE" text file as part of its
231
-
232
- distribution, then any Derivative Works that You distribute must
233
-
234
- include a readable copy of the attribution notices contained
235
-
236
- within such NOTICE file, excluding those notices that do not
237
-
238
- pertain to any part of the Derivative Works, in at least one
239
-
240
- of the following places: within a NOTICE text file distributed
241
-
242
- as part of the Derivative Works; within the Source form or
243
-
244
- documentation, if provided along with the Derivative Works; or,
245
-
246
- within a display generated by the Derivative Works, if and
247
-
248
- wherever such third-party notices normally appear. The contents
249
-
250
- of the NOTICE file are for informational purposes only and
251
-
252
- do not modify the License. You may add Your own attribution
253
-
254
- notices within Derivative Works that You distribute, alongside
255
-
256
- or as an addendum to the NOTICE text from the Work, provided
257
-
258
- that such additional attribution notices cannot be construed
259
-
260
- as modifying the License.
261
-
262
-
263
-
264
-
265
- You may add Your own copyright statement to Your modifications and
266
-
267
- may provide additional or different license terms and conditions
268
-
269
- for use, reproduction, or distribution of Your modifications, or
270
-
271
- for any such Derivative Works as a whole, provided Your use,
272
-
273
- reproduction, and distribution of the Work otherwise complies with
274
-
275
- the conditions stated in this License.
276
-
277
-
278
-
279
-
280
- 5. Submission of Contributions. Unless You explicitly state otherwise,
281
-
282
- any Contribution intentionally submitted for inclusion in the Work
283
-
284
- by You to the Licensor shall be under the terms and conditions of
285
-
286
- this License, without any additional terms or conditions.
287
-
288
- Notwithstanding the above, nothing herein shall supersede or modify
289
-
290
- the terms of any separate license agreement you may have executed
291
-
292
- with Licensor regarding such Contributions.
293
-
294
-
295
-
296
-
297
- 6. Trademarks. This License does not grant permission to use the trade
298
-
299
- names, trademarks, service marks, or product names of the Licensor,
300
-
301
- except as required for reasonable and customary use in describing the
302
-
303
- origin of the Work and reproducing the content of the NOTICE file.
304
-
305
-
306
-
307
-
308
- 7. Disclaimer of Warranty. Unless required by applicable law or
309
-
310
- agreed to in writing, Licensor provides the Work (and each
311
-
312
- Contributor provides its Contributions) on an "AS IS" BASIS,
313
-
314
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
315
-
316
- implied, including, without limitation, any warranties or conditions
317
-
318
- of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
319
-
320
- PARTICULAR PURPOSE. You are solely responsible for determining the
321
-
322
- appropriateness of using or redistributing the Work and assume any
323
-
324
- risks associated with Your exercise of permissions under this License.
325
-
326
-
327
-
328
-
329
- 8. Limitation of Liability. In no event and under no legal theory,
330
-
331
- whether in tort (including negligence), contract, or otherwise,
332
-
333
- unless required by applicable law (such as deliberate and grossly
334
-
335
- negligent acts) or agreed to in writing, shall any Contributor be
336
-
337
- liable to You for damages, including any direct, indirect, special,
338
-
339
- incidental, or consequential damages of any character arising as a
340
-
341
- result of this License or out of the use or inability to use the
342
-
343
- Work (including but not limited to damages for loss of goodwill,
344
-
345
- work stoppage, computer failure or malfunction, or any and all
346
-
347
- other commercial damages or losses), even if such Contributor
348
-
349
- has been advised of the possibility of such damages.
350
-
351
-
352
-
353
-
354
- 9. Accepting Warranty or Additional Liability. While redistributing
355
-
356
- the Work or Derivative Works thereof, You may choose to offer,
357
-
358
- and charge a fee for, acceptance of support, warranty, indemnity,
359
-
360
- or other liability obligations and/or rights consistent with this
361
-
362
- License. However, in accepting such obligations, You may act only
363
-
364
- on Your own behalf and on Your sole responsibility, not on behalf
365
-
366
- of any other Contributor, and only if You agree to indemnify,
367
-
368
- defend, and hold each Contributor harmless for any liability
369
-
370
- incurred by, or claims asserted against, such Contributor by reason
371
-
372
- of your accepting any such warranty or additional liability.
373
-
374
-
375
-
376
-
377
- END OF TERMS AND CONDITIONS
378
-
379
-
380
-
381
-
382
- APPENDIX: How to apply the Apache License to your work.
383
-
384
-
385
-
386
-
387
- To apply the Apache License to your work, attach the following
388
-
389
- boilerplate notice, with the fields enclosed by brackets "{}"
390
-
391
- replaced with your own identifying information. (Don't include
392
-
393
- the brackets!) The text should be enclosed in the appropriate
394
-
395
- comment syntax for the file format. We also recommend that a
396
-
397
- file or class name and description of purpose be included on the
398
-
399
- same "printed page" as the copyright notice for easier
400
-
401
- identification within third-party archives.
402
-
403
-
404
-
405
-
406
- Copyright (C) 2017 Beijing Didi Infinity Technology and Development Co.,Ltd. All rights reserved.
407
-
408
-
409
-
410
-
411
- Licensed under the Apache License, Version 2.0 (the "License");
412
-
413
- you may not use this file except in compliance with the License.
414
-
415
- You may obtain a copy of the License at
416
-
417
-
418
-
419
-
420
- http://www.apache.org/licenses/LICENSE-2.0
421
-
422
-
423
-
424
-
425
- Unless required by applicable law or agreed to in writing, software
426
-
427
- distributed under the License is distributed on an "AS IS" BASIS,
428
-
429
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
430
-
431
- See the License for the specific language governing permissions and
432
-
433
- limitations under the License.