vue-intergrall-plugins 1.0.13 → 1.0.14

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.
@@ -25,6 +25,27 @@
25
25
  return a;
26
26
  }
27
27
  }
28
+ function ownKeys(e, r) {
29
+ var t = Object.keys(e);
30
+ if (Object.getOwnPropertySymbols) {
31
+ var o = Object.getOwnPropertySymbols(e);
32
+ r && (o = o.filter(function (r) {
33
+ return Object.getOwnPropertyDescriptor(e, r).enumerable;
34
+ })), t.push.apply(t, o);
35
+ }
36
+ return t;
37
+ }
38
+ function _objectSpread2(e) {
39
+ for (var r = 1; r < arguments.length; r++) {
40
+ var t = null != arguments[r] ? arguments[r] : {};
41
+ r % 2 ? ownKeys(Object(t), !0).forEach(function (r) {
42
+ _defineProperty(e, r, t[r]);
43
+ }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) {
44
+ Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r));
45
+ });
46
+ }
47
+ return e;
48
+ }
28
49
  function _regeneratorRuntime() {
29
50
  _regeneratorRuntime = function () {
30
51
  return e;
@@ -326,6 +347,20 @@ function _regeneratorRuntime() {
326
347
  }
327
348
  }, e;
328
349
  }
350
+ function _toPrimitive(t, r) {
351
+ if ("object" != typeof t || !t) return t;
352
+ var e = t[Symbol.toPrimitive];
353
+ if (void 0 !== e) {
354
+ var i = e.call(t, r || "default");
355
+ if ("object" != typeof i) return i;
356
+ throw new TypeError("@@toPrimitive must return a primitive value.");
357
+ }
358
+ return ("string" === r ? String : Number)(t);
359
+ }
360
+ function _toPropertyKey(t) {
361
+ var i = _toPrimitive(t, "string");
362
+ return "symbol" == typeof i ? i : String(i);
363
+ }
329
364
  function _typeof(o) {
330
365
  "@babel/helpers - typeof";
331
366
 
@@ -365,6 +400,20 @@ function _asyncToGenerator(fn) {
365
400
  });
366
401
  };
367
402
  }
403
+ function _defineProperty(obj, key, value) {
404
+ key = _toPropertyKey(key);
405
+ if (key in obj) {
406
+ Object.defineProperty(obj, key, {
407
+ value: value,
408
+ enumerable: true,
409
+ configurable: true,
410
+ writable: true
411
+ });
412
+ } else {
413
+ obj[key] = value;
414
+ }
415
+ return obj;
416
+ }
368
417
  function _slicedToArray(arr, i) {
369
418
  return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest();
370
419
  }
@@ -8656,17 +8705,6 @@ var LinkPreview = __vue_component__$a;var script$5 = {
8656
8705
  if (this.isMenuOpen) this.closeMenu();
8657
8706
  this.isEmojisOpen = !this.isEmojisOpen;
8658
8707
  },
8659
- useGPTHandler: function useGPTHandler() {
8660
- if (this.isMenuOpen) this.closeMenu();
8661
- var params = {
8662
- message: this.msg
8663
- };
8664
- if (this.showMenu.gptCallback && typeof this.showMenu.gptCallback === "function") {
8665
- this.showMenu.gptCallback(params);
8666
- return;
8667
- }
8668
- this.$emit("use-gpt", params);
8669
- },
8670
8708
  addReaction: function addReaction(emoji) {
8671
8709
  this.messageReaction = this.messageReaction && this.messageReaction.hexa === emoji.hexa ? "" : {
8672
8710
  hexa: emoji.hexa,
@@ -8811,6 +8849,22 @@ var LinkPreview = __vue_component__$a;var script$5 = {
8811
8849
  var regex = /(\n|&nbsp;)/g;
8812
8850
  if (regex.test(msg)) msg = msg.replace(regex, "<br>");
8813
8851
  return msg;
8852
+ },
8853
+ returnParams: function returnParams(params) {
8854
+ var _this = this;
8855
+ var defaultParams = {
8856
+ message: this.msg
8857
+ };
8858
+ if (!params) return defaultParams;
8859
+ var keys = params.instanceKeys.split("|");
8860
+ if (!keys || !keys.length) return _objectSpread2({
8861
+ defaultParams: defaultParams
8862
+ }, params.values);
8863
+ var customParams = _objectSpread2({}, params.values);
8864
+ keys.forEach(function (key) {
8865
+ if (_this[key]) customParams[key] = _this[key];else console.warn("Cant find ".concat(key, " on 'this' instance"));
8866
+ });
8867
+ return Object.keys(customParams).length ? customParams : defaultParams;
8814
8868
  }
8815
8869
  }
8816
8870
  };/* script */
