@conecli/cone-render 0.8.15-beta.4 → 0.8.15-beta.41

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/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'
@@ -0,0 +1 @@
1
+ import React 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
  const latestRes = latestFromNativeMsgStorage[TaroEventType.PAGE_SCROLL] || {}
7
7
  !componentShowStateRef.current && dealPageScrollInfo(latestRes)
8
8
  useEffect(() => {
9
9
  if(componentShowState === true){
10
10
  console.log('>>>>>>>>>>>>>>>>>>> 楼层【id=' + containerId + '】已经渲染!')
11
11
  const modularPackResult = floorData?.floorExtInfo?.modularPackResult
12
12
  console.log('>>>>>>>>>>>>>>>>>>> 向IOS原生发送通知请求ISV模块依赖JS文件:', bundleUrl)
13
13
  nativePageRegisterMessage(
14
14
  Message_Type.NATIVE_INJECT_JS_FILE,
15
15
  {
16
16
  data: {
17
17
  "bundleUrl": [bundleUrl]
18
18
  },
19
19
  },
20
20
  )
21
21
  }
22
22
  }
23
23
  }, [componentShowState])
24
24
  ref={ref}
@@ -1 +1 @@
1
- import React, {useCallback, useState} from 'react'
1
+ import React, { useCallback, useEffect, useRef, useState } from 'react'
2
2
  const [componentShowState, setComponentShowState] = useState(false)
3
3
  const componentLazyRef = useRef<HTMLElement | null>(null)
4
4
  const componentShowStateRef = useRef(false)
5
5
  useEffect(() => {
6
6
  const latestRes = latestFromNativeMsgStorage[TaroEventType.PAGE_SCROLL] || {}
7
7
  !componentShowStateRef.current && dealPageScrollInfo(latestRes)
8
8
  Taro.eventCenter.on(TaroEventType.PAGE_SCROLL, (res) => {
9
9
  !componentShowStateRef.current && dealPageScrollInfo(res)
10
10
  })
11
11
 
12
12
 
13
13
  <View
14
14
  ref={componentLazyRef}
15
15
  className={classNames(
16
16
  imageStyle['d-app-lazy-image'],
17
17
  {
18
18
  [imageStyle['d-lazy-sku-image']]: isSkuImage,
19
19
  },
20
20
  {
21
21
  [imageStyle['d-hide-image-error']]: imageErrState,
22
22
  },
23
23
  {
24
24
  [imageStyle['d-load-completed']]: loadSuccess,
25
25
  },
26
26
  {
27
27
  'd-imag-rendering-crisp-edges':
28
28
  !taroJdBaseInfo.info.pageInfo.isVipShop &&
29
29
  imagRenderingSet,
30
30
  },
31
31
  'J_html5ImageBg',
32
32
  className,
33
33
  )}
34
34
  style={{
35
35
  ...style,
36
36
  ...changeStyleIncludeWidthAndHeightAndBgColor(),
37
37
  }}
38
38
  >
39
39
  {componentShowState && <img
40
40
  src={getQualityImage(
41
41
  imgSrc,
42
42
  taroJdBaseInfo.info.pageInfo.isVipShop
43
43
  ? NetWorkTypeQuality['perfect']
44
44
  : NetWorkTypeQuality[getNetWorkType],
45
45
  )}
46
46
  onLoad={imageLoad.bind(this, imgSrc)}
47
47
  onError={imageError}
48
48
  />}
49
49
  </View>
50
50
  ) : (
51
51
  <Image
52
52
  style={{
53
53
  ...style,
54
54
  ...changeStyleIncludeWidthAndHeightAndBgColor(),
55
55
  }}
56
56
  className={classNames(
57
57
  imageStyle['d-lazy-image'],
58
58
  {
59
59
  [imageStyle['d-lazy-sku-image']]: isSkuImage,
60
60
  },
61
61
  {
62
62
  [imageStyle['d-hide-image-error']]: imageErrState,
63
63
  },
64
64
  {
65
65
  [imageStyle['d-load-completed']]: loadSuccess,
66
66
  },
67
67
  {
68
68
  'd-imag-rendering-crisp-edges': imagRenderingSet,
69
69
  },
70
70
  className,
71
71
  )}
72
72
  src={getQualityImage(
73
73
  imgSrc,
74
74
  NetWorkTypeQuality[getNetWorkType],
75
75
  )}
76
76
  lazyLoad={lazyLoad}
77
77
  onError={imageError}
78
78
  onLoad={imageLoad.bind(this, imgSrc)}
79
79
  {...otherOption}
80
80
  />
81
81
  )
@@ -1 +1 @@
1
- import React, { Suspense, lazy } from 'react'
1
+ import React, { Suspense, lazy } from 'react'
@@ -1 +1 @@
1
- import { isApp, getUrlQuery } from '../utils/jm-common'
1
+ import { isApp, getUrlQuery } from '../utils/jm-common'
@@ -1 +1 @@
1
- import React from 'react'
1
+ import React from 'react'
2
2
  floorData={floorItem}
@@ -12,14 +12,15 @@
12
12
  }
