@rails/actiontext 6.1.4-1 → 7.0.0-rc1
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.
package/README.md
CHANGED
|
@@ -4,6 +4,10 @@ Action Text brings rich text content and editing to Rails. It includes the [Trix
|
|
|
4
4
|
|
|
5
5
|
You can read more about Action Text in the [Action Text Overview](https://edgeguides.rubyonrails.org/action_text_overview.html) guide.
|
|
6
6
|
|
|
7
|
+
## Development
|
|
8
|
+
|
|
9
|
+
The JavaScript for Action Text is distributed both as a npm module under @rails/actiontext and via the asset pipeline as actiontext.js (and we mirror Trix as trix.js). To ensure that the latter remains in sync, you must run `yarn build` and checkin the artifacts whenever the JavaScript source or the Trix dependency is bumped. CSS changes must be brought over manually to app/assets/stylesheets/trix.css
|
|
10
|
+
|
|
7
11
|
## License
|
|
8
12
|
|
|
9
13
|
Action Text is released under the [MIT License](https://opensource.org/licenses/MIT).
|
|
@@ -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,8 +1,9 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@rails/actiontext",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "7.0.0-rc1",
|
|
4
4
|
"description": "Edit and display rich text in Rails applications",
|
|
5
5
|
"main": "app/javascript/actiontext/index.js",
|
|
6
|
+
"type": "module",
|
|
6
7
|
"files": [
|
|
7
8
|
"app/javascript/actiontext/*.js"
|
|
8
9
|
],
|
|
@@ -21,9 +22,18 @@
|
|
|
21
22
|
],
|
|
22
23
|
"license": "MIT",
|
|
23
24
|
"dependencies": {
|
|
24
|
-
"@rails/activestorage": "
|
|
25
|
+
"@rails/activestorage": ">= 7.0.0-alpha1"
|
|
25
26
|
},
|
|
26
27
|
"peerDependencies": {
|
|
27
|
-
"trix": "^1.
|
|
28
|
+
"trix": "^1.3.1"
|
|
29
|
+
},
|
|
30
|
+
"devDependencies": {
|
|
31
|
+
"@rollup/plugin-node-resolve": "^11.0.1",
|
|
32
|
+
"@rollup/plugin-commonjs": "^19.0.1",
|
|
33
|
+
"rollup": "^2.35.1",
|
|
34
|
+
"trix": "^1.3.1"
|
|
35
|
+
},
|
|
36
|
+
"scripts": {
|
|
37
|
+
"build": "rollup --config rollup.config.js"
|
|
28
38
|
}
|
|
29
39
|
}
|