vue-intergrall-plugins 0.0.164 → 0.0.167

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.
@@ -7763,7 +7763,7 @@ var axios_1 = axios$1;
7763
7763
  // Allow use of default import syntax in TypeScript
7764
7764
  var _default = axios$1;
7765
7765
  axios_1.default = _default;var axios = axios_1;vue__default["default"].prototype.$httpRequest = axios;
7766
- var baseURL = window.location.hostname == 'localhost' ? "https://linux07/im/atdHumano/middleware/atd_api.php" : "https://".concat(window.location.hostname);
7766
+ var baseURL = window.location.hostname == 'localhost' ? "https://linux07/im/atdHumano/middleware/atd_api.php" : "https://".concat(window.location.hostname, "/im/atdHumano/middleware/atd_api.php");
7767
7767
  var dev = window.location.hostname == 'localhost' ? '&teste=levchat2' : '';
7768
7768
  var standardMessages = {
7769
7769
  methods: {
@@ -7779,7 +7779,7 @@ var standardMessages = {
7779
7779
  return _context.abrupt("return", _this.$httpRequest({
7780
7780
  method: 'get',
7781
7781
  url: "".concat(baseURL, "/get-messages/").concat(type, "?token_cliente=").concat(token).concat(dev) // headers: {
7782
- // Authorization: "Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJhdGQiOiJNS1VJNnhZdm1xSWVFaWpuMXJwMERkZzQ0ZjFzd3dpbTRsNXd3WWFrVUJtd3d4YjQ0YXd3ZVJ1U2lUeUxxVTEiLCJtYW5hZ2VyIjoiTUtVd0J6YzFnVkIzaWNlNE5yU01lbU5aekI1MkExTzdtNXdhdmQyYnd3eGI0NGF3d3d3eGI0NGF3d3FVU2NoIiwibnJvcyI6WyI0MSJdLCJhdXRoIjoiTUtVVnAxTWR3d2ltNGw1d3dYTnNjWDg5R3V4c1RsZUVqdGdpNjhoNk1JUzl6d0xBTGVRbjhUUCIsImlhdCI6MTY0NjMzOTkyOCwiZXhwIjoxNjQ2NDI2MzI4fQ.QNu0uO3qV-Lqvu8Xww1F_x8Bwnjlm175IVdM89EgPM0"
7782
+ // Authorization: "Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJhdGQiOiJNS1VuWHd3eGI0NGF3dzkwVVRXOGlIYUREd2doNm1sOFB0RVdoUHRWUjRHZW5YNnd3aW00bDV3d3M5SHB0bUIiLCJtYW5hZ2VyIjoiTUtVWHJHY2hOUlRZTkF3aHRvVUxldmtJYUdHcW9vSTVad3d4YjQ0YXd3ODRZQWxIVXpPZFZ3d3hiNDRhd3dpIiwibnJvcyI6WyI0OCJdLCJhdXRoIjoiTUtVd3d4YjQ0YXd3ZFVQVXQwVUlhaTNwanFGcmlQZ2dtaTY0SkViVnJJOXVjWFdBODRXRzR5ciIsImlhdCI6MTY0NjY1NzA0OSwiZXhwIjoxNjQ2NzQzNDQ5fQ.MqUARy1bbSc0iSOBcERwPYesIf-AdDcZaHa1yvn3RDM"
7783
7783
  // }
7784
7784
 
7785
7785
  }).then(function (response) {
@@ -7947,12 +7947,14 @@ var script$g = {
7947
7947
  if (!messageData.length) {
7948
7948
  this.formatted_messages_3.push(this.dictionary.msg_erro_sem_msg_formatada);
7949
7949
  this.key_3 = this.formatted_messages_3[0];
7950
+ this.openFormattedMsgType2(this.key_3);
7950
7951
  } else {
7951
7952
  this.formatted_messages_3 = messageData;
7952
7953
 
7953
7954
  if (this.formatted_messages_3.length == 1) {
7954
7955
  if (this.formatted_messages_3[0].cod) {
7955
7956
  this.key_3 = this.formatted_messages_3[0];
7957
+ this.openFormattedMsgType2(this.key_3);
7956
7958
  }
7957
7959
  }
7958
7960
  }
@@ -7970,7 +7972,8 @@ var script$g = {
7970
7972
  },
7971
7973
  openMsg: function openMsg() {
7972
7974
  try {
7973
- this.messageType == 1 ? this.insertFormattedMessage(this.key_3) : this.openFormattedMsgType2(this.key_3);
7975
+ // this.messageType == 1 ? this.insertFormattedMessage(this.key_3) :
7976
+ this.openFormattedMsgType2(this.key_3);
7974
7977
  } catch (e) {
7975
7978
  console.error("Error in openMsg: ", e);
7976
7979
  }
@@ -7988,17 +7991,13 @@ var script$g = {
7988
7991
  console.error("Error in openFormattedMsgType2: ", e);
7989
7992
  }
7990
7993
  },
7991
- insertFormattedMessage: function insertFormattedMessage(key) {
7994
+ insertFormattedMessage: function insertFormattedMessage() {
7992
7995
  try {
7993
- if (!key) return this.$toasted.global.defaultError({
7996
+ if (!this.key_3) return this.$toasted.global.defaultError({
7994
7997
  msg: 'Selecione uma mensagem'
7995
- });
7996
- if (!key.cod) throw new Error("Chave informada no parametro nao possue codigo");
7997
- var value = key.value;
7998
- var finalMessage = "".concat(this.message).concat(this.message && !this.message.endsWith(" ") ? " ".concat(value) : value);
7999
- return value ? this.$emit("add-standard-message", finalMessage) : this.$toasted.global.emConstrucao({
8000
- msg: 'Mensagem vazia'
8001
- });
7998
+ }); // const { value } = key
7999
+ // const finalMessage = `${this.message}${this.message && !this.message.endsWith(" ") ? ` ${value}` : value}`
8000
+ // return value ? this.$emit("add-standard-message", finalMessage) : this.$toasted.global.emConstrucao({msg: 'Mensagem vazia'})
8002
8001
  } catch (e) {
8003
8002
  console.error("Erro ao inserir mensagem formatada: ", e);
8004
8003
  }
@@ -8112,21 +8111,7 @@ var __vue_render__$g = function __vue_render__() {
8112
8111
  "slot": "no-options"
8113
8112
  },
8114
8113
  slot: "no-options"
8115
- }, [_vm._v(" " + _vm._s(_vm.dictionary.msg_sem_resultados) + " ")])]), _vm._v(" "), _vm.key_3.cod ? [_vm.messageType == 1 ? _c('span', {
8116
- staticClass: "text-footer--btn-select-03",
8117
- attrs: {
8118
- "title": _vm.dictionary.title_btn_preencher_msg_formatada
8119
- },
8120
- on: {
8121
- "click": function click($event) {
8122
- return _vm.insertFormattedMessage(_vm.key_3);
8123
- }
8124
- }
8125
- }, [_c('fa-icon', {
8126
- attrs: {
8127
- "icon": ['fas', 'level-up-alt']
8128
- }
8129
- })], 1) : _vm.messageType == 2 ? _c('span', {
8114
+ }, [_vm._v(" " + _vm._s(_vm.dictionary.msg_sem_resultados) + " ")])]), _vm._v(" "), _vm.key_3.cod ? [_c('span', {
8130
8115
  staticClass: "text-footer--btn-select-03",
8131
8116
  attrs: {
8132
8117
  "title": _vm.dictionary.title_btn_abrir_msg_tipo_2
@@ -8140,7 +8125,7 @@ var __vue_render__$g = function __vue_render__() {
8140
8125
  attrs: {
8141
8126
  "icon": ['fas', 'file-alt']
8142
8127
  }
8143
- })], 1) : _vm._e()] : _vm._e()], 2) : _vm.key_2 && _vm.loadingReq ? _c('div', {
8128
+ })], 1)] : _vm._e()], 2) : _vm.key_2 && _vm.loadingReq ? _c('div', {
8144
8129
  staticClass: "loader-select"
8145
8130
  }, [_c('VueLoader')], 1) : _vm._e()])], 2)], 2);
