actiontext 7.0.4 → 7.1.5.1

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.
Files changed (34) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +95 -42
  3. data/MIT-LICENSE +1 -1
  4. data/README.md +2 -2
  5. data/app/assets/javascripts/actiontext.esm.js +889 -0
  6. data/app/assets/javascripts/actiontext.js +55 -73
  7. data/app/assets/javascripts/trix.js +13612 -5170
  8. data/app/assets/stylesheets/trix.css +67 -30
  9. data/app/helpers/action_text/content_helper.rb +26 -4
  10. data/app/helpers/action_text/tag_helper.rb +11 -7
  11. data/app/models/action_text/encrypted_rich_text.rb +2 -0
  12. data/app/models/action_text/rich_text.rb +29 -1
  13. data/app/views/action_text/attachables/_content_attachment.html.erb +3 -0
  14. data/lib/action_text/attachable.rb +69 -5
  15. data/lib/action_text/attachables/content_attachment.rb +20 -18
  16. data/lib/action_text/attachables/missing_attachable.rb +17 -3
  17. data/lib/action_text/attachment.rb +43 -2
  18. data/lib/action_text/attribute.rb +10 -5
  19. data/lib/action_text/content.rb +48 -3
  20. data/lib/action_text/deprecator.rb +7 -0
  21. data/lib/action_text/engine.rb +15 -9
  22. data/lib/action_text/fixture_set.rb +3 -2
  23. data/lib/action_text/fragment.rb +4 -3
  24. data/lib/action_text/gem_version.rb +4 -4
  25. data/lib/action_text/html_conversion.rb +1 -1
  26. data/lib/action_text/plain_text_conversion.rb +6 -1
  27. data/lib/action_text/rendering.rb +5 -2
  28. data/lib/action_text/trix_attachment.rb +2 -2
  29. data/lib/action_text/version.rb +1 -1
  30. data/lib/action_text.rb +19 -0
  31. data/lib/generators/action_text/install/install_generator.rb +21 -4
  32. data/lib/generators/action_text/install/templates/actiontext.css +0 -4
  33. data/package.json +7 -7
  34. metadata +20 -17
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 82de1e2be05cc3b13e988c6b414f4c352a8f1a116cddca68fd1bca06cd0ec7cb
4
- data.tar.gz: fe16bd3209f7ceb9ab2694839697979d94bb64d96bb7686bd5a5a3b8ad8187aa
3
+ metadata.gz: eb74f8a7619b8294b0f780f649611245104b6024e96887adad4ccdafb54076db
4
+ data.tar.gz: 97c1d24e0a68191e7909bdbb7bd4f63a61086c73a4d4f8c64921fe0150c04c08
5
5
  SHA512:
6
- metadata.gz: 997f51c29f335af6073885d08b0c312a89bbea06eca533231ca851b450948184f96791a10d0dba23d09640985aa60086d44e66b570abbd53080868fc775192f1
7
- data.tar.gz: 041b4833e2d2b16e6c49e338b6d851023748d62c35e95cc7e5dbca27c52d69f18a8c5e5e54ea5ca51f21687af4a3bb5b85efa1b0189e1e465eb84b406ba28a1f
6
+ metadata.gz: 7ba1c7ad2177a86adc5d155070860fd09f5c4fe2485912dad6419aa748e0d6843cf874bc69361cee342096b86ac7cfc30038727473e5f09434457b328b48f53d
7
+ data.tar.gz: d1ee2ce1e3f1c4d2c0063251d2257aefa03b3fd7db4eeca59143f033ecb0da68c2c787e02bba421ac3b11d944acebc51b4bce3a01cd83b7ef38cc0213543cff5
data/CHANGELOG.md CHANGED
@@ -1,109 +1,162 @@
1
- ## Rails 7.0.4 (September 09, 2022) ##
1
+ ## Rails 7.1.5.1 (December 10, 2024) ##
2
2
 
3
- * No changes.
3
+ * Update vendored trix version to 2.1.10
4
+
5
+ *John Hawthorn*
4
6
 
5
7
 
