@acorex/components 22.0.0-next.36 → 22.0.0-next.37
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.
|
@@ -1999,15 +1999,22 @@ async function loadConversationFileTypes(catalogNames) {
|
|
|
1999
1999
|
}
|
|
2000
2000
|
return types;
|
|
2001
2001
|
}
|
|
2002
|
-
/**
|
|
2002
|
+
/** Built-in conversation catalogs (lazy-loaded on first registry resolve). */
|
|
2003
|
+
const AX_CONVERSATION_BUILTIN_FILE_CATALOGS = [
|
|
2004
|
+
AX_CONVERSATION_IMAGE_CATALOG,
|
|
2005
|
+
AX_CONVERSATION_VIDEO_CATALOG,
|
|
2006
|
+
AX_CONVERSATION_AUDIO_CATALOG,
|
|
2007
|
+
AX_CONVERSATION_FILE_CATALOG,
|
|
2008
|
+
AX_CONVERSATION_VOICE_CATALOG,
|
|
2009
|
+
];
|
|
2010
|
+
/**
|
|
2011
|
+
* Lazy-loads conversation file catalogs for the root file-type registry.
|
|
2012
|
+
* Must not inject {@link AXConversationComposerActionRegistry} — that registry
|
|
2013
|
+
* depends on {@link AXFileTypeRegistryService}, which would create a circular DI cycle.
|
|
2014
|
+
*/
|
|
2003
2015
|
class AXConversationComposerFileTypesProvider extends AXFileTypeInfoProvider {
|
|
2004
|
-
constructor() {
|
|
2005
|
-
super(...arguments);
|
|
2006
|
-
this.composerActions = inject(AXConversationComposerActionRegistry, { optional: true });
|
|
2007
|
-
}
|
|
2008
2016
|
async items() {
|
|
2009
|
-
|
|
2010
|
-
return loadConversationFileTypes(catalogNames);
|
|
2017
|
+
return loadConversationFileTypes([...AX_CONVERSATION_BUILTIN_FILE_CATALOGS]);
|
|
2011
2018
|
}
|
|
2012
2019
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.8", ngImport: i0, type: AXConversationComposerFileTypesProvider, deps: null, target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
2013
2020
|
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "22.0.8", ngImport: i0, type: AXConversationComposerFileTypesProvider }); }
|
|
@@ -2163,7 +2170,6 @@ class AXConversationComposerActionRegistry {
|
|
|
2163
2170
|
...(ngDevMode ? [{ debugName: "_actions" }] : /* istanbul ignore next */ []));
|
|
2164
2171
|
this.translation = inject(AXTranslationService);
|
|
2165
2172
|
this.injector = inject(Injector);
|
|
2166
|
-
this.fileTypeRegistry = inject(AXFileTypeRegistryService);
|
|
2167
2173
|
this.composerTabRegistry = inject(AXConversationComposerTabRegistry);
|
|
2168
2174
|
/** All registered actions */
|
|
2169
2175
|
this.actions = this._actions.asReadonly();
|
|
@@ -2222,12 +2228,16 @@ class AXConversationComposerActionRegistry {
|
|
|
2222
2228
|
// Add to registry
|
|
2223
2229
|
this._actions.update((actions) => [...actions, action]);
|
|
2224
2230
|
if (action.fileType) {
|
|
2225
|
-
this.fileTypeRegistry.invalidateCache();
|
|
2231
|
+
this.fileTypeRegistry().invalidateCache();
|
|
2226
2232
|
void this.ensureFileTypeExists(action.fileType);
|
|
2227
2233
|
}
|
|
2228
2234
|
}
|
|
2235
|
+
/** Resolved lazily to avoid a DI cycle with {@link AXConversationComposerFileTypesProvider}. */
|
|
2236
|
+
fileTypeRegistry() {
|
|
2237
|
+
return this.injector.get(AXFileTypeRegistryService);
|
|
2238
|
+
}
|
|
2229
2239
|
async ensureFileTypeExists(fileType) {
|
|
2230
|
-
const match = await this.fileTypeRegistry.get(fileType);
|
|
2240
|
+
const match = await this.fileTypeRegistry().get(fileType);
|
|
2231
2241
|
if (!match) {
|
|
2232
2242
|
console.warn(`[AXConversationComposerActionRegistry] Unknown fileType "${fileType}". ` +
|
|
2233
2243
|
'Register its AXFileTypeInfoProvider in app providers before using this action.');
|