actiontext 7.1.5.1 → 7.2.0.beta1

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.

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