avo-rhino_field 0.0.13 → 0.0.15

Sign up to get free protection for your applications and to get access to all the features.
@@ -39,16 +39,16 @@
39
39
  class="h-3.5 w-5 bg-transparent -mt-px -mb-1"
40
40
  />
41
41
  </button>
42
- <button
43
- type="button"
42
+ <a
44
43
  slot="before-attach-files-button"
45
44
  class="toolbar__button rhino-toolbar-button flex flex-col items-center grow-0 text-sm hidden-until-rhino-boots-up"
46
45
  data-role="toolbar-item"
47
46
  tabindex="-1"
48
- data-action="click->rhino-field#openGallery"
47
+ href="<%= helpers.avo.attach_media_path(resource_name: @resource.name, record_id: @resource.id, controller_selector: ".#{unique_id}", controller_name: 'rhino-field') %>"
48
+ data-turbo-frame="<%= ::Avo::MODAL_FRAME_ID %>"
49
49
  >
50
50
  <%= helpers.svg "heroicons/outline/photo", class: "!min-h-4 !max-h-4" %>
51
- </button>
51
+ </a>
52
52
  <% end %>
53
53
  <%= @form.text_area @field.id,
54
54
  value: @field.value.try(:to_trix_html) || @field.value,
@@ -1,14 +1,21 @@
1
- <%= field_wrapper **field_wrapper_args do %>
2
- <%
3
- content_classes = 'trix-content py-2 max-w-4xl'
4
- content_classes << ' hidden' unless @field.always_show
5
- %>
6
- <div data-controller="hidden-input">
7
- <% unless @field.always_show %>
8
- <%= link_to t('avo.show_content'), 'javascript:void(0);', class: 'font-bold inline-block', data: { action: 'click->hidden-input#showContent' } %>
9
- <% end %>
10
- <div class="<%= content_classes %> " data-hidden-input-target="content">
11
- <%= @field.value.html_safe %>
1
+ <%= field_wrapper(**field_wrapper_args, full_width: true, data: { controller: 'hidden-input' }) do %>
2
+ <% button_classes = 'font-semibold inline-block pt-3 text-sm' %>
3
+ <%= content_tag :div,
4
+ class: "flex flex-col w-full",
5
+ data: {
6
+ controller: "trix-body hidden-input",
7
+ trix_body_always_show_value: @field.always_show
8
+ } do %>
9
+ <div class="<%= class_names("trix-content border-none px-0 py-2 max-w-4xl", "hidden": !@field.always_show) %>" data-trix-body-target="content" data-hidden-input-target="content">
10
+ <%== @field.value %>
12
11
  </div>
13
- </div>
12
+ <% if true %>
13
+ <div class="hidden" data-trix-body-target="moreContentButton">
14
+ <%= link_to t('avo.more_content'), 'javascript:void(0);', class: button_classes, data: { action: 'click->trix-body#toggleContent' } %>
15
+ </div>
16
+ <div class="hidden" data-trix-body-target="lessContentButton">
17
+ <%= link_to t('avo.less_content'), 'javascript:void(0);', class: button_classes, data: { action: 'click->trix-body#toggleContent' } %>
18
+ </div>
19
+ <% end %>
20
+ <% end %>
14
21
  <% end %>
@@ -1,5 +1,5 @@
1
1
  module Avo
2
2
  module RhinoField
3
- VERSION = "0.0.13" unless const_defined?(:VERSION)
3
+ VERSION = "0.0.15"
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: avo-rhino_field
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.13
4
+ version: 0.0.15
5
5
  platform: ruby
6
6
  authors:
7
7
  - Adrian Marin
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2024-12-29 00:00:00.000000000 Z
11
+ date: 2025-01-30 00:00:00.000000000 Z
12
12
  dependencies: []
13
13
  description: rhino field for Avo.
14
14
  email: adrian@adrianthedev.com