@praxisui/dynamic-form 9.0.5-rc.18 → 9.0.5-rc.19

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.
@@ -1,8 +1,8 @@
1
1
  {
2
2
  "schemaVersion": "1.0.0",
3
- "generatedAt": "2026-08-14T03:13:07.413Z",
3
+ "generatedAt": "2026-08-14T18:24:26.983Z",
4
4
  "packageName": "@praxisui/dynamic-form",
5
- "packageVersion": "9.0.5-rc.18",
5
+ "packageVersion": "9.0.5-rc.19",
6
6
  "sourceRegistry": "praxis-component-registry-ingestion",
7
7
  "sourceRegistryVersion": "1.0.0",
8
8
  "componentCount": 2,
@@ -11100,6 +11100,12 @@ function exactSchemaOperationId(schema, rootUi) {
11100
11100
  }
11101
11101
  return null;
11102
11102
  }
11103
+ class PraxisDynamicFormDestroyedError extends Error {
11104
+ constructor() {
11105
+ super('PraxisDynamicForm was destroyed while asynchronous runtime work was pending.');
11106
+ this.name = 'PraxisDynamicFormDestroyedError';
11107
+ }
11108
+ }
11103
11109
  const FORM_CONFIG_LOAD_TIMEOUT_MS = 1200;
11104
11110
  const FORM_INPUT_PREFS_LOAD_TIMEOUT_MS = 1200;
11105
11111
  const SCHEMA_GLOBAL_CONFIG_READY_TIMEOUT_MS = 1200;
