avo 1.18.0.pre.1 → 1.18.1
Sign up to get free protection for your applications and to get access to all the features.
Potentially problematic release.
This version of avo might be problematic. Click here for more details.
- checksums.yaml +4 -4
- data/Gemfile.lock +2 -2
- data/app/components/avo/fields/files_field/edit_component.html.erb +3 -1
- data/app/packs/entrypoints/application.css +1 -0
- data/app/packs/entrypoints/application.js +1 -0
- data/app/packs/js/active-storage.js +45 -0
- data/app/packs/stylesheets/active-storage.css +37 -0
- data/lib/avo/engine.rb +5 -0
- data/lib/avo/fields/files_field.rb +0 -2
- data/lib/avo/version.rb +1 -1
- data/public/avo-packs/css/{application-2b4685ca.css → application-f9191617.css} +39 -1
- data/public/avo-packs/css/application-f9191617.css.br +0 -0
- data/public/avo-packs/css/application-f9191617.css.gz +0 -0
- data/public/avo-packs/css/application-f9191617.css.map +1 -0
- data/public/avo-packs/css/application-f9191617.css.map.br +0 -0
- data/public/avo-packs/css/application-f9191617.css.map.gz +0 -0
- data/public/avo-packs/js/application-cc89f096028eb1d4d971.js +26 -0
- data/public/avo-packs/js/{application-6842378de4da9b615e18.js.LICENSE.txt → application-cc89f096028eb1d4d971.js.LICENSE.txt} +0 -0
- data/public/avo-packs/js/application-cc89f096028eb1d4d971.js.br +0 -0
- data/public/avo-packs/js/application-cc89f096028eb1d4d971.js.gz +0 -0
- data/public/avo-packs/js/application-cc89f096028eb1d4d971.js.map +1 -0
- data/public/avo-packs/js/application-cc89f096028eb1d4d971.js.map.br +0 -0
- data/public/avo-packs/js/application-cc89f096028eb1d4d971.js.map.gz +0 -0
- data/public/avo-packs/manifest.json +15 -15
- metadata +19 -17
- data/public/avo-packs/css/application-2b4685ca.css.br +0 -0
- data/public/avo-packs/css/application-2b4685ca.css.gz +0 -0
- data/public/avo-packs/css/application-2b4685ca.css.map +0 -1
- data/public/avo-packs/css/application-2b4685ca.css.map.br +0 -0
- data/public/avo-packs/css/application-2b4685ca.css.map.gz +0 -0
- data/public/avo-packs/js/application-6842378de4da9b615e18.js +0 -26
- data/public/avo-packs/js/application-6842378de4da9b615e18.js.br +0 -0
- data/public/avo-packs/js/application-6842378de4da9b615e18.js.gz +0 -0
- data/public/avo-packs/js/application-6842378de4da9b615e18.js.map +0 -1
- data/public/avo-packs/js/application-6842378de4da9b615e18.js.map.br +0 -0
- data/public/avo-packs/js/application-6842378de4da9b615e18.js.map.gz +0 -0
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 46ae39b5c77496f7ebfc4da3404f2d7a5a906cb4098fa174b2b1b37c7ad07dde
|
4
|
+
data.tar.gz: 1769e6b5c3b2db3d45cc40985a1fb098b7fc8514c42be1317769312571c0c302
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 61a8c1c00aba9bd9673be393add7b9d6b18efca2006ca2527299231fe152e5e0cdf0f2ee1f7f2f889afb5dc9726a29963b13d2b5be451387d96e30dc8f0d06e0
|
7
|
+
data.tar.gz: e195465f471e4c9cd37bb5e2db31711ee1f9101f7dd5095da752acb6f4a76a818bccac7552434c545f108726c96139fb45f15113b57c3649e7807292f6fe6586
|
data/Gemfile.lock
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
avo (1.18.
|
4
|
+
avo (1.18.1)
|
5
5
|
active_link_to
|
6
6
|
addressable
|
7
7
|
breadcrumbs_on_rails
|
@@ -210,7 +210,7 @@ GEM
|
|
210
210
|
mini_portile2 (~> 2.6.1)
|
211
211
|
racc (~> 1.4)
|
212
212
|
orm_adapter (0.5.0)
|
213
|
-
pagy (5.6.
|
213
|
+
pagy (5.6.10)
|
214
214
|
parallel (1.20.1)
|
215
215
|
parser (3.0.0.0)
|
216
216
|
ast (~> 2.4.1)
|
@@ -2,6 +2,8 @@
|
|
2
2
|
<%= render Avo::Fields::Common::FilesListViewerComponent.new(field: @field, resource: @resource) if @field.value.present? %>
|
3
3
|
|
4
4
|
<% if @resource.authorization.authorize_action(:upload_attachments?, raise_exception: false) %>
|
5
|
-
|
5
|
+
<div class="mt-2">
|
6
|
+
<%= @form.file_field @field.id, disabled: @field.readonly, multiple: true, direct_upload: @field.direct_upload %>
|
7
|
+
</div>
|
6
8
|
<% end %>
|
7
9
|
<% end %>
|
@@ -16,6 +16,7 @@
|
|
16
16
|
@import './../stylesheets/pagination.css';
|
17
17
|
@import './../stylesheets/breadcrumbs.css';
|
18
18
|
@import './../stylesheets/search.css';
|
19
|
+
@import './../stylesheets/active-storage.css';
|
19
20
|
|
20
21
|
@import './../stylesheets/components/status.css';
|
21
22
|
@import './../stylesheets/components/code.css';
|
@@ -0,0 +1,45 @@
|
|
1
|
+
document.addEventListener('direct-upload:initialize', (event) => {
|
2
|
+
const { target, detail } = event
|
3
|
+
const { id, file } = detail
|
4
|
+
|
5
|
+
target.insertAdjacentHTML(
|
6
|
+
'beforebegin',
|
7
|
+
`
|
8
|
+
<div id="direct-upload-${id}" class="direct-upload direct-upload--pending">
|
9
|
+
<div id="direct-upload-progress-${id}" class="direct-upload__progress" style="width: 0%"></div>
|
10
|
+
<span class="direct-upload__filename"></span>
|
11
|
+
</div>
|
12
|
+
`,
|
13
|
+
)
|
14
|
+
target.previousElementSibling.querySelector(
|
15
|
+
'.direct-upload__filename',
|
16
|
+
).textContent = file.name
|
17
|
+
})
|
18
|
+
|
19
|
+
document.addEventListener('direct-upload:start', (event) => {
|
20
|
+
const { id } = event.detail
|
21
|
+
const element = document.getElementById(`direct-upload-${id}`)
|
22
|
+
element.classList.remove('direct-upload--pending')
|
23
|
+
})
|
24
|
+
|
25
|
+
document.addEventListener('direct-upload:progress', (event) => {
|
26
|
+
const { id, progress } = event.detail
|
27
|
+
const progressElement = document.getElementById(
|
28
|
+
`direct-upload-progress-${id}`,
|
29
|
+
)
|
30
|
+
progressElement.style.width = `${progress}%`
|
31
|
+
})
|
32
|
+
|
33
|
+
document.addEventListener('direct-upload:error', (event) => {
|
34
|
+
event.preventDefault()
|
35
|
+
const { id, error } = event.detail
|
36
|
+
const element = document.getElementById(`direct-upload-${id}`)
|
37
|
+
element.classList.add('direct-upload--error')
|
38
|
+
element.setAttribute('title', error)
|
39
|
+
})
|
40
|
+
|
41
|
+
document.addEventListener('direct-upload:end', (event) => {
|
42
|
+
const { id } = event.detail
|
43
|
+
const element = document.getElementById(`direct-upload-${id}`)
|
44
|
+
element.classList.add('direct-upload--complete')
|
45
|
+
})
|
@@ -0,0 +1,37 @@
|
|
1
|
+
.direct-upload {
|
2
|
+
display: inline-block;
|
3
|
+
position: relative;
|
4
|
+
padding: 2px 4px;
|
5
|
+
margin: 0 3px 3px 0;
|
6
|
+
border: 1px solid rgba(0, 0, 0, 0.3);
|
7
|
+
border-radius: 3px;
|
8
|
+
font-size: 11px;
|
9
|
+
line-height: 13px;
|
10
|
+
}
|
11
|
+
|
12
|
+
.direct-upload--pending {
|
13
|
+
opacity: 0.6;
|
14
|
+
}
|
15
|
+
|
16
|
+
.direct-upload__progress {
|
17
|
+
position: absolute;
|
18
|
+
top: 0;
|
19
|
+
left: 0;
|
20
|
+
bottom: 0;
|
21
|
+
opacity: 0.2;
|
22
|
+
background: #0076ff;
|
23
|
+
transition: width 120ms ease-out, opacity 60ms 60ms ease-in;
|
24
|
+
transform: translate3d(0, 0, 0);
|
25
|
+
}
|
26
|
+
|
27
|
+
.direct-upload--complete .direct-upload__progress {
|
28
|
+
opacity: 0.4;
|
29
|
+
}
|
30
|
+
|
31
|
+
.direct-upload--error {
|
32
|
+
border-color: red;
|
33
|
+
}
|
34
|
+
|
35
|
+
input[type=file][data-direct-upload-url][disabled] {
|
36
|
+
display: none;
|
37
|
+
}
|
data/lib/avo/engine.rb
CHANGED
@@ -3,6 +3,11 @@ Gem.loaded_specs["avo"].dependencies.each do |d|
|
|
3
3
|
require d.name
|
4
4
|
end
|
5
5
|
|
6
|
+
# In development we should load the engine so we get the autoload for components
|
7
|
+
if ENV["RAILS_ENV"] === "development"
|
8
|
+
require "view_component/engine"
|
9
|
+
end
|
10
|
+
|
6
11
|
module Avo
|
7
12
|
class Engine < ::Rails::Engine
|
8
13
|
isolate_namespace Avo
|
data/lib/avo/version.rb
CHANGED
@@ -3220,6 +3220,44 @@ svg.tea #steamR {
|
|
3220
3220
|
color: rgba(255, 255, 255, var(--tw-text-opacity));
|
3221
3221
|
}
|
3222
3222
|
|
3223
|
+
.direct-upload {
|
3224
|
+
display: inline-block;
|
3225
|
+
position: relative;
|
3226
|
+
padding: 2px 4px;
|
3227
|
+
margin: 0 3px 3px 0;
|
3228
|
+
border: 1px solid rgba(0, 0, 0, 0.3);
|
3229
|
+
border-radius: 3px;
|
3230
|
+
font-size: 11px;
|
3231
|
+
line-height: 13px;
|
3232
|
+
}
|
3233
|
+
|
3234
|
+
.direct-upload--pending {
|
3235
|
+
opacity: 0.6;
|
3236
|
+
}
|
3237
|
+
|
3238
|
+
.direct-upload__progress {
|
3239
|
+
position: absolute;
|
3240
|
+
top: 0;
|
3241
|
+
left: 0;
|
3242
|
+
bottom: 0;
|
3243
|
+
opacity: 0.2;
|
3244
|
+
background: #0076ff;
|
3245
|
+
transition: width 120ms ease-out, opacity 60ms 60ms ease-in;
|
3246
|
+
transform: translate3d(0, 0, 0);
|
3247
|
+
}
|
3248
|
+
|
3249
|
+
.direct-upload--complete .direct-upload__progress {
|
3250
|
+
opacity: 0.4;
|
3251
|
+
}
|
3252
|
+
|
3253
|
+
.direct-upload--error {
|
3254
|
+
border-color: red;
|
3255
|
+
}
|
3256
|
+
|
3257
|
+
input[type=file][data-direct-upload-url][disabled] {
|
3258
|
+
display: none;
|
3259
|
+
}
|
3260
|
+
|
3223
3261
|
.spinner {
|
3224
3262
|
width: 16px;
|
3225
3263
|
height: 16px;
|
@@ -6246,4 +6284,4 @@ html, body{
|
|
6246
6284
|
}
|
6247
6285
|
|
6248
6286
|
|
6249
|
-
/*# sourceMappingURL=application-
|
6287
|
+
/*# sourceMappingURL=application-f9191617.css.map*/
|
Binary file
|
Binary file
|