@progress/kendo-angular-conversational-ui 4.0.0 → 5.0.0-next.202202241517

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 (148) 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 +6 -6
  17. package/{dist/es2015/chat → chat}/chat.directives.d.ts +0 -0
  18. package/chat/chat.module.d.ts +47 -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-list.component.d.ts +8 -7
  24. package/{dist/es2015/chat → chat}/message-template.directive.d.ts +3 -0
  25. package/{dist/es2015/chat → chat}/message.component.d.ts +4 -1
  26. package/{dist/es2015/chat → chat}/suggested-actions.component.d.ts +4 -1
  27. package/common/focused-state.directive.d.ts +15 -0
  28. package/{dist/es2015/common → common}/keys.enum.d.ts +0 -0
  29. package/{dist/es2015/common → common}/scroll-anchor.directive.d.ts +3 -0
  30. package/{dist/es2015/common → common}/utils.d.ts +0 -0
  31. package/{dist/es2015 → esm2015}/api/action.interface.js +2 -1
  32. package/{dist/es2015 → esm2015}/api/attachment.interface.js +1 -0
  33. package/{dist/es2015 → esm2015}/api/execute-action-event.js +0 -0
  34. package/{dist/es/api/attachment.interface.js → esm2015/api/index.js} +6 -0
  35. package/{dist/es → esm2015}/api/message.interface.js +1 -0
  36. package/{dist/es2015 → esm2015}/api/post-message-event.js +0 -0
  37. package/{dist/es2015 → esm2015}/api/preventable-event.js +0 -0
  38. package/{dist/es2015 → esm2015}/api/user.interface.js +1 -0
  39. package/esm2015/cards/hero-card.component.js +88 -0
  40. package/{dist/es2015 → esm2015}/chat/attachment-template.directive.js +14 -12
  41. package/esm2015/chat/attachment.component.js +83 -0
  42. package/{dist/es2015 → esm2015}/chat/builtin-actions.js +13 -16
  43. package/{dist/es2015 → esm2015}/chat/chat-item.js +0 -0
  44. package/{dist/es2015 → esm2015}/chat/chat-view.js +0 -6
  45. package/esm2015/chat/chat.component.js +226 -0
  46. package/{dist/es → esm2015}/chat/chat.directives.js +0 -0
  47. package/{dist/es2015 → esm2015}/chat/chat.module.js +40 -15
  48. package/esm2015/chat/l10n/custom-messages.component.js +42 -0
  49. package/esm2015/chat/l10n/localized-messages.directive.js +37 -0
  50. package/esm2015/chat/l10n/messages.js +24 -0
  51. package/{dist/es2015 → esm2015}/chat/message-attachments.component.js +71 -48
  52. package/esm2015/chat/message-list.component.js +279 -0
  53. package/{dist/es2015 → esm2015}/chat/message-template.directive.js +14 -12
  54. package/esm2015/chat/message.component.js +140 -0
  55. package/esm2015/chat/suggested-actions.component.js +111 -0
  56. package/esm2015/common/focused-state.directive.js +37 -0
  57. package/{dist/es2015 → esm2015}/common/keys.enum.js +1 -0
  58. package/{dist/es2015 → esm2015}/common/scroll-anchor.directive.js +20 -26
  59. package/{dist/es2015 → esm2015}/common/utils.js +0 -0
  60. package/{dist/es/api/action.interface.js → esm2015/kendo-angular-conversational-ui.js} +4 -1
  61. package/{dist/npm/chat/chat-item.js → esm2015/main.js} +5 -11
  62. package/{dist/es2015 → esm2015}/package-metadata.js +1 -1
  63. package/fesm2015/kendo-angular-conversational-ui.js +1576 -0
  64. package/{dist/es2015/common/focused-state.directive.d.ts → kendo-angular-conversational-ui.d.ts} +3 -6
  65. package/main.d.ts +9 -0
  66. package/{dist/es2015/package-metadata.d.ts → package-metadata.d.ts} +0 -0
  67. package/package.json +34 -101
  68. package/schematics/ngAdd/index.js +5 -2
  69. package/schematics/ngAdd/index.js.map +1 -1
  70. package/dist/cdn/js/kendo-angular-conversational-ui.js +0 -20
  71. package/dist/cdn/main.js +0 -5
  72. package/dist/es/api/execute-action-event.js +0 -24
  73. package/dist/es/api/post-message-event.js +0 -18
  74. package/dist/es/api/preventable-event.js +0 -32
  75. package/dist/es/cards/hero-card.component.js +0 -54
  76. package/dist/es/chat/attachment-template.directive.js +0 -32
  77. package/dist/es/chat/attachment.component.js +0 -65
  78. package/dist/es/chat/builtin-actions.js +0 -28
  79. package/dist/es/chat/chat-item.js +0 -13
  80. package/dist/es/chat/chat-view.js +0 -92
  81. package/dist/es/chat/chat.component.js +0 -193
  82. package/dist/es/chat/chat.module.js +0 -76
  83. package/dist/es/chat/l10n/custom-messages.component.js +0 -45
  84. package/dist/es/chat/l10n/localized-messages.directive.js +0 -36
  85. package/dist/es/chat/l10n/messages.js +0 -26
  86. package/dist/es/chat/message-attachments.component.js +0 -148
  87. package/dist/es/chat/message-list.component.js +0 -165
  88. package/dist/es/chat/message-template.directive.js +0 -32
  89. package/dist/es/chat/message.component.js +0 -77
  90. package/dist/es/chat/suggested-actions.component.js +0 -91
  91. package/dist/es/common/focused-state.directive.js +0 -43
  92. package/dist/es/common/keys.enum.js +0 -4
  93. package/dist/es/common/scroll-anchor.directive.js +0 -87
  94. package/dist/es/common/utils.js +0 -13
  95. package/dist/es/index.js +0 -21
  96. package/dist/es/main.js +0 -8
  97. package/dist/es/package-metadata.js +0 -15
  98. package/dist/es2015/api/message.interface.js +0 -4
  99. package/dist/es2015/cards/hero-card.component.js +0 -78
  100. package/dist/es2015/chat/attachment.component.js +0 -66
  101. package/dist/es2015/chat/chat.component.js +0 -230
  102. package/dist/es2015/chat/chat.directives.js +0 -7
  103. package/dist/es2015/chat/chat.module.d.ts +0 -27
  104. package/dist/es2015/chat/l10n/custom-messages.component.js +0 -37
  105. package/dist/es2015/chat/l10n/localized-messages.directive.js +0 -32
  106. package/dist/es2015/chat/l10n/messages.js +0 -20
  107. package/dist/es2015/chat/message-list.component.js +0 -227
  108. package/dist/es2015/chat/message.component.js +0 -107
  109. package/dist/es2015/chat/suggested-actions.component.js +0 -104
  110. package/dist/es2015/common/focused-state.directive.js +0 -45
  111. package/dist/es2015/index.d.ts +0 -21
  112. package/dist/es2015/index.js +0 -21
  113. package/dist/es2015/index.metadata.json +0 -1
  114. package/dist/es2015/main.d.ts +0 -12
  115. package/dist/es2015/main.js +0 -8
  116. package/dist/fesm2015/index.js +0 -1403
  117. package/dist/fesm5/index.js +0 -1253
  118. package/dist/npm/api/action.interface.js +0 -7
  119. package/dist/npm/api/attachment.interface.js +0 -6
  120. package/dist/npm/api/execute-action-event.js +0 -26
  121. package/dist/npm/api/message.interface.js +0 -6
  122. package/dist/npm/api/post-message-event.js +0 -20
  123. package/dist/npm/api/preventable-event.js +0 -34
  124. package/dist/npm/api/user.interface.js +0 -6
  125. package/dist/npm/cards/hero-card.component.js +0 -56
  126. package/dist/npm/chat/attachment-template.directive.js +0 -34
  127. package/dist/npm/chat/attachment.component.js +0 -67
  128. package/dist/npm/chat/builtin-actions.js +0 -33
  129. package/dist/npm/chat/chat-view.js +0 -98
  130. package/dist/npm/chat/chat.component.js +0 -195
  131. package/dist/npm/chat/chat.directives.js +0 -12
  132. package/dist/npm/chat/chat.module.js +0 -78
  133. package/dist/npm/chat/l10n/custom-messages.component.js +0 -47
  134. package/dist/npm/chat/l10n/localized-messages.directive.js +0 -38
  135. package/dist/npm/chat/l10n/messages.js +0 -28
  136. package/dist/npm/chat/message-attachments.component.js +0 -150
  137. package/dist/npm/chat/message-list.component.js +0 -167
  138. package/dist/npm/chat/message-template.directive.js +0 -34
  139. package/dist/npm/chat/message.component.js +0 -79
  140. package/dist/npm/chat/suggested-actions.component.js +0 -93
  141. package/dist/npm/common/focused-state.directive.js +0 -45
  142. package/dist/npm/common/keys.enum.js +0 -6
  143. package/dist/npm/common/scroll-anchor.directive.js +0 -89
  144. package/dist/npm/common/utils.js +0 -15
  145. package/dist/npm/index.js +0 -37
  146. package/dist/npm/main.js +0 -11
  147. package/dist/npm/package-metadata.js +0 -17
  148. package/dist/systemjs/kendo-angular-conversational-ui.js +0 -5
