working on patching vcards

This commit is contained in:
2025-10-08 16:02:40 +02:00
parent 3df91f1b9d
commit 2f3a29d606
7 changed files with 98 additions and 7 deletions

View File

@@ -1,12 +1,18 @@
<script>
import LineEditor from '../../Components/LineEditor.svelte';
import { fn } from '../../vcard.js';
import { t } from '../../translations.svelte';
let { vcard } = $props();
let { code, patch = (from, to) => true } = $props();
let name = $derived(fn(vcard));
let name = $derived(fn(code));
function onSet(newVal){
const newCode = code.replace(name,newVal);
return patch(code,newCode);
}
</script>
{#if name}
<span class="formatted name">{name}</span>
<LineEditor type="span" editable={true} value={name} {onSet} />
{/if}