@conecli/cone-render 0.10.1-shop3.10 → 0.10.1-shop3.101

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 (115) hide show
  1. package/README.md +1 -1
  2. package/dist/api/index.ts +1 -1
  3. package/dist/common/accessibility.h5.ts +1 -0
  4. package/dist/common/accessibility.ts +1 -0
  5. package/dist/common/const.ts +1 -1
  6. package/dist/common/index.h5.ts +1 -1
  7. package/dist/common/index.jd.ts +1 -1
  8. package/dist/common/index.ts +1 -1
  9. package/dist/common/index.weapp.ts +1 -1
  10. package/dist/common/jdplayerSdk.weapp.tsx +1 -0
  11. package/dist/common/jssdk.ts +1 -1
  12. package/dist/common/jssdk.weapp.ts +1 -0
  13. package/dist/common/pageType.ts +1 -1
  14. package/dist/common/token/index.h5.ts +1 -1
  15. package/dist/common/token/token.jd.ts +1 -1
  16. package/dist/common/wxappApi.ascf.ts +1 -0
  17. package/dist/common/wxappApi.ts +1 -1
  18. package/dist/components/ErrorBoundary.tsx +1 -1
  19. package/dist/components/base/CommonFloorHead/index.tsx +1 -1
  20. package/dist/components/base/CountDown/index.tsx +1 -1
  21. package/dist/components/base/CustomScrollView/index.tsx +1 -1
  22. package/dist/components/base/CustomVideo/index.tsx +1 -1
  23. package/dist/components/base/CustomVideo/index.weapp.tsx +1 -0
  24. package/dist/components/base/ExposureSmart/index.h5.tsx +1 -1
  25. package/dist/components/base/ExposureSmart/index.tsx +1 -1
  26. package/dist/components/base/ExposureSmart/reporter.tsx +1 -1
  27. package/dist/components/base/InOrOutViewObserver/index.weapp.tsx +1 -0
  28. package/dist/components/base/ItemViewExposureSmart/index.tsx +1 -1
  29. package/dist/components/base/LazyLayoutLoad/index.tsx +1 -1
  30. package/dist/components/base/LazyLoadImage/index.h5.tsx +1 -1
  31. package/dist/components/base/MobileCommonHeader/index.tsx +1 -1
  32. package/dist/components/base/MobileCommonHeader/index.weapp.tsx +1 -0
  33. package/dist/components/base/NetworkDataError/const.ts +1 -1
  34. package/dist/components/base/NetworkDataError/index.module.scss +118 -72
  35. package/dist/components/base/NetworkDataError/index.tsx +1 -1
  36. package/dist/components/base/Price/Base/index.module.scss +12 -0
  37. package/dist/components/base/Price/Base/index.tsx +1 -1
  38. package/dist/components/base/Price/Double/index.module.scss +25 -1
  39. package/dist/components/base/Price/Double/index.tsx +1 -1
  40. package/dist/components/base/ShopLeGaoTag/index.h5.module.scss +35 -0
  41. package/dist/components/base/ShopLeGaoTag/index.h5.tsx +1 -0
  42. package/dist/components/base/ShopLeGaoTag/index.module.scss +33 -0
  43. package/dist/components/base/ShopLeGaoTag/index.tsx +1 -0
  44. package/dist/components/debug/DebugLayout/index.module.scss +2 -2
  45. package/dist/components/floorItem.tsx +1 -1
  46. package/dist/components/isv/Floor/index.tsx +1 -1
  47. package/dist/components/remoteFloorItem.tsx +1 -1
  48. package/dist/config/env.ts +1 -1
  49. package/dist/interface/common.ts +1 -1
  50. package/dist/interface/component.ts +1 -1
  51. package/dist/interface/jumpEventReport.ts +1 -1
  52. package/dist/interface/service.ts +1 -1
  53. package/dist/jumpEventReport/base.ts +1 -1
  54. package/dist/jumpEventReport/const.ts +1 -1
  55. package/dist/jumpEventReport/createReportFloorData.ts +1 -1
  56. package/dist/jumpEventReport/index.h5.ts +1 -1
  57. package/dist/jumpEventReport/index.jd.ts +1 -1
  58. package/dist/jumpEventReport/index.weapp.ts +1 -1
  59. package/dist/jumpEventReport/jdJumpJdApp.ts +1 -1
  60. package/dist/jumpEventReport/jumpUrlConfig/base.ts +1 -1
  61. package/dist/jumpEventReport/logEventConfig.h5.ts +1 -0
  62. package/dist/jumpEventReport/logEventConfig.ts +1 -1
  63. package/dist/jumpEventReport/web/report.ts +1 -1
  64. package/dist/jumpEventReport/web.base.ts +1 -1
  65. package/dist/jumpEventReport/web.jd.ts +1 -1
  66. package/dist/jumpEventReport/web.pc.ts +1 -1
  67. package/dist/jumpEventReport/web.tjm.ts +1 -1
  68. package/dist/jumpEventReport/web.wxapp.ts +1 -1
  69. package/dist/language/en_US.json +395 -0
  70. package/dist/language/zh_CN.json +395 -0
  71. package/dist/language/zh_HK.json +395 -0
  72. package/dist/libs/openShopBridge.js +161 -0
  73. package/dist/libs/openShopBridge.min.js +1 -0
  74. package/dist/libs/taroAppReport.js +2 -2
  75. package/dist/modules/ContainerFloorList/index.h5.module.scss +16 -2
  76. package/dist/modules/ContainerFloorList/index.h5.tsx +1 -1
  77. package/dist/modules/ContainerFloorList/index.tsx +1 -1
  78. package/dist/modules/DecorateContainerFloorList/index.weapp.tsx +1 -0
  79. package/dist/open/api/environment.ts +1 -1
  80. package/dist/open/api/shopMember.ts +1 -1
  81. package/dist/open/api/shopMember.weapp.ts +1 -0
  82. package/dist/open/api/track.ts +1 -1
  83. package/dist/open/api/util.ts +1 -1
  84. package/dist/open/components/index.ts +1 -1
  85. package/dist/open/index.ts +1 -1
  86. package/dist/sass/app.h5.scss +19 -2
  87. package/dist/sass/base.scss +8 -4
  88. package/dist/service/fetchGateway.ts +1 -1
  89. package/dist/service/fetchGateway.weapp.ts +1 -1
  90. package/dist/service/fetchJsonp.weapp.ts +1 -0
  91. package/dist/service/http/const.ts +1 -1
  92. package/dist/service/http/h5Http.ts +1 -1
  93. package/dist/service/http/httpInterceptors.weapp.ts +1 -0
  94. package/dist/service/requestServer.h5.ts +1 -1
  95. package/dist/service/requestServer.ts +1 -1
  96. package/dist/service/requestServer.weapp.ts +1 -1
  97. package/dist/utils/connectNativeJsBridge.ts +1 -1
  98. package/dist/utils/h5Utils.ts +1 -1
  99. package/dist/utils/harmonyCallRouter.h5.ts +1 -0
  100. package/dist/utils/harmonyCallRouter.ts +0 -0
  101. package/dist/utils/index.h5.ts +1 -1
  102. package/dist/utils/index.ts +1 -1
  103. package/dist/utils/index.weapp.ts +1 -1
  104. package/dist/utils/jumpExtMapUtil.ts +1 -0
  105. package/dist/utils/jumpExtMapUtil.weapp.ts +1 -0
  106. package/dist/utils/log.ts +1 -0
  107. package/dist/utils/{sColor.js → sColor.ts} +1 -1
  108. package/dist/utils/sColor.weapp.ts +1 -0
  109. package/dist/utils/utils.ts +1 -1
  110. package/dist/wxapp/common/address_api/address_api_v2.js +1 -0
  111. package/dist/wxapp/common/user_info.js +1 -1
  112. package/package.json +162 -141
  113. package/dist/jumpEventReport/web/wqshop.report.ts +0 -1
  114. package/dist/utils/priceUtils.js +0 -1
  115. /package/dist/utils/{jumpExtMapUtil.js → jumpExtMapUtil.h5.ts} +0 -0
