tramway 2.3.1.1 → 2.3.1.2

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: 0f94931c225d093e9cb11e8957ae333b66a2a6feb0e36427c77bbe864ae75433
4
- data.tar.gz: a16912c9f8ea5da24eabbba7dd0f0524f1ef0f057c14a6af6f56c2d930b08b37
3
+ metadata.gz: afb266e8ff0e57296500fc2181b623ef4abffbe184be90bbb3a6a61431cfcbc8
4
+ data.tar.gz: 7e23e932ff24c6f5c93bbc3a3cd2365c2f66e7b121a690f9c56e51cfe5c3ac60
5
5
  SHA512:
6
- metadata.gz: 0174d5e8d6ed3f337bcbc01523471d651d333d30104399da24d0e9ac16dd0a7549982e3ad77b8ff15c8af26c59791e11120c4afee462215870bbf4c1a9fbdf81
7
- data.tar.gz: 9e229945662dadadb01ca4075bf0a2da71b90fdca30e4b687144424d72e9929face26facbc94cee1c6e01cdda29c8c72a4ef072d0784fb46329bfc3c6ed257c2
6
+ metadata.gz: 48eca5f7a2a9c24681f73f164b997e59b21e75efd761fd99f8f765752ed16b226d8823ee124c60fca08c2944c49b91b38d2e8b4808faf424fc804dfb0b8aec40
7
+ data.tar.gz: 11835fac94f5d47052e64a8a6de159eb53385b1ee9dc78f1a0500c8a7b4329eb1f0f607ff8e84c078a66becd1387f0403d78f3b9fe6e43dd6c905ab695c3b50b
data/README.md CHANGED
@@ -863,6 +863,9 @@ the Tailwind color family explicitly.
863
863
  that receives new messages. Each message must include an `:id` and a `:type` (either `:sent` or `:received`). Additional
864
864
  message fields like `text`, `data`, or `sent_at` are forwarded to `tramway/chats/message_component`.
865
865
 
866
+ Use `send_messages_enabled:` to control whether users can send new messages from the rendered form. It defaults to `true`.
867
+ When set to `false`, the text field is disabled and the waiting placeholder is shown.
868
+
866
869
  ```haml
867
870
  -# Haml example
868
871
  - messages = [
@@ -872,7 +875,8 @@ message fields like `text`, `data`, or `sent_at` are forwarded to `tramway/chats
872
875
  = tramway_chat chat_id: 'support-chat',
873
876
  messages: messages,
874
877
  message_form: @message_form,
875
- send_message_path: chat_messages_path
878
+ send_message_path: chat_messages_path,
879
+ send_messages_enabled: @chat.open?
876
880
  ```
877
881
 
878
882
  ```erb
@@ -881,7 +885,8 @@ message fields like `text`, `data`, or `sent_at` are forwarded to `tramway/chats
881
885
  <%= tramway_chat chat_id: 'support-chat',
882
886
  messages: messages,
883
887
  message_form: @message_form,
884
- send_message_path: chat_messages_path %>
888
+ send_message_path: chat_messages_path,
889
+ send_messages_enabled: @chat.open? %>
885
890
  ```
886
891
 
887
892
 
@@ -16,11 +16,11 @@
16
16
 
17
17
  - if pending?
18
18
  .pb-1
19
- = inline_svg 'icons/spinner.svg', class: 'w-4 h-4 text-white animate-spin'
19
+ -# = inline_svg 'icons/spinner.svg', class: 'w-4 h-4 text-white animate-spin'
20
20
 
21
21
  - if failed?
22
22
  .pb-1
23
- = inline_svg 'icons/cross.svg', class: 'w-6 h-6 text-red-200'
23
+ -# = inline_svg 'icons/cross.svg', class: 'w-6 h-6 text-red-200'
24
24
 
25
25
  - if data_view == :table
26
26
  = component 'tramway/chats/messages/table', data:
data/docs/AGENTS.md CHANGED
@@ -131,6 +131,8 @@ Inherit all components from Tramway::BaseComponent
131
131
  When you need chat UI, use the `tramway_chat` helper. Pass `chat_id`, `messages`, `message_form`, and `send_message_path`.
132
132
  Each message must include `:id` and a `:type` of `:sent` or `:received`, and other keys (like `:text`, `:data`, `:sent_at`)
133
133
  are forwarded to `tramway/chats/message_component`. Use `message_form: nil` when you only need read-only chat rendering.
134
+ Use `send_messages_enabled:` (defaults to `true`) to control whether the message input is enabled. Set it to `false`
135
+ when chat should be visible but sending is temporarily unavailable.
134
136
 
135
137
  For live updates to a rendered `tramway_chat`, use `tramway_chat_append_message(chat_id:, message_type:, text:, sent_at:)`.
136
138
  This method is included in all controllers and ActiveRecord models. `message_type` must be `:sent` or `:received`, otherwise
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Tramway
4
- VERSION = '2.3.1.1'
4
+ VERSION = '2.3.1.2'
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: 2.3.1.1
4
+ version: 2.3.1.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - kalashnikovisme