cloud-ide-element 1.1.142 → 1.1.145
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.
|
@@ -7993,12 +7993,12 @@ class CideThemeService {
|
|
|
7993
7993
|
// Apply class name
|
|
7994
7994
|
if (this.config.useClassName) {
|
|
7995
7995
|
if (theme === 'dark') {
|
|
7996
|
-
element.classList.add('dark-mode');
|
|
7996
|
+
element.classList.add('dark-mode', 'dark');
|
|
7997
7997
|
element.classList.remove('light-mode');
|
|
7998
7998
|
}
|
|
7999
7999
|
else {
|
|
8000
8000
|
element.classList.add('light-mode');
|
|
8001
|
-
element.classList.remove('dark-mode');
|
|
8001
|
+
element.classList.remove('dark-mode', 'dark');
|
|
8002
8002
|
}
|
|
8003
8003
|
}
|
|
8004
8004
|
// Also apply to body for better compatibility
|
|
@@ -8008,12 +8008,12 @@ class CideThemeService {
|
|
|
8008
8008
|
}
|
|
8009
8009
|
if (this.config.useClassName) {
|
|
8010
8010
|
if (theme === 'dark') {
|
|
8011
|
-
document.body.classList.add('dark-mode');
|
|
8011
|
+
document.body.classList.add('dark-mode', 'dark');
|
|
8012
8012
|
document.body.classList.remove('light-mode');
|
|
8013
8013
|
}
|
|
8014
8014
|
else {
|
|
8015
8015
|
document.body.classList.add('light-mode');
|
|
8016
|
-
document.body.classList.remove('dark-mode');
|
|
8016
|
+
document.body.classList.remove('dark-mode', 'dark');
|
|
8017
8017
|
}
|
|
8018
8018
|
}
|
|
8019
8019
|
}
|
|
@@ -9533,14 +9533,37 @@ class CideEleFileImageDirective {
|
|
|
9533
9533
|
fileManagerService = inject(CideEleFileManagerService);
|
|
9534
9534
|
elementRef = inject(ElementRef);
|
|
9535
9535
|
destroyRef = inject(DestroyRef);
|
|
9536
|
+
previousFileId = null;
|
|
9536
9537
|
ngOnInit() {
|
|
9537
9538
|
this.loadImage();
|
|
9539
|
+
this.previousFileId = this.fileId;
|
|
9540
|
+
}
|
|
9541
|
+
ngOnChanges(changes) {
|
|
9542
|
+
// Check if fileId has changed
|
|
9543
|
+
if (changes['fileId'] && !changes['fileId'].firstChange) {
|
|
9544
|
+
const currentFileId = changes['fileId'].currentValue;
|
|
9545
|
+
const previousFileId = changes['fileId'].previousValue;
|
|
9546
|
+
// Only reload if the fileId actually changed
|
|
9547
|
+
if (currentFileId !== previousFileId) {
|
|
9548
|
+
console.log('🔄 [FileImageDirective] File ID changed from', previousFileId, 'to', currentFileId);
|
|
9549
|
+
this.previousFileId = currentFileId;
|
|
9550
|
+
// If fileId is null or empty, clear the image
|
|
9551
|
+
if (!currentFileId || currentFileId.trim() === '') {
|
|
9552
|
+
this.clearImage();
|
|
9553
|
+
}
|
|
9554
|
+
else {
|
|
9555
|
+
// Load the new image
|
|
9556
|
+
this.loadImage();
|
|
9557
|
+
}
|
|
9558
|
+
}
|
|
9559
|
+
}
|
|
9538
9560
|
}
|
|
9539
9561
|
ngOnDestroy() {
|
|
9540
9562
|
// Cleanup handled by takeUntilDestroyed
|
|
9541
9563
|
}
|
|
9542
9564
|
loadImage() {
|
|
9543
|
-
if (!this.fileId) {
|
|
9565
|
+
if (!this.fileId || this.fileId.trim() === '') {
|
|
9566
|
+
this.clearImage();
|
|
9544
9567
|
return;
|
|
9545
9568
|
}
|
|
9546
9569
|
console.log('🖼️ [FileImageDirective] Loading image for ID:', this.fileId);
|
|
@@ -9553,13 +9576,21 @@ class CideEleFileImageDirective {
|
|
|
9553
9576
|
}
|
|
9554
9577
|
else {
|
|
9555
9578
|
console.warn('⚠️ [FileImageDirective] No file data found for ID:', this.fileId);
|
|
9579
|
+
this.clearImage();
|
|
9556
9580
|
}
|
|
9557
9581
|
},
|
|
9558
9582
|
error: (error) => {
|
|
9559
9583
|
console.error('❌ [FileImageDirective] Error loading file details:', error);
|
|
9584
|
+
this.clearImage();
|
|
9560
9585
|
}
|
|
9561
9586
|
});
|
|
9562
9587
|
}
|
|
9588
|
+
clearImage() {
|
|
9589
|
+
const imgElement = this.elementRef.nativeElement;
|
|
9590
|
+
imgElement.src = '';
|
|
9591
|
+
imgElement.alt = this.altText;
|
|
9592
|
+
console.log('🧹 [FileImageDirective] Image cleared');
|
|
9593
|
+
}
|
|
9563
9594
|
displayImage(fileData) {
|
|
9564
9595
|
const imgElement = this.elementRef.nativeElement;
|
|
9565
9596
|
// Use base64 data directly
|
|
@@ -9578,7 +9609,7 @@ class CideEleFileImageDirective {
|
|
|
9578
9609
|
}
|
|
9579
9610
|
}
|
|
9580
9611
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.15", ngImport: i0, type: CideEleFileImageDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive });
|
|
9581
|
-
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "20.3.15", type: CideEleFileImageDirective, isStandalone: true, selector: "[cideEleFileImage]", inputs: { fileId: "fileId", altText: "altText" }, ngImport: i0 });
|
|
9612
|
+
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "20.3.15", type: CideEleFileImageDirective, isStandalone: true, selector: "[cideEleFileImage]", inputs: { fileId: "fileId", altText: "altText" }, usesOnChanges: true, ngImport: i0 });
|
|
9582
9613
|
}
|
|
9583
9614
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.15", ngImport: i0, type: CideEleFileImageDirective, decorators: [{
|
|
9584
9615
|
type: Directive,
|