@progress/kendo-angular-conversational-ui 4.1.0 → 5.0.0-dev.202204131603

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.
Files changed (163) hide show
  1. package/{dist/es2015/api → api}/action.interface.d.ts +0 -0
  2. package/{dist/es2015/api → api}/attachment.interface.d.ts +0 -0
  3. package/{dist/es2015/api → api}/execute-action-event.d.ts +1 -1
  4. package/{dist/es/api/user.interface.js → api/index.d.ts} +6 -0
  5. package/{dist/es2015/api → api}/message.interface.d.ts +0 -0
  6. package/{dist/es2015/api → api}/post-message-event.d.ts +0 -0
  7. package/{dist/es2015/api → api}/preventable-event.d.ts +0 -0
  8. package/{dist/es2015/api → api}/user.interface.d.ts +0 -0
  9. package/bundles/kendo-angular-conversational-ui.umd.js +5 -0
  10. package/{dist/es2015/cards → cards}/hero-card.component.d.ts +3 -0
  11. package/{dist/es2015/chat → chat}/attachment-template.directive.d.ts +3 -0
  12. package/{dist/es2015/chat → chat}/attachment.component.d.ts +9 -5
  13. package/{dist/es2015/chat → chat}/builtin-actions.d.ts +0 -0
  14. package/{dist/es2015/chat → chat}/chat-item.d.ts +0 -0
  15. package/{dist/es2015/chat → chat}/chat-view.d.ts +1 -1
  16. package/{dist/es2015/chat → chat}/chat.component.d.ts +7 -7
  17. package/{dist/es2015/chat → chat}/chat.directives.d.ts +0 -0
  18. package/chat/chat.module.d.ts +49 -0
  19. package/{dist/es2015/chat → chat}/l10n/custom-messages.component.d.ts +4 -1
  20. package/{dist/es2015/chat → chat}/l10n/localized-messages.directive.d.ts +3 -0
  21. package/{dist/es2015/chat → chat}/l10n/messages.d.ts +3 -0
  22. package/{dist/es2015/chat → chat}/message-attachments.component.d.ts +5 -2
  23. package/{dist/es2015/chat → chat}/message-box.component.d.ts +4 -1
  24. package/{dist/es2015/chat → chat}/message-box.directive.d.ts +3 -0
  25. package/{dist/es2015/chat → chat}/message-list.component.d.ts +9 -8
  26. package/{dist/es2015/chat → chat}/message-template.directive.d.ts +3 -0
  27. package/{dist/es2015/chat → chat}/message.component.d.ts +4 -1
  28. package/{dist/es2015/chat → chat}/suggested-actions.component.d.ts +4 -1
  29. package/common/focused-state.directive.d.ts +15 -0
  30. package/{dist/es2015/common → common}/keys.enum.d.ts +0 -0
  31. package/{dist/es2015/common → common}/models/message-box-options.d.ts +0 -0
  32. package/{dist/es2015/common → common}/scroll-anchor.directive.d.ts +3 -0
  33. package/{dist/es2015/common → common}/utils.d.ts +0 -0
  34. package/{dist/es2015 → esm2015}/api/action.interface.js +2 -1
  35. package/{dist/es2015 → esm2015}/api/attachment.interface.js +1 -0
  36. package/{dist/es2015 → esm2015}/api/execute-action-event.js +0 -0
  37. package/{dist/es/api/attachment.interface.js → esm2015/api/index.js} +6 -0
  38. package/{dist/es → esm2015}/api/message.interface.js +1 -0
  39. package/{dist/es2015 → esm2015}/api/post-message-event.js +0 -0
  40. package/{dist/es2015 → esm2015}/api/preventable-event.js +0 -0
  41. package/{dist/es2015 → esm2015}/api/user.interface.js +1 -0
  42. package/esm2015/cards/hero-card.component.js +90 -0
  43. package/{dist/es2015 → esm2015}/chat/attachment-template.directive.js +14 -12
  44. package/esm2015/chat/attachment.component.js +83 -0
  45. package/{dist/es2015 → esm2015}/chat/builtin-actions.js +13 -16
  46. package/{dist/es2015 → esm2015}/chat/chat-item.js +0 -0
  47. package/{dist/es2015 → esm2015}/chat/chat-view.js +0 -6
  48. package/esm2015/chat/chat.component.js +246 -0
  49. package/{dist/es → esm2015}/chat/chat.directives.js +0 -0
  50. package/{dist/es2015 → esm2015}/chat/chat.module.js +43 -15
  51. package/esm2015/chat/l10n/custom-messages.component.js +42 -0
  52. package/esm2015/chat/l10n/localized-messages.directive.js +37 -0
  53. package/esm2015/chat/l10n/messages.js +25 -0
  54. package/{dist/es2015 → esm2015}/chat/message-attachments.component.js +71 -48
  55. package/esm2015/chat/message-box.component.js +141 -0
  56. package/esm2015/chat/message-box.directive.js +24 -0
  57. package/esm2015/chat/message-list.component.js +279 -0
  58. package/{dist/es2015 → esm2015}/chat/message-template.directive.js +14 -12
  59. package/esm2015/chat/message.component.js +140 -0
  60. package/esm2015/chat/suggested-actions.component.js +113 -0
  61. package/esm2015/common/focused-state.directive.js +37 -0
  62. package/{dist/es2015 → esm2015}/common/keys.enum.js +1 -0
  63. package/{dist/es → esm2015}/common/models/message-box-options.js +1 -0
  64. package/{dist/es2015 → esm2015}/common/scroll-anchor.directive.js +20 -26
  65. package/{dist/es2015 → esm2015}/common/utils.js +0 -0
  66. package/{dist/es/api/action.interface.js → esm2015/kendo-angular-conversational-ui.js} +4 -1
  67. package/esm2015/main.js +10 -0
  68. package/{dist/es2015 → esm2015}/package-metadata.js +1 -1
  69. package/fesm2015/kendo-angular-conversational-ui.js +1757 -0
  70. package/{dist/es2015/common/focused-state.directive.d.ts → kendo-angular-conversational-ui.d.ts} +3 -6
  71. package/main.d.ts +11 -0
  72. package/{dist/es2015/package-metadata.d.ts → package-metadata.d.ts} +0 -0
  73. package/package.json +38 -107
  74. package/schematics/ngAdd/index.js +5 -2
  75. package/schematics/ngAdd/index.js.map +1 -1
  76. package/dist/cdn/js/kendo-angular-conversational-ui.js +0 -20
  77. package/dist/cdn/main.js +0 -5
  78. package/dist/es/api/execute-action-event.js +0 -24
  79. package/dist/es/api/post-message-event.js +0 -18
  80. package/dist/es/api/preventable-event.js +0 -32
  81. package/dist/es/cards/hero-card.component.js +0 -54
  82. package/dist/es/chat/attachment-template.directive.js +0 -32
  83. package/dist/es/chat/attachment.component.js +0 -65
  84. package/dist/es/chat/builtin-actions.js +0 -28
  85. package/dist/es/chat/chat-item.js +0 -13
  86. package/dist/es/chat/chat-view.js +0 -92
  87. package/dist/es/chat/chat.component.js +0 -190
  88. package/dist/es/chat/chat.module.js +0 -80
  89. package/dist/es/chat/l10n/custom-messages.component.js +0 -45
  90. package/dist/es/chat/l10n/localized-messages.directive.js +0 -36
  91. package/dist/es/chat/l10n/messages.js +0 -26
  92. package/dist/es/chat/message-attachments.component.js +0 -148
  93. package/dist/es/chat/message-box.component.js +0 -124
  94. package/dist/es/chat/message-box.directive.js +0 -24
  95. package/dist/es/chat/message-list.component.js +0 -165
  96. package/dist/es/chat/message-template.directive.js +0 -32
  97. package/dist/es/chat/message.component.js +0 -77
  98. package/dist/es/chat/suggested-actions.component.js +0 -91
  99. package/dist/es/common/focused-state.directive.js +0 -43
  100. package/dist/es/common/keys.enum.js +0 -4
  101. package/dist/es/common/scroll-anchor.directive.js +0 -87
  102. package/dist/es/common/utils.js +0 -13
  103. package/dist/es/index.js +0 -22
  104. package/dist/es/main.js +0 -8
  105. package/dist/es/package-metadata.js +0 -15
  106. package/dist/es2015/api/message.interface.js +0 -4
  107. package/dist/es2015/cards/hero-card.component.js +0 -79
  108. package/dist/es2015/chat/attachment.component.js +0 -66
  109. package/dist/es2015/chat/chat.component.js +0 -214
  110. package/dist/es2015/chat/chat.directives.js +0 -8
  111. package/dist/es2015/chat/chat.module.d.ts +0 -27
  112. package/dist/es2015/chat/l10n/custom-messages.component.js +0 -37
  113. package/dist/es2015/chat/l10n/localized-messages.directive.js +0 -32
  114. package/dist/es2015/chat/l10n/messages.js +0 -20
  115. package/dist/es2015/chat/message-box.component.js +0 -157
  116. package/dist/es2015/chat/message-box.directive.js +0 -23
  117. package/dist/es2015/chat/message-list.component.js +0 -227
  118. package/dist/es2015/chat/message.component.js +0 -107
  119. package/dist/es2015/chat/suggested-actions.component.js +0 -105
  120. package/dist/es2015/common/focused-state.directive.js +0 -45
  121. package/dist/es2015/common/models/message-box-options.js +0 -4
  122. package/dist/es2015/index.d.ts +0 -22
  123. package/dist/es2015/index.js +0 -22
  124. package/dist/es2015/index.metadata.json +0 -1
  125. package/dist/es2015/main.d.ts +0 -13
  126. package/dist/es2015/main.js +0 -8
  127. package/dist/fesm2015/index.js +0 -1554
  128. package/dist/fesm5/index.js +0 -1383
  129. package/dist/npm/api/action.interface.js +0 -7
  130. package/dist/npm/api/attachment.interface.js +0 -6
  131. package/dist/npm/api/execute-action-event.js +0 -26
  132. package/dist/npm/api/message.interface.js +0 -6
  133. package/dist/npm/api/post-message-event.js +0 -20
  134. package/dist/npm/api/preventable-event.js +0 -34
  135. package/dist/npm/api/user.interface.js +0 -6
  136. package/dist/npm/cards/hero-card.component.js +0 -56
  137. package/dist/npm/chat/attachment-template.directive.js +0 -34
  138. package/dist/npm/chat/attachment.component.js +0 -67
  139. package/dist/npm/chat/builtin-actions.js +0 -33
  140. package/dist/npm/chat/chat-item.js +0 -15
  141. package/dist/npm/chat/chat-view.js +0 -98
  142. package/dist/npm/chat/chat.component.js +0 -192
  143. package/dist/npm/chat/chat.directives.js +0 -14
  144. package/dist/npm/chat/chat.module.js +0 -82
  145. package/dist/npm/chat/l10n/custom-messages.component.js +0 -47
  146. package/dist/npm/chat/l10n/localized-messages.directive.js +0 -38
  147. package/dist/npm/chat/l10n/messages.js +0 -28
  148. package/dist/npm/chat/message-attachments.component.js +0 -150
  149. package/dist/npm/chat/message-box.component.js +0 -126
  150. package/dist/npm/chat/message-box.directive.js +0 -26
  151. package/dist/npm/chat/message-list.component.js +0 -167
  152. package/dist/npm/chat/message-template.directive.js +0 -34
  153. package/dist/npm/chat/message.component.js +0 -79
  154. package/dist/npm/chat/suggested-actions.component.js +0 -93
  155. package/dist/npm/common/focused-state.directive.js +0 -45
  156. package/dist/npm/common/keys.enum.js +0 -6
  157. package/dist/npm/common/models/message-box-options.js +0 -6
  158. package/dist/npm/common/scroll-anchor.directive.js +0 -89
  159. package/dist/npm/common/utils.js +0 -15
  160. package/dist/npm/index.js +0 -39
  161. package/dist/npm/main.js +0 -11
  162. package/dist/npm/package-metadata.js +0 -17
  163. package/dist/systemjs/kendo-angular-conversational-ui.js +0 -5
