vue-intergrall-plugins 0.0.506 → 0.0.508

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.506",
3
+ "version": "0.0.508",
4
4
  "description": "",
5
5
  "main": "dist/vue-intergrall-plugins.ssr.js",
6
6
  "browser": "dist/vue-intergrall-plugins.esm.js",
@@ -20,39 +20,38 @@
20
20
  "build:unpkg": "cross-env NODE_ENV=production rollup --config build/rollup.config.js --format iife"
21
21
  },
22
22
  "devDependencies": {
23
- "@babel/core": "^7.23.9",
24
- "@babel/preset-env": "^7.23.9",
23
+ "@babel/core": "^7.15.5",
24
+ "@babel/preset-env": "^7.15.6",
25
25
  "@rollup/plugin-alias": "^3.1.2",
26
26
  "@rollup/plugin-babel": "^5.3.0",
27
27
  "@rollup/plugin-commonjs": "^14.0.0",
28
28
  "@rollup/plugin-json": "^4.1.0",
29
29
  "@rollup/plugin-node-resolve": "^9.0.0",
30
30
  "@rollup/plugin-replace": "^2.4.2",
31
- "@vue/cli-plugin-babel": "^5.0.8",
32
- "@vue/cli-service": "^5.0.8",
33
- "autoprefixer": "^10.4.17",
31
+ "@vue/cli-plugin-babel": "^4.5.13",
32
+ "@vue/cli-service": "^4.5.13",
33
+ "autoprefixer": "^10.3.6",
34
34
  "cross-env": "^7.0.3",
35
- "cssnano": "^6.0.3",
36
- "minimist": "^1.2.8",
37
- "rimraf": "^5.0.5",
35
+ "cssnano": "^5.0.8",
36
+ "minimist": "^1.2.5",
37
+ "rimraf": "^3.0.2",
38
38
  "rollup": "^2.58.0",
39
- "rollup-plugin-polyfill-node": "^0.13.0",
40
39
  "rollup-plugin-terser": "^7.0.2",
41
40
  "rollup-plugin-vue": "^5.1.9",
42
- "vue": "^2.7.16",
43
- "vue-template-compiler": "^2.7.16"
41
+ "vue": "^2.6.14",
42
+ "vue-template-compiler": "^2.6.14"
44
43
  },
45
44
  "peerDependencies": {
46
- "@fortawesome/fontawesome-free": "^6.5.1",
47
- "@fortawesome/fontawesome-svg-core": "^6.5.1",
48
- "@fortawesome/free-solid-svg-icons": "^6.5.1",
49
- "@fortawesome/vue-fontawesome": "^2.0.10",
50
- "@popperjs/core": "^2.11.8",
51
- "core-js": "^3.35.1",
52
- "postcss": "^8.4.33",
53
- "vue": "^2.7.16",
45
+ "@fortawesome/fontawesome-free": "^5.15.4",
46
+ "@fortawesome/fontawesome-svg-core": "^1.2.36",
47
+ "@fortawesome/free-solid-svg-icons": "^5.15.4",
48
+ "@fortawesome/vue-fontawesome": "^2.0.2",
49
+ "@popperjs/core": "^2.11.2",
50
+ "core-js": "^3.18.1",
51
+ "postcss": "^8.3.8",
52
+ "vue": "^2.6.14",
54
53
  "vue-clickaway": "^2.2.2",
55
- "vue-select": "^3.20.0",
54
+ "vue-select": "^3.13.0",
56
55
  "vue-tippy": "^4.12.0",
57
56
  "vue-toasted": "^1.1.28",
58
57
  "vue2-google-maps": "^0.10.7"
@@ -61,6 +60,7 @@
61
60
  "node": ">=12"
62
61
  },
63
62
  "dependencies": {
64
- "axios": "^1.6.7"
63
+ "axios": "^0.26.0",
64
+ "kind-of": "^6.0.3"
65
65
  }
66
- }
66
+ }
@@ -1,18 +1,22 @@
1
1
  <template>
2
- <div
3
- v-if="linkPreview.isValid"
4
- class="link-preview"
5
- @click="openUrl()"
2
+ <div
3
+ v-if="linkPreview.isValid"
4
+ class="link-preview"
5
+ @click="openUrl()"
6
6
  :title="`Abrir ${returnURL()} em uma nova guia`"
