@conecli/cone-render 0.10.1-beta.8 → 0.10.1-beta.9

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 (34) hide show
  1. package/dist/common/const.ts +1 -1
  2. package/dist/common/index.h5.ts +1 -1
  3. package/dist/common/jssdk.ts +1 -1
  4. package/dist/common/token/token.jd.ts +1 -1
  5. package/dist/components/base/CustomScrollView/index.tsx +1 -1
  6. package/dist/components/base/InOrOutViewObserver/index.tsx +1 -1
  7. package/dist/components/base/InViewRender/index.tsx +1 -1
  8. package/dist/components/base/InViewRender/index.weapp.tsx +1 -1
  9. package/dist/components/base/LazyLayoutLoad/index.tsx +1 -1
  10. package/dist/components/base/LazyLayoutLoad/index.weapp.tsx +1 -1
  11. package/dist/components/base/LazyLoadImage/index.h5.module.scss +4 -8
  12. package/dist/components/base/LazyLoadImage/index.h5.tsx +1 -1
  13. package/dist/components/base/LazyLoadImage/index.tsx +1 -1
  14. package/dist/components/base/NetworkDataError/index.tsx +1 -1
  15. package/dist/components/debug/DebugLayout/index.module.scss +2 -2
  16. package/dist/components/decorate/PlaceHolder/index.tsx +1 -1
  17. package/dist/components/floorItem.jd.tsx +1 -1
  18. package/dist/components/floorItem.tsx +1 -1
  19. package/dist/components/floorItem.weapp.tsx +1 -1
  20. package/dist/interface/component.ts +1 -1
  21. package/dist/interface/jumpEventReport.ts +1 -1
  22. package/dist/jumpEventReport/logEventConfig.ts +1 -1
  23. package/dist/jumpEventReport/web.tjm.ts +1 -1
  24. package/dist/open/api/device.ts +1 -1
  25. package/dist/sass/app.h5.scss +0 -18
  26. package/dist/service/http/colorSign.ts +1 -1
  27. package/dist/service/requestServer.ts +1 -1
  28. package/dist/utils/connectNativeJsBridge.ts +1 -1
  29. package/dist/utils/index.h5.ts +1 -1
  30. package/dist/utils/taroRenderUtil.ts +1 -1
  31. package/dist/utils/utils.ts +1 -1
  32. package/package.json +53 -64
  33. package/dist/components/base/CustomScrollView/index-back.tsx +0 -1
  34. package/dist/utils/log.ts +0 -1
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@conecli/cone-render",
3
- "version": "0.10.1-beta.8",
3
+ "version": "0.10.1-beta.9",
4
4
  "private": false,
