actiontext 6.0.6.1 → 6.1.0.rc1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 9aee7e54845e57cfe7319e7a8c43ce51e1bd9a99d904eb10757c6c8ce90c6b39
4
- data.tar.gz: 63bb4fccbf3e4456a8f37b900a48f164679761029d4d4e244234bda8ab3270b1
3
+ metadata.gz: 92eed23fbd01cae823cfb424bba5361f0905a8378692753474c5afa818f392f3
4
+ data.tar.gz: 42319d2773752cbaae675f18c0ce924c933b1c655ca528bf832a73e45a472717
5
5
  SHA512:
6
- metadata.gz: 2462e215e1bc045398cd4ed14276f2cd411b829012c3549947714d3f76cff542bfe19e347df1a7941af967b5db7d61d43dd46ee78bb9e222a158d97759955665
7
- data.tar.gz: e2ef74017f76b4202c0d6fc6e560b9da8bee5b081bdb8428a5bfcec84843192ac3c3d33556b3e5d9b53035015e4a106408c23b12908b0f2f61c0d585d923b106
6
+ metadata.gz: 89ad4ea25a2889470a0b2951c0bfcac4f46704cba8f2e3fa71e11f243165adea7c73e5db46479644f5296f03ee491980c25e54aa6e7ca6c2d6afeeda3a098551
7
+ data.tar.gz: b3453106497fb133b26f9995c225718c30932777b04742d9c7b6aad339adb918d0ca73c8a76c88b227de08f258213ed36654a4576e0fd282914c1405fa54662e
data/CHANGELOG.md CHANGED
@@ -1,163 +1,64 @@
1
- ## Rails 6.0.6.1 (January 17, 2023) ##
1
+ ## Rails 6.1.0.rc1 (November 02, 2020) ##
2
2
 
3
- * No changes.
3
+ * Declare `ActionText::FixtureSet.attachment` to generate an
4
+ `<action-text-attachment sgid="..."></action-text-attachment>` element with
5
+ a valid `sgid` attribute.
4
6
 
7
+ ```ruby
8
+ hello_world_review_content:
9
+ record: hello_world (Review)
10
+ name: content
11
+ body: <p><%= ActionText::FixtureSet.attachment("messages", :hello_world) %> is great!</p>
12
+ ```
5
13
 
6
- ## Rails 6.0.6 (September 09, 2022) ##
14
+ *Sean Doyle*
7
15
 
8
- * No changes.
16
+ * Locate `fill_in_rich_text_area` by `<label>` text
9
17
 
18
+ In addition to searching for `<trix-editor>` elements with the appropriate
19
+ `aria-label` attribute, also support locating elements that match the
20
+ corresponding `<label>` element's text.
10
21
 
11
- ## Rails 6.0.5.1 (July 12, 2022) ##
22
+ *Sean Doyle*
12
23
 
13
- * No changes.
24
+ * Be able to add a default value to `rich_text_area`.
14
25
 
26
+ ```ruby
27
+ form.rich_text_area :content, value: "<h1>Hello world</h1>"
28
+ #=> <input type="hidden" name="message[content]" id="message_content_trix_input_message_1" value="<h1>Hello world</h1>">
29
+ ```
15
30
 
16
- ## Rails 6.0.5 (May 09, 2022) ##
31
+ *Paulo Ancheta*
17
32
 
18
- * Disentangle Action Text from ApplicationController
33
+ * Add method to confirm rich text content existence by adding `?` after rich
34
+ text attribute.
19
35
 
20
- Allow Action Text to be used without having an ApplicationController
21
- defined.
22
- This makes sure:
23
- * Action Text attachments render the correct URL host in mailers.
24
- * an ActionController::Renderer isn't allocated per request.
25
- * Sidekiq doesn't hang with the "classic" autoloader.
36
+ ```ruby
37
+ message = Message.create!(body: "<h1>Funny times!</h1>")
38
+ message.body? #=> true
39
+ ```
26
40
 
27
- *Jonathan Hefner*
41
+ *Kyohei Toyoda*
28
42
 
29
- ## Rails 6.0.4.8 (April 26, 2022) ##
43
+ * The `fill_in_rich_text_area` system test helper locates a Trix editor
44
+ and fills it in with the given HTML.
30
45
 
