|
|
|
|
@ -8,8 +8,6 @@
|
|
|
|
|
onFieldChange: (field: MetadataField) => void;
|
|
|
|
|
} = $props();
|
|
|
|
|
|
|
|
|
|
const cls = 'rounded border border-gray-700 bg-gray-800 px-2 py-1.5 text-sm text-gray-200 focus:outline-none focus:ring-2 focus:ring-blue-500 w-full';
|
|
|
|
|
|
|
|
|
|
function handle(e: Event, action: string): void {
|
|
|
|
|
const inp = e.target as HTMLInputElement;
|
|
|
|
|
const sel = e.target as HTMLSelectElement;
|
|
|
|
|
@ -24,8 +22,8 @@
|
|
|
|
|
</script>
|
|
|
|
|
|
|
|
|
|
<div class="flex flex-col gap-1 w-full">
|
|
|
|
|
<label class="text-xs font-medium text-gray-500">{glob.t('vcen.editor.mtas.editor.mediaUrlLabel')}</label>
|
|
|
|
|
<input type="text" value={field.value.url} oninput={(e) => handle(e, 'url')} class="{cls} font-mono" placeholder="/ruta o https://…" />
|
|
|
|
|
<label class="ve-label">{glob.t('vcen.editor.mtas.editor.mediaUrlLabel')}</label>
|
|
|
|
|
<input type="text" value={field.value.url} oninput={(e) => handle(e, 'url')} class="field-input font-mono" placeholder="/ruta o https://..." />
|
|
|
|
|
</div>
|
|
|
|
|
{#if field.value.url}
|
|
|
|
|
<figure class="rounded-lg overflow-hidden border border-gray-800">
|
|
|
|
|
@ -34,16 +32,16 @@
|
|
|
|
|
{/if}
|
|
|
|
|
<div class="flex gap-3">
|
|
|
|
|
<div class="flex flex-col gap-1 flex-1">
|
|
|
|
|
<label class="text-xs font-medium text-gray-500">{glob.t('vcen.editor.mtas.editor.imgWidth')}</label>
|
|
|
|
|
<input type="number" value={field.value.width ?? ''} oninput={(e) => handle(e, 'width')} class={cls} placeholder="px" />
|
|
|
|
|
<label class="ve-label">{glob.t('vcen.editor.mtas.editor.imgWidth')}</label>
|
|
|
|
|
<input type="number" value={field.value.width ?? ''} oninput={(e) => handle(e, 'width')} class="field-input" placeholder="px" />
|
|
|
|
|
</div>
|
|
|
|
|
<div class="flex flex-col gap-1 flex-1">
|
|
|
|
|
<label class="text-xs font-medium text-gray-500">{glob.t('vcen.editor.mtas.editor.imgHeight')}</label>
|
|
|
|
|
<input type="number" value={field.value.height ?? ''} oninput={(e) => handle(e, 'height')} class={cls} placeholder="px" />
|
|
|
|
|
<label class="ve-label">{glob.t('vcen.editor.mtas.editor.imgHeight')}</label>
|
|
|
|
|
<input type="number" value={field.value.height ?? ''} oninput={(e) => handle(e, 'height')} class="field-input" placeholder="px" />
|
|
|
|
|
</div>
|
|
|
|
|
<div class="flex flex-col gap-1 w-32">
|
|
|
|
|
<label class="text-xs font-medium text-gray-500">{glob.t('vcen.editor.mtas.editor.imgFormat')}</label>
|
|
|
|
|
<select class="rounded border border-gray-700 bg-gray-800 px-2 py-1.5 text-sm text-gray-200 focus:outline-none focus:ring-2 focus:ring-blue-500 w-full" value={field.value.format ?? ''} onchange={(e) => handle(e, 'format')}>
|
|
|
|
|
<label class="ve-label">{glob.t('vcen.editor.mtas.editor.imgFormat')}</label>
|
|
|
|
|
<select class="field-input" value={field.value.format ?? ''} onchange={(e) => handle(e, 'format')}>
|
|
|
|
|
<option value="">—</option>
|
|
|
|
|
<option value="jpeg">JPEG</option>
|
|
|
|
|
<option value="png">PNG</option>
|
|
|
|
|
|