package/README.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # cone-render
2
2
 
3
- 智铺模块化装修的核心公共库,包括核心渲染逻辑和一些公共组件和方法
3
+ 智铺模块化装修的核心公共库,包括核心渲染逻辑和一些公共组件和方法。
4
4
 
5
5
  ## 注意
6
6
 
package/dist/api/index.ts CHANGED
@@ -1 +1 @@
1
- import { protocol, isBetaServer, isH5 } from '../config/env';
2
1
  ? redirectDomainList.includes(location?.hostname)
3
2
  ? defaultDomain
4
3
  : location?.hostname
5
4
  : defaultDomain;
6
5
  base: `${protocol}//conecli.com`,
7
6
  jshop2013: `${protocol}//conecli.com`,
8
7
  sale: `${protocol}//conecli.com`,
9
8
  mshop: `${protocol}//conecli.com`,
10
9
  pages: `${protocol}//${changeHostName}`,
11
10
  ztJshop: `${protocol}//conecli.com`,
12
11
  club: 'https://conecli.com',
13
12
  pm: `${protocol}//pm.3.cn`,
14
13
  pf: `${protocol}//pf.3.cn`,
15
14
  pcCoupon: `${protocol}//conecli.com`,
16
15
  fmall: `${protocol}//conecli.com`,
