|
|
|
@ -1,4 +1,10 @@
|
|
|
|
<% link_tooltip_html = capture do %>
|
|
|
|
<% if value.to_s.start_with?('<html') %>
|
|
|
|
|
|
|
|
<autoresize-textarea>
|
|
|
|
|
|
|
|
<%= text_area_tag name, value, required: true, class: 'base-input w-full py-2 !rounded-2xl', dir: 'auto', style: 'max-height: 400px' %>
|
|
|
|
|
|
|
|
</autoresize-textarea>
|
|
|
|
|
|
|
|
<% else %>
|
|
|
|
|
|
|
|
<markdown-editor>
|
|
|
|
|
|
|
|
<template data-target="markdown-editor.linkTooltipTemplate">
|
|
|
|
<div class="hidden absolute flex bg-white border border-base-300 rounded-xl shadow p-1 gap-1 items-center z-50" contenteditable="false">
|
|
|
|
<div class="hidden absolute flex bg-white border border-base-300 rounded-xl shadow p-1 gap-1 items-center z-50" contenteditable="false">
|
|
|
|
<input type="text" placeholder="<%= t('enter_a_url_or_variable_name') %>" class="rounded-lg border border-base-300 px-2 py-1 text-sm outline-none" style="field-sizing: content; min-width: 205px; max-width: 320px;" autocomplete="off">
|
|
|
|
<input type="text" placeholder="<%= t('enter_a_url_or_variable_name') %>" class="rounded-lg border border-base-300 px-2 py-1 text-sm outline-none" style="field-sizing: content; min-width: 205px; max-width: 320px;" autocomplete="off">
|
|
|
|
<button type="button" data-role="link-save" class="flex items-center px-1 w-6 h-6 rounded hover:bg-success/10 cursor-pointer">
|
|
|
|
<button type="button" data-role="link-save" class="flex items-center px-1 w-6 h-6 rounded hover:bg-success/10 cursor-pointer">
|
|
|
|
@ -8,8 +14,7 @@
|
|
|
|
<%= svg_icon('x', class: 'w-4 h-4 text-error') %>
|
|
|
|
<%= svg_icon('x', class: 'w-4 h-4 text-error') %>
|
|
|
|
</button>
|
|
|
|
</button>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<% end %>
|
|
|
|
</template>
|
|
|
|
<markdown-editor data-link-tooltip-html="<%= link_tooltip_html.squish %>">
|
|
|
|
|
|
|
|
<div class="border border-base-content/20 rounded-2xl bg-white">
|
|
|
|
<div class="border border-base-content/20 rounded-2xl bg-white">
|
|
|
|
<div class="flex items-center px-2 py-2 border-b" style="height: 42px;">
|
|
|
|
<div class="flex items-center px-2 py-2 border-b" style="height: 42px;">
|
|
|
|
<div class="flex items-center gap-1">
|
|
|
|
<div class="flex items-center gap-1">
|
|
|
|
@ -68,3 +73,4 @@
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<%= hidden_field_tag name, value, required: true, data: { target: 'markdown-editor.textarea' } %>
|
|
|
|
<%= hidden_field_tag name, value, required: true, data: { target: 'markdown-editor.textarea' } %>
|
|
|
|
</markdown-editor>
|
|
|
|
</markdown-editor>
|
|
|
|
|
|
|
|
<% end %>
|
|
|
|
|