actiontext 6.0.0.beta1 → 6.0.0.beta2

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: 9eb946145656ee7d27e4ee9ce733a3e0f55e1b63ab16e4cea8741fecaac697f6
4
- data.tar.gz: 658a5373916fd11abfdbd569746f1f4ed23fb71cc52294d513d063de47a148ab
3
+ metadata.gz: 6e7846f16c7060bd84200e540ad39d3992819a09d892cf0364baaa5ce7167c67
4
+ data.tar.gz: 7f57c3531ba233e7b38fe6191d0aaf5cb72189a8f47e76310fed5e8449f2cd8d
5
5
  SHA512:
6
- metadata.gz: 8418aebfa611943071b773ec51544e039f4f3e8220a594c4a66bfced904754da4f2ee1fc7d0472e7d6e0e207f4aad70f8828509fd0f6a95df5db1557e42f34cb
7
- data.tar.gz: 427541191977534c0d36bf0b4cfb0615a5525e0ef645a939b31e066dac689ec0288bc7b6dca919523c8adae6ffee56888bc0d0cb232cd592c51bd8f06daee357
6
+ metadata.gz: b030de12337863c6fa0b248c2e6bc7bf9c2b57f340708a630f753528799d9746b4f4379d006c4086d38c292c89e6d3d947d2b2142b2b11d6355b0a2bcff3a716
7
+ data.tar.gz: 71e80235672d880a437588e99d57d5bdfda9b693572cc0f976d32e0c76fc8189e3bb66dd4955e2f79eed0dcef813a939a2d2bfa0654ae1a176931734a04c9bea
@@ -1,3 +1,8 @@
1
+ ## Rails 6.0.0.beta2 (February 25, 2019) ##
2
+
3
+ * No changes.
4
+
5
+
1
6
  ## Rails 6.0.0.beta1 (January 18, 2019) ##
2
7
 
3
8
  * Added to Rails.
@@ -1,10 +1,12 @@
1
1
  # frozen_string_literal: true
2
2
 
3
+ require "action_view/helpers/tags/placeholderable"
4
+
3
5
  module ActionText
4
6
  module TagHelper
5
7
  cattr_accessor(:id, instance_accessor: false) { 0 }
6
8
 
7
- # Returns a `trix-editor` tag that instantiates the Trix JavaScript editor as well as a hidden field
9
+ # Returns a +trix-editor+ tag that instantiates the Trix JavaScript editor as well as a hidden field
8
10
  # that Trix will write to on changes, so the content will be sent on form submissions.
9
11
  #
10
12
  # ==== Options
@@ -35,6 +37,8 @@ end
35
37
 
36
38
  module ActionView::Helpers
37
39
  class Tags::ActionText < Tags::Base
40
+ include Tags::Placeholderable
41
+
38
42
  delegate :dom_id, to: ActionView::RecordIdentifier
39
43
 
40
44
  def render
@@ -50,7 +54,7 @@ module ActionView::Helpers
50
54
  end
51
55
 
52
56
  module FormHelper
53
- # Returns a `trix-editor` tag that instantiates the Trix JavaScript editor as well as a hidden field
57
+ # Returns a +trix-editor+ tag that instantiates the Trix JavaScript editor as well as a hidden field
54
58
  # that Trix will write to on changes, so the content will be sent on form submissions.
55
59
  #
56
60
  # ==== Options
@@ -1,10 +1,10 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module ActionText
4
- # The RichText record holds the content produced by the Trix editor in a serialized `body` attribute.
4
+ # The RichText record holds the content produced by the Trix editor in a serialized +body+ attribute.
5
5
  # It also holds all the references to the embedded files, which are stored using Active Storage.
6
6
  # This record is then associated with the Active Record model the application desires to have
7
- # rich text content using the `has_rich_text` class method.
7
+ # rich text content using the +has_rich_text+ class method.
8
8
  class RichText < ActiveRecord::Base
9
9
  self.table_name = "action_text_rich_texts"
10
10
 
@@ -15,7 +15,7 @@ module ActionText
15
15
  has_many_attached :embeds
16
16
 
17
17
  before_save do
18
- self.embeds = body.attachments.map(&:attachable) if body.present?
18
+ self.embeds = body.attachables.grep(ActiveStorage::Blob) if body.present?
19
19
  end
20
20
 
21
21
  def to_plain_text
@@ -1,6 +1,6 @@
1
1
  <figure class="attachment attachment--<%= blob.representable? ? "preview" : "file" %> attachment--<%= blob.filename.extension %>">
2
2
  <% if blob.representable? %>
3
- <%= image_tag blob.representation(resize_to_fit: local_assigns[:in_gallery] ? [ 800, 600 ] : [ 1024, 768 ]) %>
3
+ <%= image_tag blob.representation(resize_to_limit: local_assigns[:in_gallery] ? [ 800, 600 ] : [ 1024, 768 ]) %>
4
4
  <% end %>
5
5
 
6
6
  <figcaption class="attachment__caption">
@@ -2,11 +2,10 @@ class CreateActionTextTables < ActiveRecord::Migration[6.0]
2
2
  def change
3
3
  create_table :action_text_rich_texts do |t|
4
4
  t.string :name, null: false
5
- t.text :body, limit: 16777215
5
+ t.text :body, size: :long
6
6
  t.references :record, null: false, polymorphic: true, index: false
7
7
 
8
- t.datetime :created_at, null: false
9
- t.datetime :updated_at, null: false
8
+ t.timestamps
10
9
 
