wip image templates

This commit is contained in:
2026-05-14 19:24:25 +03:00
parent 0725366dd5
commit ef29e4d261
9 changed files with 195 additions and 443 deletions
@@ -3,7 +3,6 @@
import { getErrorMessage } from "./errorMessage";
import RichEditorFiles from "./RichEditorFiles.svelte";
export let value;
export let field;
export let graph;
@@ -14,24 +13,24 @@
$: errorMessage = getErrorMessage(validationErrors, field.name);
let editor;
function insertMedia(e){
editor.insertMedia(e.detail)
function insertMedia(e) {
editor.insertMedia(e.detail);
}
</script>
<div class="mb-3">
<Codemirror bind:this={editor} bind:value editable={!field.readonly || isCreateMode} />
{#if field.collections.length > 0}
<RichEditorFiles
bind:graph
{record}
{field}
{validationErrors}
on:editor-insert={insertMedia}
>
</RichEditorFiles>
{/if}
<Codemirror
bind:this={editor}
bind:value
editable={!field.readonly || isCreateMode}
/>
<RichEditorFiles
bind:graph
{record}
{field}
{validationErrors}
on:editor-insert={insertMedia}
></RichEditorFiles>
{#if errorMessage}
<div class="invalid-feedback d-block">
{errorMessage}