lifeform 0.12.0 → 0.14.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/CHANGELOG.md +18 -0
- data/Gemfile.lock +3 -3
- data/lib/lifeform/form.rb +5 -0
- data/lib/lifeform/libraries/default/button.rb +2 -3
- data/lib/lifeform/libraries/default/input.rb +2 -2
- data/lib/lifeform/version.rb +1 -1
- data/lib/lifeform.rb +4 -4
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e2d1f633cb9ed57185677f4cf2e7f6f546fdc8719b6c2d26581ebf1435268980
|
4
|
+
data.tar.gz: 1cf80390c11ecc03347e006f617c93baa1a3f795db47e5af22a349b591535d5c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 159eeda3cc314b5f8d4ff35916c62bc48751f993f2ebe2eff354d32adad130624fe9c7efd87e67b1265eaea6576bb6df21af10b5bff93df7a676094b0e8fbc87
|
7
|
+
data.tar.gz: aac90b79ca2f2599d1017c1e7543e1ad740c08927feb4f008c4f53df8b5eb32a361901ed725d0ed2354cfebeb68cbabc4188aa41674cc5fb7aa60f6d6cf2dbed
|
data/CHANGELOG.md
CHANGED
@@ -1,7 +1,25 @@
|
|
1
1
|
# Changelog
|
2
2
|
|
3
|
+
All notable changes to this project will be documented in this file.
|
4
|
+
|
5
|
+
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
|
6
|
+
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
7
|
+
|
3
8
|
## [Unreleased]
|
4
9
|
|
10
|
+
## [0.14.0] - 2024-03-03
|
11
|
+
|
12
|
+
- Add Rodauth support in Bridgetown
|
13
|
+
|
14
|
+
## [0.13.0] - 2024-03-15
|
15
|
+
|
16
|
+
- Fix rendering bug when wrapper tags were set to nil
|
17
|
+
|
18
|
+
## [0.12.0] - 2023-11-07
|
19
|
+
|
20
|
+
- Use new Streamlined gem for renderable features
|
21
|
+
- Refactor to remove Phlex
|
22
|
+
|
5
23
|
## [0.11.0] - 2023-06-22
|
6
24
|
|
7
25
|
- Upgrade to Phlex 1.7+, Ruby 3.0+
|
data/Gemfile.lock
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
lifeform (0.
|
4
|
+
lifeform (0.14.0)
|
5
5
|
hash_with_dot_access (>= 1.2)
|
6
6
|
sequel (>= 5.72)
|
7
7
|
streamlined (>= 0.2.0)
|
@@ -84,7 +84,7 @@ GEM
|
|
84
84
|
unicode-display_width (>= 2.4.0, < 3.0)
|
85
85
|
rubocop-ast (1.30.0)
|
86
86
|
parser (>= 3.2.1.0)
|
87
|
-
rubocop-bridgetown (0.4.
|
87
|
+
rubocop-bridgetown (0.4.1)
|
88
88
|
rubocop (~> 1.23)
|
89
89
|
rubocop-performance (~> 1.12)
|
90
90
|
rubocop-minitest (0.20.1)
|
@@ -116,7 +116,7 @@ GEM
|
|
116
116
|
thor (~> 1.0)
|
117
117
|
tilt (~> 2.0)
|
118
118
|
yard (~> 0.9, >= 0.9.24)
|
119
|
-
streamlined (0.
|
119
|
+
streamlined (0.3.1)
|
120
120
|
serbea (>= 2.1)
|
121
121
|
zeitwerk (~> 2.5)
|
122
122
|
thor (1.3.0)
|
data/lib/lifeform/form.rb
CHANGED
@@ -23,6 +23,11 @@ module Lifeform
|
|
23
23
|
# Helper to point to `I18n.t` method
|
24
24
|
def t(...) = I18n.t(...)
|
25
25
|
|
26
|
+
# Support integration with Rodauth for sign in/sign up forms
|
27
|
+
attr_writer :rodauth
|
28
|
+
|
29
|
+
def rodauth = Form.instance_variable_get(:@rodauth)
|
30
|
+
|
26
31
|
def configuration = @configuration ||= HashWithDotAccess::Hash.new
|
27
32
|
|
28
33
|
# @param block [Proc, nil]
|
@@ -23,9 +23,7 @@ module Lifeform
|
|
23
23
|
def template(&block)
|
24
24
|
return "" if !@if.nil? && !@if
|
25
25
|
|
26
|
-
wrapper_tag = dashed self.class.const_get(:WRAPPER_TAG)
|
27
26
|
button_tag = dashed self.class.const_get(:BUTTON_TAG)
|
28
|
-
|
29
27
|
label_text = block ? capture(self, &block) : @label.is_a?(Proc) ? @label.pipe : @label # rubocop:disable Style/NestedTernaryOperator
|
30
28
|
|
31
29
|
field_body = html -> { <<~HTML # rubocop:disable Bridgetown/HTMLEscapedHeredoc
|
@@ -33,8 +31,9 @@ module Lifeform
|
|
33
31
|
HTML
|
34
32
|
}
|
35
33
|
|
36
|
-
return field_body unless
|
34
|
+
return field_body unless self.class.const_get(:WRAPPER_TAG)
|
37
35
|
|
36
|
+
wrapper_tag = dashed self.class.const_get(:WRAPPER_TAG)
|
38
37
|
html -> { <<~HTML # rubocop:disable Bridgetown/HTMLEscapedHeredoc
|
39
38
|
<#{wrapper_tag} #{html_attributes name: @attributes[:name]}>#{field_body}</#{wrapper_tag}>
|
40
39
|
HTML
|
@@ -55,7 +55,6 @@ module Lifeform
|
|
55
55
|
def template(&block) # rubocop:disable Metrics/AbcSize
|
56
56
|
return "" if !@if.nil? && !@if
|
57
57
|
|
58
|
-
wrapper_tag = dashed self.class.const_get(:WRAPPER_TAG)
|
59
58
|
input_tag = dashed self.class.const_get(:INPUT_TAG)
|
60
59
|
closing_tag = input_tag != "input"
|
61
60
|
|
@@ -68,8 +67,9 @@ module Lifeform
|
|
68
67
|
HTML
|
69
68
|
}
|
70
69
|
|
71
|
-
return field_body unless
|
70
|
+
return field_body unless self.class.const_get(:WRAPPER_TAG)
|
72
71
|
|
72
|
+
wrapper_tag = dashed self.class.const_get(:WRAPPER_TAG)
|
73
73
|
html -> { <<~HTML # rubocop:disable Bridgetown/HTMLEscapedHeredoc
|
74
74
|
<#{wrapper_tag} #{html_attributes name: @attributes[:name]}>#{field_body.to_s.strip}</#{wrapper_tag}>
|
75
75
|
HTML
|
data/lib/lifeform/version.rb
CHANGED
data/lib/lifeform.rb
CHANGED
@@ -10,9 +10,9 @@ module Lifeform
|
|
10
10
|
end
|
11
11
|
|
12
12
|
if defined?(Bridgetown)
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
13
|
+
Bridgetown.initializer :lifeform do |config|
|
14
|
+
config.hook :authtown, :initialized do |rodauth|
|
15
|
+
Lifeform::Form.rodauth = rodauth
|
16
|
+
end
|
17
17
|
end
|
18
18
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: lifeform
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.14.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Bridgetown Team
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2024-04-03 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: hash_with_dot_access
|