@taole/dev-helper 0.1.20 → 0.1.22

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.
@@ -10,11 +10,11 @@
10
10
  app_name: '点点开黑',
11
11
  link_ios: "com.tuwan.diandian://openPage",
12
12
  link_android: "intent://diandain:8888/splash#Intent;scheme=taole;package=com.tuwan.yw;S.browser_fallback_url=https://sj.qq.com/myapp/detail.htm?apkName=com.tuwan.yw;end",
13
- link_harmony: "taole://diandain:8888/splash",
14
- fallback_link_ios: "https://apps.apple.com/cn/app/%E7%82%B9%E7%82%B9-%E8%AF%AD%E9%9F%B3%E5%BC%80%E9%BB%91/id1449564746",
15
- fallback_link_android: 'https://m.malink.cn/s/3iQziy',
16
- fallback_link_harmony: 'hiapplink://com.huawei.appmarket?appId=C100212407',
17
- fallback_fin_5s: 'https://sj.qq.com/appdetail/com.tuwan.yw', // 5秒后跳转的链接(仅安卓)
13
+ link_harmony: "taole://diandain:8888/splash",
14
+ fallback_link_ios: "https://apps.apple.com/cn/app/%E7%82%B9%E7%82%B9-%E8%AF%AD%E9%9F%B3%E5%BC%80%E9%BB%91/id1449564746",
15
+ fallback_link_android: 'https://m.malink.cn/s/3iQziy',
16
+ fallback_link_harmony: 'hiapplink://com.huawei.appmarket?appId=C100212407',
17
+ fallback_fin_5s: 'https://sj.qq.com/appdetail/com.tuwan.yw', // 5秒后跳转的链接(仅安卓)
18
18
  },
19
19
  'wx0e4a6eed634134ce': { // 兔小铲
20
20
  app_name: '兔小铲',
@@ -77,7 +77,7 @@
77
77
  this._isWechat = /MicroMessenger/i.test(navigator.userAgent);
78
78
  this._isAndroid = /Android/i.test(navigator.userAgent);
79
79
  this._isIOS = /iPad|iPhone|iPod/.test(navigator.userAgent) && !window.MSStream;
80
- this._isHarmony = /Harmony/i.test(navigator.userAgent);
80
+ this._isHarmony = /Harmony/i.test(navigator.userAgent) || /HUAWEI/i.test(navigator.userAgent);
81
81
  this._isMobile = this._isAndroid || this._isIOS || this._isHarmony;
82
82
  this._isConnected = false;
83
83
  this._id = id++;
@@ -209,10 +209,12 @@
209
209
  window.addEventListener("visibilitychange", this._pagehideCallback);
210
210
  }
211
211
  this._updateTagAttr();
212
- this._initClipboardText();
213
212
  } else {
214
213
  this._log('open-diandian: not supported pc platform');
215
214
  }
215
+ if (!this._isApp) {
216
+ this._initClipboardText();
217
+ }
216
218
  }
