vue-intergrall-plugins 0.0.183 → 0.0.187

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "vue-intergrall-plugins",
3
- "version": "0.0.183",
3
+ "version": "0.0.187",
4
4
  "description": "",
5
5
  "main": "dist/vue-intergrall-plugins.ssr.js",
6
6
  "browser": "dist/vue-intergrall-plugins.esm.js",
@@ -62,7 +62,6 @@
62
62
  "dependencies": {
63
63
  "axios": "^0.26.0",
64
64
  "kind-of": "^6.0.3",
65
- "link-preview-js": "^2.1.13",
66
65
  "link-prevue": "^1.2.0"
67
66
  }
68
67
  }
@@ -72,7 +72,6 @@ import InteratividadeBotoes from "./InteratividadeBotoes"
72
72
  import InteratividadeFormulario from "./InteratividadeFormulario"
73
73
  import { formataTimezoneData } from "../../services/textFormatting"
74
74
  import LinkPrevue from "link-prevue"
75
- import { getLinkPreview } from "link-preview-js";
76
75
 
77
76
  export default {
78
77
  components: { AnexoMensagem, InteratividadeBotoes, InteratividadeFormulario, LinkPrevue },
@@ -164,26 +163,15 @@ export default {
164
163
  }
165
164
  },
166
165
  validadeUrlToMsg(){
167
- this.message = this.msg
168
- if(this.validadeIfExistsSticker()){
169
- this.urlSticker = this.getUrlSticker()
170
- this.urlFileName = this.getUrlFileName()
171
- this.message = this.removeUrlStickerByString(this.urlSticker)
172
- }
173
- if(this.validadeIfExistsUrl()){
174
- const linkRegex = /(?:(?:https?|ftp|file):\/\/|www\.|ftp\.)(?:\([-A-Z0-9+&@#\/%=~_|$?!:,.]*\)|[-A-Z0-9+&@#\/%=~_|$?!:,.])*(?:\([-A-Z0-9+&@#\/%=~_|$?!:,.]*\)|[A-Z0-9+&@#\/%=~_|$])/igm;
175
- let link = [];
176
- link = this.message.match(linkRegex);
177
- if(!link || link.length == 0){
178
- return;
166
+ try {
167
+ this.message = this.msg
168
+ if(this.validadeIfExistsSticker()){
169
+ this.urlSticker = this.getUrlSticker()
170
+ this.urlFileName = this.getUrlFileName()
171
+ this.message = this.removeUrlStickerByString(this.urlSticker)
179
172
  }
180
- getLinkPreview(link[0]).then((data) => {
181
- if(data.images && data.images.length > 0){
182
- this.urlSticker = data.images[0];
183
- }
184
- }).catch(erro => {
185
- console.log(erro);
186
- });
173
+ } catch (error) {
174
+
187
175
  }
188
176
  },
189
177
  getUrlFileName(){
@@ -200,12 +188,6 @@ export default {
200
188
  let url = this.message.match(urlRegex)[1];
201
189
  return url;
202
190
  },
203
- validadeIfExistsUrl(){
204
- if(this.message && this.message.indexOf("https://") !== false && this.message.indexOf("<a") !== false){
205
- return true;
206
- }
207
- return false;
208
- },
209
191
  validadeIfExistsSticker(){
210
192
  if(this.message && this.message.indexOf("KSTICKERK https://smarters") === 0){
211
193
  return true;