@dmitryvim/form-builder 0.1.21 → 0.1.22

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.
@@ -230,7 +230,7 @@ function renderElement(element, ctx) {
230
230
  size: 0,
231
231
  file: null // No local file for prefill data
232
232
  });
233
- console.log(`🔧 Added prefill file '${element.key}' to resourceIndex:`, initial);
233
+
234
234
  }
235
235
  renderFilePreview(fileContainer, initial, initial, '', false).catch(console.error);
236
236
  } else {
@@ -339,7 +339,7 @@ function renderElement(element, ctx) {
339
339
  size: 0,
340
340
  file: null // No local file for prefill data
341
341
  });
342
- console.log(`🔧 Added prefill file to resourceIndex:`, resourceId);
342
+
343
343
  }
344
344
  });
345
345
  }
@@ -581,6 +581,7 @@ function makeFieldHint(element) {
581
581
  }
582
582
 
583
583
  async function renderFilePreview(container, resourceId, fileName, fileType, isReadonly = false) {
584
+
584
585
  // Don't change container className - preserve max-w-xs and other styling
585
586
 
586
587
  // Clear container content first
@@ -596,9 +597,9 @@ async function renderFilePreview(container, resourceId, fileName, fileType, isRe
596
597
 
597
598
  // Use stored file from resourceIndex if available, or try getThumbnail
598
599
  const meta = state.resourceIndex.get(resourceId);
599
- console.log(`🔧 renderFilePreview debug:`, { resourceId, meta, hasGetThumbnail: !!state.config.getThumbnail });
600
+
600
601
  if (meta && meta.file && meta.file instanceof File) {
601
- console.log(`🔧 Using local file branch`);
602
+
602
603
  // For local files, use FileReader to display preview
603
604
  if (meta.type && meta.type.startsWith('image/')) {
604
605
  const reader = new FileReader();
@@ -634,11 +635,11 @@ async function renderFilePreview(container, resourceId, fileName, fileType, isRe
634
635
  });
635
636
  }
636
637
  } else if (state.config.getThumbnail) {
637
- console.log(`🔧 Using getThumbnail branch for resourceId:`, resourceId);
638
+
638
639
  // Try to get thumbnail from config for uploaded files
639
640
  try {
640
641
  const thumbnailUrl = await state.config.getThumbnail(resourceId);
641
- console.log(`📸 getThumbnail called with result:`, { resourceId, thumbnailUrl });
642
+
642
643
  if (thumbnailUrl) {
643
644
  img.src = thumbnailUrl;
644
645
  container.appendChild(img);
package/package.json CHANGED
@@ -3,7 +3,7 @@
3
3
  "publishConfig": {
4
4
  "access": "public"
5
5
  },
6
- "version": "0.1.21",
6
+ "version": "0.1.22",
7
7
  "description": "A reusable JSON schema form builder library",
8
8
  "main": "dist/form-builder.js",
9
9
  "files": [