6
- ## Rails 7.0.3.1 (July 12, 2022) ##
8
+ ## Rails 7.1.5 (October 30, 2024) ##
7
9
 
8
10
  * No changes.
9
11
 
10
12
 
11
- ## Rails 7.0.3 (May 09, 2022) ##
13
+ ## Rails 7.1.4.2 (October 23, 2024) ##
12
14
 
13
15
  * No changes.
14
16
 
15
17
 
16
- ## Rails 7.0.2.4 (April 26, 2022) ##
18
+ ## Rails 7.1.4.1 (October 15, 2024) ##
17
19
 
18
- * No changes.
20
+ * Avoid backtracing in plain_text_for_blockquote_node
19
21
 
22
+ [CVE-2024-47888]
20
23
 
21
- ## Rails 7.0.2.3 (March 08, 2022) ##
24
+ *John Hawthorn*
22
25
 
23
- * No changes.
26
+ ## Rails 7.1.4 (August 22, 2024) ##
24
27
 
28
+ * Strip `content` attribute if the key is present but the value is empty
25
29
 
26
- ## Rails 7.0.2.2 (February 11, 2022) ##
30
+ *Jeremy Green*
31
+
32
+ * Only sanitize `content` attribute when present in attachments.
33
+
34
+ *Petrik de Heus*
27
35
 
28
- * No changes.
29
36
 
37
+ ## Rails 7.1.3.4 (June 04, 2024) ##
30
38
 
31
- ## Rails 7.0.2.1 (February 11, 2022) ##
39
+ * Sanitize ActionText HTML ContentAttachment in Trix edit view
40
+ [CVE-2024-32464]
41
+
42
+ *Aaron Patterson*
43
+
44
+ ## Rails 7.1.3.3 (May 16, 2024) ##
45
+
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) ##
32
52
 
33
53
  * No changes.
34
54
 
35
55
 
36
- ## Rails 7.0.2 (February 08, 2022) ##
56
+ ## Rails 7.1.3.1 (February 21, 2024) ##
37
57
 
38
58
  * No changes.
39
59
 
40
60
 
41
- ## Rails 7.0.1 (January 06, 2022) ##
61
+ ## Rails 7.1.3 (January 16, 2024) ##
42
62
 
43
63
  * No changes.
44
64
 
45
65
 
46
- ## Rails 7.0.0 (December 15, 2021) ##
66
+ ## Rails 7.1.2 (November 10, 2023) ##
67
+
68
+ * Compile ESM package that can be used directly in the browser as `actiontext.esm.js`.
69
+
70
+ *Matias Grunberg*
71
+
72
+ * Fix using actiontext.js with Sprockets.
73
+
74
+ *Matias Grunberg*
75
+
76
+ * Upgrade Trix to 2.0.7.
77
+
78
+ *Hartley McGuire*
79
+
80
+ * Fix using Trix with Sprockets.
81
+
82
+ *Hartley McGuire*
83
+
84
+
85
+ ## Rails 7.1.1 (October 11, 2023) ##
47
86
 
48
87
  * No changes.
49
88
 
50
89
 
51
- ## Rails 7.0.0.rc3 (December 14, 2021) ##
90
+ ## Rails 7.1.0 (October 05, 2023) ##
52
91
 
53
92
  * No changes.
54
93
 
55
94
 
56
- ## Rails 7.0.0.rc2 (December 14, 2021) ##
95
+ ## Rails 7.1.0.rc2 (October 01, 2023) ##
57
96
 
58
97
  * No changes.
59
98
 
60
- ## Rails 7.0.0.rc1 (December 06, 2021) ##
61
99
 
62
- * Fix an issue with how nested lists were displayed when converting to plain text
100
+ ## Rails 7.1.0.rc1 (September 27, 2023) ##
63
101
 
64
- *Matt Swanson*
102
+ * No changes.
65
103
 
66
- * Allow passing in a custom `direct_upload_url` or `blob_url_template` to `rich_text_area_tag`.
67
104
 