@@ -1,78 +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
- "use strict";
6
- Object.defineProperty(exports, "__esModule", { value: true });
7
- var tslib_1 = require("tslib");
8
- var attachment_component_1 = require("./attachment.component");
9
- var chat_directives_1 = require("./chat.directives");
10
- var kendo_angular_buttons_1 = require("@progress/kendo-angular-buttons");
11
- var common_1 = require("@angular/common");
12
- var kendo_angular_common_1 = require("@progress/kendo-angular-common");
13
- var custom_messages_component_1 = require("./l10n/custom-messages.component");
14
- var focused_state_directive_1 = require("../common/focused-state.directive");
15
- var hero_card_component_1 = require("../cards/hero-card.component");
16
- var localized_messages_directive_1 = require("./l10n/localized-messages.directive");
17
- var message_attachments_component_1 = require("./message-attachments.component");
18
- var message_component_1 = require("./message.component");
19
- var message_list_component_1 = require("./message-list.component");
20
- var core_1 = require("@angular/core");
21
- var scroll_anchor_directive_1 = require("../common/scroll-anchor.directive");
22
- var suggested_actions_component_1 = require("./suggested-actions.component");
23
- var PUBLIC_DIRECTIVES = [
24
- chat_directives_1.ChatComponent,
25
- custom_messages_component_1.CustomMessagesComponent,
26
- chat_directives_1.AttachmentTemplateDirective,
27
- chat_directives_1.MessageTemplateDirective,
28
- hero_card_component_1.HeroCardComponent
29
- ];
30
- var PRIVATE_DIRECTIVES = [
31
- attachment_component_1.AttachmentComponent,
32
- focused_state_directive_1.FocusedStateDirective,
33
- localized_messages_directive_1.LocalizedMessagesDirective,
34
- message_attachments_component_1.MessageAttachmentsComponent,
35
- message_component_1.MessageComponent,
36
- message_list_component_1.MessageListComponent,
37
- chat_directives_1.MessageTemplateDirective,
38
- scroll_anchor_directive_1.ScrollAnchorDirective,
39
- suggested_actions_component_1.SuggestedActionsComponent
40
- ];
41
- /**
42
- * The [NgModule]({{ site.data.urls.angular['ngmodules'] }}) for the Chat component.
43
- *
44
- * @example
45
- * ```ts-no-run
46
- * import { NgModule } from '@angular/core';
47
- * import { Component } from '@angular/core';
48
- * import { BrowserModule } from '@angular/platform-browser';
49
- *
50
- * import { ChatModule } from '@progress/kendo-angular-conversational-ui';
51
- * import { AppComponent } from './app.component';
52
- *
53
- * _@NgModule({
54
- * imports: [ BrowserModule, ChatModule ],
55
- * declarations: [ AppComponent ],
56
- * bootstrap: [ AppComponent ]
57
- * })
58
- *
59
- * export class AppModule { }
60
- * ```
61
- */
62
- var ChatModule = /** @class */ (function () {
63
- function ChatModule() {
64
- }
65
- ChatModule = tslib_1.__decorate([
66
- core_1.NgModule({
67
- declarations: PUBLIC_DIRECTIVES.concat(PRIVATE_DIRECTIVES),
68
- exports: [PUBLIC_DIRECTIVES],
69
- imports: [
70
- kendo_angular_buttons_1.ButtonModule,
71
- common_1.CommonModule,
72
- kendo_angular_common_1.ResizeSensorModule
73
- ]
74
- })
75
- ], ChatModule);
76
- return ChatModule;
77
- }());
78
- exports.ChatModule = ChatModule;
@@ -1,47 +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
- "use strict";
6
- Object.defineProperty(exports, "__esModule", { value: true });
7
- var tslib_1 = require("tslib");
8
- var core_1 = require("@angular/core");
9
- var kendo_angular_l10n_1 = require("@progress/kendo-angular-l10n");
10
- var messages_1 = require("./messages");
11
- // tslint:disable:no-forward-ref
12
- /**
13
- * Custom component messages override default component messages
14
- * ([see example]({% slug globalization_chat %}#toc-custom-messages)).
15
- */
16
- var CustomMessagesComponent = /** @class */ (function (_super) {
17
- tslib_1.__extends(CustomMessagesComponent, _super);
18
- function CustomMessagesComponent(service) {
19
- var _this = _super.call(this) || this;
20
- _this.service = service;
21
- return _this;
22
- }
23
- CustomMessagesComponent_1 = CustomMessagesComponent;
24
- Object.defineProperty(CustomMessagesComponent.prototype, "override", {
25
- get: function () {
26
- return true;
27
- },
28
- enumerable: true,
29
- configurable: true
30
- });
31
- var CustomMessagesComponent_1;
32
- CustomMessagesComponent = CustomMessagesComponent_1 = tslib_1.__decorate([
33
- core_1.Component({
34
- providers: [
35
- {
36
- provide: messages_1.Messages,
37
- useExisting: core_1.forwardRef(function () { return CustomMessagesComponent_1; })
38
- }
39
- ],
40
- selector: 'kendo-chat-messages',
41
- template: ""
42
- }),
43
- tslib_1.__metadata("design:paramtypes", [kendo_angular_l10n_1.LocalizationService])
44
- ], CustomMessagesComponent);
45
- return CustomMessagesComponent;
46
- }(messages_1.Messages));
47
- exports.CustomMessagesComponent = CustomMessagesComponent;
@@ -1,38 +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
- "use strict";
6
- Object.defineProperty(exports, "__esModule", { value: true });
7
- var tslib_1 = require("tslib");
8
- var core_1 = require("@angular/core");
9
- var kendo_angular_l10n_1 = require("@progress/kendo-angular-l10n");
10
- var messages_1 = require("./messages");
11
- // tslint:disable:no-forward-ref
12
- /**
13
- * @hidden
14
- */
15
- var LocalizedMessagesDirective = /** @class */ (function (_super) {
16
- tslib_1.__extends(LocalizedMessagesDirective, _super);
17
- function LocalizedMessagesDirective(service) {
18
- var _this = _super.call(this) || this;
19
- _this.service = service;
20
- return _this;
21
- }
22
- LocalizedMessagesDirective_1 = LocalizedMessagesDirective;
23
- var LocalizedMessagesDirective_1;
24
- LocalizedMessagesDirective = LocalizedMessagesDirective_1 = tslib_1.__decorate([
25
- core_1.Directive({
26
- providers: [
27
- {
28
- provide: messages_1.Messages,
29
- useExisting: core_1.forwardRef(function () { return LocalizedMessagesDirective_1; })
30
- }
31
- ],
32
- selector: '[kendoChatLocalizedMessages]'
33
- }),
34
- tslib_1.__metadata("design:paramtypes", [kendo_angular_l10n_1.LocalizationService])
35
- ], LocalizedMessagesDirective);
36
- return LocalizedMessagesDirective;
37
- }(messages_1.Messages));
38
- exports.LocalizedMessagesDirective = LocalizedMessagesDirective;
@@ -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
- "use strict";
6
- Object.defineProperty(exports, "__esModule", { value: true });
7
- var tslib_1 = require("tslib");
8
- var core_1 = require("@angular/core");
9
- var kendo_angular_l10n_1 = require("@progress/kendo-angular-l10n");
10
- /**
11
- * @hidden
12
- */
13
- var Messages = /** @class */ (function (_super) {
14
- tslib_1.__extends(Messages, _super);
15
- function Messages() {
16
- return _super !== null && _super.apply(this, arguments) || this;
17
- }
18
- tslib_1.__decorate([
19
- core_1.Input(),
20
- tslib_1.__metadata("design:type", String)
21
- ], Messages.prototype, "messagePlaceholder", void 0);
22
- tslib_1.__decorate([
23
- core_1.Input(),
24
- tslib_1.__metadata("design:type", String)
25
- ], Messages.prototype, "send", void 0);
26
- return Messages;
27
- }(kendo_angular_l10n_1.ComponentMessages));
28
- exports.Messages = Messages;
@@ -1,150 +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
- "use strict";
6
- Object.defineProperty(exports, "__esModule", { value: true });
7
- var tslib_1 = require("tslib");
8
- var core_1 = require("@angular/core");
9
- var rxjs_1 = require("rxjs");
10
- var operators_1 = require("rxjs/operators");
11
- var chat_item_1 = require("./chat-item");
12
- var chat_directives_1 = require("./chat.directives");
13
- // tslint:disable:no-forward-ref
14
- /**
15
- * @hidden
16
- */
17
- var MessageAttachmentsComponent = /** @class */ (function (_super) {
18
- tslib_1.__extends(MessageAttachmentsComponent, _super);
19
- function MessageAttachmentsComponent(zone) {
20
- var _a, _b;
21
- var _this = _super.call(this) || this;
22
- _this.zone = zone;
23
- _this.scrollPosition = 0;
24
- _this.selectedIndex = 0;
25
- _this.carouselKeyHandlers = (_a = {},
26
- _a[37 /* left */] = function (e) { return _this.navigateTo(e, -1); },
27
- _a[39 /* right */] = function (e) { return _this.navigateTo(e, 1); },
28
- _a);
29
- _this.listKeyHandlers = (_b = {},
30
- _b[38 /* up */] = function (e) { return _this.navigateTo(e, -1); },
31
- _b[40 /* down */] = function (e) { return _this.navigateTo(e, 1); },
32
- _b);
33
- return _this;
34
- }
35
- MessageAttachmentsComponent_1 = MessageAttachmentsComponent;
36
- Object.defineProperty(MessageAttachmentsComponent.prototype, "carousel", {
37
- get: function () {
38
- return this.layout !== 'list';
39
- },
40
- enumerable: true,
41
- configurable: true
42
- });
43
- MessageAttachmentsComponent.prototype.ngAfterViewInit = function () {
44
- var _this = this;
45
- this.zone.runOutsideAngular(function () {
46
- var scrollDebounceTime = 100;
47
- _this.scrollSubscription = rxjs_1.fromEvent(_this.deck.nativeElement, 'scroll')
48
- .pipe(operators_1.debounceTime(scrollDebounceTime))
49
- .subscribe(function () { return _this.onScroll(); });
50
- });
51
- };
52
- MessageAttachmentsComponent.prototype.ngOnDestroy = function () {
53
- this.scrollSubscription.unsubscribe();
54
- };
55
- MessageAttachmentsComponent.prototype.isSelected = function (index) {
56
- return this.selectedIndex === index;
57
- };
58
- MessageAttachmentsComponent.prototype.itemKeydown = function (e, attachment) {
59
- var keyHandlers = this.layout === 'list' ?
60
- this.listKeyHandlers : this.carouselKeyHandlers;
61
- var handler = keyHandlers[e.keyCode];
62
- if (handler) {
63
- handler(e, attachment);
64
- }
65
- };
66
- MessageAttachmentsComponent.prototype.itemClick = function (index) {
67
- this.select(index);
68
- };
69
- MessageAttachmentsComponent.prototype.focus = function () {
70
- this.select(this.selectedIndex);
71
- };
72
- MessageAttachmentsComponent.prototype.scrollTo = function (dir) {
73
- var el = this.deck.nativeElement;
74
- var scrollStep = el.scrollWidth / this.items.length;
75
- var max = el.scrollWidth - el.offsetWidth;
76
- var pos = el.scrollLeft + scrollStep * dir;
77
- el.scrollLeft = Math.max(0, Math.min(max, pos));
78
- };
79
- MessageAttachmentsComponent.prototype.select = function (index) {
80
- this.selectedIndex = index;
81
- var item = this.items.toArray()[index];
82
- if (item) {
83
- item.nativeElement.focus();
84
- }
85
- };
86
- MessageAttachmentsComponent.prototype.navigateTo = function (e, offset) {
87
- var prevIndex = this.selectedIndex;
88
- var nextIndex = Math.max(0, Math.min(prevIndex + offset, this.items.length - 1));
89
- if (nextIndex !== prevIndex) {
90
- this.select(nextIndex);
91
- e.preventDefault();
92
- }
93
- };
94
- MessageAttachmentsComponent.prototype.onScroll = function () {
95
- var _this = this;
96
- var el = this.deck.nativeElement;
97
- if (el.scrollWidth === 0) {
98
- return;
99
- }
100
- var pos = el.scrollLeft / (el.scrollWidth - el.offsetWidth);
101
- if (pos !== this.scrollPosition) {
102
- this.zone.run(function () {
103
- _this.scrollPosition = pos;
104
- });
105
- }
106
- };
107
- var MessageAttachmentsComponent_1;
108
- tslib_1.__decorate([
109
- core_1.Input(),
110
- tslib_1.__metadata("design:type", Array)
111
- ], MessageAttachmentsComponent.prototype, "attachments", void 0);
112
- tslib_1.__decorate([
113
- core_1.Input(),
114
- tslib_1.__metadata("design:type", String)
115
- ], MessageAttachmentsComponent.prototype, "layout", void 0);
116
- tslib_1.__decorate([
117
- core_1.Input(),
118
- tslib_1.__metadata("design:type", Boolean)
119
- ], MessageAttachmentsComponent.prototype, "tabbable", void 0);
120
- tslib_1.__decorate([
121
- core_1.Input(),
122
- tslib_1.__metadata("design:type", chat_directives_1.AttachmentTemplateDirective)
123
- ], MessageAttachmentsComponent.prototype, "template", void 0);
124
- tslib_1.__decorate([
125
- core_1.HostBinding('class.k-card-deck-scrollwrap'),
126
- tslib_1.__metadata("design:type", Boolean),
127
- tslib_1.__metadata("design:paramtypes", [])
128
- ], MessageAttachmentsComponent.prototype, "carousel", null);
129
- tslib_1.__decorate([
130
- core_1.ViewChild('deck', { read: core_1.ElementRef, static: true }),
131
- tslib_1.__metadata("design:type", core_1.ElementRef)
132
- ], MessageAttachmentsComponent.prototype, "deck", void 0);
133
- tslib_1.__decorate([
134
- core_1.ViewChildren('item', { read: core_1.ElementRef }),
135
- tslib_1.__metadata("design:type", core_1.QueryList)
136
- ], MessageAttachmentsComponent.prototype, "items", void 0);
137
- MessageAttachmentsComponent = MessageAttachmentsComponent_1 = tslib_1.__decorate([
138
- core_1.Component({
139
- providers: [{
140
- provide: chat_item_1.ChatItem,
141
- useExisting: core_1.forwardRef(function () { return MessageAttachmentsComponent_1; })
142
- }],
143
- selector: 'kendo-chat-message-attachments',
144
- template: "\n <button\n *ngIf=\"carousel && scrollPosition > 0\"\n (click)=\"scrollTo(-1)\"\n class=\"k-button k-icon-button k-button-md k-rounded-md k-button-solid k-button-solid-base\"\n tabindex=\"-1\">\n <span class=\"k-icon k-button-icon k-i-arrow-chevron-left\"></span>\n </button>\n <div #deck [class.k-card-deck]=\"carousel\">\n <kendo-chat-attachment #item\n *ngFor=\"let att of attachments; index as index; first as first; last as last\"\n [attachment]=\"att\"\n [template]=\"template\"\n [class.k-state-selected]=\"isSelected(index)\"\n [class.k-state-focused]=\"isSelected(index)\"\n [class.k-card-wrap]=\"true\"\n [class.k-first]=\"first\"\n [class.k-last]=\"last\"\n [attr.tabindex]=\"tabbable && isSelected(index) ? '0' : '-1'\"\n (click)=\"itemClick(index)\"\n (keydown)=\"itemKeydown($event, att)\"\n >\n </kendo-chat-attachment>\n </div>\n <button\n *ngIf=\"carousel && scrollPosition < 1\"\n (click)=\"scrollTo(1)\"\n class=\"k-button k-icon-button k-button-md k-rounded-md k-button-solid k-button-solid-base\"\n tabindex=\"-1\">\n <span class=\"k-icon k-button-icon k-i-arrow-chevron-right\"></span>\n </button>\n "
145
- }),
146
- tslib_1.__metadata("design:paramtypes", [core_1.NgZone])
147
- ], MessageAttachmentsComponent);
148
- return MessageAttachmentsComponent;
149
- }(chat_item_1.ChatItem));
150
- exports.MessageAttachmentsComponent = MessageAttachmentsComponent;
@@ -1,167 +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
- "use strict";
6
- Object.defineProperty(exports, "__esModule", { value: true });
7
- var tslib_1 = require("tslib");
8
- var core_1 = require("@angular/core");
9
- var execute_action_event_1 = require("../api/execute-action-event");
10
- var utils_1 = require("../common/utils");
11
- var chat_item_1 = require("./chat-item");
12
- var chat_view_1 = require("./chat-view");
13
- var chat_directives_1 = require("./chat.directives");
14
- var message_template_directive_1 = require("./message-template.directive");
15
- var kendo_angular_intl_1 = require("@progress/kendo-angular-intl");
16
- /**
17
- * @hidden
18
- */
19
- var MessageListComponent = /** @class */ (function () {
20
- function MessageListComponent(element, intl) {
21
- var _this = this;
22
- var _a;
23
- this.element = element;
24
- this.intl = intl;
25
- this.executeAction = new core_1.EventEmitter();
26
- this.navigate = new core_1.EventEmitter();
27
- this.resize = new core_1.EventEmitter();
28
- this.cssClass = true;
29
- this.view = [];
30
- this.keyActions = (_a = {},
31
- _a[38 /* up */] = function (e) { return _this.navigateTo(e, -1); },
32
- _a[40 /* down */] = function (e) { return _this.navigateTo(e, 1); },
33
- _a);
34
- }
35
- Object.defineProperty(MessageListComponent.prototype, "messages", {
36
- get: function () {
37
- return this._messages;
38
- },
39
- set: function (value) {
40
- var data = value || [];
41
- this.view = chat_view_1.chatView(data);
42
- this._messages = data;
43
- },
44
- enumerable: true,
45
- configurable: true
46
- });
47
- MessageListComponent.prototype.ngAfterViewInit = function () {
48
- this.selectedItem = this.items.last;
49
- };
50
- MessageListComponent.prototype.onResize = function () {
51
- this.resize.emit();
52
- };
53
- MessageListComponent.prototype.formatTimeStamp = function (date) {
54
- return this.intl.formatDate(date, { date: 'full' });
55
- };
56
- MessageListComponent.prototype.onKeydown = function (e) {
57
- var action = this.keyActions[e.keyCode];
58
- if (action) {
59
- action(e);
60
- }
61
- };
62
- MessageListComponent.prototype.onBlur = function (args) {
63
- var _this = this;
64
- var next = args.relatedTarget || document.activeElement;
65
- var outside = !utils_1.closest(next, function (node) { return node === _this.element.nativeElement; });
66
- if (outside) {
67
- this.select(null);
68
- }
69
- };
70
- MessageListComponent.prototype.isOwnMessage = function (msg) {
71
- return chat_view_1.isAuthor(this.user, msg);
72
- };
73
- MessageListComponent.prototype.dispatchAction = function (action, message) {
74
- var args = new execute_action_event_1.ExecuteActionEvent(action, message);
75
- this.executeAction.emit(args);
76
- };
77
- MessageListComponent.prototype.trackGroup = function (_index, item) {
78
- return item.trackBy;
79
- };
80
- MessageListComponent.prototype.select = function (item) {
81
- var prevItem = this.selectedItem;
82
- if (prevItem) {
83
- prevItem.selected = false;
84
- }
85
- if (item) {
86
- item.selected = true;
87
- this.selectedItem = item;
88
- }
89
- };
90
- MessageListComponent.prototype.last = function (items) {
91
- if (!items || items.length === 0) {
92
- return;
93
- }
94
- return items[items.length - 1];
95
- };
96
- MessageListComponent.prototype.navigateTo = function (e, offset) {
97
- var items = this.items.toArray();
98
- var prevItem = this.selectedItem;
99
- var prevIndex = items.indexOf(prevItem);
100
- var nextIndex = Math.max(0, Math.min(prevIndex + offset, this.items.length - 1));
101
- var nextItem = items[nextIndex];
102
- if (nextItem !== prevItem) {
103
- this.select(nextItem);
104
- nextItem.focus();
105
- this.navigate.emit();
106
- e.preventDefault();
107
- }
108
- };
109
- tslib_1.__decorate([
110
- core_1.Input(),
111
- tslib_1.__metadata("design:type", Array),
112
- tslib_1.__metadata("design:paramtypes", [Array])
113
- ], MessageListComponent.prototype, "messages", null);
114
- tslib_1.__decorate([
115
- core_1.Input(),
116
- tslib_1.__metadata("design:type", chat_directives_1.AttachmentTemplateDirective)
117
- ], MessageListComponent.prototype, "attachmentTemplate", void 0);
118
- tslib_1.__decorate([
119
- core_1.Input(),
120
- tslib_1.__metadata("design:type", message_template_directive_1.MessageTemplateDirective)
121
- ], MessageListComponent.prototype, "messageTemplate", void 0);
122
- tslib_1.__decorate([
123
- core_1.Input(),
124
- tslib_1.__metadata("design:type", Object)
125
- ], MessageListComponent.prototype, "user", void 0);
126
- tslib_1.__decorate([
127
- core_1.Output(),
128
- tslib_1.__metadata("design:type", core_1.EventEmitter)
129
- ], MessageListComponent.prototype, "executeAction", void 0);
130
- tslib_1.__decorate([
131
- core_1.Output(),
132
- tslib_1.__metadata("design:type", core_1.EventEmitter)
133
- ], MessageListComponent.prototype, "navigate", void 0);
134
- tslib_1.__decorate([
135
- core_1.Output(),
136
- tslib_1.__metadata("design:type", core_1.EventEmitter)
137
- ], MessageListComponent.prototype, "resize", void 0);
138
- tslib_1.__decorate([
139
- core_1.ViewChildren(chat_item_1.ChatItem),
140
- tslib_1.__metadata("design:type", core_1.QueryList)
141
- ], MessageListComponent.prototype, "items", void 0);
142
- tslib_1.__decorate([
143
- core_1.HostBinding('class.k-message-list-content'),
144
- tslib_1.__metadata("design:type", Boolean)
145
- ], MessageListComponent.prototype, "cssClass", void 0);
146
- tslib_1.__decorate([
147
- core_1.HostListener('keydown', ['$event']),
148
- tslib_1.__metadata("design:type", Function),
149
- tslib_1.__metadata("design:paramtypes", [Object]),
150
- tslib_1.__metadata("design:returntype", void 0)
151
- ], MessageListComponent.prototype, "onKeydown", null);
152
- tslib_1.__decorate([
153
- core_1.HostListener('focusout', ['$event']),
154
- tslib_1.__metadata("design:type", Function),
155
- tslib_1.__metadata("design:paramtypes", [FocusEvent]),
156
- tslib_1.__metadata("design:returntype", void 0)
157
- ], MessageListComponent.prototype, "onBlur", null);
158
- MessageListComponent = tslib_1.__decorate([
159
- core_1.Component({
160
- selector: 'kendo-chat-message-list',
161
- template: "\n <ng-container *ngFor=\"let group of view; last as lastGroup; trackBy: trackGroup\">\n <ng-container [ngSwitch]=\"group.type\">\n <div\n *ngSwitchCase=\"'date-marker'\"\n class=\"k-timestamp\"\n >\n {{ formatTimeStamp(group.timestamp) }}\n </div>\n <div\n *ngSwitchCase=\"'message-group'\"\n class=\"k-message-group\"\n [class.k-alt]=\"isOwnMessage(group.messages[0])\"\n [class.k-no-avatar]=\"!group.author.avatarUrl\"\n >\n <img\n *ngIf=\"group.author.avatarUrl\"\n [attr.src]=\"group.author.avatarUrl\"\n class=\"k-avatar\"\n />\n <p *ngIf=\"group.author.name\" class=\"k-author\">{{ group.author.name }}</p>\n <ng-container\n *ngFor=\"let msg of group.messages; first as firstMessage; last as lastMessage\"\n >\n <img *ngIf=\"msg.user?.avatarUrl\" [src]=\"msg.user?.avatarUrl\" class=\"k-avatar\">\n <kendo-chat-message #message\n [message]=\"msg\"\n [tabbable]=\"lastGroup && lastMessage\"\n [template]=\"messageTemplate\"\n (click)=\"select(message)\"\n (focus)=\"select(message)\"\n [class.k-only]=\"group.messages.length === 1\"\n [class.k-first]=\"group.messages.length > 1 && firstMessage\"\n [class.k-last]=\"group.messages.length > 1 && lastMessage\"\n >\n </kendo-chat-message>\n\n <kendo-chat-attachment\n *ngIf=\"msg.attachments && msg.attachments.length === 1\"\n [attachment]=\"msg.attachments[0]\"\n [template]=\"attachmentTemplate\"\n >\n </kendo-chat-attachment>\n </ng-container>\n </div>\n\n <kendo-chat-message-attachments #attachments\n *ngSwitchCase=\"'attachment-group'\"\n [attachments]=\"group.attachments\"\n [layout]=\"group.attachmentLayout\"\n [tabbable]=\"lastGroup\"\n [template]=\"attachmentTemplate\"\n (click)=\"select(attachments)\"\n (focus)=\"select(attachments)\"\n >\n </kendo-chat-message-attachments>\n\n <kendo-chat-suggested-actions #actions\n *ngSwitchCase=\"'action-group'\"\n [actions]=\"group.actions\"\n [tabbable]=\"lastGroup\"\n (dispatch)=\"dispatchAction($event, last(group.messages))\"\n (click)=\"select(actions)\"\n (focus)=\"select(actions)\"\n >\n </kendo-chat-suggested-actions>\n </ng-container>\n </ng-container>\n <kendo-resize-sensor (resize)=\"onResize()\">\n </kendo-resize-sensor>\n "
162
- }),
163
- tslib_1.__metadata("design:paramtypes", [core_1.ElementRef, kendo_angular_intl_1.IntlService])
164
- ], MessageListComponent);
165
- return MessageListComponent;
166
- }());
167
- exports.MessageListComponent = MessageListComponent;
@@ -1,34 +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
- "use strict";
6
- Object.defineProperty(exports, "__esModule", { value: true });
7
- var tslib_1 = require("tslib");
8
- var core_1 = require("@angular/core");
9
- /**
10
- * Defines a template that will be used for displaying Chat messages. To define an attachment
11
- * template, nest an `<ng-template>` tag with the `kendoChatMessageTemplate` attribute inside the
12
- * `<kendo-chat>` component. The template context is set to the message instance. For more information,
13
- * refer to the article on [message templates]({% slug message_templates_chat %}).
14
- *
15
- * {% meta height:700 %}
16
- * {% embed_file messages/templates/app.component.ts preview %}
17
- * {% embed_file shared/app.module.ts preview %}
18
- * {% embed_file shared/main.ts hidden %}
19
- * {% endmeta %}
20
- */
21
- var MessageTemplateDirective = /** @class */ (function () {
22
- function MessageTemplateDirective(templateRef) {
23
- this.templateRef = templateRef;
24
- }
25
- MessageTemplateDirective = tslib_1.__decorate([
26
- core_1.Directive({
27
- selector: '[kendoChatMessageTemplate]'
28
- }),
29
- tslib_1.__param(0, core_1.Optional()),
30
- tslib_1.__metadata("design:paramtypes", [core_1.TemplateRef])
31
- ], MessageTemplateDirective);
32
- return MessageTemplateDirective;
33
- }());
34
- exports.MessageTemplateDirective = MessageTemplateDirective;
@@ -1,79 +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
- "use strict";
6
- Object.defineProperty(exports, "__esModule", { value: true });
7
- var tslib_1 = require("tslib");
8
- var core_1 = require("@angular/core");
9
- var chat_item_1 = require("./chat-item");
10
- var message_template_directive_1 = require("./message-template.directive");
11
- var kendo_angular_intl_1 = require("@progress/kendo-angular-intl");
12
- // tslint:disable:no-forward-ref
13
- /**
14
- * @hidden
15
- */
16
- var MessageComponent = /** @class */ (function (_super) {
17
- tslib_1.__extends(MessageComponent, _super);
18
- function MessageComponent(element, intl) {
19
- var _this = _super.call(this) || this;
20
- _this.element = element;
21
- _this.intl = intl;
22
- _this.cssClass = true;
23
- return _this;
24
- }
25
- MessageComponent_1 = MessageComponent;
26
- Object.defineProperty(MessageComponent.prototype, "tabIndex", {
27
- get: function () {
28
- return this.tabbable ? '0' : '-1';
29
- },
30
- enumerable: true,
31
- configurable: true
32
- });
33
- MessageComponent.prototype.formatTimeStamp = function (date) {
34
- return this.intl.formatDate(date, { datetime: 'short' });
35
- };
36
- MessageComponent.prototype.focus = function () {
37
- this.element.nativeElement.focus();
38
- };
39
- var MessageComponent_1;
40
- tslib_1.__decorate([
41
- core_1.Input(),
42
- tslib_1.__metadata("design:type", Object)
43
- ], MessageComponent.prototype, "message", void 0);
44
- tslib_1.__decorate([
45
- core_1.Input(),
46
- tslib_1.__metadata("design:type", Boolean)
47
- ], MessageComponent.prototype, "tabbable", void 0);
48
- tslib_1.__decorate([
49
- core_1.Input(),
50
- tslib_1.__metadata("design:type", message_template_directive_1.MessageTemplateDirective)
51
- ], MessageComponent.prototype, "template", void 0);
52
- tslib_1.__decorate([
53
- core_1.HostBinding('class.k-message'),
54
- tslib_1.__metadata("design:type", Boolean)
55
- ], MessageComponent.prototype, "cssClass", void 0);
56
- tslib_1.__decorate([
57
- core_1.HostBinding('class.k-state-selected'),
58
- core_1.HostBinding('class.k-state-focused'),
59
- tslib_1.__metadata("design:type", Boolean)
60
- ], MessageComponent.prototype, "selected", void 0);
61
- tslib_1.__decorate([
62
- core_1.HostBinding('attr.tabIndex'),
63
- tslib_1.__metadata("design:type", String),
64
- tslib_1.__metadata("design:paramtypes", [])
65
- ], MessageComponent.prototype, "tabIndex", null);
66
- MessageComponent = MessageComponent_1 = tslib_1.__decorate([
67
- core_1.Component({
68
- selector: 'kendo-chat-message',
69
- providers: [{
70
- provide: chat_item_1.ChatItem,
71
- useExisting: core_1.forwardRef(function () { return MessageComponent_1; })
72
- }],
73
- template: "\n <time\n [attr.aria-hidden]=\"!selected\"\n class=\"k-message-time\"\n *ngIf=\"message.timestamp\"\n >\n {{ formatTimeStamp(message.timestamp) }}\n </time>\n\n <ng-container *ngIf=\"!message.typing; else typing\">\n <div class=\"k-bubble\" *ngIf=\"template\">\n <ng-container\n *ngTemplateOutlet=\"template.templateRef; context: { $implicit: message };\"\n >\n </ng-container>\n </div>\n\n <div class=\"k-bubble\" *ngIf=\"!template && message.text\">\n {{message.text}}\n </div>\n </ng-container>\n\n <span\n class=\"k-message-status\"\n *ngIf=\"message.status\"\n >\n {{ message.status }}\n </span>\n\n <ng-template #typing>\n <div class=\"k-bubble\">\n <div class=\"k-typing-indicator\">\n <span></span>\n <span></span>\n <span></span>\n </div>\n </div>\n </ng-template>\n "
74
- }),
75
- tslib_1.__metadata("design:paramtypes", [core_1.ElementRef, kendo_angular_intl_1.IntlService])
76
- ], MessageComponent);
77
- return MessageComponent;
78
- }(chat_item_1.ChatItem));
79
- exports.MessageComponent = MessageComponent;