@acorex/components 21.0.3-next.40 → 21.0.3-next.41

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 (106) hide show
  1. package/fesm2022/{acorex-components-conversation-open-composer-picker-for-files-Du8Lj9Sp.mjs → acorex-components-conversation-open-composer-picker-for-files-Duvap4M4.mjs} +2 -3
  2. package/fesm2022/{acorex-components-conversation-open-composer-picker-for-files-Du8Lj9Sp.mjs.map → acorex-components-conversation-open-composer-picker-for-files-Duvap4M4.mjs.map} +1 -1
  3. package/fesm2022/acorex-components-conversation.mjs +22456 -1
  4. package/fesm2022/acorex-components-conversation.mjs.map +1 -1
  5. package/package.json +3 -3
  6. package/types/acorex-components-conversation.d.ts +1228 -48
  7. package/fesm2022/acorex-components-conversation-acorex-components-conversation-YhVa42TC.mjs +0 -13711
  8. package/fesm2022/acorex-components-conversation-acorex-components-conversation-YhVa42TC.mjs.map +0 -1
  9. package/fesm2022/acorex-components-conversation-audio-attachment.component-CLvS3W8F.mjs +0 -119
  10. package/fesm2022/acorex-components-conversation-audio-attachment.component-CLvS3W8F.mjs.map +0 -1
  11. package/fesm2022/acorex-components-conversation-audio-composer.payload-BHQJNyXz.mjs +0 -59
  12. package/fesm2022/acorex-components-conversation-audio-composer.payload-BHQJNyXz.mjs.map +0 -1
  13. package/fesm2022/acorex-components-conversation-audio-picker.component-BD_fN2Ip.mjs +0 -432
  14. package/fesm2022/acorex-components-conversation-audio-picker.component-BD_fN2Ip.mjs.map +0 -1
  15. package/fesm2022/acorex-components-conversation-audio-renderer.component-CcxVVprx.mjs +0 -177
  16. package/fesm2022/acorex-components-conversation-audio-renderer.component-CcxVVprx.mjs.map +0 -1
  17. package/fesm2022/acorex-components-conversation-audio.payload-Bag4aTut.mjs +0 -54
  18. package/fesm2022/acorex-components-conversation-audio.payload-Bag4aTut.mjs.map +0 -1
  19. package/fesm2022/acorex-components-conversation-conversation-audio.file-type-CfGSVnMA.mjs +0 -100
  20. package/fesm2022/acorex-components-conversation-conversation-audio.file-type-CfGSVnMA.mjs.map +0 -1
  21. package/fesm2022/acorex-components-conversation-conversation-file.file-type-DB-2xhaC.mjs +0 -121
  22. package/fesm2022/acorex-components-conversation-conversation-file.file-type-DB-2xhaC.mjs.map +0 -1
  23. package/fesm2022/acorex-components-conversation-conversation-image.file-type-C02OzZZB.mjs +0 -84
  24. package/fesm2022/acorex-components-conversation-conversation-image.file-type-C02OzZZB.mjs.map +0 -1
  25. package/fesm2022/acorex-components-conversation-conversation-info-media-view.component-Mhk7JE6K.mjs +0 -238
  26. package/fesm2022/acorex-components-conversation-conversation-info-media-view.component-Mhk7JE6K.mjs.map +0 -1
  27. package/fesm2022/acorex-components-conversation-conversation-info-panel.component-CNaM5ajR.mjs +0 -1080
  28. package/fesm2022/acorex-components-conversation-conversation-info-panel.component-CNaM5ajR.mjs.map +0 -1
  29. package/fesm2022/acorex-components-conversation-conversation-video.file-type-Pescv4Vu.mjs +0 -102
  30. package/fesm2022/acorex-components-conversation-conversation-video.file-type-Pescv4Vu.mjs.map +0 -1
  31. package/fesm2022/acorex-components-conversation-conversation-voice.file-type-DDd47o4r.mjs +0 -90
  32. package/fesm2022/acorex-components-conversation-conversation-voice.file-type-DDd47o4r.mjs.map +0 -1
  33. package/fesm2022/acorex-components-conversation-fallback-renderer.component-CYh_6O6j.mjs +0 -44
  34. package/fesm2022/acorex-components-conversation-fallback-renderer.component-CYh_6O6j.mjs.map +0 -1
  35. package/fesm2022/acorex-components-conversation-file-composer.payload-Dy7aG-EH.mjs +0 -64
  36. package/fesm2022/acorex-components-conversation-file-composer.payload-Dy7aG-EH.mjs.map +0 -1
  37. package/fesm2022/acorex-components-conversation-file-picker.component-DCVgl33l.mjs +0 -468
  38. package/fesm2022/acorex-components-conversation-file-picker.component-DCVgl33l.mjs.map +0 -1
  39. package/fesm2022/acorex-components-conversation-file-renderer.component-DgCi06Mg.mjs +0 -125
  40. package/fesm2022/acorex-components-conversation-file-renderer.component-DgCi06Mg.mjs.map +0 -1
  41. package/fesm2022/acorex-components-conversation-file.payload-DyFxTQYn.mjs +0 -50
  42. package/fesm2022/acorex-components-conversation-file.payload-DyFxTQYn.mjs.map +0 -1
  43. package/fesm2022/acorex-components-conversation-format-media-DUD4vA6F.mjs +0 -21
  44. package/fesm2022/acorex-components-conversation-format-media-DUD4vA6F.mjs.map +0 -1
  45. package/fesm2022/acorex-components-conversation-image-attachment.component-CLMGxXPl.mjs +0 -77
  46. package/fesm2022/acorex-components-conversation-image-attachment.component-CLMGxXPl.mjs.map +0 -1
  47. package/fesm2022/acorex-components-conversation-image-picker.component-CS343UDa.mjs +0 -407
  48. package/fesm2022/acorex-components-conversation-image-picker.component-CS343UDa.mjs.map +0 -1
  49. package/fesm2022/acorex-components-conversation-image-renderer.component-Cy0TA6cL.mjs +0 -83
  50. package/fesm2022/acorex-components-conversation-image-renderer.component-Cy0TA6cL.mjs.map +0 -1
  51. package/fesm2022/acorex-components-conversation-index-3V2b14I0.mjs +0 -184
  52. package/fesm2022/acorex-components-conversation-index-3V2b14I0.mjs.map +0 -1
  53. package/fesm2022/acorex-components-conversation-index-MCvfr9Zd.mjs +0 -266
  54. package/fesm2022/acorex-components-conversation-index-MCvfr9Zd.mjs.map +0 -1
  55. package/fesm2022/acorex-components-conversation-location-picker.component-DcNQzuoU.mjs +0 -149
  56. package/fesm2022/acorex-components-conversation-location-picker.component-DcNQzuoU.mjs.map +0 -1
  57. package/fesm2022/acorex-components-conversation-location-renderer.component-Cw2PB0LM.mjs +0 -118
  58. package/fesm2022/acorex-components-conversation-location-renderer.component-Cw2PB0LM.mjs.map +0 -1
  59. package/fesm2022/acorex-components-conversation-media-formatters-DV3wEEno.mjs +0 -17
  60. package/fesm2022/acorex-components-conversation-media-formatters-DV3wEEno.mjs.map +0 -1
  61. package/fesm2022/acorex-components-conversation-media-playback-info-bar-banner.component-DbWUl6M2.mjs +0 -140
  62. package/fesm2022/acorex-components-conversation-media-playback-info-bar-banner.component-DbWUl6M2.mjs.map +0 -1
  63. package/fesm2022/acorex-components-conversation-message-renderer-copy-host.component-oXTr_Lfq.mjs +0 -33
  64. package/fesm2022/acorex-components-conversation-message-renderer-copy-host.component-oXTr_Lfq.mjs.map +0 -1
  65. package/fesm2022/acorex-components-conversation-message-renderer-state.component-Dp-JdHWr.mjs +0 -172
  66. package/fesm2022/acorex-components-conversation-message-renderer-state.component-Dp-JdHWr.mjs.map +0 -1
  67. package/fesm2022/acorex-components-conversation-pagination-demo-data-oIT_YJmN.mjs +0 -81
  68. package/fesm2022/acorex-components-conversation-pagination-demo-data-oIT_YJmN.mjs.map +0 -1
  69. package/fesm2022/acorex-components-conversation-picker-header.component-BneIFjXq.mjs +0 -91
  70. package/fesm2022/acorex-components-conversation-picker-header.component-BneIFjXq.mjs.map +0 -1
  71. package/fesm2022/acorex-components-conversation-picker-toolbar.component-BthRvEeE.mjs +0 -537
  72. package/fesm2022/acorex-components-conversation-picker-toolbar.component-BthRvEeE.mjs.map +0 -1
  73. package/fesm2022/acorex-components-conversation-picker-upload-C-PlKPaU.mjs +0 -163
  74. package/fesm2022/acorex-components-conversation-picker-upload-C-PlKPaU.mjs.map +0 -1
  75. package/fesm2022/acorex-components-conversation-playback-banner-sync-D8FFKde6.mjs +0 -68
  76. package/fesm2022/acorex-components-conversation-playback-banner-sync-D8FFKde6.mjs.map +0 -1
  77. package/fesm2022/acorex-components-conversation-renderer-shared.styles-Digah3Zn.mjs +0 -95
  78. package/fesm2022/acorex-components-conversation-renderer-shared.styles-Digah3Zn.mjs.map +0 -1
  79. package/fesm2022/acorex-components-conversation-search.component-B-nc6xiA.mjs +0 -187
  80. package/fesm2022/acorex-components-conversation-search.component-B-nc6xiA.mjs.map +0 -1
  81. package/fesm2022/acorex-components-conversation-send-message-media-BRklgfV7.mjs +0 -170
  82. package/fesm2022/acorex-components-conversation-send-message-media-BRklgfV7.mjs.map +0 -1
  83. package/fesm2022/acorex-components-conversation-shared-storage.seed-J9PA4l3c.mjs +0 -750
  84. package/fesm2022/acorex-components-conversation-shared-storage.seed-J9PA4l3c.mjs.map +0 -1
  85. package/fesm2022/acorex-components-conversation-sticker-renderer.component-BmBwy7Ig.mjs +0 -103
  86. package/fesm2022/acorex-components-conversation-sticker-renderer.component-BmBwy7Ig.mjs.map +0 -1
  87. package/fesm2022/acorex-components-conversation-system-renderer.component-uie3tm5N.mjs +0 -55
  88. package/fesm2022/acorex-components-conversation-system-renderer.component-uie3tm5N.mjs.map +0 -1
  89. package/fesm2022/acorex-components-conversation-text-renderer.component-DNAquHYK.mjs +0 -109
  90. package/fesm2022/acorex-components-conversation-text-renderer.component-DNAquHYK.mjs.map +0 -1
  91. package/fesm2022/acorex-components-conversation-video-attachment.component-CGaUhnSb.mjs +0 -105
  92. package/fesm2022/acorex-components-conversation-video-attachment.component-CGaUhnSb.mjs.map +0 -1
  93. package/fesm2022/acorex-components-conversation-video-composer.payload-DMqRkafr.mjs +0 -62
  94. package/fesm2022/acorex-components-conversation-video-composer.payload-DMqRkafr.mjs.map +0 -1
  95. package/fesm2022/acorex-components-conversation-video-picker.component-DPwSBnoH.mjs +0 -446
  96. package/fesm2022/acorex-components-conversation-video-picker.component-DPwSBnoH.mjs.map +0 -1
  97. package/fesm2022/acorex-components-conversation-video-renderer.component-DKa9mUe2.mjs +0 -181
  98. package/fesm2022/acorex-components-conversation-video-renderer.component-DKa9mUe2.mjs.map +0 -1
  99. package/fesm2022/acorex-components-conversation-video.payload-C8QaqxuX.mjs +0 -54
  100. package/fesm2022/acorex-components-conversation-video.payload-C8QaqxuX.mjs.map +0 -1
  101. package/fesm2022/acorex-components-conversation-voice-composer.payload-DLVow7ex.mjs +0 -17
  102. package/fesm2022/acorex-components-conversation-voice-composer.payload-DLVow7ex.mjs.map +0 -1
  103. package/fesm2022/acorex-components-conversation-voice-recorder.component-D_rdANZN.mjs +0 -344
  104. package/fesm2022/acorex-components-conversation-voice-recorder.component-D_rdANZN.mjs.map +0 -1
  105. package/fesm2022/acorex-components-conversation-voice-renderer.component-BY5FJcT8.mjs +0 -270
  106. package/fesm2022/acorex-components-conversation-voice-renderer.component-BY5FJcT8.mjs.map +0 -1
