actiontext 6.0.3.2 → 6.1.0

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: 1ac7ffe95d8e4e57300b16e7ef7caab5a623edcef50a288b09233f67e65cc6f4
4
- data.tar.gz: 6d3c99cf327e622d4739ca31f24a9476d46c2f3abb378faeb8f200c673d6ee04
3
+ metadata.gz: 13cb19db119d85452be3f416ac6f493b594b7dcb9d0ced4e72fe941d789a4b04
4
+ data.tar.gz: b02ee0f4b74b060f27456f4c25b5dd89af8d6287d6eceee4bd56cfff4e7b5edf
5
5
  SHA512:
6
- metadata.gz: c6a4393235d8747862e53fea443e18c5e19a2b8f24fe5cdbd5fea3131e7eb973238bfd063be73a21de39b1aedcd5f1b66824761ae182d8bba24670aa1035fe2b
7
- data.tar.gz: 56dff2a4ff07234bee465d8dc48966880fec26d1b0d4004faf5cd38c87063f488c66944c8b92f961bd21c05acb2cc8fc803ee5a57c5df3742742f0b55c284dce
6
+ metadata.gz: bb185d6b1b5a206aeaaedf6d9352c24759ed1fddca04096744f084ef3e72380d604c95540c54a91861686cacb2afe7847dc4afe420e49f24be7911a5e9282011
7
+ data.tar.gz: daa433a40af5833f68644b5d4efa5afa134e2ce8497fc8ae69be30f95a7df29643e44f2fad5ec632cb22c5121be819a56f224f3c734ff96fcb00996342e01f43
@@ -1,65 +1,64 @@
1
- ## Rails 6.0.3.2 (June 17, 2020) ##
1
+ ## Rails 6.1.0 (December 09, 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.3.1 (May 18, 2020) ##
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.3 (May 06, 2020) ##
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.2.2 (March 19, 2020) ##
31
+ *Paulo Ancheta*
17
32
 
18
- * No changes.
33
+ * Add method to confirm rich text content existence by adding `?` after rich
34
+ text attribute.
19
35
 
36
+ ```ruby
37
+ message = Message.create!(body: "<h1>Funny times!</h1>")
38
+ message.body? #=> true
39
+ ```
20
40
 
21
- ## Rails 6.0.2.1 (December 18, 2019) ##
41
+ *Kyohei Toyoda*
22
42
 
23
- * No changes.
43
+ * The `fill_in_rich_text_area` system test helper locates a Trix editor
44
+ and fills it in with the given HTML.
24
45
 
46
+ ```ruby
47
+ # <trix-editor id="message_content" ...></trix-editor>
48
+ fill_in_rich_text_area "message_content", with: "Hello <em>world!</em>"
25
49
 
26
- ## Rails 6.0.2 (December 13, 2019) ##
50
+ # <trix-editor placeholder="Your message here" ...></trix-editor>
51
+ fill_in_rich_text_area "Your message here", with: "Hello <em>world!</em>"
27
52
 
28
- * No changes.
53
+ # <trix-editor aria-label="Message content" ...></trix-editor>
54
+ fill_in_rich_text_area "Message content", with: "Hello <em>world!</em>"
29
55
 
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
+ ```
30
60
 
31
- ## Rails 6.0.1 (November 5, 2019) ##
61
+ *George Claghorn*
32
62
 
33
- * No changes.
34
63
 
