actiontext 7.0.1 → 7.0.2

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: bf4bd77285fd2b59a3896c75588bd2d85b451b0e149c392bf8fc9b81cb577fd8
4
- data.tar.gz: 508163fd41adbf3e3055ca462045e4a23f0496b6dc5f283c968fe4296593d9b1
3
+ metadata.gz: 8f56744d9d099b5b762e63296c602589aaf59a8a2dba676c15d6e36da0fb0aa2
4
+ data.tar.gz: ef34b150c59b4d0f7ad9e13eacf41f949fd10cd40d12e9a0ea2aecb4f7ef561e
5
5
  SHA512:
6
- metadata.gz: f1874b4e5135f3729d96c354e0a08bc3b4aee5ff97332bcb086352db68782e7095745daa6304aed64bdbf68cdd4aac3cde448273e35912c66f73fd32d70495f1
7
- data.tar.gz: 1de1d1e3ef4feb540c075176a8e0d83d4dcd7bf1653e048c4a19db7781cf3c5bf3da1c5aebd054f695a54a0d2adfeaac5c31dc44f3b53b4bb6f125e74e386acf
6
+ metadata.gz: 14573ba5cac1acb537ce33dfc61894ce918948000ffe455b46abbf862d5e6b6f490a33469db2e68c9e1f2b7af72e05a467ef17e777fd38c77d480a7395e3264b
7
+ data.tar.gz: f536a90a0a0877510b1d2c825cf55a21e73c8da02afc78b819c619fe32dc095656cef188ba46c6122b330bdf7e0f8889b75deb65c81847bb818ad6b467379258
data/CHANGELOG.md CHANGED
@@ -1,3 +1,8 @@
1
+ ## Rails 7.0.2 (February 08, 2022) ##
2
+
3
+ * No changes.
4
+
5
+
1
6
  ## Rails 7.0.1 (January 06, 2022) ##
2
7
 
3
8
  * No changes.
@@ -506,16 +506,14 @@ var activestorage = {exports: {}};
506
506
  }
507
507
  }