@@ -1,5 +1,4 @@
1
- import { n as notifyPickerValidationErrors } from './acorex-components-conversation-picker-upload-C-PlKPaU.mjs';
2
- import { r as resolveComposerMaxFiles } from './acorex-components-conversation-acorex-components-conversation-YhVa42TC.mjs';
1
+ import { resolveComposerMaxFiles, notifyPickerValidationErrors } from './acorex-components-conversation.mjs';
3
2
 
4
3
  async function openComposerPickerPopup(popupService, composerService, registry, action, conversation, files, config) {
5
4
  const component = action.component ?? (action.componentLoader ? await action.componentLoader() : undefined);
@@ -221,4 +220,4 @@ async function handleConversationFilePaste(event, host, deps) {
221
220
  }
222
221
 
223
222
  export { filesFromClipboardEvent, handleConversationFilePaste, isPasteTargetInChatPanel, openComposerPickerForFiles, resolvePickerActionsForAllFiles };
224
- //# sourceMappingURL=acorex-components-conversation-open-composer-picker-for-files-Du8Lj9Sp.mjs.map
223
+ //# sourceMappingURL=acorex-components-conversation-open-composer-picker-for-files-Duvap4M4.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"acorex-components-conversation-open-composer-picker-for-files-Du8Lj9Sp.mjs","sources":["../../../../packages/components/conversation/src/lib/components/message-list/open-composer-picker-popup.ts","../../../../packages/components/conversation/src/lib/components/message-list/open-composer-picker-for-files.ts"],"sourcesContent":["import type { AXPopupService } from '@acorex/components/popup';\nimport type { AXConversationComposerService } from '../composer/composer.service';\nimport type { AXConversationComposerAction, AXConversationComposerActionRegistry } from '../../registries/composer-action.registry';\nimport type { AXConversation } from '../../models';\nimport { resolveComposerMaxFiles } from '../../plugins/composer/composer-upload.config';\nimport type { AXConversationConfig } from '../../tokens/conversation-config.interface';\n\nexport async function openComposerPickerPopup(\n popupService: AXPopupService,\n composerService: AXConversationComposerService,\n registry: AXConversationComposerActionRegistry,\n action: AXConversationComposerAction,\n conversation: AXConversation,\n files: File[],\n config: Pick<Required<AXConversationConfig>, 'maxFilesPerMessage'>,\n): Promise<void> {\n const component = action.component ?? (action.componentLoader ? await action.componentLoader() : undefined);\n if (!component || files.length === 0) {\n return;\n }\n\n await popupService.open(component, {\n title: registry.getActionLabel(action),\n size: 'md',\n closeButton: true,\n header: false,\n panelClass: ['ax-conversation-composer-picker-popup'],\n inputs: {\n conversation,\n maxFiles: resolveComposerMaxFiles(action, config),\n initialFiles: files,\n service: composerService,\n },\n });\n}\n","import type { AXPopupService } from '@acorex/components/popup';\nimport type { AXToastService } from '@acorex/components/toast';\nimport { AXTranslationService } from '@acorex/core/translation';\nimport type { AXFileService } from '@acorex/core/file';\nimport type { AXValidationRuleResult } from '@acorex/core/validation';\nimport type { AXConversationComposerService } from '../composer/composer.service';\nimport type { AXConversation } from '../../models';\nimport type { AXConversationComposerAction, AXConversationComposerActionRegistry } from '../../registries/composer-action.registry';\nimport { notifyPickerValidationErrors } from '../../plugins/composer/components/shared/picker-upload';\nimport type { AXConversationConfig } from '../../tokens/conversation-config.interface';\nimport { openComposerPickerPopup } from './open-composer-picker-popup';\n\nexport interface AXConversationOpenComposerPickerForFilesDeps {\n fileService: AXFileService;\n composerService: AXConversationComposerService;\n composerActionRegistry: AXConversationComposerActionRegistry;\n popupService: AXPopupService;\n toast: AXToastService;\n translation: AXTranslationService;\n conversation: AXConversation | null | undefined;\n config: Pick<Required<AXConversationConfig>, 'maxFilesPerMessage'>;\n}\n\n/** Catalogs registered on picker actions (conversation-image, conversation-file, …). */\nfunction pickerCatalogNames(registry: AXConversationComposerActionRegistry): string[] {\n const names = new Set<string>();\n for (const action of registry.actions()) {\n if ((action.component || action.componentLoader) && action.fileType) {\n names.add(action.fileType);\n }\n }\n return [...names];\n}\n\ninterface AXConversationInboundFilesAnalysis {\n matchingCatalogs: string[];\n actions: AXConversationComposerAction[];\n supportedFiles: File[];\n unsupportedFiles: { file: File; errors: AXValidationRuleResult[] }[];\n}\n\n/** Files that are not accepted by any registered picker catalog. */\nasync function collectUnsupportedInboundFiles(\n deps: Pick<AXConversationOpenComposerPickerForFilesDeps, 'fileService' | 'composerActionRegistry'>,\n files: File[],\n catalogs: string[],\n): Promise<{ file: File; errors: AXValidationRuleResult[] }[]> {\n const unsupported: { file: File; errors: AXValidationRuleResult[] }[] = [];\n\n for (const file of files) {\n let acceptedByAny = false;\n let lastErrors: AXValidationRuleResult[] = [];\n\n for (const catalog of catalogs) {\n const errors = await deps.fileService.validate(file, catalog);\n if (errors.length === 0) {\n acceptedByAny = true;\n break;\n }\n lastErrors = errors;\n }\n\n if (!acceptedByAny) {\n unsupported.push({ file, errors: lastErrors });\n }\n }\n\n return unsupported;\n}\n\nasync function analyzeInboundFiles(\n deps: Pick<\n AXConversationOpenComposerPickerForFilesDeps,\n 'fileService' | 'composerService' | 'composerActionRegistry'\n >,\n files: File[],\n): Promise<AXConversationInboundFilesAnalysis> {\n if (!files.length) {\n return { matchingCatalogs: [], actions: [], supportedFiles: [], unsupportedFiles: [] };\n }\n\n const catalogs = pickerCatalogNames(deps.composerActionRegistry);\n const unsupportedFiles = await collectUnsupportedInboundFiles(deps, files, catalogs);\n const unsupportedSet = new Set(unsupportedFiles.map((entry) => entry.file));\n const supportedFiles = files.filter((file) => !unsupportedSet.has(file));\n\n if (supportedFiles.length === 0) {\n return { matchingCatalogs: [], actions: [], supportedFiles: [], unsupportedFiles };\n }\n\n const context = deps.composerService.actionContext();\n const matchingCatalogs: string[] = [];\n\n for (const catalog of catalogs) {\n const { rejected } = await deps.fileService.validateMany(supportedFiles, catalog);\n if (rejected.length === 0) {\n matchingCatalogs.push(catalog);\n }\n }\n\n const seen = new Set<string>();\n const actions: AXConversationComposerAction[] = [];\n\n for (const catalog of matchingCatalogs) {\n for (const action of deps.composerActionRegistry.findPickerActionsForFileType(catalog, context)) {\n if (!seen.has(action.id)) {\n seen.add(action.id);\n actions.push(action);\n }\n }\n }\n\n return {\n matchingCatalogs,\n actions: actions.sort((a, b) => (b.priority ?? 0) - (a.priority ?? 0)),\n supportedFiles,\n unsupportedFiles,\n };\n}\n\nfunction notifyInboundFilesValidationFailures(\n deps: Pick<AXConversationOpenComposerPickerForFilesDeps, 'toast' | 'translation'>,\n analysis: AXConversationInboundFilesAnalysis,\n): void {\n if (analysis.supportedFiles.length === 0) {\n if (analysis.unsupportedFiles.length === 0) {\n deps.toast.warning(deps.translation.translateSync('@acorex:chat.errors.inbound-files-none-supported'));\n }\n return;\n }\n\n if (analysis.actions.length === 0) {\n const key =\n analysis.matchingCatalogs.length === 0\n ? '@acorex:chat.errors.inbound-files-none-supported'\n : '@acorex:chat.errors.inbound-files-no-send-option';\n deps.toast.warning(deps.translation.translateSync(key));\n }\n}\n\n/**\n * File catalogs that accept every supported file in the batch, then matching visible picker actions.\n */\nexport async function resolvePickerActionsForAllFiles(\n deps: Pick<AXConversationOpenComposerPickerForFilesDeps, 'fileService' | 'composerService' | 'composerActionRegistry'>,\n files: File[],\n): Promise<AXConversationComposerAction[]> {\n const analysis = await analyzeInboundFiles(deps, files);\n return analysis.actions;\n}\n\nasync function promptComposerActionChoice(\n deps: AXConversationOpenComposerPickerForFilesDeps,\n actions: AXConversationComposerAction[],\n fileCount: number,\n): Promise<AXConversationComposerAction | undefined> {\n const { AXConversationComposerActionChoiceDialogComponent } = await import('./composer-action-choice-dialog.component');\n const result = await deps.popupService.open(AXConversationComposerActionChoiceDialogComponent, {\n title: deps.translation.translateSync('@acorex:chat.dialog.choose-send-option.title'),\n size: 'sm',\n closeButton: true,\n header: true,\n inputs: {\n actions,\n fileCount,\n composerActionRegistry: deps.composerActionRegistry,\n },\n });\n\n const action = result?.data as AXConversationComposerAction | undefined;\n if (!action?.component && !action?.componentLoader) {\n return undefined;\n }\n return action;\n}\n\n/**\n * Match dropped/pasted files to composer picker action(s) and open the popup.\n * Unsupported files are skipped after a warning toast; supported files continue.\n * @returns true when a picker popup was opened\n */\nexport async function openComposerPickerForFiles(\n deps: AXConversationOpenComposerPickerForFilesDeps,\n files: File[],\n): Promise<boolean> {\n if (!files.length) {\n return false;\n }\n\n const conversation = deps.conversation;\n if (!conversation) {\n return false;\n }\n\n const analysis = await analyzeInboundFiles(deps, files);\n\n if (analysis.unsupportedFiles.length > 0) {\n notifyPickerValidationErrors(deps.toast, deps.translation, analysis.unsupportedFiles);\n }\n\n if (!analysis.supportedFiles.length || !analysis.actions.length) {\n notifyInboundFilesValidationFailures(deps, analysis);\n return false;\n }\n\n let action = analysis.actions[0];\n if (analysis.actions.length > 1) {\n const chosen = await promptComposerActionChoice(deps, analysis.actions, analysis.supportedFiles.length);\n if (!chosen) {\n return false;\n }\n action = chosen;\n }\n\n const catalog = action.fileType;\n if (!catalog) {\n deps.toast.warning(deps.translation.translateSync('@acorex:chat.errors.inbound-files-none-supported'));\n return false;\n }\n\n const { accepted, rejected } = await deps.fileService.validateMany(analysis.supportedFiles, catalog);\n if (rejected.length > 0) {\n notifyPickerValidationErrors(deps.toast, deps.translation, rejected);\n }\n if (accepted.length === 0) {\n return false;\n }\n\n await openComposerPickerPopup(\n deps.popupService,\n deps.composerService,\n deps.composerActionRegistry,\n action,\n conversation,\n accepted,\n deps.config,\n );\n return true;\n}\n\n/** Extract OS-copied files from a paste event (e.g. Ctrl+V after copying a file in Explorer). */\nexport function filesFromClipboardEvent(event: ClipboardEvent): File[] {\n const items = event.clipboardData?.items;\n if (!items?.length) {\n return [];\n }\n\n const files: File[] = [];\n for (let i = 0; i < items.length; i++) {\n const item = items[i];\n if (item.kind === 'file') {\n const file = item.getAsFile();\n if (file) {\n files.push(file);\n }\n }\n }\n return files;\n}\n\n/** Whether a paste event target lies in the chat panel (not sidebar). */\nexport function isPasteTargetInChatPanel(host: HTMLElement, target: EventTarget | null): boolean {\n if (!(target instanceof Node) || !host.contains(target)) {\n return false;\n }\n\n const excluded = host.querySelector('.conversation-sidebar-container, .sidebar-container');\n if (excluded?.contains(target)) {\n return false;\n }\n\n const chatMain = host.querySelector('.conversation-main-container, .main-area, .conversation-view');\n if (chatMain) {\n return chatMain.contains(target);\n }\n\n return true;\n}\n\n/** Handle Ctrl+V / paste when the clipboard holds files copied from the OS. */\nexport async function handleConversationFilePaste(\n event: ClipboardEvent,\n host: HTMLElement,\n deps: AXConversationOpenComposerPickerForFilesDeps,\n): Promise<void> {\n if (!isPasteTargetInChatPanel(host, event.target)) {\n return;\n }\n\n const files = filesFromClipboardEvent(event);\n if (!files.length) {\n return;\n }\n\n const handled = await openComposerPickerForFiles(deps, files);\n if (handled) {\n event.preventDefault();\n event.stopImmediatePropagation();\n }\n}\n"],"names":[],"mappings":";;;AAOO,eAAe,uBAAuB,CAC3C,YAA4B,EAC5B,eAA8C,EAC9C,QAA8C,EAC9C,MAAoC,EACpC,YAA4B,EAC5B,KAAa,EACb,MAAkE,EAAA;IAElE,MAAM,SAAS,GAAG,MAAM,CAAC,SAAS,KAAK,MAAM,CAAC,eAAe,GAAG,MAAM,MAAM,CAAC,eAAe,EAAE,GAAG,SAAS,CAAC;IAC3G,IAAI,CAAC,SAAS,IAAI,KAAK,CAAC,MAAM,KAAK,CAAC,EAAE;QACpC;IACF;AAEA,IAAA,MAAM,YAAY,CAAC,IAAI,CAAC,SAAS,EAAE;AACjC,QAAA,KAAK,EAAE,QAAQ,CAAC,cAAc,CAAC,MAAM,CAAC;AACtC,QAAA,IAAI,EAAE,IAAI;AACV,QAAA,WAAW,EAAE,IAAI;AACjB,QAAA,MAAM,EAAE,KAAK;QACb,UAAU,EAAE,CAAC,uCAAuC,CAAC;AACrD,QAAA,MAAM,EAAE;YACN,YAAY;AACZ,YAAA,QAAQ,EAAE,uBAAuB,CAAC,MAAM,EAAE,MAAM,CAAC;AACjD,YAAA,YAAY,EAAE,KAAK;AACnB,YAAA,OAAO,EAAE,eAAe;AACzB,SAAA;AACF,KAAA,CAAC;AACJ;;ACXA;AACA,SAAS,kBAAkB,CAAC,QAA8C,EAAA;AACxE,IAAA,MAAM,KAAK,GAAG,IAAI,GAAG,EAAU;IAC/B,KAAK,MAAM,MAAM,IAAI,QAAQ,CAAC,OAAO,EAA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AAK,CAAC,wBAAwB,EAAE;IAClC;AACF;;;;"}
1
+ {"version":3,"file":"acorex-components-conversation-open-composer-picker-for-files-Duvap4M4.mjs","sources":["../../../../packages/components/conversation/src/lib/components/message-list/open-composer-picker-popup.ts","../../../../packages/components/conversation/src/lib/components/message-list/open-composer-picker-for-files.ts"],"sourcesContent":["import type { AXPopupService } from '@acorex/components/popup';\nimport type { AXConversationComposerService } from '../composer/composer.service';\nimport type { AXConversationComposerAction, AXConversationComposerActionRegistry } from '../../registries/composer-action.registry';\nimport type { AXConversation } from '../../models';\nimport { resolveComposerMaxFiles } from '../../plugins/composer/composer-upload.config';\nimport type { AXConversationConfig } from '../../tokens/conversation-config.interface';\n\nexport async function openComposerPickerPopup(\n popupService: AXPopupService,\n composerService: AXConversationComposerService,\n registry: AXConversationComposerActionRegistry,\n action: AXConversationComposerAction,\n conversation: AXConversation,\n files: File[],\n config: Pick<Required<AXConversationConfig>, 'maxFilesPerMessage'>,\n): Promise<void> {\n const component = action.component ?? (action.componentLoader ? await action.componentLoader() : undefined);\n if (!component || files.length === 0) {\n return;\n }\n\n await popupService.open(component, {\n title: registry.getActionLabel(action),\n size: 'md',\n closeButton: true,\n header: false,\n panelClass: ['ax-conversation-composer-picker-popup'],\n inputs: {\n conversation,\n maxFiles: resolveComposerMaxFiles(action, config),\n initialFiles: files,\n service: composerService,\n },\n });\n}\n","import type { AXPopupService } from '@acorex/components/popup';\nimport type { AXToastService } from '@acorex/components/toast';\nimport { AXTranslationService } from '@acorex/core/translation';\nimport type { AXFileService } from '@acorex/core/file';\nimport type { AXValidationRuleResult } from '@acorex/core/validation';\nimport type { AXConversationComposerService } from '../composer/composer.service';\nimport type { AXConversation } from '../../models';\nimport type { AXConversationComposerAction, AXConversationComposerActionRegistry } from '../../registries/composer-action.registry';\nimport { notifyPickerValidationErrors } from '../../plugins/composer/components/shared/picker-upload';\nimport type { AXConversationConfig } from '../../tokens/conversation-config.interface';\nimport { openComposerPickerPopup } from './open-composer-picker-popup';\n\nexport interface AXConversationOpenComposerPickerForFilesDeps {\n fileService: AXFileService;\n composerService: AXConversationComposerService;\n composerActionRegistry: AXConversationComposerActionRegistry;\n popupService: AXPopupService;\n toast: AXToastService;\n translation: AXTranslationService;\n conversation: AXConversation | null | undefined;\n config: Pick<Required<AXConversationConfig>, 'maxFilesPerMessage'>;\n}\n\n/** Catalogs registered on picker actions (conversation-image, conversation-file, …). */\nfunction pickerCatalogNames(registry: AXConversationComposerActionRegistry): string[] {\n const names = new Set<string>();\n for (const action of registry.actions()) {\n if ((action.component || action.componentLoader) && action.fileType) {\n names.add(action.fileType);\n }\n }\n return [...names];\n}\n\ninterface AXConversationInboundFilesAnalysis {\n matchingCatalogs: string[];\n actions: AXConversationComposerAction[];\n supportedFiles: File[];\n unsupportedFiles: { file: File; errors: AXValidationRuleResult[] }[];\n}\n\n/** Files that are not accepted by any registered picker catalog. */\nasync function collectUnsupportedInboundFiles(\n deps: Pick<AXConversationOpenComposerPickerForFilesDeps, 'fileService' | 'composerActionRegistry'>,\n files: File[],\n catalogs: string[],\n): Promise<{ file: File; errors: AXValidationRuleResult[] }[]> {\n const unsupported: { file: File; errors: AXValidationRuleResult[] }[] = [];\n\n for (const file of files) {\n let acceptedByAny = false;\n let lastErrors: AXValidationRuleResult[] = [];\n\n for (const catalog of catalogs) {\n const errors = await deps.fileService.validate(file, catalog);\n if (errors.length === 0) {\n acceptedByAny = true;\n break;\n }\n lastErrors = errors;\n }\n\n if (!acceptedByAny) {\n unsupported.push({ file, errors: lastErrors });\n }\n }\n\n return unsupported;\n}\n\nasync function analyzeInboundFiles(\n deps: Pick<\n AXConversationOpenComposerPickerForFilesDeps,\n 'fileService' | 'composerService' | 'composerActionRegistry'\n >,\n files: File[],\n): Promise<AXConversationInboundFilesAnalysis> {\n if (!files.length) {\n return { matchingCatalogs: [], actions: [], supportedFiles: [], unsupportedFiles: [] };\n }\n\n const catalogs = pickerCatalogNames(deps.composerActionRegistry);\n const unsupportedFiles = await collectUnsupportedInboundFiles(deps, files, catalogs);\n const unsupportedSet = new Set(unsupportedFiles.map((entry) => entry.file));\n const supportedFiles = files.filter((file) => !unsupportedSet.has(file));\n\n if (supportedFiles.length === 0) {\n return { matchingCatalogs: [], actions: [], supportedFiles: [], unsupportedFiles };\n }\n\n const context = deps.composerService.actionContext();\n const matchingCatalogs: string[] = [];\n\n for (const catalog of catalogs) {\n const { rejected } = await deps.fileService.validateMany(supportedFiles, catalog);\n if (rejected.length === 0) {\n matchingCatalogs.push(catalog);\n }\n }\n\n const seen = new Set<string>();\n const actions: AXConversationComposerAction[] = [];\n\n for (const catalog of matchingCatalogs) {\n for (const action of deps.composerActionRegistry.findPickerActionsForFileType(catalog, context)) {\n if (!seen.has(action.id)) {\n seen.add(action.id);\n actions.push(action);\n }\n }\n }\n\n return {\n matchingCatalogs,\n actions: actions.sort((a, b) => (b.priority ?? 0) - (a.priority ?? 0)),\n supportedFiles,\n unsupportedFiles,\n };\n}\n\nfunction notifyInboundFilesValidationFailures(\n deps: Pick<AXConversationOpenComposerPickerForFilesDeps, 'toast' | 'translation'>,\n analysis: AXConversationInboundFilesAnalysis,\n): void {\n if (analysis.supportedFiles.length === 0) {\n if (analysis.unsupportedFiles.length === 0) {\n deps.toast.warning(deps.translation.translateSync('@acorex:chat.errors.inbound-files-none-supported'));\n }\n return;\n }\n\n if (analysis.actions.length === 0) {\n const key =\n analysis.matchingCatalogs.length === 0\n ? '@acorex:chat.errors.inbound-files-none-supported'\n : '@acorex:chat.errors.inbound-files-no-send-option';\n deps.toast.warning(deps.translation.translateSync(key));\n }\n}\n\n/**\n * File catalogs that accept every supported file in the batch, then matching visible picker actions.\n */\nexport async function resolvePickerActionsForAllFiles(\n deps: Pick<AXConversationOpenComposerPickerForFilesDeps, 'fileService' | 'composerService' | 'composerActionRegistry'>,\n files: File[],\n): Promise<AXConversationComposerAction[]> {\n const analysis = await analyzeInboundFiles(deps, files);\n return analysis.actions;\n}\n\nasync function promptComposerActionChoice(\n deps: AXConversationOpenComposerPickerForFilesDeps,\n actions: AXConversationComposerAction[],\n fileCount: number,\n): Promise<AXConversationComposerAction | undefined> {\n const { AXConversationComposerActionChoiceDialogComponent } = await import('./composer-action-choice-dialog.component');\n const result = await deps.popupService.open(AXConversationComposerActionChoiceDialogComponent, {\n title: deps.translation.translateSync('@acorex:chat.dialog.choose-send-option.title'),\n size: 'sm',\n closeButton: true,\n header: true,\n inputs: {\n actions,\n fileCount,\n composerActionRegistry: deps.composerActionRegistry,\n },\n });\n\n const action = result?.data as AXConversationComposerAction | undefined;\n if (!action?.component && !action?.componentLoader) {\n return undefined;\n }\n return action;\n}\n\n/**\n * Match dropped/pasted files to composer picker action(s) and open the popup.\n * Unsupported files are skipped after a warning toast; supported files continue.\n * @returns true when a picker popup was opened\n */\nexport async function openComposerPickerForFiles(\n deps: AXConversationOpenComposerPickerForFilesDeps,\n files: File[],\n): Promise<boolean> {\n if (!files.length) {\n return false;\n }\n\n const conversation = deps.conversation;\n if (!conversation) {\n return false;\n }\n\n const analysis = await analyzeInboundFiles(deps, files);\n\n if (analysis.unsupportedFiles.length > 0) {\n notifyPickerValidationErrors(deps.toast, deps.translation, analysis.unsupportedFiles);\n }\n\n if (!analysis.supportedFiles.length || !analysis.actions.length) {\n notifyInboundFilesValidationFailures(deps, analysis);\n return false;\n }\n\n let action = analysis.actions[0];\n if (analysis.actions.length > 1) {\n const chosen = await promptComposerActionChoice(deps, analysis.actions, analysis.supportedFiles.length);\n if (!chosen) {\n return false;\n }\n action = chosen;\n }\n\n const catalog = action.fileType;\n if (!catalog) {\n deps.toast.warning(deps.translation.translateSync('@acorex:chat.errors.inbound-files-none-supported'));\n return false;\n }\n\n const { accepted, rejected } = await deps.fileService.validateMany(analysis.supportedFiles, catalog);\n if (rejected.length > 0) {\n notifyPickerValidationErrors(deps.toast, deps.translation, rejected);\n }\n if (accepted.length === 0) {\n return false;\n }\n\n await openComposerPickerPopup(\n deps.popupService,\n deps.composerService,\n deps.composerActionRegistry,\n action,\n conversation,\n accepted,\n deps.config,\n );\n return true;\n}\n\n/** Extract OS-copied files from a paste event (e.g. Ctrl+V after copying a file in Explorer). */\nexport function filesFromClipboardEvent(event: ClipboardEvent): File[] {\n const items = event.clipboardData?.items;\n if (!items?.length) {\n return [];\n }\n\n const files: File[] = [];\n for (let i = 0; i < items.length; i++) {\n const item = items[i];\n if (item.kind === 'file') {\n const file = item.getAsFile();\n if (file) {\n files.push(file);\n }\n }\n }\n return files;\n}\n\n/** Whether a paste event target lies in the chat panel (not sidebar). */\nexport function isPasteTargetInChatPanel(host: HTMLElement, target: EventTarget | null): boolean {\n if (!(target instanceof Node) || !host.contains(target)) {\n return false;\n }\n\n const excluded = host.querySelector('.conversation-sidebar-container, .sidebar-container');\n if (excluded?.contains(target)) {\n return false;\n }\n\n const chatMain = host.querySelector('.conversation-main-container, .main-area, .conversation-view');\n if (chatMain) {\n return chatMain.contains(target);\n }\n\n return true;\n}\n\n/** Handle Ctrl+V / paste when the clipboard holds files copied from the OS. */\nexport async function handleConversationFilePaste(\n event: ClipboardEvent,\n host: HTMLElement,\n deps: AXConversationOpenComposerPickerForFilesDeps,\n): Promise<void> {\n if (!isPasteTargetInChatPanel(host, event.target)) {\n return;\n }\n\n const files = filesFromClipboardEvent(event);\n if (!files.length) {\n return;\n }\n\n const handled = await openComposerPickerForFiles(deps, files);\n if (handled) {\n event.preventDefault();\n event.stopImmediatePropagation();\n }\n}\n"],"names":[],"mappings":";;AAOO,eAAe,uBAAuB,CAC3C,YAA4B,EAC5B,eAA8C,EAC9C,QAA8C,EAC9C,MAAoC,EACpC,YAA4B,EAC5B,KAAa,EACb,MAAkE,EAAA;IAElE,MAAM,SAAS,GAAG,MAAM,CAAC,SAAS,KAAK,MAAM,CAAC,eAAe,GAAG,MAAM,MAAM,CAAC,eAAe,EAAE,GAAG,SAAS,CAAC;IAC3G,IAAI,CAAC,SAAS,IAAI,KAAK,CAAC,MAAM,KAAK,CAAC,EAAE;QACpC;IACF;AAEA,IAA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