vue-intergrall-plugins 1.1.59 → 1.1.61

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.
@@ -226,6 +226,7 @@ export default {
226
226
  "showMenu",
227
227
  "id_ext_msg",
228
228
  "tipo_origem",
229
+ "message_infos"
229
230
  ],
230
231
  created() {
231
232
  if (!this.$root.$refs.chatMessages) this.$root.$refs.chatMessages = this;
@@ -333,6 +334,7 @@ export default {
333
334
  mounted() {
334
335
  if (this.mapa) this.setMap();
335
336
  if (this.corMsg) this.setCorMsg();
337
+ if(this.message_infos) this.setMessageInfos()
336
338
  this.validadeUrlToMsg();
337
339
  },
338
340
  methods: {
@@ -372,12 +374,38 @@ export default {
372
374
  if (this.isMenuOpen) this.closeMenu();
373
375
  this.isEmojisOpen = !this.isEmojisOpen;
374
376
  },
377
+ setMessageInfos() {
378
+ try {
379
+ const { REACTION } = this.message_infos;
380
+
381
+ if (REACTION) {
382
+ const hexa = REACTION.split("u").slice(1).map(code => `&#x${code};`).join('');
383
+ const finalEmoji = REACTION.split("u").slice(1).map(code => String.fromCodePoint(parseInt(code, 16))).join('');
384
+ this.messageReaction = { hexa, finalEmoji };
385
+ }
386
+
387
+ } catch(err) {
388
+ console.error("Error setting message infos: ", err);
389
+ }
390
+ },
375
391
  addReaction(emoji) {
376
392
  this.messageReaction =
377
393
  this.messageReaction && this.messageReaction.hexa === emoji.hexa
378
394
  ? ""
379
395
  : { hexa: emoji.hexa, finalEmoji: emoji.finalEmoji };
380
396
  this.isEmojisOpen = false;
397
+
398
+ const ckEditorContext = document.querySelector('.ck-editor');
399
+ if (ckEditorContext) {
400
+ this.$emit("insert-emoji", {
401
+ finalEmoji: emoji.finalEmoji,
402
+ hexa: emoji.hexa,
403
+ editorType: 'ckeditor'
404
+ });
405
+ } else {
406
+ this.$emit("insert-emoji", emoji);
407
+ }
408
+
381
409
  this.$emit("reagir-mensagem", {
382
410
  emoji,
383
411
  seq: this.seq,