@memberjunction/ng-conversations 5.35.0 → 5.37.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (42) hide show
  1. package/dist/lib/components/conversation/conversation-chat-area.component.d.ts +62 -2
  2. package/dist/lib/components/conversation/conversation-chat-area.component.d.ts.map +1 -1
  3. package/dist/lib/components/conversation/conversation-chat-area.component.js +300 -24
  4. package/dist/lib/components/conversation/conversation-chat-area.component.js.map +1 -1
  5. package/dist/lib/components/dialogs/rating-dialog.component.d.ts +31 -0
  6. package/dist/lib/components/dialogs/rating-dialog.component.d.ts.map +1 -0
  7. package/dist/lib/components/dialogs/rating-dialog.component.js +290 -0
  8. package/dist/lib/components/dialogs/rating-dialog.component.js.map +1 -0
  9. package/dist/lib/components/mention/mention-editor.component.d.ts +1 -1
  10. package/dist/lib/components/mention/mention-editor.component.d.ts.map +1 -1
  11. package/dist/lib/components/mention/mention-editor.component.js +1 -0
  12. package/dist/lib/components/mention/mention-editor.component.js.map +1 -1
  13. package/dist/lib/components/message/conversation-message-rating.component.d.ts +43 -18
  14. package/dist/lib/components/message/conversation-message-rating.component.d.ts.map +1 -1
  15. package/dist/lib/components/message/conversation-message-rating.component.js +235 -193
  16. package/dist/lib/components/message/conversation-message-rating.component.js.map +1 -1
  17. package/dist/lib/components/message/message-input-box.component.d.ts +1 -1
  18. package/dist/lib/components/message/message-input-box.component.d.ts.map +1 -1
  19. package/dist/lib/components/message/message-input-box.component.js +1 -1
  20. package/dist/lib/components/message/message-input-box.component.js.map +1 -1
  21. package/dist/lib/components/message/message-input.component.d.ts +7 -1
  22. package/dist/lib/components/message/message-input.component.d.ts.map +1 -1
  23. package/dist/lib/components/message/message-input.component.js +28 -3
  24. package/dist/lib/components/message/message-input.component.js.map +1 -1
  25. package/dist/lib/components/message/message-item.component.js +20 -20
  26. package/dist/lib/components/message/message-item.component.js.map +1 -1
  27. package/dist/lib/components/overlay/chat-overlay.component.d.ts +73 -5
  28. package/dist/lib/components/overlay/chat-overlay.component.d.ts.map +1 -1
  29. package/dist/lib/components/overlay/chat-overlay.component.js +202 -37
  30. package/dist/lib/components/overlay/chat-overlay.component.js.map +1 -1
  31. package/dist/lib/conversations.module.d.ts +24 -23
  32. package/dist/lib/conversations.module.d.ts.map +1 -1
  33. package/dist/lib/conversations.module.js +4 -0
  34. package/dist/lib/conversations.module.js.map +1 -1
  35. package/dist/lib/services/data-cache.service.d.ts.map +1 -1
  36. package/dist/lib/services/data-cache.service.js +0 -1
  37. package/dist/lib/services/data-cache.service.js.map +1 -1
  38. package/dist/lib/services/dialog.service.d.ts +24 -0
  39. package/dist/lib/services/dialog.service.d.ts.map +1 -1
  40. package/dist/lib/services/dialog.service.js +45 -0
  41. package/dist/lib/services/dialog.service.js.map +1 -1
  42. package/package.json +22 -22
