@praxisui/settings-panel 10.0.0-rc.59 → 10.0.0-rc.60

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-11-23T10:34:57.283Z",
3
+ "generatedAt": "2026-11-23T14:32:32.238Z",
4
4
  "packageName": "@praxisui/settings-panel",
5
- "packageVersion": "10.0.0-rc.59",
5
+ "packageVersion": "10.0.0-rc.60",
6
6
  "sourceRegistry": "praxis-component-registry-ingestion",
7
7
  "sourceRegistryVersion": "1.0.0",
8
8
  "componentCount": 1,
@@ -4117,11 +4117,15 @@ class GlobalConfigEditorComponent {
4117
4117
  }
4118
4118
  async ngOnInit() {
4119
4119
  await this.refreshStoredConfigState();
4120
+ if (this.destroyRef.destroyed)
4121
+ return;
4120
4122
  const cfg = this.admin.getEffectiveConfig();
4121
4123
  const flat = this.flatten(cfg);
4122
4124
  this.formConfig = buildGlobalConfigFormConfig(this.tx.bind(this));
4123
4125
  this.applyConfigSnapshot(flat, { resetForms: false });
4124
4126
  await this.loadProviderCatalog();
4127
+ if (this.destroyRef.destroyed)
4128
+ return;
4125
4129
  this.applyProviderOptions();
4126
4130
  this.applyEmbeddingProviderOptions();
4127
4131
  const providerSafe = this.safeName('ai.provider');
@@ -4141,7 +4145,7 @@ class GlobalConfigEditorComponent {
4141
4145
  this.ensureEmbeddingDimensionsDefaults(false);
4142
4146
  // Monitor API Key changes to auto-fetch
4143
4147
  this.apiKeyChanged$.pipe(debounceTime(1500), // Wait for typing to stop
4144
- distinctUntilChanged((prev, curr) => prev.apiKey === curr.apiKey && prev.provider === curr.provider), filter(({ apiKey, provider }) => this.canAutoRefreshModels(provider, apiKey))).subscribe(() => {
4148
+ distinctUntilChanged((prev, curr) => prev.apiKey === curr.apiKey && prev.provider === curr.provider), filter(({ apiKey, provider }) => this.canAutoRefreshModels(provider, apiKey)), takeUntilDestroyed(this.destroyRef)).subscribe(() => {
4145
4149
  this.refreshModels();
4146
4150
  });
4147
4151
  if (this.hasApiKey && this.selectedProvider?.supportsModels !== false) {
@@ -4184,7 +4188,11 @@ class GlobalConfigEditorComponent {
4184
4188
  }
4185
4189
  }
4186
4190
  if (this.hasApiKey) {
4187
- setTimeout(() => this.ensureAiModelForm(), 0);
4191
+ setTimeout(() => {
4192
+ if (!this.destroyRef.destroyed) {
4193
+ this.ensureAiModelForm();
4194
+ }
4195
+ }, 0);
4188
4196
  }
4189
4197
  else {
4190
4198
  if (this.aiModelFormRef) {
@@ -4236,6 +4244,9 @@ class GlobalConfigEditorComponent {
4236
4244
  };
4237
4245
  }
4238
4246
  bootstrapDynamicForms() {
4247
+ if (this.destroyRef.destroyed) {
4248
+ return;
4249
+ }
4239
4250
  if (!this.dynamicFormCtor) {
4240
4251
  if (!this.loggedMissingDynamicForm) {
4241
4252
  this.logger.warnOnce('[GlobalConfigEditor] Dynamic form component was not provided. Set GLOBAL_CONFIG_DYNAMIC_FORM_COMPONENT to enable form rendering.', this.buildLogOptions({ token: 'GLOBAL_CONFIG_DYNAMIC_FORM_COMPONENT' }, { dedupeKey: 'global-config-editor:missing-dynamic-form' }));
@@ -4254,6 +4265,10 @@ class GlobalConfigEditorComponent {
4254
4265
  { id: 'ai-embedding', host: this.hostAiEmbedding, cfg: this.buildSectionConfig('ai-embedding') },
4255
4266
  ];
4256
4267
  for (const g of groups) {
4268
+ if (this.destroyRef.destroyed) {
4269
+ return;
4270
+ }
4271
+ let ref = null;
4257
4272
  try {
4258
4273
  if (!g.host) {
4259
4274
  this.logger.warnOnce('[GlobalConfigEditor] Missing host for section', this.buildLogOptions({ sectionId: g.id }, {
@@ -4266,7 +4281,7 @@ class GlobalConfigEditorComponent {
4266
4281
  context: { actionId: `section.${g.id}` },
4267
4282
  throttleKey: 'global-config-editor:create-form-section',
4268
4283
  }));
4269
- const ref = g.host.createComponent(this.dynamicFormCtor);
4284
+ ref = g.host.createComponent(this.dynamicFormCtor);
4270
4285
  ref.setInput('config', g.cfg);
4271
4286
  ref.setInput('mode', 'edit');
4272
4287
  // Não habilitar o modo de edição de layout (canvas) - queremos apenas edição de valores
@@ -4294,7 +4309,10 @@ class GlobalConfigEditorComponent {
4294
4309
  }
4295
4310
  catch { }
4296
4311
  if (inst?.valueChange?.subscribe) {
4297
- inst.valueChange.subscribe((ev) => this.onValueChange(g.id, ev));
4312
+ const stream = typeof inst.valueChange.pipe === 'function'
4313
+ ? inst.valueChange.pipe(takeUntilDestroyed(this.destroyRef))
4314
+ : inst.valueChange;
4315
+ stream.subscribe((ev) => this.onValueChange(g.id, ev));
4298
4316
  }
4299
4317
  this.componentRefs.set(g.id, ref);
4300
4318
  if (g.id === 'dialog') {
@@ -4304,12 +4322,27 @@ class GlobalConfigEditorComponent {
4304
4322
  if (g.id === 'ai-embedding') {
4305
4323
  this.aiEmbeddingFormRef = ref;
4306
4324
  }
4325
+ if (this.destroyRef.destroyed) {
4326
+ try {
4327
+ ref.destroy();
4328
+ }
4329
+ catch { }
4330
+ this.componentRefs.delete(g.id);
4331
+ return;
4332
+ }
4333
+ const createdRef = ref;
4307
4334
  this.destroyRef.onDestroy(() => { try {
4308
- ref.destroy();
4335
+ createdRef.destroy();
4309
4336
  }
4310
4337
  catch { } });
4311
4338
  }
4312
4339
  catch (err) {
4340
+ if (ref) {
4341
+ try {
4342
+ ref.destroy();
4343
+ }
4344
+ catch { }
4345
+ }
4313
4346
  this.logger.error('[GlobalConfigEditor] Failed to create form section', this.buildLogOptions({ sectionId: g.id, error: err }, { context: { actionId: `section.${g.id}.create` } }));
4314
4347
  }
4315
4348
  }
@@ -4634,17 +4667,18 @@ class GlobalConfigEditorComponent {
4634
4667
  this.syncEmbeddingDefaults();
4635
4668
  }
4636
4669
  createAiModelForm() {
4637
- if (!this.dynamicFormCtor || !this.hostAiModel)
4670
+ if (this.destroyRef.destroyed || !this.dynamicFormCtor || !this.hostAiModel)
4638
4671
  return;
4639
4672
  const cfg = this.buildSectionConfig('ai-model');
4640
4673
  if (!cfg.sections?.length)
4641
4674
  return;
4675
+ let ref = null;
4642
4676
  try {
4643
4677
  // Apply pending options to metadata before creating
4644
4678
  if (this.pendingModelOptions.length) {
4645
4679
  this.setModelFieldOptions(this.pendingModelOptions);
4646
4680
  }
4647
- const ref = this.hostAiModel.createComponent(this.dynamicFormCtor);
4681
+ ref = this.hostAiModel.createComponent(this.dynamicFormCtor);
4648
4682
  ref.setInput('config', cfg);
4649
4683
  ref.setInput('mode', 'edit');
4650
4684
  ref.setInput('enableCustomization', false);
@@ -4670,17 +4704,34 @@ class GlobalConfigEditorComponent {
4670
4704
  }
4671
4705
  catch { }
4672
4706
  if (inst?.valueChange?.subscribe) {
4673
- inst.valueChange.subscribe((ev) => this.onValueChange('ai-model', ev));
4707
+ const stream = typeof inst.valueChange.pipe === 'function'
4708
+ ? inst.valueChange.pipe(takeUntilDestroyed(this.destroyRef))
4709
+ : inst.valueChange;
4710
+ stream.subscribe((ev) => this.onValueChange('ai-model', ev));
4711
+ }
4712
+ if (this.destroyRef.destroyed) {
4713
+ try {
4714
+ ref.destroy();
4715
+ }
4716
+ catch { }
4717
+ return;
4674
4718
  }
4675
4719
  this.componentRefs.set('ai-model', ref);
4676
4720
  this.aiModelFormRef = ref;
4677
4721
  this.updateModelDetails(this.currentValues[this.safeName('ai.model')] || '');
4722
+ const createdRef = ref;
4678
4723
  this.destroyRef.onDestroy(() => { try {
4679
- ref.destroy();
4724
+ createdRef.destroy();
4680
4725
  }
4681
4726
  catch { } });
4682
4727
  }
4683
4728
  catch (err) {
4729
+ if (ref) {
4730
+ try {
4731
+ ref.destroy();
4732
+ }
4733
+ catch { }
4734
+ }
4684
4735
  this.logger.error('[GlobalConfigEditor] Failed to create AI model form', this.buildLogOptions({ error: err }, { context: { actionId: 'section.ai-model.create' } }));
4685
4736
  }
4686
4737
  }
package/package.json CHANGED
@@ -1,15 +1,15 @@
1
1
  {
2
2
  "name": "@praxisui/settings-panel",
3
- "version": "10.0.0-rc.59",
3
+ "version": "10.0.0-rc.60",
4
4
  "description": "Settings panel for Praxis UI libraries: open editors for configuration at runtime and persist settings.",
5
5
  "peerDependencies": {
6
6
  "@angular/common": "^21.0.0",
7
7
  "@angular/core": "^21.0.0",
8
8
  "@angular/cdk": "^21.0.0",
9
9
  "@angular/material": "^21.0.0",
10
- "@praxisui/ai": "^10.0.0-rc.59",
11
- "@praxisui/core": "^10.0.0-rc.59",
12
- "@praxisui/dynamic-fields": "^10.0.0-rc.59",
10
+ "@praxisui/ai": "^10.0.0-rc.60",
11
+ "@praxisui/core": "^10.0.0-rc.60",
12
+ "@praxisui/dynamic-fields": "^10.0.0-rc.60",
13
13
  "rxjs": "~7.8.0"
14
14
  },
15
15
  "dependencies": {