@@ -1,32 +0,0 @@
1
- /**-----------------------------------------------------------------------------------------
2
- * Copyright © 2021 Progress Software Corporation. All rights reserved.
3
- * Licensed under commercial license. See LICENSE.md in the project root for more information
4
- *-------------------------------------------------------------------------------------------*/
5
- import * as tslib_1 from "tslib";
6
- import { Directive, Optional, TemplateRef } from "@angular/core";
7
- /**
8
- * Defines a template that will be used for displaying message attachments. To define an attachment
9
- * template, nest an `<ng-template>` tag with the `kendoChatAttachmentTemplate` attribute inside the
10
- * `<kendo-chat>` component. The template context is set to the attachment instance. For more information,
11
- * refer to the article on [message attachments]({% slug attachments_chat %}).
12
- *
13
- * {% meta height:700 %}
14
- * {% embed_file attachments/templates/app.component.ts preview %}
15
- * {% embed_file shared/app.module.ts preview %}
16
- * {% embed_file shared/main.ts hidden %}
17
- * {% endmeta %}
18
- */
19
- var AttachmentTemplateDirective = /** @class */ (function () {
20
- function AttachmentTemplateDirective(templateRef) {
21
- this.templateRef = templateRef;
22
- }
23
- AttachmentTemplateDirective = tslib_1.__decorate([
24
- Directive({
25
- selector: '[kendoChatAttachmentTemplate]'
26
- }),
27
- tslib_1.__param(0, Optional()),
28
- tslib_1.__metadata("design:paramtypes", [TemplateRef])
29
- ], AttachmentTemplateDirective);
30
- return AttachmentTemplateDirective;
31
- }());
32
- export { AttachmentTemplateDirective };
@@ -1,65 +0,0 @@
1
- /**-----------------------------------------------------------------------------------------
2
- * Copyright © 2021 Progress Software Corporation. All rights reserved.
3
- * Licensed under commercial license. See LICENSE.md in the project root for more information
4
- *-------------------------------------------------------------------------------------------*/
5
- import * as tslib_1 from "tslib";
6
- import { Component, Input } from '@angular/core';
7
- import { AttachmentTemplateDirective } from './chat.directives';
8
- /**
9
- * @hidden
10
- */
11
- var AttachmentComponent = /** @class */ (function () {
12
- function AttachmentComponent() {
13
- }
14
- Object.defineProperty(AttachmentComponent.prototype, "attachment", {
15
- get: function () {
16
- return this._attachment;
17
- },
18
- set: function (value) {
19
- this._attachment = value;
20
- this.context = {
21
- $implicit: this.attachment
22
- };
23
- },
24
- enumerable: true,
25
- configurable: true
26
- });
27
- Object.defineProperty(AttachmentComponent.prototype, "image", {
28
- get: function () {
29
- return this.contentType.indexOf('image/') === 0;
30
- },
31
- enumerable: true,
32
- configurable: true
33
- });
34
- Object.defineProperty(AttachmentComponent.prototype, "unknown", {
35
- get: function () {
36
- return !this.image;
37
- },
38
- enumerable: true,
39
- configurable: true
40
- });
41
- Object.defineProperty(AttachmentComponent.prototype, "contentType", {
42
- get: function () {
43
- return this.attachment.contentType || '';
44
- },
45
- enumerable: true,
46
- configurable: true
47
- });
48
- tslib_1.__decorate([
49
- Input(),
50
- tslib_1.__metadata("design:type", Object),
51
- tslib_1.__metadata("design:paramtypes", [Object])
52
- ], AttachmentComponent.prototype, "attachment", null);
53
- tslib_1.__decorate([
54
- Input(),
55
- tslib_1.__metadata("design:type", AttachmentTemplateDirective)
56
- ], AttachmentComponent.prototype, "template", void 0);
57
- AttachmentComponent = tslib_1.__decorate([
58
- Component({
59
- selector: 'kendo-chat-attachment',
60
- template: "\n <ng-container *ngIf=\"template\">\n <ng-container *ngTemplateOutlet=\"template.templateRef; context: context;\">\n </ng-container>\n </ng-container>\n\n <div *ngIf=\"!template\" class=\"k-card\">\n <div class=\"k-card-body\">\n <h5 class=\"k-card-title\" *ngIf=\"attachment.title\">\n {{ attachment.title }}\n </h5>\n <h6 class=\"k-card-subtitle\" *ngIf=\"attachment.subtitle\">\n {{ attachment.subtitle }}\n </h6>\n <img *ngIf=\"image\" [attr.src]=\"attachment.content\" />\n <ng-container *ngIf=\"unknown\">\n {{ attachment.content }}\n </ng-container>\n </div>\n </div>\n "
61
- })
62
- ], AttachmentComponent);
63
- return AttachmentComponent;
64
- }());
65
- export { AttachmentComponent };
@@ -1,28 +0,0 @@
1
- /**-----------------------------------------------------------------------------------------
2
- * Copyright © 2021 Progress Software Corporation. All rights reserved.
3
- * Licensed under commercial license. See LICENSE.md in the project root for more information
4
- *-------------------------------------------------------------------------------------------*/
5
- import { SendMessageEvent } from '../api/post-message-event';
6
- var noop = function () { };
7
- var ɵ0 = noop;
8
- var ɵ1 = function (action, sender) {
9
- sender.sendMessage.emit(new SendMessageEvent({
10
- author: sender.user,
11
- text: action.value,
12
- timestamp: new Date()
13
- }));
14
- }, ɵ2 = function (action) {
15
- window.open('tel:' + action.value);
16
- }, ɵ3 = function (action) {
17
- window.open(action.value);
18
- };
19
- var handlers = {
20
- 'reply': ɵ1,
21
- 'call': ɵ2,
22
- 'openUrl': ɵ3
23
- };
24
- /**
25
- * @hidden
26
- */
27
- export var makeHandler = function (action) { return handlers[action.type] || noop; };
28
- export { ɵ0, ɵ1, ɵ2, ɵ3 };
@@ -1,13 +0,0 @@
1
- /**-----------------------------------------------------------------------------------------
2
- * Copyright © 2021 Progress Software Corporation. All rights reserved.
3
- * Licensed under commercial license. See LICENSE.md in the project root for more information
4
- *-------------------------------------------------------------------------------------------*/
5
- /**
6
- * @hidden
7
- */
8
- var ChatItem = /** @class */ (function () {
9
- function ChatItem() {
10
- }
11
- return ChatItem;
12
- }());
13
- export { ChatItem };
@@ -1,92 +0,0 @@
1
- /**-----------------------------------------------------------------------------------------
2
- * Copyright © 2021 Progress Software Corporation. All rights reserved.
3
- * Licensed under commercial license. See LICENSE.md in the project root for more information
4
- *-------------------------------------------------------------------------------------------*/
5
- import { isDevMode } from '@angular/core';
6
- /**
7
- * @hidden
8
- */
9
- export var isAuthor = function (user, msg) {
10
- return user && msg.author && user.id === msg.author.id;
11
- };
12
- var last = function (arr) { return arr[arr.length - 1]; };
13
- var ɵ0 = last;
14
- var dateChanged = function (curr, prev) {
15
- return (curr && prev) && (prev.getDate() !== curr.getDate() ||
16
- prev.getMonth() !== curr.getMonth() ||
17
- prev.getFullYear() !== curr.getFullYear());
18
- };
19
- var ɵ1 = dateChanged;
20
- var addDateMarker = function (acc, msg) {
21
- var timestamp = msg.timestamp;
22
- var lastItem = last(acc);
23
- if (!timestamp) {
24
- return;
25
- }
26
- if (!lastItem || dateChanged(timestamp, lastItem.timestamp)) {
27
- var dateMarker = {
28
- type: 'date-marker',
29
- timestamp: timestamp,
30
- trackBy: timestamp.getTime()
31
- };
32
- acc.push(dateMarker);
33
- }
34
- };
35
- var ɵ2 = addDateMarker;
36
- var groupMessages = function (acc, msg, isLastMessage) {
37
- var lastItem = last(acc);
38
- var messages;
39
- if (isDevMode() && !msg.author) {
40
- throw new Error('Author must be set for message: ' + JSON.stringify(msg));
41
- }
42
- if (msg.typing && !isLastMessage) {
43
- return;
44
- }
45
- if (lastItem && lastItem.type === 'message-group') {
46
- messages = lastItem.messages;
47
- }
48
- if (messages && isAuthor(msg.author, last(messages))) {
49
- messages.push(msg);
50
- }
51
- else {
52
- acc.push({
53
- type: 'message-group',
54
- messages: [msg],
55
- author: msg.author,
56
- timestamp: msg.timestamp,
57
- trackBy: msg
58
- });
59
- }
60
- };
61
- var ɵ3 = groupMessages;
62
- var groupItems = function (total) { return function (acc, msg, index) {
63
- var isLastMessage = index === total - 1;
64
- addDateMarker(acc, msg);
65
- groupMessages(acc, msg, isLastMessage);
66
- if (msg.attachments && msg.attachments.length > 1) {
67
- acc.push({
68
- type: 'attachment-group',
69
- attachments: msg.attachments,
70
- attachmentLayout: msg.attachmentLayout,
71
- timestamp: msg.timestamp,
72
- trackBy: msg
73
- });
74
- }
75
- if (msg.suggestedActions && isLastMessage) {
76
- acc.push({
77
- type: 'action-group',
78
- actions: msg.suggestedActions,
79
- timestamp: msg.timestamp,
80
- trackBy: msg
81
- });
82
- }
83
- return acc;
84
- }; };
85
- var ɵ4 = groupItems;
86
- /**
87
- * @hidden
88
- */
89
- export var chatView = function (messages) {
90
- return messages.reduce(groupItems(messages.length), []);
91
- };
92
- export { ɵ0, ɵ1, ɵ2, ɵ3, ɵ4 };
@@ -1,190 +0,0 @@
1
- /**-----------------------------------------------------------------------------------------
2
- * Copyright © 2021 Progress Software Corporation. All rights reserved.
3
- * Licensed under commercial license. See LICENSE.md in the project root for more information
4
- *-------------------------------------------------------------------------------------------*/
5
- import * as tslib_1 from "tslib";
6
- import { Component, ContentChild, ElementRef, EventEmitter, HostBinding, Input, isDevMode, Output, ViewChild, NgZone } from '@angular/core';
7
- import { AttachmentTemplateDirective } from './attachment-template.directive';
8
- import { L10N_PREFIX, LocalizationService } from '@progress/kendo-angular-l10n';
9
- import { makeHandler } from './builtin-actions';
10
- import { MessageTemplateDirective } from './message-template.directive';
11
- import { validatePackage } from '@progress/kendo-licensing';
12
- import { packageMetadata } from '../package-metadata';
13
- import { ChatMessageBoxTemplateDirective } from './message-box.directive';
14
- import { MessageBoxComponent } from './message-box.component';
15
- /**
16
- * Represents the Kendo UI Chat component for Angular.
17
- *
18
- * {% meta height:700 %}
19
- * {% embed_file echo/app.component.ts preview %}
20
- * {% embed_file shared/app.module.ts %}
21
- * {% embed_file shared/main.ts hidden %}
22
- * {% endmeta %}
23
- *
24
- */
25
- var ChatComponent = /** @class */ (function () {
26
- function ChatComponent(localization, zone) {
27
- var _this = this;
28
- this.localization = localization;
29
- this.zone = zone;
30
- /**
31
- * Used to switch between a one-liner input or a textarea.
32
- * ([see example]({% slug message_box %})#toc-message-box-types).
33
- * @default input
34
- */
35
- this.messageBoxType = 'textbox';
36
- /**
37
- * Fires when the user types a message and clicks the **Send** button or presses **Enter**.
38
- * Emits the [`SendMessageEvent`]({% slug api_conversational-ui_sendmessageevent %}).
39
- *
40
- * > The message is not automatically appended to the `messages` array.
41
- */
42
- this.sendMessage = new EventEmitter();
43
- /**
44
- * Fires when the user clicks a quick action button.
45
- * The Chat internally handles the `reply`, `openUrl`, and `call` [known actions]({% slug api_conversational-ui_actiontype %}).
46
- *
47
- * Emits the [`ExecuteActionEvent`]({% slug api_conversational-ui_executeactionevent %}).
48
- * The event is preventable. If `preventDefault` is called, the built-in action will be suppressed.
49
- */
50
- this.executeAction = new EventEmitter();
51
- /**
52
- * @hidden
53
- */
54
- this.autoScroll = true;
55
- validatePackage(packageMetadata);
56
- this.direction = localization.rtl ? 'rtl' : 'ltr';
57
- this.localizationChangeSubscription = localization.changes.subscribe(function (_a) {
58
- var rtl = _a.rtl;
59
- _this.direction = rtl ? 'rtl' : 'ltr';
60
- });
61
- }
62
- Object.defineProperty(ChatComponent.prototype, "className", {
63
- get: function () {
64
- return 'k-chat';
65
- },
66
- enumerable: true,
67
- configurable: true
68
- });
69
- Object.defineProperty(ChatComponent.prototype, "dirAttr", {
70
- get: function () {
71
- return this.direction;
72
- },
73
- enumerable: true,
74
- configurable: true
75
- });
76
- Object.defineProperty(ChatComponent.prototype, "localizationText", {
77
- /**
78
- * @hidden
79
- */
80
- get: function () {
81
- return this.localization;
82
- },
83
- enumerable: true,
84
- configurable: true
85
- });
86
- ChatComponent.prototype.ngOnChanges = function () {
87
- var _this = this;
88
- this.zone.runOutsideAngular(function () { return setTimeout(function () {
89
- _this.messageList.nativeElement.style.flex = '1 1 auto';
90
- }); });
91
- };
92
- ChatComponent.prototype.ngAfterViewInit = function () {
93
- if (!isDevMode()) {
94
- return;
95
- }
96
- if (!this.user) {
97
- throw new Error('User must be set and have a valid id.');
98
- }
99
- };
100
- ChatComponent.prototype.ngOnDestroy = function () {
101
- if (this.localizationChangeSubscription) {
102
- this.localizationChangeSubscription.unsubscribe();
103
- }
104
- };
105
- /**
106
- * @hidden
107
- */
108
- ChatComponent.prototype.dispatchAction = function (e) {
109
- this.executeAction.emit(e);
110
- if (!e.isDefaultPrevented()) {
111
- var handler = makeHandler(e.action);
112
- handler(e.action, this);
113
- if (!this.messageBoxTemplate) {
114
- this.messageBox.messageBoxInput.nativeElement.focus();
115
- }
116
- }
117
- };
118
- /**
119
- * @hidden
120
- */
121
- ChatComponent.prototype.textFor = function (key) {
122
- return this.localization.get(key);
123
- };
124
- tslib_1.__decorate([
125
- Input(),
126
- tslib_1.__metadata("design:type", Array)
127
- ], ChatComponent.prototype, "messages", void 0);
128
- tslib_1.__decorate([
129
- Input(),
130
- tslib_1.__metadata("design:type", Object)
131
- ], ChatComponent.prototype, "user", void 0);
132
- tslib_1.__decorate([
133
- Input(),
134
- tslib_1.__metadata("design:type", String)
135
- ], ChatComponent.prototype, "messageBoxType", void 0);
136
- tslib_1.__decorate([
137
- Output(),
138
- tslib_1.__metadata("design:type", EventEmitter)
139
- ], ChatComponent.prototype, "sendMessage", void 0);
140
- tslib_1.__decorate([
141
- Output(),
142
- tslib_1.__metadata("design:type", EventEmitter)
143
- ], ChatComponent.prototype, "executeAction", void 0);
144
- tslib_1.__decorate([
145
- HostBinding('class'),
146
- tslib_1.__metadata("design:type", String),
147
- tslib_1.__metadata("design:paramtypes", [])
148
- ], ChatComponent.prototype, "className", null);
149
- tslib_1.__decorate([
150
- HostBinding('attr.dir'),
151
- tslib_1.__metadata("design:type", String),
152
- tslib_1.__metadata("design:paramtypes", [])
153
- ], ChatComponent.prototype, "dirAttr", null);
154
- tslib_1.__decorate([
155
- ContentChild(AttachmentTemplateDirective, { static: false }),
156
- tslib_1.__metadata("design:type", AttachmentTemplateDirective)
157
- ], ChatComponent.prototype, "attachmentTemplate", void 0);
158
- tslib_1.__decorate([
159
- ContentChild(MessageTemplateDirective, { static: false }),
160
- tslib_1.__metadata("design:type", MessageTemplateDirective)
161
- ], ChatComponent.prototype, "messageTemplate", void 0);
162
- tslib_1.__decorate([
163
- ContentChild(ChatMessageBoxTemplateDirective, { static: false }),
164
- tslib_1.__metadata("design:type", ChatMessageBoxTemplateDirective)
165
- ], ChatComponent.prototype, "messageBoxTemplate", void 0);
166
- tslib_1.__decorate([
167
- ViewChild('messageBox', { static: false }),
168
- tslib_1.__metadata("design:type", MessageBoxComponent)
169
- ], ChatComponent.prototype, "messageBox", void 0);
170
- tslib_1.__decorate([
171
- ViewChild('messageList', { static: true }),
172
- tslib_1.__metadata("design:type", ElementRef)
173
- ], ChatComponent.prototype, "messageList", void 0);
174
- ChatComponent = tslib_1.__decorate([
175
- Component({
176
- providers: [
177
- LocalizationService,
178
- {
179
- provide: L10N_PREFIX,
180
- useValue: 'kendo.chat'
181
- }
182
- ],
183
- selector: 'kendo-chat',
184
- template: "\n <ng-container\n kendoChatLocalizedMessages\n i18n-messagePlaceholder=\"kendo.chat.messagePlaceholder|The placholder text of the message text input\"\n messagePlaceholder=\"Type a message...\"\n\n i18n-send=\"kendo.chat.send|The text for the Send button\"\n send=\"Send...\"\n >\n </ng-container>\n\n <div\n #messageList\n class=\"k-message-list k-avatars\"\n aria-live=\"polite\" role=\"log\"\n kendoChatScrollAnchor\n #anchor=\"scrollAnchor\"\n [(autoScroll)]=\"autoScroll\"\n >\n <kendo-chat-message-list\n [messages]=\"messages\"\n [messageTemplate]=\"messageTemplate\"\n [attachmentTemplate]=\"attachmentTemplate\"\n [user]=\"user\"\n (executeAction)=\"dispatchAction($event)\"\n (resize)=\"anchor.scrollToBottom()\"\n (navigate)=\"this.autoScroll = false\"\n >\n </kendo-chat-message-list>\n </div>\n <kendo-message-box\n #messageBox\n [messageBoxTemplate]=\"messageBoxTemplate\"\n [type]=\"messageBoxType\"\n [user]=\"user\"\n [autoScroll]=\"autoScroll\"\n [localization]=\"localizationText\"\n (sendMessage)=\"sendMessage.emit($event)\"\n >\n </kendo-message-box>\n "
185
- }),
186
- tslib_1.__metadata("design:paramtypes", [LocalizationService, NgZone])
187
- ], ChatComponent);
188
- return ChatComponent;
189
- }());
190
- export { ChatComponent };
@@ -1,80 +0,0 @@
1
- /**-----------------------------------------------------------------------------------------
2
- * Copyright © 2021 Progress Software Corporation. All rights reserved.
3
- * Licensed under commercial license. See LICENSE.md in the project root for more information
4
- *-------------------------------------------------------------------------------------------*/
5
- import * as tslib_1 from "tslib";
6
- import { AttachmentComponent } from './attachment.component';
7
- import { AttachmentTemplateDirective, ChatComponent, MessageTemplateDirective } from './chat.directives';
8
- import { ButtonModule } from '@progress/kendo-angular-buttons';
9
- import { CommonModule } from '@angular/common';
10
- import { ResizeSensorModule } from '@progress/kendo-angular-common';
11
- import { CustomMessagesComponent } from './l10n/custom-messages.component';
12
- import { FocusedStateDirective } from '../common/focused-state.directive';
13
- import { HeroCardComponent } from '../cards/hero-card.component';
14
- import { LocalizedMessagesDirective } from './l10n/localized-messages.directive';
15
- import { MessageAttachmentsComponent } from './message-attachments.component';
16
- import { MessageComponent } from './message.component';
17
- import { MessageListComponent } from './message-list.component';
18
- import { NgModule } from '@angular/core';
19
- import { ScrollAnchorDirective } from '../common/scroll-anchor.directive';
20
- import { SuggestedActionsComponent } from './suggested-actions.component';
21
- import { MessageBoxComponent } from './message-box.component';
22
- import { ChatMessageBoxTemplateDirective } from './message-box.directive';
23
- var PUBLIC_DIRECTIVES = [
24
- ChatComponent,
25
- CustomMessagesComponent,
26
- AttachmentTemplateDirective,
27
- MessageTemplateDirective,
28
- HeroCardComponent,
29
- ChatMessageBoxTemplateDirective
30
- ];
31
- var PRIVATE_DIRECTIVES = [
32
- AttachmentComponent,
33
- FocusedStateDirective,
34
- LocalizedMessagesDirective,
35
- MessageAttachmentsComponent,
36
- MessageComponent,
37
- MessageListComponent,
38
- MessageTemplateDirective,
39
- ScrollAnchorDirective,
40
- SuggestedActionsComponent,
41
- MessageBoxComponent
42
- ];
43
- /**
44
- * The [NgModule]({{ site.data.urls.angular['ngmodules'] }}) for the Chat component.
45
- *
46
- * @example
47
- * ```ts-no-run
48
- * import { NgModule } from '@angular/core';
49
- * import { Component } from '@angular/core';
50
- * import { BrowserModule } from '@angular/platform-browser';
51
- *
52
- * import { ChatModule } from '@progress/kendo-angular-conversational-ui';
53
- * import { AppComponent } from './app.component';
54
- *
55
- * _@NgModule({
56
- * imports: [ BrowserModule, ChatModule ],
57
- * declarations: [ AppComponent ],
58
- * bootstrap: [ AppComponent ]
59
- * })
60
- *
61
- * export class AppModule { }
62
- * ```
63
- */
64
- var ChatModule = /** @class */ (function () {
65
- function ChatModule() {
66
- }
67
- ChatModule = tslib_1.__decorate([
68
- NgModule({
69
- declarations: PUBLIC_DIRECTIVES.concat(PRIVATE_DIRECTIVES),
70
- exports: [PUBLIC_DIRECTIVES],
71
- imports: [
72
- ButtonModule,
73
- CommonModule,
74
- ResizeSensorModule
75
- ]
76
- })
77
- ], ChatModule);
78
- return ChatModule;
79
- }());
80
- export { ChatModule };
@@ -1,45 +0,0 @@
1
- /**-----------------------------------------------------------------------------------------
2
- * Copyright © 2021 Progress Software Corporation. All rights reserved.
3
- * Licensed under commercial license. See LICENSE.md in the project root for more information
4
- *-------------------------------------------------------------------------------------------*/
5
- import * as tslib_1 from "tslib";
6
- import { Component, forwardRef } from '@angular/core';
7
- import { LocalizationService } from '@progress/kendo-angular-l10n';
8
- import { Messages } from './messages';
9
- // tslint:disable:no-forward-ref
10
- /**
11
- * Custom component messages override default component messages
12
- * ([see example]({% slug globalization_chat %}#toc-custom-messages)).
13
- */
14
- var CustomMessagesComponent = /** @class */ (function (_super) {
15
- tslib_1.__extends(CustomMessagesComponent, _super);
16
- function CustomMessagesComponent(service) {
17
- var _this = _super.call(this) || this;
18
- _this.service = service;
19
- return _this;
20
- }
21
- CustomMessagesComponent_1 = CustomMessagesComponent;
22
- Object.defineProperty(CustomMessagesComponent.prototype, "override", {
23
- get: function () {
24
- return true;
25
- },
26
- enumerable: true,
27
- configurable: true
28
- });
29
- var CustomMessagesComponent_1;
30
- CustomMessagesComponent = CustomMessagesComponent_1 = tslib_1.__decorate([
31
- Component({
32
- providers: [
33
- {
34
- provide: Messages,
35
- useExisting: forwardRef(function () { return CustomMessagesComponent_1; })
36
- }
37
- ],
38
- selector: 'kendo-chat-messages',
39
- template: ""
40
- }),
41
- tslib_1.__metadata("design:paramtypes", [LocalizationService])
42
- ], CustomMessagesComponent);
43
- return CustomMessagesComponent;
44
- }(Messages));
45
- export { CustomMessagesComponent };
@@ -1,36 +0,0 @@
1
- /**-----------------------------------------------------------------------------------------
2
- * Copyright © 2021 Progress Software Corporation. All rights reserved.
3
- * Licensed under commercial license. See LICENSE.md in the project root for more information
4
- *-------------------------------------------------------------------------------------------*/
5
- import * as tslib_1 from "tslib";
6
- import { Directive, forwardRef } from '@angular/core';
7
- import { LocalizationService } from '@progress/kendo-angular-l10n';
8
- import { Messages } from './messages';
9
- // tslint:disable:no-forward-ref
10
- /**
11
- * @hidden
12
- */
13
- var LocalizedMessagesDirective = /** @class */ (function (_super) {
14
- tslib_1.__extends(LocalizedMessagesDirective, _super);
15
- function LocalizedMessagesDirective(service) {
16
- var _this = _super.call(this) || this;
17
- _this.service = service;
18
- return _this;
19
- }
20
- LocalizedMessagesDirective_1 = LocalizedMessagesDirective;
21
- var LocalizedMessagesDirective_1;
22
- LocalizedMessagesDirective = LocalizedMessagesDirective_1 = tslib_1.__decorate([
23
- Directive({
24
- providers: [
25
- {
26
- provide: Messages,
27
- useExisting: forwardRef(function () { return LocalizedMessagesDirective_1; })
28
- }
29
- ],
30
- selector: '[kendoChatLocalizedMessages]'
31
- }),
32
- tslib_1.__metadata("design:paramtypes", [LocalizationService])
33
- ], LocalizedMessagesDirective);
34
- return LocalizedMessagesDirective;
35
- }(Messages));
36
- export { LocalizedMessagesDirective };
@@ -1,26 +0,0 @@
1
- /**-----------------------------------------------------------------------------------------
2
- * Copyright © 2021 Progress Software Corporation. All rights reserved.
3
- * Licensed under commercial license. See LICENSE.md in the project root for more information
4
- *-------------------------------------------------------------------------------------------*/
5
- import * as tslib_1 from "tslib";
6
- import { Input } from '@angular/core';
7
- import { ComponentMessages } from '@progress/kendo-angular-l10n';
8
- /**
9
- * @hidden
10
- */
11
- var Messages = /** @class */ (function (_super) {
12
- tslib_1.__extends(Messages, _super);
13
- function Messages() {
14
- return _super !== null && _super.apply(this, arguments) || this;
15
- }
16
- tslib_1.__decorate([
17
- Input(),
18
- tslib_1.__metadata("design:type", String)
19
- ], Messages.prototype, "messagePlaceholder", void 0);
20
- tslib_1.__decorate([
21
- Input(),
22
- tslib_1.__metadata("design:type", String)
23
- ], Messages.prototype, "send", void 0);
24
- return Messages;
25
- }(ComponentMessages));
26
- export { Messages };