lato 3.10.12 → 3.11.1
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/README.md +4 -3
- data/app/assets/javascripts/lato/application.js +5 -0
- data/app/assets/javascripts/lato/controllers/lato_guide_controller.js +93 -0
- data/app/assets/stylesheets/lato/application.scss +7 -0
- data/app/views/layouts/lato/application.html.erb +1 -1
- data/lib/lato/config.rb +1 -1
- data/lib/lato/version.rb +1 -1
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: aac7553d07bfc74cea7e43c829e5e68a99ef5c4c1ca84c0abafbe3ed9b28d4e2
|
4
|
+
data.tar.gz: 946fa0334adad14cd55836470e5969a04be8d8533085811fd206cc21685bc333
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: fa351b5aaeb8c3610000eef54cfc6dc1fe000ede31e9a6963b5282c2f6591239a475da8285066f7c2e2483f5c8e1f2b7fbc109157cc6c035f4155c7ac66db3a0
|
7
|
+
data.tar.gz: 0ec8ec42232d0ec5c0cd4411e6b5821348772cd451ea81c3698b2c852b20b96457e907a387f58634b2a711bf294140b55e55123503074f353d7bf828503eecaa
|
data/README.md
CHANGED
@@ -1,5 +1,6 @@
|
|
1
1
|
# Lato
|
2
|
-
|
2
|
+
|
3
|
+
Lato is a Rails Engine to deliver a full featured web panel for your Rails application.
|
3
4
|
|
4
5
|
This gem includes:
|
5
6
|
- User management with full authentication (signin, signup, recover password);
|
@@ -77,7 +78,7 @@ end
|
|
77
78
|
### Extra tasks
|
78
79
|
Lato integrates by default a basic PWAs manifest and service worker. To re-generate them with all required assets follow these steps:
|
79
80
|
|
80
|
-
1. Complete the configuration of lato on a custom initializer (see [configuration](https://github.com/lato-
|
81
|
+
1. Complete the configuration of lato on a custom initializer (see [configuration](https://github.com/lato-org/lato/blob/main/lib/lato/config.rb) options for more details)
|
81
82
|
2. Add an icon.png file on **public/icon.png** with minimum size of 512x512px
|
82
83
|
3. Run the following commands:
|
83
84
|
|
@@ -91,7 +92,7 @@ $ rails lato:generate:pwa
|
|
91
92
|
Clone repository, install dependencies, run migrations and start:
|
92
93
|
|
93
94
|
```shell
|
94
|
-
$ git clone https://github.com/
|
95
|
+
$ git clone https://github.com/lato-org/lato
|
95
96
|
$ cd lato
|
96
97
|
$ bundle
|
97
98
|
$ rails db:migrate
|
@@ -55,5 +55,10 @@ document.addEventListener('turbo:before-cache', (e) => {
|
|
55
55
|
document.querySelector('.navbar-toggler').classList.add('collapsed')
|
56
56
|
document.querySelector('.navbar-collapse').classList.remove('show')
|
57
57
|
|
58
|
+
// remove all tooltips
|
59
|
+
document.querySelectorAll('.tooltip').forEach((el) => {
|
60
|
+
el.remove()
|
61
|
+
})
|
62
|
+
|
58
63
|
e.detail?.resume()
|
59
64
|
})
|
@@ -0,0 +1,93 @@
|
|
1
|
+
import { Controller } from "@hotwired/stimulus"
|
2
|
+
|
3
|
+
export default class extends Controller {
|
4
|
+
static targets = ['item']
|
5
|
+
|
6
|
+
/**
|
7
|
+
* Stimulus
|
8
|
+
*/
|
9
|
+
|
10
|
+
connect() {
|
11
|
+
const localStorageStatus = localStorage.getItem('lato_guide')
|
12
|
+
this.status = localStorageStatus ? JSON.parse(localStorageStatus) : {}
|
13
|
+
this.items = null
|
14
|
+
this.showing = false
|
15
|
+
|
16
|
+
this.storeStatus()
|
17
|
+
this.setupItems()
|
18
|
+
this.showGuide()
|
19
|
+
}
|
20
|
+
|
21
|
+
itemTargetConnected(e) {
|
22
|
+
this.setupItems()
|
23
|
+
this.showGuide()
|
24
|
+
}
|
25
|
+
|
26
|
+
itemTargetDisconnected(e) {
|
27
|
+
this.setupItems()
|
28
|
+
}
|
29
|
+
|
30
|
+
setupItems(e = null) {
|
31
|
+
if (e) e.preventDefault()
|
32
|
+
|
33
|
+
this.items = this.itemTargets.map(item => ({ element: item, key: item.dataset.guideKey, content: item.dataset.guideContent, index: parseInt(item.dataset.guideIndex) })).map(item => {
|
34
|
+
item.index = isNaN(item.index) ? 999 : item.index
|
35
|
+
return item
|
36
|
+
}).sort((a, b) => a.index - b.index)
|
37
|
+
}
|
38
|
+
|
39
|
+
async showGuide() {
|
40
|
+
if (this.showing) return
|
41
|
+
if (!this.status) return
|
42
|
+
if (!this.items) return
|
43
|
+
|
44
|
+
for (const item of this.items) {
|
45
|
+
if (this.status[item.key]) continue
|
46
|
+
await this.showGuideItem(item)
|
47
|
+
}
|
48
|
+
}
|
49
|
+
|
50
|
+
async showGuideItem(item) {
|
51
|
+
if (this.showing) return
|
52
|
+
if (!this.status) return
|
53
|
+
if (this.status[item.key]) return
|
54
|
+
|
55
|
+
this.showing = true
|
56
|
+
return new Promise((resolve) => {
|
57
|
+
const tooltipIsLast = this.items.filter(target => !this.status[target.key]).length === 1
|
58
|
+
const tooltipCloseId = `lato-guide-close-${Math.random().toString(36).substring(7)}`
|
59
|
+
const tooltipTitle = `
|
60
|
+
<div class="px-2 py-2 d-flex align-items-center justify-content-between">
|
61
|
+
<p class="me-2 mb-0 text-start">${item.content}</p>
|
62
|
+
<a id="${tooltipCloseId}" class="btn btn-light btn-sm">${tooltipIsLast ? 'Close' : 'Next'}</a>
|
63
|
+
</div>
|
64
|
+
`
|
65
|
+
|
66
|
+
const tooltip = new bootstrap.Tooltip(item.element, { title: tooltipTitle, trigger: 'manual', html: true, customClass: 'lato-guide-tooltip' })
|
67
|
+
item.element.addEventListener('shown.bs.tooltip', () => {
|
68
|
+
setTimeout(() => {
|
69
|
+
document.getElementById(tooltipCloseId).addEventListener('click', () => {
|
70
|
+
tooltip.hide()
|
71
|
+
this.showing = false
|
72
|
+
this.status[item.key] = true
|
73
|
+
this.storeStatus()
|
74
|
+
resolve()
|
75
|
+
})
|
76
|
+
}, 250)
|
77
|
+
})
|
78
|
+
tooltip.show()
|
79
|
+
})
|
80
|
+
}
|
81
|
+
|
82
|
+
storeStatus(e = null) {
|
83
|
+
if (e) e.preventDefault()
|
84
|
+
localStorage.setItem('lato_guide', JSON.stringify(this.status))
|
85
|
+
}
|
86
|
+
|
87
|
+
resetStatus(e = null) {
|
88
|
+
if (e) e.preventDefault()
|
89
|
+
this.status = {}
|
90
|
+
this.storeStatus()
|
91
|
+
this.showGuide()
|
92
|
+
}
|
93
|
+
}
|
@@ -17,6 +17,9 @@ $gray-700: #454f58 !default;
|
|
17
17
|
$gray-800: #313a42 !default;
|
18
18
|
$gray-900: #1f262c !default;
|
19
19
|
|
20
|
+
$tooltip-opacity: 1;
|
21
|
+
$tooltip-max-width: 300px;
|
22
|
+
|
20
23
|
@import url("https://cdn.jsdelivr.net/npm/bootstrap-icons@1.11.2/font/bootstrap-icons.css");
|
21
24
|
@import "bootstrap";
|
22
25
|
|
@@ -127,4 +130,8 @@ main, aside {
|
|
127
130
|
100% {
|
128
131
|
transform: rotate(360deg);
|
129
132
|
}
|
133
|
+
}
|
134
|
+
|
135
|
+
.lato-guide-tooltip {
|
136
|
+
|
130
137
|
}
|
@@ -25,7 +25,7 @@
|
|
25
25
|
</head>
|
26
26
|
<body
|
27
27
|
class="controller-<%= controller_name %> action-<%= action_name %> <%= @layout_body_classes.join(' ') %>"
|
28
|
-
data-controller="lato-action"
|
28
|
+
data-controller="lato-action lato-guide"
|
29
29
|
>
|
30
30
|
<header>
|
31
31
|
<%= render 'layouts/lato/navbar' %>
|
data/lib/lato/config.rb
CHANGED
@@ -32,7 +32,7 @@ module Lato
|
|
32
32
|
@application_title = 'Lato'
|
33
33
|
@application_version = '1.0.0'
|
34
34
|
@application_company_name = 'Lato Team'
|
35
|
-
@application_company_url = 'https://github.com/
|
35
|
+
@application_company_url = 'https://github.com/lato-org'
|
36
36
|
@application_brand_color = '#03256c'
|
37
37
|
|
38
38
|
@auth_disable_signup = false
|
data/lib/lato/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: lato
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 3.
|
4
|
+
version: 3.11.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Gregorio Galante
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2025-02-13 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|
@@ -159,6 +159,7 @@ files:
|
|
159
159
|
- app/assets/javascripts/lato/controllers/lato_confirm_controller.js
|
160
160
|
- app/assets/javascripts/lato/controllers/lato_feedback_controller.js
|
161
161
|
- app/assets/javascripts/lato/controllers/lato_form_controller.js
|
162
|
+
- app/assets/javascripts/lato/controllers/lato_guide_controller.js
|
162
163
|
- app/assets/javascripts/lato/controllers/lato_hello_controller.js
|
163
164
|
- app/assets/javascripts/lato/controllers/lato_input_autocomplete2_controller.js
|
164
165
|
- app/assets/javascripts/lato/controllers/lato_input_autocomplete_controller.js
|