@conecli/cone-render 0.8.15-beta.29 → 0.8.15-beta.30

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.
@@ -1 +1 @@
1
- import React, { useCallback, useEffect, useRef, useState } from 'react'
2
1
  const [componentShowState, setComponentShowState] = useState(false)
3
2
  const componentLazyRef = useRef<HTMLElement | null>(null)
4
3
  const componentShowStateRef = useRef(false)
5
4
  useEffect(() => {
6
5
  const latestRes = latestFromNativeMsgStorage[TaroEventType.PAGE_SCROLL] || {}
7
6
  !componentShowStateRef.current && dealPageScrollInfo(latestRes)
8
7
  Taro.eventCenter.on(TaroEventType.PAGE_SCROLL, (res) => {
9
8
  !componentShowStateRef.current && dealPageScrollInfo(res)
10
9
  })
11
10
 
12
11
 
13
12
  src,
14
13
  <View
15
14
  ref={componentLazyRef}
16
15
  className={classNames(
17
16
  imageStyle['d-app-lazy-image'],
18
17
  {
19
18
  [imageStyle['d-lazy-sku-image']]: isSkuImage,
20
19
  },
21
20
  {
22
21
  [imageStyle['d-hide-image-error']]: imageErrState,
23
22
  },
24
23
  {
25
24
  [imageStyle['d-load-completed']]: loadSuccess,
26
25
  },
27
26
  {
28
27
  'd-imag-rendering-crisp-edges':
29
28
  !taroJdBaseInfo.info.pageInfo.isVipShop &&
30
29
  imagRenderingSet,
31
30
  },
32
31
  'J_html5ImageBg',
33
32
  className,
34
33
  )}
35
34
  style={{
36
35
  ...style,
37
36
  ...changeStyleIncludeWidthAndHeightAndBgColor(),
38
37
  }}
39
38
  >
40
39
  {componentShowState && <img
41
40
  src={getQualityImage(
42
41
  imgSrc,
43
42
  taroJdBaseInfo.info.pageInfo.isVipShop
44
43
  ? NetWorkTypeQuality['perfect']
45
44
  : NetWorkTypeQuality[getNetWorkType],
46
45
  )}
47
46
  onLoad={imageLoad.bind(this, imgSrc)}
48
47
  onError={imageError}
49
48
  />}
50
49
  </View>
51
50
  ) : (
52
51
  <Image
53
52
  style={{
54
53
  ...style,
55
54
  ...changeStyleIncludeWidthAndHeightAndBgColor(),
56
55
  }}
57
56
  className={classNames(
58
57
  imageStyle['d-lazy-image'],
59
58
  {
60
59
  [imageStyle['d-lazy-sku-image']]: isSkuImage,
61
60
  },
62
61
  {
63
62
  [imageStyle['d-hide-image-error']]: imageErrState,
64
63
  },
65
64
  {
66
65
  [imageStyle['d-load-completed']]: loadSuccess,
67
66
  },
68
67
  {
69
68
  'd-imag-rendering-crisp-edges': imagRenderingSet,
70
69
  },
71
70
  className,
72
71
  )}
73
72
  src={getQualityImage(
74
73
  imgSrc,
75
74
  NetWorkTypeQuality[getNetWorkType],
76
75
  )}
77
76
  lazyLoad={lazyLoad}
78
77
  onError={imageError}
79
78
  onLoad={imageLoad.bind(this, imgSrc)}
80
79
  {...otherOption}
81
80
  />
82
81
  )
82
+ import React, { useCallback, useEffect, useRef, useState } from 'react'
83
83
  const [componentShowState, setComponentShowState] = useState(false)
84
84
  const componentLazyRef = useRef<HTMLElement | null>(null)
85
85
  const componentShowStateRef = useRef(false)
86
86
  useEffect(() => {
87
87
  const latestRes = latestFromNativeMsgStorage[TaroEventType.PAGE_SCROLL] || {}
88
88
  !componentShowStateRef.current && dealPageScrollInfo(latestRes)
89
89
  Taro.eventCenter.on(TaroEventType.PAGE_SCROLL, (res) => {
90
90
  !componentShowStateRef.current && dealPageScrollInfo(res)
91
91
  })
92
92
 
93
93
 
94
94
  <View
95
95
  ref={componentLazyRef}
96
96
  className={classNames(
97
97
  imageStyle['d-app-lazy-image'],
98
98
  {
99
99
  [imageStyle['d-lazy-sku-image']]: isSkuImage,
100
100
  },
101
101
  {
102
102
  [imageStyle['d-hide-image-error']]: imageErrState,
103
103
  },
104
104
  {
105
105
  [imageStyle['d-load-completed']]: loadSuccess,
106
106
  },
107
107
  {
108
108
  'd-imag-rendering-crisp-edges':
109
109
  !taroJdBaseInfo.info.pageInfo.isVipShop &&
110
110
  imagRenderingSet,
111
111
  },
112
112
  'J_html5ImageBg',
113
113
  className,
114
114
  )}
115
115
  style={{
116
116
  ...style,
117
117
  ...changeStyleIncludeWidthAndHeightAndBgColor(),
118
118
  }}
119
119
  >
120
120
  {componentShowState && <img
121
121
  src={getQualityImage(
122
122
  imgSrc,
123
123
  taroJdBaseInfo.info.pageInfo.isVipShop
124
124
  ? NetWorkTypeQuality['perfect']
125
125
  : NetWorkTypeQuality[getNetWorkType],
126
126
  )}
127
127
  onLoad={imageLoad.bind(this, imgSrc)}
128
128
  onError={imageError}
129
129
  />}
130
130
  </View>
131
131
  ) : (
132
132
  <Image
133
133
  style={{
134
134
  ...style,
135
135
  ...changeStyleIncludeWidthAndHeightAndBgColor(),
136
136
  }}
137
137
  className={classNames(
138
138
  imageStyle['d-lazy-image'],
139
139
  {
140
140
  [imageStyle['d-lazy-sku-image']]: isSkuImage,
141
141
  },
142
142
  {
143
143
  [imageStyle['d-hide-image-error']]: imageErrState,
144
144
  },
145
145
  {
146
146
  [imageStyle['d-load-completed']]: loadSuccess,
147
147
  },
148
148
  {
149
149
  'd-imag-rendering-crisp-edges': imagRenderingSet,
150
150
  },
151
151
  className,
152
152
  )}
153
153
  src={getQualityImage(
154
154
  imgSrc,
155
155
  NetWorkTypeQuality[getNetWorkType],
156
156
  )}
157
157
  lazyLoad={lazyLoad}
158
158
  onError={imageError}
159
159
  onLoad={imageLoad.bind(this, imgSrc)}
160
160
  {...otherOption}
161
161
  />
162
162
  )
@@ -1 +1 @@
1
- import React, { Suspense, lazy } from 'react'
1
+ import React, { Suspense, lazy } from 'react'
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@conecli/cone-render",
3
- "version": "0.8.15-beta.29",
3
+ "version": "0.8.15-beta.30",
4
4
  "private": false,
5
5
  "files": [
6
6
  "dist/"