- `;
- } else {
- // Check if this is a file upload widget - try multiple ways to access x-widget
- const hasXWidget = prop.hasOwnProperty('x-widget');
- const xWidgetValue = prop['x-widget'];
- const xWidgetValue2 = prop['x-widget'] || prop['x_widget'] || prop.xWidget;
-
- console.log(`[DEBUG] Array field ${fullKey}:`, {
- type: prop.type,
- hasItems: !!prop.items,
- itemsType: prop.items?.type,
- itemsHasProperties: !!prop.items?.properties,
- hasXWidget: hasXWidget,
- 'x-widget': xWidgetValue,
- 'x-widget (alt)': xWidgetValue2,
- 'x-upload-config': prop['x-upload-config'],
- propKeys: Object.keys(prop),
- value: value
- });
+ // Array - check for file upload widget first (to avoid breaking static-image plugin),
+ // then checkbox-group, then custom-feeds, then array of objects
+ const hasXWidget = prop.hasOwnProperty('x-widget');
+ const xWidgetValue = prop['x-widget'];
+ const xWidgetValue2 = prop['x-widget'] || prop['x_widget'] || prop.xWidget;
- // Check for file-upload widget - be more defensive
+ console.log(`[DEBUG] Array field ${fullKey}:`, {
+ type: prop.type,
+ hasItems: !!prop.items,
+ itemsType: prop.items?.type,
+ itemsHasProperties: !!prop.items?.properties,
+ hasXWidget: hasXWidget,
+ 'x-widget': xWidgetValue,
+ 'x-widget (alt)': xWidgetValue2,
+ 'x-upload-config': prop['x-upload-config'],
+ propKeys: Object.keys(prop),
+ value: value
+ });
+
+ // Check for file-upload widget FIRST (to avoid breaking static-image plugin)
if (xWidgetValue === 'file-upload' || xWidgetValue2 === 'file-upload') {
console.log(`[DEBUG] ✅ Detected file-upload widget for ${fullKey} - rendering upload zone`);
const uploadConfig = prop['x-upload-config'] || {};
@@ -3050,9 +3019,93 @@ function generateFieldHtml(key, prop, value, prefix = '') {
`;
});
html += ``;
+ } else if (xWidgetValue === 'custom-feeds' || xWidgetValue2 === 'custom-feeds') {
+ // Custom feeds widget - check schema validation first
+ const itemsSchema = prop.items || {};
+ const itemProperties = itemsSchema.properties || {};
+ if (!itemProperties.name || !itemProperties.url) {
+ // Schema doesn't match expected structure - fallback to regular array input
+ console.log(`[DEBUG] ⚠️ Custom feeds widget requires 'name' and 'url' properties for ${fullKey}, using regular array input`);
+ let arrayValue = '';
+ if (value === null || value === undefined) {
+ arrayValue = Array.isArray(prop.default) ? prop.default.join(', ') : '';
+ } else if (Array.isArray(value)) {
+ arrayValue = value.join(', ');
+ } else {
+ arrayValue = '';
+ }
+ html += `
+
+
Enter values separated by commas
+ `;
+ } else {
+ // Custom feeds table interface - widget-specific implementation
+ // Note: This is handled by the template, but we include it here for consistency
+ // The template renders the custom feeds table, so JS-rendered forms should match
+ console.log(`[DEBUG] ✅ Detected custom-feeds widget for ${fullKey} - note: custom feeds table is typically rendered server-side`);
+ let arrayValue = '';
+ if (value === null || value === undefined) {
+ arrayValue = Array.isArray(prop.default) ? prop.default.join(', ') : '';
+ } else if (Array.isArray(value)) {
+ arrayValue = value.join(', ');
+ } else {
+ arrayValue = '';
+ }
+ html += `
+
+
Enter values separated by commas (custom feeds table rendered server-side)
`;
+ if (propSchema.type === 'boolean') {
+ html += ``;
+ } else {
+ html += ``;
+ }
+ html += `
`;
+ });
+ html += `
`;
+ }
+ });
+
+ html += `
+
+
+
+
+ `;
} else {
- // Regular array input
- console.log(`[DEBUG] ❌ NOT a file upload widget for ${fullKey}, using regular array input`);
+ // Regular array input (comma-separated)
+ console.log(`[DEBUG] ❌ No special widget detected for ${fullKey}, using regular array input`);
// Handle null/undefined values - use default if available
let arrayValue = '';
if (value === null || value === undefined) {