@phuong-tran-redoc/document-engine-angular 0.0.26 → 0.0.27

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,5 +1,5 @@
1
1
  import * as i0 from '@angular/core';
2
- import { HostBinding, Input, Directive, inject, Injectable, ChangeDetectorRef, ElementRef, ViewEncapsulation, ChangeDetectionStrategy, Component, EventEmitter, Output, InjectionToken, HostListener, forwardRef, ContentChildren, ViewChild, ViewChildren, NgZone, ViewContainerRef, EnvironmentInjector, NgModule, ApplicationRef, createComponent, Renderer2 } from '@angular/core';
2
+ import { HostBinding, Input, Directive, inject, Injectable, ElementRef, ViewEncapsulation, ChangeDetectionStrategy, Component, EventEmitter, Output, ChangeDetectorRef, InjectionToken, HostListener, forwardRef, ContentChildren, ViewChild, ViewChildren, NgZone, ViewContainerRef, EnvironmentInjector, NgModule, ApplicationRef, createComponent, Renderer2 } from '@angular/core';
3
3
  import { Extension, Editor } from '@tiptap/core';
4
4
  import Blockquote from '@tiptap/extension-blockquote';
5
5
  import Bold from '@tiptap/extension-bold';
@@ -533,21 +533,18 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.10", ngImpo
533
533
  }], ctorParameters: () => [] });
534
534
 
535
535
  class IconComponent {
536
- name = '';
537
- cdr = inject(ChangeDetectorRef);
536
+ set name(value) {
537
+ const svgContent = this.iconRegistry.getIconString(value);
538
+ const hostElement = this.elementRef.nativeElement;
539
+ // Set innerHTML to render SVG
540
+ hostElement.innerHTML = svgContent;
541
+ // this.cdr.markForCheck();
542
+ }
543
+ // private cdr = inject(ChangeDetectorRef);
538
544
  elementRef = inject(ElementRef);
539
545
  iconRegistry = inject(IconRegistryService);
540
- ngOnChanges(changes) {
541
- if (changes['name']) {
542
- const svgContent = this.iconRegistry.getIconString(this.name);
543
- const hostElement = this.elementRef.nativeElement;
544
- // Set innerHTML to render SVG
545
- hostElement.innerHTML = svgContent;
546
- this.cdr.markForCheck();
547
- }
548
- }
549
546
  static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.10", ngImport: i0, type: IconComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
550
- static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "20.3.10", type: IconComponent, isStandalone: true, selector: "document-engine-icon", inputs: { name: "name" }, usesOnChanges: true, ngImport: i0, template: '', isInline: true, changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None });
547
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "20.3.10", type: IconComponent, isStandalone: true, selector: "document-engine-icon", inputs: { name: "name" }, ngImport: i0, template: '', isInline: true, changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None });
551
548
  }
552
549
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.10", ngImport: i0, type: IconComponent, decorators: [{
553
550
  type: Component,
@@ -4819,7 +4816,7 @@ class EditorBubbleMenuComponent {
4819
4816
  this.addDocumentClickHandler();
4820
4817
  }
4821
4818
  ngAfterViewInit() {
4822
- const bubbleElement = this.bubbleElement?.nativeElement;
4819
+ // const bubbleElement = this.bubbleElement?.nativeElement;
4823
4820
  // if (bubbleElement) {
4824
4821
  // this.focusTrap.attach(bubbleElement);
4825
4822
  // }
@@ -4985,6 +4982,9 @@ class EditorBubbleMenuComponent {
4985
4982
  this.currentViewId = viewId;
4986
4983
  // Activate new view
4987
4984
  this.activateView(this.currentViewRef);
4985
+ // Trigger change detection for the child component to render immediately
4986
+ // This is especially important for Angular v14 compatibility
4987
+ this.cdr.markForCheck();
4988
4988
  // Mark bubble as visible for transition handling
4989
4989
  const bubbleElement = this.bubbleElement?.nativeElement;
4990
4990
  if (bubbleElement && this.config.target?.requireFocus) {