@taole/dev-helper 0.1.21 → 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.
@@ -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);
@@ -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);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@taole/dev-helper",
3
- "version": "0.1.21",
3
+ "version": "0.1.22",
4
4
  "type": "module",
5
5
  "bin": {
6
6
  "dev-helper": "./bin/dev-helper.js"