mirror of
https://github.com/ggml-org/llama.cpp.git
synced 2026-09-01 10:01:23 +02:00
fc6545d322
* feat: Add contenteditable tokenizer for badge/code-chip chat input * feat: Add source-space undo/redo history for the rich input * feat: Split text glued to a closing code fence onto its own line * feat: Add ChatFormContenteditable rich input renderer * feat : wire the contenteditable into ChatForm with auto-switch gating
28 lines
655 B
Svelte
28 lines
655 B
Svelte
<script lang="ts">
|
|
import { untrack } from 'svelte';
|
|
import ChatFormContenteditable from '$lib/components/app/chat/ChatForm/ChatFormContenteditable.svelte';
|
|
|
|
interface Props {
|
|
value?: string;
|
|
}
|
|
|
|
let { value: initial = '' }: Props = $props();
|
|
|
|
let value = $state(untrack(() => initial));
|
|
let inputRef: ChatFormContenteditable | undefined = $state(undefined);
|
|
|
|
export function getValue() {
|
|
return value;
|
|
}
|
|
|
|
export function getCaretOffset() {
|
|
return inputRef?.getCaretOffset();
|
|
}
|
|
|
|
export function setCaretOffset(offset: number) {
|
|
inputRef?.setCaretOffset(offset);
|
|
}
|
|
</script>
|
|
|
|
<ChatFormContenteditable bind:this={inputRef} bind:value />
|