@conecli/cone-render 0.8.15-beta.0 → 0.8.15-beta.10

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 (32) hide show
  1. package/README.md +0 -2
  2. package/dist/common/const.ts +1 -1
  3. package/dist/common/index.h5.ts +1 -1
  4. package/dist/common/index.jd.ts +1 -1
  5. package/dist/common/index.ts +1 -1
  6. package/dist/common/index.weapp.ts +1 -1
  7. package/dist/components/ErrorBoundary.tsx +1 -0
  8. package/dist/components/base/CommonFloorHead/index.module.scss +1 -1
  9. package/dist/components/base/CountDown/index.tsx +1 -1
  10. package/dist/components/base/CustomScrollView/index.tsx +1 -1
  11. package/dist/components/base/LazyLayoutLoad/index.tsx +1 -1
  12. package/dist/components/base/LazyLoadImage/const.ts +1 -1
  13. package/dist/components/base/LazyLoadImage/index.h5.tsx +1 -1
  14. package/dist/components/base/LazyLoadImage/index.tsx +1 -1
  15. package/dist/components/floorItem.tsx +1 -1
  16. package/dist/components/system/Banner/index.tsx +1 -1
  17. package/dist/components/system/PictureHotSpot/index.tsx +1 -1
  18. package/dist/components/system/Video/index.tsx +1 -1
  19. package/dist/interface/common.ts +1 -1
  20. package/dist/interface/component.ts +1 -1
  21. package/dist/interface/jumpEventReport.ts +1 -1
  22. package/dist/jumpEventReport/base.ts +1 -1
  23. package/dist/jumpEventReport/const.ts +1 -1
  24. package/dist/jumpEventReport/jdJumpJdApp.ts +1 -1
  25. package/dist/jumpEventReport/web.jd.ts +1 -1
  26. package/dist/jumpEventReport/web.wxapp.ts +1 -1
  27. package/dist/modules/ContainerFloorList/index.h5.tsx +1 -1
  28. package/dist/open/index.ts +1 -1
  29. package/dist/utils/connectNativeJsBridge.ts +1 -1
  30. package/dist/utils/index.h5.ts +1 -1
  31. package/dist/utils/utils.ts +1 -1
  32. package/package.json +9 -5
package/README.md CHANGED
@@ -1,3 +1 @@
1
1
  cone-render
2
-
3
- 11
@@ -1 +1 @@
1
- import { isPublishToWxapp } from '../config/env'
1
+ import { isPublishToWxapp } from '../config/env'
@@ -1 +1 @@
1
- import Taro from '@tarojs/taro'
1
+ import Taro from '@tarojs/taro'
@@ -1 +1 @@
1
- import Taro from '@tarojs/taro'
1
+ import Taro from '@tarojs/taro'
@@ -1 +1 @@
1
- import Taro from '@tarojs/taro'
1
+ import Taro from '@tarojs/taro'
@@ -1 +1 @@
1
- import Taro from '@tarojs/taro'
1
+ import Taro from '@tarojs/taro'
@@ -0,0 +1 @@
1
+ import React from 'react'
@@ -138,7 +138,7 @@
138
138
  display: block;
139
139
  // height: auto;
140
140
  height: 96px;
141
- background: no-repeat center/cover;
141
+ background: no-repeat top/100% auto;
142
142
  }
143
143
 
144
144
  .d-place-holder {
@@ -1 +1 @@
1
- import Taro from '@tarojs/taro'
1
+ import Taro from '@tarojs/taro'
@@ -1 +1 @@
1
- import React, {useRef, useEffect} from 'react'
1
+ import React, {useRef, useEffect} from 'react'
@@ -1 +1 @@
1
- import Taro, { useRouter } from '@tarojs/taro'
1
+ import Taro, { useRouter } from '@tarojs/taro'
2
2
  floorData = {},
3
3
  const rootDom = document.querySelector('#J_shopHomeRoot')
4
4
  root: rootDom,
5
5
  rootMargin: `0px 0px ${window.innerHeight}px 0px`,
6
6
  useEffect(() => {
7
7
  if(componentShowState === true){
8
8
  const modularPackResult = floorData?.floorExtInfo?.modularPackResult
9
9
  console.log('向IOS原生发送通知请求ISV模块依赖JS文件:', bundleUrl)
10
10
  nativePageRegisterMessage(
11
11
  Message_Type.NATIVE_INJECT_JS_FILE,
12
12
  {
13
13
  data: {
14
14
  "bundleUrl": [bundleUrl]
15
15
  },
16
16
  },
17
17
  )
18
18
  }
19
19
  }
20
20
  }, [componentShowState])
