@mpxjs/webpack-plugin 2.10.22 → 2.10.24-test.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 (123) hide show
  1. package/lib/loader.js +2 -0
  2. package/lib/platform/style/wx/index.js +395 -104
  3. package/lib/react/index.js +3 -1
  4. package/lib/react/processTemplate.js +3 -1
  5. package/lib/react/style-helper.js +6 -6
  6. package/lib/runtime/components/react/animationHooks/index.ts +7 -3
  7. package/lib/runtime/components/react/dist/animationHooks/index.d.ts +0 -2
  8. package/lib/runtime/components/react/dist/animationHooks/index.js +6 -1
  9. package/lib/runtime/components/react/dist/event.config.d.ts +2 -6
  10. package/lib/runtime/components/react/dist/event.config.js +28 -24
  11. package/lib/runtime/components/react/dist/getInnerListeners.d.ts +1 -1
  12. package/lib/runtime/components/react/dist/getInnerListeners.js +74 -56
  13. package/lib/runtime/components/react/dist/mpx-button.d.ts +1 -1
  14. package/lib/runtime/components/react/dist/mpx-button.jsx +16 -9
  15. package/lib/runtime/components/react/dist/mpx-camera.d.ts +0 -1
  16. package/lib/runtime/components/react/dist/mpx-camera.jsx +1 -2
  17. package/lib/runtime/components/react/dist/mpx-canvas/index.d.ts +0 -1
  18. package/lib/runtime/components/react/dist/mpx-canvas/index.jsx +1 -2
  19. package/lib/runtime/components/react/dist/mpx-canvas/utils.d.ts +1 -1
  20. package/lib/runtime/components/react/dist/mpx-checkbox-group.d.ts +0 -1
  21. package/lib/runtime/components/react/dist/mpx-checkbox-group.jsx +3 -4
  22. package/lib/runtime/components/react/dist/mpx-checkbox.d.ts +1 -1
  23. package/lib/runtime/components/react/dist/mpx-checkbox.jsx +8 -9
  24. package/lib/runtime/components/react/dist/mpx-form.d.ts +1 -1
  25. package/lib/runtime/components/react/dist/mpx-form.jsx +5 -5
  26. package/lib/runtime/components/react/dist/mpx-icon/index.d.ts +0 -1
  27. package/lib/runtime/components/react/dist/mpx-icon/index.jsx +2 -2
  28. package/lib/runtime/components/react/dist/mpx-image.d.ts +0 -1
  29. package/lib/runtime/components/react/dist/mpx-image.jsx +59 -43
  30. package/lib/runtime/components/react/dist/mpx-input.d.ts +0 -1
  31. package/lib/runtime/components/react/dist/mpx-input.jsx +2 -2
  32. package/lib/runtime/components/react/dist/mpx-label.d.ts +1 -1
  33. package/lib/runtime/components/react/dist/mpx-label.jsx +5 -6
  34. package/lib/runtime/components/react/dist/mpx-movable-area.d.ts +0 -1
  35. package/lib/runtime/components/react/dist/mpx-movable-area.jsx +3 -3
  36. package/lib/runtime/components/react/dist/mpx-movable-view.d.ts +1 -1
  37. package/lib/runtime/components/react/dist/mpx-movable-view.jsx +6 -6
  38. package/lib/runtime/components/react/dist/mpx-picker-view/index.d.ts +1 -1
  39. package/lib/runtime/components/react/dist/mpx-picker-view/index.jsx +5 -7
  40. package/lib/runtime/components/react/dist/mpx-picker-view-column/index.d.ts +0 -1
  41. package/lib/runtime/components/react/dist/mpx-picker-view-column/index.jsx +2 -2
  42. package/lib/runtime/components/react/dist/mpx-progress.d.ts +0 -1
  43. package/lib/runtime/components/react/dist/mpx-progress.jsx +1 -2
  44. package/lib/runtime/components/react/dist/mpx-radio-group.d.ts +0 -1
  45. package/lib/runtime/components/react/dist/mpx-radio-group.jsx +3 -4
  46. package/lib/runtime/components/react/dist/mpx-radio.d.ts +1 -1
  47. package/lib/runtime/components/react/dist/mpx-radio.jsx +8 -9
  48. package/lib/runtime/components/react/dist/mpx-rich-text/index.d.ts +0 -1
  49. package/lib/runtime/components/react/dist/mpx-rich-text/index.jsx +1 -2
  50. package/lib/runtime/components/react/dist/mpx-scroll-view.d.ts +1 -1
  51. package/lib/runtime/components/react/dist/mpx-scroll-view.jsx +6 -6
  52. package/lib/runtime/components/react/dist/mpx-simple-text.jsx +36 -31
  53. package/lib/runtime/components/react/dist/mpx-simple-view.d.ts +4 -2
  54. package/lib/runtime/components/react/dist/mpx-simple-view.jsx +24 -17
  55. package/lib/runtime/components/react/dist/mpx-slider.d.ts +0 -1
  56. package/lib/runtime/components/react/dist/mpx-slider.jsx +6 -6
  57. package/lib/runtime/components/react/dist/mpx-sticky-header.d.ts +1 -1
  58. package/lib/runtime/components/react/dist/mpx-sticky-header.jsx +5 -5
  59. package/lib/runtime/components/react/dist/mpx-sticky-section.d.ts +1 -1
  60. package/lib/runtime/components/react/dist/mpx-sticky-section.jsx +6 -6
  61. package/lib/runtime/components/react/dist/mpx-swiper-item.d.ts +1 -1
  62. package/lib/runtime/components/react/dist/mpx-swiper-item.jsx +5 -5
  63. package/lib/runtime/components/react/dist/mpx-swiper.d.ts +1 -1
  64. package/lib/runtime/components/react/dist/mpx-swiper.jsx +4 -7
  65. package/lib/runtime/components/react/dist/mpx-switch.d.ts +0 -1
  66. package/lib/runtime/components/react/dist/mpx-switch.jsx +1 -2
  67. package/lib/runtime/components/react/dist/mpx-text.d.ts +0 -1
  68. package/lib/runtime/components/react/dist/mpx-text.jsx +44 -40
  69. package/lib/runtime/components/react/dist/mpx-video.d.ts +0 -1
  70. package/lib/runtime/components/react/dist/mpx-video.jsx +4 -4
  71. package/lib/runtime/components/react/dist/mpx-view.d.ts +2 -1
  72. package/lib/runtime/components/react/dist/mpx-view.jsx +229 -128
  73. package/lib/runtime/components/react/dist/mpx-web-view.jsx +5 -1
  74. package/lib/runtime/components/react/dist/namedColorSet.d.ts +2 -0
  75. package/lib/runtime/components/react/dist/namedColorSet.js +149 -0
  76. package/lib/runtime/components/react/dist/utils.d.ts +73 -69
  77. package/lib/runtime/components/react/dist/utils.jsx +1295 -442
  78. package/lib/runtime/components/react/event.config.ts +32 -25
  79. package/lib/runtime/components/react/getInnerListeners.ts +84 -60
  80. package/lib/runtime/components/react/mpx-button.tsx +18 -16
  81. package/lib/runtime/components/react/mpx-camera.tsx +0 -3
  82. package/lib/runtime/components/react/mpx-canvas/index.tsx +1 -3
  83. package/lib/runtime/components/react/mpx-canvas/utils.tsx +3 -1
  84. package/lib/runtime/components/react/mpx-checkbox-group.tsx +2 -6
  85. package/lib/runtime/components/react/mpx-checkbox.tsx +9 -11
  86. package/lib/runtime/components/react/mpx-form.tsx +6 -6
  87. package/lib/runtime/components/react/mpx-icon/index.tsx +1 -3
  88. package/lib/runtime/components/react/mpx-image.tsx +65 -54
  89. package/lib/runtime/components/react/mpx-input.tsx +1 -3
  90. package/lib/runtime/components/react/mpx-label.tsx +6 -8
  91. package/lib/runtime/components/react/mpx-movable-area.tsx +3 -4
  92. package/lib/runtime/components/react/mpx-movable-view.tsx +7 -7
  93. package/lib/runtime/components/react/mpx-picker-view/index.tsx +6 -8
  94. package/lib/runtime/components/react/mpx-picker-view-column/index.tsx +2 -4
  95. package/lib/runtime/components/react/mpx-progress.tsx +0 -3
  96. package/lib/runtime/components/react/mpx-radio-group.tsx +2 -6
  97. package/lib/runtime/components/react/mpx-radio.tsx +9 -11
  98. package/lib/runtime/components/react/mpx-rich-text/index.tsx +0 -3
  99. package/lib/runtime/components/react/mpx-scroll-view.tsx +7 -7
  100. package/lib/runtime/components/react/mpx-simple-text.tsx +36 -38
  101. package/lib/runtime/components/react/mpx-simple-view.tsx +29 -17
  102. package/lib/runtime/components/react/mpx-slider.tsx +15 -10
  103. package/lib/runtime/components/react/mpx-sticky-header.tsx +6 -6
  104. package/lib/runtime/components/react/mpx-sticky-section.tsx +7 -7
  105. package/lib/runtime/components/react/mpx-swiper-item.tsx +6 -6
  106. package/lib/runtime/components/react/mpx-swiper.tsx +5 -8
  107. package/lib/runtime/components/react/mpx-switch.tsx +0 -3
  108. package/lib/runtime/components/react/mpx-text.tsx +46 -49
  109. package/lib/runtime/components/react/mpx-video.tsx +3 -5
  110. package/lib/runtime/components/react/mpx-view.tsx +250 -141
  111. package/lib/runtime/components/react/mpx-web-view.tsx +8 -3
  112. package/lib/runtime/components/react/namedColorSet.ts +150 -0
  113. package/lib/runtime/components/react/types/getInnerListeners.d.ts +21 -1
  114. package/lib/runtime/components/react/types/global.d.ts +1 -0
  115. package/lib/runtime/components/react/utils.tsx +1347 -539
  116. package/lib/runtime/i18n.wxs +15 -9
  117. package/lib/style-compiler/strip-conditional.js +19 -4
  118. package/lib/template-compiler/compiler.js +5 -1
  119. package/lib/utils/source-location.js +9 -13
  120. package/lib/web/index.js +3 -1
  121. package/lib/web/processTemplate.js +3 -1
  122. package/package.json +5 -4
  123. package/LICENSE +0 -433
