disallowList = explode(',', $value); } public function render(): string { $editorClass = 'w-full flex flex-col bg-elevated border-3 border-contrast rounded-lg overflow-hidden focus-within:ring-accent ' . $this->class; $this->attributes['class'] = 'bg-elevated border-none focus:border-none focus:outline-none focus:ring-0 w-full h-full'; $this->attributes['rows'] = 6; $value = htmlspecialchars_decode($this->value); $oldValue = old($this->name); if ($oldValue === null) { $oldValue = $value; } $textarea = form_textarea($this->attributes, $oldValue); $markdownIcon = icon( 'markdown', 'mr-1 text-lg opacity-40' ); $translations = [ 'write' => lang('Common.forms.editor.write'), 'preview' => lang('Common.forms.editor.preview'), 'help' => lang('Common.forms.editor.help'), ]; $toolbarGroups = [ [ [ 'name' => 'header', 'tag' => 'md-header', 'icon' => icon('heading'), ], [ 'name' => 'bold', 'tag' => 'md-bold', 'icon' => icon('bold'), ], [ 'name' => 'italic', 'tag' => 'md-italic', 'icon' => icon('italic'), ], ], [ [ 'name' => 'unordered-list', 'tag' => 'md-unordered-list', 'icon' => icon('list-unordered'), ], [ 'name' => 'ordered-list', 'tag' => 'md-ordered-list ', 'icon' => icon('list-ordered'), ], ], [ [ 'name' => 'quote', 'tag' => 'md-quote', 'icon' => icon('quote'), ], [ 'name' => 'link', 'tag' => 'md-link', 'icon' => icon('link'), ], [ 'name' => 'image', 'tag' => 'md-image', 'icon' => icon('image-add'), ], ], ]; $toolbarContent = ''; foreach ($toolbarGroups as $buttonsGroup) { $toolbarContent .= '