217
219
  _handleAlinkClick() {
218
220
  this._writeClickboard();
@@ -276,6 +278,13 @@
276
278
  const shorUrl = await twKit.genShortUrl(urlText);
277
279
  this._clipboardText = `【${this._appInfo.app_name}】 ${shorUrl} `;
278
280
  this._log("initClipboardText success", this._clipboardText);
281
+ this.dispatchEvent(new CustomEvent('clipboardtext', {
282
+ detail: {
283
+ text: this._clipboardText,
284
+ },
285
+ bubbles: true,
286
+ composed: true,
287
+ }));
279
288
  resolve();
280
289
  } catch (error) {
281
290
  this._log("initClipboardText error", error);
@@ -376,17 +385,17 @@
376
385
  this._alink_fallback = this._appInfo.fallback_link_ios;
377
386
  this._alink_link = this._appInfo.link_ios || this._alink_fallback;
378
387
  this._alink_fin_5s = '';
379
- } else {
380
- this._alink_fallback = this._appInfo.fallback_link_android;
381
- this._alink_link = this._appInfo.link_android || this._alink_fallback;
382
- if(this._isHarmony && this._appInfo.link_harmony){
383
- this._alink_link = this._appInfo.link_harmony;
384
- }
385
- if(this._isHarmony && this._appInfo.fallback_link_harmony){
386
- this._alink_fallback = this._appInfo.fallback_link_harmony;
387
- }
388
- this._alink_fin_5s = this._appInfo.fallback_fin_5s || '';
389
- }
388
+ } else {
389
+ this._alink_fallback = this._appInfo.fallback_link_android;
390
+ this._alink_link = this._appInfo.link_android || this._alink_fallback;
391
+ if(this._isHarmony && this._appInfo.link_harmony){
392
+ this._alink_link = this._appInfo.link_harmony;
393
+ }
394
+ if(this._isHarmony && this._appInfo.fallback_link_harmony){
395
+ this._alink_fallback = this._appInfo.fallback_link_harmony;
396
+ }
397
+ this._alink_fin_5s = this._appInfo.fallback_fin_5s || '';
398
+ }
390
399
  if (this._openAppTag) {
391
400
  this._openAppTag.setAttribute('appid', this._appid);
392
401
  this._openAppTag.setAttribute('extinfo', this.getAttribute('extinfo') || "");
@@ -5,11 +5,11 @@ const appInfoMap = {
5
5
  app_name: '点点开黑',
6
6
  link_ios: "com.tuwan.diandian://openPage",
7
7
  link_android: "intent://diandain:8888/splash#Intent;scheme=taole;package=com.tuwan.yw;S.browser_fallback_url=https://sj.qq.com/myapp/detail.htm?apkName=com.tuwan.yw;end",
8
- link_harmony: "taole://diandain:8888/splash",
9
- fallback_link_ios: "https://apps.apple.com/cn/app/%E7%82%B9%E7%82%B9-%E8%AF%AD%E9%9F%B3%E5%BC%80%E9%BB%91/id1449564746",
10
- fallback_link_android: 'https://m.malink.cn/s/3iQziy',
11
- fallback_link_harmony: 'hiapplink://com.huawei.appmarket?appId=C100212407',
12
- fallback_fin_5s: 'https://sj.qq.com/appdetail/com.tuwan.yw', // 5秒后跳转的链接(仅安卓)
8
+ link_harmony: "taole://diandain:8888/splash",
9
+ fallback_link_ios: "https://apps.apple.com/cn/app/%E7%82%B9%E7%82%B9-%E8%AF%AD%E9%9F%B3%E5%BC%80%E9%BB%91/id1449564746",
10
+ fallback_link_android: 'https://m.malink.cn/s/3iQziy',
11
+ fallback_link_harmony: 'hiapplink://com.huawei.appmarket?appId=C100212407',
12
+ fallback_fin_5s: 'https://sj.qq.com/appdetail/com.tuwan.yw', // 5秒后跳转的链接(仅安卓)
13
13
  },
14
14
  'wx0e4a6eed634134ce': { // 兔小铲
15
15
  app_name: '兔小铲',
@@ -72,7 +72,7 @@ function createOpenDiandianElementClass() {
72
72
  this._isWechat = /MicroMessenger/i.test(navigator.userAgent);
73
73
  this._isAndroid = /Android/i.test(navigator.userAgent);
74
74
  this._isIOS = /iPad|iPhone|iPod/.test(navigator.userAgent) && !window.MSStream;
75
- this._isHarmony = /Harmony/i.test(navigator.userAgent);
75
+ this._isHarmony = /Harmony/i.test(navigator.userAgent) || /HUAWEI/i.test(navigator.userAgent);
76
76
  this._isMobile = this._isAndroid || this._isIOS || this._isHarmony;
77
77
  this._isConnected = false;
78
78
  this._id = id++;
@@ -204,10 +204,12 @@ function createOpenDiandianElementClass() {
204
204
  window.addEventListener("visibilitychange", this._pagehideCallback);
205
205
  }
206
206
  this._updateTagAttr();
207
- this._initClipboardText();
208
207
  } else {
209
208
  this._log('open-diandian: not supported pc platform');
210
209
  }
210
+ if (!this._isApp) {
211
+ this._initClipboardText();
212
+ }
211
213
  }
212
214
  _handleAlinkClick() {
213
215
  this._writeClickboard();
@@ -271,6 +273,13 @@ function createOpenDiandianElementClass() {
271
273
  const shorUrl = await twKit.genShortUrl(urlText);
272
274
  this._clipboardText = `【${this._appInfo.app_name}】 ${shorUrl} `;
273
275
  this._log("initClipboardText success", this._clipboardText);
276
+ this.dispatchEvent(new CustomEvent('clipboardtext', {
277
+ detail: {
278
+ text: this._clipboardText,
279
+ },
280
+ bubbles: true,
281
+ composed: true,
282
+ }));
274
283
  resolve();
275
284
  } catch (error) {
276
285
  this._log("initClipboardText error", error);
@@ -371,17 +380,17 @@ function createOpenDiandianElementClass() {
371
380
  this._alink_fallback = this._appInfo.fallback_link_ios;
372
381
  this._alink_link = this._appInfo.link_ios || this._alink_fallback;
373
382
  this._alink_fin_5s = '';
374
- } else {
375
- this._alink_fallback = this._appInfo.fallback_link_android;
376
- this._alink_link = this._appInfo.link_android || this._alink_fallback;
377
- if(this._isHarmony && this._appInfo.link_harmony){
378
- this._alink_link = this._appInfo.link_harmony;
379
- }
380
- if(this._isHarmony && this._appInfo.fallback_link_harmony){
381
- this._alink_fallback = this._appInfo.fallback_link_harmony;
382
- }
383
- this._alink_fin_5s = this._appInfo.fallback_fin_5s || '';
384
- }
383
+ } else {
384
+ this._alink_fallback = this._appInfo.fallback_link_android;
385
+ this._alink_link = this._appInfo.link_android || this._alink_fallback;
386
+ if(this._isHarmony && this._appInfo.link_harmony){
387
+ this._alink_link = this._appInfo.link_harmony;
388
+ }
389
+ if(this._isHarmony && this._appInfo.fallback_link_harmony){
390
+ this._alink_fallback = this._appInfo.fallback_link_harmony;
391
+ }
392
+ this._alink_fin_5s = this._appInfo.fallback_fin_5s || '';
393
+ }
385
394
  if (this._openAppTag) {
386
395
  this._openAppTag.setAttribute('appid', this._appid);
387
396
  this._openAppTag.setAttribute('extinfo', this.getAttribute('extinfo') || "");
@@ -408,4 +417,4 @@ function registerTdiv() {
408
417
  }
409
418
  }
410
419
 
411
- registerTdiv();
420
+ registerTdiv();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@taole/dev-helper",
3
- "version": "0.1.20",
3
+ "version": "0.1.22",
4
4
  "type": "module",
5
5
  "bin": {
6
6
  "dev-helper": "./bin/dev-helper.js"