dropzone_input 0.0.2 → 0.0.3

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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 2b6c88928b59aae6ea99b57c341d4b0be5804bfd4e6c3b9ae1627ff06a31ade9
4
- data.tar.gz: '083f0bafaad00984a5ad416fe83ae1f8ab10dbd26ae64c9b8b624ffefbe1b818'
3
+ metadata.gz: f43ed683613903787253cbbb2fc33a367d136827bc81142507c41715259f5380
4
+ data.tar.gz: d3e584083ca1732c7096d9196e47f52590156ddfedb9b9c72652ea20937c3d4b
5
5
  SHA512:
6
- metadata.gz: e4113b589dfbe38c9740cf061e37639627afb7155ce5a8f7ea08a3b824b9d4a4584963ee13ef490a963af2bb305a54a7f815f4332f562a090595bd19c90b25d8
7
- data.tar.gz: db76a2c6297fb2cde4b7ad9db4f266a6d1375fb81cc0ffecf6cd3c7d101f3de03341b4eebbdb2517b12348173c1989ed4cc5f85f304063f862f83eec5721ac00
6
+ metadata.gz: 6a6816c083c814a246d0790c63fb88d7bf10e19819a5a2dbd71d212ed78efc6c28fa3475f10ce727898bc09452ff3bacde266036ab791a739d722ce2ddf2e679
7
+ data.tar.gz: 2fb0b976b24d7d2b7d9b076e7d3fd5058f12510dd0be8d4c820bd0201eff39c44bef87e7992c72fc77ec58f0b11cbc45e325e2768ba8122834d2fa15838042ea
data/README.md CHANGED
@@ -16,7 +16,7 @@ time and *pull requests are welcome* and will be reviewed quickly.
16
16
 
17
17
  ## Installation
18
18
 
19
- Add to your Gemfile
19
+ Add to your Gemfile.
20
20
 
21
21
  ```ruby
22
22
  gem 'dropzone_input'
@@ -24,10 +24,23 @@ gem 'dropzone_input'
24
24
 
25
25
  ```sh
26
26
  bundle install
27
+ ```
28
+
29
+ Add Javascript dependencies.
30
+
31
+ ```
27
32
  yarn add dropzone # If you don't already have this
28
33
  yarn add @darkroom-com/dropzone-input
29
34
  ```
30
35
 
36
+ Register Stimulus controller. By default in Rails, this is in `controllers/index.js`.
37
+
38
+ ```js
39
+ import DropzoneController from '@darkroom-com/dropzone-input';
40
+
41
+ application.register('dropzone', DropzoneController);
42
+ ```
43
+
31
44
  ## Development
32
45
 
33
46
  To develop this locally you can update your Gemfile to
@@ -45,7 +58,7 @@ yarn link
45
58
  In your app project run
46
59
 
47
60
  ```sh
48
- yarn add @darkroom-com/dropzone-input
61
+ yarn link @darkroom-com/dropzone-input
49
62
  ```
50
63
 
51
64
  To auto-recompile this project, run
@@ -0,0 +1,9 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <svg enable-background="new 0 0 72 43.2" version="1.1" viewBox="0 0 72 43.2" xml:space="preserve" xmlns="http://www.w3.org/2000/svg" class="inline-block w-16 mb-1">
3
+ <style type="text/css">
4
+ .st0{fill:none;stroke:#424443;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:10;}
5
+ </style>
6
+ <polyline class="st0" points="28.3 26.3 34.4 20.3 40.4 26.3 34.4 20.3 34.4 42.3"/>
7
+ <path class="st0" d="m22.1 33c-6.6 0-11.9-5.3-11.9-11.9s5.4-11.9 11.9-11.9c2.4-4.9 7.4-8.3 13.3-8.3 7.6 0 13.9 5.8 14.7 13.2 0.7-0.1 1.3-0.2 2-0.2 5.3 0 9.5 4.3 9.5 9.5s-4.1 9.6-9.4 9.6h-5.6"/>
8
+ </svg>
9
+ <h1 class="text-xl text-gray-700">Upload</h1>
@@ -1,12 +1,4 @@
1
1
  <%= form.file_field field, direct_upload: true, data: { target: 'dropzone.input' } %>
2
2
  <div class="dz-default dz-message">
3
- <?xml version="1.0" encoding="UTF-8"?>
4
- <svg enable-background="new 0 0 72 43.2" version="1.1" viewBox="0 0 72 43.2" xml:space="preserve" xmlns="http://www.w3.org/2000/svg" class="inline-block w-16 mb-1">
5
- <style type="text/css">
6
- .st0{fill:none;stroke:#424443;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:10;}
7
- </style>
8
- <polyline class="st0" points="28.3 26.3 34.4 20.3 40.4 26.3 34.4 20.3 34.4 42.3"/>
9
- <path class="st0" d="m22.1 33c-6.6 0-11.9-5.3-11.9-11.9s5.4-11.9 11.9-11.9c2.4-4.9 7.4-8.3 13.3-8.3 7.6 0 13.9 5.8 14.7 13.2 0.7-0.1 1.3-0.2 2-0.2 5.3 0 9.5 4.3 9.5 9.5s-4.1 9.6-9.4 9.6h-5.6"/>
10
- </svg>
11
- <h1 class="text-xl text-gray-700">Upload</h1>
3
+ <%= yield %>
12
4
  </div>
@@ -17,7 +17,9 @@ module DropzoneInput
17
17
  end
18
18
 
19
19
  content_tag :div, options.merge(class: class_list, data: data) do
20
- render partial: 'dropzone_input/dropzone', locals: { form: form, field: field }
20
+ render 'dropzone_input/dropzone', form: form, field: field do
21
+ block_given? ? yield : render('dropzone_input/default_content')
22
+ end
21
23
  end
22
24
  end
23
25
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module DropzoneInput
4
- VERSION = '0.0.2'
4
+ VERSION = '0.0.3'
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: dropzone_input
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.2
4
+ version: 0.0.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Trae Robrock
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2020-07-07 00:00:00.000000000 Z
11
+ date: 2020-10-30 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails
@@ -40,6 +40,7 @@ files:
40
40
  - MIT-LICENSE
41
41
  - README.md
42
42
  - Rakefile
43
+ - app/views/dropzone_input/_default_content.html.erb
43
44
  - app/views/dropzone_input/_dropzone.html.erb
44
45
  - lib/dropzone_input.rb
45
46
  - lib/dropzone_input/engine.rb
@@ -64,7 +65,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
64
65
  - !ruby/object:Gem::Version
65
66
  version: '0'
66
67
  requirements: []
67
- rubygems_version: 3.1.2
68
+ rubygems_version: 3.1.4
68
69
  signing_key:
69
70
  specification_version: 4
70
71
  summary: A rails helper to easily add Dropzone to forms.