avo 4.0.0.beta.24 → 4.0.0.beta.25
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 +4 -4
- data/Gemfile.lock +1 -1
- data/app/assets/builds/avo/application.css +20 -0
- data/app/components/avo/u_i/panel_component.html.erb +6 -0
- data/app/components/avo/u_i/panel_component.rb +1 -0
- data/app/controllers/avo/actions_controller.rb +1 -3
- data/lib/avo/resources/base.rb +8 -0
- data/lib/avo/test_helpers.rb +24 -8
- data/lib/avo/version.rb +1 -1
- metadata +5 -3
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: a6b665112ab80fbc0f5b2f8ed14cafb1ce6ca767975e349b645882c94e559ad7
|
|
4
|
+
data.tar.gz: e17bb67497bdd0e0972fe90e5a007d83d76153bb0776539a2bac39c8e5537bbe
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 5c58ca46f77393b6382fba5075303b9bb0ef1481ab69012ba9fdca10f297f38c19244df8c14d4dd7adb417af656454b17378ce7eca83bb67215c74f38a355ca6
|
|
7
|
+
data.tar.gz: b261d3cc4e8535d09be07826a242ad3edcb523bb76b8fc1547240bdab7f8542421b1dc435f060c2a325509ebe55e1f5a067c7e9e68f0f536c66904fb30c6aa00
|
data/Gemfile.lock
CHANGED
|
@@ -301,7 +301,11 @@
|
|
|
301
301
|
--color-primary-800: rgb(var(--avo-color-primary-800));
|
|
302
302
|
--color-primary-850: rgb(var(--avo-color-primary-850));
|
|
303
303
|
--color-primary-900: rgb(var(--avo-color-primary-900));
|
|
304
|
+
--aspect-media-library-item: 4 / 3;
|
|
305
|
+
--shadow-panel: "0px 4px 8px rgba(0, 0, 0, 0.04), 0px 0px 2px rgba(0, 0, 0, 0.06), 0px 0px 1px rgba(0, 0, 0, 0.04)";
|
|
304
306
|
--shadow-modal: " 0px 24px 32px rgba(0, 0, 0, 0.04), 0px 16px 24px rgba(0, 0, 0, 0.04), 0px 4px 8px rgba(0, 0, 0, 0.04), 0px 0px 1px rgba(0, 0, 0, 0.04)";
|
|
307
|
+
--breakpoint-xs: 30rem;
|
|
308
|
+
--container-8xl: 96rem;
|
|
305
309
|
--text-tiny: 0.625rem;
|
|
306
310
|
--color-table-row-selected: var(--color-secondary);
|
|
307
311
|
--color-table-row-hover: color-mix(in srgb, oklch(97.31% 0.0000 89.88), oklch(20.46% 0.0000 89.88) 2%);
|
|
@@ -746,6 +750,9 @@
|
|
|
746
750
|
.my-auto {
|
|
747
751
|
margin-block: auto;
|
|
748
752
|
}
|
|
753
|
+
.ms-0 {
|
|
754
|
+
margin-inline-start: calc(var(--spacing) * 0);
|
|
755
|
+
}
|
|
749
756
|
.ms-1 {
|
|
750
757
|
margin-inline-start: calc(var(--spacing) * 1);
|
|
751
758
|
}
|
|
@@ -954,6 +961,9 @@
|
|
|
954
961
|
.h-10 {
|
|
955
962
|
height: calc(var(--spacing) * 10);
|
|
956
963
|
}
|
|
964
|
+
.h-12 {
|
|
965
|
+
height: calc(var(--spacing) * 12);
|
|
966
|
+
}
|
|
957
967
|
.h-16 {
|
|
958
968
|
height: calc(var(--spacing) * 16);
|
|
959
969
|
}
|
|
@@ -2561,6 +2571,10 @@
|
|
|
2561
2571
|
.underline-offset-2 {
|
|
2562
2572
|
text-underline-offset: 2px;
|
|
2563
2573
|
}
|
|
2574
|
+
.antialiased {
|
|
2575
|
+
-webkit-font-smoothing: antialiased;
|
|
2576
|
+
-moz-osx-font-smoothing: grayscale;
|
|
2577
|
+
}
|
|
2564
2578
|
.scheme-dark {
|
|
2565
2579
|
color-scheme: dark;
|
|
2566
2580
|
}
|
|
@@ -2638,6 +2652,9 @@
|
|
|
2638
2652
|
transition-timing-function: var(--tw-ease, var(--default-transition-timing-function));
|
|
2639
2653
|
transition-duration: var(--tw-duration, var(--default-transition-duration));
|
|
2640
2654
|
}
|
|
2655
|
+
.delay-150 {
|
|
2656
|
+
transition-delay: 150ms;
|
|
2657
|
+
}
|
|
2641
2658
|
.duration-100 {
|
|
2642
2659
|
--tw-duration: 100ms;
|
|
2643
2660
|
transition-duration: 100ms;
|
|
@@ -2666,6 +2683,9 @@
|
|
|
2666
2683
|
--tw-ease: var(--ease-out);
|
|
2667
2684
|
transition-timing-function: var(--ease-out);
|
|
2668
2685
|
}
|
|
2686
|
+
.will-change-transform {
|
|
2687
|
+
will-change: transform;
|
|
2688
|
+
}
|
|
2669
2689
|
.select-none {
|
|
2670
2690
|
-webkit-user-select: none;
|
|
2671
2691
|
user-select: none;
|
|
@@ -15,6 +15,7 @@ class Avo::UI::PanelComponent < Avo::BaseComponent
|
|
|
15
15
|
renders_one :controls
|
|
16
16
|
renders_one :cover
|
|
17
17
|
renders_one :sidebar
|
|
18
|
+
renders_many :pre_bodies
|
|
18
19
|
renders_one :body
|
|
19
20
|
renders_one :card, "Avo::UI::CardComponent" # wraps content into a card automatically
|
|
20
21
|
renders_one :footer
|
|
@@ -115,9 +115,7 @@ module Avo
|
|
|
115
115
|
def action_class
|
|
116
116
|
@resource.hydrate(view: action_params[:resource_view].presence, user: _current_user, params: params)
|
|
117
117
|
|
|
118
|
-
registered_action = @resource.
|
|
119
|
-
action[:class].to_s == params[:action_id]
|
|
120
|
-
end
|
|
118
|
+
registered_action = @resource.find_action(params[:action_id])
|
|
121
119
|
|
|
122
120
|
if registered_action.nil?
|
|
123
121
|
if Rails.env.development?
|
data/lib/avo/resources/base.rb
CHANGED
|
@@ -393,6 +393,14 @@ module Avo
|
|
|
393
393
|
end
|
|
394
394
|
end
|
|
395
395
|
|
|
396
|
+
def find_action(action_id)
|
|
397
|
+
actions = get_actions + Array(safe_call(:get_actions_from_custom_controls))
|
|
398
|
+
|
|
399
|
+
actions
|
|
400
|
+
.uniq { |action| action[:class].to_s }
|
|
401
|
+
.find { |action| action[:class].to_s == action_id.to_s }
|
|
402
|
+
end
|
|
403
|
+
|
|
396
404
|
def hydrate(...)
|
|
397
405
|
super
|
|
398
406
|
|
data/lib/avo/test_helpers.rb
CHANGED
|
@@ -230,7 +230,7 @@ module Avo
|
|
|
230
230
|
end
|
|
231
231
|
|
|
232
232
|
# Click on the action from the panel (index and show above the table)
|
|
233
|
-
# Pass list: nil to run
|
|
233
|
+
# Pass list: nil to run a standalone action (found by data-action-name / action name, not link text)
|
|
234
234
|
# Pass list: "List name" if list is not the default "Actions"
|
|
235
235
|
# Example usage:
|
|
236
236
|
# open_panel_action(action_name: "Dummy action")
|
|
@@ -241,7 +241,7 @@ module Avo
|
|
|
241
241
|
end
|
|
242
242
|
|
|
243
243
|
# Open the action from the record_id row
|
|
244
|
-
# Pass list: nil to run
|
|
244
|
+
# Pass list: nil to run a standalone row action (matched by action name, not visible label)
|
|
245
245
|
# Pass list: "List name" if list is not the default "Actions"
|
|
246
246
|
# Example usage:
|
|
247
247
|
# open_row_action(action_name: "Dummy action")
|
|
@@ -377,17 +377,33 @@ module Avo
|
|
|
377
377
|
find('[data-sidebar-target="sidebar"]')
|
|
378
378
|
end
|
|
379
379
|
|
|
380
|
-
# Opens an action. If a list is provided, it will click
|
|
381
|
-
#
|
|
382
|
-
# If no list is present, it will directly click
|
|
380
|
+
# Opens an action. If a list is provided, it will click the list trigger (Actions, etc.),
|
|
381
|
+
# then finds the action link inside the native popover panel referenced by popovertarget.
|
|
382
|
+
# If no list is present, it will directly click the action anchor (matched by
|
|
383
|
+
# data-action-name, i.e. the action's name), not the visible label — row controls
|
|
384
|
+
# often override the label while keeping the same action name.
|
|
383
385
|
def open_action(action_name:, list:, context:, &block)
|
|
386
|
+
list_popover_id = nil
|
|
387
|
+
|
|
384
388
|
within(context) do
|
|
385
389
|
if list.present?
|
|
386
390
|
sleep 0.1
|
|
387
|
-
|
|
388
|
-
|
|
391
|
+
list_trigger = find(:link_or_button, text: list)
|
|
392
|
+
list_popover_id = list_trigger["popovertarget"].presence
|
|
393
|
+
list_trigger.click
|
|
389
394
|
else
|
|
390
|
-
|
|
395
|
+
# Prefer visible matches only: the same action can appear again inside closed popovers/lists.
|
|
396
|
+
find("a[data-action-name='#{action_name}']", match: :first).click
|
|
397
|
+
end
|
|
398
|
+
end
|
|
399
|
+
|
|
400
|
+
if list.present? && list_popover_id.present?
|
|
401
|
+
within(page.find(:id, list_popover_id)) do
|
|
402
|
+
find("a[data-action-name='#{action_name}']", visible: :all, match: :first).click
|
|
403
|
+
end
|
|
404
|
+
elsif list.present?
|
|
405
|
+
within(context) do
|
|
406
|
+
find("a[data-action-name='#{action_name}']", visible: :all, match: :first).click
|
|
391
407
|
end
|
|
392
408
|
end
|
|
393
409
|
|
data/lib/avo/version.rb
CHANGED
metadata
CHANGED
|
@@ -1,15 +1,16 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: avo
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 4.0.0.beta.
|
|
4
|
+
version: 4.0.0.beta.25
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Adrian Marin
|
|
8
8
|
- Mihai Marin
|
|
9
9
|
- Paul Bob
|
|
10
|
+
autorequire:
|
|
10
11
|
bindir: bin
|
|
11
12
|
cert_chain: []
|
|
12
|
-
date:
|
|
13
|
+
date: 2026-04-23 00:00:00.000000000 Z
|
|
13
14
|
dependencies:
|
|
14
15
|
- !ruby/object:Gem::Dependency
|
|
15
16
|
name: activerecord
|
|
@@ -1159,7 +1160,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
|
1159
1160
|
- !ruby/object:Gem::Version
|
|
1160
1161
|
version: '0'
|
|
1161
1162
|
requirements: []
|
|
1162
|
-
rubygems_version:
|
|
1163
|
+
rubygems_version: 3.5.22
|
|
1164
|
+
signing_key:
|
|
1163
1165
|
specification_version: 4
|
|
1164
1166
|
summary: Admin panel framework and Content Management System for Ruby on Rails.
|
|
1165
1167
|
test_files: []
|