@@ -217,15 +217,16 @@ function parsePath (pathStr) {
217
217
  property = ''
218
218
  }
219
219
 
220
+ if (pathStr.indexOf('[') === -1 && pathStr.indexOf(']') === -1) {
221
+ // 对于简单数据路径,直接分割,避免无意义的解析
222
+ return pathStr.split('.')
223
+ }
224
+
220
225
  var curStack = genStack()
221
226
  var targetStacks = []
222
227
  var property = ''
223
228
  var index = 0
224
229
 
225
- if (genRegExp('^[^[]]+$').test(pathStr)) {
226
- // 对于简单数据路径,直接分割,避免无意义的解析
227
- return pathStr.split('.')
228
- }
229
230
  while (index < pathStr.length) {
230
231
  var char = pathStr[index]
231
232
  // 当前遍历引号内的字符串时
@@ -271,11 +272,16 @@ function getMessage (messages, locale, fallbackLocale, key) {
271
272
 
272
273
  function resolve (messages, locale, key) {
273
274
  if (messages && messages[locale] && key) {
274
- var format = getPathValue(messages[locale], key)
275
- if (format == null) {
276
- format = messages[locale][key]
277
- }
278
- return format
275
+ var localeMessages = messages[locale]
276
+ // 优先按「字面量 key」直查:形如 "1000+ reviews" 的扁平 key 含 '+',若先走 getPathValue
277
+ // 会被 parsePath 当成算术表达式求值('1000' + undefined = NaN),导致翻译失败。
278
+ // 字面量命中即返回,未命中再交给 getPathValue 解析嵌套路径(如 "nav.home")。
279
+ // 注意:这会让「扁平 key 与同名嵌套路径冲突」时由 nested 优先变为 flat 优先。
280
+ if (isDef(localeMessages[key])) return localeMessages[key]
281
+ var format = getPathValue(localeMessages, key)
282
+ // 含 '+' 的 key 在当前语言缺失时,getPathValue 仍可能返回 NaN。NaN 会被 isDef 当成
283
+ // 「已定义」而中断 getMessage 的 fallback,故归一成 undefined 以保留回退(format !== format 仅 NaN 成立)。
284
+ return format !== format ? undefined : format
279
285
  }
280
286
  }
281
287
 
@@ -13,11 +13,26 @@ class Node {
13
13
  function keepLines(content) {
14
14
  return content.replace(/([^\r\n]*)(\r\n|\r|\n|$)/g, (all, line, lineBreak) => {
15
15
  if (!all) return ''
16
+ // 空行 / 纯空白行直接保留换行:directive 自身被 blankDirective 抹平后,
17
+ // 其前后 text token 里夹缝 \n 形成的"空行"如果再放占位注释,会变成 col 0 的
18
+ // /* mpx-style-pad-placeholder */,破坏 stylus / sass 的 indent 结构。
19
+ // 这里产生的连续空行最多只有 directive 链长度量级(个位数),远低于 stylus
20
+ // lexer 栈溢出阈值,安全。
21
+ if (!line.trim()) return lineBreak
16
22
  const indent = (/^[ \t]*/.exec(line) || [''])[0]
17
23
  return `${indent}/* ${STYLE_PAD_PLACEHOLDER} */${lineBreak}`
18
24
  })
19
25
  }
20
26
 
27
+ // 仅保留换行、清掉所有非换行字符,让条件编译指令本身的列位置在
28
+ // 缩进敏感的预处理器(stylus / sass)中完全透明。
29
+ // 不能直接把整段都换成空行 —— stylus 的 lexer 在遇到大量连续空行时
30
+ // 会递归判定 outdent 层级,触发调用栈溢出;因此被剥离的"内容"仍走
31
+ // keepLines 走占位注释,只让"指令"这一行(通常 1 行)变成空行。
32
+ function blankDirective(content) {
33
+ return content.replace(/[^\r\n]+/g, '')
34
+ }
35
+
21
36
  // 提取 css string 为 token
22
37
  function tokenize(cssString) {
23
38
  // Support /* ... */, // ..., and <!-- ... --> styles
@@ -123,22 +138,22 @@ function traverseAndEvaluate(ast, defs) {
123
138
  output += active ? node.value : keepLines(node.value)
124
139
  } else if (node.type === 'If') {
125
140
  // 直接判断 If 节点
126
- output += keepLines(node.value)
141
+ output += blankDirective(node.value)
127
142
  const currentMatched = active && evaluateCondition(node.condition, defs)
128
143
  output += traverse(node.children, currentMatched)
129
144
  batchedIf = currentMatched
130
145
  } else if (node.type === 'ElseIf') {
131
- output += keepLines(node.value)
146
+ output += blankDirective(node.value)
132
147
  const currentMatched = active && !batchedIf && evaluateCondition(node.condition, defs)
133
148
  output += traverse(node.children, currentMatched)
134
149
  batchedIf = batchedIf || currentMatched
135
150
  } else if (node.type === 'Else') {
136
- output += keepLines(node.value)
151
+ output += blankDirective(node.value)
137
152
  const currentMatched = active && !batchedIf
138
153
  output += traverse(node.children, currentMatched)
139
154
  batchedIf = true
140
155
  } else if (node.type === 'EndIf') {
141
- output += keepLines(node.value)
156
+ output += blankDirective(node.value)
142
157
  }
143
158
  }
144
159
  return output
@@ -849,9 +849,13 @@ function parse (template, options) {
849
849
  })
850
850
 
851
851
  if (!tagNames.has('component') && !tagNames.has('template') && options.checkUsingComponents) {
852
+ // usingComponents 与 tagNames 均为 rulesRunner 处理后的名字(capitalToHyphen / mpx-com- 前缀已对齐),
853
+ // 反向排除 globalComponents 以避免对仅在 app 注册的组件误报「未使用」
854
+ const globalComponents = options.globalComponents || []
855
+ const componentPlaceholder = options.componentPlaceholder || []
852
856
  const arr = []
853
857
  usingComponents.forEach((item) => {
854
- if (!tagNames.has(item) && !options.globalComponents.includes(item) && !options.componentPlaceholder.includes(item)) {
858
+ if (!tagNames.has(item) && !globalComponents.includes(item) && !componentPlaceholder.includes(item)) {
855
859
  arr.push(item)
856
860
  }
857
861
  })
@@ -1,6 +1,10 @@
1
1
  const path = require('path')
2
2
  const { codeFrameColumns } = require('@babel/code-frame')
3
- const { SourceMapConsumer } = require('source-map')
3
+ const {
4
+ TraceMap,
5
+ originalPositionFor: traceOriginalPositionFor,
6
+ sourceContentFor
7
+ } = require('@jridgewell/trace-mapping')
4
8
 
5
9
  function offsetToPosition (source, offset) {
6
10
  const before = source.slice(0, offset)
@@ -45,25 +49,17 @@ function createCodeFrame (source, loc) {
45
49
  function originalPositionFor (map, loc) {
46
50
  loc = normalizeLoc(loc)
47
51
  if (!map || !loc || !loc.start) return
48
- if (typeof map === 'string') {
49
- try {
50
- map = JSON.parse(map)
51
- } catch (e) {
52
- return
53
- }
54
- }
55
- let consumer
52
+ let tracer
56
53
  try {
57
- consumer = new SourceMapConsumer(map)
54
+ tracer = new TraceMap(map)
58
55
  } catch (e) {
59
56
  return
60
57
  }
61
- const original = consumer.originalPositionFor({
58
+ const original = traceOriginalPositionFor(tracer, {
62
59
  line: loc.start.line,
63
60
  column: Math.max((loc.start.column || 1) - 1, 0)
64
61
  })
65
62
  if (!original || !original.source || !original.line) return
66
- const sourceIndex = map.sources && map.sources.indexOf(original.source)
67
63
  return {
68
64
  file: original.source,
69
65
  loc: {
@@ -72,7 +68,7 @@ function originalPositionFor (map, loc) {
72
68
  column: (original.column || 0) + 1
73
69
  }
74
70
  },
75
- source: sourceIndex > -1 && map.sourcesContent && map.sourcesContent[sourceIndex],
71
+ source: sourceContentFor(tracer, original.source) || undefined,
76
72
  generatedLoc: loc
77
73
  }
78
74
  }
package/lib/web/index.js CHANGED
@@ -23,6 +23,7 @@ module.exports = function ({
23
23
  usingComponentsInfo,
24
24
  originalUsingComponents,
25
25
  componentGenerics,
26
+ componentPlaceholder,
26
27
  autoScope,
27
28
  callback
28
29
  }) {
@@ -72,7 +73,8 @@ module.exports = function ({
72
73
  ctorType,
73
74
  usingComponentsInfo,
74
75
  originalUsingComponents,
75
- componentGenerics
76
+ componentGenerics,
77
+ componentPlaceholder
76
78
  }, callback)
77
79
  },
78
80
  (callback) => {
@@ -15,7 +15,8 @@ module.exports = function (template, {
15
15
  ctorType,
16
16
  usingComponentsInfo,
17
17
  originalUsingComponents,
18
- componentGenerics
18
+ componentGenerics,
19
+ componentPlaceholder
19
20
  }, callback) {
20
21
  const mpx = loaderContext.getMpx()
21
22
  const {
@@ -99,6 +100,7 @@ module.exports = function (template, {
99
100
  i18n: null,
100
101
  // 与 template-compiler/index 一致:usingComponentsInfo 已合并 globalComponentsInfo,此处白名单避免对仅 app 注册的组件误报「未使用」
101
102
  globalComponents: Object.keys(globalComponents || {}),
103
+ componentPlaceholder,
102
104
  // web模式下实现抽象组件
103
105
  componentGenerics,
104
106
  hasVirtualHost,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mpxjs/webpack-plugin",
3
- "version": "2.10.22",
3
+ "version": "2.10.24-test.1",
4
4
  "description": "mpx compile core",
5
5
  "keywords": [
6
6
  "mpx"
@@ -28,7 +28,8 @@
28
28
  "@better-scroll/slide": "^2.5.1",
29
29
  "@better-scroll/wheel": "^2.5.1",
30
30
  "@better-scroll/zoom": "^2.5.1",
31
- "@mpxjs/perf": "^2.10.22",
31
+ "@jridgewell/trace-mapping": "^0.3.25",
32
+ "@mpxjs/perf": "^2.10.24",
32
33
  "@mpxjs/template-engine": "^2.8.7",
33
34
  "@mpxjs/utils": "^2.10.21",
34
35
  "acorn": "^8.11.3",
@@ -106,7 +107,7 @@
106
107
  "react-native-svg": "^15.8.0",
107
108
  "react-native-video": "^6.9.0",
108
109
  "react-native-vision-camera": "^4.7.2",
109
- "react-native-webview": "^13.12.2",
110
+ "react-native-webview": "^13.17.0",
110
111
  "rimraf": "^6.0.1",
111
112
  "vue": "^2.7.16",
112
113
  "webpack": "^5.75.0"
@@ -114,5 +115,5 @@
114
115
  "engines": {
115
116
  "node": ">=14.14.0"
116
117
  },
117
- "gitHead": "7328bd1e5d833ddac5130982c9565d17ada55d1b"
118
+ "gitHead": "2d37697869b9bdda3efab92dda8c910b68fd05c0"
118
119
  }
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.