@acorex/platform 21.0.0-next.3 → 21.0.0-next.7

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 (30) hide show
  1. package/auth/index.d.ts +6 -6
  2. package/common/index.d.ts +10 -5
  3. package/core/index.d.ts +55 -315
  4. package/fesm2022/acorex-platform-auth.mjs +18 -22
  5. package/fesm2022/acorex-platform-auth.mjs.map +1 -1
  6. package/fesm2022/acorex-platform-common.mjs +62 -38
  7. package/fesm2022/acorex-platform-common.mjs.map +1 -1
  8. package/fesm2022/acorex-platform-core.mjs +150 -246
  9. package/fesm2022/acorex-platform-core.mjs.map +1 -1
  10. package/fesm2022/acorex-platform-layout-builder.mjs +11 -2
  11. package/fesm2022/acorex-platform-layout-builder.mjs.map +1 -1
  12. package/fesm2022/acorex-platform-layout-components.mjs +3 -3
  13. package/fesm2022/acorex-platform-layout-components.mjs.map +1 -1
  14. package/fesm2022/acorex-platform-layout-entity.mjs +67 -83
  15. package/fesm2022/acorex-platform-layout-entity.mjs.map +1 -1
  16. package/fesm2022/acorex-platform-layout-widget-core.mjs +110 -33
  17. package/fesm2022/acorex-platform-layout-widget-core.mjs.map +1 -1
  18. package/fesm2022/acorex-platform-layout-widgets.mjs +19 -11
  19. package/fesm2022/acorex-platform-layout-widgets.mjs.map +1 -1
  20. package/fesm2022/{acorex-platform-themes-default-entity-master-list-view.component-DyDa_hyd.mjs → acorex-platform-themes-default-entity-master-list-view.component-DfJEx_bs.mjs} +2 -2
  21. package/fesm2022/acorex-platform-themes-default-entity-master-list-view.component-DfJEx_bs.mjs.map +1 -0
  22. package/fesm2022/acorex-platform-themes-default.mjs +2 -2
  23. package/fesm2022/acorex-platform-workflow.mjs +1268 -1699
  24. package/fesm2022/acorex-platform-workflow.mjs.map +1 -1
  25. package/layout/builder/index.d.ts +6 -0
  26. package/layout/entity/index.d.ts +2 -9
  27. package/layout/widget-core/index.d.ts +42 -4
  28. package/package.json +5 -5
  29. package/workflow/index.d.ts +650 -1074
  30. package/fesm2022/acorex-platform-themes-default-entity-master-list-view.component-DyDa_hyd.mjs.map +0 -1
@@ -4,7 +4,7 @@ import { kebabCase, merge, sortBy, cloneDeep, get, omit } from 'lodash-es';
4
4
  import { Router, ROUTES, RouterModule } from '@angular/router';
5
5
  import { AXPSessionService, AXPSessionStatus } from '@acorex/platform/auth';
6
6
  import { Subject, distinctUntilChanged, merge as merge$1 } from 'rxjs';
7
- import { AXPModuleProviderRegistry, AXPPlatformScope, AXPBroadcastEventService, objectKeyValueTransforms, AXPSystemActionType, AXPModuleManifestModule, AXPAppStartUpProvider, AXP_EXPRESSION_EVALUATOR_SCOPE_PROVIDER, AXPModuleManifestRegistry } from '@acorex/platform/core';
7
+ import { AXPPlatformScope, AXPBroadcastEventService, objectKeyValueTransforms, AXPSystemActionType, AXPModuleManifestModule, AXPAppStartUpProvider, AXP_EXPRESSION_EVALUATOR_SCOPE_PROVIDER, AXPModuleManifestRegistry } from '@acorex/platform/core';
8
8
  import { AXTranslationService } from '@acorex/core/translation';
9
9
  import { AXPWidgetsCatalog } from '@acorex/platform/layout/widget-core';
10
10
  import { AXPopupModule, AXPopupService } from '@acorex/components/popup';