8146
8131
  };
@@ -8150,7 +8135,7 @@ var __vue_staticRenderFns__$g = [];
8150
8135
 
8151
8136
  var __vue_inject_styles__$g = function __vue_inject_styles__(inject) {
8152
8137
  if (!inject) return;
8153
- inject("data-v-9fe38344_0", {
8138
+ inject("data-v-2e6ac510_0", {
8154
8139
  source: ".transition-selects{min-height:80px;display:flex;flex-direction:column;width:100%}.loader-select{position:relative;min-height:35px;background:#fff;width:100%;border:1px solid #ccc;border-radius:5px;z-index:1}",
8155
8140
  map: undefined,
8156
8141
  media: undefined
@@ -8162,7 +8147,7 @@ var __vue_inject_styles__$g = function __vue_inject_styles__(inject) {
8162
8147
  var __vue_scope_id__$g = undefined;
8163
8148
  /* module identifier */
8164
8149
 
8165
- var __vue_module_identifier__$g = "data-v-9fe38344";
8150
+ var __vue_module_identifier__$g = "data-v-2e6ac510";
8166
8151
  /* functional template */
8167
8152
 
8168
8153
  var __vue_is_functional_template__$g = false;
@@ -8302,7 +8287,8 @@ var script$f = {
8302
8287
  this.$root.$refs["tf-".concat(this.textId)] = this;
8303
8288
  },
8304
8289
  mounted: function mounted() {
8305
- setResizeListeners(this.$el, ".js-autoresize", ".js-parentresize"); // this.$root.$on("drop-file", (file, type) => { if(this.buttons.hasFiles) this.fileUpload(file, type, true) })
8290
+ setResizeListeners(this.$el, ".js-autoresize", ".js-parentresize");
8291
+ window.addEventListener("message", this.listenerPostMessage, false); // this.$root.$on("drop-file", (file, type) => { if(this.buttons.hasFiles) this.fileUpload(file, type, true) })
8306
8292
  // this.$root.$on("toggle-msg-formatada", () => { this.toggleStandardMessages() })
8307
8293
  // this.$root.$on("textarea-focus", () => { this.focusTextarea() })
8308
8294
  // this.$root.$on("resize-footer-template", () => { this.adjustChatHeight() })
@@ -8310,6 +8296,26 @@ var script$f = {
8310
8296
  // if(this.cssStyle.outsideButtons) if(this.$root.$refs.chatCorpo) this.$root.$refs.chatCorpo.setOutsideButtons(this.cssStyle.outsideButtons)
8311
8297
  },
8312
8298
  methods: {
8299
+ listenerPostMessage: function listenerPostMessage(event) {
8300
+ if (!this.formattedMessageSettings.hasStandardMessages) return;
8301
+ if (event.data.gerenciador || event.data.abrirFishing || event.data.multiplos_contatos || event.data.inserir_cliente_omni || event.data.multiple_contatos) return;
8302
+
8303
+ if (event.data == '') {
8304
+ if (this.showStandardMessages) {
8305
+ this.closeBlockerStandardMessage();
8306
+ this.toggleStandardMessages();
8307
+ }
8308
+
8309
+ this.$toasted.global.emConstrucao({
8310
+ msg: this.dicionario.msg_erro_sem_msg_formatada
8311
+ });
8312
+ } else if (typeof event.data === "string") {
8313
+ this.message = event.data;
8314
+ this.focusTextarea();
8315
+ this.closeBlockerStandardMessage();
8316
+ this.toggleStandardMessages();
8317
+ }
8318
+ },
8313
8319
  closeEmojis: function closeEmojis() {
8314
8320
  try {
8315
8321
  this.$root.$refs["etf-".concat(this.textId)].showEmojis ? this.$root.$refs["etf-".concat(this.textId)].away() : '';
@@ -8582,11 +8588,13 @@ var script$f = {
8582
8588
  this.sendFinalMessage();
8583
8589
  }
8584
8590
  },
8585
- destroyed: function destroyed() {// this.$root.$off("drop-file")
8591
+ destroyed: function destroyed() {
8592
+ // this.$root.$off("drop-file")
8586
8593
  // this.$root.$off("toggle-msg-formatada")
8587
8594
  // this.$root.$off("textarea-focus")
8588
8595
  // this.$root.$off("clear-footer-message")
8589
8596
  // this.$root.$off("resize-footer-template")
8597
+ window.removeEventListener("message", this.listenerPostMessage);
8590
8598
  }
8591
8599
  };/* script */
8592
8600
  var __vue_script__$f = script$f;
@@ -8754,7 +8762,7 @@ var __vue_staticRenderFns__$f = [];
8754
8762
 
8755
8763
  var __vue_inject_styles__$f = function __vue_inject_styles__(inject) {
8756
8764
  if (!inject) return;
8757
- inject("data-v-35ab0f5c_0", {
8765
+ inject("data-v-7f95b9ce_0", {
8758
8766
  source: ".toasted svg{margin-right:10px}.d-none{display:none}ul{list-style-type:none}.text-footer-container{display:flex;justify-content:center;align-items:center;flex-direction:column;width:100%;position:relative}.text-footer-container .text-footer{min-height:48px;box-shadow:0 3px 7px -2px rgba(0,0,0,.45);position:relative;display:flex;justify-content:center;align-items:center;border:1px solid #ccc;padding:5px 2px 5px 5px;border-radius:5px}.text-footer-container .text-footer.full{width:100%}.text-footer-container .text-footer.almostFull{width:95%}.text-footer-container .text-footer.medium{width:75%}.text-footer-container.bigger .text-footer{height:80px}.text-footer-container.bigger .text-footer>textarea{font-size:.875rem;height:75px;max-height:75px;min-height:75px}.text-footer-container textarea{margin:0 5px;border:unset;flex:1;resize:none;min-height:30px;max-height:60px;font-size:.875rem;font-family:inherit;background:inherit}.text-footer-container textarea:focus{outline:unset}.text-footer-container textarea::placeholder{font-size:.75rem}.text-footer-container .text-footer-audio{flex:1;display:flex;justify-content:center;align-items:center}.text-footer-container audio{flex:1;outline:unset;width:auto;height:38px}.text-footer-container .delete-audio{display:flex;justify-content:center;align-items:center;color:#e74c3c;transition:background .3s;border-radius:50%;font-size:1rem;padding:10px;cursor:pointer;margin:0 5px;width:31px;height:31px}.text-footer-container .delete-audio:hover{background-color:rgba(208,0,0,.2)}.text-footer-container .max-characters{font-size:.575rem;z-index:1;color:#444;position:relative;top:30px;left:-30px}.text-footer-container .max-characters.no-width{width:0}.text-footer-container .text-footer-actions{display:flex}.text-footer-container .text-footer-actions.outside-buttons{display:flex;align-items:center;justify-content:flex-end;position:absolute;top:-42px;right:2px;background-color:#ddd;box-shadow:inset 0 -10px 5px -11px rgba(0,0,0,.5)}.text-footer-container .text-footer-actions .text-footer-actions--btn{display:flex;justify-content:center;align-items:center;color:#777;border-radius:50%;transition:background .3s;padding:10px;font-size:1rem;width:36px;height:36px;cursor:pointer;margin-right:2.5px}.text-footer-container .text-footer-actions .text-footer-actions--btn:last-child{margin-right:unset}.text-footer-container .text-footer-actions .text-footer-actions--btn:hover{background-color:rgba(0,0,0,.1)}.text-footer-container .text-footer-actions .text-footer-actions--btn.files-activated{background-color:rgba(0,0,0,.1)}.text-footer-container .text-footer-actions .text-footer-actions--btn.audio-activated{background-color:rgba(208,0,0,.7);color:#fff}.text-footer-container .text-footer-actions .text-footer-actions--btn.left-button{position:absolute;left:0}.text-footer-container .text-footer-hsm-container{margin:12px 0 7px 0}.text-footer-container .text-footer-hsm-container.full{width:100%}.text-footer-container .text-footer-hsm-container.almostFull{width:95%}.text-footer-container .text-footer-hsm-container.medium{width:75%}.text-footer-container .text-footer-hsm-container .text-footer-v-select{border-radius:5px;margin-bottom:5px}.text-footer-container .text-footer-hsm-container .text-footer-select-03{display:flex;align-items:center;flex:1;width:100%}.text-footer-container .text-footer-hsm-container .text-footer-select-03 .text-footer-v-select{flex:1}.text-footer-container .text-footer-hsm-container .text-footer-select-03 .text-footer--btn-select-03{transition-duration:.3s;user-select:none;cursor:pointer;box-shadow:inset 0 -3px rgba(0,0,0,.2);opacity:.9;border-radius:2.5px;display:flex;justify-content:center;align-items:center;margin-left:5px;margin-bottom:5px;background-color:#f7fe72;width:32px;height:32px}.text-footer-container .text-footer-hsm-container .text-footer-select-03 .text-footer--btn-select-03:hover{opacity:1}.text-footer-container .text-footer-hsm-container .text-footer-select-03 .text-footer--btn-select-03:active{opacity:1;box-shadow:inset 0 -1px rgba(0,0,0,.2);-webkit-transform:translateY(1px);-moz-transform:translateY(1px);-o-transform:translateY(1px);-ms-transform:translateY(1px);transform:translateY(1px)}.text-footer-container .text-footer-hsm-container .text-footer-select-03 .text-footer--btn-select-03 svg{font-size:1rem}.text-footer-container .text-footer-files-container{position:absolute;right:0;top:-55px;padding:5px;background-color:rgba(0,0,0,.4);border-radius:5px;display:flex;align-items:center;justify-content:space-between;z-index:1}.text-footer-container .text-footer-files-container.horizontal{right:-55px;flex-direction:column}.text-footer-container .text-footer-files-container .files-btn{transition-duration:.3s;transition-property:opacity;opacity:.8;cursor:pointer;display:flex;justify-content:center;align-items:center;border-radius:10px;padding:3px;width:40px;height:40px;font-size:1rem;color:#fff}.text-footer-container .text-footer-files-container .files-btn:hover{opacity:1}.text-footer-container .text-footer-files-container .files-btn svg{color:#fff}.text-footer-container .text-footer-files-container .files-btn.images{background-color:#9575cd;margin-right:5px}.text-footer-container .text-footer-files-container .files-btn.images.margin-bottom{margin-right:unset;margin-bottom:5px}.text-footer-container .text-footer-files-container .files-btn.docs{background-color:#7986cb;margin-right:5px}.text-footer-container .text-footer-files-container .files-btn.system{background-color:#49a349}.text-footer-container .text-footer-preview-container{cursor:default;position:absolute;left:0;background-color:#f1f1f1;border:2px solid #ccc;border-bottom:unset;border-top-left-radius:2.5px;border-top-right-radius:2.5px}.text-footer-container .text-footer-preview-container.isDoc{top:-50px;width:100%;height:45px}.text-footer-container .text-footer-preview-container.isImg,.text-footer-container .text-footer-preview-container.isMultiple{top:-205px;width:100%;height:200px}.text-footer-container .text-footer-preview-container.isImg .text-footer-image-preview{height:170px}.text-footer-container .text-footer-preview-container.isError{top:-80px;width:100%;height:75px}.text-footer-container .text-footer-alt{margin-top:-12px;width:100%;padding:0 10px}.text-footer-container .text-footer-alt .text-footer-out-session{margin-top:12px}.text-footer-container .text-footer-alt .text-footer-sem-24h{font-size:.8rem;text-align:right;font-weight:600;letter-spacing:-.5px;color:#dd7f0c;margin-top:5px;position:absolute;right:0}.text-footer-container .text-footer-alt .sem-templates{margin-top:10px;font-size:.8rem;text-align:right;font-weight:600;letter-spacing:-.5px;color:#921e12}.text-footer-container .text-footer-alt .text-footer-templates{position:relative;width:100%}.text-footer-container .text-footer-alt .text-footer-templates .text-footer-group-selection{width:100%;display:flex;align-items:center}.text-footer-container .text-footer-alt .text-footer-templates .text-footer-group-selection h4{margin-right:5px}.text-footer-container .text-footer-alt .text-footer-templates .text-footer-group-selection .sm__select{flex:1}.vs__dropdown-menu{font-size:.85rem!important}.emoji-mart-anchor,.emoji-mart-emoji span{cursor:pointer!important}.emoji-mart{z-index:2!important}.emoji-mart-scroll{overflow-x:hidden}",
8759
8767
  map: undefined,
8760
8768
  media: undefined
@@ -8766,7 +8774,7 @@ var __vue_inject_styles__$f = function __vue_inject_styles__(inject) {
8766
8774
  var __vue_scope_id__$f = undefined;
8767
8775
  /* module identifier */
8768
8776
 
8769
- var __vue_module_identifier__$f = "data-v-35ab0f5c";
8777
+ var __vue_module_identifier__$f = "data-v-7f95b9ce";
8770
8778
  /* functional template */
8771
8779
 
8772
8780
  var __vue_is_functional_template__$f = false;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "vue-intergrall-plugins",
3
- "version": "0.0.164",
3
+ "version": "0.0.167",
4
4
  "description": "",
5
5
  "main": "dist/vue-intergrall-plugins.ssr.js",
6
6
  "browser": "dist/vue-intergrall-plugins.esm.js",
@@ -50,10 +50,10 @@
50
50
  <div slot="no-options"> {{ dictionary.msg_sem_resultados }} </div>
51
51
  </v-select>
52
52
  <template v-if="key_3.cod">
53
- <span class="text-footer--btn-select-03" v-if="messageType == 1" :title="dictionary.title_btn_preencher_msg_formatada" @click="insertFormattedMessage(key_3)">
53
+ <!-- <span class="text-footer--btn-select-03" v-if="messageType == 1" :title="dictionary.title_btn_preencher_msg_formatada" @click="insertFormattedMessage(key_3)">
54
54
  <fa-icon :icon="['fas', 'level-up-alt']" />
55
- </span>
56
- <span class="text-footer--btn-select-03" v-else-if="messageType == 2" :title="dictionary.title_btn_abrir_msg_tipo_2" @click="openFormattedMsgType2(key_3)">
55
+ </span> -->
56
+ <span class="text-footer--btn-select-03" :title="dictionary.title_btn_abrir_msg_tipo_2" @click="openFormattedMsgType2(key_3)"> <!-- v-else-if="messageType == 2" -->
57
57
  <fa-icon :icon="['fas', 'file-alt']" />
58
58
  </span>
59
59
  </template>
@@ -198,11 +198,13 @@ export default {
198
198
  if(!messageData.length){
199
199
  this.formatted_messages_3.push(this.dictionary.msg_erro_sem_msg_formatada)
200
200
  this.key_3 = this.formatted_messages_3[0]
201
+ this.openFormattedMsgType2(this.key_3)
201
202
  }else{
202
203
  this.formatted_messages_3 = messageData
203
204
  if(this.formatted_messages_3.length == 1) {
204
205
  if(this.formatted_messages_3[0].cod) {
205
206
  this.key_3 = this.formatted_messages_3[0]
207
+ this.openFormattedMsgType2(this.key_3)
206
208
  }
207
209
  }
208
210
  }
@@ -219,7 +221,8 @@ export default {
219
221
  },
220
222
  openMsg() {
221
223
  try {
222
- this.messageType == 1 ? this.insertFormattedMessage(this.key_3) : this.openFormattedMsgType2(this.key_3)
224
+ // this.messageType == 1 ? this.insertFormattedMessage(this.key_3) :
225
+ this.openFormattedMsgType2(this.key_3)
223
226
  }catch(e) {
224
227
  console.error("Error in openMsg: ", e)
225
228
  }
@@ -234,13 +237,12 @@ export default {
234
237
  console.error("Error in openFormattedMsgType2: ", e)
235
238
  }
236
239
  },
237
- insertFormattedMessage(key) {
240
+ insertFormattedMessage() {
238
241
  try {
239
- if(!key) return this.$toasted.global.defaultError({msg: 'Selecione uma mensagem'})
240
- if(!key.cod) throw new Error("Chave informada no parametro nao possue codigo")
241
- const { value } = key
242
- const finalMessage = `${this.message}${this.message && !this.message.endsWith(" ") ? ` ${value}` : value}`
243
- return value ? this.$emit("add-standard-message", finalMessage) : this.$toasted.global.emConstrucao({msg: 'Mensagem vazia'})
242
+ if(!this.key_3) return this.$toasted.global.defaultError({msg: 'Selecione uma mensagem'})
243
+ // const { value } = key
244
+ // const finalMessage = `${this.message}${this.message && !this.message.endsWith(" ") ? ` ${value}` : value}`
245
+ // return value ? this.$emit("add-standard-message", finalMessage) : this.$toasted.global.emConstrucao({msg: 'Mensagem vazia'})
244
246
  }catch(e) {
245
247
  console.error("Erro ao inserir mensagem formatada: ", e)
246
248
  }
@@ -192,6 +192,7 @@ export default {
192
192
  },
193
193
  mounted() {
194
194
  setResizeListeners(this.$el, ".js-autoresize", ".js-parentresize")
195
+ window.addEventListener("message", this.listenerPostMessage, false)
195
196
 
196
197
  // this.$root.$on("drop-file", (file, type) => { if(this.buttons.hasFiles) this.fileUpload(file, type, true) })
197
198
  // this.$root.$on("toggle-msg-formatada", () => { this.toggleStandardMessages() })
@@ -201,6 +202,23 @@ export default {
201
202
  // if(this.cssStyle.outsideButtons) if(this.$root.$refs.chatCorpo) this.$root.$refs.chatCorpo.setOutsideButtons(this.cssStyle.outsideButtons)
202
203
  },
203
204
  methods: {
205
+ listenerPostMessage(event){
206
+ if(!this.formattedMessageSettings.hasStandardMessages) return
207
+ if(event.data.gerenciador || event.data.abrirFishing || event.data.multiplos_contatos || event.data.inserir_cliente_omni || event.data.multiple_contatos) return
208
+ if(event.data == ''){
209
+ if(this.showStandardMessages) {
210
+ this.closeBlockerStandardMessage()
211
+ this.toggleStandardMessages()
212
+ }
213
+ this.$toasted.global.emConstrucao({msg: this.dicionario.msg_erro_sem_msg_formatada})
214
+ }else if(typeof event.data === "string"){
215
+ this.message = event.data
216
+ this.focusTextarea()
217
+
218
+ this.closeBlockerStandardMessage()
219
+ this.toggleStandardMessages()
220
+ }
221
+ },
204
222
  closeEmojis() {
205
223
  try {
206
224
  this.$root.$refs[`etf-${this.textId}`].showEmojis ? this.$root.$refs[`etf-${this.textId}`].away() : ''
@@ -461,6 +479,8 @@ export default {
461
479
  // this.$root.$off("textarea-focus")
462
480
  // this.$root.$off("clear-footer-message")
463
481
  // this.$root.$off("resize-footer-template")
482
+
483
+ window.removeEventListener("message", this.listenerPostMessage)
464
484
  }
465
485
  }
466
486
  </script>