35
-
36
- ## Rails 6.0.0 (August 16, 2019) ##
37
-
38
- * No changes.
39
-
40
-
41
- ## Rails 6.0.0.rc2 (July 22, 2019) ##
42
-
43
- * No changes.
44
-
45
-
46
- ## Rails 6.0.0.rc1 (April 24, 2019) ##
47
-
48
- * No changes.
49
-
50
-
51
- ## Rails 6.0.0.beta3 (March 11, 2019) ##
52
-
53
- * No changes.
54
-
55
-
56
- ## Rails 6.0.0.beta2 (February 25, 2019) ##
57
-
58
- * No changes.
59
-
60
-
61
- ## Rails 6.0.0.beta1 (January 18, 2019) ##
62
-
63
- * Added to Rails.
64
-
65
- *DHH*
64
+ Please check [6-0-stable](https://github.com/rails/rails/blob/6-0-stable/actiontext/CHANGELOG.md) for previous changes.
@@ -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
@@ -10,6 +10,7 @@ module ActionText
10
10
  mattr_accessor(:scrubber)
11
11
 
12
12
  def render_action_text_content(content)
13
+ self.prefix_partial_path_with_controller_namespace = false
13
14
  sanitize_action_text_content(render_action_text_attachments(content))
14
15
  end
15
16
 
@@ -29,7 +30,7 @@ module ActionText
29
30
  attachment_gallery.attachments.map do |attachment|
30
31
  attachment.node.inner_html = render(attachment, in_gallery: true).chomp
31
32
  attachment.to_html
32
- end.join("").html_safe
33
+ end.join.html_safe
33
34
  end.chomp
34
35
  end
35
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,8 +14,10 @@ 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
20
+ autoload :Rendering
19
21
  autoload :Serialization
20
22
  autoload :TrixAttachment
21
23
 
@@ -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
@@ -26,7 +28,7 @@ module ActionText
26
28
  private
27
29
  def trix_attachment_content
28
30
  if partial_path = attachable.try(:to_trix_content_attachment_partial_path)
29
- ActionText::Content.renderer.render(partial: partial_path, object: self, as: model_name.element)
31
+ ActionText::Content.render(partial: partial_path, object: self, as: model_name.element)
30
32
  end
31
33
  end
32
34
  end
@@ -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
@@ -1,12 +1,8 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- require "active_support/core_ext/module/attribute_accessors_per_thread"
4
-
5
3
  module ActionText
6
4
  class Content
7
- include Serialization
8
-
9
- thread_cattr_accessor :renderer
5
+ include Rendering, Serialization
10
6
 
11
7
  attr_reader :fragment
12
8
 
@@ -88,7 +84,7 @@ module ActionText
88
84
  end
89
85
 
90
86
  def to_rendered_html_with_layout
91
- renderer.render(partial: "action_text/content/layout", locals: { content: self })
87
+ render partial: "action_text/content/layout", formats: :html, locals: { content: self }
92
88
  end
93
89
 
94
90
  def to_s
@@ -37,21 +37,31 @@ module ActionText
37
37
  end
38
38
 
39
39
  initializer "action_text.helper" do
40
- ActiveSupport.on_load(:action_controller_base) do
41
- helper ActionText::Engine.helpers
40
+ %i[action_controller_base action_mailer].each do |abstract_controller|
41
+ ActiveSupport.on_load(abstract_controller) do
42
+ helper ActionText::Engine.helpers
43
+ end
42
44
  end
43
45
  end
44
46
 
45
- initializer "action_text.renderer" do |app|
46
- app.executor.to_run { ActionText::Content.renderer = ApplicationController.renderer }
47
- app.executor.to_complete { ActionText::Content.renderer = ApplicationController.renderer }
48
-
47
+ initializer "action_text.renderer" do
49
48
  ActiveSupport.on_load(:action_text_content) do
50
- self.renderer = ApplicationController.renderer
49
+ self.default_renderer = Class.new(ActionController::Base).renderer
50
+ end
51
+
52
+ %i[action_controller_base action_mailer].each do |abstract_controller|
53
+ ActiveSupport.on_load(abstract_controller) do
54
+ around_action do |controller, action|
55
+ ActionText::Content.with_renderer(controller, &action)
56
+ end
57
+ end
51
58
  end
59
+ end
52
60
 
53
- ActiveSupport.on_load(:action_controller_base) do
54
- before_action { ActionText::Content.renderer = ApplicationController.renderer.new(request.env) }
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
55
65
  end
56
66
  end
57
67
  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 = 3
13
- PRE = "2"
11
+ MINOR = 1
12
+ TINY = 0
13
+ PRE = nil
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,30 @@
1
+ # frozen_string_literal: true
2
+
3
+ require "active_support/concern"
4
+ require "active_support/core_ext/module/attribute_accessors_per_thread"
5
+
6
+ module ActionText
7
+ module Rendering #:nodoc:
8
+ extend ActiveSupport::Concern
9
+
10
+ included do
11
+ cattr_accessor :default_renderer, instance_accessor: false
12
+ thread_cattr_accessor :renderer, instance_accessor: false
13
+ delegate :render, to: :class
14
+ end
15
+
16
+ class_methods do
17
+ def with_renderer(renderer)
18
+ previous_renderer = self.renderer
19
+ self.renderer = renderer
20
+ yield
21
+ ensure
22
+ self.renderer = previous_renderer
23
+ end
24
+
25
+ def render(*args, &block)
26
+ (renderer || default_renderer).render_to_string(*args, &block)
27
+ end
28
+ end
29
+ end
30
+ end
@@ -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
@@ -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
@@ -1,12 +1,12 @@
1
1
  {
2
2
  "name": "@rails/actiontext",
3
- "version": "6.0.3-2",
3
+ "version": "6.1.0",
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"
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.3.2
4
+ version: 6.1.0
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: 2020-06-17 00:00:00.000000000 Z
13
+ date: 2020-12-09 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.3.2
21
+ version: 6.1.0
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.3.2
28
+ version: 6.1.0
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.3.2
35
+ version: 6.1.0
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.3.2
42
+ version: 6.1.0
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.3.2
49
+ version: 6.1.0
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.3.2
56
+ version: 6.1.0
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.3.2
63
+ version: 6.1.0
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.3.2
70
+ version: 6.1.0
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,28 +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
127
+ - lib/action_text/rendering.rb
125
128
  - lib/action_text/serialization.rb
129
+ - lib/action_text/system_test_helper.rb
126
130
  - lib/action_text/trix_attachment.rb
127
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
128
136
  - lib/tasks/actiontext.rake
129
- - lib/templates/actiontext.scss
130
- - lib/templates/fixtures.yml
131
- - lib/templates/installer.rb
132
137
  - package.json
133
138
  homepage: https://rubyonrails.org
134
139
  licenses:
135
140
  - MIT
136
141
  metadata:
137
142
  bug_tracker_uri: https://github.com/rails/rails/issues
138
- changelog_uri: https://github.com/rails/rails/blob/v6.0.3.2/actiontext/CHANGELOG.md
139
- documentation_uri: https://api.rubyonrails.org/v6.0.3.2/
143
+ changelog_uri: https://github.com/rails/rails/blob/v6.1.0/actiontext/CHANGELOG.md
144
+ documentation_uri: https://api.rubyonrails.org/v6.1.0/
140
145
  mailing_list_uri: https://discuss.rubyonrails.org/c/rubyonrails-talk
141
- source_code_uri: https://github.com/rails/rails/tree/v6.0.3.2/actiontext
142
- post_install_message:
146
+ source_code_uri: https://github.com/rails/rails/tree/v6.1.0/actiontext
147
+ post_install_message:
143
148
  rdoc_options: []
144
149
  require_paths:
145
150
  - lib
@@ -154,8 +159,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
154
159
  - !ruby/object:Gem::Version
155
160
  version: '0'
156
161
  requirements: []
157
- rubygems_version: 3.1.2
158
- signing_key:
162
+ rubygems_version: 3.1.4
163
+ signing_key:
159
164
  specification_version: 4
160
165
  summary: Rich text framework.
161
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