actiontext 6.1.7.10 → 7.0.0.alpha1
Sign up to get free protection for your applications and to get access to all the features.
Potentially problematic release.
This version of actiontext might be problematic. Click here for more details.
- checksums.yaml +4 -4
- data/CHANGELOG.md +19 -200
- data/MIT-LICENSE +1 -1
- data/README.md +4 -0
- data/app/assets/javascripts/actiontext.js +880 -0
- data/app/assets/javascripts/trix.js +5278 -0
- data/app/assets/stylesheets/trix.css +375 -0
- data/app/helpers/action_text/content_helper.rb +17 -3
- data/app/helpers/action_text/tag_helper.rb +5 -7
- data/app/models/action_text/encrypted_rich_text.rb +9 -0
- data/app/models/action_text/record.rb +1 -1
- data/app/models/action_text/rich_text.rb +4 -0
- data/app/views/action_text/contents/_content.html.erb +1 -0
- data/app/views/layouts/action_text/contents/_content.html.erb +3 -0
- data/db/migrate/20180528164100_create_action_text_tables.rb +14 -2
- data/lib/action_text/attachable.rb +4 -0
- data/lib/action_text/attachment.rb +4 -4
- data/lib/action_text/attachment_gallery.rb +14 -9
- data/lib/action_text/attachments/caching.rb +1 -1
- data/lib/action_text/attachments/minification.rb +1 -1
- data/lib/action_text/attribute.rb +18 -2
- data/lib/action_text/content.rb +7 -3
- data/lib/action_text/encryption.rb +38 -0
- data/lib/action_text/engine.rb +14 -0
- data/lib/action_text/fixture_set.rb +49 -0
- data/lib/action_text/gem_version.rb +4 -4
- data/lib/action_text/plain_text_conversion.rb +1 -6
- data/lib/action_text/rendering.rb +1 -1
- data/lib/action_text/serialization.rb +0 -2
- data/lib/action_text/trix_attachment.rb +3 -3
- data/lib/action_text.rb +1 -0
- data/lib/generators/action_text/install/install_generator.rb +28 -35
- data/lib/generators/action_text/install/templates/actiontext.css +35 -0
- data/package.json +13 -3
- metadata +25 -20
- data/app/views/action_text/content/_layout.html.erb +0 -3
- data/lib/generators/action_text/install/templates/actiontext.scss +0 -36
@@ -24,7 +24,13 @@ module ActionText
|
|
24
24
|
#
|
25
25
|
# Message.all.with_rich_text_content # Avoids N+1 queries when you just want the body, not the attachments.
|
26
26
|
# Message.all.with_rich_text_content_and_embeds # Avoids N+1 queries when you just want the body and attachments.
|
27
|
-
|
27
|
+
# Message.all.with_all_rich_text # Loads all rich text associations.
|
28
|
+
#
|
29
|
+
# === Options
|
30
|
+
#
|
31
|
+
# * <tt>:encrypted</tt> - Pass true to encrypt the rich text attribute. The encryption will be non-deterministic. See
|
32
|
+
# +ActiveRecord::Encryption::EncryptableRecord.encrypts+. Default: false.
|
33
|
+
def has_rich_text(name, encrypted: false)
|
28
34
|
class_eval <<-CODE, __FILE__, __LINE__ + 1
|
29
35
|
def #{name}
|
30
36
|
rich_text_#{name} || build_rich_text_#{name}
|
@@ -39,12 +45,22 @@ module ActionText
|
|
39
45
|
end
|
40
46
|
CODE
|
41
47
|
|
48
|
+
rich_text_class_name = encrypted ? "ActionText::EncryptedRichText" : "ActionText::RichText"
|
42
49
|
has_one :"rich_text_#{name}", -> { where(name: name) },
|
43
|
-
class_name:
|
50
|
+
class_name: rich_text_class_name, as: :record, inverse_of: :record, autosave: true, dependent: :destroy
|
44
51
|
|
45
52
|
scope :"with_rich_text_#{name}", -> { includes("rich_text_#{name}") }
|
46
53
|
scope :"with_rich_text_#{name}_and_embeds", -> { includes("rich_text_#{name}": { embeds_attachments: :blob }) }
|
47
54
|
end
|
55
|
+
|
56
|
+
# Eager load all dependent RichText models in bulk.
|
57
|
+
def with_all_rich_text
|
58
|
+
eager_load(rich_text_association_names)
|
59
|
+
end
|
60
|
+
|
61
|
+
def rich_text_association_names
|
62
|
+
reflect_on_all_associations(:has_one).collect(&:name).select { |n| n.start_with?("rich_text_") }
|
63
|
+
end
|
48
64
|
end
|
49
65
|
end
|
50
66
|
end
|
data/lib/action_text/content.rb
CHANGED
@@ -58,7 +58,7 @@ module ActionText
|
|
58
58
|
end
|
59
59
|
|
60
60
|
def render_attachments(**options, &block)
|
61
|
-
content = fragment.replace(ActionText::Attachment
|
61
|
+
content = fragment.replace(ActionText::Attachment.tag_name) do |node|
|
62
62
|
block.call(attachment_for_node(node, **options))
|
63
63
|
end
|
64
64
|
self.class.new(content, canonicalize: false)
|
@@ -84,7 +84,11 @@ module ActionText
|
|
84
84
|
end
|
85
85
|
|
86
86
|
def to_rendered_html_with_layout
|
87
|
-
render
|
87
|
+
render layout: "action_text/contents/content", partial: to_partial_path, formats: :html, locals: { content: self }
|
88
|
+
end
|
89
|
+
|
90
|
+
def to_partial_path
|
91
|
+
"action_text/contents/content"
|
88
92
|
end
|
89
93
|
|
90
94
|
def to_s
|
@@ -107,7 +111,7 @@ module ActionText
|
|
107
111
|
|
108
112
|
private
|
109
113
|
def attachment_nodes
|
110
|
-
@attachment_nodes ||= fragment.find_all(ActionText::Attachment
|
114
|
+
@attachment_nodes ||= fragment.find_all(ActionText::Attachment.tag_name)
|
111
115
|
end
|
112
116
|
|
113
117
|
def attachment_gallery_nodes
|
@@ -0,0 +1,38 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module ActionText
|
4
|
+
module Encryption
|
5
|
+
def encrypt
|
6
|
+
transaction do
|
7
|
+
super
|
8
|
+
encrypt_rich_texts if has_encrypted_rich_texts?
|
9
|
+
end
|
10
|
+
end
|
11
|
+
|
12
|
+
def decrypt
|
13
|
+
transaction do
|
14
|
+
super
|
15
|
+
decrypt_rich_texts if has_encrypted_rich_texts?
|
16
|
+
end
|
17
|
+
end
|
18
|
+
|
19
|
+
private
|
20
|
+
def encrypt_rich_texts
|
21
|
+
encryptable_rich_texts.each(&:encrypt)
|
22
|
+
end
|
23
|
+
|
24
|
+
def decrypt_rich_texts
|
25
|
+
encryptable_rich_texts.each(&:decrypt)
|
26
|
+
end
|
27
|
+
|
28
|
+
def has_encrypted_rich_texts?
|
29
|
+
encryptable_rich_texts.present?
|
30
|
+
end
|
31
|
+
|
32
|
+
def encryptable_rich_texts
|
33
|
+
@encryptable_rich_texts ||= self.class.rich_text_association_names
|
34
|
+
.filter_map { |attribute_name| send(attribute_name) }
|
35
|
+
.find_all { |record| record.is_a?(ActionText::EncryptedRichText) }
|
36
|
+
end
|
37
|
+
end
|
38
|
+
end
|
data/lib/action_text/engine.rb
CHANGED
@@ -11,6 +11,9 @@ module ActionText
|
|
11
11
|
class Engine < Rails::Engine
|
12
12
|
isolate_namespace ActionText
|
13
13
|
config.eager_load_namespaces << ActionText
|
14
|
+
|
15
|
+
config.action_text = ActiveSupport::OrderedOptions.new
|
16
|
+
config.action_text.attachment_tag_name = "action-text-attachment"
|
14
17
|
config.autoload_once_paths = %W(
|
15
18
|
#{root}/app/helpers
|
16
19
|
#{root}/app/models
|
@@ -19,6 +22,13 @@ module ActionText
|
|
19
22
|
initializer "action_text.attribute" do
|
20
23
|
ActiveSupport.on_load(:active_record) do
|
21
24
|
include ActionText::Attribute
|
25
|
+
prepend ActionText::Encryption
|
26
|
+
end
|
27
|
+
end
|
28
|
+
|
29
|
+
initializer "action_text.asset" do
|
30
|
+
if Rails.application.config.respond_to?(:assets)
|
31
|
+
Rails.application.config.assets.precompile += %w( actiontext.js trix.js trix.css )
|
22
32
|
end
|
23
33
|
end
|
24
34
|
|
@@ -68,5 +78,9 @@ module ActionText
|
|
68
78
|
include ActionText::SystemTestHelper
|
69
79
|
end
|
70
80
|
end
|
81
|
+
|
82
|
+
initializer "action_text.configure" do |app|
|
83
|
+
ActionText::Attachment.tag_name = app.config.action_text.attachment_tag_name
|
84
|
+
end
|
71
85
|
end
|
72
86
|
end
|
@@ -1,7 +1,56 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
3
|
module ActionText
|
4
|
+
# Fixtures are a way of organizing data that you want to test against; in
|
5
|
+
# short, sample data.
|
6
|
+
#
|
7
|
+
# To learn more about fixtures, read the
|
8
|
+
# {ActiveRecord::FixtureSet}[rdoc-ref:ActiveRecord::FixtureSet] documentation.
|
9
|
+
#
|
10
|
+
# === YAML
|
11
|
+
#
|
12
|
+
# Like other Active Record-backed models, ActionText::RichText records inherit
|
13
|
+
# from ActiveRecord::Base instances and therefore can be populated by
|
14
|
+
# fixtures.
|
15
|
+
#
|
16
|
+
# Consider a hypothetical <tt>Article</tt> model class, its related fixture
|
17
|
+
# data, as well as fixture data for related ActionText::RichText records:
|
18
|
+
#
|
19
|
+
# # app/models/article.rb
|
20
|
+
# class Article < ApplicationRecord
|
21
|
+
# has_rich_text :content
|
22
|
+
# end
|
23
|
+
#
|
24
|
+
# # tests/fixtures/articles.yml
|
25
|
+
# first:
|
26
|
+
# title: An Article
|
27
|
+
#
|
28
|
+
# # tests/fixtures/action_text/rich_texts.yml
|
29
|
+
# first_content:
|
30
|
+
# record: first (Article)
|
31
|
+
# name: content
|
32
|
+
# body: <div>Hello, world.</div>
|
33
|
+
#
|
34
|
+
# When processed, Active Record will insert database records for each fixture
|
35
|
+
# entry and will ensure the Action Text relationship is intact.
|
4
36
|
class FixtureSet
|
37
|
+
# Fixtures support Action Text attachments as part of their <tt>body</tt>
|
38
|
+
# HTML.
|
39
|
+
#
|
40
|
+
# === Examples
|
41
|
+
#
|
42
|
+
# For example, consider a second <tt>Article</tt> record that mentions the
|
43
|
+
# first as part of its <tt>content</tt> HTML:
|
44
|
+
#
|
45
|
+
# # tests/fixtures/articles.yml
|
46
|
+
# second:
|
47
|
+
# title: Another Article
|
48
|
+
#
|
49
|
+
# # tests/fixtures/action_text/rich_texts.yml
|
50
|
+
# second_content:
|
51
|
+
# record: second (Article)
|
52
|
+
# name: content
|
53
|
+
# body: <div>Hello, <%= ActionText::FixtureSet.attachment("articles", :first) %></div>
|
5
54
|
def self.attachment(fixture_set_name, label, column_type: :integer)
|
6
55
|
signed_global_id = ActiveRecord::FixtureSet.signed_global_id fixture_set_name, label,
|
7
56
|
column_type: column_type, for: ActionText::Attachable::LOCATOR_NAME
|
@@ -55,12 +55,7 @@ module ActionText
|
|
55
55
|
|
56
56
|
def plain_text_for_blockquote_node(node, index)
|
57
57
|
text = plain_text_for_block(node)
|
58
|
-
|
59
|
-
|
60
|
-
text = text.dup
|
61
|
-
text.insert(text.rindex(/\S/) + 1, "”")
|
62
|
-
text.insert(text.index(/\S/), "“")
|
63
|
-
text
|
58
|
+
text.sub(/\A(\s*)(.+?)(\s*)\Z/m, '\1“\2”\3')
|
64
59
|
end
|
65
60
|
|
66
61
|
def plain_text_for_li_node(node, index)
|
@@ -9,9 +9,9 @@ module ActionText
|
|
9
9
|
ATTRIBUTES = %w( sgid contentType url href filename filesize width height previewable content ) + COMPOSED_ATTRIBUTES
|
10
10
|
ATTRIBUTE_TYPES = {
|
11
11
|
"previewable" => ->(value) { value.to_s == "true" },
|
12
|
-
"filesize" => ->(value) { Integer(value.to_s)
|
13
|
-
"width" => ->(value) { Integer(value.to_s
|
14
|
-
"height" => ->(value) { Integer(value.to_s
|
12
|
+
"filesize" => ->(value) { Integer(value.to_s, exception: false) || value },
|
13
|
+
"width" => ->(value) { Integer(value.to_s, exception: false) },
|
14
|
+
"height" => ->(value) { Integer(value.to_s, exception: false) },
|
15
15
|
:default => ->(value) { value.to_s }
|
16
16
|
}
|
17
17
|
|
data/lib/action_text.rb
CHANGED
@@ -9,43 +9,45 @@ module ActionText
|
|
9
9
|
source_root File.expand_path("templates", __dir__)
|
10
10
|
|
11
11
|
def install_javascript_dependencies
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
abort_on_failure: true, capture: true
|
12
|
+
if Pathname(destination_root).join("package.json").exist?
|
13
|
+
say "Installing JavaScript dependencies", :green
|
14
|
+
run "yarn add @rails/actiontext trix"
|
15
|
+
end
|
17
16
|
end
|
18
17
|
|
19
|
-
def
|
20
|
-
|
21
|
-
js_dependencies.each_key do |dependency|
|
22
|
-
line = %[require("#{dependency}")]
|
18
|
+
def append_javascript_dependencies
|
19
|
+
destination = Pathname(destination_root)
|
23
20
|
|
24
|
-
|
25
|
-
|
26
|
-
append_to_file app_javascript_pack_path, "\n#{line}"
|
27
|
-
end
|
28
|
-
end
|
21
|
+
if (application_javascript_path = destination.join("app/javascript/application.js")).exist?
|
22
|
+
insert_into_file application_javascript_path.to_s, %(import "trix"\nimport "@rails/actiontext"\n)
|
29
23
|
else
|
30
|
-
say <<~
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
require("trix")
|
36
|
-
require("@rails/actiontext")
|
24
|
+
say <<~INSTRUCTIONS, :green
|
25
|
+
You must import the @rails/actiontext and trix JavaScript modules in your application entrypoint.
|
26
|
+
INSTRUCTIONS
|
27
|
+
end
|
37
28
|
|
38
|
-
|
39
|
-
|
40
|
-
WARNING
|
29
|
+
if (importmap_path = destination.join("config/importmap.rb")).exist?
|
30
|
+
append_to_file importmap_path.to_s, %(pin "trix"\npin "@rails/actiontext", to: "actiontext.js"\n)
|
41
31
|
end
|
42
32
|
end
|
43
33
|
|
44
34
|
def create_actiontext_files
|
45
|
-
template "actiontext.
|
35
|
+
template "actiontext.css", "app/assets/stylesheets/actiontext.css"
|
36
|
+
|
37
|
+
gem_root = "#{__dir__}/../../../.."
|
46
38
|
|
47
|
-
copy_file "#{
|
39
|
+
copy_file "#{gem_root}/app/views/active_storage/blobs/_blob.html.erb",
|
48
40
|
"app/views/active_storage/blobs/_blob.html.erb"
|
41
|
+
|
42
|
+
copy_file "#{gem_root}/app/views/layouts/action_text/contents/_content.html.erb",
|
43
|
+
"app/views/layouts/action_text/contents/_content.html.erb"
|
44
|
+
end
|
45
|
+
|
46
|
+
def enable_image_processing_gem
|
47
|
+
if (gemfile_path = Pathname(destination_root).join("Gemfile")).exist?
|
48
|
+
say "Ensure image_processing gem has been enabled so image uploads will work (remember to bundle!)"
|
49
|
+
uncomment_lines gemfile_path, /gem "image_processing"/
|
50
|
+
end
|
49
51
|
end
|
50
52
|
|
51
53
|
def create_migrations
|
@@ -53,15 +55,6 @@ module ActionText
|
|
53
55
|
end
|
54
56
|
|
55
57
|
hook_for :test_framework
|
56
|
-
|
57
|
-
private
|
58
|
-
GEM_ROOT = "#{__dir__}/../../../.."
|
59
|
-
|
60
|
-
def js_dependencies
|
61
|
-
js_package = JSON.load(Pathname.new("#{GEM_ROOT}/package.json"))
|
62
|
-
js_package["peerDependencies"].merge \
|
63
|
-
js_package["name"] => "^#{js_package["version"]}"
|
64
|
-
end
|
65
58
|
end
|
66
59
|
end
|
67
60
|
end
|
@@ -0,0 +1,35 @@
|
|
1
|
+
/*
|
2
|
+
* Provides a drop-in pointer for the default Trix stylesheet that will format the toolbar and
|
3
|
+
* the trix-editor content (whether displayed or under editing). Feel free to incorporate this
|
4
|
+
* inclusion directly in any other asset bundle and remove this file.
|
5
|
+
*
|
6
|
+
<%- if defined?(Webpacker::Engine) -%>
|
7
|
+
*= require trix/dist/trix
|
8
|
+
<%- else -%>
|
9
|
+
*= require trix
|
10
|
+
<% end -%>
|
11
|
+
*/
|
12
|
+
|
13
|
+
/*
|
14
|
+
* We need to override trix.css’s image gallery styles to accommodate the
|
15
|
+
* <action-text-attachment> element we wrap around attachments. Otherwise,
|
16
|
+
* images in galleries will be squished by the max-width: 33%; rule.
|
17
|
+
*/
|
18
|
+
.trix-content .attachment-gallery > action-text-attachment,
|
19
|
+
.trix-content .attachment-gallery > .attachment {
|
20
|
+
flex: 1 0 33%;
|
21
|
+
padding: 0 0.5em;
|
22
|
+
max-width: 33%;
|
23
|
+
}
|
24
|
+
|
25
|
+
.trix-content .attachment-gallery.attachment-gallery--2 > action-text-attachment,
|
26
|
+
.trix-content .attachment-gallery.attachment-gallery--2 > .attachment, .trix-content .attachment-gallery.attachment-gallery--4 > action-text-attachment,
|
27
|
+
.trix-content .attachment-gallery.attachment-gallery--4 > .attachment {
|
28
|
+
flex-basis: 50%;
|
29
|
+
max-width: 50%;
|
30
|
+
}
|
31
|
+
|
32
|
+
.trix-content action-text-attachment .attachment {
|
33
|
+
padding: 0 !important;
|
34
|
+
max-width: 100% !important;
|
35
|
+
}
|
data/package.json
CHANGED
@@ -1,8 +1,9 @@
|
|
1
1
|
{
|
2
2
|
"name": "@rails/actiontext",
|
3
|
-
"version": "
|
3
|
+
"version": "7.0.0-alpha1",
|
4
4
|
"description": "Edit and display rich text in Rails applications",
|
5
5
|
"main": "app/javascript/actiontext/index.js",
|
6
|
+
"type": "module",
|
6
7
|
"files": [
|
7
8
|
"app/javascript/actiontext/*.js"
|
8
9
|
],
|
@@ -21,9 +22,18 @@
|
|
21
22
|
],
|
22
23
|
"license": "MIT",
|
23
24
|
"dependencies": {
|
24
|
-
"@rails/activestorage": "
|
25
|
+
"@rails/activestorage": "7.0.0-alpha"
|
25
26
|
},
|
26
27
|
"peerDependencies": {
|
27
|
-
"trix": "^1.
|
28
|
+
"trix": "^1.3.1"
|
29
|
+
},
|
30
|
+
"devDependencies": {
|
31
|
+
"@rollup/plugin-node-resolve": "^11.0.1",
|
32
|
+
"@rollup/plugin-commonjs": "^19.0.1",
|
33
|
+
"rollup": "^2.35.1",
|
34
|
+
"trix": "^1.3.1"
|
35
|
+
},
|
36
|
+
"scripts": {
|
37
|
+
"build": "rollup --config rollup.config.js"
|
28
38
|
}
|
29
39
|
}
|
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:
|
4
|
+
version: 7.0.0.alpha1
|
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:
|
13
|
+
date: 2021-09-15 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:
|
21
|
+
version: 7.0.0.alpha1
|
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:
|
28
|
+
version: 7.0.0.alpha1
|
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:
|
35
|
+
version: 7.0.0.alpha1
|
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:
|
42
|
+
version: 7.0.0.alpha1
|
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:
|
49
|
+
version: 7.0.0.alpha1
|
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:
|
56
|
+
version: 7.0.0.alpha1
|
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:
|
63
|
+
version: 7.0.0.alpha1
|
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:
|
70
|
+
version: 7.0.0.alpha1
|
71
71
|
- !ruby/object:Gem::Dependency
|
72
72
|
name: nokogiri
|
73
73
|
requirement: !ruby/object:Gem::Requirement
|
@@ -94,17 +94,22 @@ files:
|
|
94
94
|
- CHANGELOG.md
|
95
95
|
- MIT-LICENSE
|
96
96
|
- README.md
|
97
|
+
- app/assets/javascripts/actiontext.js
|
98
|
+
- app/assets/javascripts/trix.js
|
99
|
+
- app/assets/stylesheets/trix.css
|
97
100
|
- app/helpers/action_text/content_helper.rb
|
98
101
|
- app/helpers/action_text/tag_helper.rb
|
99
102
|
- app/javascript/actiontext/attachment_upload.js
|
100
103
|
- app/javascript/actiontext/index.js
|
104
|
+
- app/models/action_text/encrypted_rich_text.rb
|
101
105
|
- app/models/action_text/record.rb
|
102
106
|
- app/models/action_text/rich_text.rb
|
103
107
|
- app/views/action_text/attachables/_missing_attachable.html.erb
|
104
108
|
- app/views/action_text/attachables/_remote_image.html.erb
|
105
109
|
- app/views/action_text/attachment_galleries/_attachment_gallery.html.erb
|
106
|
-
- app/views/action_text/
|
110
|
+
- app/views/action_text/contents/_content.html.erb
|
107
111
|
- app/views/active_storage/blobs/_blob.html.erb
|
112
|
+
- app/views/layouts/action_text/contents/_content.html.erb
|
108
113
|
- db/migrate/20180528164100_create_action_text_tables.rb
|
109
114
|
- lib/action_text.rb
|
110
115
|
- lib/action_text/attachable.rb
|
@@ -118,6 +123,7 @@ files:
|
|
118
123
|
- lib/action_text/attachments/trix_conversion.rb
|
119
124
|
- lib/action_text/attribute.rb
|
120
125
|
- lib/action_text/content.rb
|
126
|
+
- lib/action_text/encryption.rb
|
121
127
|
- lib/action_text/engine.rb
|
122
128
|
- lib/action_text/fixture_set.rb
|
123
129
|
- lib/action_text/fragment.rb
|
@@ -130,7 +136,7 @@ files:
|
|
130
136
|
- lib/action_text/trix_attachment.rb
|
131
137
|
- lib/action_text/version.rb
|
132
138
|
- lib/generators/action_text/install/install_generator.rb
|
133
|
-
- lib/generators/action_text/install/templates/actiontext.
|
139
|
+
- lib/generators/action_text/install/templates/actiontext.css
|
134
140
|
- lib/rails/generators/test_unit/install_generator.rb
|
135
141
|
- lib/rails/generators/test_unit/templates/fixtures.yml
|
136
142
|
- lib/tasks/actiontext.rake
|
@@ -140,11 +146,10 @@ licenses:
|
|
140
146
|
- MIT
|
141
147
|
metadata:
|
142
148
|
bug_tracker_uri: https://github.com/rails/rails/issues
|
143
|
-
changelog_uri: https://github.com/rails/rails/blob/
|
144
|
-
documentation_uri: https://api.rubyonrails.org/
|
149
|
+
changelog_uri: https://github.com/rails/rails/blob/v7.0.0.alpha1/actiontext/CHANGELOG.md
|
150
|
+
documentation_uri: https://api.rubyonrails.org/v7.0.0.alpha1/
|
145
151
|
mailing_list_uri: https://discuss.rubyonrails.org/c/rubyonrails-talk
|
146
|
-
source_code_uri: https://github.com/rails/rails/tree/
|
147
|
-
rubygems_mfa_required: 'true'
|
152
|
+
source_code_uri: https://github.com/rails/rails/tree/v7.0.0.alpha1/actiontext
|
148
153
|
post_install_message:
|
149
154
|
rdoc_options: []
|
150
155
|
require_paths:
|
@@ -153,14 +158,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
153
158
|
requirements:
|
154
159
|
- - ">="
|
155
160
|
- !ruby/object:Gem::Version
|
156
|
-
version: 2.
|
161
|
+
version: 2.7.0
|
157
162
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
158
163
|
requirements:
|
159
|
-
- - "
|
164
|
+
- - ">"
|
160
165
|
- !ruby/object:Gem::Version
|
161
|
-
version:
|
166
|
+
version: 1.3.1
|
162
167
|
requirements: []
|
163
|
-
rubygems_version: 3.
|
168
|
+
rubygems_version: 3.1.6
|
164
169
|
signing_key:
|
165
170
|
specification_version: 4
|
166
171
|
summary: Rich text framework.
|
@@ -1,36 +0,0 @@
|
|
1
|
-
//
|
2
|
-
// Provides a drop-in pointer for the default Trix stylesheet that will format the toolbar and
|
3
|
-
// the trix-editor content (whether displayed or under editing). Feel free to incorporate this
|
4
|
-
// inclusion directly in any other asset bundle and remove this file.
|
5
|
-
//
|
6
|
-
//= require trix/dist/trix
|
7
|
-
|
8
|
-
// We need to override trix.css’s image gallery styles to accommodate the
|
9
|
-
// <action-text-attachment> element we wrap around attachments. Otherwise,
|
10
|
-
// images in galleries will be squished by the max-width: 33%; rule.
|
11
|
-
.trix-content {
|
12
|
-
.attachment-gallery {
|
13
|
-
> action-text-attachment,
|
14
|
-
> .attachment {
|
15
|
-
flex: 1 0 33%;
|
16
|
-
padding: 0 0.5em;
|
17
|
-
max-width: 33%;
|
18
|
-
}
|
19
|
-
|
20
|
-
&.attachment-gallery--2,
|
21
|
-
&.attachment-gallery--4 {
|
22
|
-
> action-text-attachment,
|
23
|
-
> .attachment {
|
24
|
-
flex-basis: 50%;
|
25
|
-
max-width: 50%;
|
26
|
-
}
|
27
|
-
}
|
28
|
-
}
|
29
|
-
|
30
|
-
action-text-attachment {
|
31
|
-
.attachment {
|
32
|
-
padding: 0 !important;
|
33
|
-
max-width: 100% !important;
|
34
|
-
}
|
35
|
-
}
|
36
|
-
}
|