@memberjunction/ng-conversations 6.1.4 → 6.2.0-edge.1
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/README.md +36 -3
- package/dist/lib/components/active-tasks/active-tasks-panel.component.d.ts +19 -3
- package/dist/lib/components/active-tasks/active-tasks-panel.component.d.ts.map +1 -1
- package/dist/lib/components/active-tasks/active-tasks-panel.component.js +39 -7
- package/dist/lib/components/active-tasks/active-tasks-panel.component.js.map +1 -1
- package/dist/lib/components/agent/active-agent-indicator.component.d.ts +74 -6
- package/dist/lib/components/agent/active-agent-indicator.component.d.ts.map +1 -1
- package/dist/lib/components/agent/active-agent-indicator.component.js +111 -21
- package/dist/lib/components/agent/active-agent-indicator.component.js.map +1 -1
- package/dist/lib/components/agent/agent-process-panel.component.d.ts +31 -5
- package/dist/lib/components/agent/agent-process-panel.component.d.ts.map +1 -1
- package/dist/lib/components/agent/agent-process-panel.component.js +71 -15
- package/dist/lib/components/agent/agent-process-panel.component.js.map +1 -1
- package/dist/lib/components/artifact/artifact-share-modal.component.d.ts +65 -9
- package/dist/lib/components/artifact/artifact-share-modal.component.d.ts.map +1 -1
- package/dist/lib/components/artifact/artifact-share-modal.component.js +169 -57
- package/dist/lib/components/artifact/artifact-share-modal.component.js.map +1 -1
- package/dist/lib/components/attachment/image-viewer.component.d.ts +77 -11
- package/dist/lib/components/attachment/image-viewer.component.d.ts.map +1 -1
- package/dist/lib/components/attachment/image-viewer.component.js +181 -47
- package/dist/lib/components/attachment/image-viewer.component.js.map +1 -1
- package/dist/lib/components/collection/artifact-collection-picker-modal.component.d.ts +129 -19
- package/dist/lib/components/collection/artifact-collection-picker-modal.component.d.ts.map +1 -1
- package/dist/lib/components/collection/artifact-collection-picker-modal.component.js +350 -116
- package/dist/lib/components/collection/artifact-collection-picker-modal.component.js.map +1 -1
- package/dist/lib/components/collection/artifact-create-modal.component.d.ts +60 -8
- package/dist/lib/components/collection/artifact-create-modal.component.d.ts.map +1 -1
- package/dist/lib/components/collection/artifact-create-modal.component.js +130 -46
- package/dist/lib/components/collection/artifact-create-modal.component.js.map +1 -1
- package/dist/lib/components/collection/collection-artifact-card.component.d.ts +63 -3
- package/dist/lib/components/collection/collection-artifact-card.component.d.ts.map +1 -1
- package/dist/lib/components/collection/collection-artifact-card.component.js +113 -19
- package/dist/lib/components/collection/collection-artifact-card.component.js.map +1 -1
- package/dist/lib/components/collection/collection-form-modal.component.d.ts +54 -8
- package/dist/lib/components/collection/collection-form-modal.component.d.ts.map +1 -1
- package/dist/lib/components/collection/collection-form-modal.component.js +130 -46
- package/dist/lib/components/collection/collection-form-modal.component.js.map +1 -1
- package/dist/lib/components/collection/collection-share-modal.component.d.ts +70 -10
- package/dist/lib/components/collection/collection-share-modal.component.d.ts.map +1 -1
- package/dist/lib/components/collection/collection-share-modal.component.js +175 -53
- package/dist/lib/components/collection/collection-share-modal.component.js.map +1 -1
- package/dist/lib/components/collection/collection-tree.component.d.ts +89 -9
- package/dist/lib/components/collection/collection-tree.component.d.ts.map +1 -1
- package/dist/lib/components/collection/collection-tree.component.js +220 -70
- package/dist/lib/components/collection/collection-tree.component.js.map +1 -1
- package/dist/lib/components/collection/collection-view.component.d.ts +89 -11
- package/dist/lib/components/collection/collection-view.component.d.ts.map +1 -1
- package/dist/lib/components/collection/collection-view.component.js +154 -40
- package/dist/lib/components/collection/collection-view.component.js.map +1 -1
- package/dist/lib/components/collection/collections-full-view.component.d.ts +390 -38
- package/dist/lib/components/collection/collections-full-view.component.d.ts.map +1 -1
- package/dist/lib/components/collection/collections-full-view.component.js +951 -367
- package/dist/lib/components/collection/collections-full-view.component.js.map +1 -1
- package/dist/lib/components/composer/ai-composer.component.d.ts +213 -18
- package/dist/lib/components/composer/ai-composer.component.d.ts.map +1 -1
- package/dist/lib/components/composer/ai-composer.component.js +388 -44
- package/dist/lib/components/composer/ai-composer.component.js.map +1 -1
- package/dist/lib/components/conversation/conversation-agent-picker.component.d.ts +12 -1
- package/dist/lib/components/conversation/conversation-agent-picker.component.d.ts.map +1 -1
- package/dist/lib/components/conversation/conversation-agent-picker.component.js +26 -4
- package/dist/lib/components/conversation/conversation-agent-picker.component.js.map +1 -1
- package/dist/lib/components/conversation/conversation-chat-area.component.d.ts +1090 -123
- package/dist/lib/components/conversation/conversation-chat-area.component.d.ts.map +1 -1
- package/dist/lib/components/conversation/conversation-chat-area.component.js +2407 -731
- package/dist/lib/components/conversation/conversation-chat-area.component.js.map +1 -1
- package/dist/lib/components/conversation/conversation-empty-state.component.d.ts +139 -19
- package/dist/lib/components/conversation/conversation-empty-state.component.d.ts.map +1 -1
- package/dist/lib/components/conversation/conversation-empty-state.component.js +296 -59
- package/dist/lib/components/conversation/conversation-empty-state.component.js.map +1 -1
- package/dist/lib/components/conversation/conversation-list.component.d.ts +579 -78
- package/dist/lib/components/conversation/conversation-list.component.d.ts.map +1 -1
- package/dist/lib/components/conversation/conversation-list.component.js +2322 -823
- package/dist/lib/components/conversation/conversation-list.component.js.map +1 -1
- package/dist/lib/components/conversation/pinned-messages-panel.component.d.ts +40 -4
- package/dist/lib/components/conversation/pinned-messages-panel.component.d.ts.map +1 -1
- package/dist/lib/components/conversation/pinned-messages-panel.component.js +72 -14
- package/dist/lib/components/conversation/pinned-messages-panel.component.js.map +1 -1
- package/dist/lib/components/dialogs/input-dialog.component.d.ts +57 -11
- package/dist/lib/components/dialogs/input-dialog.component.d.ts.map +1 -1
- package/dist/lib/components/dialogs/input-dialog.component.js +128 -16
- package/dist/lib/components/dialogs/input-dialog.component.js.map +1 -1
- package/dist/lib/components/dialogs/rating-dialog.component.d.ts +68 -10
- package/dist/lib/components/dialogs/rating-dialog.component.d.ts.map +1 -1
- package/dist/lib/components/dialogs/rating-dialog.component.js +151 -27
- package/dist/lib/components/dialogs/rating-dialog.component.js.map +1 -1
- package/dist/lib/components/export/export-modal.component.d.ts +84 -10
- package/dist/lib/components/export/export-modal.component.d.ts.map +1 -1
- package/dist/lib/components/export/export-modal.component.js +173 -49
- package/dist/lib/components/export/export-modal.component.js.map +1 -1
- package/dist/lib/components/global-tasks/global-tasks-panel.component.d.ts +29 -3
- package/dist/lib/components/global-tasks/global-tasks-panel.component.d.ts.map +1 -1
- package/dist/lib/components/global-tasks/global-tasks-panel.component.js +58 -12
- package/dist/lib/components/global-tasks/global-tasks-panel.component.js.map +1 -1
- package/dist/lib/components/library/library-full-view.component.d.ts +57 -8
- package/dist/lib/components/library/library-full-view.component.d.ts.map +1 -1
- package/dist/lib/components/library/library-full-view.component.js +119 -35
- package/dist/lib/components/library/library-full-view.component.js.map +1 -1
- package/dist/lib/components/members/members-modal.component.d.ts +76 -10
- package/dist/lib/components/members/members-modal.component.d.ts.map +1 -1
- package/dist/lib/components/members/members-modal.component.js +164 -50
- package/dist/lib/components/members/members-modal.component.js.map +1 -1
- package/dist/lib/components/message/actionable-commands.component.d.ts +37 -5
- package/dist/lib/components/message/actionable-commands.component.d.ts.map +1 -1
- package/dist/lib/components/message/actionable-commands.component.js +82 -16
- package/dist/lib/components/message/actionable-commands.component.js.map +1 -1
- package/dist/lib/components/message/conversation-message-rating.component.d.ts +46 -10
- package/dist/lib/components/message/conversation-message-rating.component.d.ts.map +1 -1
- package/dist/lib/components/message/conversation-message-rating.component.js +120 -36
- package/dist/lib/components/message/conversation-message-rating.component.js.map +1 -1
- package/dist/lib/components/message/message-input.component.d.ts +549 -74
- package/dist/lib/components/message/message-input.component.d.ts.map +1 -1
- package/dist/lib/components/message/message-input.component.js +1250 -421
- package/dist/lib/components/message/message-input.component.js.map +1 -1
- package/dist/lib/components/message/message-item.component.d.ts +411 -29
- package/dist/lib/components/message/message-item.component.d.ts.map +1 -1
- package/dist/lib/components/message/message-item.component.js +896 -222
- package/dist/lib/components/message/message-item.component.js.map +1 -1
- package/dist/lib/components/message/message-list.component.d.ts +288 -29
- package/dist/lib/components/message/message-list.component.d.ts.map +1 -1
- package/dist/lib/components/message/message-list.component.js +561 -123
- package/dist/lib/components/message/message-list.component.js.map +1 -1
- package/dist/lib/components/navigation/conversation-navigation.component.d.ts +64 -5
- package/dist/lib/components/navigation/conversation-navigation.component.d.ts.map +1 -1
- package/dist/lib/components/navigation/conversation-navigation.component.js +101 -11
- package/dist/lib/components/navigation/conversation-navigation.component.js.map +1 -1
- package/dist/lib/components/notification/activity-indicator.component.d.ts +6 -2
- package/dist/lib/components/notification/activity-indicator.component.d.ts.map +1 -1
- package/dist/lib/components/notification/activity-indicator.component.js +13 -3
- package/dist/lib/components/notification/activity-indicator.component.js.map +1 -1
- package/dist/lib/components/notification/notification-badge.component.d.ts +15 -3
- package/dist/lib/components/notification/notification-badge.component.d.ts.map +1 -1
- package/dist/lib/components/notification/notification-badge.component.js +36 -8
- package/dist/lib/components/notification/notification-badge.component.js.map +1 -1
- package/dist/lib/components/overlay/chat-overlay.component.d.ts +1 -1
- package/dist/lib/components/overlay/chat-overlay.component.js +4 -4
- package/dist/lib/components/overlay/chat-overlay.component.js.map +1 -1
- package/dist/lib/components/project/project-form-modal.component.d.ts +93 -11
- package/dist/lib/components/project/project-form-modal.component.d.ts.map +1 -1
- package/dist/lib/components/project/project-form-modal.component.js +348 -87
- package/dist/lib/components/project/project-form-modal.component.js.map +1 -1
- package/dist/lib/components/project/project-selector.component.d.ts +78 -8
- package/dist/lib/components/project/project-selector.component.d.ts.map +1 -1
- package/dist/lib/components/project/project-selector.component.js +177 -46
- package/dist/lib/components/project/project-selector.component.js.map +1 -1
- package/dist/lib/components/realtime/channels/channel-onboarding-panel.component.d.ts +1 -1
- package/dist/lib/components/realtime/channels/channel-onboarding-panel.component.d.ts.map +1 -1
- package/dist/lib/components/realtime/channels/channel-onboarding-panel.component.js.map +1 -1
- package/dist/lib/components/realtime/channels/client-context-channel.d.ts +1 -1
- package/dist/lib/components/realtime/channels/client-context-channel.d.ts.map +1 -1
- package/dist/lib/components/realtime/channels/client-context-channel.js +1 -1
- package/dist/lib/components/realtime/channels/client-context-channel.js.map +1 -1
- package/dist/lib/components/realtime/channels/realtime-channel-pane.component.d.ts +1 -1
- package/dist/lib/components/realtime/channels/realtime-channel-pane.component.d.ts.map +1 -1
- package/dist/lib/components/realtime/channels/realtime-channel-pane.component.js +3 -0
- package/dist/lib/components/realtime/channels/realtime-channel-pane.component.js.map +1 -1
- package/dist/lib/components/realtime/media/media-channel.d.ts +2 -1
- package/dist/lib/components/realtime/media/media-channel.d.ts.map +1 -1
- package/dist/lib/components/realtime/media/media-channel.js +1 -1
- package/dist/lib/components/realtime/media/media-channel.js.map +1 -1
- package/dist/lib/components/realtime/realtime-activity-rail.component.d.ts +2 -2
- package/dist/lib/components/realtime/realtime-activity-rail.component.d.ts.map +1 -1
- package/dist/lib/components/realtime/realtime-activity-rail.component.js +2 -2
- package/dist/lib/components/realtime/realtime-activity-rail.component.js.map +1 -1
- package/dist/lib/components/realtime/realtime-agent-banner.component.d.ts +1 -1
- package/dist/lib/components/realtime/realtime-agent-banner.component.d.ts.map +1 -1
- package/dist/lib/components/realtime/realtime-agent-banner.component.js.map +1 -1
- package/dist/lib/components/realtime/realtime-composer.component.d.ts +3 -1
- package/dist/lib/components/realtime/realtime-composer.component.d.ts.map +1 -1
- package/dist/lib/components/realtime/realtime-composer.component.js +26 -8
- package/dist/lib/components/realtime/realtime-composer.component.js.map +1 -1
- package/dist/lib/components/realtime/realtime-delegation-card.component.d.ts +2 -2
- package/dist/lib/components/realtime/realtime-delegation-card.component.d.ts.map +1 -1
- package/dist/lib/components/realtime/realtime-delegation-card.component.js +2 -2
- package/dist/lib/components/realtime/realtime-delegation-card.component.js.map +1 -1
- package/dist/lib/components/realtime/realtime-session-overlay.component.d.ts +4 -4
- package/dist/lib/components/realtime/realtime-session-overlay.component.d.ts.map +1 -1
- package/dist/lib/components/realtime/realtime-session-overlay.component.js +19 -19
- package/dist/lib/components/realtime/realtime-session-overlay.component.js.map +1 -1
- package/dist/lib/components/realtime/realtime-session-state.d.ts +2 -3
- package/dist/lib/components/realtime/realtime-session-state.d.ts.map +1 -1
- package/dist/lib/components/realtime/realtime-session-state.js +3 -2
- package/dist/lib/components/realtime/realtime-session-state.js.map +1 -1
- package/dist/lib/components/realtime/realtime-session-thread.component.d.ts +17 -1
- package/dist/lib/components/realtime/realtime-session-thread.component.d.ts.map +1 -1
- package/dist/lib/components/realtime/realtime-session-thread.component.js +122 -45
- package/dist/lib/components/realtime/realtime-session-thread.component.js.map +1 -1
- package/dist/lib/components/realtime/realtime-session-timeline-card.component.d.ts +47 -31
- package/dist/lib/components/realtime/realtime-session-timeline-card.component.d.ts.map +1 -1
- package/dist/lib/components/realtime/realtime-session-timeline-card.component.js +138 -124
- package/dist/lib/components/realtime/realtime-session-timeline-card.component.js.map +1 -1
- package/dist/lib/components/realtime/realtime-surface-tabs.component.d.ts +4 -4
- package/dist/lib/components/realtime/realtime-surface-tabs.component.d.ts.map +1 -1
- package/dist/lib/components/realtime/realtime-surface-tabs.component.js +4 -4
- package/dist/lib/components/realtime/realtime-surface-tabs.component.js.map +1 -1
- package/dist/lib/components/realtime/realtime-surface-tabs.model.d.ts +2 -2
- package/dist/lib/components/realtime/realtime-surface-tabs.model.d.ts.map +1 -1
- package/dist/lib/components/realtime/realtime-surface-tabs.model.js +3 -3
- package/dist/lib/components/realtime/realtime-surface-tabs.model.js.map +1 -1
- package/dist/lib/components/realtime/realtime-ui-config.d.ts +13 -11
- package/dist/lib/components/realtime/realtime-ui-config.d.ts.map +1 -1
- package/dist/lib/components/realtime/realtime-ui-config.js +29 -25
- package/dist/lib/components/realtime/realtime-ui-config.js.map +1 -1
- package/dist/lib/components/realtime/remote-browser/remote-browser-channel.d.ts +1 -1
- package/dist/lib/components/realtime/remote-browser/remote-browser-channel.d.ts.map +1 -1
- package/dist/lib/components/realtime/remote-browser/remote-browser-channel.js +1 -1
- package/dist/lib/components/realtime/remote-browser/remote-browser-channel.js.map +1 -1
- package/dist/lib/components/realtime/whiteboard/whiteboard-channel.d.ts +4 -2
- package/dist/lib/components/realtime/whiteboard/whiteboard-channel.d.ts.map +1 -1
- package/dist/lib/components/realtime/whiteboard/whiteboard-channel.js +7 -3
- package/dist/lib/components/realtime/whiteboard/whiteboard-channel.js.map +1 -1
- package/dist/lib/components/search/search-panel.component.d.ts +133 -22
- package/dist/lib/components/search/search-panel.component.d.ts.map +1 -1
- package/dist/lib/components/search/search-panel.component.js +312 -83
- package/dist/lib/components/search/search-panel.component.js.map +1 -1
- package/dist/lib/components/share/share-modal.component.d.ts +69 -9
- package/dist/lib/components/share/share-modal.component.d.ts.map +1 -1
- package/dist/lib/components/share/share-modal.component.js +139 -31
- package/dist/lib/components/share/share-modal.component.js.map +1 -1
- package/dist/lib/components/shared/user-picker.component.d.ts +48 -8
- package/dist/lib/components/shared/user-picker.component.d.ts.map +1 -1
- package/dist/lib/components/shared/user-picker.component.js +110 -30
- package/dist/lib/components/shared/user-picker.component.js.map +1 -1
- package/dist/lib/components/sidebar/conversation-sidebar.component.d.ts +114 -11
- package/dist/lib/components/sidebar/conversation-sidebar.component.d.ts.map +1 -1
- package/dist/lib/components/sidebar/conversation-sidebar.component.js +199 -21
- package/dist/lib/components/sidebar/conversation-sidebar.component.js.map +1 -1
- package/dist/lib/components/sidebar/routines-section.component.d.ts +20 -1
- package/dist/lib/components/sidebar/routines-section.component.d.ts.map +1 -1
- package/dist/lib/components/sidebar/routines-section.component.js +25 -5
- package/dist/lib/components/sidebar/routines-section.component.js.map +1 -1
- package/dist/lib/components/slots/slot-interfaces.d.ts +19 -0
- package/dist/lib/components/slots/slot-interfaces.d.ts.map +1 -1
- package/dist/lib/components/slots/slot-interfaces.js.map +1 -1
- package/dist/lib/components/task/tasks-full-view.component.d.ts +95 -13
- package/dist/lib/components/task/tasks-full-view.component.d.ts.map +1 -1
- package/dist/lib/components/task/tasks-full-view.component.js +223 -75
- package/dist/lib/components/task/tasks-full-view.component.js.map +1 -1
- package/dist/lib/components/tasks/task-widget.component.d.ts +46 -6
- package/dist/lib/components/tasks/task-widget.component.d.ts.map +1 -1
- package/dist/lib/components/tasks/task-widget.component.js +100 -16
- package/dist/lib/components/tasks/task-widget.component.js.map +1 -1
- package/dist/lib/components/tasks/tasks-dropdown.component.d.ts +64 -7
- package/dist/lib/components/tasks/tasks-dropdown.component.d.ts.map +1 -1
- package/dist/lib/components/tasks/tasks-dropdown.component.js +127 -27
- package/dist/lib/components/tasks/tasks-dropdown.component.js.map +1 -1
- package/dist/lib/components/thread/thread-panel.component.d.ts +66 -8
- package/dist/lib/components/thread/thread-panel.component.d.ts.map +1 -1
- package/dist/lib/components/thread/thread-panel.component.js +146 -36
- package/dist/lib/components/thread/thread-panel.component.js.map +1 -1
- package/dist/lib/components/toast/toast.component.d.ts +11 -1
- package/dist/lib/components/toast/toast.component.d.ts.map +1 -1
- package/dist/lib/components/toast/toast.component.js +25 -5
- package/dist/lib/components/toast/toast.component.js.map +1 -1
- package/dist/lib/components/workspace/conversation-workspace.component.d.ts +385 -42
- package/dist/lib/components/workspace/conversation-workspace.component.d.ts.map +1 -1
- package/dist/lib/components/workspace/conversation-workspace.component.js +887 -291
- package/dist/lib/components/workspace/conversation-workspace.component.js.map +1 -1
- package/dist/lib/composer-plugins/base-conversation-mention.provider.d.ts +8 -0
- package/dist/lib/composer-plugins/base-conversation-mention.provider.d.ts.map +1 -1
- package/dist/lib/composer-plugins/base-conversation-mention.provider.js +8 -1
- package/dist/lib/composer-plugins/base-conversation-mention.provider.js.map +1 -1
- package/dist/lib/conversations.module.d.ts.map +1 -1
- package/dist/lib/conversations.module.js.map +1 -1
- package/dist/lib/directives/chat-slot.directive.d.ts +5 -1
- package/dist/lib/directives/chat-slot.directive.d.ts.map +1 -1
- package/dist/lib/directives/chat-slot.directive.js.map +1 -1
- package/dist/lib/directives/search-shortcut.directive.d.ts +9 -1
- package/dist/lib/directives/search-shortcut.directive.d.ts.map +1 -1
- package/dist/lib/directives/search-shortcut.directive.js +14 -4
- package/dist/lib/directives/search-shortcut.directive.js.map +1 -1
- package/dist/lib/events/chat-events.d.ts +34 -7
- package/dist/lib/events/chat-events.d.ts.map +1 -1
- package/dist/lib/events/chat-events.js +37 -7
- package/dist/lib/events/chat-events.js.map +1 -1
- package/dist/lib/models/agent-turn.model.d.ts +103 -0
- package/dist/lib/models/agent-turn.model.d.ts.map +1 -0
- package/dist/lib/models/agent-turn.model.js +12 -0
- package/dist/lib/models/agent-turn.model.js.map +1 -0
- package/dist/lib/models/collection-view.model.js.map +1 -1
- package/dist/lib/models/conversation-state.model.d.ts +8 -0
- package/dist/lib/models/conversation-state.model.d.ts.map +1 -1
- package/dist/lib/models/conversation-state.model.js.map +1 -1
- package/dist/lib/models/lazy-artifact-info.d.ts +44 -12
- package/dist/lib/models/lazy-artifact-info.d.ts.map +1 -1
- package/dist/lib/models/lazy-artifact-info.js +98 -34
- package/dist/lib/models/lazy-artifact-info.js.map +1 -1
- package/dist/lib/services/active-tasks.service.d.ts +30 -4
- package/dist/lib/services/active-tasks.service.d.ts.map +1 -1
- package/dist/lib/services/active-tasks.service.js +71 -19
- package/dist/lib/services/active-tasks.service.js.map +1 -1
- package/dist/lib/services/agent-state.service.d.ts +17 -1
- package/dist/lib/services/agent-state.service.d.ts.map +1 -1
- package/dist/lib/services/agent-state.service.js +48 -16
- package/dist/lib/services/agent-state.service.js.map +1 -1
- package/dist/lib/services/artifact-permission.service.d.ts +39 -0
- package/dist/lib/services/artifact-permission.service.d.ts.map +1 -1
- package/dist/lib/services/artifact-permission.service.js +152 -17
- package/dist/lib/services/artifact-permission.service.js.map +1 -1
- package/dist/lib/services/artifact-state.service.d.ts +58 -5
- package/dist/lib/services/artifact-state.service.d.ts.map +1 -1
- package/dist/lib/services/artifact-state.service.js +135 -35
- package/dist/lib/services/artifact-state.service.js.map +1 -1
- package/dist/lib/services/browser-realtime-media-host.d.ts +24 -0
- package/dist/lib/services/browser-realtime-media-host.d.ts.map +1 -0
- package/dist/lib/services/browser-realtime-media-host.js +95 -0
- package/dist/lib/services/browser-realtime-media-host.js.map +1 -0
- package/dist/lib/services/collection-permission.service.d.ts +28 -0
- package/dist/lib/services/collection-permission.service.d.ts.map +1 -1
- package/dist/lib/services/collection-permission.service.js +88 -32
- package/dist/lib/services/collection-permission.service.js.map +1 -1
- package/dist/lib/services/collection-state.service.d.ts +11 -1
- package/dist/lib/services/collection-state.service.d.ts.map +1 -1
- package/dist/lib/services/collection-state.service.js +25 -5
- package/dist/lib/services/collection-state.service.js.map +1 -1
- package/dist/lib/services/conversation-agent.service.d.ts +26 -4
- package/dist/lib/services/conversation-agent.service.d.ts.map +1 -1
- package/dist/lib/services/conversation-agent.service.js +57 -18
- package/dist/lib/services/conversation-agent.service.js.map +1 -1
- package/dist/lib/services/conversation-attachment.service.d.ts +41 -2
- package/dist/lib/services/conversation-attachment.service.d.ts.map +1 -1
- package/dist/lib/services/conversation-attachment.service.js +80 -13
- package/dist/lib/services/conversation-attachment.service.js.map +1 -1
- package/dist/lib/services/conversation-streaming.service.d.ts +22 -0
- package/dist/lib/services/conversation-streaming.service.d.ts.map +1 -1
- package/dist/lib/services/conversation-streaming.service.js +50 -10
- package/dist/lib/services/conversation-streaming.service.js.map +1 -1
- package/dist/lib/services/data-cache.service.d.ts +31 -0
- package/dist/lib/services/data-cache.service.d.ts.map +1 -1
- package/dist/lib/services/data-cache.service.js +71 -15
- package/dist/lib/services/data-cache.service.js.map +1 -1
- package/dist/lib/services/dialog.service.d.ts +13 -0
- package/dist/lib/services/dialog.service.d.ts.map +1 -1
- package/dist/lib/services/dialog.service.js +25 -5
- package/dist/lib/services/dialog.service.js.map +1 -1
- package/dist/lib/services/export.service.d.ts +2 -0
- package/dist/lib/services/export.service.d.ts.map +1 -1
- package/dist/lib/services/export.service.js +5 -1
- package/dist/lib/services/export.service.js.map +1 -1
- package/dist/lib/services/graphql-attachment-blob-store.d.ts +44 -0
- package/dist/lib/services/graphql-attachment-blob-store.d.ts.map +1 -0
- package/dist/lib/services/graphql-attachment-blob-store.js +113 -0
- package/dist/lib/services/graphql-attachment-blob-store.js.map +1 -0
- package/dist/lib/services/mention-autocomplete.service.d.ts +17 -141
- package/dist/lib/services/mention-autocomplete.service.d.ts.map +1 -1
- package/dist/lib/services/mention-autocomplete.service.js +15 -460
- package/dist/lib/services/mention-autocomplete.service.js.map +1 -1
- package/dist/lib/services/mention-parser.service.d.ts +10 -0
- package/dist/lib/services/mention-parser.service.d.ts.map +1 -1
- package/dist/lib/services/mention-parser.service.js +25 -5
- package/dist/lib/services/mention-parser.service.js.map +1 -1
- package/dist/lib/services/notification.service.d.ts +54 -6
- package/dist/lib/services/notification.service.d.ts.map +1 -1
- package/dist/lib/services/notification.service.js +123 -27
- package/dist/lib/services/notification.service.js.map +1 -1
- package/dist/lib/services/realtime-audio-recorder.d.ts +4 -4
- package/dist/lib/services/realtime-audio-recorder.js +12 -12
- package/dist/lib/services/realtime-audio-recorder.js.map +1 -1
- package/dist/lib/services/realtime-pcm-wav.d.ts +4 -0
- package/dist/lib/services/realtime-pcm-wav.d.ts.map +1 -1
- package/dist/lib/services/realtime-pcm-wav.js +10 -2
- package/dist/lib/services/realtime-pcm-wav.js.map +1 -1
- package/dist/lib/services/realtime-session-review.service.d.ts +1 -1
- package/dist/lib/services/realtime-session-review.service.d.ts.map +1 -1
- package/dist/lib/services/realtime-session-review.service.js +1 -1
- package/dist/lib/services/realtime-session-review.service.js.map +1 -1
- package/dist/lib/services/realtime-session.service.d.ts +16 -1150
- package/dist/lib/services/realtime-session.service.d.ts.map +1 -1
- package/dist/lib/services/realtime-session.service.js +28 -2430
- package/dist/lib/services/realtime-session.service.js.map +1 -1
- package/dist/lib/services/search.service.d.ts +42 -9
- package/dist/lib/services/search.service.d.ts.map +1 -1
- package/dist/lib/services/search.service.js +103 -23
- package/dist/lib/services/search.service.js.map +1 -1
- package/dist/lib/services/toast.service.d.ts +19 -1
- package/dist/lib/services/toast.service.d.ts.map +1 -1
- package/dist/lib/services/toast.service.js +45 -9
- package/dist/lib/services/toast.service.js.map +1 -1
- package/dist/lib/services/ui-command-handler.service.d.ts +16 -2
- package/dist/lib/services/ui-command-handler.service.d.ts.map +1 -1
- package/dist/lib/services/ui-command-handler.service.js +36 -8
- package/dist/lib/services/ui-command-handler.service.js.map +1 -1
- package/dist/lib/utils/agent-artifact-summary.d.ts +2 -2
- package/dist/lib/utils/agent-artifact-summary.js +3 -3
- package/dist/lib/utils/agent-artifact-summary.js.map +1 -1
- package/dist/lib/utils/agent-turn-routing.d.ts +69 -0
- package/dist/lib/utils/agent-turn-routing.d.ts.map +1 -0
- package/dist/lib/utils/agent-turn-routing.js +96 -0
- package/dist/lib/utils/agent-turn-routing.js.map +1 -0
- package/dist/lib/utils/artifact-panel-action.d.ts +15 -4
- package/dist/lib/utils/artifact-panel-action.d.ts.map +1 -1
- package/dist/lib/utils/artifact-panel-action.js +10 -2
- package/dist/lib/utils/artifact-panel-action.js.map +1 -1
- package/dist/lib/utils/distinct-artifacts.d.ts +2 -0
- package/dist/lib/utils/distinct-artifacts.d.ts.map +1 -1
- package/dist/lib/utils/distinct-artifacts.js +5 -1
- package/dist/lib/utils/distinct-artifacts.js.map +1 -1
- package/dist/lib/utils/plan-mode-preference.d.ts +2 -2
- package/dist/lib/utils/plan-mode-preference.js +6 -6
- package/dist/lib/utils/plan-mode-preference.js.map +1 -1
- package/dist/lib/utils/realtime-session-timeline.d.ts +8 -79
- package/dist/lib/utils/realtime-session-timeline.d.ts.map +1 -1
- package/dist/lib/utils/realtime-session-timeline.js +8 -89
- package/dist/lib/utils/realtime-session-timeline.js.map +1 -1
- package/dist/public-api.d.ts +5 -2
- package/dist/public-api.d.ts.map +1 -1
- package/dist/public-api.js +9 -2
- package/dist/public-api.js.map +1 -1
- package/package.json +33 -32
- package/dist/lib/components/realtime/channels/base-realtime-channel-client.d.ts +0 -384
- package/dist/lib/components/realtime/channels/base-realtime-channel-client.d.ts.map +0 -1
- package/dist/lib/components/realtime/channels/base-realtime-channel-client.js +0 -231
- package/dist/lib/components/realtime/channels/base-realtime-channel-client.js.map +0 -1
- package/dist/lib/services/delegation-result-parser.d.ts +0 -50
- package/dist/lib/services/delegation-result-parser.d.ts.map +0 -1
- package/dist/lib/services/delegation-result-parser.js +0 -60
- package/dist/lib/services/delegation-result-parser.js.map +0 -1
- package/dist/lib/services/narration-template.d.ts +0 -42
- package/dist/lib/services/narration-template.d.ts.map +0 -1
- package/dist/lib/services/narration-template.js +0 -73
- package/dist/lib/services/narration-template.js.map +0 -1
- package/dist/lib/services/skill-picker-narrowing.d.ts +0 -13
- package/dist/lib/services/skill-picker-narrowing.d.ts.map +0 -1
- package/dist/lib/services/skill-picker-narrowing.js +0 -13
- package/dist/lib/services/skill-picker-narrowing.js.map +0 -1
|
@@ -40,32 +40,80 @@ function ActionableCommandsComponent_Conditional_0_Template(rf, ctx) { if (rf &
|
|
|
40
40
|
* These are actions the user can trigger after an agent completes a task
|
|
41
41
|
*/
|
|
42
42
|
export class ActionableCommandsComponent {
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
43
|
+
Commands = [];
|
|
44
|
+
/** @deprecated Use {@link Commands}. */
|
|
45
|
+
set commands(value) {
|
|
46
|
+
this.Commands = value;
|
|
47
|
+
}
|
|
48
|
+
/** @deprecated Use {@link Commands}. */
|
|
49
|
+
get commands() {
|
|
50
|
+
return this.Commands;
|
|
51
|
+
}
|
|
52
|
+
Disabled = false;
|
|
53
|
+
/** @deprecated Use {@link Disabled}. */
|
|
54
|
+
set disabled(value) {
|
|
55
|
+
this.Disabled = value;
|
|
56
|
+
}
|
|
57
|
+
/** @deprecated Use {@link Disabled}. */
|
|
58
|
+
get disabled() {
|
|
59
|
+
return this.Disabled;
|
|
60
|
+
}
|
|
61
|
+
IsLastMessage = false;
|
|
62
|
+
/** @deprecated Use {@link IsLastMessage}. */
|
|
63
|
+
set isLastMessage(value) {
|
|
64
|
+
this.IsLastMessage = value;
|
|
65
|
+
}
|
|
66
|
+
/** @deprecated Use {@link IsLastMessage}. */
|
|
67
|
+
get isLastMessage() {
|
|
68
|
+
return this.IsLastMessage;
|
|
69
|
+
}
|
|
70
|
+
IsConversationOwner = false;
|
|
71
|
+
/** @deprecated Use {@link IsConversationOwner}. */
|
|
72
|
+
set isConversationOwner(value) {
|
|
73
|
+
this.IsConversationOwner = value;
|
|
74
|
+
}
|
|
75
|
+
/** @deprecated Use {@link IsConversationOwner}. */
|
|
76
|
+
get isConversationOwner() {
|
|
77
|
+
return this.IsConversationOwner;
|
|
78
|
+
}
|
|
79
|
+
CommandExecuted = new EventEmitter();
|
|
80
|
+
/**
|
|
81
|
+
* @deprecated Use {@link CommandExecuted}.
|
|
82
|
+
*
|
|
83
|
+
* The same emitter under the old binding name, so a template still binding
|
|
84
|
+
* (commandExecuted) keeps working. Must stay AFTER CommandExecuted: class fields
|
|
85
|
+
* initialise in order, and the other way round this captures undefined.
|
|
86
|
+
*/
|
|
87
|
+
commandExecuted = this.CommandExecuted;
|
|
48
88
|
/**
|
|
49
89
|
* Check if component should be visible
|
|
50
90
|
*/
|
|
91
|
+
get IsVisible() {
|
|
92
|
+
return (this.IsLastMessage &&
|
|
93
|
+
this.IsConversationOwner &&
|
|
94
|
+
this.Commands &&
|
|
95
|
+
this.Commands.length > 0);
|
|
96
|
+
}
|
|
97
|
+
/** @deprecated Use {@link IsVisible}. */
|
|
51
98
|
get isVisible() {
|
|
52
|
-
return
|
|
53
|
-
this.isConversationOwner &&
|
|
54
|
-
this.commands &&
|
|
55
|
-
this.commands.length > 0);
|
|
99
|
+
return this.IsVisible;
|
|
56
100
|
}
|
|
57
101
|
/**
|
|
58
102
|
* Handle command button click
|
|
59
103
|
*/
|
|
60
|
-
|
|
61
|
-
if (!this.
|
|
62
|
-
this.
|
|
104
|
+
OnCommandClick(command) {
|
|
105
|
+
if (!this.Disabled) {
|
|
106
|
+
this.CommandExecuted.emit(command);
|
|
63
107
|
}
|
|
64
108
|
}
|
|
109
|
+
/** @deprecated Use {@link OnCommandClick}. */
|
|
110
|
+
onCommandClick(command) {
|
|
111
|
+
return this.OnCommandClick(command);
|
|
112
|
+
}
|
|
65
113
|
/**
|
|
66
114
|
* Get button variant based on command type
|
|
67
115
|
*/
|
|
68
|
-
|
|
116
|
+
GetButtonVariant(command) {
|
|
69
117
|
if (command.type === 'open:resource') {
|
|
70
118
|
return 'primary';
|
|
71
119
|
}
|
|
@@ -74,14 +122,22 @@ export class ActionableCommandsComponent {
|
|
|
74
122
|
}
|
|
75
123
|
return 'secondary';
|
|
76
124
|
}
|
|
125
|
+
/** @deprecated Use {@link GetButtonVariant}. */
|
|
126
|
+
getButtonVariant(command) {
|
|
127
|
+
return this.GetButtonVariant(command);
|
|
128
|
+
}
|
|
77
129
|
/**
|
|
78
130
|
* Track by function for commands list
|
|
79
131
|
*/
|
|
80
|
-
|
|
132
|
+
TrackByCommand(index, command) {
|
|
81
133
|
return `${command.type}_${index}`;
|
|
82
134
|
}
|
|
135
|
+
/** @deprecated Use {@link TrackByCommand}. */
|
|
136
|
+
trackByCommand(index, command) {
|
|
137
|
+
return this.TrackByCommand(index, command);
|
|
138
|
+
}
|
|
83
139
|
static ɵfac = function ActionableCommandsComponent_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || ActionableCommandsComponent)(); };
|
|
84
|
-
static ɵcmp = /*@__PURE__*/ i0.ɵɵdefineComponent({ type: ActionableCommandsComponent, selectors: [["mj-actionable-commands"]], inputs: { commands: "commands", disabled: "disabled", isLastMessage: "isLastMessage", isConversationOwner: "isConversationOwner" }, outputs: { commandExecuted: "commandExecuted" }, standalone: false, decls: 1, vars: 1, consts: [[1, "actionable-commands"], [1, "commands-label"], [1, "commands-buttons"], ["mjButton", "", 1, "command-button", 3, "variant", "disabled"], ["mjButton", "", 1, "command-button", 3, "click", "variant", "disabled"], ["aria-hidden", "true", 3, "class"], ["aria-hidden", "true"]], template: function ActionableCommandsComponent_Template(rf, ctx) { if (rf & 1) {
|
|
140
|
+
static ɵcmp = /*@__PURE__*/ i0.ɵɵdefineComponent({ type: ActionableCommandsComponent, selectors: [["mj-actionable-commands"]], inputs: { Commands: "Commands", commands: "commands", Disabled: "Disabled", disabled: "disabled", IsLastMessage: "IsLastMessage", isLastMessage: "isLastMessage", IsConversationOwner: "IsConversationOwner", isConversationOwner: "isConversationOwner" }, outputs: { CommandExecuted: "CommandExecuted", commandExecuted: "commandExecuted" }, standalone: false, decls: 1, vars: 1, consts: [[1, "actionable-commands"], [1, "commands-label"], [1, "commands-buttons"], ["mjButton", "", 1, "command-button", 3, "variant", "disabled"], ["mjButton", "", 1, "command-button", 3, "click", "variant", "disabled"], ["aria-hidden", "true", 3, "class"], ["aria-hidden", "true"]], template: function ActionableCommandsComponent_Template(rf, ctx) { if (rf & 1) {
|
|
85
141
|
i0.ɵɵconditionalCreate(0, ActionableCommandsComponent_Conditional_0_Template, 6, 0, "div", 0);
|
|
86
142
|
} if (rf & 2) {
|
|
87
143
|
i0.ɵɵconditional(ctx.isVisible ? 0 : -1);
|
|
@@ -90,14 +146,24 @@ export class ActionableCommandsComponent {
|
|
|
90
146
|
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(ActionableCommandsComponent, [{
|
|
91
147
|
type: Component,
|
|
92
148
|
args: [{ standalone: false, selector: 'mj-actionable-commands', template: "@if (isVisible) {\n <div class=\"actionable-commands\">\n <div class=\"commands-label\">Actions:</div>\n <div class=\"commands-buttons\">\n @for (command of commands; track trackByCommand($index, command)) {\n <button mjButton\n [variant]=\"getButtonVariant(command)\"\n [disabled]=\"disabled\"\n (click)=\"onCommandClick(command)\"\n class=\"command-button\"\n >\n @if (command.icon) {\n <i class=\"fa {{ command.icon }}\" aria-hidden=\"true\"></i>\n }\n {{ command.label }}\n </button>\n }\n </div>\n </div>\n}\n", styles: [".actionable-commands {\n margin-top: 16px;\n padding: 12px;\n background: var(--mj-bg-surface-sunken);\n border-left: 3px solid var(--mj-brand-primary);\n border-radius: 4px;\n}\n\n.commands-label {\n font-size: 13px;\n font-weight: 600;\n color: var(--mj-text-secondary);\n margin-bottom: 10px;\n text-transform: uppercase;\n letter-spacing: 0.5px;\n}\n\n.commands-buttons {\n display: flex;\n flex-wrap: wrap;\n gap: 10px;\n}\n\n.command-button {\n padding: 8px 16px;\n font-size: 14px;\n}\n\n.command-button i {\n margin-right: 6px;\n}\n\n/* Responsive Design */\n@media (max-width: 768px) {\n .commands-buttons {\n flex-direction: column;\n }\n\n .command-button {\n width: 100%;\n }\n}\n"] }]
|
|
93
|
-
}], null, {
|
|
149
|
+
}], null, { Commands: [{
|
|
150
|
+
type: Input
|
|
151
|
+
}], commands: [{
|
|
152
|
+
type: Input
|
|
153
|
+
}], Disabled: [{
|
|
94
154
|
type: Input
|
|
95
155
|
}], disabled: [{
|
|
96
156
|
type: Input
|
|
157
|
+
}], IsLastMessage: [{
|
|
158
|
+
type: Input
|
|
97
159
|
}], isLastMessage: [{
|
|
98
160
|
type: Input
|
|
161
|
+
}], IsConversationOwner: [{
|
|
162
|
+
type: Input
|
|
99
163
|
}], isConversationOwner: [{
|
|
100
164
|
type: Input
|
|
165
|
+
}], CommandExecuted: [{
|
|
166
|
+
type: Output
|
|
101
167
|
}], commandExecuted: [{
|
|
102
168
|
type: Output
|
|
103
169
|
}] }); })();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"actionable-commands.component.js","sourceRoot":"","sources":["../../../../src/lib/components/message/actionable-commands.component.ts","../../../../src/lib/components/message/actionable-commands.component.html"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,KAAK,EAAE,MAAM,EAAE,YAAY,EAAE,MAAM,eAAe,CAAC;;;;ICY3D,uBAAwD;;;IAArD,cAAA,yCAA6B,CAAA;;;;IAPpC,iCAKG;IAFD,mOAAS,iCAAuB,KAAC;IAGjC,+GAAoB;IAGpB,YACF;IAAA,iBAAS;;;;IARP,AADA,6DAAqC,6BAChB;IAIrB,cAEC;IAFD,0CAEC;IACD,cACF;IADE,iDACF;;;IAbJ,AADF,8BAAiC,aACH;IAAA,wBAAQ;IAAA,iBAAM;IAC1C,8BAA8B;IAC5B,kJAYC;IAEL,AADE,iBAAM,EACF;;;IAdF,eAYC;IAZD,8BAYC;;ADbP;;;GAGG;AAOH,MAAM,OAAO,2BAA2B;IAC7B,QAAQ,GAAwB,EAAE,CAAC;
|
|
1
|
+
{"version":3,"file":"actionable-commands.component.js","sourceRoot":"","sources":["../../../../src/lib/components/message/actionable-commands.component.ts","../../../../src/lib/components/message/actionable-commands.component.html"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,KAAK,EAAE,MAAM,EAAE,YAAY,EAAE,MAAM,eAAe,CAAC;;;;ICY3D,uBAAwD;;;IAArD,cAAA,yCAA6B,CAAA;;;;IAPpC,iCAKG;IAFD,mOAAS,iCAAuB,KAAC;IAGjC,+GAAoB;IAGpB,YACF;IAAA,iBAAS;;;;IARP,AADA,6DAAqC,6BAChB;IAIrB,cAEC;IAFD,0CAEC;IACD,cACF;IADE,iDACF;;;IAbJ,AADF,8BAAiC,aACH;IAAA,wBAAQ;IAAA,iBAAM;IAC1C,8BAA8B;IAC5B,kJAYC;IAEL,AADE,iBAAM,EACF;;;IAdF,eAYC;IAZD,8BAYC;;ADbP;;;GAGG;AAOH,MAAM,OAAO,2BAA2B;IAC7B,QAAQ,GAAwB,EAAE,CAAC;IAE5C,wCAAwC;IACxC,IAAa,QAAQ,CAAC,KAA0B;QAC9C,IAAI,CAAC,QAAQ,GAAG,KAAK,CAAC;IACxB,CAAC;IACD,wCAAwC;IACxC,IAAI,QAAQ;QACV,OAAO,IAAI,CAAC,QAAQ,CAAC;IACvB,CAAC;IACQ,QAAQ,GAAY,KAAK,CAAC;IAEnC,wCAAwC;IACxC,IAAa,QAAQ,CAAC,KAAc;QAClC,IAAI,CAAC,QAAQ,GAAG,KAAK,CAAC;IACxB,CAAC;IACD,wCAAwC;IACxC,IAAI,QAAQ;QACV,OAAO,IAAI,CAAC,QAAQ,CAAC;IACvB,CAAC;IACQ,aAAa,GAAY,KAAK,CAAC;IAExC,6CAA6C;IAC7C,IAAa,aAAa,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AC;QACD,OAAO,WAAW,CAAC;IACrB,CAAC;IAED,gDAAgD;IACzC,gBAAgB,CAAC,OAA0B;QAChD,OAAO,IAAI,CAAC,gBAAgB,CAAC,OAAO,CAAC,CAAC;IACxC,CAAC;IAED;;OAEG;IACI,cAAc,CAAC,KAAa,EAAE,OAA0B;QAC7D,OAAO,GAAG,OAAO,CAAC,IAAI,IAAI,KAAK,EAAE,CAAC;IACpC,CAAC;IAED,8CAA8C;IACvC,cAAc,CAAC,KAAa,EAAE,OAA0B;QAC7D,OAAO,IAAI,CAAC,cAAc,CAAC,KAAK,EAAE,OAAO,CAAC,CAAC;IAC7C,CAAC;qHA/GU,2BAA2B;6DAA3B,2BAA2B;YCbxC,6FAAiB;;YAAjB,wCAmBC;;;iFDNY,2BAA2B;cANvC,SAAS;6BACI,KAAK,YACP,wBAAwB;;kBAKjC,KAAK;;kBAGL,KAAK;;kBAOL,KAAK;;kBAGL,KAAK;;kBAOL,KAAK;;kBAGL,KAAK;;kBAOL,KAAK;;kBAGL,KAAK;;kBAQL,MAAM;;kBASN,MAAM;;kFAnDI,2BAA2B","sourcesContent":["import { Component, Input, Output, EventEmitter } from '@angular/core';\nimport { ActionableCommand } from '@memberjunction/ai-core-plus';\n\n/**\n * Component for displaying actionable command buttons\n * These are actions the user can trigger after an agent completes a task\n */\n@Component({\n standalone: false,\n selector: 'mj-actionable-commands',\n templateUrl: './actionable-commands.component.html',\n styleUrls: ['./actionable-commands.component.css']\n})\nexport class ActionableCommandsComponent {\n @Input() Commands: ActionableCommand[] = [];\n\n /** @deprecated Use {@link Commands}. */\n @Input() set commands(value: ActionableCommand[]) {\n this.Commands = value;\n }\n /** @deprecated Use {@link Commands}. */\n get commands(): ActionableCommand[] {\n return this.Commands;\n }\n @Input() Disabled: boolean = false;\n\n /** @deprecated Use {@link Disabled}. */\n @Input() set disabled(value: boolean) {\n this.Disabled = value;\n }\n /** @deprecated Use {@link Disabled}. */\n get disabled(): boolean {\n return this.Disabled;\n }\n @Input() IsLastMessage: boolean = false;\n\n /** @deprecated Use {@link IsLastMessage}. */\n @Input() set isLastMessage(value: boolean) {\n this.IsLastMessage = value;\n }\n /** @deprecated Use {@link IsLastMessage}. */\n get isLastMessage(): boolean {\n return this.IsLastMessage;\n }\n @Input() IsConversationOwner: boolean = false;\n\n /** @deprecated Use {@link IsConversationOwner}. */\n @Input() set isConversationOwner(value: boolean) {\n this.IsConversationOwner = value;\n }\n /** @deprecated Use {@link IsConversationOwner}. */\n get isConversationOwner(): boolean {\n return this.IsConversationOwner;\n }\n\n @Output() CommandExecuted = new EventEmitter<ActionableCommand>();\n\n /**\n * @deprecated Use {@link CommandExecuted}.\n *\n * The same emitter under the old binding name, so a template still binding\n * (commandExecuted) keeps working. Must stay AFTER CommandExecuted: class fields\n * initialise in order, and the other way round this captures undefined.\n */\n @Output() commandExecuted = this.CommandExecuted;\n\n /**\n * Check if component should be visible\n */\n public get IsVisible(): boolean {\n return (\n this.IsLastMessage &&\n this.IsConversationOwner &&\n this.Commands &&\n this.Commands.length > 0\n );\n }\n\n /** @deprecated Use {@link IsVisible}. */\n public get isVisible(): boolean {\n return this.IsVisible;\n }\n\n /**\n * Handle command button click\n */\n public OnCommandClick(command: ActionableCommand): void {\n if (!this.Disabled) {\n this.CommandExecuted.emit(command);\n }\n }\n\n /** @deprecated Use {@link OnCommandClick}. */\n public onCommandClick(command: ActionableCommand): void {\n return this.OnCommandClick(command);\n }\n\n /**\n * Get button variant based on command type\n */\n public GetButtonVariant(command: ActionableCommand): 'primary' | 'secondary' | 'outline' | 'flat' {\n if (command.type === 'open:resource') {\n return 'primary';\n } else if (command.type === 'open:url') {\n return 'outline';\n }\n return 'secondary';\n }\n\n /** @deprecated Use {@link GetButtonVariant}. */\n public getButtonVariant(command: ActionableCommand): 'primary' | 'secondary' | 'outline' | 'flat' {\n return this.GetButtonVariant(command);\n }\n\n /**\n * Track by function for commands list\n */\n public TrackByCommand(index: number, command: ActionableCommand): string {\n return `${command.type}_${index}`;\n }\n\n /** @deprecated Use {@link TrackByCommand}. */\n public trackByCommand(index: number, command: ActionableCommand): string {\n return this.TrackByCommand(index, command);\n }\n}\n","@if (isVisible) {\n <div class=\"actionable-commands\">\n <div class=\"commands-label\">Actions:</div>\n <div class=\"commands-buttons\">\n @for (command of commands; track trackByCommand($index, command)) {\n <button mjButton\n [variant]=\"getButtonVariant(command)\"\n [disabled]=\"disabled\"\n (click)=\"onCommandClick(command)\"\n class=\"command-button\"\n >\n @if (command.icon) {\n <i class=\"fa {{ command.icon }}\" aria-hidden=\"true\"></i>\n }\n {{ command.label }}\n </button>\n }\n </div>\n </div>\n}\n"]}
|
|
@@ -16,8 +16,16 @@ import * as i0 from "@angular/core";
|
|
|
16
16
|
export declare class ConversationMessageRatingComponent extends BaseAngularComponent implements OnInit {
|
|
17
17
|
private cdr;
|
|
18
18
|
private dialogService;
|
|
19
|
-
|
|
20
|
-
|
|
19
|
+
ConversationDetailId: string;
|
|
20
|
+
/** @deprecated Use {@link ConversationDetailId}. */
|
|
21
|
+
set conversationDetailId(value: string);
|
|
22
|
+
/** @deprecated Use {@link ConversationDetailId}. */
|
|
23
|
+
get conversationDetailId(): string;
|
|
24
|
+
CurrentUser: UserInfo;
|
|
25
|
+
/** @deprecated Use {@link CurrentUser}. */
|
|
26
|
+
set currentUser(value: UserInfo);
|
|
27
|
+
/** @deprecated Use {@link CurrentUser}. */
|
|
28
|
+
get currentUser(): UserInfo;
|
|
21
29
|
/**
|
|
22
30
|
* When false, the rating UI renders as a read-only badge instead of an editable
|
|
23
31
|
* button. Set by the parent (MessageItemComponent) to `false` when the current
|
|
@@ -30,20 +38,48 @@ export declare class ConversationMessageRatingComponent extends BaseAngularCompo
|
|
|
30
38
|
* `MJ: Conversation Details` (which has `UserRating`/`UserFeedback`).
|
|
31
39
|
* Skip-Brain hosts pass `'Conversation Details__Skip'`.
|
|
32
40
|
*/
|
|
33
|
-
|
|
41
|
+
RatingEntityName: string;
|
|
42
|
+
/** @deprecated Use {@link RatingEntityName}. */
|
|
43
|
+
set ratingEntityName(value: string);
|
|
44
|
+
/** @deprecated Use {@link RatingEntityName}. */
|
|
45
|
+
get ratingEntityName(): string;
|
|
34
46
|
/** Column on the entity that stores the 1-10 rating. */
|
|
35
|
-
|
|
47
|
+
RatingField: string;
|
|
48
|
+
/** @deprecated Use {@link RatingField}. */
|
|
49
|
+
set ratingField(value: string);
|
|
50
|
+
/** @deprecated Use {@link RatingField}. */
|
|
51
|
+
get ratingField(): string;
|
|
36
52
|
/** Column on the entity that stores the free-form feedback. */
|
|
37
|
-
|
|
53
|
+
RatingCommentField: string;
|
|
54
|
+
/** @deprecated Use {@link RatingCommentField}. */
|
|
55
|
+
set ratingCommentField(value: string);
|
|
56
|
+
/** @deprecated Use {@link RatingCommentField}. */
|
|
57
|
+
get ratingCommentField(): string;
|
|
38
58
|
/**
|
|
39
59
|
* Optional: legacy pre-loaded ratings array (no longer used by storage; kept
|
|
40
60
|
* to preserve the input shape used by existing call sites like
|
|
41
61
|
* MessageItemComponent).
|
|
42
62
|
*/
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
63
|
+
RatingsData?: RatingJSON[];
|
|
64
|
+
/** @deprecated Use {@link RatingsData}. */
|
|
65
|
+
set ratingsData(value: RatingJSON[] | undefined);
|
|
66
|
+
/** @deprecated Use {@link RatingsData}. */
|
|
67
|
+
get ratingsData(): RatingJSON[] | undefined;
|
|
68
|
+
CurrentUserRating: number | null;
|
|
69
|
+
/** @deprecated Use {@link CurrentUserRating}. */
|
|
70
|
+
get currentUserRating(): number | null;
|
|
71
|
+
/** @deprecated Use {@link CurrentUserRating}. */
|
|
72
|
+
set currentUserRating(value: number | null);
|
|
73
|
+
CurrentUserComments: string;
|
|
74
|
+
/** @deprecated Use {@link CurrentUserComments}. */
|
|
75
|
+
get currentUserComments(): string;
|
|
76
|
+
/** @deprecated Use {@link CurrentUserComments}. */
|
|
77
|
+
set currentUserComments(value: string);
|
|
78
|
+
IsSaving: boolean;
|
|
79
|
+
/** @deprecated Use {@link IsSaving}. */
|
|
80
|
+
get isSaving(): boolean;
|
|
81
|
+
/** @deprecated Use {@link IsSaving}. */
|
|
82
|
+
set isSaving(value: boolean);
|
|
47
83
|
constructor(cdr: ChangeDetectorRef, dialogService: DialogService);
|
|
48
84
|
ngOnInit(): Promise<void>;
|
|
49
85
|
OpenRatingDialog(): Promise<void>;
|
|
@@ -57,6 +93,6 @@ export declare class ConversationMessageRatingComponent extends BaseAngularCompo
|
|
|
57
93
|
private loadRating;
|
|
58
94
|
private saveRating;
|
|
59
95
|
static ɵfac: i0.ɵɵFactoryDeclaration<ConversationMessageRatingComponent, never>;
|
|
60
|
-
static ɵcmp: i0.ɵɵComponentDeclaration<ConversationMessageRatingComponent, "mj-conversation-message-rating", never, { "conversationDetailId": { "alias": "conversationDetailId"; "required": false; }; "currentUser": { "alias": "currentUser"; "required": false; }; "canEdit": { "alias": "canEdit"; "required": false; }; "ratingEntityName": { "alias": "ratingEntityName"; "required": false; }; "ratingField": { "alias": "ratingField"; "required": false; }; "ratingCommentField": { "alias": "ratingCommentField"; "required": false; }; "ratingsData": { "alias": "ratingsData"; "required": false; }; }, {}, never, never, false, never>;
|
|
96
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<ConversationMessageRatingComponent, "mj-conversation-message-rating", never, { "ConversationDetailId": { "alias": "ConversationDetailId"; "required": false; }; "conversationDetailId": { "alias": "conversationDetailId"; "required": false; }; "CurrentUser": { "alias": "CurrentUser"; "required": false; }; "currentUser": { "alias": "currentUser"; "required": false; }; "canEdit": { "alias": "canEdit"; "required": false; }; "RatingEntityName": { "alias": "RatingEntityName"; "required": false; }; "ratingEntityName": { "alias": "ratingEntityName"; "required": false; }; "RatingField": { "alias": "RatingField"; "required": false; }; "ratingField": { "alias": "ratingField"; "required": false; }; "RatingCommentField": { "alias": "RatingCommentField"; "required": false; }; "ratingCommentField": { "alias": "ratingCommentField"; "required": false; }; "RatingsData": { "alias": "RatingsData"; "required": false; }; "ratingsData": { "alias": "ratingsData"; "required": false; }; }, {}, never, never, false, never>;
|
|
61
97
|
}
|
|
62
98
|
//# sourceMappingURL=conversation-message-rating.component.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"conversation-message-rating.component.d.ts","sourceRoot":"","sources":["../../../../src/lib/components/message/conversation-message-rating.component.ts"],"names":[],"mappings":"AAAA,OAAO,EAAoB,MAAM,EAAE,iBAAiB,EAAE,MAAM,eAAe,CAAC;AAC5E,OAAO,EAAE,oBAAoB,EAAE,MAAM,+BAA+B,CAAC;AACrE,OAAO,EAAqC,QAAQ,EAAE,MAAM,sBAAsB,CAAC;AACnF,OAAO,EAAE,UAAU,EAAkB,MAAM,+BAA+B,CAAC;AAC3E,OAAO,EAAE,aAAa,EAAE,MAAM,+BAA+B,CAAC;;AAiB9D;;;;;;;;GAQG;AACH,qBA+Fa,kCAAmC,SAAQ,oBAAqB,YAAW,MAAM;
|
|
1
|
+
{"version":3,"file":"conversation-message-rating.component.d.ts","sourceRoot":"","sources":["../../../../src/lib/components/message/conversation-message-rating.component.ts"],"names":[],"mappings":"AAAA,OAAO,EAAoB,MAAM,EAAE,iBAAiB,EAAE,MAAM,eAAe,CAAC;AAC5E,OAAO,EAAE,oBAAoB,EAAE,MAAM,+BAA+B,CAAC;AACrE,OAAO,EAAqC,QAAQ,EAAE,MAAM,sBAAsB,CAAC;AACnF,OAAO,EAAE,UAAU,EAAkB,MAAM,+BAA+B,CAAC;AAC3E,OAAO,EAAE,aAAa,EAAE,MAAM,+BAA+B,CAAC;;AAiB9D;;;;;;;;GAQG;AACH,qBA+Fa,kCAAmC,SAAQ,oBAAqB,YAAW,MAAM;IAsH1F,OAAO,CAAC,GAAG;IACX,OAAO,CAAC,aAAa;IAtHd,oBAAoB,EAAG,MAAM,CAAC;IAEvC,oDAAoD;IACpD,IAAa,oBAAoB,CAAC,KAAK,EAAE,MAAM,EAE9C;IACD,oDAAoD;IACpD,IAAI,oBAA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,CAAC,KAAK,EAAE,MAAM,EAEpC;IACD,QAAQ,UAAS;IAEjB,wCAAwC;IACxC,IAAI,QAAQ,YAEX;IACD,wCAAwC;IACxC,IAAI,QAAQ,CAAC,KAAK,SAAA,EAEjB;gBAGS,GAAG,EAAE,iBAAiB,EACtB,aAAa,EAAE,aAAa;IAKhC,QAAQ;IAIR,gBAAgB,IAAI,OAAO,CAAC,IAAI,CAAC;IA6CvC;;;;;OAKG;YACW,uBAAuB;YAoCvB,UAAU;YAkBV,UAAU;yCAzOb,kCAAkC;2CAAlC,kCAAkC;CAgR9C"}
|
|
@@ -62,8 +62,24 @@ const FEEDBACK_ROLE_IDS = [
|
|
|
62
62
|
export class ConversationMessageRatingComponent extends BaseAngularComponent {
|
|
63
63
|
cdr;
|
|
64
64
|
dialogService;
|
|
65
|
-
|
|
66
|
-
|
|
65
|
+
ConversationDetailId;
|
|
66
|
+
/** @deprecated Use {@link ConversationDetailId}. */
|
|
67
|
+
set conversationDetailId(value) {
|
|
68
|
+
this.ConversationDetailId = value;
|
|
69
|
+
}
|
|
70
|
+
/** @deprecated Use {@link ConversationDetailId}. */
|
|
71
|
+
get conversationDetailId() {
|
|
72
|
+
return this.ConversationDetailId;
|
|
73
|
+
}
|
|
74
|
+
CurrentUser;
|
|
75
|
+
/** @deprecated Use {@link CurrentUser}. */
|
|
76
|
+
set currentUser(value) {
|
|
77
|
+
this.CurrentUser = value;
|
|
78
|
+
}
|
|
79
|
+
/** @deprecated Use {@link CurrentUser}. */
|
|
80
|
+
get currentUser() {
|
|
81
|
+
return this.CurrentUser;
|
|
82
|
+
}
|
|
67
83
|
/**
|
|
68
84
|
* When false, the rating UI renders as a read-only badge instead of an editable
|
|
69
85
|
* button. Set by the parent (MessageItemComponent) to `false` when the current
|
|
@@ -76,20 +92,76 @@ export class ConversationMessageRatingComponent extends BaseAngularComponent {
|
|
|
76
92
|
* `MJ: Conversation Details` (which has `UserRating`/`UserFeedback`).
|
|
77
93
|
* Skip-Brain hosts pass `'Conversation Details__Skip'`.
|
|
78
94
|
*/
|
|
79
|
-
|
|
95
|
+
RatingEntityName = 'MJ: Conversation Details';
|
|
96
|
+
/** @deprecated Use {@link RatingEntityName}. */
|
|
97
|
+
set ratingEntityName(value) {
|
|
98
|
+
this.RatingEntityName = value;
|
|
99
|
+
}
|
|
100
|
+
/** @deprecated Use {@link RatingEntityName}. */
|
|
101
|
+
get ratingEntityName() {
|
|
102
|
+
return this.RatingEntityName;
|
|
103
|
+
}
|
|
80
104
|
/** Column on the entity that stores the 1-10 rating. */
|
|
81
|
-
|
|
105
|
+
RatingField = 'UserRating';
|
|
106
|
+
/** @deprecated Use {@link RatingField}. */
|
|
107
|
+
set ratingField(value) {
|
|
108
|
+
this.RatingField = value;
|
|
109
|
+
}
|
|
110
|
+
/** @deprecated Use {@link RatingField}. */
|
|
111
|
+
get ratingField() {
|
|
112
|
+
return this.RatingField;
|
|
113
|
+
}
|
|
82
114
|
/** Column on the entity that stores the free-form feedback. */
|
|
83
|
-
|
|
115
|
+
RatingCommentField = 'UserFeedback';
|
|
116
|
+
/** @deprecated Use {@link RatingCommentField}. */
|
|
117
|
+
set ratingCommentField(value) {
|
|
118
|
+
this.RatingCommentField = value;
|
|
119
|
+
}
|
|
120
|
+
/** @deprecated Use {@link RatingCommentField}. */
|
|
121
|
+
get ratingCommentField() {
|
|
122
|
+
return this.RatingCommentField;
|
|
123
|
+
}
|
|
84
124
|
/**
|
|
85
125
|
* Optional: legacy pre-loaded ratings array (no longer used by storage; kept
|
|
86
126
|
* to preserve the input shape used by existing call sites like
|
|
87
127
|
* MessageItemComponent).
|
|
88
128
|
*/
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
129
|
+
RatingsData;
|
|
130
|
+
/** @deprecated Use {@link RatingsData}. */
|
|
131
|
+
set ratingsData(value) {
|
|
132
|
+
this.RatingsData = value;
|
|
133
|
+
}
|
|
134
|
+
/** @deprecated Use {@link RatingsData}. */
|
|
135
|
+
get ratingsData() {
|
|
136
|
+
return this.RatingsData;
|
|
137
|
+
}
|
|
138
|
+
CurrentUserRating = null;
|
|
139
|
+
/** @deprecated Use {@link CurrentUserRating}. */
|
|
140
|
+
get currentUserRating() {
|
|
141
|
+
return this.CurrentUserRating;
|
|
142
|
+
}
|
|
143
|
+
/** @deprecated Use {@link CurrentUserRating}. */
|
|
144
|
+
set currentUserRating(value) {
|
|
145
|
+
this.CurrentUserRating = value;
|
|
146
|
+
}
|
|
147
|
+
CurrentUserComments = '';
|
|
148
|
+
/** @deprecated Use {@link CurrentUserComments}. */
|
|
149
|
+
get currentUserComments() {
|
|
150
|
+
return this.CurrentUserComments;
|
|
151
|
+
}
|
|
152
|
+
/** @deprecated Use {@link CurrentUserComments}. */
|
|
153
|
+
set currentUserComments(value) {
|
|
154
|
+
this.CurrentUserComments = value;
|
|
155
|
+
}
|
|
156
|
+
IsSaving = false;
|
|
157
|
+
/** @deprecated Use {@link IsSaving}. */
|
|
158
|
+
get isSaving() {
|
|
159
|
+
return this.IsSaving;
|
|
160
|
+
}
|
|
161
|
+
/** @deprecated Use {@link IsSaving}. */
|
|
162
|
+
set isSaving(value) {
|
|
163
|
+
this.IsSaving = value;
|
|
164
|
+
}
|
|
93
165
|
constructor(cdr, dialogService) {
|
|
94
166
|
super();
|
|
95
167
|
this.cdr = cdr;
|
|
@@ -99,7 +171,7 @@ export class ConversationMessageRatingComponent extends BaseAngularComponent {
|
|
|
99
171
|
await this.loadRating();
|
|
100
172
|
}
|
|
101
173
|
async OpenRatingDialog() {
|
|
102
|
-
if (this.
|
|
174
|
+
if (this.IsSaving)
|
|
103
175
|
return;
|
|
104
176
|
if (!this.canEdit)
|
|
105
177
|
return;
|
|
@@ -112,10 +184,10 @@ export class ConversationMessageRatingComponent extends BaseAngularComponent {
|
|
|
112
184
|
console.warn('[Rating] Could not read consent flag, will require acknowledgement', e);
|
|
113
185
|
}
|
|
114
186
|
const result = await this.dialogService.rating({
|
|
115
|
-
title: this.
|
|
187
|
+
title: this.CurrentUserRating != null ? 'Edit your rating' : 'Rate this response',
|
|
116
188
|
message: 'Rate the response on a 1-10 scale and (optionally) describe what was good or bad.',
|
|
117
|
-
initialRating: this.
|
|
118
|
-
initialComments: this.
|
|
189
|
+
initialRating: this.CurrentUserRating,
|
|
190
|
+
initialComments: this.CurrentUserComments,
|
|
119
191
|
okText: 'Submit',
|
|
120
192
|
requireConsent: !consentAcknowledged
|
|
121
193
|
});
|
|
@@ -178,16 +250,16 @@ export class ConversationMessageRatingComponent extends BaseAngularComponent {
|
|
|
178
250
|
}
|
|
179
251
|
}
|
|
180
252
|
async loadRating() {
|
|
181
|
-
if (!this.
|
|
253
|
+
if (!this.ConversationDetailId)
|
|
182
254
|
return;
|
|
183
255
|
try {
|
|
184
256
|
const md = this.ProviderToUse;
|
|
185
|
-
const entity = (await md.GetEntityObject(this.
|
|
186
|
-
const loaded = await entity.Load(this.
|
|
257
|
+
const entity = (await md.GetEntityObject(this.RatingEntityName));
|
|
258
|
+
const loaded = await entity.Load(this.ConversationDetailId);
|
|
187
259
|
if (loaded) {
|
|
188
|
-
const rating = entity.Get(this.
|
|
189
|
-
this.
|
|
190
|
-
this.
|
|
260
|
+
const rating = entity.Get(this.RatingField);
|
|
261
|
+
this.CurrentUserRating = rating != null ? Number(rating) : null;
|
|
262
|
+
this.CurrentUserComments = (entity.Get(this.RatingCommentField) ?? '');
|
|
191
263
|
this.cdr.detectChanges();
|
|
192
264
|
}
|
|
193
265
|
}
|
|
@@ -197,27 +269,27 @@ export class ConversationMessageRatingComponent extends BaseAngularComponent {
|
|
|
197
269
|
}
|
|
198
270
|
}
|
|
199
271
|
async saveRating(rating, comments) {
|
|
200
|
-
if (this.
|
|
272
|
+
if (this.IsSaving)
|
|
201
273
|
return null;
|
|
202
274
|
if (rating < 1 || rating > 10)
|
|
203
275
|
return null;
|
|
204
|
-
if (!this.
|
|
276
|
+
if (!this.ConversationDetailId)
|
|
205
277
|
return null;
|
|
206
|
-
const prevRating = this.
|
|
207
|
-
const prevComments = this.
|
|
208
|
-
this.
|
|
209
|
-
this.
|
|
210
|
-
this.
|
|
278
|
+
const prevRating = this.CurrentUserRating;
|
|
279
|
+
const prevComments = this.CurrentUserComments;
|
|
280
|
+
this.IsSaving = true;
|
|
281
|
+
this.CurrentUserRating = rating;
|
|
282
|
+
this.CurrentUserComments = comments;
|
|
211
283
|
this.cdr.detectChanges();
|
|
212
284
|
try {
|
|
213
285
|
const md = this.ProviderToUse;
|
|
214
|
-
const entity = (await md.GetEntityObject(this.
|
|
215
|
-
const loaded = await entity.Load(this.
|
|
286
|
+
const entity = (await md.GetEntityObject(this.RatingEntityName));
|
|
287
|
+
const loaded = await entity.Load(this.ConversationDetailId);
|
|
216
288
|
if (!loaded) {
|
|
217
|
-
throw new Error(`ConversationDetail ${this.
|
|
289
|
+
throw new Error(`ConversationDetail ${this.ConversationDetailId} not found in ${this.RatingEntityName}`);
|
|
218
290
|
}
|
|
219
|
-
entity.Set(this.
|
|
220
|
-
entity.Set(this.
|
|
291
|
+
entity.Set(this.RatingField, rating);
|
|
292
|
+
entity.Set(this.RatingCommentField, comments || null);
|
|
221
293
|
const saveResult = await entity.Save();
|
|
222
294
|
if (!saveResult) {
|
|
223
295
|
throw new Error(`Save failed: ${entity.LatestResult?.Message ?? 'unknown'}`);
|
|
@@ -227,18 +299,18 @@ export class ConversationMessageRatingComponent extends BaseAngularComponent {
|
|
|
227
299
|
}
|
|
228
300
|
catch (error) {
|
|
229
301
|
console.error('[Rating] save failed:', error);
|
|
230
|
-
this.
|
|
231
|
-
this.
|
|
302
|
+
this.CurrentUserRating = prevRating;
|
|
303
|
+
this.CurrentUserComments = prevComments;
|
|
232
304
|
this.cdr.detectChanges();
|
|
233
305
|
return null;
|
|
234
306
|
}
|
|
235
307
|
finally {
|
|
236
|
-
this.
|
|
308
|
+
this.IsSaving = false;
|
|
237
309
|
this.cdr.detectChanges();
|
|
238
310
|
}
|
|
239
311
|
}
|
|
240
312
|
static ɵfac = function ConversationMessageRatingComponent_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || ConversationMessageRatingComponent)(i0.ɵɵdirectiveInject(i0.ChangeDetectorRef), i0.ɵɵdirectiveInject(i1.DialogService)); };
|
|
241
|
-
static ɵcmp = /*@__PURE__*/ i0.ɵɵdefineComponent({ type: ConversationMessageRatingComponent, selectors: [["mj-conversation-message-rating"]], inputs: { conversationDetailId: "conversationDetailId", currentUser: "currentUser", canEdit: "canEdit", ratingEntityName: "ratingEntityName", ratingField: "ratingField", ratingCommentField: "ratingCommentField", ratingsData: "ratingsData" }, standalone: false, features: [i0.ɵɵInheritDefinitionFeature], decls: 4, vars: 1, consts: [[1, "rating-container"], [1, "user-rating"], ["type", "button", 1, "rating-button", 3, "has-rated", "disabled", "title"], ["title", "Rating left by the conversation owner \u2014 read-only", 1, "rating-readonly"], ["type", "button", 1, "rating-button", 3, "click", "disabled", "title"], [1, "fa-solid", "fa-pen-to-square"], [1, "my-rating"], [1, "fa-regular", "fa-comment-dots"], [1, "fa-solid", "fa-comment-dots"]], template: function ConversationMessageRatingComponent_Template(rf, ctx) { if (rf & 1) {
|
|
313
|
+
static ɵcmp = /*@__PURE__*/ i0.ɵɵdefineComponent({ type: ConversationMessageRatingComponent, selectors: [["mj-conversation-message-rating"]], inputs: { ConversationDetailId: "ConversationDetailId", conversationDetailId: "conversationDetailId", CurrentUser: "CurrentUser", currentUser: "currentUser", canEdit: "canEdit", RatingEntityName: "RatingEntityName", ratingEntityName: "ratingEntityName", RatingField: "RatingField", ratingField: "ratingField", RatingCommentField: "RatingCommentField", ratingCommentField: "ratingCommentField", RatingsData: "RatingsData", ratingsData: "ratingsData" }, standalone: false, features: [i0.ɵɵInheritDefinitionFeature], decls: 4, vars: 1, consts: [[1, "rating-container"], [1, "user-rating"], ["type", "button", 1, "rating-button", 3, "has-rated", "disabled", "title"], ["title", "Rating left by the conversation owner \u2014 read-only", 1, "rating-readonly"], ["type", "button", 1, "rating-button", 3, "click", "disabled", "title"], [1, "fa-solid", "fa-pen-to-square"], [1, "my-rating"], [1, "fa-regular", "fa-comment-dots"], [1, "fa-solid", "fa-comment-dots"]], template: function ConversationMessageRatingComponent_Template(rf, ctx) { if (rf & 1) {
|
|
242
314
|
i0.ɵɵelementStart(0, "div", 0)(1, "div", 1);
|
|
243
315
|
i0.ɵɵconditionalCreate(2, ConversationMessageRatingComponent_Conditional_2_Template, 3, 5, "button", 2)(3, ConversationMessageRatingComponent_Conditional_3_Template, 4, 1, "span", 3);
|
|
244
316
|
i0.ɵɵelementEnd()();
|
|
@@ -278,18 +350,30 @@ export class ConversationMessageRatingComponent extends BaseAngularComponent {
|
|
|
278
350
|
</div>
|
|
279
351
|
</div>
|
|
280
352
|
`, styles: ["\n .rating-container {\n display: flex;\n align-items: center;\n gap: 12px;\n padding: 4px 0;\n }\n\n .user-rating {\n display: flex;\n gap: 4px;\n margin-left: auto;\n }\n\n .rating-button {\n display: inline-flex;\n align-items: center;\n gap: 6px;\n background: var(--mj-bg-surface);\n border: 1px solid var(--mj-border-strong);\n border-radius: 6px;\n padding: 6px 12px;\n cursor: pointer;\n font-size: 13px;\n color: var(--mj-text-primary);\n opacity: 0.85;\n transition: all 0.15s ease;\n }\n\n .rating-button:hover:not(:disabled) {\n opacity: 1;\n border-color: var(--mj-brand-primary);\n background: color-mix(in srgb, var(--mj-brand-primary) 6%, var(--mj-bg-surface));\n }\n\n .rating-button:disabled {\n cursor: not-allowed;\n opacity: 0.5;\n }\n\n .rating-button.has-rated {\n border-color: var(--mj-brand-primary);\n background: color-mix(in srgb, var(--mj-brand-primary) 10%, var(--mj-bg-surface));\n }\n\n .my-rating {\n font-weight: 500;\n }\n\n .rating-readonly {\n display: inline-flex;\n align-items: center;\n gap: 6px;\n padding: 4px 10px;\n border: 1px solid var(--mj-border-default);\n border-radius: 6px;\n font-size: 12px;\n color: var(--mj-text-secondary);\n background: var(--mj-bg-surface-sunken);\n cursor: default;\n }\n "] }]
|
|
281
|
-
}], () => [{ type: i0.ChangeDetectorRef }, { type: i1.DialogService }], {
|
|
353
|
+
}], () => [{ type: i0.ChangeDetectorRef }, { type: i1.DialogService }], { ConversationDetailId: [{
|
|
354
|
+
type: Input
|
|
355
|
+
}], conversationDetailId: [{
|
|
356
|
+
type: Input
|
|
357
|
+
}], CurrentUser: [{
|
|
282
358
|
type: Input
|
|
283
359
|
}], currentUser: [{
|
|
284
360
|
type: Input
|
|
285
361
|
}], canEdit: [{
|
|
286
362
|
type: Input
|
|
363
|
+
}], RatingEntityName: [{
|
|
364
|
+
type: Input
|
|
287
365
|
}], ratingEntityName: [{
|
|
288
366
|
type: Input
|
|
367
|
+
}], RatingField: [{
|
|
368
|
+
type: Input
|
|
289
369
|
}], ratingField: [{
|
|
290
370
|
type: Input
|
|
371
|
+
}], RatingCommentField: [{
|
|
372
|
+
type: Input
|
|
291
373
|
}], ratingCommentField: [{
|
|
292
374
|
type: Input
|
|
375
|
+
}], RatingsData: [{
|
|
376
|
+
type: Input
|
|
293
377
|
}], ratingsData: [{
|
|
294
378
|
type: Input
|
|
295
379
|
}] }); })();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"conversation-message-rating.component.js","sourceRoot":"","sources":["../../../../src/lib/components/message/conversation-message-rating.component.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,KAAK,EAA6B,MAAM,eAAe,CAAC;AAC5E,OAAO,EAAE,oBAAoB,EAAE,MAAM,+BAA+B,CAAC;AACrE,OAAO,EAA4B,OAAO,EAAY,MAAM,sBAAsB,CAAC;AACnF,OAAO,EAAc,cAAc,EAAE,MAAM,+BAA+B,CAAC;;;;IA0C7D,uBAAyC;IACzC,+BAAwB;IAAA,YAAqC;IAAA,iBAAO;;;IAA5C,eAAqC;IAArC,qEAAqC;;;IAE7D,uBAA0C;IAC1C,4BAAM;IAAA,6BAAa;IAAA,iBAAO;;;;IAZ9B,iCAMgB;IAFd,sMAAS,yBAAkB,KAAC;IAM1B,AAHF,wGAAiC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,EAAE,CAAC;YACvC,IAAI,CAAC,UAAU,EAAE,CAAC;gBAChB,MAAM,IAAI,KAAK,CAAC,gBAAiB,MAAc,CAAC,YAAY,EAAE,OAAO,IAAI,SAAS,EAAE,CAAC,CAAC;YACxF,CAAC;YACD,MAAM,cAAc,GAAG,MAAM,CAAC,GAAG,CAAC,gBAAgB,CAAC,CAAC;YACpD,OAAO,OAAO,cAAc,KAAK,QAAQ,CAAC,CAAC,CAAC,cAAc,CAAC,CAAC,CAAC,IAAI,CAAC;QACpE,CAAC;QAAC,OAAO,KAAK,EAAE,CAAC;YACf,OAAO,CAAC,KAAK,CAAC,uBAAuB,EAAE,KAAK,CAAC,CAAC;YAC9C,IAAI,CAAC,iBAAiB,GAAG,UAAU,CAAC;YACpC,IAAI,CAAC,mBAAmB,GAAG,YAAY,CAAC;YACxC,IAAI,CAAC,GAAG,CAAC,aAAa,EAAE,CAAC;YACzB,OAAO,IAAI,CAAC;QACd,CAAC;gBAAS,CAAC;YACT,IAAI,CAAC,QAAQ,GAAG,KAAK,CAAC;YACtB,IAAI,CAAC,GAAG,CAAC,aAAa,EAAE,CAAC;QAC3B,CAAC;IACH,CAAC;4HA9LU,kCAAkC;6DAAlC,kCAAkC;YA1FzC,AADF,8BAA8B,aACH;YAiBrB,AAhBF,uGAAe,+EAgByB;YAQ5C,AADE,iBAAM,EACF;;YAxBF,eAsBC;YAtBD,0EAsBC;;;iFAmEI,kCAAkC;cA/F9C,SAAS;6BACI,KAAK,YACP,gCAAgC,YAChC;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4BT;;kBAiEA,KAAK;;kBACL,KAAK;;kBAQL,KAAK;;kBAOL,KAAK;;kBAGL,KAAK;;kBAGL,KAAK;;kBAOL,KAAK;;kFA9BK,kCAAkC","sourcesContent":["import { Component, Input, OnInit, ChangeDetectorRef } from '@angular/core';\nimport { BaseAngularComponent } from '@memberjunction/ng-base-types';\nimport { BaseEntity, CompositeKey, RunView, UserInfo } from '@memberjunction/core';\nimport { RatingJSON, UserInfoEngine } from '@memberjunction/core-entities';\nimport { DialogService } from '../../services/dialog.service';\n\nconst FEEDBACK_CONSENT_KEY = 'agent-feedback-share-consent';\nconst CONVERSATIONS_RESOURCE_TYPE_ID = '81D4BC3D-9FEB-EF11-B01A-286B35C04427';\nconst FEEDBACK_ROLE_IDS = [\n 'deafccec-6a37-ef11-86d4-000d3a4e707e', // Developer\n 'dfafccec-6a37-ef11-86d4-000d3a4e707e' // Integration\n];\n\n/** Minimal shape we use against the loaded entity. All MJ entity subclasses\n * implement `Load(ID)` via codegen but the base `BaseEntity<unknown>` type\n * doesn't expose it, so we narrow here to keep the call generic across\n * entity names without resorting to `any`. */\ntype LoadableEntity = BaseEntity<unknown> & {\n Load(KeyValuePairs: CompositeKey | string, EntityRelationshipsToLoad?: string[]): Promise<boolean>;\n};\n\n/**\n * Single-rating-per-message rating UI for an AI conversation response.\n *\n * Storage model: the rating + free-form comment live directly on the\n * ConversationDetail row, in `UserRating` (1-10, nullable) and `UserFeedback`\n * (nvarchar(max), nullable). This matches MJ's own pattern on\n * `__mj.ConversationDetail` and Skip's matching columns on\n * `Skip.ConversationDetail`. The host app picks the entity via @Input.\n */\n@Component({\n standalone: false,\n selector: 'mj-conversation-message-rating',\n template: `\n <div class=\"rating-container\">\n <div class=\"user-rating\">\n @if (canEdit) {\n <button\n class=\"rating-button\"\n [class.has-rated]=\"currentUserRating != null\"\n [disabled]=\"isSaving\"\n (click)=\"OpenRatingDialog()\"\n [title]=\"currentUserRating != null ? 'Edit your rating' : 'Rate this response'\"\n type=\"button\">\n @if (currentUserRating != null) {\n <i class=\"fa-solid fa-pen-to-square\"></i>\n <span class=\"my-rating\">My rating: {{ currentUserRating }}/10</span>\n } @else {\n <i class=\"fa-regular fa-comment-dots\"></i>\n <span>Rate response</span>\n }\n </button>\n } @else if (currentUserRating != null) {\n <span class=\"rating-readonly\"\n title=\"Rating left by the conversation owner — read-only\">\n <i class=\"fa-solid fa-comment-dots\"></i>\n <span>Rated {{ currentUserRating }}/10</span>\n </span>\n }\n </div>\n </div>\n `,\n styles: [`\n .rating-container {\n display: flex;\n align-items: center;\n gap: 12px;\n padding: 4px 0;\n }\n\n .user-rating {\n display: flex;\n gap: 4px;\n margin-left: auto;\n }\n\n .rating-button {\n display: inline-flex;\n align-items: center;\n gap: 6px;\n background: var(--mj-bg-surface);\n border: 1px solid var(--mj-border-strong);\n border-radius: 6px;\n padding: 6px 12px;\n cursor: pointer;\n font-size: 13px;\n color: var(--mj-text-primary);\n opacity: 0.85;\n transition: all 0.15s ease;\n }\n\n .rating-button:hover:not(:disabled) {\n opacity: 1;\n border-color: var(--mj-brand-primary);\n background: color-mix(in srgb, var(--mj-brand-primary) 6%, var(--mj-bg-surface));\n }\n\n .rating-button:disabled {\n cursor: not-allowed;\n opacity: 0.5;\n }\n\n .rating-button.has-rated {\n border-color: var(--mj-brand-primary);\n background: color-mix(in srgb, var(--mj-brand-primary) 10%, var(--mj-bg-surface));\n }\n\n .my-rating {\n font-weight: 500;\n }\n\n .rating-readonly {\n display: inline-flex;\n align-items: center;\n gap: 6px;\n padding: 4px 10px;\n border: 1px solid var(--mj-border-default);\n border-radius: 6px;\n font-size: 12px;\n color: var(--mj-text-secondary);\n background: var(--mj-bg-surface-sunken);\n cursor: default;\n }\n `]\n})\nexport class ConversationMessageRatingComponent extends BaseAngularComponent implements OnInit {\n @Input() conversationDetailId!: string;\n @Input() currentUser!: UserInfo;\n\n /**\n * When false, the rating UI renders as a read-only badge instead of an editable\n * button. Set by the parent (MessageItemComponent) to `false` when the current\n * user is not the conversation owner — the rating storage is a single field on\n * the ConversationDetail row, so only the owner is allowed to mutate it.\n */\n @Input() canEdit: boolean = true;\n\n /**\n * Entity name to load/update for the rating. Defaults to MJ's\n * `MJ: Conversation Details` (which has `UserRating`/`UserFeedback`).\n * Skip-Brain hosts pass `'Conversation Details__Skip'`.\n */\n @Input() ratingEntityName: string = 'MJ: Conversation Details';\n\n /** Column on the entity that stores the 1-10 rating. */\n @Input() ratingField: string = 'UserRating';\n\n /** Column on the entity that stores the free-form feedback. */\n @Input() ratingCommentField: string = 'UserFeedback';\n\n /**\n * Optional: legacy pre-loaded ratings array (no longer used by storage; kept\n * to preserve the input shape used by existing call sites like\n * MessageItemComponent).\n */\n @Input() ratingsData?: RatingJSON[];\n\n currentUserRating: number | null = null;\n currentUserComments: string = '';\n isSaving = false;\n\n constructor(\n private cdr: ChangeDetectorRef,\n private dialogService: DialogService\n ) {\n super();\n }\n\n async ngOnInit() {\n await this.loadRating();\n }\n\n async OpenRatingDialog(): Promise<void> {\n if (this.isSaving) return;\n if (!this.canEdit) return;\n\n let consentAcknowledged = false;\n try {\n await UserInfoEngine.Instance.Config();\n consentAcknowledged = UserInfoEngine.Instance.GetSetting(FEEDBACK_CONSENT_KEY) === 'true';\n } catch (e) {\n console.warn('[Rating] Could not read consent flag, will require acknowledgement', e);\n }\n\n const result = await this.dialogService.rating({\n title: this.currentUserRating != null ? 'Edit your rating' : 'Rate this response',\n message: 'Rate the response on a 1-10 scale and (optionally) describe what was good or bad.',\n initialRating: this.currentUserRating,\n initialComments: this.currentUserComments,\n okText: 'Submit',\n requireConsent: !consentAcknowledged\n });\n\n if (result == null) return;\n\n const conversationID = await this.saveRating(result.rating, result.comments);\n\n if (result.consentNewlyAcknowledged) {\n try {\n const saved = await UserInfoEngine.Instance.SetSetting(FEEDBACK_CONSENT_KEY, 'true');\n if (!saved) {\n console.error(\n `[Rating] Failed to persist consent acknowledgement under key \"${FEEDBACK_CONSENT_KEY}\" — ` +\n `the dialog will re-prompt on next rating. Likely cause: the current user lacks ` +\n `create/update permission on the \"MJ: User Settings\" entity.`\n );\n }\n } catch (e) {\n console.error('[Rating] Could not persist consent flag', e);\n }\n }\n\n if (conversationID) {\n await this.grantConversationAccess(conversationID);\n }\n }\n\n /**\n * Grants the Integrations and Developer roles View access to the parent\n * Conversation via `MJ: Resource Permissions`. Idempotent — existing\n * permissions for the same role are not duplicated. Best-effort; any error\n * is logged but does not roll back the rating itself.\n */\n private async grantConversationAccess(conversationID: string): Promise<void> {\n try {\n const md = this.ProviderToUse;\n const rv = RunView.FromMetadataProvider(md);\n const existing = await rv.RunView({\n EntityName: 'MJ: Resource Permissions',\n ExtraFilter:\n `ResourceTypeID='${CONVERSATIONS_RESOURCE_TYPE_ID}' AND ` +\n `ResourceRecordID='${conversationID}' AND Type='Role' AND ` +\n `RoleID IN ('${FEEDBACK_ROLE_IDS.join(\"','\")}')`\n });\n\n const granted = new Set<string>(\n (existing.Results || []).map((r: any) => (r.RoleID || '').toLowerCase())\n );\n\n for (const roleID of FEEDBACK_ROLE_IDS) {\n if (granted.has(roleID.toLowerCase())) continue;\n const perm = await md.GetEntityObject('MJ: Resource Permissions');\n perm.NewRecord();\n perm.Set('ResourceTypeID', CONVERSATIONS_RESOURCE_TYPE_ID);\n perm.Set('ResourceRecordID', conversationID);\n perm.Set('Type', 'Role');\n perm.Set('RoleID', roleID);\n perm.Set('PermissionLevel', 'View');\n perm.Set('Status', 'Approved');\n const ok = await perm.Save();\n if (!ok) {\n console.warn('[Rating] Failed to create ResourcePermission for role', roleID, (perm as any).LatestResult);\n }\n }\n } catch (e) {\n console.warn('[Rating] grantConversationAccess failed:', e);\n }\n }\n\n private async loadRating(): Promise<void> {\n if (!this.conversationDetailId) return;\n try {\n const md = this.ProviderToUse;\n const entity = (await md.GetEntityObject(this.ratingEntityName)) as LoadableEntity;\n const loaded = await entity.Load(this.conversationDetailId);\n if (loaded) {\n const rating = entity.Get(this.ratingField);\n this.currentUserRating = rating != null ? Number(rating) : null;\n this.currentUserComments = (entity.Get(this.ratingCommentField) ?? '') as string;\n this.cdr.detectChanges();\n }\n } catch (error) {\n // Silently swallow — message may not be persisted yet, or entity lookup failed.\n console.warn('[ConversationMessageRating] Could not load existing rating:', error);\n }\n }\n\n private async saveRating(rating: number, comments: string): Promise<string | null> {\n if (this.isSaving) return null;\n if (rating < 1 || rating > 10) return null;\n if (!this.conversationDetailId) return null;\n\n const prevRating = this.currentUserRating;\n const prevComments = this.currentUserComments;\n\n this.isSaving = true;\n this.currentUserRating = rating;\n this.currentUserComments = comments;\n this.cdr.detectChanges();\n\n try {\n const md = this.ProviderToUse;\n const entity = (await md.GetEntityObject(this.ratingEntityName)) as LoadableEntity;\n const loaded = await entity.Load(this.conversationDetailId);\n if (!loaded) {\n throw new Error(`ConversationDetail ${this.conversationDetailId} not found in ${this.ratingEntityName}`);\n }\n entity.Set(this.ratingField, rating);\n entity.Set(this.ratingCommentField, comments || null);\n const saveResult = await entity.Save();\n if (!saveResult) {\n throw new Error(`Save failed: ${(entity as any).LatestResult?.Message ?? 'unknown'}`);\n }\n const conversationID = entity.Get('ConversationID');\n return typeof conversationID === 'string' ? conversationID : null;\n } catch (error) {\n console.error('[Rating] save failed:', error);\n this.currentUserRating = prevRating;\n this.currentUserComments = prevComments;\n this.cdr.detectChanges();\n return null;\n } finally {\n this.isSaving = false;\n this.cdr.detectChanges();\n }\n }\n}\n"]}
|
|
1
|
+
{"version":3,"file":"conversation-message-rating.component.js","sourceRoot":"","sources":["../../../../src/lib/components/message/conversation-message-rating.component.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,KAAK,EAA6B,MAAM,eAAe,CAAC;AAC5E,OAAO,EAAE,oBAAoB,EAAE,MAAM,+BAA+B,CAAC;AACrE,OAAO,EAA4B,OAAO,EAAY,MAAM,sBAAsB,CAAC;AACnF,OAAO,EAAc,cAAc,EAAE,MAAM,+BAA+B,CAAC;;;;IA0C7D,uBAAyC;IACzC,+BAAwB;IAAA,YAAqC;IAAA,iBAAO;;;IAA5C,eAAqC;IAArC,qEAAqC;;;IAE7D,uBAA0C;IAC1C,4BAAM;IAAA,6BAAa;IAAA,iBAAO;;;;IAZ9B,iCAMgB;IAFd,sMAAS,yBAAkB,KAAC;IAM1B,AAHF,wGAAiC,kFAGxB;IAIX,iBAAS;;;IAZP,6DAA6C;IAG7C,AAFA,0CAAqB,uFAE0D;IAE/E,cAM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EI,kCAAkC;cA/F9C,SAAS;6BACI,KAAK,YACP,gCAAgC,YAChC;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4BT;;kBAiEA,KAAK;;kBAGL,KAAK;;kBAOL,KAAK;;kBAGL,KAAK;;kBAcL,KAAK;;kBAOL,KAAK;;kBAGL,KAAK;;kBASL,KAAK;;kBAGL,KAAK;;kBASL,KAAK;;kBAGL,KAAK;;kBAaL,KAAK;;kBAGL,KAAK;;kFA9EK,kCAAkC","sourcesContent":["import { Component, Input, OnInit, ChangeDetectorRef } from '@angular/core';\nimport { BaseAngularComponent } from '@memberjunction/ng-base-types';\nimport { BaseEntity, CompositeKey, RunView, UserInfo } from '@memberjunction/core';\nimport { RatingJSON, UserInfoEngine } from '@memberjunction/core-entities';\nimport { DialogService } from '../../services/dialog.service';\n\nconst FEEDBACK_CONSENT_KEY = 'agent-feedback-share-consent';\nconst CONVERSATIONS_RESOURCE_TYPE_ID = '81D4BC3D-9FEB-EF11-B01A-286B35C04427';\nconst FEEDBACK_ROLE_IDS = [\n 'deafccec-6a37-ef11-86d4-000d3a4e707e', // Developer\n 'dfafccec-6a37-ef11-86d4-000d3a4e707e' // Integration\n];\n\n/** Minimal shape we use against the loaded entity. All MJ entity subclasses\n * implement `Load(ID)` via codegen but the base `BaseEntity<unknown>` type\n * doesn't expose it, so we narrow here to keep the call generic across\n * entity names without resorting to `any`. */\ntype LoadableEntity = BaseEntity<unknown> & {\n Load(KeyValuePairs: CompositeKey | string, EntityRelationshipsToLoad?: string[]): Promise<boolean>;\n};\n\n/**\n * Single-rating-per-message rating UI for an AI conversation response.\n *\n * Storage model: the rating + free-form comment live directly on the\n * ConversationDetail row, in `UserRating` (1-10, nullable) and `UserFeedback`\n * (nvarchar(max), nullable). This matches MJ's own pattern on\n * `__mj.ConversationDetail` and Skip's matching columns on\n * `Skip.ConversationDetail`. The host app picks the entity via @Input.\n */\n@Component({\n standalone: false,\n selector: 'mj-conversation-message-rating',\n template: `\n <div class=\"rating-container\">\n <div class=\"user-rating\">\n @if (canEdit) {\n <button\n class=\"rating-button\"\n [class.has-rated]=\"currentUserRating != null\"\n [disabled]=\"isSaving\"\n (click)=\"OpenRatingDialog()\"\n [title]=\"currentUserRating != null ? 'Edit your rating' : 'Rate this response'\"\n type=\"button\">\n @if (currentUserRating != null) {\n <i class=\"fa-solid fa-pen-to-square\"></i>\n <span class=\"my-rating\">My rating: {{ currentUserRating }}/10</span>\n } @else {\n <i class=\"fa-regular fa-comment-dots\"></i>\n <span>Rate response</span>\n }\n </button>\n } @else if (currentUserRating != null) {\n <span class=\"rating-readonly\"\n title=\"Rating left by the conversation owner — read-only\">\n <i class=\"fa-solid fa-comment-dots\"></i>\n <span>Rated {{ currentUserRating }}/10</span>\n </span>\n }\n </div>\n </div>\n `,\n styles: [`\n .rating-container {\n display: flex;\n align-items: center;\n gap: 12px;\n padding: 4px 0;\n }\n\n .user-rating {\n display: flex;\n gap: 4px;\n margin-left: auto;\n }\n\n .rating-button {\n display: inline-flex;\n align-items: center;\n gap: 6px;\n background: var(--mj-bg-surface);\n border: 1px solid var(--mj-border-strong);\n border-radius: 6px;\n padding: 6px 12px;\n cursor: pointer;\n font-size: 13px;\n color: var(--mj-text-primary);\n opacity: 0.85;\n transition: all 0.15s ease;\n }\n\n .rating-button:hover:not(:disabled) {\n opacity: 1;\n border-color: var(--mj-brand-primary);\n background: color-mix(in srgb, var(--mj-brand-primary) 6%, var(--mj-bg-surface));\n }\n\n .rating-button:disabled {\n cursor: not-allowed;\n opacity: 0.5;\n }\n\n .rating-button.has-rated {\n border-color: var(--mj-brand-primary);\n background: color-mix(in srgb, var(--mj-brand-primary) 10%, var(--mj-bg-surface));\n }\n\n .my-rating {\n font-weight: 500;\n }\n\n .rating-readonly {\n display: inline-flex;\n align-items: center;\n gap: 6px;\n padding: 4px 10px;\n border: 1px solid var(--mj-border-default);\n border-radius: 6px;\n font-size: 12px;\n color: var(--mj-text-secondary);\n background: var(--mj-bg-surface-sunken);\n cursor: default;\n }\n `]\n})\nexport class ConversationMessageRatingComponent extends BaseAngularComponent implements OnInit {\n @Input() ConversationDetailId!: string;\n\n /** @deprecated Use {@link ConversationDetailId}. */\n @Input() set conversationDetailId(value: string) {\n this.ConversationDetailId = value;\n }\n /** @deprecated Use {@link ConversationDetailId}. */\n get conversationDetailId(): string {\n return this.ConversationDetailId;\n }\n @Input() CurrentUser!: UserInfo;\n\n /** @deprecated Use {@link CurrentUser}. */\n @Input() set currentUser(value: UserInfo) {\n this.CurrentUser = value;\n }\n /** @deprecated Use {@link CurrentUser}. */\n get currentUser(): UserInfo {\n return this.CurrentUser;\n }\n\n /**\n * When false, the rating UI renders as a read-only badge instead of an editable\n * button. Set by the parent (MessageItemComponent) to `false` when the current\n * user is not the conversation owner — the rating storage is a single field on\n * the ConversationDetail row, so only the owner is allowed to mutate it.\n */\n @Input() canEdit: boolean = true;\n\n /**\n * Entity name to load/update for the rating. Defaults to MJ's\n * `MJ: Conversation Details` (which has `UserRating`/`UserFeedback`).\n * Skip-Brain hosts pass `'Conversation Details__Skip'`.\n */\n @Input() RatingEntityName: string = 'MJ: Conversation Details';\n\n /** @deprecated Use {@link RatingEntityName}. */\n @Input() set ratingEntityName(value: string) {\n this.RatingEntityName = value;\n }\n /** @deprecated Use {@link RatingEntityName}. */\n get ratingEntityName(): string {\n return this.RatingEntityName;\n }\n\n /** Column on the entity that stores the 1-10 rating. */\n @Input() RatingField: string = 'UserRating';\n\n /** @deprecated Use {@link RatingField}. */\n @Input() set ratingField(value: string) {\n this.RatingField = value;\n }\n /** @deprecated Use {@link RatingField}. */\n get ratingField(): string {\n return this.RatingField;\n }\n\n /** Column on the entity that stores the free-form feedback. */\n @Input() RatingCommentField: string = 'UserFeedback';\n\n /** @deprecated Use {@link RatingCommentField}. */\n @Input() set ratingCommentField(value: string) {\n this.RatingCommentField = value;\n }\n /** @deprecated Use {@link RatingCommentField}. */\n get ratingCommentField(): string {\n return this.RatingCommentField;\n }\n\n /**\n * Optional: legacy pre-loaded ratings array (no longer used by storage; kept\n * to preserve the input shape used by existing call sites like\n * MessageItemComponent).\n */\n @Input() RatingsData?: RatingJSON[];\n\n /** @deprecated Use {@link RatingsData}. */\n @Input() set ratingsData(value: RatingJSON[] | undefined) {\n this.RatingsData = value;\n }\n /** @deprecated Use {@link RatingsData}. */\n get ratingsData(): RatingJSON[] | undefined {\n return this.RatingsData;\n }\n\n CurrentUserRating: number | null = null;\n\n /** @deprecated Use {@link CurrentUserRating}. */\n get currentUserRating(): number | null {\n return this.CurrentUserRating;\n }\n /** @deprecated Use {@link CurrentUserRating}. */\n set currentUserRating(value: number | null) {\n this.CurrentUserRating = value;\n }\n CurrentUserComments: string = '';\n\n /** @deprecated Use {@link CurrentUserComments}. */\n get currentUserComments(): string {\n return this.CurrentUserComments;\n }\n /** @deprecated Use {@link CurrentUserComments}. */\n set currentUserComments(value: string) {\n this.CurrentUserComments = value;\n }\n IsSaving = false;\n\n /** @deprecated Use {@link IsSaving}. */\n get isSaving() {\n return this.IsSaving;\n }\n /** @deprecated Use {@link IsSaving}. */\n set isSaving(value) {\n this.IsSaving = value;\n }\n\n constructor(\n private cdr: ChangeDetectorRef,\n private dialogService: DialogService\n ) {\n super();\n }\n\n async ngOnInit() {\n await this.loadRating();\n }\n\n async OpenRatingDialog(): Promise<void> {\n if (this.IsSaving) return;\n if (!this.canEdit) return;\n\n let consentAcknowledged = false;\n try {\n await UserInfoEngine.Instance.Config();\n consentAcknowledged = UserInfoEngine.Instance.GetSetting(FEEDBACK_CONSENT_KEY) === 'true';\n } catch (e) {\n console.warn('[Rating] Could not read consent flag, will require acknowledgement', e);\n }\n\n const result = await this.dialogService.rating({\n title: this.CurrentUserRating != null ? 'Edit your rating' : 'Rate this response',\n message: 'Rate the response on a 1-10 scale and (optionally) describe what was good or bad.',\n initialRating: this.CurrentUserRating,\n initialComments: this.CurrentUserComments,\n okText: 'Submit',\n requireConsent: !consentAcknowledged\n });\n\n if (result == null) return;\n\n const conversationID = await this.saveRating(result.rating, result.comments);\n\n if (result.consentNewlyAcknowledged) {\n try {\n const saved = await UserInfoEngine.Instance.SetSetting(FEEDBACK_CONSENT_KEY, 'true');\n if (!saved) {\n console.error(\n `[Rating] Failed to persist consent acknowledgement under key \"${FEEDBACK_CONSENT_KEY}\" — ` +\n `the dialog will re-prompt on next rating. Likely cause: the current user lacks ` +\n `create/update permission on the \"MJ: User Settings\" entity.`\n );\n }\n } catch (e) {\n console.error('[Rating] Could not persist consent flag', e);\n }\n }\n\n if (conversationID) {\n await this.grantConversationAccess(conversationID);\n }\n }\n\n /**\n * Grants the Integrations and Developer roles View access to the parent\n * Conversation via `MJ: Resource Permissions`. Idempotent — existing\n * permissions for the same role are not duplicated. Best-effort; any error\n * is logged but does not roll back the rating itself.\n */\n private async grantConversationAccess(conversationID: string): Promise<void> {\n try {\n const md = this.ProviderToUse;\n const rv = RunView.FromMetadataProvider(md);\n const existing = await rv.RunView({\n EntityName: 'MJ: Resource Permissions',\n ExtraFilter:\n `ResourceTypeID='${CONVERSATIONS_RESOURCE_TYPE_ID}' AND ` +\n `ResourceRecordID='${conversationID}' AND Type='Role' AND ` +\n `RoleID IN ('${FEEDBACK_ROLE_IDS.join(\"','\")}')`\n });\n\n const granted = new Set<string>(\n (existing.Results || []).map((r: any) => (r.RoleID || '').toLowerCase())\n );\n\n for (const roleID of FEEDBACK_ROLE_IDS) {\n if (granted.has(roleID.toLowerCase())) continue;\n const perm = await md.GetEntityObject('MJ: Resource Permissions');\n perm.NewRecord();\n perm.Set('ResourceTypeID', CONVERSATIONS_RESOURCE_TYPE_ID);\n perm.Set('ResourceRecordID', conversationID);\n perm.Set('Type', 'Role');\n perm.Set('RoleID', roleID);\n perm.Set('PermissionLevel', 'View');\n perm.Set('Status', 'Approved');\n const ok = await perm.Save();\n if (!ok) {\n console.warn('[Rating] Failed to create ResourcePermission for role', roleID, (perm as any).LatestResult);\n }\n }\n } catch (e) {\n console.warn('[Rating] grantConversationAccess failed:', e);\n }\n }\n\n private async loadRating(): Promise<void> {\n if (!this.ConversationDetailId) return;\n try {\n const md = this.ProviderToUse;\n const entity = (await md.GetEntityObject(this.RatingEntityName)) as LoadableEntity;\n const loaded = await entity.Load(this.ConversationDetailId);\n if (loaded) {\n const rating = entity.Get(this.RatingField);\n this.CurrentUserRating = rating != null ? Number(rating) : null;\n this.CurrentUserComments = (entity.Get(this.RatingCommentField) ?? '') as string;\n this.cdr.detectChanges();\n }\n } catch (error) {\n // Silently swallow — message may not be persisted yet, or entity lookup failed.\n console.warn('[ConversationMessageRating] Could not load existing rating:', error);\n }\n }\n\n private async saveRating(rating: number, comments: string): Promise<string | null> {\n if (this.IsSaving) return null;\n if (rating < 1 || rating > 10) return null;\n if (!this.ConversationDetailId) return null;\n\n const prevRating = this.CurrentUserRating;\n const prevComments = this.CurrentUserComments;\n\n this.IsSaving = true;\n this.CurrentUserRating = rating;\n this.CurrentUserComments = comments;\n this.cdr.detectChanges();\n\n try {\n const md = this.ProviderToUse;\n const entity = (await md.GetEntityObject(this.RatingEntityName)) as LoadableEntity;\n const loaded = await entity.Load(this.ConversationDetailId);\n if (!loaded) {\n throw new Error(`ConversationDetail ${this.ConversationDetailId} not found in ${this.RatingEntityName}`);\n }\n entity.Set(this.RatingField, rating);\n entity.Set(this.RatingCommentField, comments || null);\n const saveResult = await entity.Save();\n if (!saveResult) {\n throw new Error(`Save failed: ${(entity as any).LatestResult?.Message ?? 'unknown'}`);\n }\n const conversationID = entity.Get('ConversationID');\n return typeof conversationID === 'string' ? conversationID : null;\n } catch (error) {\n console.error('[Rating] save failed:', error);\n this.CurrentUserRating = prevRating;\n this.CurrentUserComments = prevComments;\n this.cdr.detectChanges();\n return null;\n } finally {\n this.IsSaving = false;\n this.cdr.detectChanges();\n }\n }\n}\n"]}
|