@@ -1 +1 @@
1
- {"version":3,"file":"dialog.service.js","sourceRoot":"","sources":["../../../src/lib/services/dialog.service.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAG3C,OAAO,EAAE,oBAAoB,EAAE,MAAM,8CAA8C,CAAC;;;AAgCpF;;;GAGG;AAIH,MAAM,OAAO,aAAa;IACJ;IAApB,YAAoB,eAAgC;QAAhC,oBAAe,GAAf,eAAe,CAAiB;IAAG,CAAC;IAExD;;;OAGG;IACH,OAAO,CAAC,OAA6B;QACnC,OAAO,IAAI,OAAO,CAAC,CAAC,OAAO,EAAE,EAAE;YAC7B,MAAM,SAAS,GAAG,IAAI,CAAC,eAAe,CAAC,IAAI,CAAC;gBAC1C,KAAK,EAAE,OAAO,CAAC,KAAK;gBACpB,OAAO,EAAE,OAAO,CAAC,OAAO;gBACxB,OAAO,EAAE;oBACP;wBACE,IAAI,EAAE,OAAO,CAAC,MAAM,IAAI,IAAI;wBAC5B,OAAO,EAAE,IAAI;wBACb,UAAU,EAAE,OAAO,CAAC,SAAS,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CA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C,CAAC,CAAC;QAEJ,MAAM,SAAS,GAAG,IAAI,CAAC,eAAe,CAAC,IAAI,CAAC;YAC1C,KAAK,EAAE,KAAK;YACZ,OAAO,EAAE,OAAO;YAChB,OAAO,EAAE,OAAO;YAChB,KAAK,EAAE,KAAK;YACZ,QAAQ,EAAE,GAAG;SACd,CAAC,CAAC;QAEH,SAAS,CAAC,MAAM,CAAC,SAAS,CAAC,CAAC,MAAM,EAAE,EAAE;YACpC,MAAM,MAAM,GAAG,MAAoC,CAAC;YACpD,IAAI,MAAM,IAAI,MAAM,IAAI,MAAM,EAAE,CAAC;gBAC/B,MAAM,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,IAAI,KAAK,MAAM,CAAC,IAAI,CAAC,CAAC;gBACzD,IAAI,MAAM,IAAI,MAAM,CAAC,MAAM,EAAE,CAAC;oBAC5B,MAAM,CAAC,MAAM,EAAE,CAAC;gBAClB,CAAC;YACH,CAAC;QACH,CAAC,CAAC,CAAC;QAEH,OAAO,SAAS,CAAC;IACnB,CAAC;uGAnKU,aAAa;gEAAb,aAAa,WAAb,aAAa,mBAFZ,MAAM;;iFAEP,aAAa;cAHzB,UAAU;eAAC;gBACV,UAAU,EAAE,MAAM;aACnB","sourcesContent":["import { Injectable } from '@angular/core';\nimport { MJDialogService, MJDialogRef, MJDialogAction } from '@memberjunction/ng-ui-components';\nimport { Observable } from 'rxjs';\nimport { InputDialogComponent } from '../components/dialogs/input-dialog.component';\n\nexport interface DialogButton {\n text: string;\n primary?: boolean;\n action: () => void;\n}\n\nexport interface InputDialogOptions {\n title: string;\n message: string;\n inputLabel: string;\n inputValue?: string;\n inputType?: 'text' | 'textarea' | 'number' | 'email';\n placeholder?: string;\n required?: boolean;\n secondInputLabel?: string;\n secondInputValue?: string;\n secondInputPlaceholder?: string;\n secondInputRequired?: boolean;\n okText?: string;\n cancelText?: string;\n}\n\nexport interface ConfirmDialogOptions {\n title: string;\n message: string;\n okText?: string;\n cancelText?: string;\n dangerous?: boolean;\n}\n\n/**\n * Dialog service for displaying MJ dialogs.\n * Replaces browser alert() and confirm() with proper UI components.\n */\n@Injectable({\n providedIn: 'root'\n})\nexport class DialogService {\n constructor(private mjDialogService: MJDialogService) {}\n\n /**\n * Show a confirmation dialog\n * @returns Promise<boolean> - true if user clicked OK, false if cancelled\n */\n confirm(options: ConfirmDialogOptions): Promise<boolean> {\n return new Promise((resolve) => {\n const dialogRef = this.mjDialogService.open({\n title: options.title,\n content: options.message,\n actions: [\n {\n text: options.okText || 'OK',\n primary: true,\n themeColor: options.dangerous ? 'error' : 'primary'\n },\n {\n text: options.cancelText || 'Cancel',\n primary: false\n }\n ],\n width: 450,\n minWidth: 250\n });\n\n dialogRef.Result.subscribe((result) => {\n const action = result as MJDialogAction | undefined;\n if (action && 'text' in action) {\n resolve(action.text === (options.okText || 'OK'));\n } else {\n resolve(false);\n }\n });\n });\n }\n\n /**\n * Show an alert dialog\n */\n alert(title: string, message: string, okText: string = 'OK'): Promise<void> {\n return new Promise((resolve) => {\n const dialogRef = this.mjDialogService.open({\n title: title,\n content: message,\n actions: [\n {\n text: okText,\n primary: true\n }\n ],\n width: 450,\n minWidth: 250\n });\n\n dialogRef.Result.subscribe(() => {\n resolve();\n });\n });\n }\n\n /**\n * Show an input dialog\n * @returns Promise<string | {value: string; secondValue?: string} | null> -\n * If single input: returns string\n * If dual input: returns object with both values\n * Returns null if cancelled\n */\n input(options: InputDialogOptions): Promise<string | {value: string; secondValue?: string} | null> {\n return new Promise((resolve) => {\n const dialogRef = this.mjDialogService.open({\n title: options.title,\n content: InputDialogComponent,\n actions: [\n {\n text: options.okText || 'OK',\n primary: true\n },\n {\n text: options.cancelText || 'Cancel',\n primary: false\n }\n ],\n width: 500,\n minWidth: 300\n });\n\n // Pass data to the component\n const componentInstance = dialogRef.Content!.instance as unknown as InputDialogComponent;\n componentInstance.message = options.message;\n componentInstance.inputLabel = options.inputLabel;\n componentInstance.inputType = options.inputType || 'text';\n componentInstance.placeholder = options.placeholder || '';\n componentInstance.required = options.required || false;\n componentInstance.value = options.inputValue || '';\n componentInstance.secondInputLabel = options.secondInputLabel || '';\n componentInstance.secondInputPlaceholder = options.secondInputPlaceholder || '';\n componentInstance.secondInputRequired = options.secondInputRequired || false;\n componentInstance.secondValue = options.secondInputValue || '';\n\n // Focus and select input after dialog opens\n setTimeout(() => {\n const inputElement = document.querySelector('.mj-dialog-body input, .mj-dialog-body textarea') as HTMLInputElement | HTMLTextAreaElement;\n if (inputElement) {\n inputElement.focus();\n inputElement.select();\n }\n }, 100);\n\n dialogRef.Result.subscribe((result) => {\n const action = result as MJDialogAction | undefined;\n if (action && 'text' in action && action.text === (options.okText || 'OK')) {\n const value = componentInstance.getValue();\n if (options.required && !value) {\n resolve(null);\n } else {\n // If second input is present, return object with both values\n if (options.secondInputLabel) {\n resolve({\n value: value,\n secondValue: componentInstance.getSecondValue()\n });\n } else {\n // Single input - return string for backward compatibility\n resolve(value);\n }\n }\n } else {\n resolve(null);\n }\n });\n });\n }\n\n /**\n * Show a custom dialog with custom content and actions\n */\n custom(title: string, content: string, buttons: DialogButton[], width: number = 500): MJDialogRef {\n const actions = buttons.map(btn => ({\n text: btn.text,\n primary: btn.primary || false\n }));\n\n const dialogRef = this.mjDialogService.open({\n title: title,\n content: content,\n actions: actions,\n width: width,\n minWidth: 300\n });\n\n dialogRef.Result.subscribe((result) => {\n const action = result as MJDialogAction | undefined;\n if (action && 'text' in action) {\n const button = buttons.find(b => b.text === action.text);\n if (button && button.action) {\n button.action();\n }\n }\n });\n\n return dialogRef;\n }\n}\n"]}
1
+ {"version":3,"file":"dialog.service.js","sourceRoot":"","sources":["../../../src/lib/services/dialog.service.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAG3C,OAAO,EAAE,oBAAoB,EAAE,MAAM,8CAA8C,CAAC;AACpF,OAAO,EAAE,qBAAqB,EAAE,MAAM,+CAA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ACpD,IAAI,MAAM,IAAI,MAAM,IAAI,MAAM,EAAE,CAAC;gBAC/B,MAAM,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,IAAI,KAAK,MAAM,CAAC,IAAI,CAAC,CAAC;gBACzD,IAAI,MAAM,IAAI,MAAM,CAAC,MAAM,EAAE,CAAC;oBAC5B,MAAM,CAAC,MAAM,EAAE,CAAC;gBAClB,CAAC;YACH,CAAC;QACH,CAAC,CAAC,CAAC;QAEH,OAAO,SAAS,CAAC;IACnB,CAAC;uGAjNU,aAAa;gEAAb,aAAa,WAAb,aAAa,mBAFZ,MAAM;;iFAEP,aAAa;cAHzB,UAAU;eAAC;gBACV,UAAU,EAAE,MAAM;aACnB","sourcesContent":["import { Injectable } from '@angular/core';\nimport { MJDialogService, MJDialogRef, MJDialogAction } from '@memberjunction/ng-ui-components';\nimport { Observable } from 'rxjs';\nimport { InputDialogComponent } from '../components/dialogs/input-dialog.component';\nimport { RatingDialogComponent } from '../components/dialogs/rating-dialog.component';\n\nexport interface DialogButton {\n text: string;\n primary?: boolean;\n action: () => void;\n}\n\nexport interface InputDialogOptions {\n title: string;\n message: string;\n inputLabel: string;\n inputValue?: string;\n inputType?: 'text' | 'textarea' | 'number' | 'email';\n placeholder?: string;\n required?: boolean;\n secondInputLabel?: string;\n secondInputValue?: string;\n secondInputPlaceholder?: string;\n secondInputRequired?: boolean;\n okText?: string;\n cancelText?: string;\n}\n\nexport interface ConfirmDialogOptions {\n title: string;\n message: string;\n okText?: string;\n cancelText?: string;\n dangerous?: boolean;\n}\n\nexport interface RatingDialogOptions {\n title?: string;\n message?: string;\n initialRating?: number | null;\n initialComments?: string;\n okText?: string;\n cancelText?: string;\n /** When true, the rating dialog shows a consent checkbox the user must\n * accept before submitting (first-time-only authorization). */\n requireConsent?: boolean;\n}\n\nexport interface RatingDialogResult {\n rating: number;\n comments: string;\n /** True only when the user *just* acknowledged consent in this dialog —\n * i.e. `requireConsent` was true and they checked the box. The caller\n * should persist the acknowledgement so consent isn't requested again. */\n consentNewlyAcknowledged: boolean;\n}\n\n/**\n * Dialog service for displaying MJ dialogs.\n * Replaces browser alert() and confirm() with proper UI components.\n */\n@Injectable({\n providedIn: 'root'\n})\nexport class DialogService {\n constructor(private mjDialogService: MJDialogService) {}\n\n /**\n * Show a confirmation dialog\n * @returns Promise<boolean> - true if user clicked OK, false if cancelled\n */\n confirm(options: ConfirmDialogOptions): Promise<boolean> {\n return new Promise((resolve) => {\n const dialogRef = this.mjDialogService.open({\n title: options.title,\n content: options.message,\n actions: [\n {\n text: options.okText || 'OK',\n primary: true,\n themeColor: options.dangerous ? 'error' : 'primary'\n },\n {\n text: options.cancelText || 'Cancel',\n primary: false\n }\n ],\n width: 450,\n minWidth: 250\n });\n\n dialogRef.Result.subscribe((result) => {\n const action = result as MJDialogAction | undefined;\n if (action && 'text' in action) {\n resolve(action.text === (options.okText || 'OK'));\n } else {\n resolve(false);\n }\n });\n });\n }\n\n /**\n * Show an alert dialog\n */\n alert(title: string, message: string, okText: string = 'OK'): Promise<void> {\n return new Promise((resolve) => {\n const dialogRef = this.mjDialogService.open({\n title: title,\n content: message,\n actions: [\n {\n text: okText,\n primary: true\n }\n ],\n width: 450,\n minWidth: 250\n });\n\n dialogRef.Result.subscribe(() => {\n resolve();\n });\n });\n }\n\n /**\n * Show an input dialog\n * @returns Promise<string | {value: string; secondValue?: string} | null> -\n * If single input: returns string\n * If dual input: returns object with both values\n * Returns null if cancelled\n */\n input(options: InputDialogOptions): Promise<string | {value: string; secondValue?: string} | null> {\n return new Promise((resolve) => {\n const dialogRef = this.mjDialogService.open({\n title: options.title,\n content: InputDialogComponent,\n actions: [\n {\n text: options.okText || 'OK',\n primary: true\n },\n {\n text: options.cancelText || 'Cancel',\n primary: false\n }\n ],\n width: 500,\n minWidth: 300\n });\n\n // Pass data to the component\n const componentInstance = dialogRef.Content!.instance as unknown as InputDialogComponent;\n componentInstance.message = options.message;\n componentInstance.inputLabel = options.inputLabel;\n componentInstance.inputType = options.inputType || 'text';\n componentInstance.placeholder = options.placeholder || '';\n componentInstance.required = options.required || false;\n componentInstance.value = options.inputValue || '';\n componentInstance.secondInputLabel = options.secondInputLabel || '';\n componentInstance.secondInputPlaceholder = options.secondInputPlaceholder || '';\n componentInstance.secondInputRequired = options.secondInputRequired || false;\n componentInstance.secondValue = options.secondInputValue || '';\n\n // Focus and select input after dialog opens\n setTimeout(() => {\n const inputElement = document.querySelector('.mj-dialog-body input, .mj-dialog-body textarea') as HTMLInputElement | HTMLTextAreaElement;\n if (inputElement) {\n inputElement.focus();\n inputElement.select();\n }\n }, 100);\n\n dialogRef.Result.subscribe((result) => {\n const action = result as MJDialogAction | undefined;\n if (action && 'text' in action && action.text === (options.okText || 'OK')) {\n const value = componentInstance.getValue();\n if (options.required && !value) {\n resolve(null);\n } else {\n // If second input is present, return object with both values\n if (options.secondInputLabel) {\n resolve({\n value: value,\n secondValue: componentInstance.getSecondValue()\n });\n } else {\n // Single input - return string for backward compatibility\n resolve(value);\n }\n }\n } else {\n resolve(null);\n }\n });\n });\n }\n\n /**\n * Show a rating dialog (1-10 + free-form comments).\n * @returns Promise<RatingDialogResult | null> — null if cancelled or no rating selected.\n */\n rating(options: RatingDialogOptions = {}): Promise<RatingDialogResult | null> {\n return new Promise((resolve) => {\n const okText = options.okText || 'Submit';\n const cancelText = options.cancelText || 'Cancel';\n\n const dialogRef = this.mjDialogService.open({\n title: options.title || 'Rate this response',\n content: RatingDialogComponent,\n actions: [\n { text: okText, primary: true },\n { text: cancelText, primary: false }\n ],\n width: 560,\n minWidth: 320\n });\n\n const componentInstance = dialogRef.Content!.instance as unknown as RatingDialogComponent;\n componentInstance.message = options.message ?? '';\n componentInstance.initialRating = options.initialRating ?? null;\n componentInstance.initialComments = options.initialComments ?? '';\n componentInstance.requireConsent = options.requireConsent ?? false;\n\n dialogRef.Result.subscribe((result) => {\n const action = result as MJDialogAction | undefined;\n if (action && 'text' in action && action.text === okText) {\n const rating = componentInstance.getRating();\n if (rating == null || !componentInstance.isConsentValid()) {\n resolve(null);\n } else {\n resolve({\n rating,\n comments: componentInstance.getComments(),\n consentNewlyAcknowledged: componentInstance.wasConsentNewlyAcknowledged()\n });\n }\n } else {\n resolve(null);\n }\n });\n });\n }\n\n /**\n * Show a custom dialog with custom content and actions\n */\n custom(title: string, content: string, buttons: DialogButton[], width: number = 500): MJDialogRef {\n const actions = buttons.map(btn => ({\n text: btn.text,\n primary: btn.primary || false\n }));\n\n const dialogRef = this.mjDialogService.open({\n title: title,\n content: content,\n actions: actions,\n width: width,\n minWidth: 300\n });\n\n dialogRef.Result.subscribe((result) => {\n const action = result as MJDialogAction | undefined;\n if (action && 'text' in action) {\n const button = buttons.find(b => b.text === action.text);\n if (button && button.action) {\n button.action();\n }\n }\n });\n\n return dialogRef;\n }\n}\n"]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@memberjunction/ng-conversations",
3
- "version": "5.35.0",
3
+ "version": "5.37.0",
4
4
  "description": "MemberJunction: Conversation, Collection, and Artifact management components for any Angular application",
5
5
  "main": "./dist/public-api.js",
6
6
  "typings": "./dist/public-api.d.ts",
@@ -29,29 +29,29 @@
29
29
  "@angular/router": "21.1.3"
30
30
  },
31
31
  "dependencies": {
32
- "@memberjunction/ng-ui-components": "5.35.0",
32
+ "@memberjunction/ng-ui-components": "5.37.0",
33
33
  "@angular/animations": "21.1.3",
34
34
  "@angular/cdk": "21.1.3",
35
- "@memberjunction/ai": "5.35.0",
36
- "@memberjunction/ai-agent-client": "5.35.0",
37
- "@memberjunction/ai-core-plus": "5.35.0",
38
- "@memberjunction/ai-engine-base": "5.35.0",
39
- "@memberjunction/ng-agent-client": "5.35.0",
40
- "@memberjunction/core": "5.35.0",
41
- "@memberjunction/core-entities": "5.35.0",
42
- "@memberjunction/global": "5.35.0",
43
- "@memberjunction/graphql-dataprovider": "5.35.0",
44
- "@memberjunction/ng-artifacts": "5.35.0",
45
- "@memberjunction/ng-base-types": "5.35.0",
46
- "@memberjunction/ng-code-editor": "5.35.0",
47
- "@memberjunction/ng-container-directives": "5.35.0",
48
- "@memberjunction/ng-forms": "5.35.0",
49
- "@memberjunction/ng-markdown": "5.35.0",
50
- "@memberjunction/ng-notifications": "5.35.0",
51
- "@memberjunction/ng-resource-permissions": "5.35.0",
52
- "@memberjunction/ng-shared-generic": "5.35.0",
53
- "@memberjunction/ng-tasks": "5.35.0",
54
- "@memberjunction/ng-testing": "5.35.0",
35
+ "@memberjunction/ai": "5.37.0",
36
+ "@memberjunction/ai-agent-client": "5.37.0",
37
+ "@memberjunction/ai-core-plus": "5.37.0",
38
+ "@memberjunction/ai-engine-base": "5.37.0",
39
+ "@memberjunction/ng-agent-client": "5.37.0",
40
+ "@memberjunction/core": "5.37.0",
41
+ "@memberjunction/core-entities": "5.37.0",
42
+ "@memberjunction/global": "5.37.0",
43
+ "@memberjunction/graphql-dataprovider": "5.37.0",
44
+ "@memberjunction/ng-artifacts": "5.37.0",
45
+ "@memberjunction/ng-base-types": "5.37.0",
46
+ "@memberjunction/ng-code-editor": "5.37.0",
47
+ "@memberjunction/ng-container-directives": "5.37.0",
48
+ "@memberjunction/ng-forms": "5.37.0",
49
+ "@memberjunction/ng-markdown": "5.37.0",
50
+ "@memberjunction/ng-notifications": "5.37.0",
51
+ "@memberjunction/ng-resource-permissions": "5.37.0",
52
+ "@memberjunction/ng-shared-generic": "5.37.0",
53
+ "@memberjunction/ng-tasks": "5.37.0",
54
+ "@memberjunction/ng-testing": "5.37.0",
55
55
  "rxjs": "^7.8.2",
56
56
  "tslib": "^2.8.1"
57
57
  },