croco-html 20.4.4 → 20.4.6

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.
@@ -3428,19 +3428,24 @@ class TagEditorService {
3428
3428
 
3429
3429
  class DefinedCustomEditorBlockComponent {
3430
3430
  set tagService(data) {
3431
+ this._tagServiceSub$.next();
3431
3432
  this._tagService = data;
3432
3433
  this._tagService.tag$
3433
- .pipe(takeUntilDestroyed(this._destroyRef))
3434
+ .pipe(takeUntil(this._tagServiceSub$))
3434
3435
  .subscribe(tag => {
3435
3436
  this._tag = tag;
3436
3437
  this._cdr.markForCheck();
3437
3438
  });
3439
+ if (this.dynamicContainerRef) {
3440
+ this.dynamicContainerRef.setInput("tagService", this._tagService);
3441
+ }
3438
3442
  this._cdr.markForCheck();
3439
3443
  }
3440
3444
  constructor(_options) {
3441
3445
  this._options = _options;
3442
3446
  this._cdr = inject(ChangeDetectorRef);
3443
- this._destroyRef = inject(DestroyRef);
3447
+ this._destroy$ = new Subject();
3448
+ this._tagServiceSub$ = new Subject();
3444
3449
  this.useDynamicComponent = false;
3445
3450
  }
3446
3451
  ngOnInit() {
@@ -3454,7 +3459,11 @@ class DefinedCustomEditorBlockComponent {
3454
3459
  this._cdr.markForCheck();
3455
3460
  }
3456
3461
  ngOnDestroy() {
3457
- this.dynamicContainerRef.destroy();
3462
+ this._tagServiceSub$.next();
3463
+ this._tagServiceSub$.complete();
3464
+ this._destroy$.next();
3465
+ this._destroy$.complete();
3466
+ this.dynamicContainerRef?.destroy();
3458
3467
  }
3459
3468
  static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.15", ngImport: i0, type: DefinedCustomEditorBlockComponent, deps: [{ token: CrocoHtmlOptionsToken }], target: i0.ɵɵFactoryTarget.Component }); }
3460
3469
  static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.3.15", type: DefinedCustomEditorBlockComponent, isStandalone: true, selector: "croco-html-defined-custom-editor-block", inputs: { tagService: "tagService" }, viewQueries: [{ propertyName: "viewContainerRef", first: true, predicate: ["container"], descendants: true, read: ViewContainerRef, static: true }], ngImport: i0, template: "<ng-container #container>\n @if (!useDynamicComponent) {\n <div>\n \u0420\u0435\u0434\u0430\u043A\u0442\u043E\u0440 \u0440\u0430\u0437\u043C\u0435\u0442\u043A\u0438 \u0434\u043B\u044F {{_tag.tagDescription.tag}} \u043D\u0435 \u043E\u043F\u0438\u0441\u0430\u043D.\n </div>\n <div>\n \u0423\u0441\u0442\u0430\u043D\u043E\u0432\u0438\u0442\u0435 CrocoHtmlOptions.definedCustomTagViewRenderers[{{_tag.tagDescription.tag}}].editorComponent\n </div>\n }\n</ng-container>", changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
@@ -3475,11 +3484,12 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.15", ngImpo
3475
3484
 
3476
3485
  class MainEditorBlockComponent {
3477
3486
  set tag(data) {
3487
+ this._tagSub$.next();
3478
3488
  this._tag = data;
3479
3489
  this._tagService = new TagEditorService();
3480
3490
  this._tagService.tag$.next(this._tag);
3481
3491
  this._tagService.presentOrEdit$
3482
- .pipe(takeUntil(this.unsubscribe))
3492
+ .pipe(takeUntil(this._tagSub$))
3483
3493
  .subscribe(val => {
3484
3494
  this.presentOrEdit = val;
3485
3495
  this._cdr.markForCheck();
@@ -3489,6 +3499,7 @@ class MainEditorBlockComponent {
3489
3499
  this._options = _options;
3490
3500
  this.textTags = TextTags.allTextTags;
3491
3501
  this.unsubscribe = new Subject();
3502
+ this._tagSub$ = new Subject();
3492
3503
  this._cdr = inject(ChangeDetectorRef);
3493
3504
  this._tag = null;
3494
3505
  this.presentOrEdit = true;
@@ -3510,6 +3521,8 @@ class MainEditorBlockComponent {
3510
3521
  this.onTagRemoved.emit(this._tag);
3511
3522
  }
3512
3523
  ngOnDestroy() {
3524
+ this._tagSub$.next();
3525
+ this._tagSub$.complete();
3513
3526
  this.unsubscribe.next();
3514
3527
  this.unsubscribe.complete();
3515
3528
  }