lato 3.10.12 → 3.11.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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 1933e05b24bc5a17c0bdfed4bc7e4138115ea82d295f602a10d8773037add06c
4
- data.tar.gz: 2a5a834dc481d9ee274128d5a3f1686b00faaaabd7356a34c3b2d4c05d067855
3
+ metadata.gz: 890f6071431f470805aa8c253844356565814fbdc2ceb6152135fba2c02e79aa
4
+ data.tar.gz: 8eddac1dc91f0a5755ee40a115b45038c023393e7ffee6200e796968c79a1a7f
5
5
  SHA512:
6
- metadata.gz: 0d985c7cb9f25127c0d5b045593e0063d6fc8dcfcdca34b6fecc30fdd27851205f9e0838fd01d939b52a753060c0d6bf85909bb7b2b506d99a8bb6e68c949613
7
- data.tar.gz: 62bf40a75b307205ed2927b6aebedbf320b592f5f71389eab763cafa716b9c15351b5ab490b022e28afea4d654c8d8569185facb46bdd219db8fc28979fb5cc3
6
+ metadata.gz: 04ece6a0739114376e060e78d5a05e967d76d5469363635d0f3912de92e1f1861ca7c6b862e666257b31a1beeec31d6387f03a6f9ebbe3ebffb366685929b6b4
7
+ data.tar.gz: 113ea99f5ba6a087dafdf6594d348ecb283451010766254b2c207c1ff68841791171482866e2df7b8f4d49a4a68f79755076b5a6a0a54870a71492dc8e738b69
data/README.md CHANGED
@@ -1,5 +1,6 @@
1
1
  # Lato
2
- Lato is a Rails Engine for developing web applications.
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-gam/lato/blob/main/lib/lato/config.rb) options for more details)
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/Lato-GAM/lato
95
+ $ git clone https://github.com/lato-org/lato
95
96
  $ cd lato
96
97
  $ bundle
97
98
  $ rails db:migrate
@@ -0,0 +1,76 @@
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.storeStatus()
14
+
15
+ this.start()
16
+ }
17
+
18
+ start(e = null) {
19
+ if (e) e.preventDefault()
20
+
21
+ const targets = this.itemTargets.map(item => ({ element: item, key: item.dataset.guideKey, content: item.dataset.guideContent, index: parseInt(item.dataset.guideIndex) })).map(item => {
22
+ item.index = isNaN(item.index) ? 999 : item.index
23
+ return item
24
+ }).sort((a, b) => a.index - b.index)
25
+
26
+ this.showGuide(targets)
27
+ }
28
+
29
+ async showGuide(targets) {
30
+ for (let i = 0; i < targets.length; i++) {
31
+ const item = targets[i]
32
+ if (this.status[item.key]) continue
33
+
34
+ await this.showGuideItem(item, i === targets.length - 1)
35
+ }
36
+ }
37
+
38
+ async showGuideItem(item, isLast = false) {
39
+ if (this.status[item.key]) return
40
+
41
+ return new Promise((resolve) => {
42
+ const tooltipCloseId = `guide-close-${Math.random().toString(36).substring(7)}`
43
+ const tooltipTitle = `
44
+ <div class="px-3 py-3">
45
+ <p class="mb-1">${item.content}</p>
46
+ <a id="${tooltipCloseId}" class="btn btn-light btn-sm mt-2">${isLast ? 'Close' : 'Next'}</a>
47
+ </div>
48
+ `
49
+
50
+ const tooltip = new bootstrap.Tooltip(item.element, { title: tooltipTitle, trigger: 'manual', html: true })
51
+ item.element.addEventListener('shown.bs.tooltip', () => {
52
+ setTimeout(() => {
53
+ document.getElementById(tooltipCloseId).addEventListener('click', () => {
54
+ tooltip.hide()
55
+ this.status[item.key] = true
56
+ this.storeStatus()
57
+ resolve()
58
+ })
59
+ }, 250)
60
+ })
61
+ tooltip.show()
62
+ })
63
+ }
64
+
65
+ storeStatus(e = null) {
66
+ if (e) e.preventDefault()
67
+ localStorage.setItem('lato_guide', JSON.stringify(this.status))
68
+ }
69
+
70
+ resetStatus(e = null) {
71
+ if (e) e.preventDefault()
72
+ this.status = {}
73
+ this.storeStatus()
74
+ this.start()
75
+ }
76
+ }
@@ -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/Lato-GAM'
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
@@ -1,3 +1,3 @@
1
1
  module Lato
2
- VERSION = "3.10.12"
2
+ VERSION = "3.11.0"
3
3
  end
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.10.12
4
+ version: 3.11.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Gregorio Galante
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2024-12-31 00:00:00.000000000 Z
11
+ date: 2025-02-12 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