21
21
  ref={ref}
@@ -1 +1 @@
1
- export const NetWorkTypeQuality = {
1
+ export const NetWorkTypeQuality = {
@@ -1 +1 @@
1
- import React, {useCallback, useState} from 'react'
2
1
  const {
3
2
  src,
4
3
  lazyLoad,
5
4
  width,
6
5
  height,
7
6
  className,
8
7
  isSkuImage,
9
8
  hideErrorImage,
10
9
  style,
11
10
  backgroundColor,
12
11
  errorSrc,
13
12
  onLoad,
14
13
  onError,
15
14
  ...otherOption
16
15
  } = props
17
16
  getNetWorkType === NetWorkTypeQuality.default &&
18
17
  (getNetWorkType = taroJdBaseInfo.info.sysInfo.netWorkType)
19
18
  const [loadSuccess, setLoadSuccess] = useState(false)
20
19
  const [imageErrState, setImageErrState] = useState(false)
21
20
  const [imgSrc, setImgSrc] = useState(src)
22
21
  const imageError = useCallback(
23
22
  (e) => {
24
23
  console.log('图片加载错误', e)
25
24
  errorSrc && setImgSrc(errorSrc)
26
25
  hideErrorImage && setImageErrState(true)
27
26
  typeof onError === 'function' && onError(e, src, props)
28
27
  },
29
28
  [src],
30
29
  )
31
30
 
32
31
  const imageLoad = useCallback(
32
+ import React, { useCallback, useEffect, useRef, useState } from 'react'
33
33
  const [componentShowState, setComponentShowState] = useState(false)
34
34
  const componentLazyRef = useRef<HTMLElement | null>(null)
35
35
  const componentShowStateRef = useRef(false)
36
36
  useEffect(() => {
37
37
  const latestRes = latestFromNativeMsgStorage[TaroEventType.PAGE_SCROLL] || {}
38
38
  !componentShowStateRef.current && dealPageScrollInfo(latestRes)
39
39
  Taro.eventCenter.on(TaroEventType.PAGE_SCROLL, (res) => {
40
40
  !componentShowStateRef.current && dealPageScrollInfo(res)
41
41
  })
42
42
 
43
43
 
44
44
  <View
45
45
  ref={componentLazyRef}
46
46
  className={classNames(
47
47
  imageStyle['d-app-lazy-image'],
48
48
  {
49
49
  [imageStyle['d-lazy-sku-image']]: isSkuImage,
50
50
  },
51
51
  {
52
52
  [imageStyle['d-hide-image-error']]: imageErrState,
53
53
  },
54
54
  {
55
55
  [imageStyle['d-load-completed']]: loadSuccess,
56
56
  },
57
57
  {
58
58
  'd-imag-rendering-crisp-edges':
59
59
  !taroJdBaseInfo.info.pageInfo.isVipShop &&
60
60
  imagRenderingSet,
61
61
  },
62
62
  'J_html5ImageBg',
63
63
  className,
64
64
  )}
65
65
  style={{
66
66
  ...style,
67
67
  ...changeStyleIncludeWidthAndHeightAndBgColor(),
68
68
  }}
69
69
  >
70
70
  {componentShowState && <img
71
71
  src={getQualityImage(
72
72
  imgSrc,
73
73
  taroJdBaseInfo.info.pageInfo.isVipShop
74
74
  ? NetWorkTypeQuality['perfect']
75
75
  : NetWorkTypeQuality[getNetWorkType],
76
76
  )}
77
77
  onLoad={imageLoad.bind(this, imgSrc)}
78
78
  onError={imageError}
79
79
  />}
80
80
  </View>
81
81
  ) : (
82
82
  <Image
83
83
  style={{
84
84
  ...style,
85
85
  ...changeStyleIncludeWidthAndHeightAndBgColor(),
86
86
  }}
87
87
  className={classNames(
88
88
  imageStyle['d-lazy-image'],
89
89
  {
90
90
  [imageStyle['d-lazy-sku-image']]: isSkuImage,
91
91
  },
92
92
  {
93
93
  [imageStyle['d-hide-image-error']]: imageErrState,
94
94
  },
95
95
  {
96
96
  [imageStyle['d-load-completed']]: loadSuccess,
97
97
  },
98
98
  {
99
99
  'd-imag-rendering-crisp-edges': imagRenderingSet,
100
100
  },
101
101
  className,
102
102
  )}
103
103
  src={getQualityImage(
104
104
  imgSrc,
105
105
  NetWorkTypeQuality[getNetWorkType],
106
106
  )}
107
107
  lazyLoad={lazyLoad}
108
108
  onError={imageError}
109
109
  onLoad={imageLoad.bind(this, imgSrc)}
110
110
  {...otherOption}
111
111
  />
112
112
  )
@@ -1 +1 @@
1
- import React, {useCallback, useState} from 'react'
2
1
  const {
3
2
  src,
4
3
  lazyLoad,
5
4
  width,
6
5
  height,
7
6
  className,
8
7
  isSkuImage,
9
8
  hideErrorImage,
10
9
  style,
11
10
  backgroundColor,
12
11
  errorSrc,
13
12
  onLoad,
14
13
  onError,
15
14
  ...otherOption
16
15
  } = props
17
16
  getNetWorkType === NetWorkTypeQuality.default &&
18
17
  (getNetWorkType = taroJdBaseInfo.info.sysInfo.netWorkType)
19
18
  const [loadSuccess, setLoadSuccess] = useState(false)
20
19
  const [imgSrc, setImgSrc] = useState(src)
21
20
  const [imageErrState, setImageErrState] = useState(false)
22
21
  const imageError = useCallback(
23
22
  (e) => {
24
23
  console.log('图片加载错误', e)
25
24
  errorSrc && setImgSrc(errorSrc)
26
25
  hideErrorImage && setImageErrState(true)
27
26
  typeof onError === 'function' && onError(e, src, props)
28
27
  },
29
28
  [src],
30
29
  )
31
30
 
32
31
  const imageLoad = useCallback(
33
32
  (event) => {
34
33
  setLoadSuccess(true)
35
34
  typeof onLoad === 'function' && onLoad(event, src, props)
36
35
  },
37
36
  [src],
38
37
  )
39
38
 
40
39
  const changeStyleIncludeWidthAndHeightAndBgColor = () => {
41
40
  const changeStyle = {}
42
41
  width && (changeStyle['width'] = width)
43
42
  height && (changeStyle['height'] = height)
44
43
  backgroundColor && (changeStyle['backgroundColor'] = backgroundColor)
45
44
  return changeStyle
46
45
  }
47
46
  return (
48
47
  <Image
49
48
  style={{
50
49
  ...style,
51
50
  ...changeStyleIncludeWidthAndHeightAndBgColor(),
52
51
  }}
53
52
  className={classNames(
54
53
  imageStyle['d-lazy-image'],
55
54
  {
56
55
  [imageStyle['d-lazy-sku-image']]: isSkuImage,
57
56
  },
58
57
  {
59
58
  [imageStyle['d-hide-image-error']]: imageErrState,
60
59
  },
61
60
  {
62
61
  },
63
62
  'd-imag-rendering-crisp-edges',
64
63
  className,
65
64
  )}
66
65
  src={getQualityImage(imgSrc, NetWorkTypeQuality[getNetWorkType])}
67
66
  lazyLoad={lazyLoad}
68
67
  onError={imageError}
69
68
  onLoad={imageLoad}
70
69
  {...otherOption}
71
70
  />
72
71
  )
73
72
  lazyLoad: true,
74
73
  isSkuImage: false,
75
74
  hideErrorImage: false,
76
75
  src: null,
77
76
  style: null,
78
77
  width: null,
79
78
  height: null,
80
79
  backgroundColor: null,
81
80
  className: null,
82
81
  errorSrc: null,
83
82
  onLoad: null,
84
83
  onError: null,
84
+ import React, {useCallback, useState} from 'react'
@@ -1 +1 @@
1
- import React, { Suspense, lazy } from 'react'
1
+ import React, { Suspense, lazy } from 'react'
@@ -1 +1 @@
1
- import { ComponentInterFace } from '../../../interface/component'
1
+ import { ComponentInterFace } from '../../../interface/component'
@@ -1 +1 @@
1
- import React, { useRef } from 'react'
1
+ import React, { useRef } from 'react'
@@ -1 +1 @@
1
- import React, { useCallback, useEffect, useRef } from 'react'
1
+ import React, { useCallback, useEffect, useRef } from 'react'
@@ -1 +1 @@
1
- import Taro from '@tarojs/taro'
1
+ import Taro from '@tarojs/taro'
@@ -1 +1 @@
1
- import React from 'react'
1
+ import React from 'react'
@@ -1 +1 @@
1
- export declare namespace JumpEventReportInterFace {
1
+ export declare namespace JumpEventReportInterFace {
@@ -1 +1 @@
1
- import Taro from '@tarojs/taro'
1
+ import Taro from '@tarojs/taro'
@@ -1 +1 @@
1
- export enum LinkConfigType {
1
+ import { isH5 } from '../utils'
@@ -1 +1 @@
1
- import Taro from '@tarojs/taro'
1
+ import Taro from '@tarojs/taro'
@@ -1 +1 @@
1
- import { JdJumpJdApp } from './jdJumpJdApp'
1
+ import { JdJumpJdApp } from './jdJumpJdApp'
@@ -1 +1 @@
1
- import taroJdBaseInfo from '../common'
1
+ import taroJdBaseInfo from '../common'
@@ -1 +1 @@
1
- import React from 'react'
1
+ import React from 'react'
2
2
  floorData={floorItem}
@@ -1 +1 @@
1
- import taroJdBaseInfo from '../common'
1
+ import taroJdBaseInfo from '../common'
2
2
  const result = document.domain.match(/jd\.\w+$/)
3
3
  if(result){
4
4
  document.domain = result[0]
5
5
  }
@@ -1 +1 @@
1
- import Taro from '@tarojs/taro'
1
+ import Taro from '@tarojs/taro'
2
2
  if(isJdApp && isH5AndJdShopView && isAndroidDevice){
3
3
  setTimeout(() => {
4
4
  nativePageRegisterMessage(
5
5
  Message_Type.NATIVE_GET_SCROLL_TOP,
6
6
  null,
7
7
  )
8
8
  }, 0)
9
9
  }
@@ -1 +1 @@
1
- import Taro from '@tarojs/taro'
2
1
  <span class="d-shop-loading-icon"></span>
3
2
  <p class="d-shop-text">${text}</p>
4
3
  </div>`
4
+ import Taro from '@tarojs/taro'
5
5
  <span class="d-shop-loading-icon"></span>
6
6
  <p class="d-shop-text">${text}</p>
7
7
  </div>`
@@ -1 +1 @@
1
- import Taro from '@tarojs/taro'
1
+ import Taro from '@tarojs/taro'
package/package.json CHANGED
@@ -1,13 +1,11 @@
1
1
  {
2
2
  "name": "@conecli/cone-render",
3
- "version": "0.8.15-beta.0",
3
+ "version": "0.8.15-beta.10",
4
4
  "private": false,
5
- "main": "dist/open/index.ts",
6
5
  "files": [
7
6
  "dist/"
8
7
  ],
9
8
  "exports": {
10
- ".": "./dist/open/index.ts",
11
9
  "./api": "./dist/open/api/index.ts",
12
10
  "./components": "./dist/open/components/index.ts",
13
11
  "./modules": "./dist/open/modules/index.ts"
@@ -68,13 +66,16 @@
68
66
  "react": "^18.2.0",
69
67
  "react-content-loader": "^6.2.0",
70
68
  "react-dom": "^18.2.0",
71
- "react-refresh": "^0.14.0",
72
- "react-intersection-observer": "^9.1.0"
69
+ "react-intersection-observer": "^9.1.0",
70
+ "react-refresh": "^0.14.0"
73
71
  },
74
72
  "devDependencies": {
75
73
  "@babel/core": "^7.8.0",
76
74
  "@babel/runtime": "^7.17.9",
75
+ "@jmfe/jd-jssdk": "^3.3.1-alpha.0",
77
76
  "@pmmmwh/react-refresh-webpack-plugin": "^0.5.7",
77
+ "@swc/core": "^1.2.242",
78
+ "@swc/register": "^0.1.10",
78
79
  "@types/react": "^18.0.17",
79
80
  "@types/webpack-env": "^1.13.6",
80
81
  "@typescript-eslint/eslint-plugin": "^5.20.0",
@@ -92,9 +93,12 @@
92
93
  "estraverse": "^5.3.0",
93
94
  "gulp": "^4.0.2",
94
95
  "gulp-util": "^3.0.8",
96
+ "html-webpack-plugin": "^5.5.0",
97
+ "mini-css-extract-plugin": "^2.6.1",
95
98
  "sass": "^1.53.0",
96
99
  "shelljs": "^0.8.5",
97
100
  "stylelint": "^14.4.0",
101
+ "terser-webpack-plugin": "^5.3.6",
98
102
  "typescript": "^4.1.0",
99
103
  "webpack": "5.69.0"
100
104
  }