feat: add xml preview

This commit is contained in:
Nybkox
2025-02-11 16:51:39 +01:00
parent 7b68dd0f47
commit aa8dfa1c87
7 changed files with 296 additions and 0 deletions

View File

@@ -44,6 +44,12 @@
component: HtmlCellView,
single: false,
},
{
type: 'xml',
title: 'XML',
component: XmlCellView,
single: false,
},
{
type: 'map',
title: 'Map',
@@ -68,6 +74,9 @@
if (_.isPlainObject(value) || _.isArray(value)) {
return 'json';
}
if (typeof value === 'string' && value.startsWith('<') && value.endsWith('>')) {
return 'xml';
}
return 'textWrap';
}
@@ -91,6 +100,7 @@
import { selectedCellsCallback } from '../stores';
import WidgetTitle from './WidgetTitle.svelte';
import JsonExpandedCellView from '../celldata/JsonExpandedCellView.svelte';
import XmlCellView from '../celldata/XmlCellView.svelte';
let selectedFormatType = 'autodetect';