@@ -321,7 +321,6 @@ const AXP_SETTING_DEFINITION_PROVIDER = new InjectionToken('AXP_SETTING_DEFINITI
321
321
  class AXPSettingDefinitionProviderService {
322
322
  constructor() {
323
323
  this.providers = inject(AXP_SETTING_DEFINITION_PROVIDER, { optional: true });
324
- this.providerRegistry = inject(AXPModuleProviderRegistry);
325
324
  this.cache = null;
326
325
  }
327
326
  async load() {
@@ -329,7 +328,7 @@ class AXPSettingDefinitionProviderService {
329
328
  return;
330
329
  }
331
330
  const context = new AXPSettingDefinitionProviderContext();
332
- // Load providers from DI tokens (backward compatibility)
331
+ // Load providers from DI tokens
333
332
  if (Array.isArray(this.providers)) {
334
333
  for (const provider of this.providers) {
335
334
  if (provider instanceof Promise) {
@@ -343,11 +342,6 @@ class AXPSettingDefinitionProviderService {
343
342
  }
344
343
  }
345
344
  }
346
- // Load providers from registry (manifest-based, conditionally loaded)
347
- const registryProviders = this.providerRegistry.getSettingProviders();
348
- for (const provider of registryProviders) {
349
- await provider.provide(context);
350
- }
351
345
  this.cache = context.getGroups();
352
346
  }
353
347
  async reload() {
@@ -1640,7 +1634,6 @@ class AXPMenuProviderService {
1640
1634
  constructor() {
1641
1635
  //#region ---- Dependencies ----
1642
1636
  this.providers = inject(AXP_MENU_PROVIDER, { optional: true });
1643
- this.providerRegistry = inject(AXPModuleProviderRegistry);
1644
1637
  this.middlewareRegistry = inject(AXPMenuMiddlewareRegistry);
1645
1638
  //#endregion
1646
1639
  //#region ---- State ----
@@ -1668,17 +1661,20 @@ class AXPMenuProviderService {
1668
1661
  }
1669
1662
  const items = [];
1670
1663
  const context = this.createMenuProviderContext(items);
1671
- // Load providers from DI tokens (backward compatibility)
1664
+ // Load providers from DI tokens
1672
1665
  if (Array.isArray(this.providers)) {
1673
1666
  for (const provider of this.providers) {
1674
- await provider.provide(context);
1667
+ if (provider instanceof Promise) {
1668
+ // If provider is a promise, resolve it
1669
+ const resolvedProvider = await provider;
1670
+ await resolvedProvider.provide(context);
1671
+ }
1672
+ else {
1673
+ // If provider is a direct instance, use it directly
1674
+ await provider.provide(context);
1675
+ }
1675
1676
  }
1676
1677
  }
1677
- // Load providers from registry (manifest-based, conditionally loaded)
1678
- const registryProviders = this.providerRegistry.getMenuProviders();
1679
- for (const provider of registryProviders) {
1680
- await provider.provide(context);
1681
- }
1682
1678
  // Apply pending operations
1683
1679
  this.applyPendingOperations(items);
1684
1680
  // Sort items by priority
@@ -1698,17 +1694,20 @@ class AXPMenuProviderService {
1698
1694
  async rawItems() {
1699
1695
  const items = [];
1700
1696
  const context = this.createMenuProviderContext(items);
1701
- // Load providers from DI tokens (backward compatibility)
1697
+ // Load providers from DI tokens
1702
1698
  if (Array.isArray(this.providers)) {
1703
1699
  for (const provider of this.providers) {
1704
- await provider.provide(context);
1700
+ if (provider instanceof Promise) {
1701
+ // If provider is a promise, resolve it
1702
+ const resolvedProvider = await provider;
1703
+ await resolvedProvider.provide(context);
1704
+ }
1705
+ else {
1706
+ // If provider is a direct instance, use it directly
1707
+ await provider.provide(context);
1708
+ }
1705
1709
  }
1706
1710
  }
1707
- // Load providers from registry (manifest-based, conditionally loaded)
1708
- const registryProviders = this.providerRegistry.getMenuProviders();
1709
- for (const provider of registryProviders) {
1710
- await provider.provide(context);
1711
- }
1712
1711
  // Apply pending operations
1713
1712
  this.applyPendingOperations(items);
1714
1713
  // Sort items by priority
@@ -2498,7 +2497,6 @@ const AXP_SEARCH_DEFINITION_PROVIDER = new InjectionToken('AXP_SEARCH_DEFINITION
2498
2497
  class AXPSearchDefinitionProviderService {
2499
2498
  constructor() {
2500
2499
  this.providers = inject(AXP_SEARCH_DEFINITION_PROVIDER, { optional: true });
2501
- this.providerRegistry = inject(AXPModuleProviderRegistry);
2502
2500
  this.cache = null;
2503
2501
  }
2504
2502
  async load() {
@@ -2561,7 +2559,6 @@ const AXP_SEARCH_PROVIDER = new InjectionToken('AXP_SEARCH_PROVIDER');
2561
2559
  class AXPSearchService {
2562
2560
  constructor() {
2563
2561
  this.providers = inject(AXP_SEARCH_PROVIDER, { optional: true });
2564
- this.providerRegistry = inject(AXPModuleProviderRegistry);
2565
2562
  this.definitionService = inject(AXPSearchDefinitionProviderService);
2566
2563
  this.formatService = inject(AXFormatService);
2567
2564
  }
@@ -2570,19 +2567,15 @@ class AXPSearchService {
2570
2567
  if (this.definitionService.getList().length == 0) {
2571
2568
  await this.definitionService.getListAsync();
2572
2569
  }
2573
- // Collect providers from both DI tokens and registry
2570
+ // Collect providers from DI tokens
2574
2571
  const allProviders = [];
2575
- // Load from DI tokens (backward compatibility)
2572
+ // Load from DI tokens
2576
2573
  if (Array.isArray(this.providers)) {
2577
2574
  allProviders.push(...this.providers);
2578
2575
  }
2579
2576
  else if (this.providers) {
2580
2577
  allProviders.push(this.providers);
2581
2578
  }
2582
- // Load from registry (manifest-based, conditionally loaded)
2583
- // Note: Registry stores AXPSearchCommandProvider which implements AXPSearchProvider
2584
- const registryProviders = this.providerRegistry.getSearchProviders();
2585
- allProviders.push(...registryProviders);
2586
2579
  if (allProviders.length === 0) {
2587
2580
  throw new Error('No search providers available');
2588
2581
  }
@@ -3106,7 +3099,7 @@ const AXP_STATUS_PROVIDERS = new InjectionToken('AXP_STATUS_PROVIDERS');
3106
3099
  */
3107
3100
  class AXPStatusDefinitionProviderService {
3108
3101
  //#endregion
3109
- //#region ---- Constructor ----
3102
+ //#region ---- Initialization ----
3110
3103
  constructor() {
3111
3104
  //#region ---- Dependencies ----
3112
3105
  this.providers = inject(AXP_STATUS_PROVIDERS, { optional: true }) ?? [];
@@ -3114,19 +3107,49 @@ class AXPStatusDefinitionProviderService {
3114
3107
  //#endregion
3115
3108
  //#region ---- State ----
3116
3109
  this.statusMap = new Map();
3117
- // Register all providers in constructor (like badge service)
3110
+ this.initializationPromise = null;
3111
+ this.isInitialized = false;
3112
+ this.initialize();
3113
+ }
3114
+ /**
3115
+ * Initialize providers (resolve promises if needed)
3116
+ * Called lazily on first access
3117
+ */
3118
+ async initialize() {
3119
+ if (this.isInitialized) {
3120
+ return;
3121
+ }
3122
+ if (this.initializationPromise) {
3123
+ return this.initializationPromise;
3124
+ }
3125
+ this.initializationPromise = this._doInitialize();
3126
+ await this.initializationPromise;
3127
+ }
3128
+ async _doInitialize() {
3129
+ // Register all providers, resolving promises if needed
3118
3130
  for (const provider of this.providers) {
3119
- if (this.statusMap.has(provider.key)) {
3120
- console.warn(`Status with key "${provider.key}" already exists. Overwriting with new status.`);
3131
+ let resolvedProvider;
3132
+ if (provider instanceof Promise) {
3133
+ // If provider is a promise, resolve it
3134
+ resolvedProvider = await provider;
3135
+ }
3136
+ else {
3137
+ // If provider is a direct instance, use it directly
3138
+ resolvedProvider = provider;
3139
+ }
3140
+ if (this.statusMap.has(resolvedProvider.key)) {
3141
+ console.warn(`Status with key "${resolvedProvider.key}" already exists. Overwriting with new status.`);
3121
3142
  }
3122
- this.statusMap.set(provider.key, provider);
3143
+ this.statusMap.set(resolvedProvider.key, resolvedProvider);
3123
3144
  }
3145
+ this.isInitialized = true;
3124
3146
  }
3125
3147
  //#endregion
3126
3148
  //#region ---- Public API ----
3127
3149
  /**
3128
3150
  * Get a status provider by key
3129
- * Direct access from Map (no lazy load, no cache)
3151
+ * Direct synchronous access from Map. Providers are initialized in the constructor,
3152
+ * including lazy-loaded providers (promises) which are resolved during initialization.
3130
3153
  *
3131
3154
  * @param key - Status key (e.g., 'task-management.status')
3132
3155
  * @returns Status provider with all statuses and transitions, or undefined if not found
@@ -3163,7 +3186,8 @@ class AXPStatusDefinitionProviderService {
3163
3186
  * ```
3164
3187
  */
3165
3188
  async executeTransition(definitionKey, transition, context) {
3166
- const provider = this.getStatus(definitionKey);
3189
+ await this.initialize();
3190
+ const provider = this.statusMap.get(definitionKey);
3167
3191
  if (!provider) {
3168
3192
  throw new Error(`Status provider with key "${definitionKey}" not found.`);
3169
3193
  }