localmail 0.2.0 → 0.2.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: 3a4368d18e29898c3d0da732096bdcbfca22bae05aba4c0a39657a194349e125
4
- data.tar.gz: 23058480820db07e13055fffb48caa10b0da2861a70afa1689e1101024f76d1a
3
+ metadata.gz: fff6275885473ff681acef6b4f0f25b53fbb5dd80774e58aa8cae32edf66673d
4
+ data.tar.gz: 509d6fba1d91f1cefba48c0e2375b5e621de01916ff556b5212a24d1d2c7727d
5
5
  SHA512:
6
- metadata.gz: 5e20872b27d16760ae4f8b2e4723b93c92c5d695e9f73f16676cb3598028c98c56758850eed3b584a3572bd74000f5828ba9018d4f9580631fa1a8a5b0a4acac
7
- data.tar.gz: 7ce8b3f9eeefa367f14e314cc2fb3f162c19e830cee7d1edbe013b37c5e4b9170d429cfef370b14c922bb8aaec7963d7c89b56bffec85f0576f8ca3d843464ee
6
+ metadata.gz: e270cde29fb6a3eba25b125f9656848b76a079dc487045a69d1b08c1bc4d7b1091813b68a2afb3bedde5528a8ff156d86198a89879593b811c8026fc64e5b563
7
+ data.tar.gz: d26b30d335d02bb7a4b9fbd3c4da4fe5ef01bdc9b2e16442dd4b315099a3bea9702a0cf7c1b22f9a042bd00c9e581b1056313994e8259e82a49afe9c4842bbe7
data/CHANGELOG.md CHANGED
@@ -2,6 +2,16 @@
2
2
 
3
3
  ## [Unreleased]
4
4
 
5
+ ## [0.2.2]
6
+
7
+ - **The mobile preview reflows wide emails to fit**, as a phone mail app does: fixed widths
8
+ give way and the text wraps at full size. A fixed-width email no longer scrolls sideways
9
+ in the 390px preview. The desktop preview is unchanged.
10
+
11
+ ## [0.2.1]
12
+
13
+ - Declare the MIT licence in the gemspec, so RubyGems lists it.
14
+
5
15
  ## [0.2.0]
6
16
 
7
17
  - **Pluggable storage.** `config.store` takes `:active_record` (new default), `:redis`, or a
@@ -2,6 +2,17 @@ module Localmail
2
2
  # One captured email, rebuilt from its stored raw source, with the parts the inbox
3
3
  # renders exposed as UTF-8 strings.
4
4
  class Message
5
+ REFLOW_ON_PHONE = <<~CSS.squish
6
+ @media (max-width: 480px) {
7
+ html, body { min-width: 0 !important; }
8
+ body * { max-width: 100% !important; min-width: 0 !important; }
9
+ td[width]:not([width$="%"]), th[width]:not([width$="%"]),
10
+ td[style*="width"]:not([style*="%"]), th[style*="width"]:not([style*="%"]) { width: auto !important; }
11
+ img { height: auto !important; }
12
+ body { overflow-wrap: anywhere; }
13
+ }
14
+ CSS
15
+
5
16
  attr_reader :id, :mail
6
17
 
7
18
  delegate :subject, :from, :to, :cc, :bcc, :date, to: :mail
@@ -18,7 +29,7 @@ module Localmail
18
29
  def preview_html
19
30
  return if html_body.nil?
20
31
 
21
- %(<base target="_blank">#{html_body})
32
+ %(<base target="_blank"><style>#{REFLOW_ON_PHONE}</style>#{html_body})
22
33
  end
23
34
 
24
35
  def text_body
@@ -1,3 +1,3 @@
1
1
  module Localmail
2
- VERSION = "0.2.0"
2
+ VERSION = "0.2.2"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: localmail
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.0
4
+ version: 0.2.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - John Arnold
@@ -56,7 +56,8 @@ files:
56
56
  - lib/localmail/stores/redis.rb
57
57
  - lib/localmail/version.rb
58
58
  homepage: https://github.com/jaarnie/localmail
59
- licenses: []
59
+ licenses:
60
+ - MIT
60
61
  metadata:
61
62
  homepage_uri: https://github.com/jaarnie/localmail
62
63
  source_code_uri: https://github.com/jaarnie/localmail