5
5
  "files": [
6
6
  "dist/"
@@ -24,8 +24,7 @@
24
24
  "templateInfo": {
25
25
  "name": "default",
26
26
  "typescript": true,
27
- "css": "sass",
28
- "framework": "React"
27
+ "css": "sass"
29
28
  },
30
29
  "scripts": {
31
30
  "build:weapp": "taro build --type weapp",
@@ -36,7 +35,7 @@
36
35
  "build:rn": "taro build --type rn",
37
36
  "build:qq": "taro build --type qq",
38
37
  "build:jd": "taro build --type jd",
39
- "build:harmony-hybrid": "taro build --type harmony-hybrid",
38
+ "build:quickapp": "taro build --type quickapp",
40
39
  "dev:weapp": "npm run build:weapp -- --watch",
41
40
  "dev:swan": "npm run build:swan -- --watch",
42
41
  "dev:alipay": "npm run build:alipay -- --watch",
@@ -45,23 +44,17 @@
45
44
  "dev:rn": "npm run build:rn -- --watch",
46
45
  "dev:qq": "npm run build:qq -- --watch",
47
46
  "dev:jd": "npm run build:jd -- --watch",
48
- "dev:harmony-hybrid": "npm run build:harmony-hybrid -- --watch",
47
+ "dev:quickapp": "npm run build:quickapp -- --watch",
49
48
  "compressWatch": "gulp compressWatch --gulpfile ./publish/gulpfile.js",
50
49
  "compress": "gulp compress --gulpfile ./publish/gulpfile.js",
51
50
  "build": "npm run compress",
52
51
  "check": "gulp check --gulpfile ./publish/gulpfile.js"
53
52
  },
54
- "browserslist": {
55
- "development": [
56
- "defaults and fully supports es6-module",
57
- "maintained node versions"
58
- ],
59
- "production": [
60
- "last 3 versions",
61
- "Android >= 4.1",
62
- "ios >= 8"
63
- ]
64
- },
53
+ "browserslist": [
54
+ "last 3 versions",
55
+ "Android >= 4.1",
56
+ "ios >= 8"
57
+ ],
65
58
  "husky": {
66
59
  "hooks": {
67
60
  "pre-commit": "lint-staged",
@@ -85,76 +78,72 @@
85
78
  ],
86
79
  "author": "conecli",
87
80
  "dependencies": {
88
- "@babel/runtime": "7.24.4",
89
- "@tarojs/components": "4.1.2",
90
- "@tarojs/helper": "4.1.2",
91
- "@tarojs/plugin-platform-weapp": "4.1.2",
92
- "@tarojs/plugin-platform-alipay": "4.1.2",
93
- "@tarojs/plugin-platform-tt": "4.1.2",
94
- "@tarojs/plugin-platform-swan": "4.1.2",
95
- "@tarojs/plugin-platform-jd": "4.1.2",
96
- "@tarojs/plugin-platform-qq": "4.1.2",
97
- "@tarojs/plugin-platform-h5": "4.1.2",
98
- "@tarojs/plugin-platform-harmony-hybrid": "4.1.2",
99
- "@tarojs/runtime": "4.1.2",
100
- "@tarojs/shared": "4.1.2",
101
- "@tarojs/taro": "4.1.2",
102
- "@tarojs/plugin-framework-react": "4.1.2",
103
- "@tarojs/react": "4.1.2",
104
- "@tarojs/service": "4.1.2",
105
- "react-dom": "^18.2.0",
106
- "react": "^18.2.0",
81
+ "@tarojs/cli": "3.5.4",
82
+ "@tarojs/components": "3.5.4",
83
+ "@tarojs/plugin-framework-react": "3.5.4",
84
+ "@tarojs/react": "3.5.4",
85
+ "@tarojs/runtime": "3.5.4",
86
+ "@tarojs/shared": "3.5.4",
87
+ "@tarojs/taro": "3.5.4",
88
+ "@tarojs/taro-h5": "3.5.4",
89
+ "@tarojs/taro-loader": "3.5.4",
90
+ "@tarojs/webpack5-runner": "3.5.4",
107
91
  "art-template": "^4.13.2",
108
92
  "gulp-filter": "^7.0.0",
109
93
  "normalize.css": "^8.0.1",
94
+ "raf": "^3.4.1",
95
+ "react": "^18.2.0",
110
96
  "react-content-loader": "^6.2.0",
97
+ "react-dom": "^18.2.0",
111
98
  "react-intersection-observer": "8.33.1",
112
99
  "react-refresh": "^0.14.0",
113
100
  "sha256": "^0.2.0"
114
101
  },
115
102
  "devDependencies": {
103
+ "@babel/core": "^7.8.0",
104
+ "@babel/runtime": "7.23.7",
116
105
  "@babel/plugin-transform-strict-mode": "^7.16.7",
117
- "@babel/core": "7.24.4",
118
- "@tarojs/cli": "4.1.2",
119
- "@babel/plugin-proposal-class-properties": "7.14.5",
120
- "@types/webpack-env": "^1.13.6",
121
- "@types/react": "^18.0.17",
122
- "webpack": "5.91.0",
123
- "@tarojs/taro-loader": "4.1.2",
124
- "@tarojs/webpack5-runner": "4.1.2",
125
- "sass": "^1.75.0",
126
- "babel-preset-taro": "4.1.2",
127
- "eslint-config-taro": "4.1.2",
128
- "eslint": "^8.57.0",
106
+ "@commitlint/cli": "^13.1.0",
107
+ "@commitlint/config-conventional": "^13.1.0",
129
108
  "@pmmmwh/react-refresh-webpack-plugin": "^0.5.7",
130
- "react-refresh": "^0.14.0",
131
- "@babel/preset-react": "^7.24.1",
132
- "eslint-plugin-react": "^7.34.1",
133
- "eslint-plugin-import": "^2.12.0",
134
- "eslint-plugin-react-hooks": "^4.4.0",
135
- "stylelint": "^16.4.0",
136
- "@typescript-eslint/parser": "^6.2.0",
137
- "@typescript-eslint/eslint-plugin": "^6.2.0",
138
- "typescript": "^5.4.5",
139
- "tsconfig-paths-webpack-plugin": "^4.1.0",
140
- "postcss": "^8.4.38",
141
- "ts-node": "^10.9.1",
142
- "@types/node": "^18",
109
+ "@swc/core": "1.2.242",
110
+ "@swc/register": "^0.1.10",
111
+ "@types/react": "^18.0.17",
112
+ "@types/webpack-env": "^1.13.6",
113
+ "@typescript-eslint/eslint-plugin": "^5.62.0",
114
+ "@typescript-eslint/parser": "^5.62.0",
115
+ "babel-preset-taro": "3.5.4",
143
116
  "del": "^6.1.1",
144
117
  "escodegen": "^2.0.0",
118
+ "eslint": "^8.56.0",
119
+ "eslint-config-prettier": "^8.3.0",
120
+ "eslint-config-taro": "3.5.4",
121
+ "eslint-plugin-import": "^2.12.0",
122
+ "eslint-plugin-prettier": "^3.4.0",
123
+ "eslint-plugin-react": "^7.8.2",
124
+ "eslint-plugin-react-hooks": "^4.2.0",
145
125
  "espree": "^9.3.2",
146
126
  "esprima": "^4.0.1",
147
127
  "estraverse": "^5.3.0",
148
128
  "gulp": "^4.0.2",
149
129
  "gulp-util": "^3.0.8",
150
130
  "html-webpack-plugin": "^5.5.0",
131
+ "husky": "^4.3.8",
132
+ "lint-staged": "^11.1.1",
151
133
  "mini-css-extract-plugin": "^2.6.1",
134
+ "prettier": "^3.3.3",
135
+ "sass": "^1.53.0",
152
136
  "shelljs": "^0.8.5",
153
- "terser-webpack-plugin": "^5.3.6"
137
+ "stylelint": "^14.4.0",
138
+ "terser-webpack-plugin": "^5.3.6",
139
+ "typescript": "^4.1.0",
140
+ "webpack": "5.69.0"
154
141
  },
155
142
  "resolutions": {
156
- "@babel/runtime": "7.24.4",
157
- "@tarojs/cli": "4.1.2",
158
- "@tarojs/helper": "4.1.2"
143
+ "@babel/runtime": "7.23.7",
144
+ "@tarojs/cli": "3.5.4",
145
+ "@tarojs/helper": "3.5.4",
146
+ "@tarojs/service": "3.5.4",
147
+ "@tarojs/shared": "3.5.4"
159
148
  }
160
149
  }
@@ -1 +0,0 @@
1
- import React, { useRef, useEffect } from 'react';
2
  isH5AndJdShopView,
3
1
  isAndroidDevice,
4
2
  isJdAndAndroidDevice,
5
3
  isJdAndIosDevice,
6
4
  isIosDevice,
7
5
  isJdApp,
8
6
  isWxMin,
9
7
  isH5AndJdShopViewH5Scroll,
10
8
  isH5AndJdShopH5CustomScrollView,
11
9
  isH5,
12
10
  isAppClassifyPage,
13
11
  lodashThrottle,
14
12
  START: 'start',
15
13
  MOVE: 'move',
16
14
  END: 'end',
17
15
  const {
18
16
  style = {},
19
17
  scrollX = false,
20
18
  scrollY = false,
21
19
  scrollWithAnimation = true,
22
20
  iosNeedDisableVertical = false,
23
21
  className = null,
24
22
  dispatchTouchMove = true,
25
23
  children,
26
24
  ...otherProps
27
25
  } = props;
28
26
  const rootEleNode = isH5 && document?.querySelector('body');
29
27
  const needShowHighVersion =
30
28
  isH5AndJdShopViewH5Scroll && global.info.queryInfo?.downgraded !== 'true';
31
29
  const mLastClientPosRef = useRef({
32
30
  mLastClientX: 0,
33
31
  mLastClientY: 0,
34
32
  });
35
33
  const isJdAndH5ScrollState = needShowHighVersion || isH5AndJdShopH5CustomScrollView;
36
34
 
37
35
  const touchstartEventBubbleFunc = (e) => {
38
36
  const isH5SwiperCustomEle = e?.target?.closest('.J_h5SwiperCustom');
39
37
  if (!isH5SwiperCustomEle) {
40
38
  const hasCustomEle = e
41
39
  ? e?.target?.closest('.J_customScroll') || e?.target?.closest('.J_customLayout')
42
40
  : false;
43
41
  if (isJdAndAndroidDevice && !hasCustomEle) {
44
42
  window.JdAndroid && window.JdAndroid.requestEvent(false);
45
43
  }
46
44
  !hasCustomEle &&
47
45
  rootEleNode &&
48
46
  rootEleNode.classList.contains('over-hidden') &&
49
47
  rootEleNode.classList.remove('over-hidden');
50
48
  }
51
49
  };
52
50
  const touchstartEventCaptureFunc = (e) => {
53
51
  if (e && !e?.target?.closest('.J_h5SwiperCustom') && !e?.target?.closest('.J_customLayout')) {
54
52
  rootEleNode &&
55
53
  rootEleNode.classList.contains('over-hidden') &&
56
54
  rootEleNode.classList.remove('over-hidden');
57
55
  }
58
56
  };
59
57
  useEffect(() => {
60
58
  isJdApp &&
61
59
  !window.JDJshopViewInfo.getAndroidTouchSlopState &&
62
60
  nativePageGetScaledTouchSlop((res) => {
63
61
  console.log('获取安卓系统滑动阈值', res);
64
62
  window.JDJshopViewInfo.androidTouchSlop = res;
65
63
  window.JDJshopViewInfo.getAndroidTouchSlopState = true;
66
64
  });
67
65
  if (isJdAndH5ScrollState && rootEleNode && !rootEleAddEventListenerState) {
68
66
  global?.removeJdAndroidRquestEventForTouchStart &&
69
67
  global.removeJdAndroidRquestEventForTouchStart();
70
68
  rootEleNode.addEventListener('touchstart', touchstartEventBubbleFunc, false);
71
69
 
72
70
  rootEleNode.addEventListener('touchstart', touchstartEventCaptureFunc, true);
73
71
  rootEleAddEventListenerState = true;
74
72
  console.log('customScrollView 初始化document监听完成');
75
73
  }
76
74
  return () => {
77
75
  if (isJdAndH5ScrollState && rootEleNode && rootEleAddEventListenerState) {
78
76
  console.log('customScrollView document监听取消完成');
79
77
  rootEleNode.removeEventListener('touchstart', touchstartEventBubbleFunc, false);
80
78
  rootEleNode.removeEventListener('touchstart', touchstartEventCaptureFunc, true);
81
79
  }
82
80
  };
83
81
  }, []);
84
82
 
85
83
  const androidDeviceStopNativeScrollEvent = (touchType) => {
86
84
  isJdApp &&
87
85
  isAndroidDevice &&
88
86
  window?.JdAndroid &&
89
87
  window?.JdAndroid.requestEvent(touchType === TouchType.START);
90
88
  };
91
89
  const iosDeviceStopNativeScrollEvent = (e, touchType, sendIosState = true) => {
92
90
  sendIosState && iosDeviceSendRouter(touchType);
93
91
  };
94
92
 
95
93
  const iosDeviceSendRouter = (state: string) => {
96
94
  window?.webkit?.messageHandlers?.MobileNavi?.postMessage?.({
97
95
  method: 'callRouterModuleWithParams',
98
96
  params: {
99
97
  routerURL: 'router://JDShopModule/processShoph5SlideState',
100
98
  routerParam: {
101
99
  slideDirection: 'horizontal',
102
100
  needDisableVertical: `${iosNeedDisableVertical}`,
103
101
  state,
104
102
  },
105
103
  callBackId: new Date().getTime(),
106
104
  },
107
105
  });
108
106
  };
109
107
  const stopNativeScrollEvent = (e: Event, touchType, sendIosState = true) => {
110
108
  if (isJdApp) {
111
109
  if (isIosDevice && !isAppClassifyPage) {
112
110
  iosDeviceStopNativeScrollEvent(e, touchType, sendIosState);
113
111
  } else if (isAndroidDevice) {
114
112
  androidDeviceStopNativeScrollEvent(touchType);
115
113
  }
116
114
  }
117
115
  };
118
116
 
119
117
  const GetSlideAngle = (dx, dy) => {
120
118
  return (Math.atan2(dy, dx) * 180) / Math.PI;
121
119
  };
122
120
 
123
121
  const GetSlideDirection = (startX, startY, endX, endY) => {
124
122
  const dy = startY - endY;
125
123
  const dx = endX - startX;
126
124
  let result = 0;
127
125
  if (Math.abs(dx) < 2 && Math.abs(dy) < 2) {
128
126
  return result;
129
127
  }
130
128
  const angle = GetSlideAngle(dx, dy);
131
129
  if (angle >= -45 && angle < 45) {
132
130
  result = 4;
133
131
  } else if (angle >= 45 && angle < 135) {
134
132
  result = 1;
135
133
  } else if (angle >= -135 && angle < -45) {
136
134
  result = 2;
137
135
  } else if ((angle >= 135 && angle <= 180) || (angle >= -180 && angle < -135)) {
138
136
  result = 3;
139
137
  }
140
138
  return result;
141
139
  };
142
140
  const changeTouchStart = (e) => {
143
141
  if (isJdApp) {
144
142
  stopNativeScrollEvent(e, TouchType.START, !iosNeedDisableVertical);
145
143
  if (isH5AndJdShopView || isH5AndJdShopH5CustomScrollView) {
146
144
  isJdAndH5ScrollState && rootEleNode && rootEleNode.classList.add('over-hidden');
147
145
  const touchEvent = e?.originalEvent?.targetTouches[0] || e?.targetTouches[0];
148
146
  mLastClientPosRef.current.mLastClientX = touchEvent.clientX;
149
147
  mLastClientPosRef.current.mLastClientY = touchEvent.clientY;
150
148
  }
151
149
  }
152
150
  };
153
151
  const changeTouchEnd = (e) => {
154
152
  stopNativeScrollEvent(e, TouchType.END);
155
153
  mLastClientPosRef.current.mLastClientX = 0;
156
154
  mLastClientPosRef.current.mLastClientY = 0;
157
155
  };
158
156
  const triggerIosTouchMove = () => {
159
157
  isJdAndIosDevice && iosDeviceStopNativeScrollEvent(null, TouchType.START, true);
160
158
  };
161
159
 
162
160
  const lodashThrottleTriggerIosTouchMove = lodashThrottle(triggerIosTouchMove, 500);
163
161
 
164
162
  const recoverRootEleVerticalScroll = (touchEvent) => {
165
163
  const direction = GetSlideDirection(
166
164
  mLastClientPosRef.current.mLastClientX,
167
165
  mLastClientPosRef.current.mLastClientY,
168
166
  touchEvent.clientX,
169
167
  touchEvent.clientY,
170
168
  );
171
169
  if (direction === 1 || direction === 2) {
172
170
  rootEleNode &&
173
171
  rootEleNode.classList.contains('over-hidden') &&
174
172
  rootEleNode.classList.remove('over-hidden');
175
173
  }
176
174
  };
177
175
  const changeTouchMove = (e) => {
178
176
  if (isH5AndJdShopView || isH5AndJdShopH5CustomScrollView) {
179
177
  const touchEvent = e?.originalEvent?.targetTouches[0] || e?.targetTouches[0];
180
178
  const xDiff = Math.abs(touchEvent.clientX - mLastClientPosRef.current.mLastClientX).toFixed(
181
179
  2,
182
180
  );
183
181
  const yDiff = Math.abs(touchEvent.clientY - mLastClientPosRef.current.mLastClientY).toFixed(
184
182
  2,
185
183
  );
186
184
  if (isJdApp) {
187
185
  if (xDiff >= window.JDJshopViewInfo.androidTouchSlop) {
188
186
  iosNeedDisableVertical && isJdApp && lodashThrottleTriggerIosTouchMove();
189
187
  } else if (yDiff > window.JDJshopViewInfo.androidTouchSlop) {
190
188
  stopNativeScrollEvent(e, TouchType.END);
191
189
  }
192
190
  }
193
191
  isJdAndH5ScrollState && recoverRootEleVerticalScroll(touchEvent);
194
192
  }
195
193
  if (!dispatchTouchMove) {
196
194
  return;
197
195
  }
198
196
  const parentNode = e.target?.parentNode;
199
197
  if (!parentNode) {
200
198
  return;
201
199
  }
202
200
  const event = new TouchEvent('touchmove', e);
203
201
  parentNode.dispatchEvent(event);
204
202
  };
205
203
  if (scrollX && isJdApp && !isIgnorePreventNative) {
206
204
  return (
207
205
  <ScrollView
208
206
  scrollX
209
207
  onTouchStart={changeTouchStart}
210
208
  onTouchEnd={changeTouchEnd}
211
209
  onTouchCancel={changeTouchEnd}
212
210
  onTouchMove={changeTouchMove}
213
211
  enhanced
214
212
  showScrollbar={false}
215
213
  style={style}
216
214
  className={classNames(
217
215
  className,
218
216
  {
219
217
  [customScrollViewStyle['d-custom-ios-h5-extend-border-radius']]: isIosDevice,
220
218
  },
221
219
  'J_customScroll',
222
220
  )}
223
221
  scrollY
224
222
  scrollWithAnimation
225
223
  {...otherProps}
226
224
  >
227
225
  {children}
228
226
  </ScrollView>
229
227
  );
230
228
  } else {
231
229
  return (
232
230
  <ScrollView
233
231
  scrollX
234
232
  scrollY
235
233
  scrollWithAnimation
236
234
  enhanced
237
235
  showScrollbar={false}
238
236
  {...otherProps}
239
237
  className={classNames(
240
238
  className,
241
239
  {
242
240
  [customScrollViewStyle['d-custom-ios-mini-extend-border-radius']]:
243
241
  isIosDevice && isWxMin && scrollX && style['borderRadius'],
244
242
  },
245
243
  {
246
244
  [customScrollViewStyle['d-custom-ios-h5-extend-border-radius']]: isIosDevice,
247
245
  },
248
246
  {
249
247
  [customScrollViewStyle['d-custom-mini-hide-scroll']]: isWxMin,
250
248
  },
251
249
  )}
252
250
  style={style}
253
251
  >
254
252
  {children}
255
253
  </ScrollView>
256
254
  );
257
255
  }
package/dist/utils/log.ts DELETED
@@ -1 +0,0 @@
1
- export const timeLog = (...messages) => {
2
  const level = 'info';
3
1
  const now = new Date();
4
2
  const timestamp = now.toLocaleString('zh-CN', {
5
3
  year: 'numeric',
6
4
  month: '2-digit',
7
5
  day: '2-digit',
8
6
  hour: '2-digit',
9
7
  minute: '2-digit',
10
8
  second: '2-digit',
11
9
  hour12: false,
12
10
  });
13
11
  const milliseconds = now.getMilliseconds().toString().padStart(3, '0');
14
12
  const prefix = `[${timestamp}.${milliseconds}] `;
15
13
  const logMethods = {
16
14
  info: console.info,
17
15
  warn: console.warn,
18
16
  error: console.error,
19
17
  };
20
18
  logMethods[level](prefix, ...messages);