Configuración general
patchVisual({ basePath: e.currentTarget.value || undefined })}
placeholder={catDefaults.basePath || 'Heredado del catálogo'}
class="field-input text-xs font-mono" />
patchVisual({ fallback: e.currentTarget.value || undefined })}
placeholder={catDefaults.fallback || 'Heredado del catálogo'}
class="field-input text-xs font-mono" />
{#if views.length > 0}
{:else}
Añade vistas desde el panel lateral.
{/if}
{:else if selectedView && (selected as any).kind === 'view'}
{@const view = selectedView}
{@const isNew = newViewId === view.id}
{isNew ? 'Nueva vista' : (getLabelStr(view.label) || view.code)}
{#if isNew}
{:else}
{/if}
{#if isNew}
vw_
viewIdError = ''}
onkeydown={e => { if (e.key === 'Enter') saveViewNew() }}
placeholder="frontal, detalle-rueda…"
class={['field-input font-mono text-xs flex-1', viewIdError ? 'border-red-600' : ''].join(' ')} />
{#if viewIdError}
{viewIdError}{/if}
{:else}
{view.id}
{/if}
updateView(view.id, { label: v as any })} />
updateView(view.id, { icon: e.currentTarget.value || undefined })}
placeholder="car-front, image, eye…"
class="field-input text-xs font-mono" />
{#if view.config.strategy === 'static'}
updateView(view.id, { config: { ...view.config, url: e.currentTarget.value } as any })}
placeholder="images/front.jpg"
class="field-input font-mono text-xs" />
{:else if view.config.strategy === 'dynamic'}
updateView(view.id, { config: { ...view.config, template: e.currentTarget.value } as any })}
placeholder={"car_{at_color}.jpg"}
class="field-input font-mono text-xs" />
{:else if view.config.strategy === 'api'}
updateView(view.id, { config: { ...view.config, endpoint: e.currentTarget.value } as any })}
placeholder="https://render.example.com"
class="field-input font-mono text-xs" />
{:else if view.config.strategy === 'd3'}
updateView(view.id, { config: { ...view.config, modelUrl: e.currentTarget.value } as any })}
placeholder="models/object.glb"
class="field-input font-mono text-xs" />
{:else}
Editable en modo avanzado
{/if}
updateView(view.id, {
metadata: Object.keys(m).filter(k => k !== 'order').length === 0 ? undefined : m
})} />
{:else if selectedView && selectedHotspot && (selected as any).kind === 'hotspot'}
{@const view = selectedView}
{@const hs = selectedHotspot}
{@const isNew = newHotspotId === hs.id}
{isNew ? 'Nuevo hotspot' : (getLabelStr(hs.label) || hs.id)}
{#if isNew}
{:else}
{/if}
{#if isNew}
hs_
hotspotIdError = ''}
onkeydown={e => { if (e.key === 'Enter') saveHotspotNew() }}
placeholder="rueda, interior…"
class={['field-input font-mono text-xs flex-1', hotspotIdError ? 'border-red-600' : ''].join(' ')} />
{#if hotspotIdError}
{hotspotIdError}{/if}
{:else}
{hs.id}
{/if}
updateHotspot(view.id, hs.id, { label: v as any })} />
updateHotspot(view.id, hs.id, { tooltip: (Object.keys(v).length ? v : undefined) as any })} />
updateHotspot(view.id, hs.id, {
metadata: Object.keys(m).filter(k => k !== 'order').length === 0 ? undefined : m
})} />