@@ -11534,6 +11540,7 @@ class PraxisDynamicForm {
11534
11540
  schemaRootReactiveDeterminations = [];
11535
11541
  schemaRootOperationId = null;
11536
11542
  destroy$ = new Subject();
11543
+ isDestroyed = false;
11537
11544
  formValueChangesSubscription = null;
11538
11545
  reactiveDeterminationSubscription = null;
11539
11546
  reactiveDeterminationScheduledBuildId = 0;
@@ -12580,6 +12587,8 @@ class PraxisDynamicForm {
12580
12587
  catch { }
12581
12588
  }
12582
12589
  async initializeForm() {
12590
+ if (this.isDestroyed)
12591
+ return;
12583
12592
  this.debugLog('[PDF] initializeForm:start', {
12584
12593
  isInitialized: this.isInitialized,
12585
12594
  isLoading: this.isLoading,
@@ -12607,6 +12616,8 @@ class PraxisDynamicForm {
12607
12616
  this.emitLoadingState('config', 'loading', 'Carregando configuração do formulário...');
12608
12617
  // Hooks: beforeInit
12609
12618
  await this.runHooks('beforeInit');
12619
+ if (this.isDestroyed)
12620
+ return;
12610
12621
  try {
12611
12622
  // Step 1: Check for saved config
12612
12623
  const configKey = this.formConfigKey();
@@ -12674,6 +12685,8 @@ class PraxisDynamicForm {
12674
12685
  this.cdr.detectChanges();
12675
12686
  }
12676
12687
  catch (error) {
12688
+ if (this.isDestroyed || error instanceof PraxisDynamicFormDestroyedError)
12689
+ return;
12677
12690
  this.errorLog('[PDF] initializeForm:error', error);
12678
12691
  const key = this.formConfigKey();
12679
12692
  const hasLocalConfig = key
@@ -12686,11 +12699,15 @@ class PraxisDynamicForm {
12686
12699
  });
12687
12700
  }
12688
12701
  finally {
12689
- this.isLoading = false;
12690
- this.cdr.detectChanges();
12702
+ if (!this.isDestroyed) {
12703
+ this.isLoading = false;
12704
+ this.cdr.detectChanges();
12705
+ }
12691
12706
  }
12692
12707
  }
12693
12708
  handleInitializationError(stage, error, context) {
12709
+ if (this.isDestroyed || error instanceof PraxisDynamicFormDestroyedError)
12710
+ return;
12694
12711
  this.initializationStatus = 'error';
12695
12712
  this.isLoading = false;
12696
12713
  this.cdr.detectChanges();
@@ -19385,6 +19402,7 @@ class PraxisDynamicForm {
19385
19402
  this.cdr.detectChanges();
19386
19403
  }
19387
19404
  ngOnDestroy() {
19405
+ this.isDestroyed = true;
19388
19406
  this.assistantSessions.removeContextSession(this.buildAiAssistantContextSnapshot());
19389
19407
  this.aiAssistantStateSubscription?.unsubscribe();
19390
19408
  this.aiAssistantStateSubscription = null;
@@ -19851,6 +19869,8 @@ class PraxisDynamicForm {
19851
19869
  return { path, operation, schemaType, includeInternalSchemas: useFilterSchema, tenant, locale, baseUrl, apiOrigin };
19852
19870
  }
19853
19871
  async getSchemaWithCache() {
19872
+ if (this.isDestroyed)
19873
+ throw new PraxisDynamicFormDestroyedError();
19854
19874
  if (this.schemaCache) {
19855
19875
  this.debugLog('[PDF] schema:fromCache');
19856
19876
  return this.schemaCache;
@@ -19876,12 +19896,16 @@ class PraxisDynamicForm {
19876
19896
  }
19877
19897
  catch { }
19878
19898
  await this.waitForGlobalConfigReadyForSchema();
19899
+ if (this.isDestroyed)
19900
+ throw new PraxisDynamicFormDestroyedError();
19879
19901
  const disableCache = this.global.get('cache.disableSchemaCache');
19880
19902
  const adapter = disableCache
19881
19903
  ? new MemoryCacheAdapter()
19882
19904
  : new LocalStorageCacheAdapter({ ttlMs: 30 * 60 * 1000, maxEntries: 200 });
19883
19905
  const client = new SchemaMetadataClient(adapter);
19884
19906
  const loadLegacySchema = async (reason) => {
19907
+ if (this.isDestroyed)
19908
+ throw new PraxisDynamicFormDestroyedError();
19885
19909
  try {
19886
19910
  this.warnLog('[PDF] schema:metadata-fallback', reason);
19887
19911
  }
@@ -19896,6 +19920,8 @@ class PraxisDynamicForm {
19896
19920
  const legacyDefs = await firstValueFrom(legacyResult && typeof legacyResult.pipe === 'function'
19897
19921
  ? legacyResult.pipe(take(1))
19898
19922
  : legacyResult);
19923
+ if (this.isDestroyed)
19924
+ throw new PraxisDynamicFormDestroyedError();
19899
19925
  try {
19900
19926
  const schemaId = buildSchemaId(schemaContext);
19901
19927
  this.lastSchemaMeta = { schemaId, context: schemaContext };
@@ -19967,6 +19993,9 @@ class PraxisDynamicForm {
19967
19993
  return defs;
19968
19994
  }
19969
19995
  catch (error) {
19996
+ if (this.isDestroyed || error instanceof PraxisDynamicFormDestroyedError) {
19997
+ throw new PraxisDynamicFormDestroyedError();
19998
+ }
19970
19999
  return await loadLegacySchema(error);
19971
20000
  }
19972
20001
  finally {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@praxisui/dynamic-form",
3
- "version": "9.0.5-rc.18",
3
+ "version": "9.0.5-rc.19",
4
4
  "description": "Angular dynamic form engine for Praxis UI: metadata-driven forms, hooks, and services integrating @praxisui/* packages.",
5
5
  "peerDependencies": {
6
6
  "@angular/common": "^21.0.0",
@@ -9,13 +9,13 @@
9
9
  "@angular/forms": "^21.0.0",
10
10
  "@angular/material": "^21.0.0",
11
11
  "@angular/router": "^21.0.0",
12
- "@praxisui/ai": "^9.0.5-rc.18",
13
- "@praxisui/dynamic-fields": "^9.0.5-rc.18",
14
- "@praxisui/metadata-editor": "^9.0.5-rc.18",
15
- "@praxisui/rich-content": "^9.0.5-rc.18",
16
- "@praxisui/settings-panel": "^9.0.5-rc.18",
17
- "@praxisui/visual-builder": "^9.0.5-rc.18",
18
- "@praxisui/core": "^9.0.5-rc.18",
12
+ "@praxisui/ai": "^9.0.5-rc.19",
13
+ "@praxisui/dynamic-fields": "^9.0.5-rc.19",
14
+ "@praxisui/metadata-editor": "^9.0.5-rc.19",
15
+ "@praxisui/rich-content": "^9.0.5-rc.19",
16
+ "@praxisui/settings-panel": "^9.0.5-rc.19",
17
+ "@praxisui/visual-builder": "^9.0.5-rc.19",
18
+ "@praxisui/core": "^9.0.5-rc.19",
19
19
  "rxjs": "^7.8.0"
20
20
  },
21
21
  "dependencies": {
@@ -931,6 +931,7 @@ declare class PraxisDynamicForm implements OnInit, OnChanges, OnDestroy {
931
931
  private schemaRootReactiveDeterminations;
932
932
  private schemaRootOperationId;
933
933
  private destroy$;
934
+ private isDestroyed;
934
935
  private formValueChangesSubscription;
935
936
  private reactiveDeterminationSubscription;
936
937
  private reactiveDeterminationScheduledBuildId;