17
16
  lbs: `${protocol}//conecli.com`,
18
17
  yushou: `${protocol}//conecli.com`,
19
18
  wq: `${protocol}//wq.jd.com`,
20
19
  wqs: `${protocol}//conecli.com`,
21
20
  wqshop: `${protocol}//conecli.com`,
22
21
  shopMember: `${protocol}//conecli.com`,
23
22
  bean: `${protocol}//conecli.com`,
24
23
  mapi: `${protocol}//conecli.com`,
25
24
  api: isBetaServer ? `${protocol}//beta-api.m.jd.com` : `${protocol}//api.m.jd.com`,
26
25
  hkApi: isBetaServer ? `${protocol}//beta-color.jd.hk` : `${protocol}//color.jd.hk`,
27
26
  actJshop: `${protocol}//conecli.com`,
28
27
  msJshop: isBetaServer ? `${protocol}//conecli.com` : `${protocol}//conecli.com`,
29
28
  quark: 'https://conecli.com',
30
29
  ranking: `${protocol}//conecli.com`,
31
30
  iJshop: `${protocol}//conecli.com`,
32
31
  mobileSo: `${protocol}//conecli.com`,
33
32
  pcSo: `${protocol}//conecli.com`,
34
33
  capturehomeshare: `${protocol}//conecli.com`,
35
34
  jdcs: `${protocol}//conecli.com`,
36
35
  lives: `${protocol}//conecli.com`,
37
36
  mobileDetail: `${protocol}//conecli.com`,
38
37
  mobileHome: `${protocol}//conecli.com`,
39
38
  mobileLogin: `${protocol}//plogin.m.jd.com`,
40
39
  pcView: `${protocol}//mall.jd.com`,
41
40
  pcLogin: `${protocol}//passport.jd.com`,
42
41
  kpl: `${protocol}//conecli.com`,
43
42
  jxDomain: `${protocol}//st.jingxi.com`,
44
43
  ecoDomain: `${protocol}//conecli.com`,
45
44
  decorate: {
46
45
  preview: `${domain.iJshop}/mshop/edit/preview.json`,
47
46
  },
48
47
  userAddress: `${domain.fmall}/address/getDefaultAddress.html`,
49
48
  lbsLocation: `${domain.lbs}/o`,
50
49
  couponStatus: `${domain.base}/m/couponStatus.json`,
51
50
  addCart: `${domain.mapi}/cart/add.json`,
52
51
  receiveCoupon: `${domain.base}/m/couponGet.json`,
53
52
  areaStockState: `${domain.fmall}/ss/areaStockState/mget`,
54
53
  apiFunc: `${domain.api}/client.action`,
55
54
  hkApiFunc: `${domain.hkApi}/client.action`,
