cloud-ide-element 1.0.64 → 1.0.65

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.
@@ -4499,46 +4499,20 @@ class CideEleFileImageDirective {
4499
4499
  }
4500
4500
  displayImage(fileData) {
4501
4501
  const imgElement = this.elementRef.nativeElement;
4502
- // Check if it's an image file
4503
- const isImage = this.isImageFile(fileData.cyfm_name || '', fileData.cyfm_type || '');
4504
- if (isImage) {
4505
- // For now, we'll use a placeholder or the file path
4506
- // In a real implementation, you might need to fetch the actual file content
4507
- if (fileData.cyfm_path) {
4508
- // If you have a direct URL to the file, use it
4509
- imgElement.src = fileData.cyfm_path;
4510
- imgElement.alt = fileData.cyfm_alt_text || this.altText;
4511
- console.log('✅ [FileImageDirective] Image loaded from path:', fileData.cyfm_path);
4512
- }
4513
- else if (fileData.cyfm_file_base64) {
4514
- // If base64 data is available, use it
4515
- let base64Data = fileData.cyfm_file_base64;
4516
- if (!base64Data.startsWith('data:')) {
4517
- const mimeType = fileData.cyfm_type || 'image/jpeg';
4518
- base64Data = `data:${mimeType};base64,${base64Data}`;
4519
- }
4520
- imgElement.src = base64Data;
4521
- imgElement.alt = fileData.cyfm_alt_text || this.altText;
4522
- console.log('✅ [FileImageDirective] Image loaded from base64 data');
4523
- }
4524
- else {
4525
- console.warn('⚠️ [FileImageDirective] No image data available for file:', fileData.cyfm_name);
4502
+ // Use base64 data directly
4503
+ if (fileData.cyfm_file_base64) {
4504
+ let base64Data = fileData.cyfm_file_base64;
4505
+ if (!base64Data.startsWith('data:')) {
4506
+ const mimeType = fileData.cyfm_type || 'image/jpeg';
4507
+ base64Data = `data:${mimeType};base64,${base64Data}`;
4526
4508
  }
4509
+ imgElement.src = base64Data;
4510
+ imgElement.alt = fileData.cyfm_alt_text || this.altText;
4511
+ console.log('✅ [FileImageDirective] Image loaded from base64 data');
4527
4512
  }
4528
4513
  else {
4529
- console.warn('⚠️ [FileImageDirective] File is not an image:', fileData.cyfm_name);
4530
- }
4531
- }
4532
- isImageFile(fileName, fileType) {
4533
- if (fileType && fileType.startsWith('image/')) {
4534
- return true;
4514
+ console.warn('⚠️ [FileImageDirective] No base64 data available for file');
4535
4515
  }
4536
- if (fileName) {
4537
- const imageExtensions = ['.jpg', '.jpeg', '.png', '.gif', '.bmp', '.webp', '.svg'];
4538
- const lowerFileName = fileName.toLowerCase();
4539
- return imageExtensions.some(ext => lowerFileName.endsWith(ext));
4540
- }
4541
- return false;
4542
4516
  }
4543
4517
  static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.1.7", ngImport: i0, type: CideEleFileImageDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive });
4544
4518
  static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "20.1.7", type: CideEleFileImageDirective, isStandalone: true, selector: "[cideEleFileImage]", inputs: { fileId: "fileId", altText: "altText" }, ngImport: i0 });