@@ -9160,23 +9214,33 @@ var __vue_render__$5 = function __vue_render__() {
9160
9214
  attrs: {
9161
9215
  "icon": ['fas', 'smile']
9162
9216
  }
9163
- })], 1) : _vm._e(), _vm._v(" "), _vm.showMenu.useGPT ? _c('span', {
9164
- directives: [{
9165
- name: "tippy",
9166
- rawName: "v-tippy"
9167
- }],
9168
- staticClass: "menu-mensagem",
9169
- attrs: {
9170
- "content": _vm.dictionary.tit_use_gpt
9171
- },
9172
- on: {
9173
- "click": _vm.useGPTHandler
9174
- }
9175
- }, [_c('fa-icon', {
9176
- attrs: {
9177
- "icon": ['fas', 'question-circle']
9178
- }
9179
- })], 1) : _vm._e()]) : _vm._e(), _vm._v(" "), _vm.isEmojisOpen ? _c('div', {
9217
+ })], 1) : _vm._e(), _vm._v(" "), _vm.showMenu.customButtons && _vm.showMenu.customButtons.length ? _vm._l(_vm.showMenu.customButtons, function (button, index) {
9218
+ return _c('span', {
9219
+ directives: [{
9220
+ name: "show",
9221
+ rawName: "v-show",
9222
+ value: button.use,
9223
+ expression: "button.use"
9224
+ }, {
9225
+ name: "tippy",
9226
+ rawName: "v-tippy"
9227
+ }],
9228
+ key: button.id || index,
9229
+ class: "" + (button.customClass || 'menu-mensagem'),
9230
+ attrs: {
9231
+ "content": button.tippyContent
9232
+ },
9233
+ on: {
9234
+ "click": function click($event) {
9235
+ button.callback(_vm.returnParams(button.params));
9236
+ }
9237
+ }
9238
+ }, [_c('fa-icon', {
9239
+ attrs: {
9240
+ "icon": ['fas', button.icon || 'question-circle']
9241
+ }
9242
+ })], 1);
9243
+ }) : _vm._e()], 2) : _vm._e(), _vm._v(" "), _vm.isEmojisOpen ? _c('div', {
9180
9244
  directives: [{
9181
9245
  name: "on-clickaway",
9182
9246
  rawName: "v-on-clickaway",
@@ -9243,7 +9307,7 @@ var __vue_staticRenderFns__$5 = [];
9243
9307
  /* style */
9244
9308
  var __vue_inject_styles__$5 = function __vue_inject_styles__(inject) {
9245
9309
  if (!inject) return;
9246
- inject("data-v-73ca470f_0", {
9310
+ inject("data-v-392a4a3e_0", {
9247
9311
  source: ":root{--message-color:#373737;--text-color:#fff;--files-bg:rgba(255, 255, 255, 0.1);--files-bg-hover:rgba(255, 255, 255, 0.1);--light:80;--threshold:60}.fade-enter-active,.fade-leave-active{transition:opacity .5s}.fade-enter,.fade-leave-to{opacity:0}.mensagem-reply{padding:5px 10px;font-size:12px;color:#666;transition:background-color 150ms ease-in-out;border-radius:5px;margin:5px 0;overflow:hidden;max-width:100%}.mensagem-reply p{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.message-reply-principal{border-left:3px solid transparent;background-color:rgba(100,100,100,.1)}.message-reply-principal:hover{background-color:rgba(100,100,100,.2)}.message-reply-outros{background-color:#f5f5f5;border-left:3px solid var(--message-color)}.message-reply-outros:hover{background-color:#ebebeb}.mensagem-reply-vazia{display:flex;align-items:center}.mensagem-reply-vazia svg{margin-right:5px;color:#ba181b}.mensagem{padding:20px 7px 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:12px;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:hover .menu-primario{visibility:visible;opacity:1}.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:9.6px;color:#67a332;width:14.4px;height:14.4px;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:11.2px}.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:6.4px;width:11.2px}.default-stick-size{width:180px;height:auto}.horario-envio{margin-right:15px;font-size:11.2px;position:absolute;left:10px;bottom:2px}.autor-mensagem{position:absolute;font-size:9.6px;white-space:nowrap;text-overflow:ellipsis;overflow:hidden;max-width:90%;font-weight:700;top:2px}.menu-primario{visibility:hidden;opacity:0;transition:opacity 150ms ease-in-out;position:absolute;font-size:11.2px;top:3px;display:flex;gap:5px;padding:2px 4px}.menu-primario.principal{left:4px;color:var(--text-color);background-color:var(--message-color)}.menu-primario.outros{right:4px;color:var(--text-color);background-color:#fff}.menu-primario.outros>span:nth-child(1){order:10}.menu-mensagem{cursor:pointer;padding:1px}.menu-flutuante{background-color:#fff;-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);border-radius:10px;position:absolute;top:20px;width:120px;min-height:50px;height:50px;max-height:50px;overflow-x:hidden;overflow-y:auto;margin:0;padding:0;display:flex;flex-direction:column;z-index:1}.menu-flutuante.principal{left:3px}.menu-flutuante.outros{right:3px}.menu-flutuante li{transition:background-color .3s ease-in-out;width:100%;cursor:pointer;padding:5px 10px;display:flex;align-items:center}.menu-flutuante li:hover{background-color:#e9e9e9}.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}.emoji-message-container{position:absolute;top:0;z-index:1;width:300px;height:250px}.emoji-message-container .sm-emoji-picker{width:300px;height:250px}.emoji-message-container .sm-emoji-picker .sm-emoji-header{overflow-x:auto;overflow-y:hidden}.reaction{position:absolute;bottom:0;border-radius:50%;display:flex;justify-content:center;align-items:center;background-color:rgba(100,100,100,.4);padding:5px;font-size:1.3em;min-width:1.8em;min-height:1.8em;max-width:1.8em;max-height:1.8em}.reaction>span{display:block;transform:translateY(-1px)}.mensagem__outros .reaction{right:-30px}.mensagem__principal .reaction{left:-30px}",
9248
9312
  map: undefined,
9249
9313
  media: undefined
@@ -9252,7 +9316,7 @@ var __vue_inject_styles__$5 = function __vue_inject_styles__(inject) {
9252
9316
  /* scoped */
9253
9317
  var __vue_scope_id__$5 = undefined;
9254
9318
  /* module identifier */
9255
- var __vue_module_identifier__$5 = "data-v-73ca470f";
9319
+ var __vue_module_identifier__$5 = "data-v-392a4a3e";
9256
9320
  /* functional template */
9257
9321
  var __vue_is_functional_template__$5 = false;
9258
9322
  /* style inject shadow dom */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "vue-intergrall-plugins",
3
- "version": "1.0.13",
3
+ "version": "1.0.14",
4
4
  "description": "",
5
5
  "main": "dist/vue-intergrall-plugins.ssr.js",
6
6
  "browser": "dist/vue-intergrall-plugins.esm.js",
@@ -228,15 +228,19 @@
228
228
  >
229
229
  <fa-icon :icon="['fas', 'smile']" />
230
230
  </span>
231
- <span
232
- v-if="showMenu.useGPT"
233
- @click="useGPTHandler"
234
- class="menu-mensagem"
235
- v-tippy
236
- :content="dictionary.tit_use_gpt"
237
- >
238
- <fa-icon :icon="['fas', 'question-circle']" />
239
- </span>
231
+ <template v-if="showMenu.customButtons && showMenu.customButtons.length">
232
+ <span
233
+ v-for="(button, index) in showMenu.customButtons"
234
+ :key="button.id || index"
235
+ v-show="button.use"
236
+ @click="button.callback(returnParams(button.params))"
237
+ :class="`${button.customClass || 'menu-mensagem'}`"
238
+ v-tippy
239
+ :content="button.tippyContent"
240
+ >
241
+ <fa-icon :icon="['fas', button.icon || 'question-circle']" />
242
+ </span>
243
+ </template>
240
244
  </div>
241
245
  <div
242
246
  class="emoji-message-container"
@@ -477,19 +481,6 @@ export default {
477
481
  if (this.isMenuOpen) this.closeMenu();
478
482
  this.isEmojisOpen = !this.isEmojisOpen;
479
483
  },
480
- useGPTHandler() {
481
- if (this.isMenuOpen) this.closeMenu();
482
- const params = {
483
- message: this.msg,
484
- };
485
-
486
- if (this.showMenu.gptCallback && typeof this.showMenu.gptCallback === "function") {
487
- this.showMenu.gptCallback(params);
488
- return;
489
- }
490
-
491
- this.$emit("use-gpt", params);
492
- },
493
484
  addReaction(emoji) {
494
485
  this.messageReaction =
495
486
  this.messageReaction && this.messageReaction.hexa === emoji.hexa
@@ -657,6 +648,28 @@ export default {
657
648
  if (regex.test(msg)) msg = msg.replace(regex, "<br>");
658
649
  return msg;
659
650
  },
651
+ returnParams(params) {
652
+ const defaultParams = {
653
+ message: this.msg,
654
+ };
655
+
656
+ if (!params) return defaultParams;
657
+
658
+ const keys = params.instanceKeys.split("|");
659
+ if (!keys || !keys.length)
660
+ return {
661
+ defaultParams,
662
+ ...params.values,
663
+ };
664
+
665
+ const customParams = { ...params.values };
666
+ keys.forEach((key) => {
667
+ if (this[key]) customParams[key] = this[key];
668
+ else console.warn(`Cant find ${key} on 'this' instance`);
669
+ });
670
+
671
+ return Object.keys(customParams).length ? customParams : defaultParams;
672
+ },
660
673
  },
661
674
  };
662
675
  </script>