maglevcms 3.0.2 → 3.1.0
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/app/assets/builds/maglev/tailwind.css +123 -105
- data/app/assets/javascripts/maglev/editor/controllers/app/forms/section_form_controller.js +31 -6
- data/app/assets/javascripts/maglev/editor/controllers/app/page_preview_controller.js +20 -6
- data/app/assets/stylesheets/maglev/application.css +47 -3
- data/app/components/maglev/uikit/app_layout/sidebar_component.html.erb +1 -1
- data/app/components/maglev/uikit/app_layout/topbar/logo_component.html.erb +1 -1
- data/app/components/maglev/uikit/app_layout/topbar/page_info_component.html.erb +2 -2
- data/app/components/maglev/uikit/breadcrumbs/breadcrumbs_component.html.erb +2 -2
- data/app/components/maglev/uikit/breadcrumbs/link_component.html.erb +2 -2
- data/app/components/maglev/uikit/button_group_component/button_group_component.html.erb +1 -1
- data/app/components/maglev/uikit/collapsible/item_component.html.erb +1 -1
- data/app/components/maglev/uikit/dropdown_component/dropdown_controller.js +13 -2
- data/app/components/maglev/uikit/form/checkbox_component.html.erb +2 -2
- data/app/components/maglev/uikit/form/color_field_component.html.erb +3 -3
- data/app/components/maglev/uikit/form/combobox/list_component.html.erb +1 -1
- data/app/components/maglev/uikit/form/combobox/option_component.html.erb +1 -1
- data/app/components/maglev/uikit/form/combobox_component.html.erb +1 -1
- data/app/components/maglev/uikit/form/link/email_link_component.html.erb +2 -2
- data/app/components/maglev/uikit/form/link/page_link_component.html.erb +2 -2
- data/app/components/maglev/uikit/form/link/static_page_link_component.html.erb +2 -2
- data/app/components/maglev/uikit/form/link/url_link_component.html.erb +2 -2
- data/app/components/maglev/uikit/form/richtext/block_button_component.html.erb +1 -1
- data/app/components/maglev/uikit/form/richtext/button_component.html.erb +2 -2
- data/app/components/maglev/uikit/form/richtext/toolbar_component.html.erb +1 -1
- data/app/components/maglev/uikit/form/search_form_component.html.erb +1 -1
- data/app/components/maglev/uikit/form/search_form_component.rb +1 -1
- data/app/components/maglev/uikit/form/select_component.html.erb +1 -1
- data/app/components/maglev/uikit/image_library/card_component.html.erb +1 -1
- data/app/components/maglev/uikit/list/insert_button_component.html.erb +1 -1
- data/app/components/maglev/uikit/list/list_item_component.html.erb +7 -5
- data/app/components/maglev/uikit/list/list_item_component.rb +2 -0
- data/app/components/maglev/uikit/locale_switcher_component/locale_switcher_component.html.erb +1 -1
- data/app/components/maglev/uikit/menu_dropdown_component.rb +3 -3
- data/app/components/maglev/uikit/modal_component/modal_component.html.erb +3 -3
- data/app/components/maglev/uikit/modal_component.rb +1 -1
- data/app/components/maglev/uikit/page_layout_component/back_link_component.html.erb +1 -1
- data/app/components/maglev/uikit/page_layout_component/page_layout_component.html.erb +2 -2
- data/app/components/maglev/uikit/page_layout_component.rb +3 -3
- data/app/components/maglev/uikit/pagination_component/pagination_component.html.erb +4 -4
- data/app/components/maglev/uikit/section_toolbar/top_left_corner_component.html.erb +4 -4
- data/app/components/maglev/uikit/section_toolbar/top_right_corner_component.html.erb +3 -3
- data/app/controllers/concerns/maglev/editor/errors_concern.rb +1 -1
- data/app/controllers/concerns/maglev/editor/lock_version_concern.rb +27 -0
- data/app/controllers/maglev/editor/section_blocks_controller.rb +3 -9
- data/app/controllers/maglev/editor/sections_controller.rb +3 -9
- data/app/helpers/maglev/application_helper.rb +6 -0
- data/app/services/concerns/maglev/content/helpers_concern.rb +1 -1
- data/app/views/layouts/maglev/editor/application.html.erb +1 -1
- data/app/views/maglev/editor/assets/index.html.erb +1 -1
- data/app/views/maglev/editor/pages/_preview.html.erb +3 -3
- data/app/views/maglev/editor/pages/_preview_empty_message.html.erb +1 -1
- data/app/views/maglev/editor/section_blocks/index/_tree.html.erb +3 -3
- data/app/views/maglev/editor/sections/_toolbar_list.html.erb +1 -1
- data/app/views/maglev/editor/sections/theme/_list.html.erb +4 -2
- data/lib/maglev/version.rb +1 -1
- metadata +12 -5
|
@@ -3,8 +3,8 @@
|
|
|
3
3
|
<div class="font-semibold text-gray-800">
|
|
4
4
|
<%= label %>
|
|
5
5
|
</div>
|
|
6
|
-
<div class="
|
|
7
|
-
<span class="size-5 rounded-full bg-white shadow-xs ring-1 ring-gray-900/5 transition-transform duration-200 ease-in-out group-has-checked:translate-x-4"></span>
|
|
6
|
+
<div class="ms-auto group relative inline-flex w-10 shrink-0 rounded-full bg-gray-200 p-0.5 inset-ring inset-ring-gray-900/5 outline-offset-2 outline-editor-primary transition-colors duration-200 ease-in-out has-checked:bg-editor-primary has-focus-visible:outline-2">
|
|
7
|
+
<span class="size-5 rounded-full bg-white shadow-xs ring-1 ring-gray-900/5 transition-transform duration-200 ease-in-out group-has-checked:translate-x-4 rtl:group-has-checked:-translate-x-4"></span>
|
|
8
8
|
<%= hidden_field_tag name, '0', { id: "#{dom_id}_hidden" } %>
|
|
9
9
|
<%= check_box_tag name, '1', checked?, class: 'absolute inset-0 appearance-none focus:outline-hidden cursor-pointer', aria: { label: label }, data: { action: 'change->uikit-form-checkbox#change' } %>
|
|
10
10
|
</div>
|
|
@@ -16,7 +16,7 @@
|
|
|
16
16
|
|
|
17
17
|
<div class="inline-block relative">
|
|
18
18
|
<%= tag.div(
|
|
19
|
-
class: 'absolute
|
|
19
|
+
class: 'absolute start-3 top-2 w-6 h-6 rounded-sm border border-gray-200 group-[.is-empty]/color:bg-checkerboard group-[.is-empty]/color:bg-white!',
|
|
20
20
|
style: "background-color: #{value}",
|
|
21
21
|
data: {
|
|
22
22
|
"uikit-form-color-field-target": "preview",
|
|
@@ -31,7 +31,7 @@
|
|
|
31
31
|
minlength: 4,
|
|
32
32
|
maxlength: 8,
|
|
33
33
|
size: 9,
|
|
34
|
-
class: 'block py-2
|
|
34
|
+
class: 'block py-2 ps-11 pe-8 rounded bg-gray-100 text-gray-800 focus:outline-none focus:ring focus:ring-inset focus:ring-2 focus:ring-editor-primary/50 placeholder-gray-500',
|
|
35
35
|
data: {
|
|
36
36
|
'uikit-form-color-field-target': 'input',
|
|
37
37
|
action: ['input->uikit-form-color-field#change', **input_action].join(' '),
|
|
@@ -41,7 +41,7 @@
|
|
|
41
41
|
) %>
|
|
42
42
|
|
|
43
43
|
<% if presets? %>
|
|
44
|
-
<div class="absolute top-1.5
|
|
44
|
+
<div class="absolute top-1.5 end-3">
|
|
45
45
|
<%= render Maglev::Uikit::DropdownComponent.new(placement: 'bottom-end') do |dropdown| %>
|
|
46
46
|
<% dropdown.with_trigger do %>
|
|
47
47
|
<%= render Maglev::Uikit::IconButtonComponent.new(
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
<% options.each_with_index do |option, index| %>
|
|
2
2
|
<li
|
|
3
|
-
class="relative cursor-default select-none py-2
|
|
3
|
+
class="relative cursor-default select-none py-2 ps-3 pe-9 text-gray-900 group data-[focus]:bg-editor-primary data-[focus]:text-white"
|
|
4
4
|
role="option"
|
|
5
5
|
tabindex="-1"
|
|
6
6
|
data-id="<%= option.id %>"
|
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
</span>
|
|
10
10
|
<% end %>
|
|
11
11
|
|
|
12
|
-
<span class="absolute inset-y-0
|
|
12
|
+
<span class="absolute inset-y-0 end-0 flex items-center pe-4 text-editor-primary hidden group-data-[selected]:flex group-data-[focus]:text-white">
|
|
13
13
|
<svg class="size-5" viewBox="0 0 20 20" fill="currentColor" aria-hidden="true" data-slot="icon">
|
|
14
14
|
<path fill-rule="evenodd" d="M16.704 4.153a.75.75 0 0 1 .143 1.052l-8 10.5a.75.75 0 0 1-1.127.075l-4.5-4.5a.75.75 0 0 1 1.06-1.06l3.894 3.893 7.48-9.817a.75.75 0 0 1 1.05-.143Z" clip-rule="evenodd" />
|
|
15
15
|
</svg>
|
|
@@ -48,7 +48,7 @@
|
|
|
48
48
|
}
|
|
49
49
|
) %>
|
|
50
50
|
|
|
51
|
-
<div class="absolute top-0.5 bottom-0.5
|
|
51
|
+
<div class="absolute top-0.5 bottom-0.5 end-3 bg-gray-100 flex items-center gap-2">
|
|
52
52
|
<svg data-uikit-form-combobox-target="spinner" aria-hidden="true" class="hidden w-4 h-4 text-gray-200 animate-spin dark:text-editor-primary fill-editor-primary" viewBox="0 0 100 101" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
53
53
|
<path d="M100 50.5908C100 78.2051 77.6142 100.591 50 100.591C22.3858 100.591 0 78.2051 0 50.5908C0 22.9766 22.3858 0.59082 50 0.59082C77.6142 0.59082 100 22.9766 100 50.5908ZM9.08144 50.5908C9.08144 73.1895 27.4013 91.5094 50 91.5094C72.5987 91.5094 90.9186 73.1895 90.9186 50.5908C90.9186 27.9921 72.5987 9.67226 50 9.67226C27.4013 9.67226 9.08144 27.9921 9.08144 50.5908Z" fill="currentColor"/>
|
|
54
54
|
<path d="M93.9676 39.0409C96.393 38.4038 97.8624 35.9116 97.0079 33.5539C95.2932 28.8227 92.871 24.3692 89.8167 20.348C85.8452 15.1192 80.8826 10.7238 75.2124 7.41289C69.5422 4.10194 63.2754 1.94025 56.7698 1.05124C51.7666 0.367541 46.6976 0.446843 41.7345 1.27873C39.2613 1.69328 37.813 4.19778 38.4501 6.62326C39.0873 9.04874 41.5694 10.4717 44.0505 10.1071C47.8511 9.54855 51.7191 9.52689 55.5402 10.0491C60.8642 10.7766 65.9928 12.5457 70.6331 15.2552C75.2735 17.9648 79.3347 21.5619 82.5849 25.841C84.9175 28.9121 86.7997 32.2913 88.1811 35.8758C89.083 38.2158 91.5421 39.6781 93.9676 39.0409Z" fill="currentFill"/>
|
|
@@ -3,10 +3,10 @@
|
|
|
3
3
|
class: 'flex-1 flex items-center overflow-hidden items-center w-full h-10 px-3 rounded bg-gray-100 text-gray-800 cursor-pointer focus:outline-none focus:ring focus:ring-inset focus:ring-2 focus:ring-editor-primary/50',
|
|
4
4
|
data: { turbo_frame: 'modal' } do %>
|
|
5
5
|
<%= render Maglev::Uikit::IconComponent.new(name: "mail") %>
|
|
6
|
-
<span class="
|
|
6
|
+
<span class="ms-3 shrink"><%= link[:email] %></span>
|
|
7
7
|
<% end %>
|
|
8
8
|
|
|
9
|
-
<div class="absolute
|
|
9
|
+
<div class="absolute end-3 top-0 bottom-0 flex items-center ps-3">
|
|
10
10
|
<%= render(Maglev::Uikit::IconButtonComponent.new(icon_name: 'eraser', data: { action: 'click->uikit-form-link#clear:prevent' })) %>
|
|
11
11
|
</div>
|
|
12
12
|
|
|
@@ -3,10 +3,10 @@
|
|
|
3
3
|
class: 'flex-1 flex items-center overflow-hidden items-center w-full h-10 px-3 rounded bg-gray-100 text-gray-800 cursor-pointer focus:outline-none focus:ring focus:ring-inset focus:ring-2 focus:ring-editor-primary/50',
|
|
4
4
|
data: { turbo_frame: 'modal' } do %>
|
|
5
5
|
<%= render Maglev::Uikit::IconComponent.new(name: "file") %>
|
|
6
|
-
<span class="
|
|
6
|
+
<span class="ms-3 shrink"><%= link[:link_label] %></span>
|
|
7
7
|
<% end %>
|
|
8
8
|
|
|
9
|
-
<div class="absolute
|
|
9
|
+
<div class="absolute end-3 top-0 bottom-0 flex items-center ps-3">
|
|
10
10
|
<%= render(Maglev::Uikit::IconButtonComponent.new(icon_name: 'eraser', data: { action: 'click->uikit-form-link#clear:prevent' })) %>
|
|
11
11
|
</div>
|
|
12
12
|
|
|
@@ -3,10 +3,10 @@
|
|
|
3
3
|
class: 'flex-1 flex items-center overflow-hidden items-center w-full h-10 px-3 rounded bg-gray-100 text-gray-800 cursor-pointer focus:outline-none focus:ring focus:ring-inset focus:ring-2 focus:ring-editor-primary/50',
|
|
4
4
|
data: { turbo_frame: 'modal' } do %>
|
|
5
5
|
<%= render Maglev::Uikit::IconComponent.new(name: "file") %>
|
|
6
|
-
<span class="
|
|
6
|
+
<span class="ms-3 shrink"><%= link[:link_label] %></span>
|
|
7
7
|
<% end %>
|
|
8
8
|
|
|
9
|
-
<div class="absolute
|
|
9
|
+
<div class="absolute end-3 top-0 bottom-0 flex items-center ps-3">
|
|
10
10
|
<%= render(Maglev::Uikit::IconButtonComponent.new(icon_name: 'eraser', data: { action: 'click->uikit-form-link#clear:prevent' })) %>
|
|
11
11
|
</div>
|
|
12
12
|
|
|
@@ -3,10 +3,10 @@
|
|
|
3
3
|
class: 'flex-1 flex items-center overflow-hidden items-center w-full h-10 px-3 rounded bg-gray-100 text-gray-800 cursor-pointer focus:outline-none focus:ring focus:ring-inset focus:ring-2 focus:ring-editor-primary/50',
|
|
4
4
|
data: { turbo_frame: 'modal' } do %>
|
|
5
5
|
<%= render Maglev::Uikit::IconComponent.new(name: "external_link") %>
|
|
6
|
-
<span class="
|
|
6
|
+
<span class="ms-3 shrink"><%= link[:href] %></span>
|
|
7
7
|
<% end %>
|
|
8
8
|
|
|
9
|
-
<div class="absolute
|
|
9
|
+
<div class="absolute end-3 top-0 bottom-0 flex items-center ps-3">
|
|
10
10
|
<%= render(Maglev::Uikit::IconButtonComponent.new(icon_name: 'eraser', data: { action: 'click->uikit-form-link#clear:prevent' })) %>
|
|
11
11
|
</div>
|
|
12
12
|
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
<%= tag.button(
|
|
2
2
|
class: class_names(
|
|
3
3
|
'cursor-pointer px-2 py-2 bg-gray-100 hover:bg-gray-200 focus:outline-none focus:ring-2 focus:ring-editor-primary/50 focus:ring-inset focus:ring bg-gray-100',
|
|
4
|
-
'first:rounded-
|
|
5
|
-
'last:rounded-
|
|
4
|
+
'first:rounded-s-sm',
|
|
5
|
+
'last:rounded-e-sm',
|
|
6
6
|
'[&.active]:bg-gray-600 [&.active]:hover:bg-gray-600 [&.active]:text-white'
|
|
7
7
|
),
|
|
8
8
|
type: 'button',
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
<div class="flex sticky top-0 z-10 pb-2 bg-white
|
|
1
|
+
<div class="flex sticky top-0 z-10 pb-2 bg-white gap-1 overflow-x-auto">
|
|
2
2
|
<%= render Maglev::Uikit::Form::Richtext::ButtonGroupComponent.new do |button_group| %>
|
|
3
3
|
<%= render Maglev::Uikit::Form::Richtext::BlockButtonComponent.new %>
|
|
4
4
|
<% end unless line_break? %>
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
<%= tag.attributes(data: data) %>
|
|
6
6
|
>
|
|
7
7
|
<%= content if content? %>
|
|
8
|
-
<button type="submit" class="
|
|
8
|
+
<button type="submit" class="me-2">
|
|
9
9
|
<%= render Maglev::Uikit::IconComponent.new(name: 'search', size: '1.25rem', class_names: 'text-gray-500') %>
|
|
10
10
|
</button>
|
|
11
11
|
<%= tag.input(
|
|
@@ -14,6 +14,6 @@
|
|
|
14
14
|
**input_tag_options,
|
|
15
15
|
**html_options
|
|
16
16
|
%>
|
|
17
|
-
<%= render Maglev::Uikit::IconComponent.new(name: 'arrow_down', size: '1.25rem', class_names: 'pointer-events-none col-start-1 row-start-1
|
|
17
|
+
<%= render Maglev::Uikit::IconComponent.new(name: 'arrow_down', size: '1.25rem', class_names: 'pointer-events-none col-start-1 row-start-1 me-2 size-5 self-center justify-self-end text-gray-500 sm:size-4') %>
|
|
18
18
|
</div>
|
|
19
19
|
</div>
|
|
@@ -24,7 +24,7 @@
|
|
|
24
24
|
>
|
|
25
25
|
<%= button_to delete_path,
|
|
26
26
|
method: :delete,
|
|
27
|
-
form_class: '
|
|
27
|
+
form_class: 'ms-auto flex items-center',
|
|
28
28
|
class: 'px-1 py-1 bg-white rounded-full flex items-center justify-center text-gray-900 cursor-pointer',
|
|
29
29
|
data: { turbo_confirm: t('maglev.editor.image_library.confirm_destroy'), turbo_frame: 'modal-dialog' } do
|
|
30
30
|
%>
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
<div <%= tag.attributes(class: wrapper_classes) %>>
|
|
2
|
-
<div class="absolute top-0
|
|
2
|
+
<div class="absolute top-0 start-0 w-full justify-center flex opacity-0 group-hover/button:opacity-100 transition-opacity duration-200">
|
|
3
3
|
<%= link_to link_url, data: link_data, class: "h-7 w-7 flex items-center justify-center rounded-full focus:outline-none transition-colors duration-200 border-4 border-white bg-gray-500 text-gray-200 hover:bg-gray-900 hover:text-gray-100" do %>
|
|
4
4
|
<%= render Maglev::Uikit::IconComponent.new(name: "add", size: "1.15rem") %>
|
|
5
5
|
<% end %>
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
<%= tag.div(data: { sortable_target: sortable_target, item_id: id, item_index: index }) do %>
|
|
2
2
|
<%= content_tag(wrapper_tag_name.to_sym, class: wrapper_classes) do %>
|
|
3
|
-
<%=
|
|
3
|
+
<%= leading if leading? %>
|
|
4
4
|
|
|
5
5
|
<%= tag.div(class: 'flex items-center cursor-move', data: { sortable_target: sortable_handle }) do %>
|
|
6
6
|
<%= render Maglev::Uikit::IconComponent.new(name: "draggable") %>
|
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
<% item_body = capture do %>
|
|
10
10
|
<% if icon? %>
|
|
11
11
|
<div class="grid grid-cols-[auto_1fr_auto] flex flex-1 items-center">
|
|
12
|
-
<div class="
|
|
12
|
+
<div class="me-2">
|
|
13
13
|
<%= icon %>
|
|
14
14
|
</div>
|
|
15
15
|
<div class="text-gray-800 truncate"><%= title %></div>
|
|
@@ -56,9 +56,11 @@
|
|
|
56
56
|
<% end %>
|
|
57
57
|
|
|
58
58
|
<% if action? %>
|
|
59
|
-
<div class="relative
|
|
59
|
+
<div class="relative ms-auto flex items-center shrink-0 min-h-full gap-2">
|
|
60
60
|
<%= action %>
|
|
61
61
|
</div>
|
|
62
62
|
<% end %>
|
|
63
|
-
<% end %>
|
|
64
|
-
|
|
63
|
+
<% end %>
|
|
64
|
+
|
|
65
|
+
<%= content if content? %>
|
|
66
|
+
<% end %>
|
|
@@ -12,6 +12,8 @@ module Maglev
|
|
|
12
12
|
renders_one :sub_title
|
|
13
13
|
renders_one :title
|
|
14
14
|
renders_one :action
|
|
15
|
+
# Inside the wrapper (e.g. radio for label wrappers). Default content stays below.
|
|
16
|
+
renders_one :leading
|
|
15
17
|
|
|
16
18
|
attr_reader :link, :index, :options, :variant, :wrapper_tag_name
|
|
17
19
|
|
data/app/components/maglev/uikit/locale_switcher_component/locale_switcher_component.html.erb
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
<%= render(Maglev::Uikit::MenuDropdownComponent.new) do |dropdown| %>
|
|
2
2
|
<% dropdown.with_trigger do %>
|
|
3
|
-
<%= tag.button class: helpers.maglev_button_classes(color: :secondary, class: '
|
|
3
|
+
<%= tag.button class: helpers.maglev_button_classes(color: :secondary, class: 'gap-2'), data: { action: 'click->uikit-dropdown#toggle', 'uikit-dropdown-target': 'button' } do %>
|
|
4
4
|
<%= render Maglev::Uikit::IconComponent.new(name: 'global') %>
|
|
5
5
|
<span class="whitespace-nowrap">
|
|
6
6
|
<%= current_locale_label %>
|
|
@@ -52,7 +52,7 @@ module Maglev
|
|
|
52
52
|
class_variants(
|
|
53
53
|
base: %(
|
|
54
54
|
col-span-3 grid grid-cols-subgrid
|
|
55
|
-
flex flex-1 items-center px-2 py-3 w-full mx-1 rounded-sm text-
|
|
55
|
+
flex flex-1 items-center px-2 py-3 w-full mx-1 rounded-sm text-start
|
|
56
56
|
transition-colors duration-200 focus:outline-none cursor-pointer
|
|
57
57
|
),
|
|
58
58
|
variants: {
|
|
@@ -82,11 +82,11 @@ module Maglev
|
|
|
82
82
|
|
|
83
83
|
def self.inner_content
|
|
84
84
|
<<-ERB
|
|
85
|
-
<%= render Maglev::Uikit::IconComponent.new(name: icon.to_s, size: '1.15rem', class_names: '
|
|
85
|
+
<%= render Maglev::Uikit::IconComponent.new(name: icon.to_s, size: '1.15rem', class_names: 'me-2 shrink-0') if icon? %>
|
|
86
86
|
<span class="<%= 'col-start-2' unless icon? %> whitespace-nowrap whitespace-nowrap truncate overflow-hidden">
|
|
87
87
|
<%= label %>
|
|
88
88
|
</span>
|
|
89
|
-
<%= render Maglev::Uikit::IconComponent.new(name: 'arrow_right', size: '1.15rem', class_names: '
|
|
89
|
+
<%= render Maglev::Uikit::IconComponent.new(name: 'arrow_right', size: '1.15rem', class_names: 'ms-2 shrink-0 rtl:-scale-x-100') if right_arrow? %>
|
|
90
90
|
<span class="col-start-2 whitespace-nowrap whitespace-nowrap truncate overflow-hidden text-xs text-gray-500">
|
|
91
91
|
<%= sub_label %>
|
|
92
92
|
</span>
|
|
@@ -23,7 +23,7 @@
|
|
|
23
23
|
<div class="fixed inset-0 z-10 w-screen overflow-y-auto">
|
|
24
24
|
<div class="flex min-h-full items-center justify-center p-4" data-action="click->uikit-modal#close:self">
|
|
25
25
|
<div
|
|
26
|
-
class="relative transform overflow-y-visible rounded-lg bg-white px-4 pb-4 pt-5 text-
|
|
26
|
+
class="relative transform overflow-y-visible rounded-lg bg-white px-4 pb-4 pt-5 text-start shadow-xl transition-all sm:my-8 sm:min-w-96 sm:p-6 w-full sm:w-auto hidden"
|
|
27
27
|
data-uikit-modal-target="dialog"
|
|
28
28
|
data-transition-enter="ease-out duration-100"
|
|
29
29
|
data-transition-enter-start="opacity-0 -translate-y-6 scale-95"
|
|
@@ -36,12 +36,12 @@
|
|
|
36
36
|
<div class="flex items-center justify-between">
|
|
37
37
|
<h2 class="text-gray-800 font-semibold antialiased text-lg"><%= title %></h2>
|
|
38
38
|
|
|
39
|
-
<div class="
|
|
39
|
+
<div class="ms-auto ps-2 gap-0.5 flex items-center">
|
|
40
40
|
<% if notification? %>
|
|
41
41
|
<%= notification %>
|
|
42
42
|
<% end %>
|
|
43
43
|
|
|
44
|
-
<div class="relative -
|
|
44
|
+
<div class="relative -end-2">
|
|
45
45
|
<%= render Maglev::Uikit::IconButtonComponent.new(icon_name: 'close', data: { action: 'click->uikit-modal#close' }) %>
|
|
46
46
|
</div>
|
|
47
47
|
</div>
|
|
@@ -19,7 +19,7 @@ module Maglev
|
|
|
19
19
|
def dialog_classes
|
|
20
20
|
class_variants(
|
|
21
21
|
base: %(
|
|
22
|
-
relative transform overflow-y-visible rounded-lg bg-white px-4 pb-4 pt-5 text-
|
|
22
|
+
relative transform overflow-y-visible rounded-lg bg-white px-4 pb-4 pt-5 text-start
|
|
23
23
|
shadow-xl transition-all sm:my-8 sm:p-6 hidden
|
|
24
24
|
),
|
|
25
25
|
variants: {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
<%= link_to path, class: 'text-gray-500 hover:text-gray-700 inline-flex items-center space-x text-xs', data: { turbo_frame: '_top' } do %>
|
|
2
|
-
<%= render Maglev::Uikit::IconComponent.new(name: 'arrow_left', size: '1.15rem', class_names: 'relative -
|
|
2
|
+
<%= render Maglev::Uikit::IconComponent.new(name: 'arrow_left', size: '1.15rem', class_names: 'relative -start-1 rtl:-scale-x-100') %>
|
|
3
3
|
<%= content %>
|
|
4
4
|
<% end %>
|
|
@@ -22,14 +22,14 @@
|
|
|
22
22
|
<%= title_html %>
|
|
23
23
|
<% end %>
|
|
24
24
|
</div>
|
|
25
|
-
<div class="
|
|
25
|
+
<div class="ms-auto ps-2 gap-0.5 flex items-center">
|
|
26
26
|
<turbo-frame id="page-layout-notification">
|
|
27
27
|
<% if notification? %>
|
|
28
28
|
<%= notification %>
|
|
29
29
|
<% end %>
|
|
30
30
|
</turbo-frame>
|
|
31
31
|
|
|
32
|
-
<%= link_to back_path, class: 'h-7 w-7 flex items-center justify-center rounded-full focus:outline-none transition-colors duration-200 relative -
|
|
32
|
+
<%= link_to back_path, class: 'h-7 w-7 flex items-center justify-center rounded-full focus:outline-none transition-colors duration-200 relative -end-2 bg-gray-600/0 hover:text-gray-900 text-gray-800 hover:bg-gray-600/10', data: { turbo_frame: '_top' } do %>
|
|
33
33
|
<%= render Maglev::Uikit::IconComponent.new(name: 'close', size: '1.15rem') %>
|
|
34
34
|
<% end %>
|
|
35
35
|
</div>
|
|
@@ -21,11 +21,11 @@ module Maglev
|
|
|
21
21
|
class_variants(
|
|
22
22
|
base: %(
|
|
23
23
|
slide-pane absolute inset-y-0 h-[100dvh-(--spacing(16))] bg-white
|
|
24
|
-
border-
|
|
24
|
+
border-e border-gray-200 origin-top-left rtl:origin-top-right flex flex-col top-16 w-104
|
|
25
25
|
),
|
|
26
26
|
variants: {
|
|
27
|
-
expanded: '
|
|
28
|
-
'!expanded': '
|
|
27
|
+
expanded: 'start-0 z-40',
|
|
28
|
+
'!expanded': 'start-16 z-10'
|
|
29
29
|
}
|
|
30
30
|
).render(expanded: expanded)
|
|
31
31
|
end
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
<% a = pagy_anchor(pagy) %>
|
|
2
2
|
|
|
3
3
|
<% left_arrow = capture do %>
|
|
4
|
-
<%= render Maglev::Uikit::IconComponent.new(name: 'arrow_left', size: '1.25rem') %>
|
|
4
|
+
<%= render Maglev::Uikit::IconComponent.new(name: 'arrow_left', size: '1.25rem', class_names: 'rtl:-scale-x-100') %>
|
|
5
5
|
<% end %>
|
|
6
6
|
|
|
7
7
|
<% right_arrow = capture do %>
|
|
8
|
-
<%= render Maglev::Uikit::IconComponent.new(name: 'arrow_right', size: '1.25rem') %>
|
|
8
|
+
<%= render Maglev::Uikit::IconComponent.new(name: 'arrow_right', size: '1.25rem', class_names: 'rtl:-scale-x-100') %>
|
|
9
9
|
<% end %>
|
|
10
10
|
|
|
11
11
|
<div class="flex items-center justify-between bg-white w-full h-10">
|
|
@@ -19,9 +19,9 @@
|
|
|
19
19
|
<% end %>
|
|
20
20
|
|
|
21
21
|
<% if pagy.next %>
|
|
22
|
-
<%== a.(pagy.next, pagy_t('pagy.aria_label.next'), aria_label: 'Next', classes: 'relative
|
|
22
|
+
<%== a.(pagy.next, pagy_t('pagy.aria_label.next'), aria_label: 'Next', classes: 'relative ms-3 inline-flex items-center rounded-md border border-gray-300 bg-white px-4 py-2 text-sm font-medium text-gray-700 hover:bg-gray-100') %>
|
|
23
23
|
<% else %>
|
|
24
|
-
<a role="link" aria-disabled="true" aria-label="Next" class="relative
|
|
24
|
+
<a role="link" aria-disabled="true" aria-label="Next" class="relative ms-3 inline-flex items-center rounded-md border border-gray-300 bg-white px-4 py-2 text-sm font-medium text-gray-700 hover:bg-gray-100">
|
|
25
25
|
<%= pagy_t('pagy.aria_label.next') %>
|
|
26
26
|
</a>
|
|
27
27
|
<% end %>
|
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
<div
|
|
2
|
-
class="absolute top-0
|
|
2
|
+
class="absolute top-0 start-0 mt-2 ms-2 flex hidden transition ease-[cubic-bezier(0.55,0,0.1,1)]"
|
|
3
3
|
data-uikit-section-toolbar-target="topLeftCorner"
|
|
4
4
|
data-transition-enter="duration-200"
|
|
5
|
-
data-transition-enter-start="-translate-x-[50%] opacity-0"
|
|
5
|
+
data-transition-enter-start="-translate-x-[50%] rtl:translate-x-[50%] opacity-0"
|
|
6
6
|
data-transition-enter-end="translate-x-0 opacity-100"
|
|
7
7
|
data-transition-leave="duration-200"
|
|
8
8
|
data-transition-leave-start="translate-x-0 opacity-100"
|
|
9
|
-
data-transition-leave-end="-translate-x-[50%] opacity-0"
|
|
9
|
+
data-transition-leave-end="-translate-x-[50%] rtl:translate-x-[50%] opacity-0"
|
|
10
10
|
>
|
|
11
11
|
<div
|
|
12
|
-
class="bg-editor-primary text-white py-1 px-3 rounded-
|
|
12
|
+
class="bg-editor-primary text-white py-1 px-3 rounded-s-2xl rounded-e-2xl text-xs flex items-center"
|
|
13
13
|
>
|
|
14
14
|
<span><%= label %></span>
|
|
15
15
|
</div>
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
<div class="absolute top-0
|
|
1
|
+
<div class="absolute top-0 end-0 mt-2 me-2 flex justify-center gap-x-2 hidden transition ease-[cubic-bezier(0.55,0,0.1,1)]"
|
|
2
2
|
data-uikit-section-toolbar-target="topRightCorner"
|
|
3
3
|
data-transition-enter="duration-200"
|
|
4
|
-
data-transition-enter-start="translate-x-[50%] opacity-0"
|
|
4
|
+
data-transition-enter-start="translate-x-[50%] rtl:-translate-x-[50%] opacity-0"
|
|
5
5
|
data-transition-enter-end="translate-x-0 opacity-100"
|
|
6
6
|
data-transition-leave="duration-200"
|
|
7
7
|
data-transition-leave-start="translate-x-0 opacity-100"
|
|
8
|
-
data-transition-leave-end="translate-x-[50%] opacity-0"
|
|
8
|
+
data-transition-leave-end="translate-x-[50%] rtl:-translate-x-[50%] opacity-0"
|
|
9
9
|
>
|
|
10
10
|
<%= link_to paths[:edit], class: button_classes, data: { turbo_frame: '_top' } do %>
|
|
11
11
|
<%= render Maglev::Uikit::IconComponent.new(name: 'pencil') %>
|
|
@@ -26,7 +26,7 @@ module Maglev
|
|
|
26
26
|
|
|
27
27
|
def handle_stale_object
|
|
28
28
|
respond_to do |format|
|
|
29
|
-
format.turbo_stream { render 'maglev/editor/shared/errors/stale_object_error' }
|
|
29
|
+
format.turbo_stream { render 'maglev/editor/shared/errors/stale_object_error', status: :conflict }
|
|
30
30
|
format.html { redirect_to editor_root_path }
|
|
31
31
|
end
|
|
32
32
|
end
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Maglev
|
|
4
|
+
module Editor
|
|
5
|
+
module LockVersionConcern
|
|
6
|
+
extend ActiveSupport::Concern
|
|
7
|
+
|
|
8
|
+
included do
|
|
9
|
+
helper_method :source_lock_version
|
|
10
|
+
end
|
|
11
|
+
|
|
12
|
+
private
|
|
13
|
+
|
|
14
|
+
def lock_source
|
|
15
|
+
@section.site_scoped? ? maglev_site : current_maglev_page
|
|
16
|
+
end
|
|
17
|
+
|
|
18
|
+
def source_lock_version
|
|
19
|
+
lock_source.lock_version || 0
|
|
20
|
+
end
|
|
21
|
+
|
|
22
|
+
def reload_lock_source
|
|
23
|
+
lock_source.reload if @section.site_scoped?
|
|
24
|
+
end
|
|
25
|
+
end
|
|
26
|
+
end
|
|
27
|
+
end
|
|
@@ -3,8 +3,9 @@
|
|
|
3
3
|
module Maglev
|
|
4
4
|
module Editor
|
|
5
5
|
class SectionBlocksController < Maglev::Editor::BaseController
|
|
6
|
+
include Maglev::Editor::LockVersionConcern
|
|
7
|
+
|
|
6
8
|
helper Maglev::Editor::SettingsHelper
|
|
7
|
-
helper_method :source_lock_version
|
|
8
9
|
|
|
9
10
|
before_action :set_section
|
|
10
11
|
before_action :set_section_block, only: %i[edit update destroy]
|
|
@@ -32,6 +33,7 @@ module Maglev
|
|
|
32
33
|
|
|
33
34
|
def update
|
|
34
35
|
update_section_block
|
|
36
|
+
reload_lock_source
|
|
35
37
|
flash.now[:notice] = flash_t(:success)
|
|
36
38
|
end
|
|
37
39
|
|
|
@@ -77,14 +79,6 @@ module Maglev
|
|
|
77
79
|
)
|
|
78
80
|
end
|
|
79
81
|
|
|
80
|
-
def lock_source
|
|
81
|
-
@section.site_scoped? ? maglev_site : current_maglev_page
|
|
82
|
-
end
|
|
83
|
-
|
|
84
|
-
def source_lock_version
|
|
85
|
-
lock_source.lock_version || 0
|
|
86
|
-
end
|
|
87
|
-
|
|
88
82
|
def redirect_to_section_blocks_path(success: true)
|
|
89
83
|
flash = case success
|
|
90
84
|
when true then { notice: flash_t(:success) }
|
|
@@ -3,8 +3,9 @@
|
|
|
3
3
|
module Maglev
|
|
4
4
|
module Editor
|
|
5
5
|
class SectionsController < Maglev::Editor::BaseController
|
|
6
|
+
include Maglev::Editor::LockVersionConcern
|
|
7
|
+
|
|
6
8
|
helper Maglev::Editor::SettingsHelper
|
|
7
|
-
helper_method :source_lock_version
|
|
8
9
|
|
|
9
10
|
before_action :ensure_turbo_frame_request, only: [:new]
|
|
10
11
|
before_action :set_section, only: %i[edit update]
|
|
@@ -39,6 +40,7 @@ module Maglev
|
|
|
39
40
|
|
|
40
41
|
def update
|
|
41
42
|
update_section
|
|
43
|
+
reload_lock_source
|
|
42
44
|
flash.now[:notice] = flash_t(:success)
|
|
43
45
|
end
|
|
44
46
|
|
|
@@ -95,14 +97,6 @@ module Maglev
|
|
|
95
97
|
headers['X-Section-Position'] = flash[:position]
|
|
96
98
|
end
|
|
97
99
|
|
|
98
|
-
def lock_source
|
|
99
|
-
@section.site_scoped? ? maglev_site : current_maglev_page
|
|
100
|
-
end
|
|
101
|
-
|
|
102
|
-
def source_lock_version
|
|
103
|
-
lock_source.lock_version || 0
|
|
104
|
-
end
|
|
105
|
-
|
|
106
100
|
def redirect_to_sections_path
|
|
107
101
|
redirect_to editor_sections_path_with_context, notice: flash_t(:success), status: :see_other
|
|
108
102
|
end
|
|
@@ -3,6 +3,8 @@
|
|
|
3
3
|
# rubocop:disable Metrics/ModuleLength
|
|
4
4
|
module Maglev
|
|
5
5
|
module ApplicationHelper
|
|
6
|
+
RTL_UI_LOCALES = %i[ar he fa ur].freeze
|
|
7
|
+
|
|
6
8
|
## "system" helpers
|
|
7
9
|
def turbo_stream
|
|
8
10
|
# we don't want to pollute the global Turbo::Streams::TagBuilder
|
|
@@ -63,6 +65,10 @@ module Maglev
|
|
|
63
65
|
end
|
|
64
66
|
|
|
65
67
|
## Editor helpers
|
|
68
|
+
def maglev_editor_direction
|
|
69
|
+
RTL_UI_LOCALES.include?(editor_ui_locale.to_sym) ? 'rtl' : 'ltr'
|
|
70
|
+
end
|
|
71
|
+
|
|
66
72
|
def maglev_editor_title
|
|
67
73
|
case maglev_config.title
|
|
68
74
|
when nil
|
|
@@ -58,7 +58,7 @@ module Maglev
|
|
|
58
58
|
|
|
59
59
|
def update_setting_value(setting, current_content)
|
|
60
60
|
setting_content = current_content.find { |s| s['id'] == setting.id }
|
|
61
|
-
value = content[setting.id.to_sym]
|
|
61
|
+
value = setting.cast_value(content[setting.id.to_sym])
|
|
62
62
|
|
|
63
63
|
if setting_content.nil?
|
|
64
64
|
current_content.push({ id: setting.id, value: value })
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
<div
|
|
2
|
-
class="absolute top-16
|
|
2
|
+
class="absolute top-16 start-16 end-0 bottom-0 z-0 overflow-hidden group"
|
|
3
3
|
data-controller="editor-page-preview"
|
|
4
4
|
data-action="
|
|
5
5
|
uikit-device-toggler:change@window->editor-page-preview#changeDevice
|
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
>
|
|
15
15
|
<div
|
|
16
16
|
id="page-preview"
|
|
17
|
-
class="bg-gray-50 origin-top-left transition-transform duration-150 ease-out will-change-transform transform-gpu hidden opacity-0 group-[.is-loaded]:opacity-100 group-[.is-loaded]:block"
|
|
17
|
+
class="bg-gray-50 origin-top-left rtl:origin-top-right transition-transform duration-150 ease-out will-change-transform transform-gpu hidden opacity-0 group-[.is-loaded]:opacity-100 group-[.is-loaded]:block"
|
|
18
18
|
data-editor-page-preview-target="iframe-wrapper"
|
|
19
19
|
>
|
|
20
20
|
<iframe
|
|
@@ -28,7 +28,7 @@
|
|
|
28
28
|
</div>
|
|
29
29
|
|
|
30
30
|
<div class="flex h-full w-full justify-center items-center transition-discrete transition-all duration-100 ease-in-out opacity-100 group-[.is-loaded]:opacity-0 group-[.is-loaded]:hidden" data-editor-page-preview-target="loading">
|
|
31
|
-
<p class="animate-bounce duration-200 group-data-[expanded-page-layout]/page-layout:
|
|
31
|
+
<p class="animate-bounce duration-200 group-data-[expanded-page-layout]/page-layout:ps-88">
|
|
32
32
|
<%= t('maglev.editor.page_preview.loading') %>
|
|
33
33
|
</p>
|
|
34
34
|
</div>
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
<%# z-[5]: below PageLayoutComponent (z-10 / z-40), above preview shell (z-0). editor-preview-empty: tailwind.css.erb @custom-variant on [data-controller~="editor-page-preview"].is-empty %>
|
|
2
|
-
<div class="fixed top-16
|
|
2
|
+
<div class="fixed top-16 start-16 end-0 bottom-0 z-[5] bg-gray-50 hidden editor-preview-empty:block">
|
|
3
3
|
<div class="flex min-h-full flex-col items-center justify-center px-4">
|
|
4
4
|
<h2 class="text-center text-2xl font-bold">
|
|
5
5
|
<%= t('maglev.editor.page_preview.empty.title') %>
|