vue-intergrall-plugins 0.0.242 → 0.0.243

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.
@@ -11951,23 +11951,47 @@ var script$5 = {
11951
11951
  adjustFontColor: function adjustFontColor(cor) {
11952
11952
  try {
11953
11953
  var result = /^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(cor);
11954
- result = result ? {
11955
- r: parseInt(result[1], 16),
11956
- g: parseInt(result[2], 16),
11957
- b: parseInt(result[3], 16)
11958
- } : null;
11959
11954
  if (!result) return;
11960
- var _result = result,
11961
- r = _result.r,
11962
- g = _result.g,
11963
- b = _result.b;
11964
- var rgb = parseInt("".concat(r).concat(g).concat(b), 16);
11965
- var r1 = rgb >> 16 & 0xFF;
11966
- var g1 = rgb >> 8 & 0xFF;
11967
- var b1 = rgb & 0xFF;
11968
- var luma = 0.2126 * r1 + 0.7152 * g1 + 0.0722 * b1;
11955
+ var r = parseInt(result[1], 16);
11956
+ var g = parseInt(result[2], 16);
11957
+ var b = parseInt(result[3], 16);
11958
+ r /= 255, g /= 255, b /= 255;
11959
+ var max = Math.max(r, g, b),
11960
+ min = Math.min(r, g, b);
11961
+ var h,
11962
+ s,
11963
+ l = (max + min) / 2;
11964
+
11965
+ if (max == min) {
11966
+ h = s = 0; // achromatic
11967
+ } else {
11968
+ var d = max - min;
11969
+ s = l > 0.5 ? d / (2 - max - min) : d / (max + min);
11970
+
11971
+ switch (max) {
11972
+ case r:
11973
+ h = (g - b) / d + (g < b ? 6 : 0);
11974
+ break;
11975
+
11976
+ case g:
11977
+ h = (b - r) / d + 2;
11978
+ break;
11979
+
11980
+ case b:
11981
+ h = (r - g) / d + 4;
11982
+ break;
11983
+ }
11984
+
11985
+ h /= 6;
11986
+ }
11987
+
11988
+ s = s * 100;
11989
+ s = Math.round(s);
11990
+ l = l * 100;
11991
+ l = Math.round(l);
11992
+ h = Math.round(360 * h);
11969
11993
  var root = document.documentElement;
11970
- root.style.setProperty('--text-color', luma < 40 ? "#FFF" : "#111B21");
11994
+ root.style.setProperty('--text-color', l <= 50 ? "#FFF" : "#111B21");
11971
11995
  } catch (e) {
11972
11996
  console.error("Erro ao ajustar a cor da mensagem: ", e);
11973
11997
  }
@@ -12266,7 +12290,7 @@ var __vue_staticRenderFns__$5 = [];
12266
12290
 
12267
12291
  var __vue_inject_styles__$5 = function __vue_inject_styles__(inject) {
12268
12292
  if (!inject) return;
12269
- inject("data-v-5a3a5b00_0", {
12293
+ inject("data-v-44a68ecf_0", {
12270
12294
  source: ":root{--message-color:#373737;--text-color:#FFF;--light:80;--threshold:60}.fade-enter-active,.fade-leave-active{transition:opacity .5s}.fade-enter,.fade-leave-to{opacity:0}.mensagem{padding:14px 7px;border-radius:5px;min-width:150px;min-height:60px;width:-webkit-fit-content;width:-moz-fit-content;width:fit-content;position:relative;max-width:80%;margin-bottom:10px;font-size:.75rem;word-break:break-word;-webkit-box-shadow:0 3px 1px -2px rgba(0,0,0,.2),0 2px 2px 0 rgba(0,0,0,.14),0 1px 5px 0 rgba(0,0,0,.12);-moz-box-shadow:0 3px 1px -2px rgba(0,0,0,.2),0 2px 2px 0 rgba(0,0,0,.14),0 1px 5px 0 rgba(0,0,0,.12);box-shadow:0 3px 1px -2px rgba(0,0,0,.2),0 2px 2px 0 rgba(0,0,0,.14),0 1px 5px 0 rgba(0,0,0,.12)}.mensagem.max-w-60{max-width:60%}.mensagem.mapa{width:100%}.mensagem.hist-msg{animation:show 1s}.mensagem a{margin-right:5px;font-weight:550;color:inherit;text-decoration:none}.mensagem a:hover{text-decoration:underline}.message p{white-space:pre-wrap}.mensagem-anexo a,.mensagem-div-mapa a{white-space:nowrap;text-overflow:ellipsis;overflow:hidden}.reply{cursor:pointer;position:absolute;right:53px;bottom:5px;font-size:.6rem;color:#67a332;width:.9rem;height:.9rem;display:flex;justify-content:center;align-items:center;border-radius:50%;background-color:#fff}.reply svg{margin-top:-1px;margin-right:-1px}.reply-with-2-icons{right:30px}.check{cursor:pointer;position:absolute;right:10px;bottom:2px;font-size:.7rem}.check.visualizado,.check.visualizado svg{color:#006daa}.check.verde,.check.verde svg{color:#4f772d}.check.vermelho,.check.vermelho svg{color:#ba181b}.check.cinza,.check.cinza svg{color:#999}.check.preto,.check.preto svg{color:#666}.star{cursor:pointer;position:absolute;right:30px;bottom:2px;font-size:.4rem;width:11.2px}.default-stick-size{width:180px;height:auto}.horario-envio{margin-right:15px;font-size:.7rem;position:absolute;left:10px;bottom:2px}.autor-mensagem{position:absolute;font-size:.6rem;white-space:nowrap;text-overflow:ellipsis;overflow:hidden;max-width:90%;font-weight:700;top:2px}.mensagem__principal{width:100%;display:flex;justify-content:flex-end}.mensagem__principal>.mensagem::after{content:\"\";width:0;height:0;position:absolute;border-left:10px solid transparent;border-right:10px solid transparent;border-top:10px solid var(--message-color);bottom:5px;right:-10px;transform:rotate(-90deg)}.mensagem__principal>.mensagem{background-color:var(--message-color);color:var(--text-color)}.mensagem__principal>.mensagem .horario-envio{color:var(--text-color)}.mensagem__principal>.mensagem .autor-mensagem{right:5px;color:var(--text-color)}.mensagem__outros{width:100%;display:flex}.mensagem__outros>.mensagem{background-color:#fff;color:#333}.mensagem__outros>.mensagem::after{content:\"\";width:0;height:0;position:absolute;border-left:10px solid transparent;border-right:10px solid transparent;border-top:10px solid #fff;bottom:5px;left:-10px;transform:rotate(90deg)}.mensagem__outros>.autor-mensagem{left:5px;color:#333}.mensagem-div-mapa{width:100%;display:flex;justify-content:center;align-items:center;flex-direction:column;margin-bottom:5px}.msg-mapa{width:100%;min-height:225px;height:100%;box-sizing:initial}.msg-mapa img{max-width:none!important}.info-mapa{list-style-type:none}.info-mapa li.title{font-size:.85em}.info-mapa li.address,.info-mapa li.url{font-size:.85em}.info-mapa li.url{font-size:.85em}.tooltip-list{margin:0;padding:0;display:flex;flex-direction:column;justify-content:center;align-items:flex-start}",
12271
12295
  map: undefined,
12272
12296
  media: undefined
@@ -12278,7 +12302,7 @@ var __vue_inject_styles__$5 = function __vue_inject_styles__(inject) {
12278
12302
  var __vue_scope_id__$5 = undefined;
12279
12303
  /* module identifier */
12280
12304
 
12281
- var __vue_module_identifier__$5 = "data-v-5a3a5b00";
12305
+ var __vue_module_identifier__$5 = "data-v-44a68ecf";
12282
12306
  /* functional template */
12283
12307
 
12284
12308
  var __vue_is_functional_template__$5 = false;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "vue-intergrall-plugins",
3
- "version": "0.0.242",
3
+ "version": "0.0.243",
4
4
  "description": "",
5
5
  "main": "dist/vue-intergrall-plugins.ssr.js",
6
6
  "browser": "dist/vue-intergrall-plugins.esm.js",
@@ -230,27 +230,39 @@ export default {
230
230
  },
231
231
  adjustFontColor(cor) {
232
232
  try {
233
- let result = /^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(cor)
234
-
235
- result = result ? {
236
- r: parseInt(result[1], 16),
237
- g: parseInt(result[2], 16),
238
- b: parseInt(result[3], 16)
239
- } : null
240
-
233
+ var result = /^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(cor);
234
+
241
235
  if(!result) return
242
-
243
- const { r, g, b }= result
244
236
 
245
- const rgb = parseInt(`${r}${g}${b}`, 16)
246
- const r1 = rgb >> 16 & 0xFF
247
- const g1 = rgb >> 8 & 0xFF
248
- const b1 = rgb & 0xFF
237
+ var r = parseInt(result[1], 16);
238
+ var g = parseInt(result[2], 16);
239
+ var b = parseInt(result[3], 16);
240
+
241
+ r /= 255, g /= 255, b /= 255;
242
+ var max = Math.max(r, g, b), min = Math.min(r, g, b);
243
+ var h, s, l = (max + min) / 2;
244
+
245
+ if(max == min){
246
+ h = s = 0; // achromatic
247
+ } else {
248
+ var d = max - min;
249
+ s = l > 0.5 ? d / (2 - max - min) : d / (max + min);
250
+ switch(max) {
251
+ case r: h = (g - b) / d + (g < b ? 6 : 0); break;
252
+ case g: h = (b - r) / d + 2; break;
253
+ case b: h = (r - g) / d + 4; break;
254
+ }
255
+ h /= 6;
256
+ }
249
257
 
250
- const luma = 0.2126 * r1 + 0.7152 * g1 + 0.0722 * b1
258
+ s = s*100;
259
+ s = Math.round(s);
260
+ l = l*100;
261
+ l = Math.round(l);
262
+ h = Math.round(360*h);
251
263
 
252
264
  const root = document.documentElement
253
- root.style.setProperty('--text-color', luma < 40 ? "#FFF" : "#111B21")
265
+ root.style.setProperty('--text-color', l <= 50 ? "#FFF" : "#111B21")
254
266
  }catch(e) {
255
267
  console.error("Erro ao ajustar a cor da mensagem: ", e)
256
268
  }