56
55
  follow: `${domain.wq}/fav/shop/AddShopFav`,
57
56
  unfollow: `${domain.wq}/fav/shop/DelShopFav`,
58
57
  isFollow: domain.fmall + '/rpc/vender/batchIsFollow',
59
58
  flowers: domain.fmall + '/rpc/vender/queryFollowedUserCount',
60
59
  serverTime: domain.actJshop + '/serverTime.html',
61
60
  followShop: 'followShop',
62
61
  getDefaultAddress: 'getDefaultAddress',
63
62
  userInfo: `${domain.msJshop}/user/info`,
64
63
  font: `${domain.quark}/font/ttf`,
65
64
  isLogin: `${domain.mobileLogin}/cgi-bin/ml/islogin`,
65
+ import { protocol, isBetaServer, isH5 } from '../config/env';
66
66
  ? redirectDomainList.includes(location?.hostname)
67
67
  ? defaultDomain
68
68
  : location?.hostname
69
69
  : defaultDomain;
70
70
  base: `${protocol}//conecli.com`,
71
71
  jshop2013: `${protocol}//conecli.com`,
72
72
  sale: `${protocol}//conecli.com`,
73
73
  mshop: `${protocol}//conecli.com`,
74
74
  pages: `${protocol}//${changeHostName}`,
75
75
  ztJshop: `${protocol}//conecli.com`,
76
76
  club: 'https://conecli.com',
77
77
  pm: `${protocol}//pm.3.cn`,
78
78
  pf: `${protocol}//pf.3.cn`,
79
79
  pcCoupon: `${protocol}//conecli.com`,
80
80
  fmall: `${protocol}//conecli.com`,
81
81
  lbs: `${protocol}//conecli.com`,
82
82
  yushou: `${protocol}//conecli.com`,
83
83
  wq: `${protocol}//wq.jd.com`,
84
84
  wqs: `${protocol}//conecli.com`,
85
85
  wqshop: `${protocol}//conecli.com`,
86
86
  shopMember: `${protocol}//conecli.com`,
87
87
  bean: `${protocol}//conecli.com`,
88
88
  mapi: `${protocol}//conecli.com`,
89
89
  api: isBetaServer ? `${protocol}//beta-api.m.jd.com` : `${protocol}//api.m.jd.com`,
90
90
  hkApi: isBetaServer ? `${protocol}//beta-color.jd.hk` : `${protocol}//color.jd.hk`,
91
91
  actJshop: `${protocol}//conecli.com`,
92
92
  msJshop: isBetaServer ? `${protocol}//conecli.com` : `${protocol}//conecli.com`,
93
93
  quark: 'https://conecli.com',
94
94
  ranking: `${protocol}//conecli.com`,
95
95
  iJshop: `${protocol}//conecli.com`,
96
96
  mobileSo: `${protocol}//conecli.com`,
97
97
  pcSo: `${protocol}//conecli.com`,
98
98
  capturehomeshare: `${protocol}//conecli.com`,
99
99
  jdcs: `${protocol}//conecli.com`,
100
100
  lives: `${protocol}//conecli.com`,
101
101
  mobileDetail: `${protocol}//conecli.com`,
102
102
  mobileHome: `${protocol}//conecli.com`,
103
103
  mobileLogin: `${protocol}//plogin.m.jd.com`,
104
104
  pcView: `${protocol}//mall.jd.com`,
105
105
  pcLogin: `${protocol}//passport.jd.com`,
106
106
  kpl: `${protocol}//conecli.com`,
107
107
  jxDomain: `${protocol}//st.jingxi.com`,
108
108
  ecoDomain: `${protocol}//conecli.com`,
109
109
  p: `${protocol}//conecli.com`,
110
110
  trade: `${protocol}//conecli.com`,
111
111
  decorate: {
112
112
  preview: `${domain.iJshop}/mshop/edit/preview.json`,
113
113
  },
114
114
  userAddress: `${domain.fmall}/address/getDefaultAddress.html`,
115
115
  lbsLocation: `${domain.lbs}/o`,
116
116
  couponStatus: `${domain.base}/m/couponStatus.json`,
