@rails/actiontext 7.0.0-alpha1 → 7.0.0-rc3

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.
@@ -4,7 +4,7 @@ export class AttachmentUpload {
4
4
  constructor(attachment, element) {
5
5
  this.attachment = attachment
6
6
  this.element = element
7
- this.directUpload = new DirectUpload(attachment.file, this.directUploadUrl, this)
7
+ this.directUpload = new DirectUpload(attachment.file, this.directUploadUrl, this.directUploadToken, this.attachmentName, this)
8
8
  }
9
9
 
10
10
  start() {
@@ -42,4 +42,11 @@ export class AttachmentUpload {
42
42
  get blobUrlTemplate() {
43
43
  return this.element.dataset.blobUrlTemplate
44
44
  }
45
+
46
+ get directUploadToken() {
47
+ return this.element.getAttribute("data-direct-upload-token");
48
+ }
49
+ get attachmentName() {
50
+ return this.element.getAttribute("data-direct-upload-attachment-name");
51
+ }
45
52
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rails/actiontext",
3
- "version": "7.0.0-alpha1",
3
+ "version": "7.0.0-rc3",
4
4
  "description": "Edit and display rich text in Rails applications",
5
5
  "main": "app/javascript/actiontext/index.js",
6
6
  "type": "module",
@@ -22,7 +22,7 @@
22
22
  ],
23
23
  "license": "MIT",
24
24
  "dependencies": {
25
- "@rails/activestorage": "7.0.0-alpha"
25
+ "@rails/activestorage": ">= 7.0.0-alpha1"
26
26
  },
27
27
  "peerDependencies": {
28
28
  "trix": "^1.3.1"
package/CHANGELOG.md DELETED
@@ -1,34 +0,0 @@
1
- ## Rails 7.0.0.alpha1 (September 15, 2021) ##
2
-
3
- * Make the Action Text + Trix JavaScript and CSS available through the asset pipeline.
4
-
5
- *DHH*
6
-
7
- * OpenSSL constants are now used for Digest computations.
8
-
9
- *Dirkjan Bussink*
10
-
11
- * Add support for passing `form:` option to `rich_text_area_tag` and
12
- `rich_text_area` helpers to specify the `<input type="hidden" form="...">`
13
- value.
14
-
15
- *Sean Doyle*
16
-
17
- * Add `config.action_text.attachment_tag_name`, to specify the HTML tag that contains attachments.
18
-
19
- *Mark VanLandingham*
20
-
21
- * Expose how we render the HTML _surrounding_ rich text content as an
22
- extensible `layouts/action_view/contents/_content.html.erb` template to
23
- encourage user-land customizations, while retaining private API control over how
24
- the rich text itself is rendered by `action_text/contents/_content.html.erb`
25
- partial.
26
-
27
- *Sean Doyle*
28
-
29
- * Add `with_all_rich_text` method to eager load all rich text associations on a model at once.
30
-
31
- *Matt Swanson*, *DHH*
32
-
33
-
34
- Please check [6-1-stable](https://github.com/rails/rails/blob/6-1-stable/actiontext/CHANGELOG.md) for previous changes.