13
13
  .taro_router,
14
14
  .taro_page {
15
- height: auto!important;
16
- max-height: inherit!important;
17
- overflow: auto!important;
15
+ height: auto !important;
16
+ max-height: inherit !important;
17
+ overflow: auto !important;
18
18
  }
19
19
 
20
20
  .taro_router {
21
21
  min-height: 800PX;
22
- padding-bottom: 50PX;
22
+ // TODO: 这里的全局样式,用于本地开发工具装修端。但经打包后会影响浏览端样式,使得多出一段间距。暂时屏蔽处理
23
+ // padding-bottom: 50PX;
23
24
  .taro_page {
24
25
  position: static!important;
25
26
  }
@@ -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
  latestFromNativeMsgStorage[TaroEventType.PAGE_SCROLL] = {
3
3
  displayHeight: 1920,
4
4
  offSetY: 0
5
5
  }
6
6
  console.log('>>>>>>>>>>>>>>>>>>> render taroEventSendPageScrollInfo origin time:', Date.now(), 'res:', options)
7
7
  if(options){
8
8
  latestFromNativeMsgStorage[TaroEventType.PAGE_SCROLL] = options
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>`
@@ -0,0 +1 @@
1
+ (function webpackUniversalModuleDefinition(root, factory) {
@@ -1 +1 @@
1
- import Taro from '@tarojs/taro'
1
+ import Taro from '@tarojs/taro'
package/package.json CHANGED
@@ -1,16 +1,15 @@
1
1
  {
2
2
  "name": "@conecli/cone-render",
3
- "version": "0.8.15-beta.4",
3
+ "version": "0.8.15-beta.41",
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
- "./modules": "./dist/open/modules/index.ts"
11
+ "./modules": "./dist/open/modules/index.ts",
12
+ "./_utils/": "./dist/utils/"
14
13
  },
15
14
  "description": "cone-render",
16
15
  "templateInfo": {
@@ -68,8 +67,8 @@
68
67
  "react": "^18.2.0",
69
68
  "react-content-loader": "^6.2.0",
70
69
  "react-dom": "^18.2.0",
71
- "react-refresh": "^0.14.0",
72
- "react-intersection-observer": "^9.1.0"
70
+ "react-intersection-observer": "^9.1.0",
71
+ "react-refresh": "^0.14.0"
73
72
  },
74
73
  "devDependencies": {
75
74
  "@babel/core": "^7.8.0",
@@ -1,43 +0,0 @@
1
- /*
2
- * @Author: lichang68
3
- * @Date: 2022-10-31 20:27:51
4
- * @LastEditTime: 2022-11-01 11:05:23
5
- * @LastEditors: lichang68
6
- * @Description: 错误边界,是一个React组件,只能是class组件,可以捕获发生在子组件树任何位置的js错误,并打印这些错误,同时展示降级UI,并不会渲染发生崩溃的子组件树。
7
- * 包裹ContainerFloorList,捕获isv h5楼层渲染时的错误异常,并做屏蔽处理
8
- * @FilePath: /shop-react/Users/cdlichang1/Documents/work/workSpace/cone-render/src/components/ErrorBoundary.jsx
9
- */
10
- import React from 'react'
11
- import { Text } from '@tarojs/components'
12
- export default class ErrorBoundary extends React.Component {
13
- constructor(props) {
14
- super(props);
15
- this.state = {
16
- hasError: false,
17
- }
18
- }
19
-
20
- static getDerivedStateFromError(error) {
21
- // 更新 state 使下一次渲染能够显示出错降级后的 UI
22
- return {
23
- hasError: true
24
- }
25
- }
26
-
27
- componentDidCatch(error, errorInfo) {
28
- // TODO: 后期这里增加,isv异常上报。当前处理只是简单的console.log('错误信息')
29
- // 打印错误信息,error错误信息,errorInfo错误堆栈
30
- console.log('isv模块渲染异常ErrorBoundary==========error: ', error.toString())
31
- console.log('isv模块渲染异常ErrorBoundary==========errorInfo: ', errorInfo.componentStack)
32
- }
33
-
34
- render() {
35
- if (this.state.hasError) {
36
- // 可以在这里自定义出错降级后的 UI 并渲染
37
- // 对于isv模块,出错后隐藏楼层
38
- return null
39
- }
40
-
41
- return this.props.children
42
- }
43
- }