117
117
  addCart: `${domain.mapi}/cart/add.json`,
118
118
  receiveCoupon: `${domain.base}/m/couponGet.json`,
119
119
  areaStockState: `${domain.fmall}/ss/areaStockState/mget`,
120
120
  apiFunc: `${domain.api}/client.action`,
121
121
  hkApiFunc: `${domain.hkApi}/client.action`,
122
122
  follow: `${domain.wq}/fav/shop/AddShopFav`,
123
123
  unfollow: `${domain.wq}/fav/shop/DelShopFav`,
124
124
  isFollow: domain.fmall + '/rpc/vender/batchIsFollow',
125
125
  flowers: domain.fmall + '/rpc/vender/queryFollowedUserCount',
126
126
  serverTime: domain.actJshop + '/serverTime.html',
127
127
  followShop: 'followShop',
128
128
  getDefaultAddress: 'getDefaultAddress',
129
129
  userInfo: `${domain.msJshop}/user/info`,
130
130
  font: `${domain.quark}/font/ttf`,
131
131
  isLogin: `${domain.mobileLogin}/cgi-bin/ml/islogin`,
@@ -0,0 +1 @@
1
+ import Taro from '@tarojs/taro';
2
  'app-activity',
1
3
  'app-rank',
2
4
  'app-seckill',
3
5
  'm-coupon',
4
6
  'scene-buy',
5
7
  'light-details',
6
8
  'member-paid-center',
7
9
  'member-paid-card',
8
10
  'member-paid-bind',
9
11
  'app-introduce',
10
12
  'app-search-result',
11
13
  if (window?.shopGlobalSwitch?.openAccessibilityLanguage) {
12
14
  Taro.nextTick(() => {
13
15
  const htmlRoot = document?.documentElement;
14
16
  htmlRoot && htmlRoot.setAttribute('lang', isLanguageForEn ? 'en' : 'zh-CN');
15
17
  });
16
18
  }
17
19
  const mainConfig = {
18
20
  childList: true,
19
21
  subtree: true,
20
22
  attributes: true,
21
23
  attributeFilter: ['auto-accessible'],
22
24
  };
23
25
  const mainObserver = new MutationObserver(function (mutations) {
24
26
  mutations.forEach(function (mutation) {
25
27
  if (mutation.type === 'childList') {
26
28
  mutation.addedNodes.forEach(function (node) {
27
29
  if (node.nodeType === Node.ELEMENT_NODE) {
28
30
  if (node.hasAttribute && node.getAttribute('auto-accessible') === 'true') {
29
31
  updateAccessibilityLabel(node);
30
32
  }
31
33
  const accessibleElements = node.querySelectorAll
32
34
  ? node.querySelectorAll('[auto-accessible="true"]')
33
35
  : [];
34
36
  accessibleElements.forEach(function (el) {
35
37
  updateAccessibilityLabel(el);
36
38
  });
37
39
  }
38
40
  });
39
41
  }
40
42
  if (mutation.type === 'attributes' && mutation.attributeName === 'auto-accessible') {
41
43
  if (mutation.target.getAttribute('auto-accessible') === 'true') {
42
44
  updateAccessibilityLabel(mutation.target);
43
45
  }
44
46
  }
45
47
  });
46
48
  });
47
49
  mainObserver.observe(document.body, mainConfig);
48
50
  setupGlobalContentObserver();
49
51
  const contentConfig = {
50
52
  characterData: true,
51
53
  childList: true,
52
54
  subtree: true,
53
55
  };
54
56
  const lastUpdateTime = new WeakMap();
55
57
  const THROTTLE_DELAY = 2000;
56
58
 
57
59
  function shouldUpdate(element) {
58
60
  const now = Date.now();
59
61
  const lastTime = lastUpdateTime.get(element);
60
62
  if (!lastTime || now - lastTime >= THROTTLE_DELAY) {
61
63
  lastUpdateTime.set(element, now);
62
64
  return true;
63
65
  }
64
66
  return false;
65
67
  }
