actiontext 7.1.5.2 → 7.2.0.beta1

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.

Potentially problematic release.


This version of actiontext might be problematic. Click here for more details.

Files changed (39) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +19 -141
  3. data/app/assets/javascripts/actiontext.esm.js +3 -3
  4. data/app/assets/javascripts/actiontext.js +3 -3
  5. data/app/assets/javascripts/trix.js +203 -1758
  6. data/app/helpers/action_text/content_helper.rb +2 -9
  7. data/app/helpers/action_text/tag_helper.rb +38 -28
  8. data/app/models/action_text/encrypted_rich_text.rb +2 -2
  9. data/app/models/action_text/record.rb +2 -0
  10. data/app/models/action_text/rich_text.rb +58 -26
  11. data/db/migrate/20180528164100_create_action_text_tables.rb +1 -1
  12. data/lib/action_text/attachable.rb +35 -33
  13. data/lib/action_text/attachables/content_attachment.rb +2 -0
  14. data/lib/action_text/attachables/missing_attachable.rb +2 -0
  15. data/lib/action_text/attachables/remote_image.rb +2 -0
  16. data/lib/action_text/attachment.rb +27 -25
  17. data/lib/action_text/attachment_gallery.rb +2 -0
  18. data/lib/action_text/attachments/caching.rb +2 -0
  19. data/lib/action_text/attachments/minification.rb +2 -0
  20. data/lib/action_text/attachments/trix_conversion.rb +2 -0
  21. data/lib/action_text/attribute.rb +36 -22
  22. data/lib/action_text/content.rb +47 -31
  23. data/lib/action_text/deprecator.rb +2 -0
  24. data/lib/action_text/encryption.rb +2 -0
  25. data/lib/action_text/engine.rb +2 -0
  26. data/lib/action_text/fixture_set.rb +34 -34
  27. data/lib/action_text/fragment.rb +4 -0
  28. data/lib/action_text/gem_version.rb +6 -4
  29. data/lib/action_text/html_conversion.rb +2 -0
  30. data/lib/action_text/plain_text_conversion.rb +3 -6
  31. data/lib/action_text/rendering.rb +2 -0
  32. data/lib/action_text/serialization.rb +2 -0
  33. data/lib/action_text/system_test_helper.rb +20 -17
  34. data/lib/action_text/trix_attachment.rb +2 -0
  35. data/lib/action_text/version.rb +3 -1
  36. data/lib/generators/action_text/install/install_generator.rb +10 -3
  37. data/lib/rails/generators/test_unit/install_generator.rb +2 -0
  38. data/package.json +1 -1
  39. metadata +18 -15
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 7cb8576fb6dc6ee3f8b1cfff7f3e3973f6eb3fa34e1784c5c912418233b49a54
4
- data.tar.gz: 47519302480a37ee21c2841674238431d08aec65e7d4d7b459be4805c1631dfa
3
+ metadata.gz: d497d50205633b66005bfcfe850ee8d5404c0b3b9f953a14356bb912c8b3b4d5
4
+ data.tar.gz: '099e3d4dca02f13983f06b8ffcf6c49a1bb2f3cb66ae94e8534c0764f8b56700'
5
5
  SHA512:
6
- metadata.gz: 7948ef6965b909773870f725b10732634619221c9cffaeefb7fb6881cf77c44ea2746d7b93f152c6a786c24b328b3f409248ed8193d66e593728b3f5976e16a5
7
- data.tar.gz: cc70c65ce97bc493dd9e9cce61fd4fb3026cd4f31c4b5aabeacd01b86858a75df5e2217bf29dbedc983d4b9921692f8736df015ea345954d44f7b61c7b91331d
6
+ metadata.gz: e9acfe56af6ec22cf0448fc42c7dc3cba769bbbce316efa926869ac083db8491a547366ae5beede3da8a02b75c1cbb6f7a8e252c0519fbd7c282af841835a644
7
+ data.tar.gz: 9beaaede36bf8158e2fee2e6d5f2fb02dbaabeb86a279ee7ca0e9ef87b5cc710d3ea454ae3e8723235eb8b2d2bc2586e540f89623c2609fd3620207e2785c042
data/CHANGELOG.md CHANGED
@@ -1,76 +1,32 @@
1
- ## Rails 7.1.5.2 (August 13, 2025) ##
1
+ ## Rails 7.2.0.beta1 (May 29, 2024) ##
2
2
 
