livechat 0.6.5 → 0.6.7

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: 5bcd5b886e8241ac0969dfe00c979bf0f8c8b375bdac9776f20173fae827d737
4
- data.tar.gz: e3df3bd597b8d94b86099071fefcfa33e7a961df125bb0f5fc202efec608c457
3
+ metadata.gz: 1d79d2656f03388a1c60b6ae02e3135e592eda11b654bc55a48c1ed4326ff587
4
+ data.tar.gz: dc11d8cbe564080e185583a52e5ad2865654b2194224c6868e6453a4fb441126
5
5
  SHA512:
6
- metadata.gz: e1d5122996fc4e272fa4a902638b079999c75022465d0ff67db7d628f01cf730187097050bcc2c4c74fe5e2d9e42cdc2707686d811f862e482b18a8ffcac08fa
7
- data.tar.gz: 5ccc1ee55482383f9e9b3c8b81bfad53f2aac99fdf85cb457e0883c457de208178087abd3d08b1c8736f52c7465464dba5e79e88811acb9344578029d260b935
6
+ metadata.gz: 10291e2d99e5250f9bc94967556870f159c3ca44d6b2f1e20f42f0b638b700f0ec0939e1c4d984abcff214881c7d817c1e3e975c8b23314e912fbe39d6d30f35
7
+ data.tar.gz: f34aa3e46605a7c431d62bae5355b8465f22d8d28ba1b32b6c21026f4c8b6ab7637dc622b0a7e3ab07f9b495c97a0fde7728219426c6a152e4352a4635adb6af
data/CHANGELOG.md CHANGED
@@ -1,5 +1,17 @@
1
1
  # Changelog
2
2
 
3
+ ## 0.6.7
4
+
5
+ - Added `config.agent_layout`, letting host apps render the Livechat inbox
6
+ inside their own admin layout while keeping the standalone gem layout as the
7
+ default.
8
+
9
+ ## 0.6.6
10
+
11
+ - Expanded the desktop visitor widget into a taller, wider panel with equal
12
+ viewport padding above and below, while preserving the existing full-screen
13
+ mobile chat behavior.
14
+
3
15
  ## 0.6.5
4
16
 
5
17
  - Added `mount_livechat at: "/livechat"` as the install-time route helper,
@@ -6,6 +6,10 @@ module Livechat
6
6
 
7
7
  private
8
8
 
9
+ def livechat_agent_layout
10
+ Livechat.config.agent_layout
11
+ end
12
+
9
13
  def current_visitor
10
14
  return @current_visitor if defined?(@current_visitor)
11
15
 
@@ -7,7 +7,7 @@ module Livechat
7
7
  class ConversationsController < ApplicationController
8
8
  before_action :require_agent
9
9
  before_action :set_conversation, except: %i[index index_poll]
10
- layout 'livechat/application'
10
+ layout :livechat_agent_layout
11
11
 
12
12
  PER_PAGE = 50
13
13
 
@@ -12,6 +12,10 @@ Livechat.configure do |config|
12
12
  # Who can answer at the mount path. Defaults to development only — override
13
13
  # before deploying.
14
14
  # config.authorize_agent = ->(request) { request.env["warden"]&.user&.admin? }
15
+ #
16
+ # Render the inbox inside your app's admin layout. Default: the gem's
17
+ # standalone inbox layout.
18
+ # config.agent_layout = "admin/application"
15
19
 
16
20
  # Resolve the current user (optional). Return an object responding to #id,
17
21
  # or nil. Signed-in visitors keep one conversation across devices; guests
@@ -18,6 +18,10 @@ module Livechat
18
18
  # so your team can answer from production even where the widget is off.
19
19
  attr_accessor :authorize_agent
20
20
 
21
+ # Layout used by the built-in inbox. Override this to render Livechat
22
+ # inside your app's admin shell, e.g. "admin/application".
23
+ attr_accessor :agent_layout
24
+
21
25
  # Resolve the current user (optional). Return an object responding to
22
26
  # #id, or nil. Receives the request. Signed-in users keep one conversation
23
27
  # across devices; guests are tracked with a cookie.
@@ -100,6 +104,7 @@ module Livechat
100
104
  @app_name = nil
101
105
  @enabled = ->(_request) { true }
102
106
  @authorize_agent = ->(_request) { Rails.env.development? }
107
+ @agent_layout = 'livechat/application'
103
108
  @current_user = ->(_request) {}
104
109
  @visitor_label = ->(user) { user.try(:name).presence || user.try(:email).presence || user.to_s }
105
110
  @agent_label = ->(user) { user.try(:name).presence || user.try(:email).presence || user.to_s }
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Livechat
4
- VERSION = '0.6.5'
4
+ VERSION = '0.6.7'
5
5
  end
@@ -1230,8 +1230,8 @@
1230
1230
  "#lvc-root #lvc-expand:hover{background:rgba(255,255,255,.15);opacity:1}" +
1231
1231
  // Desktop only: a roomier panel for long threads and image-heavy chats.
1232
1232
  // Guarded by min-width so it can never shrink the full-screen mobile panel.
1233
- "@media(min-width:481px){#lvc-root.lvc-expanded #lvc-panel{width:min(460px,92vw);" +
1234
- "height:min(680px,88dvh);max-height:88dvh}}" +
1233
+ "@media(min-width:481px){#lvc-root.lvc-expanded #lvc-panel{top:20px;bottom:20px;" +
1234
+ "width:min(520px,calc(100vw - 40px));height:auto;max-height:none}}" +
1235
1235
  // min-height:0 lets this flex child actually scroll within the panel
1236
1236
  // instead of overflowing it (the classic flexbox scroll gotcha).
1237
1237
  "#lvc-list{flex:1;min-height:0;overflow-y:auto;overscroll-behavior:contain;padding:14px;" +
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: livechat
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.6.5
4
+ version: 0.6.7
5
5
  platform: ruby
6
6
  authors:
7
7
  - Yaroslav Shmarov