7
7
  >
8
- <div
9
- v-if="linkPreview.imageSource"
8
+ <div
9
+ v-if="linkPreview.imageSource"
10
10
  :style="linkPreview.colorTheme ? `background-color: ${linkPreview.colorTheme}` : ''"
11
11
  class="link-preview-image"
12
12
  >
13
13
  <img :src="linkPreview.imageSource" alt="Imagem referente ao link" />
14
14
  </div>
15
- <div class="link-preview-author" :class="{'mb-0' : linkPreview.description}" v-if="linkPreview.author">
15
+ <div
16
+ class="link-preview-author"
17
+ :class="{ 'mb-0': linkPreview.description }"
18
+ v-if="linkPreview.author"
19
+ >
16
20
  <h1 v-text="linkPreview.author"></h1>
17
21
  </div>
18
22
  <div v-if="linkPreview.description" class="link-preview-infos">
@@ -22,14 +26,14 @@
22
26
  </template>
23
27
 
24
28
  <script>
25
- import { dev, baseURL } from '@/services/smartChannelAxios'
29
+ import { dev, baseURL } from "@/services/smartChannelAxios";
26
30
 
27
31
  export default {
28
32
  props: {
29
33
  message: {
30
34
  type: String,
31
- default: ""
32
- }
35
+ default: "",
36
+ },
33
37
  },
34
38
  data() {
35
39
  return {
@@ -38,127 +42,148 @@ export default {
38
42
  description: "",
39
43
  imageSource: "",
40
44
  colorTheme: "",
41
- isValid: false
42
- }
43
- }
45
+ isValid: false,
46
+ },
47
+ };
44
48
  },
45
49
  mounted() {
46
- this.$nextTick(() => { this.gerarPreview() })
50
+ this.$nextTick(() => {
51
+ this.gerarPreview();
52
+ });
47
53
  },
