@mpxjs/core 2.10.2 → 2.10.3-beta.4

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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mpxjs/core",
3
- "version": "2.10.2",
3
+ "version": "2.10.3-beta.4",
4
4
  "description": "mpx runtime core",
5
5
  "keywords": [
6
6
  "miniprogram",
@@ -109,5 +109,5 @@
109
109
  "url": "https://github.com/didi/mpx/issues"
110
110
  },
111
111
  "sideEffects": false,
112
- "gitHead": "4445de7c3ce29fb0166d3bb77a1a0460e41a32d3"
112
+ "gitHead": "2d37697869b9bdda3efab92dda8c910b68fd05c0"
113
113
  }
@@ -37,7 +37,8 @@ const rulesMap = {
37
37
  wxToDd: extend({}, defaultConvertRule, wxToDdRule),
38
38
  wxToJd: extend({}, defaultConvertRule, wxToJdRule),
39
39
  wxToIos: extend({}, defaultConvertRule, wxToReactRule),
40
- wxToAndroid: extend({}, defaultConvertRule, wxToReactRule)
40
+ wxToAndroid: extend({}, defaultConvertRule, wxToReactRule),
41
+ wxToHarmony: extend({}, defaultConvertRule, wxToReactRule)
41
42
  }
42
43
 
43
44
  export function getConvertRule (convertMode) {
@@ -7,7 +7,8 @@ const convertModes = {
7
7
  'wx-jd': 'wxToJd',
8
8
  'wx-dd': 'wxToDd',
9
9
  'wx-ios': 'wxToIos',
10
- 'wx-android': 'wxToAndroid'
10
+ 'wx-android': 'wxToAndroid',
11
+ 'wx-harmony': 'wxToHarmony'
11
12
  }
12
13
 
13
14
  export function getConvertMode (srcMode) {
@@ -18,6 +18,10 @@ export default function transferOptions (options, type, needConvert = true) {
18
18
  if (!options.__nativeRender__) {
19
19
  options = mergeInjectedMixins(options, type)
20
20
  }
21
+ if (currentInject && currentInject.injectProperties) {
22
+ // 编译属性注入
23
+ options.properties = Object.assign({}, currentInject.injectProperties, options.properties)
24
+ }
21
25
  if (currentInject && currentInject.injectComputed) {
22
26
  // 编译计算属性注入
23
27
  options.computed = Object.assign({}, currentInject.injectComputed, options.computed)
@@ -1,3 +1,4 @@
1
+ import { isReact } from '@mpxjs/utils'
1
2
  import pageStatusMixin from './pageStatusMixin'
2
3
  import proxyEventMixin from './proxyEventMixin'
3
4
  import renderHelperMixin from './renderHelperMixin'
@@ -17,7 +18,7 @@ import pageIdMixin from './pageIdMixin'
17
18
 
18
19
  export default function getBuiltInMixins ({ type, rawOptions = {} }) {
19
20
  let bulitInMixins
20
- if (__mpx_mode__ === 'ios' || __mpx_mode__ === 'android') {
21
+ if (isReact) {
21
22
  bulitInMixins = [
22
23
  proxyEventMixin(),
23
24
  directiveHelperMixin(),
@@ -195,7 +195,14 @@ export default function styleHelperMixin () {
195
195
 
196
196
  if (hide) {
197
197
  Object.assign(result, {
198
- display: 'none'
198
+ // display: 'none'
199
+ // RN下display:'none'容易引发未知异常问题,使用布局样式模拟
200
+ flex: 0,
201
+ height: 0,
202
+ width: 0,
203
+ padding: 0,
204
+ margin: 0,
205
+ overflow: 'hidden'
199
206
  })
200
207
  }
201
208
 
@@ -10,8 +10,8 @@ import { initAppProvides } from './export/inject'
10
10
 
11
11
  const appHooksMap = makeMap(mergeLifecycle(LIFECYCLE).app)
12
12
 
13
- function getOrientation (window = ReactNative.Dimensions.get('window')) {
14
- return window.width > window.height ? 'landscape' : 'portrait'
13
+ function getPageSize (window = ReactNative.Dimensions.get('window')) {
14
+ return window.width + 'x' + window.height
15
15
  }
16
16
 
17
17
  function filterOptions (options, appData) {
@@ -56,16 +56,22 @@ export default function createApp (options) {
56
56
  const Stack = createStackNavigator()
57
57
  const getPageScreens = (initialRouteName, initialParams) => {
58
58
  return Object.entries(pages).map(([key, item]) => {
59
+ const options = {
60
+ // __mpxPageStatusMap 为编译注入的全局变量
61
+ headerShown: !(Object.assign({}, global.__mpxPageConfig, global.__mpxPageConfigsMap[key]).navigationStyle === 'custom')
62
+ }
59
63
  if (key === initialRouteName) {
60
64
  return createElement(Stack.Screen, {
61
65
  name: key,
62
66
  component: item,
63
- initialParams
67
+ initialParams,
68
+ options
64
69
  })
65
70
  }
66
71
  return createElement(Stack.Screen, {
67
72
  name: key,
68
- component: item
73
+ component: item,
74
+ options
69
75
  })
70
76
  })
71
77
  }
@@ -154,7 +160,9 @@ export default function createApp (options) {
154
160
  }
155
161
  } else if (currentState === 'inactive' || currentState === 'background') {
156
162
  global.__mpxAppCbs.hide.forEach((cb) => {
157
- cb()
163
+ cb({
164
+ reason: 3
165
+ })
158
166
  })
159
167
  const navigation = getFocusedNavigation()
160
168
  if (navigation && hasOwn(global.__mpxPageStatusMap, navigation.pageId)) {
@@ -164,17 +172,23 @@ export default function createApp (options) {
164
172
  })
165
173
 
166
174
  let count = 0
167
- let lastOrientation = getOrientation()
175
+ let lastPageSize = getPageSize()
168
176
  const resizeSubScription = ReactNative.Dimensions.addEventListener('change', ({ window }) => {
169
- const orientation = getOrientation(window)
170
- if (orientation === lastOrientation) return
171
- lastOrientation = orientation
177
+ const pageSize = getPageSize(window)
178
+ if (pageSize === lastPageSize) return
179
+ lastPageSize = pageSize
172
180
  const navigation = getFocusedNavigation()
173
181
  if (navigation && hasOwn(global.__mpxPageStatusMap, navigation.pageId)) {
174
182
  global.__mpxPageStatusMap[navigation.pageId] = `resize${count++}`
175
183
  }
176
184
  })
177
185
  return () => {
186
+ // todo 跳到原生页面或者其他rn bundle可以考虑使用reason 1/2进行模拟抹平
187
+ global.__mpxAppCbs.hide.forEach((cb) => {
188
+ cb({
189
+ reason: 0
190
+ })
191
+ })
178
192
  changeSubscription && changeSubscription.remove()
179
193
  resizeSubScription && resizeSubScription.remove()
180
194
  }
@@ -186,6 +200,9 @@ export default function createApp (options) {
186
200
  // headerBackButtonDisplayMode: 'minimal',
187
201
  headerBackTitleVisible: false,
188
202
  headerShadowVisible: false
203
+ // 整体切换native-stack时进行修改如下
204
+ // statusBarTranslucent: true,
205
+ // statusBarBackgroundColor: 'transparent'
189
206
  }
190
207
  if (__mpx_mode__ === 'ios') {
191
208
  // ios使用native-stack
@@ -194,8 +211,8 @@ export default function createApp (options) {
194
211
  navScreenOpts.headerBackImageSource = headerBackImageSource
195
212
  }
196
213
  } else {
197
- // 安卓上会出现导航条闪现的问题所以默认加headerShown false(stack版本, native-stack版本可以干掉)
198
- // iOS加上默认headerShown false的话会因为iOS根高度是screenHeight - useHeaderHeight()会导致出现渲染两次情况,因此iOS不加此默认值
214
+ // 安卓上会出现导航条闪现的问题所以默认加headerShown false(stack版本, native-stack版本可以干掉)
215
+ // iOS加上默认headerShown false的话会因为iOS根高度是screenHeight - useHeaderHeight()会导致出现渲染两次情况,因此iOS不加此默认值
199
216
  navScreenOpts.headerShown = false
200
217
  // 安卓和鸿蒙先用stack
201
218
  const headerBackImageProps = Mpx.config.rnConfig.headerBackImageProps || null
@@ -10,20 +10,19 @@ import mergeOptions from '../../core/mergeOptions'
10
10
  import { queueJob, hasPendingJob } from '../../observer/scheduler'
11
11
  import { createSelectorQuery, createIntersectionObserver } from '@mpxjs/api-proxy'
12
12
  import { IntersectionObserverContext, RouteContext, KeyboardAvoidContext } from '@mpxjs/webpack-plugin/lib/runtime/components/react/dist/context'
13
- import KeyboardAvoidingView from '@mpxjs/webpack-plugin/lib/runtime/components/react/dist/KeyboardAvoidingView'
13
+ import MpxKeyboardAvoidingView from '@mpxjs/webpack-plugin/lib/runtime/components/react/dist/mpx-keyboard-avoiding-view'
14
14
 
15
15
  const ProviderContext = createContext(null)
16
-
16
+ const windowDimensions = ReactNative.Dimensions.get('window')
17
+ const screenDimensions = ReactNative.Dimensions.get('screen')
17
18
  function getSystemInfo () {
18
- const window = ReactNative.Dimensions.get('window')
19
- const screen = ReactNative.Dimensions.get('screen')
20
19
  return {
21
- deviceOrientation: window.width > window.height ? 'landscape' : 'portrait',
20
+ deviceOrientation: windowDimensions.width > windowDimensions.height ? 'landscape' : 'portrait',
22
21
  size: {
23
- screenWidth: screen.width,
24
- screenHeight: screen.height,
25
- windowWidth: window.width,
26
- windowHeight: window.height
22
+ screenWidth: screenDimensions.width,
23
+ screenHeight: screenDimensions.height,
24
+ windowWidth: windowDimensions.width,
25
+ windowHeight: windowDimensions.height
27
26
  }
28
27
  }
29
28
  }
@@ -46,7 +45,9 @@ function createEffect (proxy, components) {
46
45
  if (!tagName) return null
47
46
  if (tagName === 'block') return Fragment
48
47
  const appComponents = global.__getAppComponents?.() || {}
49
- return components[tagName] || appComponents[tagName] || getByPath(ReactNative, tagName)
48
+ const generichash = proxy.target.generichash || ''
49
+ const genericComponents = global.__mpxGenericsMap[generichash] || noop
50
+ return components[tagName] || genericComponents(tagName) || appComponents[tagName] || getByPath(ReactNative, tagName)
50
51
  }
51
52
  const innerCreateElement = (type, ...rest) => {
52
53
  if (!type) return null
@@ -440,6 +441,8 @@ const checkRelation = (options) => {
440
441
  }
441
442
  }
442
443
 
444
+ // 临时用来存储安卓底部(iOS没有这个)的高度(虚拟按键等高度)根据第一次进入推算
445
+ let bottomVirtualHeight = null
443
446
  export function getDefaultOptions ({ type, rawOptions = {}, currentInject }) {
444
447
  rawOptions = mergeOptions(rawOptions, type, false)
445
448
  const components = Object.assign({}, rawOptions.components, currentInject.getComponents())
@@ -586,9 +589,7 @@ export function getDefaultOptions ({ type, rawOptions = {}, currentInject }) {
586
589
  })
587
590
  usePageStatus(navigation, currentPageId)
588
591
  useLayoutEffect(() => {
589
- const isCustom = pageConfig.navigationStyle === 'custom'
590
592
  navigation.setOptions({
591
- headerShown: !isCustom,
592
593
  title: pageConfig.navigationBarTitleText?.trim() || '',
593
594
  headerStyle: {
594
595
  backgroundColor: pageConfig.navigationBarBackgroundColor || '#000000'
@@ -596,29 +597,56 @@ export function getDefaultOptions ({ type, rawOptions = {}, currentInject }) {
596
597
  headerTintColor: pageConfig.navigationBarTextStyle || 'white'
597
598
  })
598
599
 
599
- if (__mpx_mode__ === 'android') {
600
+ // TODO 此部分内容在native-stack可删除,用setOptions设置
601
+ if (__mpx_mode__ === 'android' || __mpx_mode__ === 'harmony') {
600
602
  ReactNative.StatusBar.setBarStyle(pageConfig.barStyle || 'dark-content')
601
- ReactNative.StatusBar.setTranslucent(isCustom) // 控制statusbar是否占位
602
- const color = isCustom ? 'transparent' : pageConfig.statusBarColor
603
- color && ReactNative.StatusBar.setBackgroundColor(color)
603
+ ReactNative.StatusBar.setTranslucent(true) // 控制statusbar是否占位
604
+ ReactNative.StatusBar.setBackgroundColor('transparent')
604
605
  }
605
606
  }, [])
606
607
 
607
608
  const rootRef = useRef(null)
608
609
  const keyboardAvoidRef = useRef(null)
609
- useEffect(() => {
610
- setTimeout(() => {
611
- rootRef.current?.measureInWindow((x, y, width, height) => {
612
- navigation.layout = { x, y, width, height }
613
- })
614
- }, 100)
615
- }, [])
610
+ const headerHeight = useHeaderHeight()
611
+ const onLayout = () => {
612
+ if (__mpx_mode__ === 'ios') {
613
+ navigation.layout = {
614
+ x: 0,
615
+ y: headerHeight,
616
+ width: windowDimensions.width,
617
+ height: screenDimensions.height - headerHeight
618
+ }
619
+ } else {
620
+ if (bottomVirtualHeight === null) {
621
+ rootRef.current?.measureInWindow((height) => {
622
+ // 沉浸模式的计算方式
623
+ bottomVirtualHeight = screenDimensions.height - height - headerHeight
624
+ // 非沉浸模式(translucent=true)计算方式, 现在默认是全用沉浸模式,所以先不算这个
625
+ // bottomVirtualHeight = windowDimensions.height - height - headerHeight
626
+ navigation.layout = {
627
+ x: 0,
628
+ y: headerHeight,
629
+ width: windowDimensions.width,
630
+ height: height
631
+ }
632
+ })
633
+ } else {
634
+ navigation.layout = {
635
+ x: 0,
636
+ y: headerHeight, // 这个y值
637
+ width: windowDimensions.width,
638
+ // 后续页面的layout是通过第一次路由进入时候推算出来的底部区域来推算出来的
639
+ height: screenDimensions.height - bottomVirtualHeight - headerHeight
640
+ }
641
+ }
642
+ }
643
+ }
616
644
  const withKeyboardAvoidingView = (element) => {
617
645
  return createElement(KeyboardAvoidContext.Provider,
618
646
  {
619
647
  value: keyboardAvoidRef
620
648
  },
621
- createElement(KeyboardAvoidingView,
649
+ createElement(MpxKeyboardAvoidingView,
622
650
  {
623
651
  style: {
624
652
  flex: 1
@@ -652,7 +680,9 @@ export function getDefaultOptions ({ type, rawOptions = {}, currentInject }) {
652
680
  flex: 1,
653
681
  backgroundColor: pageConfig.backgroundColor || '#ffffff'
654
682
  },
655
- ref: rootRef
683
+ ref: rootRef,
684
+ // 测试过了 键盘拉起后不会重新触发onLayout
685
+ onLayout
656
686
  },
657
687
  createElement(RouteContext.Provider,
658
688
  {
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.