tramway 3.1.2 → 3.1.2.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: b60bf123066d7c59336dba45b1dae5ab6a90b36fd54063c73f04d4fcac17ba21
4
- data.tar.gz: d1512dee19a6f92b27791ad9b6b40582e0b0e90b7ef2a6304e7d1846d7d05930
3
+ metadata.gz: 3132f9d101d25cd7cb9cacf33921c0d10b70bce3fed987b4d50ade050611d40c
4
+ data.tar.gz: d6a2e0b3b9b5548d3ddb393ea3b29e005571dbfbe64a62d0920d17e206e6323f
5
5
  SHA512:
6
- metadata.gz: fbe4b415c8fc353f3be1453064072dc34864181f795f92c631ff2776af7fa060f0c0ab893149b8e3fb1702365b9f56c286b038424bff034b6ec3a1a6c13156b8
7
- data.tar.gz: 4a403cd5695f25bf309feceed280afdf9cc489eff25dd1d37bf766b2714aff4fd22cf6d0fbf460659b115258bd9b89f6b10bb5c419c228a077d97272921222c8
6
+ metadata.gz: 8c630a5d57c0ef7e1c4a1d656975dffd3aa51637439cc16a816198b15d90385b129c7c8b4178fb83e4c1fb1fdaaa46e9de2f77e57835f70994dfc13cf6ee7896
7
+ data.tar.gz: bfc68e7d6f29b8a5060dd2235a3d7d18afe7bcf33330882d8b8104fd3d2dbb65f2d9880e94e66fff003f66706f37d2a659d1cfb6c3b858e6ab7e18f7771f67da
data/README.md CHANGED
@@ -921,6 +921,8 @@ choose when it appears. Supported events are `:hover` and `:onclick`; hover is t
921
921
  `tramway_chat` renders the chat experience bundled with Tramway. Provide a chat ID, a list of message hashes, and the URL
922
922
  that receives new messages. Each message must include an `:id` and a `:type` (either `:sent` or `:received`). Additional
923
923
  message fields like `text`, `data`, or `sent_at` are forwarded to `tramway/chats/message_component`.
924
+ Message text preserves normal word wrapping and only breaks oversized words or links when needed to keep content inside the
925
+ message bubble.
924
926
 
925
927
  Use `send_messages_enabled:` to control whether users can send new messages from the rendered form. It defaults to `true`.
926
928
  When set to `false`, the text field is disabled and the waiting placeholder is shown.
@@ -1215,6 +1217,7 @@ will render [this](https://play.tailwindcss.com/xho3LfjKkK)
1215
1217
 
1216
1218
  Use `size:` to control the input sizing (`:small`, `:medium`, or `:large`). The default is `:medium`, and supported inputs
1217
1219
  rendered within the form will use the same size value.
1220
+ Date and datetime fields open the browser's native picker when clicking anywhere in the input, not only the picker icon.
1218
1221
 
1219
1222
  ```erb
1220
1223
  <%= tramway_form_for @user, size: :large do |f| %>
@@ -3,4 +3,4 @@
3
3
  = component('tramway/form/label', for: @for, class: 'mb-0') do
4
4
  = @label
5
5
  - classes = "#{size_class(:text_input)} #{text_input_base_classes}"
6
- = @input.call @attribute, **@options.merge(class: classes), value: @value
6
+ = @input.call @attribute, **picker_options(classes), value: @value
@@ -4,6 +4,13 @@ module Tramway
4
4
  module Form
5
5
  # Tailwind-styled date field
6
6
  class DateFieldComponent < TailwindComponent
7
+ PICKER_ONCLICK = 'try { this.showPicker && this.showPicker() } catch (error) {}'
8
+
9
+ private
10
+
11
+ def picker_options(classes)
12
+ @options.merge(class: classes, onclick: [@options[:onclick], PICKER_ONCLICK].compact.join('; '))
13
+ end
7
14
  end
8
15
  end
9
16
  end
@@ -3,4 +3,4 @@
3
3
  = component('tramway/form/label', for: @for, class: 'mb-0') do
4
4
  = @label
5
5
  - classes = "#{size_class(:text_input)} #{text_input_base_classes}"
6
- = @input.call @attribute, **@options.merge(class: classes), value: @value
6
+ = @input.call @attribute, **picker_options(classes), value: @value
@@ -4,6 +4,13 @@ module Tramway
4
4
  module Form
5
5
  # Tailwind-styled datetime field
6
6
  class DatetimeFieldComponent < TailwindComponent
7
+ PICKER_ONCLICK = 'try { this.showPicker && this.showPicker() } catch (error) {}'
8
+
9
+ private
10
+
11
+ def picker_options(classes)
12
+ @options.merge(class: classes, onclick: [@options[:onclick], PICKER_ONCLICK].compact.join('; '))
13
+ end
7
14
  end
8
15
  end
9
16
  end
@@ -1,2 +1,2 @@
1
- %div.max-w-full.min-w-0.break-all
1
+ %div.max-w-full.min-w-0.break-words
2
2
  = rendered_html
@@ -148,7 +148,7 @@ module.exports = {
148
148
  'text-blue-100/90',
149
149
  'text-red-200',
150
150
  'underline',
151
- 'break-all',
151
+ 'break-words',
152
152
  'animate-spin',
153
153
  'placeholder:text-gray-400',
154
154
  'focus:outline-none',
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Tramway
4
- VERSION = '3.1.2'
4
+ VERSION = '3.1.2.1'
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: tramway
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.1.2
4
+ version: 3.1.2.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - kalashnikovisme