68
- *Lucas Mansur*
105
+ ## Rails 7.1.0.beta1 (September 13, 2023) ##
69
106
 
107
+ * Use `Rails::HTML5::SafeListSanitizer` by default in the Rails 7.1 configuration if it is
108
+ supported.
70
109
 
71
- ## Rails 7.0.0.alpha2 (September 15, 2021) ##
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`.
72
113
 
73
- * No changes.
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`.
74
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.
75
123
 
76
- ## Rails 7.0.0.alpha1 (September 15, 2021) ##
124
+ *Mike Dalessio*
77
125
 
78
- * Make the Action Text + Trix JavaScript and CSS available through the asset pipeline.
126
+ * Attachables now can override default attachment missing template.
79
127
 
80
- *DHH*
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.
81
132
 
82
- * OpenSSL constants are now used for Digest computations.
133
+ *Matt Swanson*, *Joel Drapper*
83
134
 
84
- *Dirkjan Bussink*
135
+ * Update bundled Trix version from `1.3.1` to `2.0.4`.
85
136
 
86
- * Add support for passing `form:` option to `rich_text_area_tag` and
87
- `rich_text_area` helpers to specify the `<input type="hidden" form="...">`
88
- value.
137
+ *Sarah Ridge*, *Sean Doyle*
89
138
 
90
- *Sean Doyle*
139
+ * Apply `field_error_proc` to `rich_text_area` form fields.
140
+
141
+ *Kaíque Kandy Koga*
91
142
 
92
- * Add `config.action_text.attachment_tag_name`, to specify the HTML tag that contains attachments.
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`.
93
146
 
94
- *Mark VanLandingham*
147
+ *Jonathan Hefner*
95
148
 
96
- * Expose how we render the HTML _surrounding_ rich text content as an
97
- extensible `layouts/action_view/contents/_content.html.erb` template to
98
- encourage user-land customizations, while retaining private API control over how
99
- the rich text itself is rendered by `action_text/contents/_content.html.erb`
100
- partial.
149
+ * Support `strict_loading:` option for `has_rich_text` declaration
101
150
 
102
151
  *Sean Doyle*
103
152
 
104
- * Add `with_all_rich_text` method to eager load all rich text associations on a model at once.
153
+ * Update ContentAttachment so that it can encapsulate arbitrary HTML content in a document.
154
+
155
+ *Jamis Buck*
105
156
 
106
- *Matt Swanson*, *DHH*
157
+ * Fix an issue that caused the content layout to render multiple times when a
158
+ rich_text field was updated.
107
159
 
160
+ *Jacob Herrington*
108
161
 
109
- Please check [6-1-stable](https://github.com/rails/rails/blob/6-1-stable/actiontext/CHANGELOG.md) for previous changes.
162
+ Please check [7-0-stable](https://github.com/rails/rails/blob/7-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) 2020-2022 Basecamp, LLC
3
+ Copyright (c) 37signals 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
data/README.md CHANGED
@@ -1,8 +1,8 @@
1
1
  # Action Text
2
2
 
3
- Action Text brings rich text content and editing to Rails. It includes the [Trix editor](https://trix-editor.org) that handles everything from formatting to links to quotes to lists to embedded images and galleries. The rich text content generated by the Trix editor is saved in its own RichText model that's associated with any existing Active Record model in the application. Any embedded images (or other attachments) are automatically stored using Active Storage and associated with the included RichText model.
3
+ Action Text brings rich text content and editing to \Rails. It includes the [Trix editor](https://trix-editor.org) that handles everything from formatting to links to quotes to lists to embedded images and galleries. The rich text content generated by the Trix editor is saved in its own RichText model that's associated with any existing Active Record model in the application. Any embedded images (or other attachments) are automatically stored using Active Storage and associated with the included RichText model.
4
4
 
5
- You can read more about Action Text in the [Action Text Overview](https://edgeguides.rubyonrails.org/action_text_overview.html) guide.
5
+ You can read more about Action Text in the [Action Text Overview](https://guides.rubyonrails.org/action_text_overview.html) guide.
6
6
 
7
7
  ## Development
8
8