508
508
  class BlobRecord {
509
- constructor(file, checksum, url, directUploadToken, attachmentName) {
509
+ constructor(file, checksum, url) {
510
510
  this.file = file;
511
511
  this.attributes = {
512
512
  filename: file.name,
513
513
  content_type: file.type || "application/octet-stream",
514
514
  byte_size: file.size,
515
- checksum: checksum,
515
+ checksum: checksum
516
516
  };
517
- this.directUploadToken = directUploadToken;
518
- this.attachmentName = attachmentName;
519
517
  this.xhr = new XMLHttpRequest;
520
518
  this.xhr.open("POST", url, true);
521
519
  this.xhr.responseType = "json";
@@ -543,9 +541,7 @@ var activestorage = {exports: {}};
543
541
  create(callback) {
544
542
  this.callback = callback;
545
543
  this.xhr.send(JSON.stringify({
546
- blob: this.attributes,
547
- direct_upload_token: this.directUploadToken,
548
- attachment_name: this.attachmentName
544
+ blob: this.attributes
549
545
  }));
550
546
  }
551
547
  requestDidLoad(event) {
@@ -603,12 +599,10 @@ var activestorage = {exports: {}};
603
599
  }
604
600
  let id = 0;
605
601
  class DirectUpload {
606
- constructor(file, url, directUploadToken, attachmentName, delegate) {
602
+ constructor(file, url, delegate) {
607
603
  this.id = ++id;
608
604
  this.file = file;
609
605
  this.url = url;
610
- this.directUploadToken = directUploadToken;
611
- this.attachmentName = attachmentName;
612
606
  this.delegate = delegate;
613
607
  }
614
608
  create(callback) {
@@ -617,7 +611,7 @@ var activestorage = {exports: {}};
617
611
  callback(error);
618
612
  return;
619
613
  }
620
- const blob = new BlobRecord(this.file, checksum, this.url, this.directUploadToken, this.attachmentName);
614
+ const blob = new BlobRecord(this.file, checksum, this.url);
621
615
  notify(this.delegate, "directUploadWillCreateBlobWithXHR", blob.xhr);
622
616
  blob.create((error => {
623
617
  if (error) {
@@ -646,7 +640,7 @@ var activestorage = {exports: {}};
646
640
  constructor(input, file) {
647
641
  this.input = input;
648
642
  this.file = file;
649
- this.directUpload = new DirectUpload(this.file, this.url, this.directUploadToken, this.attachmentName, this);
643
+ this.directUpload = new DirectUpload(this.file, this.url, this);
650
644
  this.dispatch("initialize");
651
645
  }
652
646
  start(callback) {
@@ -677,12 +671,6 @@ var activestorage = {exports: {}};
677
671
  get url() {
678
672
  return this.input.getAttribute("data-direct-upload-url");
679
673
  }
680
- get directUploadToken() {
681
- return this.input.getAttribute("data-direct-upload-token");
682
- }
683
- get attachmentName() {
684
- return this.input.getAttribute("data-direct-upload-attachment-name");
685
- }
686
674
  dispatch(name, detail = {}) {
687
675
  detail.file = this.file;
688
676
  detail.id = this.directUpload.id;
@@ -842,7 +830,7 @@ class AttachmentUpload {
842
830
  constructor(attachment, element) {
843
831
  this.attachment = attachment;
844
832
  this.element = element;
845
- this.directUpload = new activestorage.exports.DirectUpload(attachment.file, this.directUploadUrl, this.directUploadToken, this.directUploadAttachmentName, this);
833
+ this.directUpload = new activestorage.exports.DirectUpload(attachment.file, this.directUploadUrl, this);
846
834
  }
847
835
 
848
836
  start() {
@@ -877,14 +865,6 @@ class AttachmentUpload {
877
865
  return this.element.dataset.directUploadUrl
878
866
  }
879
867
 
880
- get directUploadToken() {
881
- return this.element.dataset.directUploadToken
882
- }
883
-
884
- get directUploadAttachmentName() {
885
- return this.element.dataset.directUploadAttachmentName
886
- }
887
-
888
868
  get blobUrlTemplate() {
889
869
  return this.element.dataset.blobUrlTemplate
890
870
  }
@@ -32,14 +32,6 @@ module ActionText
32
32
  options[:data][:direct_upload_url] ||= main_app.rails_direct_uploads_url
33
33
  options[:data][:blob_url_template] ||= main_app.rails_service_blob_url(":signed_id", ":filename")
34
34
 
35
- class_with_attachment = "ActionText::RichText#embeds"
36
- options[:data][:direct_upload_attachment_name] ||= class_with_attachment
37
- options[:data][:direct_upload_token] = ActiveStorage::DirectUploadToken.generate_direct_upload_token(
38
- class_with_attachment,
39
- ActiveStorage::Blob.service.name,
40
- session
41
- )
42
-
43
35
  editor_tag = content_tag("trix-editor", "", options)
44
36
  input_tag = hidden_field_tag(name, value.try(:to_trix_html) || value, id: options[:input], form: form)
45
37
 
@@ -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.directUploadToken, this.attachmentName, this)
7
+ this.directUpload = new DirectUpload(attachment.file, this.directUploadUrl, this)
8
8
  }
9
9
 
10
10
  start() {
@@ -42,11 +42,4 @@ 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
- }
52
45
  }
@@ -9,7 +9,7 @@ module ActionText
9
9
  module VERSION
10
10
  MAJOR = 7
11
11
  MINOR = 0
12
- TINY = 1
12
+ TINY = 2
13
13
  PRE = nil
14
14
 
15
15
  STRING = [MAJOR, MINOR, TINY, PRE].compact.join(".")
data/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rails/actiontext",
3
- "version": "7.0.1",
3
+ "version": "7.0.2",
4
4
  "description": "Edit and display rich text in Rails applications",
5
5
  "main": "app/javascript/actiontext/index.js",
6
6
  "type": "module",
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: actiontext
3
3
  version: !ruby/object:Gem::Version
4
- version: 7.0.1
4
+ version: 7.0.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Javan Makhmali
@@ -10,7 +10,7 @@ authors:
10
10
  autorequire:
11
11
  bindir: bin
12
12
  cert_chain: []
13
- date: 2022-01-06 00:00:00.000000000 Z
13
+ date: 2022-02-08 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: activesupport
@@ -18,56 +18,56 @@ dependencies:
18
18
  requirements:
19
19
  - - '='
20
20
  - !ruby/object:Gem::Version
21
- version: 7.0.1
21
+ version: 7.0.2
22
22
  type: :runtime
23
23
  prerelease: false
24
24
  version_requirements: !ruby/object:Gem::Requirement
25
25
  requirements:
26
26
  - - '='
27
27
  - !ruby/object:Gem::Version
28
- version: 7.0.1
28
+ version: 7.0.2
29
29
  - !ruby/object:Gem::Dependency
30
30
  name: activerecord
31
31
  requirement: !ruby/object:Gem::Requirement
32
32
  requirements:
33
33
  - - '='
34
34
  - !ruby/object:Gem::Version
35
- version: 7.0.1
35
+ version: 7.0.2
36
36
  type: :runtime
37
37
  prerelease: false
38
38
  version_requirements: !ruby/object:Gem::Requirement
39
39
  requirements:
40
40
  - - '='
41
41
  - !ruby/object:Gem::Version
42
- version: 7.0.1
42
+ version: 7.0.2
43
43
  - !ruby/object:Gem::Dependency
44
44
  name: activestorage
45
45
  requirement: !ruby/object:Gem::Requirement
46
46
  requirements:
47
47
  - - '='
48
48
  - !ruby/object:Gem::Version
49
- version: 7.0.1
49
+ version: 7.0.2
50
50
  type: :runtime
51
51
  prerelease: false
52
52
  version_requirements: !ruby/object:Gem::Requirement
53
53
  requirements:
54
54
  - - '='
55
55
  - !ruby/object:Gem::Version
56
- version: 7.0.1
56
+ version: 7.0.2
57
57
  - !ruby/object:Gem::Dependency
58
58
  name: actionpack
59
59
  requirement: !ruby/object:Gem::Requirement
60
60
  requirements:
61
61
  - - '='
62
62
  - !ruby/object:Gem::Version
63
- version: 7.0.1
63
+ version: 7.0.2
64
64
  type: :runtime
65
65
  prerelease: false
66
66
  version_requirements: !ruby/object:Gem::Requirement
67
67
  requirements:
68
68
  - - '='
69
69
  - !ruby/object:Gem::Version
70
- version: 7.0.1
70
+ version: 7.0.2
71
71
  - !ruby/object:Gem::Dependency
72
72
  name: nokogiri
73
73
  requirement: !ruby/object:Gem::Requirement
@@ -160,10 +160,10 @@ licenses:
160
160
  - MIT
161
161
  metadata:
162
162
  bug_tracker_uri: https://github.com/rails/rails/issues
163
- changelog_uri: https://github.com/rails/rails/blob/v7.0.1/actiontext/CHANGELOG.md
164
- documentation_uri: https://api.rubyonrails.org/v7.0.1/
163
+ changelog_uri: https://github.com/rails/rails/blob/v7.0.2/actiontext/CHANGELOG.md
164
+ documentation_uri: https://api.rubyonrails.org/v7.0.2/
165
165
  mailing_list_uri: https://discuss.rubyonrails.org/c/rubyonrails-talk
166
- source_code_uri: https://github.com/rails/rails/tree/v7.0.1/actiontext
166
+ source_code_uri: https://github.com/rails/rails/tree/v7.0.2/actiontext
167
167
  rubygems_mfa_required: 'true'
168
168
  post_install_message:
169
169
  rdoc_options: []