3
- * No changes.
4
-
5
-
6
- ## Rails 7.1.5.1 (December 10, 2024) ##
7
-
8
- * Update vendored trix version to 2.1.10
9
-
10
- *John Hawthorn*
11
-
12
-
13
- ## Rails 7.1.5 (October 30, 2024) ##
14
-
15
- * No changes.
16
-
17
-
18
- ## Rails 7.1.4.2 (October 23, 2024) ##
19
-
20
- * No changes.
21
-
22
-
23
- ## Rails 7.1.4.1 (October 15, 2024) ##
24
-
25
- * Avoid backtracing in plain_text_for_blockquote_node
26
-
27
- [CVE-2024-47888]
28
-
29
- *John Hawthorn*
30
-
31
- ## Rails 7.1.4 (August 22, 2024) ##
32
-
33
- * Strip `content` attribute if the key is present but the value is empty
34
-
35
- *Jeremy Green*
36
-
37
- * Only sanitize `content` attribute when present in attachments.
3
+ * Use `includes` instead of `eager_load` for `with_all_rich_text`.
38
4
 
39
5
  *Petrik de Heus*
40
6
 
7
+ * Delegate `ActionText::Content#deconstruct` to `Nokogiri::XML::DocumentFragment#elements`.
41
8
 
42
- ## Rails 7.1.3.4 (June 04, 2024) ##
43
-
44
- * Sanitize ActionText HTML ContentAttachment in Trix edit view
45
- [CVE-2024-32464]
46
-
47
- *Aaron Patterson*
48
-
49
- ## Rails 7.1.3.3 (May 16, 2024) ##
50
-
51
- * Upgrade Trix to 2.1.1 to fix [CVE-2024-34341](https://github.com/basecamp/trix/security/advisories/GHSA-qjqp-xr96-cj99).
52
-
53
- *Rafael Mendonça França*
54
-
9
+ ```ruby
10
+ content = ActionText::Content.new <<~HTML
11
+ <h1>Hello, world</h1>
55
12
 
56
- ## Rails 7.1.3.2 (February 21, 2024) ##
13
+ <div>The body</div>
14
+ HTML
57
15
 
58
- * No changes.
16
+ content => [h1, div]
59
17
 
18
+ assert_pattern { h1 => { content: "Hello, world" } }
19
+ assert_pattern { div => { content: "The body" } }
20
+ ```
60
21
 
61
- ## Rails 7.1.3.1 (February 21, 2024) ##
62
-
63
- * No changes.
64
-
65
-
66
- ## Rails 7.1.3 (January 16, 2024) ##
67
-
68
- * No changes.
22
+ *Sean Doyle*
69
23
 
24
+ * Fix all Action Text database related models to respect
25
+ `ActiveRecord::Base.table_name_prefix` configuration.
70
26
 
71
- ## Rails 7.1.2 (November 10, 2023) ##
27
+ *Chedli Bourguiba*
72
28
 
73
- * Compile ESM package that can be used directly in the browser as `actiontext.esm.js`.
29
+ * Compile ESM package that can be used directly in the browser as actiontext.esm.js
74
30
 
75
31
  *Matias Grunberg*
76
32
 
@@ -78,7 +34,7 @@
78
34
 
79
35
  *Matias Grunberg*
80
36
 
81
- * Upgrade Trix to 2.0.7.
37
+ * Upgrade Trix to 2.0.7
82
38
 
83
39
  *Hartley McGuire*
84
40
 
@@ -86,82 +42,4 @@
86
42
 
87
43
  *Hartley McGuire*
88
44
 
89
-
90
- ## Rails 7.1.1 (October 11, 2023) ##
91
-
92
- * No changes.
93
-
94
-
95
- ## Rails 7.1.0 (October 05, 2023) ##
96
-
97
- * No changes.
98
-
99
-
100
- ## Rails 7.1.0.rc2 (October 01, 2023) ##
101
-
102
- * No changes.
103
-
104
-
105
- ## Rails 7.1.0.rc1 (September 27, 2023) ##
106
-
107
- * No changes.
108
-
109
-
110
- ## Rails 7.1.0.beta1 (September 13, 2023) ##
111
-
112
- * Use `Rails::HTML5::SafeListSanitizer` by default in the Rails 7.1 configuration if it is
113
- supported.
114
-
115
- Action Text's sanitizer can be configured by setting
116
- `config.action_text.sanitizer_vendor`. Supported values are `Rails::HTML4::Sanitizer` or
117
- `Rails::HTML5::Sanitizer`.
118
-
119
- The Rails 7.1 configuration will set this to `Rails::HTML5::Sanitizer` when it is supported, and
120
- fall back to `Rails::HTML4::Sanitizer`. Previous configurations default to
121
- `Rails::HTML4::Sanitizer`.
122
-
123
- As a result of this change, the defaults for `ActionText::ContentHelper.allowed_tags` and
124
- `.allowed_attributes` are applied at runtime, so the value of these attributes is now 'nil'
125
- unless set by the application. You may call `sanitizer_allowed_tags` or
126
- `sanitizer_allowed_attributes` to inspect the tags and attributes being allowed by the
127
- sanitizer.
128
-
129
- *Mike Dalessio*
130
-
131
- * Attachables now can override default attachment missing template.
132
-
133
- When rendering Action Text attachments where the underlying attachable model has
134
- been removed, a fallback template is used. You now can override this template on
135
- a per-model basis. For example, you could render a placeholder image for a file
136
- attachment or the text "Deleted User" for a User attachment.
137
-
138
- *Matt Swanson*, *Joel Drapper*
139
-
140
- * Update bundled Trix version from `1.3.1` to `2.0.4`.
141
-
142
- *Sarah Ridge*, *Sean Doyle*
143
-
144
- * Apply `field_error_proc` to `rich_text_area` form fields.
145
-
146
- *Kaíque Kandy Koga*
147
-
148
- * Action Text attachment URLs rendered in a background job (a la Turbo
149
- Streams) now use `Rails.application.default_url_options` and
150
- `Rails.application.config.force_ssl` instead of `http://example.org`.
151
-
152
- *Jonathan Hefner*
153
-
154
- * Support `strict_loading:` option for `has_rich_text` declaration
155
-
156
- *Sean Doyle*
157
-
158
- * Update ContentAttachment so that it can encapsulate arbitrary HTML content in a document.
159
-
160
- *Jamis Buck*
161
-
162
- * Fix an issue that caused the content layout to render multiple times when a
163
- rich_text field was updated.
164
-
165
- *Jacob Herrington*
166
-
167
- Please check [7-0-stable](https://github.com/rails/rails/blob/7-0-stable/actiontext/CHANGELOG.md) for previous changes.
45
+ Please check [7-1-stable](https://github.com/rails/rails/blob/7-1-stable/actiontext/CHANGELOG.md) for previous changes.
@@ -771,9 +771,9 @@ function start() {
771
771
  }
772
772
 
773
773
  function didClick(event) {
774
- const button = event.target.closest("button, input");
775
- if (button && button.type === "submit" && button.form) {
776
- submitButtonsByForm.set(button.form, button);
774
+ const {target: target} = event;
775
+ if ((target.tagName == "INPUT" || target.tagName == "BUTTON") && target.type == "submit" && target.form) {
776
+ submitButtonsByForm.set(target.form, target);
777
777
  }
778
778
  }
779
779
 
@@ -753,9 +753,9 @@
753
753
  }
754
754
  }
755
755
  function didClick(event) {
756
- const button = event.target.closest("button, input");
757
- if (button && button.type === "submit" && button.form) {
758
- submitButtonsByForm.set(button.form, button);
756
+ const {target: target} = event;
757
+ if ((target.tagName == "INPUT" || target.tagName == "BUTTON") && target.type == "submit" && target.form) {
758
+ submitButtonsByForm.set(target.form, target);
759
759
  }
760
760
  }
761
761
  function didSubmitForm(event) {