now with git support

This commit is contained in:
Mark Gregory
2026-06-24 12:29:48 +01:00
parent 5c3b692618
commit 69e4e3ccca
11 changed files with 214 additions and 61 deletions
@@ -13,7 +13,7 @@
<div {{ $attributes->whereDoesntStartWith('wire:model')->merge(['class' => 'space-y-2']) }}
@if ($model) data-helpdesk-editor-model="{{ $model }}" @endif
x-on:helpdesk-editor-reset.window="if ($event.detail.model === model) clear()"
x-on:helpdesk-editor-reset.window="if ($event.detail.model === model) clear($event.detail.value || '')"
x-on:helpdesk-editor-sync.window="if ($event.detail.model === model) syncToLivewire()"
x-data="{
model: @js($model),
@@ -54,12 +54,12 @@
this.$nextTick(() => this.syncToHiddenInput());
},
clear() {
this.value = '';
this.$refs.editor.innerHTML = '';
clear(value = '') {
this.value = value || '';
this.$refs.editor.innerHTML = this.value;
if (this.model) {
this.$wire.set(this.model, '', false);
this.$wire.set(this.model, this.value, false);
}
},
init() {
@@ -103,7 +103,7 @@
class="rounded-lg px-2 py-1 text-sm hover:bg-zinc-200 dark:hover:bg-zinc-800">Clear</button>
</div>
<div x-ref="editor" contenteditable="true" spellcheck="true" lang="en-GB" autocapitalize="sentences" autocorrect="on" autocomplete="off" inputmode="text"
<div x-ref="editor" contenteditable="true" spellcheck="true" lang="en-GB" autocapitalize="sentences" autocorrect="on" inputmode="text" aria-multiline="true" role="textbox"
@if ($editorDusk) data-dusk="{{ $editorDusk }}" dusk="{{ $editorDusk }}" @endif
x-on:paste="handlePaste($event)" x-on:blur="syncToHiddenInput()"
class="helpdesk-rich-editor prose prose-sm min-h-[{{ (int) $rows * 28 }}px] max-w-none bg-white p-4 text-sm text-zinc-900 outline-none dark:prose-invert dark:bg-zinc-950 dark:text-zinc-100"