66
68
  const globalContentObserver = new MutationObserver(function (mutations) {
67
69
  const affectedElements = new Set();
68
70
  mutations.forEach(function (mutation) {
69
71
  let targetElement = null;
70
72
  if (mutation.type === 'characterData') {
71
73
  targetElement = findClosestAccessibleElement(mutation.target);
72
74
  } else if (mutation.type === 'childList') {
73
75
  targetElement = findClosestAccessibleElement(mutation.target);
74
76
  }
75
77
  if (targetElement && targetElement.getAttribute('auto-accessible') === 'true') {
76
78
  affectedElements.add(targetElement);
77
79
  }
78
80
  });
79
81
  affectedElements.forEach(function (element) {
80
82
  if (shouldUpdate(element)) {
81
83
  updateAccessibilityLabel(element);
82
84
  } else {
83
85
  }
84
86
  });
85
87
  });
86
88
  globalContentObserver.observe(document.body, contentConfig);
87
89
  let current = node;
88
90
  if (current.nodeType === Node.TEXT_NODE) {
89
91
  current = current.parentElement;
90
92
  }
91
93
  while (current && current !== document.body) {
92
94
  if (current.getAttribute && current.getAttribute('auto-accessible') === 'true') {
93
95
  return current;
94
96
  }
95
97
  current = current.parentElement;
96
98
  }
97
99
  return null;
98
100
  if (!element) return;
99
101
  if (element.hasAttribute('aria-label')) {
100
102
  completeA11yAttributes(element);
101
103
  if (!element.getAttribute('data-auto-aria-label')) {
102
104
  return;
103
105
  }
104
106
  }
105
107
  const text = element.innerText;
106
108
  if (text) {
107
109
  const processedText = text.replace(/\r|\n/g, ' ').replace(/¥\s(\d+)(\s(\.\d+))?/, '¥$1$3');
108
110
  element.setAttribute('aria-label', processedText);
109
111
  element.setAttribute('data-auto-aria-label', 'true');
110
112
  completeA11yAttributes(element);
111
113
  }
112
114
  if (!element.hasAttribute('role')) {
113
115
  element.setAttribute('role', 'text');
114
116
  }
115
117
  if (!element.hasAttribute('tabindex')) {
116
118
  element.setAttribute('tabindex', 0);
117
119
  }
118
120
  const routerURL = 'router://JDShopModule/isAccessibilityIsRunning';
119
121
  const callBackName = `nativeGetAccessibilityIsRunning${Date.now()}`;
120
122
  let params: any = {
121
123
  routerURL,
122
124
  routerParam: null,
123
125
  callBackName,
124
126
  };
125
127
  return new Promise((resolve) => {
126
128
  window[callBackName] = (res) => {
127
129
  let data;
128
130
  try {
129
131
  data = typeof res === 'string' ? JSON.parse(res) : res;
130
132
  } catch (e) {
131
133
  console.error('JSON parse error:', e);
132
134
  data = {};
133
135
  }
134
136
  console.log('无障碍router回调成功:', res);
135
137
  const isRunning = data?.data?.isAccessibilityIsRunning || false;
136
138
  resolve(isRunning);
137
139
  };
138
140
  if (isJdAndIosDevice) {
139
141
  callRouterIOS(params);
140
142
  } else if (isJdAndAndroidDevice) {
141
143
  callRouterAndroid(params);
142
144
  }
143
145
  });
144
146
  setPageLanguage();
145
147
  let isRunning;
146
148
  try {
147
149
  isRunning = await getAccessibilityIsRunning();
148
150
  } catch (e) {
149
151
  console.error('getAccessibilityIsRunning() ~~ error:', e);
150
152
  }
151
153
  if (isRunning || autoAccessiblePagesWhitelist.includes(buildType)) {
152
154
  console.log('🚀 ~~ 页面启用无障碍自动支持方案 ~~ buildType:', buildType);
153
155
  setupMainObserver();
154
156
  } else {
155
157
  console.log('🚀 ~~ 页面不启用无障碍自动支持方案 !! buildType:', buildType);
156
158
  }
@@ -0,0 +1 @@
1
+ export default () => {};