@dmitryvim/form-builder 0.1.20 → 0.1.21
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.
- package/dist/form-builder.js +4 -0
- package/package.json +1 -1
package/dist/form-builder.js
CHANGED
|
@@ -596,7 +596,9 @@ async function renderFilePreview(container, resourceId, fileName, fileType, isRe
|
|
|
596
596
|
|
|
597
597
|
// Use stored file from resourceIndex if available, or try getThumbnail
|
|
598
598
|
const meta = state.resourceIndex.get(resourceId);
|
|
599
|
+
console.log(`🔧 renderFilePreview debug:`, { resourceId, meta, hasGetThumbnail: !!state.config.getThumbnail });
|
|
599
600
|
if (meta && meta.file && meta.file instanceof File) {
|
|
601
|
+
console.log(`🔧 Using local file branch`);
|
|
600
602
|
// For local files, use FileReader to display preview
|
|
601
603
|
if (meta.type && meta.type.startsWith('image/')) {
|
|
602
604
|
const reader = new FileReader();
|
|
@@ -632,9 +634,11 @@ async function renderFilePreview(container, resourceId, fileName, fileType, isRe
|
|
|
632
634
|
});
|
|
633
635
|
}
|
|
634
636
|
} else if (state.config.getThumbnail) {
|
|
637
|
+
console.log(`🔧 Using getThumbnail branch for resourceId:`, resourceId);
|
|
635
638
|
// Try to get thumbnail from config for uploaded files
|
|
636
639
|
try {
|
|
637
640
|
const thumbnailUrl = await state.config.getThumbnail(resourceId);
|
|
641
|
+
console.log(`📸 getThumbnail called with result:`, { resourceId, thumbnailUrl });
|
|
638
642
|
if (thumbnailUrl) {
|
|
639
643
|
img.src = thumbnailUrl;
|
|
640
644
|
container.appendChild(img);
|