48
54
  methods: {
49
55
  returnURL() {
50
- if(!this.message) return ""
51
- const isSticker = this.message.indexOf("KSTICKERK") < 0 ? false : true
52
- if(isSticker) return ""
53
- const regex = /(https?:\/\/(?:www\.|(?!www))[a-zA-Z0-9][a-zA-Z0-9-]+[a-zA-Z0-9]\.[^\s]{2,}|www\.[a-zA-Z0-9][a-zA-Z0-9-]+[a-zA-Z0-9]\.[^\s]{2,}|https?:\/\/(?:www\.|(?!www))[a-zA-Z0-9]+\.[^\s]{2,}|www\.[a-zA-Z0-9]+\.[^\s]{2,})/g
54
- const url = regex.exec(this.message)
55
- if(!url || !url[0]) {
56
- console.warn("URL invalida para gerar preview")
57
- return ""
58
- }
59
- const finalUrl = url[0].replace(/["'*]/g, "")
60
- if(/((https?|ftp):\/\/.)?(www\.)?(?:([-a-zA-Z0-9@:%._\+~#=]{2,256}\.[a-z]{2,6})|(linux07|linux03))\b([-a-zA-Z0-9@:%_\+.~#?&//=]*)/gi.test(finalUrl)) return finalUrl
61
- return false
56
+ if (!this.message) return "";
57
+ const isSticker = this.message.indexOf("KSTICKERK") < 0 ? false : true;
58
+ if (isSticker) return "";
59
+ const regex = /(https?:\/\/(?:www\.|(?!www))[a-zA-Z0-9][a-zA-Z0-9-]+[a-zA-Z0-9]\.[^\s]{2,}|www\.[a-zA-Z0-9][a-zA-Z0-9-]+[a-zA-Z0-9]\.[^\s]{2,}|https?:\/\/(?:www\.|(?!www))[a-zA-Z0-9]+\.[^\s]{2,}|www\.[a-zA-Z0-9]+\.[^\s]{2,})/g;
60
+ const url = regex.exec(this.message);
61
+ if (!url || !url[0]) {
62
+ console.warn("URL invalida para gerar preview");
63
+ return "";
64
+ }
65
+ const finalUrl = url[0].replace(/["'*]/g, "");
66
+ if (
67
+ /((https?|ftp):\/\/.)?(www\.)?(?:([-a-zA-Z0-9@:%._\+~#=]{2,256}\.[a-z]{2,6})|(linux07|linux03))\b([-a-zA-Z0-9@:%_\+.~#?&//=]*)/gi.test(
68
+ finalUrl
69
+ )
70
+ )
71
+ return finalUrl;
72
+ return false;
62
73
  },
63
74
  async gerarPreview() {
64
75
  try {
65
- const url = this.returnURL()
66
- if(!url) return
67
- const encodedURL = Buffer(url).toString("base64")
68
- const response = await this.$httpRequest(
69
- {
70
- method: 'get',
76
+ const url = this.returnURL();
77
+ if (!url) return;
78
+ const encodedURL = Buffer(url).toString("base64");
79
+ const response = await this.$httpRequest({
80
+ method: "get",
71
81
  url: `${baseURL}/preview?url=${encodedURL}${dev}`,
72
82
  // headers: {
73
83
  // Authorization: "Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJhdGQiOiJNS1VGWnBQeEV1UHc5UXdvN21HU2tWNEl4VHN0blM3MHNyZUJTTWt3d3hiNDRhd3dDcWwxd09jIiwibWFuYWdlciI6Ik1LVXRhd3dpbTRsNXd3WW1LMWFJYXd3aW00bDV3d3d3eGI0NGF3d0s0a2pveHBPMnl6TFZ3dXBud3d4YjQ0YXd3cmxNNHRqZ3FKTExsTjMiLCJoYXNfaW5mb3MiOnRydWUsIm5yb3MiOlsiMjczIl0sImF1dGgiOiJNS1VncmxDdkdRbElGbXZVTERCSGplV0wyOXFVUHdyOVlSMVMyeXdJanlLOUNteCIsImlhdCI6MTY0ODQ3MzYxNSwiZXhwIjoxNjQ4NTYwMDE1fQ.KSG_6_9NfQhk5br7hnXzeLyVZuT69XLaEYF9XkdgmmQ"
74
84
  // }
75
- })
76
- if(typeof response != "object" || typeof response.data != "object") throw "Retorno incorreto"
77
- const { data } = response
78
- const { st_ret, msg_ret, raspagem } = data
79
- if(st_ret != "OK") throw `${st_ret} - ${msg_ret}`
80
- if(!raspagem) throw `${st_ret} - ${msg_ret} | (Raspagem nao encontrada no retorno)`
81
- const { description, og, theme_color } = raspagem
82
- if(description) this.linkPreview.description = description
83
- if(raspagem.author) this.linkPreview.author = raspagem.author
84
- if(og) {
85
- const { image, site_name, title, author } = og
86
- if(image) this.linkPreview.imageSource = image.url ? image.url : image.url == "" ? "" : image
87
- if(author || site_name || title) this.linkPreview.author = title ? title : author ? author : site_name ? site_name : ""
88
- if(og.description) this.linkPreview.description = og.description
85
+ });
86
+ if (typeof response != "object" || typeof response.data != "object")
87
+ throw "Retorno incorreto";
88
+ const { data } = response;
89
+ const { st_ret, msg_ret, raspagem } = data;
90
+ if (st_ret != "OK") throw `${st_ret} - ${msg_ret}`;
91
+ if (!raspagem)
92
+ throw `${st_ret} - ${msg_ret} | (Raspagem nao encontrada no retorno)`;
93
+ const { description, og, theme_color } = raspagem;
94
+ if (description) this.linkPreview.description = description;
95
+ if (raspagem.author) this.linkPreview.author = raspagem.author;
96
+ if (og) {
97
+ const { image, site_name, title, author } = og;
98
+ if (image)
99
+ this.linkPreview.imageSource = image.url
100
+ ? image.url
101
+ : image.url == ""
102
+ ? ""
103
+ : image;
104
+ if (author || site_name || title)
105
+ this.linkPreview.author = title
106
+ ? title
107
+ : author
108
+ ? author
109
+ : site_name
110
+ ? site_name
111
+ : "";
112
+ if (og.description) this.linkPreview.description = og.description;
89
113
  }
90
- if(theme_color) this.linkPreview.colorTheme = theme_color
114
+ if (theme_color) this.linkPreview.colorTheme = theme_color;
91
115
 
92
- if(this.linkPreview.description || this.linkPreview.imageSource) this.linkPreview.isValid = true
93
- }catch(e) {
94
- console.error("Erro ao gerar o preview do link: ", e)
116
+ if (this.linkPreview.description || this.linkPreview.imageSource)
117
+ this.linkPreview.isValid = true;
118
+ } catch (e) {
119
+ console.error("Erro ao gerar o preview do link: ", e);
95
120
  }
96
121
  },
97
122
  openUrl() {
98
- const url = this.returnURL()
99
- if(!url) return
100
- window.open(url, "_blank")
101
- }
102
- }
103
- }
123
+ const url = this.returnURL();
124
+ if (!url) return;
125
+ window.open(url, "_blank");
126
+ },
127
+ },
128
+ };
104
129
  </script>
105
130
 
106
131
  <style scoped>
107
- .link-preview {
108
- display: flex;
109
- flex-direction: column;
110
- background-color: #EEE;
111
- color: #333;
112
- cursor: pointer;
113
- margin: 5px 0;
114
- border-radius: 5px;
115
- opacity: .95;
116
- transition: opacity 300ms ease-in-out;
117
- font-size: 13.6px;
118
- }
132
+ .link-preview {
133
+ display: flex;
134
+ flex-direction: column;
135
+ background-color: #eee;
136
+ color: #333;
137
+ cursor: pointer;
138
+ margin: 5px 0;
139
+ border-radius: 5px;
140
+ opacity: 0.95;
141
+ transition: opacity 300ms ease-in-out;
142
+ font-size: 13.6px;
143
+ }
119
144
 
120
- .link-preview-image {
121
- display: flex;
122
- justify-content: center;
123
- align-items: center;
124
- padding: 1px;
125
- border-top-left-radius: 5px;
126
- border-top-right-radius: 5px;
127
- }
145
+ .link-preview-image {
146
+ display: flex;
147
+ justify-content: center;
148
+ align-items: center;
149
+ padding: 1px;
150
+ border-top-left-radius: 5px;
151
+ border-top-right-radius: 5px;
152
+ }
128
153
 
129
- .link-preview-author {
130
- margin: 5px;
131
- font-size: .615em;
132
- font-weight: bold;
133
- }
134
- .link-preview-author.mb-0 {
135
- margin-bottom: 0;
136
- }
137
- .link-preview-author h1 {
138
- overflow: hidden;
139
- text-overflow: ellipsis;
140
- white-space: nowrap;
141
- }
154
+ .link-preview-author {
155
+ margin: 5px;
156
+ font-size: 0.615em;
157
+ font-weight: bold;
158
+ }
159
+ .link-preview-author.mb-0 {
160
+ margin-bottom: 0;
161
+ }
162
+ .link-preview-author h1 {
163
+ overflow: hidden;
164
+ text-overflow: ellipsis;
165
+ white-space: nowrap;
166
+ }
142
167
 
143
- .link-preview-image img {
144
- min-width: 100px;
145
- max-width: 200px;
146
- border-top-left-radius: 5px;
147
- border-top-right-radius: 5px;
148
- }
168
+ .link-preview-image img {
169
+ min-width: 100px;
170
+ max-width: 200px;
171
+ border-top-left-radius: 5px;
172
+ border-top-right-radius: 5px;
173
+ }
149
174
 
150
- .link-preview-infos {
151
- background-color: #2626261a;
152
- padding: 5px;
153
- margin: 5px;
154
- font-size: .83em;
155
- border-radius: 5px;
156
- }
175
+ .link-preview-infos {
176
+ background-color: #2626261a;
177
+ padding: 5px;
178
+ margin: 5px;
179
+ font-size: 0.83em;
180
+ border-radius: 5px;
181
+ }
157
182
 
158
- .link-preview:hover {
159
- opacity: 1;
160
- }
161
- .link-preview:hover .link-preview-infos p {
162
- text-decoration: underline;
163
- }
164
- </style>
183
+ .link-preview:hover {
184
+ opacity: 1;
185
+ }
186
+ .link-preview:hover .link-preview-infos p {
187
+ text-decoration: underline;
188
+ }
189
+ </style>