@chat21/chat21-web-widget 5.1.0 → 5.1.1-rc1
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 -1
- package/package.json +1 -1
- package/src/app/app.component.ts +2 -3
- package/src/app/component/message/carousel/carousel.component.html +2 -1
- package/src/app/component/message/carousel/carousel.component.scss +3 -3
- package/src/app/component/message/text/text.component.html +2 -4
- package/src/app/pipe/marked.pipe.ts +17 -9
- package/src/app/sass/_variables.scss +3 -4
- package/src/app/utils/globals.ts +1 -6
package/CHANGELOG.md
CHANGED
|
@@ -6,7 +6,11 @@
|
|
|
6
6
|
### **Copyrigth**:
|
|
7
7
|
*Tiledesk SRL*
|
|
8
8
|
|
|
9
|
-
# 5.1.
|
|
9
|
+
# 5.1.1-rc1
|
|
10
|
+
- **bug-fixed**: marked pipe not renders urls
|
|
11
|
+
|
|
12
|
+
# 5.1.0-rc34
|
|
13
|
+
- **bug-fixed**: css fixed carousel
|
|
10
14
|
|
|
11
15
|
# 5.1.0-rc33
|
|
12
16
|
- **changed**: updated "marked library" from 4.0.16 to 16.3.0 - enabled list and table
|
package/package.json
CHANGED
package/src/app/app.component.ts
CHANGED
|
@@ -2163,12 +2163,11 @@ export class AppComponent implements OnInit, AfterViewInit, OnDestroy {
|
|
|
2163
2163
|
|
|
2164
2164
|
this.el.nativeElement.style.setProperty('--button-in-msg-background-color', this.g.bubbleSentBackground)
|
|
2165
2165
|
this.el.nativeElement.style.setProperty('--button-in-msg-font-size', this.g.buttonFontSize)
|
|
2166
|
-
this.el.nativeElement.style.setProperty('--button-in-msg-font-family', this.g.fontFamily)
|
|
2167
|
-
|
|
2168
|
-
this.el.nativeElement.style.setProperty('--chat-header-height', this.g.hideHeaderConversation? '0px': null)
|
|
2169
2166
|
this.el.nativeElement.style.setProperty('--font-size-bubble-message', this.g.fontSize)
|
|
2170
2167
|
this.el.nativeElement.style.setProperty('--font-family-bubble-message', this.g.fontFamily)
|
|
2168
|
+
this.el.nativeElement.style.setProperty('--button-in-msg-font-family', this.g.fontFamily)
|
|
2171
2169
|
|
|
2170
|
+
this.el.nativeElement.style.setProperty('--chat-header-height', this.g.hideHeaderConversation? '0px': null)
|
|
2172
2171
|
}
|
|
2173
2172
|
|
|
2174
2173
|
|
|
@@ -7,7 +7,8 @@
|
|
|
7
7
|
<div class="carousel">
|
|
8
8
|
<!-- <div class="card" style="width: 17px;"></div> -->
|
|
9
9
|
<div class="card" *ngFor="let card of gallery; let i = index">
|
|
10
|
-
<div [style.opacity]="i+1 === activeElement? 1: 0.5">
|
|
10
|
+
<!-- <div [style.opacity]="i+1 === activeElement? 1: 0.5"> -->
|
|
11
|
+
<div>
|
|
11
12
|
<div class="card-image" *ngIf="card?.preview?.src !== ''">
|
|
12
13
|
<img [src]="card?.preview?.src" alt="img" draggable="false">
|
|
13
14
|
</div>
|
|
@@ -54,7 +54,7 @@
|
|
|
54
54
|
display: grid;
|
|
55
55
|
align-items: start;
|
|
56
56
|
grid-auto-flow: column;
|
|
57
|
-
grid-auto-columns: calc((100% / 3) - 12px);
|
|
57
|
+
// grid-auto-columns: calc((100% / 3) - 12px);
|
|
58
58
|
// overflow-x: auto;
|
|
59
59
|
overflow-x: hidden;
|
|
60
60
|
scroll-snap-type: x mandatory;
|
|
@@ -270,12 +270,12 @@
|
|
|
270
270
|
}
|
|
271
271
|
@media screen and (max-width: 900px) {
|
|
272
272
|
.wrapper .carousel {
|
|
273
|
-
grid-auto-columns: calc((100% / 2) - 9px);
|
|
273
|
+
// grid-auto-columns: calc((100% / 2) - 9px);
|
|
274
274
|
}
|
|
275
275
|
}
|
|
276
276
|
@media screen and (max-width: 600px) {
|
|
277
277
|
.wrapper .carousel {
|
|
278
|
-
grid-auto-columns: var(--cardWidth);
|
|
278
|
+
// grid-auto-columns: var(--cardWidth);
|
|
279
279
|
// grid-auto-columns: 17px repeat(var(--cardWidth)) 17px;
|
|
280
280
|
}
|
|
281
281
|
}
|
|
@@ -1,6 +1,4 @@
|
|
|
1
|
-
<p
|
|
1
|
+
<p #messageEl class="message_innerhtml marked"
|
|
2
2
|
[innerHTML]="printMessage(text, messageEl, this) | marked"
|
|
3
3
|
[style.color]="color"></p>
|
|
4
|
-
<!-- [
|
|
5
|
-
<!-- [innerHTML]="printMessage(text, messageEl, this) | htmlEntitiesEncode | marked" -->
|
|
6
|
-
|
|
4
|
+
<!-- [innerHTML]="printMessage(text, messageEl, this) | htmlEntitiesEncode | marked" -->
|
|
@@ -10,21 +10,29 @@ export class MarkedPipe implements PipeTransform {
|
|
|
10
10
|
transform(value: any): any {
|
|
11
11
|
const renderer = new marked.Renderer();
|
|
12
12
|
renderer.link = function({ href, title, tokens }) {
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
13
|
+
const text = tokens
|
|
14
|
+
? tokens.map(token => token.raw).join('')
|
|
15
|
+
: href; // fallback se tokens non c'è
|
|
16
|
+
if (!href) return text;
|
|
17
|
+
|
|
18
|
+
return `<a href="${href}" target="_blank" rel="noopener noreferrer">${text}</a>`;
|
|
16
19
|
};
|
|
20
|
+
|
|
17
21
|
marked.setOptions({
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
22
|
+
renderer,
|
|
23
|
+
gfm: true,
|
|
24
|
+
breaks: true
|
|
21
25
|
});
|
|
26
|
+
|
|
22
27
|
if (value && value.length > 0) {
|
|
23
|
-
|
|
24
|
-
|
|
28
|
+
try {
|
|
29
|
+
return marked.parse(value);
|
|
30
|
+
} catch (err) {
|
|
31
|
+
console.error('Errore nel parsing markdown:', err);
|
|
32
|
+
return value;
|
|
33
|
+
}
|
|
25
34
|
}
|
|
26
35
|
return value;
|
|
27
36
|
}
|
|
28
37
|
|
|
29
|
-
|
|
30
38
|
}
|
|
@@ -42,16 +42,15 @@
|
|
|
42
42
|
--content-background-color: #fff;
|
|
43
43
|
--content-text-color: var(--black);
|
|
44
44
|
|
|
45
|
-
--avatar-height: 40px;
|
|
46
|
-
--avatar-width: 40px;
|
|
47
|
-
|
|
48
|
-
|
|
49
45
|
--font-family: 'Roboto','Google Sans', Helvetica, Arial, sans-serif; //Mulish, sans-serif;
|
|
50
46
|
--font-family-bubble-message: 'Roboto','Google Sans', Helvetica, Arial, sans-serif;
|
|
51
47
|
--font-family-callout: 'Helvetica Neue', 'Apple Color Emoji', Helvetica, Arial, sans-serif;
|
|
52
48
|
--font-family-powered-by: Mulish, sans-serif;
|
|
53
49
|
|
|
54
50
|
--font-size-bubble-message: 1.4em;
|
|
51
|
+
|
|
52
|
+
--avatar-height: 40px;
|
|
53
|
+
--avatar-width: 40px;
|
|
55
54
|
}
|
|
56
55
|
|
|
57
56
|
$trasp-black:rgba(0,0,0,0.8);
|
package/src/app/utils/globals.ts
CHANGED
|
@@ -294,9 +294,6 @@ export class Globals {
|
|
|
294
294
|
* false the WAITING_TIME_NOT_FOUND will always be displayed)
|
|
295
295
|
* is set to true for backward compatibility with old projects */
|
|
296
296
|
this.dynamicWaitTimeReply = true;
|
|
297
|
-
/** Hide the close button in the widget header. Permitted values: true,
|
|
298
|
-
false. The default value is false. */
|
|
299
|
-
this.hideHeaderCloseButton = false;
|
|
300
297
|
|
|
301
298
|
/** if it is true, the chat window is open in fullscreen mode. Permitted
|
|
302
299
|
values: true, false. Default value : false */
|
|
@@ -338,15 +335,13 @@ export class Globals {
|
|
|
338
335
|
/** set launcher balon widget shape: can set corner by corner */
|
|
339
336
|
this.baloonShape = '50%';
|
|
340
337
|
// this.parameters['isLogEnabled'] = false;
|
|
341
|
-
this.
|
|
338
|
+
this.isLogEnabled = false;
|
|
342
339
|
/** Hide the header conversation Permitted values: true,
|
|
343
340
|
false. The default value is false. */
|
|
344
341
|
this.hideHeaderConversation= false;
|
|
345
342
|
/** Hide the close button in the widget header. Permitted values: true,
|
|
346
343
|
false. The default value is false. */
|
|
347
344
|
this.hideHeaderCloseButton = false;
|
|
348
|
-
/** set global log. Permitted values: true, false. The default value is false. */
|
|
349
|
-
this.isLogEnabled = false;
|
|
350
345
|
/** enable to hide/show upper-right header conversation options menu */
|
|
351
346
|
this.openExternalLinkButton = true;
|
|
352
347
|
/** enable to close a conversation from upper-right header menu */
|