11
10
  t.index [ :record_type, :record_id, :name ], name: "index_action_text_rich_texts_uniqueness", unique: true
12
11
  end
@@ -10,7 +10,7 @@ module ActionText
10
10
  MAJOR = 6
11
11
  MINOR = 0
12
12
  TINY = 0
13
- PRE = "beta1"
13
+ PRE = "beta2"
14
14
 
15
15
  STRING = [MAJOR, MINOR, TINY, PRE].compact.join(".")
16
16
  end
@@ -26,7 +26,7 @@ if APPLICATION_PACK_PATH.exist?
26
26
  line = %[require("#{name}")]
27
27
  unless APPLICATION_PACK_PATH.read.include? line
28
28
  say "Adding #{name} to #{APPLICATION_PACK_PATH}"
29
- append_to_file APPLICATION_PACK_PATH, "#{line}\n"
29
+ append_to_file APPLICATION_PACK_PATH, "\n#{line}"
30
30
  end
31
31
  end
32
32
  end
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rails/actiontext",
3
- "version": "6.0.0-beta1",
3
+ "version": "6.0.0-beta2",
4
4
  "description": "Edit and display rich text in Rails applications",
5
5
  "main": "app/javascript/actiontext/index.js",
6
6
  "files": [
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: actiontext
3
3
  version: !ruby/object:Gem::Version
4
- version: 6.0.0.beta1
4
+ version: 6.0.0.beta2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Javan Makhmali
@@ -10,7 +10,7 @@ authors:
10
10
  autorequire:
11
11
  bindir: bin
12
12
  cert_chain: []
13
- date: 2019-01-18 00:00:00.000000000 Z
13
+ date: 2019-02-25 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: activesupport
@@ -18,56 +18,56 @@ dependencies:
18
18
  requirements:
19
19
  - - '='
20
20
  - !ruby/object:Gem::Version
21
- version: 6.0.0.beta1
21
+ version: 6.0.0.beta2
22
22
  type: :runtime
23
23
  prerelease: false
24
24
  version_requirements: !ruby/object:Gem::Requirement
25
25
  requirements:
26
26
  - - '='
27
27
  - !ruby/object:Gem::Version
28
- version: 6.0.0.beta1
28
+ version: 6.0.0.beta2
29
29
  - !ruby/object:Gem::Dependency
30
30
  name: activerecord
31
31
  requirement: !ruby/object:Gem::Requirement
32
32
  requirements:
33
33
  - - '='
34
34
  - !ruby/object:Gem::Version
35
- version: 6.0.0.beta1
35
+ version: 6.0.0.beta2
36
36
  type: :runtime
37
37
  prerelease: false
38
38
  version_requirements: !ruby/object:Gem::Requirement
39
39
  requirements:
40
40
  - - '='
41
41
  - !ruby/object:Gem::Version
42
- version: 6.0.0.beta1
42
+ version: 6.0.0.beta2
43
43
  - !ruby/object:Gem::Dependency
44
44
  name: activestorage
45
45
  requirement: !ruby/object:Gem::Requirement
46
46
  requirements:
47
47
  - - '='
48
48
  - !ruby/object:Gem::Version
49
- version: 6.0.0.beta1
49
+ version: 6.0.0.beta2
50
50
  type: :runtime
51
51
  prerelease: false
52
52
  version_requirements: !ruby/object:Gem::Requirement
53
53
  requirements:
54
54
  - - '='
55
55
  - !ruby/object:Gem::Version
56
- version: 6.0.0.beta1
56
+ version: 6.0.0.beta2
57
57
  - !ruby/object:Gem::Dependency
58
58
  name: actionpack
59
59
  requirement: !ruby/object:Gem::Requirement
60
60
  requirements:
61
61
  - - '='
62
62
  - !ruby/object:Gem::Version
63
- version: 6.0.0.beta1
63
+ version: 6.0.0.beta2
64
64
  type: :runtime
65
65
  prerelease: false
66
66
  version_requirements: !ruby/object:Gem::Requirement
67
67
  requirements:
68
68
  - - '='
69
69
  - !ruby/object:Gem::Version
70
- version: 6.0.0.beta1
70
+ version: 6.0.0.beta2
71
71
  - !ruby/object:Gem::Dependency
72
72
  name: nokogiri
73
73
  requirement: !ruby/object:Gem::Requirement
@@ -104,7 +104,7 @@ files:
104
104
  - app/views/action_text/attachment_galleries/_attachment_gallery.html.erb
105
105
  - app/views/action_text/content/_layout.html.erb
106
106
  - app/views/active_storage/blobs/_blob.html.erb
107
- - db/migrate/201805281641_create_action_text_tables.rb
107
+ - db/migrate/20180528164100_create_action_text_tables.rb
108
108
  - lib/action_text.rb
109
109
  - lib/action_text/attachable.rb
110
110
  - lib/action_text/attachables/content_attachment.rb
@@ -134,8 +134,8 @@ homepage: https://rubyonrails.org
134
134
  licenses:
135
135
  - MIT
136
136
  metadata:
137
- source_code_uri: https://github.com/rails/rails/tree/v6.0.0.beta1/actiontext
138
- changelog_uri: https://github.com/rails/rails/blob/v6.0.0.beta1/actiontext/CHANGELOG.md
137
+ source_code_uri: https://github.com/rails/rails/tree/v6.0.0.beta2/actiontext
138
+ changelog_uri: https://github.com/rails/rails/blob/v6.0.0.beta2/actiontext/CHANGELOG.md
139
139
  post_install_message:
140
140
  rdoc_options: []
141
141
  require_paths: