vue-intergrall-plugins 1.1.39 → 1.1.40

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": "1.1.39",
3
+ "version": "1.1.40",
4
4
  "description": "",
5
5
  "main": "dist/vue-intergrall-plugins.ssr.js",
6
6
  "browser": "dist/vue-intergrall-plugins.esm.js",
@@ -22,6 +22,21 @@
22
22
  <fa-icon :class="[iconClass ? iconClass : '']" :icon="['fas', 'file-alt']" />
23
23
  <p v-text="filename" :title="filename"></p>
24
24
  </span>
25
+
26
+ <!-- Transcricao -->
27
+ <div v-if="audio && hasTranscription" class="transcription-controls" @click="emitTranscription">
28
+ {{ dictionary.transcricaoControl || 'Transcrever' }}
29
+ </div>
30
+ <div v-if="audio && transcriptionText" class="transcription-container">
31
+ <div class="transcription-header">
32
+ <p v-if="!hideTranscription" v-text="`${dictionary.transcricaoLabel || 'Transcricao'}: `"></p>
33
+ <button @click="toggleHideTranscription" class="transcription-button">
34
+ <fa-icon :icon="['fas', `caret-${hideTranscription ? 'down' : 'up'}`]" />
35
+ </button>
36
+ </div>
37
+ <p v-if="!hideTranscription" class="transcription-text">{{ transcriptionText }}</p>
38
+ </div>
39
+
25
40
  <!-- Acoes -->
26
41
  <div v-if="showControlFiles" class="file-actions">
27
42
  <span v-if="imageURL" class="file-action-button" @click="showImage(imageURL)">
@@ -61,6 +76,54 @@
61
76
  </template>
62
77
 
63
78
  <style>
79
+ .transcription-container {
80
+ display: flex;
81
+ flex-wrap: wrap;
82
+ width: 100%;
83
+ }
84
+
85
+ .transcription-header {
86
+ display: flex;
87
+ justify-content: flex-end;
88
+ align-items: center;
89
+ gap: 10px;
90
+ width: 100%;
91
+ }
92
+
93
+ .transcription-header > p {
94
+ flex: 1;
95
+ }
96
+
97
+ .transcription-button {
98
+ background-color: transparent;
99
+ border: none;
100
+ cursor: pointer;
101
+ transition: background 150ms ease-in-out;
102
+ border-radius: 5px;
103
+ display: flex;
104
+ justify-content: center;
105
+ align-items: center;
106
+ }
107
+
108
+ .transcription-button:hover {
109
+ background: rgba(0, 0, 0, 0.1);
110
+ }
111
+
112
+ .transcription-controls {
113
+ margin-top: 10px;
114
+ color: blue;
115
+ cursor: pointer;
116
+ }
117
+
118
+ .transcription-controls:hover {
119
+ text-decoration: underline;
120
+ }
121
+
122
+ .transcription-text {
123
+ white-space: break-spaces;
124
+ color: rgba(0, 0, 0, 0.6);
125
+ }
126
+
64
127
  .tippy-tooltip.light-theme .tippy-backdrop {
65
128
  background-color: #fff;
66
129
  }
@@ -131,11 +194,14 @@ export default {
131
194
  required: true,
132
195
  },
133
196
  showControlFiles: { type: Boolean },
197
+ hasTranscription: { type: Boolean, default: false },
198
+ transcriptionText: { type: String, default: "" }
134
199
  },
135
200
  data() {
136
201
  return {
137
202
  imgErro: false,
138
203
  imgMsgErro: "",
204
+ hideTranscription: false
139
205
  };
140
206
  },
141
207
  mounted() {
@@ -144,6 +210,12 @@ export default {
144
210
  }
145
211
  },
146
212
  methods: {
213
+ toggleHideTranscription() {
214
+ this.hideTranscription = !this.hideTranscription;
215
+ },
216
+ emitTranscription() {
217
+ this.$emit("transcribe-audio", this.anexo);
218
+ },
147
219
  changeAudioSpeed(newSpeed) {
148
220
  // Aplique a velocidade ao elemento de áudio
149
221
  this.$refs.audioPlayer.playbackRate = newSpeed;
@@ -1,5 +1,5 @@
1
1
  <template>
2
- <div :class="'mensagem__' + origem" v-if="origem && !erro" :id="`a${messageIndex ? messageIndex : randomizeValue}`">
2
+ <div :class="'mensagem__' + origem" v-if="origem && !erro" :id="`a${messageIndex ? messageIndex : randomizeValue}`">
3
3
  <InteratividadeFormulario v-if="interatividade && validateInterativity()" :interatividade="interatividade"
4
4
  :dominio="dominio" :anexos="anexos" :dictionary="dictionary" />
5
5
  <div v-else class="mensagem" :class="{ mapa, 'hist-msg': histMsg, 'max-w-60': link && !mapa }">
@@ -18,7 +18,11 @@
18
18
  <div class="mensagem-anexo" v-for="(anexo, index) in anexos" :key="index">
19
19
  <AnexoMensagem :showControlFiles="showControlFiles" :referenceSelector="referenceSelector"
20
20
  :dictionary="dictionary" :anexo="anexo" :origemExterna="origemExterna" :dominio="dominio"
21
- @abrir-imagem="abrirImagem" @download-all="$emit('download-all')" />
21
+ @abrir-imagem="abrirImagem" @download-all="$emit('download-all')"
22
+ :hasTranscription="hasTranscription"
23
+ :transcriptionText="transcriptionText"
24
+ @transcribe-audio="emitTranscription"
25
+ />
22
26
  </div>
23
27
  </template>
24
28
  <!-- sticker -->
@@ -173,6 +177,9 @@ export default {
173
177
  Picker,
174
178
  },
175
179
  props: [
180
+ "hasTranscription",
181
+ "transcriptionText",
182
+ "grupoAtendimento",
176
183
  "emitContactClick",
177
184
  "smartchannel",
178
185
  "messageIndex",
@@ -327,6 +334,10 @@ export default {
327
334
  this.validadeUrlToMsg();
328
335
  },
329
336
  methods: {
337
+ emitTranscription(anexo) {
338
+ const deepCopyData = JSON.parse(JSON.stringify({ anexo, grupo: this.grupoAtendimento, seq: this.seq }));
339
+ this.$emit("transcribe-audio", deepCopyData);
340
+ },
330
341
  closeMenu() {
331
342
  this.isMenuOpen = false;
332
343
  },