31
- * No changes.
46
+ ```ruby
47
+ # <trix-editor id="message_content" ...></trix-editor>
48
+ fill_in_rich_text_area "message_content", with: "Hello <em>world!</em>"
32
49
 
50
+ # <trix-editor placeholder="Your message here" ...></trix-editor>
51
+ fill_in_rich_text_area "Your message here", with: "Hello <em>world!</em>"
33
52
 
34
- ## Rails 6.0.4.7 (March 08, 2022) ##
53
+ # <trix-editor aria-label="Message content" ...></trix-editor>
54
+ fill_in_rich_text_area "Message content", with: "Hello <em>world!</em>"
35
55
 
36
- * No changes.
56
+ # <input id="trix_input_1" name="message[content]" type="hidden">
57
+ # <trix-editor input="trix_input_1"></trix-editor>
58
+ fill_in_rich_text_area "message[content]", with: "Hello <em>world!</em>"
59
+ ```
37
60
 
61
+ *George Claghorn*
38
62
 
39
- ## Rails 6.0.4.6 (February 11, 2022) ##
40
63
 
41
- * No changes.
42
-
43
-
44
- ## Rails 6.0.4.5 (February 11, 2022) ##
45
-
46
- * No changes.
47
-
48
-
49
- ## Rails 6.0.4.4 (December 15, 2021) ##
50
-
51
- * No changes.
52
-
53
-
54
- ## Rails 6.0.4.3 (December 14, 2021) ##
55
-
56
- * No changes.
57
-
58
-
59
- ## Rails 6.0.4.2 (December 14, 2021) ##
60
-
61
- * No changes.
62
-
63
-
64
- ## Rails 6.0.4.1 (August 19, 2021) ##
65
-
66
- * No changes.
67
-
68
-
69
- ## Rails 6.0.4 (June 15, 2021) ##
70
-
71
- * No changes.
72
-
73
-
74
- ## Rails 6.0.3.7 (May 05, 2021) ##
75
-
76
- * No changes.
77
-
78
-
79
- ## Rails 6.0.3.6 (March 26, 2021) ##
80
-
81
- * No changes.
82
-
83
-
84
- ## Rails 6.0.3.5 (February 10, 2021) ##
85
-
86
- * No changes.
87
-
88
-
89
- ## Rails 6.0.3.4 (October 07, 2020) ##
90
-
91
- * No changes.
92
-
93
-
94
- ## Rails 6.0.3.3 (September 09, 2020) ##
95
-
96
- * No changes.
97
-
98
-
99
- ## Rails 6.0.3.2 (June 17, 2020) ##
100
-
101
- * No changes.
102
-
103
-
104
- ## Rails 6.0.3.1 (May 18, 2020) ##
105
-
106
- * No changes.
107
-
108
-
109
- ## Rails 6.0.3 (May 06, 2020) ##
110
-
111
- * No changes.
112
-
113
-
114
- ## Rails 6.0.2.2 (March 19, 2020) ##
115
-
116
- * No changes.
117
-
118
-
119
- ## Rails 6.0.2.1 (December 18, 2019) ##
120
-
121
- * No changes.
122
-
123
-
124
- ## Rails 6.0.2 (December 13, 2019) ##
125
-
126
- * No changes.
127
-
128
-
129
- ## Rails 6.0.1 (November 5, 2019) ##
130
-
131
- * No changes.
132
-
133
-
134
- ## Rails 6.0.0 (August 16, 2019) ##
135
-
136
- * No changes.
137
-
138
-
139
- ## Rails 6.0.0.rc2 (July 22, 2019) ##
140
-
141
- * No changes.
142
-
143
-
144
- ## Rails 6.0.0.rc1 (April 24, 2019) ##
145
-
146
- * No changes.
147
-
148
-
149
- ## Rails 6.0.0.beta3 (March 11, 2019) ##
150
-
151
- * No changes.
152
-
153
-
154
- ## Rails 6.0.0.beta2 (February 25, 2019) ##
155
-
156
- * No changes.
157
-
158
-
159
- ## Rails 6.0.0.beta1 (January 18, 2019) ##
160
-
161
- * Added to Rails.
162
-
163
- *DHH*
64
+ Please check [6-0-stable](https://github.com/rails/rails/blob/6-0-stable/actiontext/CHANGELOG.md) for previous changes.
data/MIT-LICENSE CHANGED
@@ -1,6 +1,6 @@
1
1
  MIT License
2
2
 
3
- Copyright (c) 2019 Basecamp, LLC
3
+ Copyright (c) 2020 Basecamp, LLC
4
4
 
5
5
  Permission is hereby granted, free of charge, to any person obtaining a copy
6
6
  of this software and associated documentation files (the "Software"), to deal
@@ -30,7 +30,7 @@ module ActionText
30
30
  attachment_gallery.attachments.map do |attachment|
31
31
  attachment.node.inner_html = render(attachment, in_gallery: true).chomp
32
32
  attachment.to_html
33
- end.join("").html_safe
33
+ end.join.html_safe
34
34
  end.chomp
35
35
  end
36
36
  end
@@ -1,5 +1,6 @@
1
1
  # frozen_string_literal: true
2
2
 
3
+ require "active_support/core_ext/object/try"
3
4
  require "action_view/helpers/tags/placeholderable"
4
5
 
5
6
  module ActionText
@@ -45,7 +46,7 @@ module ActionView::Helpers
45
46
  options = @options.stringify_keys
46
47
  add_default_name_and_id(options)
47
48
  options["input"] ||= dom_id(object, [options["id"], :trix_input].compact.join("_")) if object
48
- @template_object.rich_text_area_tag(options.delete("name"), editable_value, options)
49
+ @template_object.rich_text_area_tag(options.delete("name"), options.fetch("value") { editable_value }, options.except("value"))
49
50
  end
50
51
 
51
52
  def editable_value
@@ -59,6 +60,7 @@ module ActionView::Helpers
59
60
  #
60
61
  # ==== Options
61
62
  # * <tt>:class</tt> - Defaults to "trix-content" which ensures default styling is applied.
63
+ # * <tt>:value</tt> - Adds a default value to the HTML input tag.
62
64
  #
63
65
  # ==== Example
64
66
  # form_with(model: @message) do |form|
@@ -66,6 +68,12 @@ module ActionView::Helpers
66
68
  # end
67
69
  # # <input type="hidden" name="message[content]" id="message_content_trix_input_message_1">
68
70
  # # <trix-editor id="content" input="message_content_trix_input_message_1" class="trix-content" ...></trix-editor>
71
+ #
72
+ # form_with(model: @message) do |form|
73
+ # form.rich_text_area :content, value: "<h1>Default message</h1>"
74
+ # end
75
+ # # <input type="hidden" name="message[content]" id="message_content_trix_input_message_1" value="<h1>Default message</h1>">
76
+ # # <trix-editor id="content" input="message_content_trix_input_message_1" class="trix-content" ...></trix-editor>
69
77
  def rich_text_area(object_name, method, options = {})
70
78
  Tags::ActionText.new(object_name, method, self, options).render
71
79
  end
@@ -0,0 +1,9 @@
1
+ # frozen_string_literal: true
2
+
3
+ module ActionText
4
+ class Record < ActiveRecord::Base #:nodoc:
5
+ self.abstract_class = true
6
+ end
7
+ end
8
+
9
+ ActiveSupport.run_load_hooks :action_text_record, ActionText::Record
@@ -5,7 +5,7 @@ module ActionText
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
7
  # rich text content using the +has_rich_text+ class method.
8
- class RichText < ActiveRecord::Base
8
+ class RichText < Record
9
9
  self.table_name = "action_text_rich_texts"
10
10
 
11
11
  serialize :body, ActionText::Content
@@ -14,7 +14,7 @@ module ActionText
14
14
 
15
15
  private
16
16
  def content_type_is_image?(content_type)
17
- content_type.to_s =~ /^image(\/.+|$)/
17
+ content_type.to_s.match?(/^image(\/.+|$)/)
18
18
  end
19
19
 
20
20
  def attributes_from_node(node)
@@ -1,5 +1,7 @@
1
1
  # frozen_string_literal: true
2
2
 
3
+ require "active_support/core_ext/object/try"
4
+
3
5
  module ActionText
4
6
  class Attachment
5
7
  include Attachments::TrixConversion, Attachments::Minification, Attachments::Caching
@@ -23,7 +23,7 @@ module ActionText
23
23
  Fragment.wrap(content).find_all(SELECTOR).select do |node|
24
24
  node.children.all? do |child|
25
25
  if child.text?
26
- child.text =~ /\A(\n|\ )*\z/
26
+ /\A(\n|\ )*\z/.match?(child.text)
27
27
  else
28
28
  child.matches? ATTACHMENT_SELECTOR
29
29
  end
@@ -1,5 +1,7 @@
1
1
  # frozen_string_literal: true
2
2
 
3
+ require "active_support/core_ext/object/try"
4
+
3
5
  module ActionText
4
6
  module Attachments
5
7
  module TrixConversion
@@ -13,6 +13,7 @@ module ActionText
13
13
  # end
14
14
  #
15
15
  # message = Message.create!(content: "<h1>Funny times!</h1>")
16
+ # message.content? #=> true
16
17
  # message.content.to_s # => "<h1>Funny times!</h1>"
17
18
  # message.content.to_plain_text # => "Funny times!"
18
19
  #
@@ -29,6 +30,10 @@ module ActionText
29
30
  rich_text_#{name} || build_rich_text_#{name}
30
31
  end
31
32
 
33
+ def #{name}?
34
+ rich_text_#{name}.present?
35
+ end
36
+
32
37
  def #{name}=(body)
33
38
  self.#{name}.body = body
34
39
  end
@@ -57,5 +57,12 @@ module ActionText
57
57
  end
58
58
  end
59
59
  end
60
+
61
+ initializer "action_text.system_test_helper" do
62
+ ActiveSupport.on_load(:action_dispatch_system_test_case) do
63
+ require "action_text/system_test_helper"
64
+ include ActionText::SystemTestHelper
65
+ end
66
+ end
60
67
  end
61
68
  end
@@ -0,0 +1,12 @@
1
+ # frozen_string_literal: true
2
+
3
+ module ActionText
4
+ class FixtureSet
5
+ def self.attachment(fixture_set_name, label, column_type: :integer)
6
+ signed_global_id = ActiveRecord::FixtureSet.signed_global_id fixture_set_name, label,
7
+ column_type: column_type, for: ActionText::Attachable::LOCATOR_NAME
8
+
9
+ %(<action-text-attachment sgid="#{signed_global_id}"></action-text-attachment>)
10
+ end
11
+ end
12
+ end
@@ -8,9 +8,9 @@ module ActionText
8
8
 
9
9
  module VERSION
10
10
  MAJOR = 6
11
- MINOR = 0
12
- TINY = 6
13
- PRE = "1"
11
+ MINOR = 1
12
+ TINY = 0
13
+ PRE = "rc1"
14
14
 
15
15
  STRING = [MAJOR, MINOR, TINY, PRE].compact.join(".")
16
16
  end
@@ -18,9 +18,11 @@ module ActionText
18
18
  end
19
19
 
20
20
  def plain_text_for_node_children(node)
21
- node.children.each_with_index.map do |child, index|
22
- plain_text_for_node(child, index)
23
- end.compact.join("")
21
+ texts = []
22
+ node.children.each_with_index do |child, index|
23
+ texts << plain_text_for_node(child, index)
24
+ end
25
+ texts.join
24
26
  end
25
27
 
26
28
  def plain_text_method_for_node(node)
@@ -0,0 +1,55 @@
1
+ # frozen_string_literal: true
2
+
3
+ module ActionText
4
+ module SystemTestHelper
5
+ # Locates a Trix editor and fills it in with the given HTML.
6
+ #
7
+ # The editor can be found by:
8
+ # * its +id+
9
+ # * its +placeholder+
10
+ # * the text from its +label+ element
11
+ # * its +aria-label+
12
+ # * the +name+ of its input
13
+ #
14
+ # Examples:
15
+ #
16
+ # # <trix-editor id="message_content" ...></trix-editor>
17
+ # fill_in_rich_text_area "message_content", with: "Hello <em>world!</em>"
18
+ #
19
+ # # <trix-editor placeholder="Your message here" ...></trix-editor>
20
+ # fill_in_rich_text_area "Your message here", with: "Hello <em>world!</em>"
21
+ #
22
+ # # <label for="message_content">Message content</label>
23
+ # # <trix-editor id="message_content" ...></trix-editor>
24
+ # fill_in_rich_text_area "Message content", with: "Hello <em>world!</em>"
25
+ #
26
+ # # <trix-editor aria-label="Message content" ...></trix-editor>
27
+ # fill_in_rich_text_area "Message content", with: "Hello <em>world!</em>"
28
+ #
29
+ # # <input id="trix_input_1" name="message[content]" type="hidden">
30
+ # # <trix-editor input="trix_input_1"></trix-editor>
31
+ # fill_in_rich_text_area "message[content]", with: "Hello <em>world!</em>"
32
+ def fill_in_rich_text_area(locator = nil, with:)
33
+ find(:rich_text_area, locator).execute_script("this.editor.loadHTML(arguments[0])", with.to_s)
34
+ end
35
+ end
36
+ end
37
+
38
+ Capybara.add_selector :rich_text_area do
39
+ label "rich-text area"
40
+ xpath do |locator|
41
+ if locator.nil?
42
+ XPath.descendant(:"trix-editor")
43
+ else
44
+ input_located_by_name = XPath.anywhere(:input).where(XPath.attr(:name) == locator).attr(:id)
45
+ input_located_by_label = XPath.anywhere(:label).where(XPath.string.n.is(locator)).attr(:for)
46
+
47
+ XPath.descendant(:"trix-editor").where \
48
+ XPath.attr(:id).equals(locator) |
49
+ XPath.attr(:placeholder).equals(locator) |
50
+ XPath.attr(:"aria-label").equals(locator) |
51
+ XPath.attr(:input).equals(input_located_by_name) |
52
+ XPath.attr(:id).equals(input_located_by_label)
53
+ end
54
+ end
55
+ end
data/lib/action_text.rb CHANGED
@@ -14,6 +14,7 @@ module ActionText
14
14
  autoload :Attribute
15
15
  autoload :Content
16
16
  autoload :Fragment
17
+ autoload :FixtureSet
17
18
  autoload :HtmlConversion
18
19
  autoload :PlainTextConversion
19
20
  autoload :Rendering
@@ -0,0 +1,67 @@
1
+ # frozen_string_literal: true
2
+
3
+ require "pathname"
4
+ require "json"
5
+
6
+ module ActionText
7
+ module Generators
8
+ class InstallGenerator < ::Rails::Generators::Base
9
+ source_root File.expand_path("templates", __dir__)
10
+
11
+ def install_javascript_dependencies
12
+ rails_command "app:binstub:yarn", inline: true
13
+
14
+ say "Installing JavaScript dependencies", :green
15
+ run "bin/yarn add #{js_dependencies.map { |name, version| "#{name}@#{version}" }.join(" ")}",
16
+ abort_on_failure: true, capture: true
17
+ end
18
+
19
+ def append_dependencies_to_package_file
20
+ if (app_javascript_pack_path = Pathname.new("app/javascript/packs/application.js")).exist?
21
+ js_dependencies.each_key do |dependency|
22
+ line = %[require("#{dependency}")]
23
+
24
+ unless app_javascript_pack_path.read.include? line
25
+ say "Adding #{dependency} to #{app_javascript_pack_path}", :green
26
+ append_to_file app_javascript_pack_path, "\n#{line}"
27
+ end
28
+ end
29
+ else
30
+ say <<~WARNING, :red
31
+ WARNING: Action Text can't locate your JavaScript bundle to add its package dependencies.
32
+
33
+ Add these lines to any bundles:
34
+
35
+ require("trix")
36
+ require("@rails/actiontext")
37
+
38
+ Alternatively, install and setup the webpacker gem then rerun `bin/rails action_text:install`
39
+ to have these dependencies added automatically.
40
+ WARNING
41
+ end
42
+ end
43
+
44
+ def create_actiontext_files
45
+ template "actiontext.scss", "app/assets/stylesheets/actiontext.scss"
46
+
47
+ copy_file "#{GEM_ROOT}/app/views/active_storage/blobs/_blob.html.erb",
48
+ "app/views/active_storage/blobs/_blob.html.erb"
49
+ end
50
+
51
+ def create_migrations
52
+ rails_command "railties:install:migrations FROM=active_storage,action_text", inline: true
53
+ end
54
+
55
+ 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
+ end
66
+ end
67
+ end
@@ -0,0 +1,13 @@
1
+ # frozen_string_literal: true
2
+
3
+ module TestUnit
4
+ module Generators
5
+ class InstallGenerator < ::Rails::Generators::Base
6
+ source_root File.expand_path("templates", __dir__)
7
+
8
+ def create_test_files
9
+ template "fixtures.yml", "test/fixtures/action_text/rich_texts.yml"
10
+ end
11
+ end
12
+ end
13
+ end
@@ -1,20 +1,6 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- namespace :action_text do
4
- # Prevent migration installation task from showing up twice.
5
- Rake::Task["install:migrations"].clear_comments
6
-
7
- desc "Copy over the migration, stylesheet, and JavaScript files"
8
- task install: %w( environment run_installer copy_migrations )
9
-
10
- task :run_installer do
11
- installer_template = File.expand_path("../templates/installer.rb", __dir__)
12
- system "#{RbConfig.ruby} ./bin/rails app:template LOCATION=#{installer_template}"
13
- end
14
-
15
- task :copy_migrations do
16
- Rake::Task["active_storage:install:migrations"].invoke
17
- Rake::Task["railties:install:migrations"].reenable # Otherwise you can't run 2 migration copy tasks in one invocation
18
- Rake::Task["action_text:install:migrations"].invoke
19
- end
3
+ desc "Copy over the migration, stylesheet, and JavaScript files"
4
+ task "action_text:install" do
5
+ Rails::Command.invoke :generate, ["action_text:install"]
20
6
  end
data/package.json CHANGED
@@ -1,12 +1,12 @@
1
1
  {
2
2
  "name": "@rails/actiontext",
3
- "version": "6.0.6-1",
3
+ "version": "6.1.0-rc1",
4
4
  "description": "Edit and display rich text in Rails applications",
5
5
  "main": "app/javascript/actiontext/index.js",
6
6
  "files": [
7
7
  "app/javascript/actiontext/*.js"
8
8
  ],
9
- "homepage": "http://rubyonrails.org/",
9
+ "homepage": "https://rubyonrails.org/",
10
10
  "repository": {
11
11
  "type": "git",
12
12
  "url": "git+https://github.com/rails/rails.git"
@@ -21,7 +21,7 @@
21
21
  ],
22
22
  "license": "MIT",
23
23
  "dependencies": {
24
- "@rails/activestorage": "^6.0.0"
24
+ "@rails/activestorage": "^6.0.0-alpha"
25
25
  },
26
26
  "peerDependencies": {
27
27
  "trix": "^1.2.0"
metadata CHANGED
@@ -1,16 +1,16 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: actiontext
3
3
  version: !ruby/object:Gem::Version
4
- version: 6.0.6.1
4
+ version: 6.1.0.rc1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Javan Makhmali
8
8
  - Sam Stephenson
9
9
  - David Heinemeier Hansson
10
- autorequire:
10
+ autorequire:
11
11
  bindir: bin
12
12
  cert_chain: []
13
- date: 2023-01-17 00:00:00.000000000 Z
13
+ date: 2020-11-02 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.6.1
21
+ version: 6.1.0.rc1
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.6.1
28
+ version: 6.1.0.rc1
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.6.1
35
+ version: 6.1.0.rc1
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.6.1
42
+ version: 6.1.0.rc1
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.6.1
49
+ version: 6.1.0.rc1
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.6.1
56
+ version: 6.1.0.rc1
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.6.1
63
+ version: 6.1.0.rc1
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.6.1
70
+ version: 6.1.0.rc1
71
71
  - !ruby/object:Gem::Dependency
72
72
  name: nokogiri
73
73
  requirement: !ruby/object:Gem::Requirement
@@ -98,6 +98,7 @@ files:
98
98
  - app/helpers/action_text/tag_helper.rb
99
99
  - app/javascript/actiontext/attachment_upload.js
100
100
  - app/javascript/actiontext/index.js
101
+ - app/models/action_text/record.rb
101
102
  - app/models/action_text/rich_text.rb
102
103
  - app/views/action_text/attachables/_missing_attachable.html.erb
103
104
  - app/views/action_text/attachables/_remote_image.html.erb
@@ -118,30 +119,32 @@ files:
118
119
  - lib/action_text/attribute.rb
119
120
  - lib/action_text/content.rb
120
121
  - lib/action_text/engine.rb
122
+ - lib/action_text/fixture_set.rb
121
123
  - lib/action_text/fragment.rb
122
124
  - lib/action_text/gem_version.rb
123
125
  - lib/action_text/html_conversion.rb
124
126
  - lib/action_text/plain_text_conversion.rb
125
127
  - lib/action_text/rendering.rb
126
128
  - lib/action_text/serialization.rb
129
+ - lib/action_text/system_test_helper.rb
127
130
  - lib/action_text/trix_attachment.rb
128
131
  - lib/action_text/version.rb
132
+ - lib/generators/action_text/install/install_generator.rb
133
+ - lib/generators/action_text/install/templates/actiontext.scss
134
+ - lib/rails/generators/test_unit/install_generator.rb
135
+ - lib/rails/generators/test_unit/templates/fixtures.yml
129
136
  - lib/tasks/actiontext.rake
130
- - lib/templates/actiontext.scss
131
- - lib/templates/fixtures.yml
132
- - lib/templates/installer.rb
133
137
  - package.json
134
138
  homepage: https://rubyonrails.org
135
139
  licenses:
136
140
  - MIT
137
141
  metadata:
138
142
  bug_tracker_uri: https://github.com/rails/rails/issues
139
- changelog_uri: https://github.com/rails/rails/blob/v6.0.6.1/actiontext/CHANGELOG.md
140
- documentation_uri: https://api.rubyonrails.org/v6.0.6.1/
143
+ changelog_uri: https://github.com/rails/rails/blob/v6.1.0.rc1/actiontext/CHANGELOG.md
144
+ documentation_uri: https://api.rubyonrails.org/v6.1.0.rc1/
141
145
  mailing_list_uri: https://discuss.rubyonrails.org/c/rubyonrails-talk
142
- source_code_uri: https://github.com/rails/rails/tree/v6.0.6.1/actiontext
143
- rubygems_mfa_required: 'true'
144
- post_install_message:
146
+ source_code_uri: https://github.com/rails/rails/tree/v6.1.0.rc1/actiontext
147
+ post_install_message:
145
148
  rdoc_options: []
146
149
  require_paths:
147
150
  - lib
@@ -152,12 +155,12 @@ required_ruby_version: !ruby/object:Gem::Requirement
152
155
  version: 2.5.0
153
156
  required_rubygems_version: !ruby/object:Gem::Requirement
154
157
  requirements:
155
- - - ">="
158
+ - - ">"
156
159
  - !ruby/object:Gem::Version
157
- version: '0'
160
+ version: 1.3.1
158
161
  requirements: []
159
- rubygems_version: 3.4.3
160
- signing_key:
162
+ rubygems_version: 3.1.4
163
+ signing_key:
161
164
  specification_version: 4
162
165
  summary: Rich text framework.
163
166
  test_files: []
@@ -1,45 +0,0 @@
1
- require "pathname"
2
- require "json"
3
-
4
- APPLICATION_PACK_PATH = Pathname.new("app/javascript/packs/application.js")
5
- JS_PACKAGE_PATH = Pathname.new("#{__dir__}/../../package.json")
6
-
7
- JS_PACKAGE = JSON.load(JS_PACKAGE_PATH)
8
- JS_DEPENDENCIES = JS_PACKAGE["peerDependencies"].dup.merge \
9
- JS_PACKAGE["name"] => "^#{JS_PACKAGE["version"]}"
10
-
11
- say "Copying actiontext.scss to app/assets/stylesheets"
12
- copy_file "#{__dir__}/actiontext.scss", "app/assets/stylesheets/actiontext.scss"
13
-
14
- say "Copying fixtures to test/fixtures/action_text/rich_texts.yml"
15
- copy_file "#{__dir__}/fixtures.yml", "test/fixtures/action_text/rich_texts.yml"
16
-
17
- say "Copying blob rendering partial to app/views/active_storage/blobs/_blob.html.erb"
18
- copy_file "#{__dir__}/../../app/views/active_storage/blobs/_blob.html.erb",
19
- "app/views/active_storage/blobs/_blob.html.erb"
20
-
21
- say "Installing JavaScript dependencies"
22
- run "yarn add #{JS_DEPENDENCIES.map { |name, version| "#{name}@#{version}" }.join(" ")}"
23
-
24
- if APPLICATION_PACK_PATH.exist?
25
- JS_DEPENDENCIES.keys.each do |name|
26
- line = %[require("#{name}")]
27
- unless APPLICATION_PACK_PATH.read.include? line
28
- say "Adding #{name} to #{APPLICATION_PACK_PATH}"
29
- append_to_file APPLICATION_PACK_PATH, "\n#{line}"
30
- end
31
- end
32
- else
33
- warn <<~WARNING
34
- WARNING: Action Text can't locate your JavaScript bundle to add its package dependencies.
35
-
36
- Add these lines to any bundles:
37
-
38
- require("trix")
39
- require("@rails/actiontext")
40
-
41
- Alternatively, install and setup the webpacker gem then rerun `bin/rails action_text:install`
42
- to have these dependencies added automatically.
43
-
44
- WARNING
45
- end