@weni/unnnic-system 3.2.1 → 3.2.2
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/CHANGELOG.md +5 -0
- package/dist/components/ChatsMessage/ChatsMessage.vue.d.ts +60 -3
- package/dist/components/ChatsMessage/ChatsMessage.vue.d.ts.map +1 -1
- package/dist/components/ChatsMessage/ChatsMessageText.vue.d.ts +42 -3
- package/dist/components/ChatsMessage/ChatsMessageText.vue.d.ts.map +1 -1
- package/dist/components/index.d.ts +60 -3
- package/dist/components/index.d.ts.map +1 -1
- package/dist/{es-a01fbef6.mjs → es-b22a2af8.mjs} +1 -1
- package/dist/{index-653c8f92.mjs → index-3e3537cb.mjs} +593 -555
- package/dist/{pt-br-8c017501.mjs → pt-br-7a4de77d.mjs} +1 -1
- package/dist/style.css +1 -1
- package/dist/unnnic.mjs +1 -1
- package/dist/unnnic.umd.js +20 -20
- package/package.json +2 -2
- package/src/components/ChatsMessage/ChatsMessage.vue +15 -0
- package/src/components/ChatsMessage/ChatsMessageText.vue +58 -4
- package/src/stories/ChatsMessage.stories.js +7 -0
package/package.json
CHANGED
|
@@ -3,6 +3,7 @@
|
|
|
3
3
|
class="unnnic-chats-message"
|
|
4
4
|
:class="{
|
|
5
5
|
sent: type === 'sent',
|
|
6
|
+
automatic: automatic,
|
|
6
7
|
sending: status === 'sending',
|
|
7
8
|
'is-document': isDocument,
|
|
8
9
|
'is-media': isMedia,
|
|
@@ -45,7 +46,9 @@
|
|
|
45
46
|
/>
|
|
46
47
|
<UnnnicChatsMessageText
|
|
47
48
|
v-if="isText"
|
|
49
|
+
:locale="locale"
|
|
48
50
|
:text="slotText"
|
|
51
|
+
:isAutomatic="automatic"
|
|
49
52
|
/>
|
|
50
53
|
<div
|
|
51
54
|
v-if="isDocument"
|
|
@@ -156,6 +159,10 @@ export default {
|
|
|
156
159
|
},
|
|
157
160
|
mixins: [UnnnicI18n],
|
|
158
161
|
props: {
|
|
162
|
+
locale: {
|
|
163
|
+
type: String,
|
|
164
|
+
default: 'en',
|
|
165
|
+
},
|
|
159
166
|
enableReply: {
|
|
160
167
|
type: Boolean,
|
|
161
168
|
default: false,
|
|
@@ -171,6 +178,10 @@ export default {
|
|
|
171
178
|
return ['received', 'sent'].includes(type);
|
|
172
179
|
},
|
|
173
180
|
},
|
|
181
|
+
automatic: {
|
|
182
|
+
type: Boolean,
|
|
183
|
+
default: false,
|
|
184
|
+
},
|
|
174
185
|
time: {
|
|
175
186
|
type: Date,
|
|
176
187
|
required: true,
|
|
@@ -323,6 +334,10 @@ $defaultLineHeight: $unnnic-font-size-body-gt + $unnnic-line-height-medium;
|
|
|
323
334
|
|
|
324
335
|
&.sent {
|
|
325
336
|
background-color: #cff8f4;
|
|
337
|
+
|
|
338
|
+
&.automatic {
|
|
339
|
+
background-color: $unnnic-color-aux-blue-50;
|
|
340
|
+
}
|
|
326
341
|
}
|
|
327
342
|
|
|
328
343
|
&.sending {
|
|
@@ -1,18 +1,45 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
<
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
2
|
+
<section class="unnnic-chats-message__text__container">
|
|
3
|
+
<p
|
|
4
|
+
class="unnnic-chats-message__text"
|
|
5
|
+
v-html="formattedText"
|
|
6
|
+
/>
|
|
7
|
+
<p v-if="isAutomatic" class="unnnic-chats-message__text--automatic">
|
|
8
|
+
{{ i18n('automatic_message') }}
|
|
9
|
+
</p>
|
|
10
|
+
</section>
|
|
6
11
|
</template>
|
|
7
12
|
|
|
8
13
|
<script>
|
|
14
|
+
import UnnnicI18n from '../../mixins/i18n';
|
|
15
|
+
|
|
9
16
|
export default {
|
|
10
17
|
name: 'ChatsMessageText',
|
|
18
|
+
mixins: [UnnnicI18n],
|
|
11
19
|
props: {
|
|
20
|
+
locale: {
|
|
21
|
+
type: String,
|
|
22
|
+
default: 'en',
|
|
23
|
+
},
|
|
12
24
|
text: {
|
|
13
25
|
type: String,
|
|
14
26
|
required: true,
|
|
15
27
|
},
|
|
28
|
+
isAutomatic: {
|
|
29
|
+
type: Boolean,
|
|
30
|
+
default: false,
|
|
31
|
+
},
|
|
32
|
+
},
|
|
33
|
+
data() {
|
|
34
|
+
return {
|
|
35
|
+
defaultTranslations: {
|
|
36
|
+
automatic_message: {
|
|
37
|
+
'pt-br': 'Mensagem de abertura automática',
|
|
38
|
+
en: 'Automatic Opening Message',
|
|
39
|
+
es: 'Mensaje de apertura automático',
|
|
40
|
+
},
|
|
41
|
+
},
|
|
42
|
+
};
|
|
16
43
|
},
|
|
17
44
|
computed: {
|
|
18
45
|
formattedText() {
|
|
@@ -78,3 +105,30 @@ export default {
|
|
|
78
105
|
},
|
|
79
106
|
};
|
|
80
107
|
</script>
|
|
108
|
+
|
|
109
|
+
<style lang="scss" scoped>
|
|
110
|
+
@use '@/assets/scss/unnnic' as *;
|
|
111
|
+
|
|
112
|
+
* {
|
|
113
|
+
padding: 0;
|
|
114
|
+
margin: 0;
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
.unnnic-chats-message__text {
|
|
118
|
+
&__container {
|
|
119
|
+
display: flex;
|
|
120
|
+
flex-direction: column;
|
|
121
|
+
gap: $unnnic-spacing-sm;
|
|
122
|
+
padding: $unnnic-spacing-nano 0;
|
|
123
|
+
font-size: $unnnic-font-size-body-gt;
|
|
124
|
+
color: $unnnic-color-neutral-dark;
|
|
125
|
+
line-height: $unnnic-font-size-body-gt + $unnnic-line-height-medium;
|
|
126
|
+
word-break: break-word;
|
|
127
|
+
}
|
|
128
|
+
&--automatic {
|
|
129
|
+
font-size: $unnnic-font-size-body-md;
|
|
130
|
+
line-height: $unnnic-line-height-caption-1;
|
|
131
|
+
color: $unnnic-color-aux-blue-500;
|
|
132
|
+
}
|
|
133
|
+
}
|
|
134
|
+
</style>
|