@chat21/chat21-ionic 3.0.74 → 3.0.75-rc.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 +6 -0
- package/package.json +1 -1
- package/src/app/chatlib/conversation-detail/message/bubble-message/bubble-message.component.html +3 -3
- package/src/app/chatlib/conversation-detail/message/bubble-message/bubble-message.component.ts +25 -15
- package/src/app/chatlib/conversation-detail/message/image/image.component.html +10 -5
- package/src/app/chatlib/conversation-detail/message/image/image.component.scss +15 -0
- package/src/app/components/image-viewer/image-viewer.component.ts +9 -1
- package/src/app/components/project-item/project-item.component.ts +1 -1
- package/src/app/pages/conversations-list/conversations-list.page.scss +4 -0
- package/src/chat21-core/utils/constants.ts +1 -0
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,11 @@
|
|
|
1
1
|
# chat21-ionic ver 3.0
|
|
2
2
|
|
|
3
|
+
### 3.0.75-rc.2
|
|
4
|
+
- bug-fixed: unserved request count not updated correctly after a request is assigned
|
|
5
|
+
|
|
6
|
+
### 3.0.75-rc.1
|
|
7
|
+
- added: handled ESC keyboard button to dismiss image preview component
|
|
8
|
+
|
|
3
9
|
### 3.0.74 in PROD
|
|
4
10
|
|
|
5
11
|
### 3.0.74-rc.1
|
package/package.json
CHANGED
package/src/app/chatlib/conversation-detail/message/bubble-message/bubble-message.component.html
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
<!-- [ngStyle]="{'padding': (isImage(message) || isFrame(message))?'0px':'0 8px'}" -->
|
|
3
3
|
<!-- isImage >{{isImage(message) }} message.metadata.width {{message?.metadata?.width }} -->
|
|
4
4
|
<div id="bubble-message"
|
|
5
|
-
[ngStyle]="{'padding': (isImage(message) || isFrame(message))?'0px':'0 8px', 'width': (isImage(message) || isFrame(message))?
|
|
5
|
+
[ngStyle]="{'padding': (isImage(message) || isFrame(message))?'0px':'0 8px', 'width': (isImage(message) || isFrame(message))? sizeImage?.width + 'px' : null }"
|
|
6
6
|
class="messages primary-color" [class.emoticon]="message?.emoticon">
|
|
7
7
|
|
|
8
8
|
|
|
@@ -20,8 +20,8 @@
|
|
|
20
20
|
[height]="getMetadataSize(message.metadata).height" -->
|
|
21
21
|
<chat-image *ngIf="isImage(message)"
|
|
22
22
|
[metadata]="message.metadata"
|
|
23
|
-
[width]="
|
|
24
|
-
[height]="
|
|
23
|
+
[width]="sizeImage?.width"
|
|
24
|
+
[height]="sizeImage?.height"
|
|
25
25
|
(onImageRendered)="onImageRenderedFN($event)">
|
|
26
26
|
</chat-image>
|
|
27
27
|
|
package/src/app/chatlib/conversation-detail/message/bubble-message/bubble-message.component.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { Component, ElementRef, EventEmitter, Input, OnChanges, OnInit, Output } from '@angular/core';
|
|
2
2
|
import { DomSanitizer } from '@angular/platform-browser';
|
|
3
3
|
import { MessageModel } from 'src/chat21-core/models/message';
|
|
4
|
-
import { MAX_WIDTH_IMAGES } from 'src/chat21-core/utils/constants';
|
|
4
|
+
import { MAX_WIDTH_IMAGES, MIN_WIDTH_IMAGES } from 'src/chat21-core/utils/constants';
|
|
5
5
|
import { LoggerService } from 'src/chat21-core/providers/abstract/logger.service';
|
|
6
6
|
import { isFile, isFrame, isImage } from 'src/chat21-core/utils/utils-message';
|
|
7
7
|
import { LoggerInstance } from 'src/chat21-core/providers/logger/loggerInstance';
|
|
@@ -39,6 +39,7 @@ export class BubbleMessageComponent implements OnInit, OnChanges {
|
|
|
39
39
|
'hideDelayAfterClick': 3000,
|
|
40
40
|
'hide-delay': 200
|
|
41
41
|
};
|
|
42
|
+
sizeImage : { width: number, height: number}
|
|
42
43
|
|
|
43
44
|
private logger: LoggerService = LoggerInstance.getInstance()
|
|
44
45
|
|
|
@@ -72,7 +73,7 @@ export class BubbleMessageComponent implements OnInit, OnChanges {
|
|
|
72
73
|
} else if (this.browserLang && stored_preferred_lang) {
|
|
73
74
|
chat_lang = stored_preferred_lang
|
|
74
75
|
}
|
|
75
|
-
moment.
|
|
76
|
+
moment.updateLocale(chat_lang , {
|
|
76
77
|
calendar: {
|
|
77
78
|
sameElse: 'LLLL'
|
|
78
79
|
}
|
|
@@ -81,7 +82,7 @@ export class BubbleMessageComponent implements OnInit, OnChanges {
|
|
|
81
82
|
|
|
82
83
|
ngOnChanges() {
|
|
83
84
|
if (this.message && this.message.metadata && typeof this.message.metadata === 'object') {
|
|
84
|
-
this.getMetadataSize(this.message.metadata)
|
|
85
|
+
this.sizeImage = this.getMetadataSize(this.message.metadata)
|
|
85
86
|
}
|
|
86
87
|
}
|
|
87
88
|
|
|
@@ -112,27 +113,36 @@ export class BubbleMessageComponent implements OnInit, OnChanges {
|
|
|
112
113
|
// }
|
|
113
114
|
|
|
114
115
|
getMetadataSize(metadata): any {
|
|
115
|
-
if (metadata.width === undefined) {
|
|
116
|
-
|
|
117
|
-
}
|
|
118
|
-
if (metadata.height === undefined) {
|
|
119
|
-
|
|
120
|
-
}
|
|
116
|
+
// if (metadata.width === undefined) {
|
|
117
|
+
// metadata.width = MAX_WIDTH_IMAGES
|
|
118
|
+
// }
|
|
119
|
+
// if (metadata.height === undefined) {
|
|
120
|
+
// metadata.height = MAX_WIDTH_IMAGES
|
|
121
|
+
// }
|
|
122
|
+
|
|
123
|
+
const sizeImage = {
|
|
124
|
+
width: metadata.width,
|
|
125
|
+
height: metadata.height
|
|
126
|
+
};
|
|
121
127
|
|
|
122
128
|
if (metadata.width && metadata.width < MAX_WIDTH_IMAGES) {
|
|
123
129
|
if (metadata.width <= 55) {
|
|
124
130
|
const ratio = (metadata['width'] / metadata['height']);
|
|
125
|
-
|
|
126
|
-
|
|
131
|
+
sizeImage.width = MIN_WIDTH_IMAGES;
|
|
132
|
+
sizeImage.height = MIN_WIDTH_IMAGES / ratio;
|
|
127
133
|
} else if (metadata.width > 55) {
|
|
128
|
-
|
|
129
|
-
|
|
134
|
+
sizeImage.width = metadata.width;
|
|
135
|
+
sizeImage.height = metadata.height
|
|
130
136
|
}
|
|
137
|
+
|
|
131
138
|
} else if (metadata.width && metadata.width > MAX_WIDTH_IMAGES) {
|
|
132
139
|
const ratio = (metadata['width'] / metadata['height']);
|
|
133
|
-
|
|
134
|
-
|
|
140
|
+
sizeImage.width = MAX_WIDTH_IMAGES;
|
|
141
|
+
sizeImage.height = MAX_WIDTH_IMAGES / ratio;
|
|
135
142
|
}
|
|
143
|
+
// metadata.width = sizeImage.width
|
|
144
|
+
// metadata.height = sizeImage.height
|
|
145
|
+
return sizeImage
|
|
136
146
|
}
|
|
137
147
|
|
|
138
148
|
|
|
@@ -1,9 +1,14 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
<!-- [ngStyle]="{ 'max-width': width +'px', 'max-height': height +'px' }" style="position: relative; " -->
|
|
2
|
+
<div [ngStyle]="{ 'max-width': width +'px', 'max-height': height +'px' }" class="c21-img-container">
|
|
3
|
+
<div *ngIf="loading" class="loader" [ngStyle]="{ 'width': width , 'height': height }"></div>
|
|
3
4
|
<!-- [tooltip]="timeTooltipRight" [options]="tooltipOptions" placement="bottom" content-type="template" -->
|
|
4
|
-
<img id="myImg"
|
|
5
|
-
class="message-contentX message-content-imageX"
|
|
6
|
-
[
|
|
5
|
+
<img id="myImg"
|
|
6
|
+
class="message-contentX message-content-imageX"
|
|
7
|
+
[ngClass]="{'isLoadingImage': loading}"
|
|
8
|
+
[ngStyle]="{ 'width': width , 'height': height }"
|
|
9
|
+
[src]="metadata.src"
|
|
10
|
+
(load)="onLoaded($event)"
|
|
11
|
+
(click)="openImageViewerModal(metadata.src, metadata.name)" />
|
|
7
12
|
<!-- <ng-template #timeTooltipRight>
|
|
8
13
|
<span>{{ tooltipMessage }}</span>
|
|
9
14
|
</ng-template> -->
|
|
@@ -8,6 +8,21 @@ img {
|
|
|
8
8
|
object-fit: cover;
|
|
9
9
|
}
|
|
10
10
|
|
|
11
|
+
img:hover{
|
|
12
|
+
cursor: pointer;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
.c21-img-container {
|
|
16
|
+
text-align: center;
|
|
17
|
+
width: 100%;
|
|
18
|
+
// background-image: linear-gradient(rgba(255,255,255,.5), rgba(255,255,255,.5)), url("https://firebasestorage.googleapis.com/v0/b/chat21-pre-01.appspot.com/o/public%2Fimages%2Fb4361ea5-5e37-433c-b727-9034eb5586fe%2F6d74f795-5873-49a8-9165-38f48642df51%2Ffacebook_like%20(3).png?alt=media&token=79afcfe5-ba0c-4573-9263-0877e0225c84");
|
|
19
|
+
// background-repeat: no-repeat;
|
|
20
|
+
// background-position: 50% 0;
|
|
21
|
+
// background-size: cover;
|
|
22
|
+
// border-top-left-radius: $border-radius-bubble-message;
|
|
23
|
+
// border-top-right-radius: $border-radius-bubble-message;
|
|
24
|
+
}
|
|
25
|
+
|
|
11
26
|
.isLoadingImage {
|
|
12
27
|
// position: relative;
|
|
13
28
|
// top: 6px;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Component, OnInit } from '@angular/core';
|
|
1
|
+
import { Component, HostListener, OnInit } from '@angular/core';
|
|
2
2
|
import { saveAs } from 'file-saver';
|
|
3
3
|
@Component({
|
|
4
4
|
selector: 'app-image-viewer',
|
|
@@ -53,4 +53,12 @@ export class ImageViewerComponent implements OnInit {
|
|
|
53
53
|
this.closeImageViewerModal()
|
|
54
54
|
}
|
|
55
55
|
|
|
56
|
+
@HostListener('document:keydown', ['$event'])
|
|
57
|
+
onKeyPress(event){
|
|
58
|
+
const keyCode = event.which || event.keyCode;
|
|
59
|
+
if (keyCode === 27) { // Esc keyboard code
|
|
60
|
+
this.closeImageViewerModal()
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
|
|
56
64
|
}
|
|
@@ -311,7 +311,7 @@ export class ProjectItemComponent implements OnInit {
|
|
|
311
311
|
}
|
|
312
312
|
});
|
|
313
313
|
//not sound if unservedRequest is already chached and web-sk is closed and restart again
|
|
314
|
-
if(this.unservedRequestCount
|
|
314
|
+
if(this.unservedRequestCount !== count){
|
|
315
315
|
this.unservedRequestCount = count;
|
|
316
316
|
this.events.publish('unservedRequest:count', this.unservedRequestCount)
|
|
317
317
|
}
|
|
@@ -44,6 +44,7 @@ export const CHANNEL_TYPE_GROUP = 'group';
|
|
|
44
44
|
export const TYPE_MSG_TEXT = 'text';
|
|
45
45
|
export const TYPE_MSG_IMAGE = 'image';
|
|
46
46
|
export const MAX_WIDTH_IMAGES = 300;
|
|
47
|
+
export const MIN_WIDTH_IMAGES = 130;
|
|
47
48
|
export const TYPE_DIRECT = 'direct';
|
|
48
49
|
export const TYPE_GROUP = 'group';
|
|
49
50
|
export const SYSTEM = 'system';
|