lookbook 0.9.1 → 0.9.2
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 +1 -1
- data/app/views/lookbook/previews/inputs/_select.html.erb +1 -1
- data/app/views/lookbook/previews/inputs/_text.html.erb +1 -1
- data/app/views/lookbook/previews/inputs/_textarea.html.erb +1 -1
- data/app/views/lookbook/previews/inputs/_toggle.html.erb +1 -1
- data/lib/lookbook/engine.rb +4 -3
- data/lib/lookbook/markdown.rb +1 -0
- data/lib/lookbook/version.rb +1 -1
- 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: 3aef0fb4a6cbd200e129c3557e1b49188be466dcf73b0447964239f98cdb1263
|
|
4
|
+
data.tar.gz: 7a04c0d210854191cd18424aaac033201200ab3a26883a8884b6fe2646530b53
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 91397d74515100b3d1a6f465209bbaa482251275722da317dcc30306e26659aadb5e923f4d1390e60f25fe527ada10015bc7c2631a292fa8a2e33b4c4c885dad
|
|
7
|
+
data.tar.gz: '0901051f061b47bbebcd0900b976ab1a2302e867f126b587ef5ae220b2ccb68e048f90354e3830b392be61466443a6b23926382a83ba88383366d91b5d95d37b'
|
data/README.md
CHANGED
|
@@ -52,7 +52,7 @@ If you'd rather dig in a bit more and run the demo app locally, the [demo repo](
|
|
|
52
52
|
Add Lookbook to your `Gemfile` somewhere **after** the ViewComponent gem. For example:
|
|
53
53
|
|
|
54
54
|
```ruby
|
|
55
|
-
gem "view_component"
|
|
55
|
+
gem "view_component"
|
|
56
56
|
gem "lookbook"
|
|
57
57
|
```
|
|
58
58
|
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
<div x-data="param('<%= name %>', <%= value %>)" data-morph-strategy="replace">
|
|
1
|
+
<div x-data="param('<%= name %>', <%= j(value) %>)" data-morph-strategy="replace">
|
|
2
2
|
<button type="button"
|
|
3
3
|
class="relative inline-flex flex-shrink-0 h-6 w-11 border-2 border-transparent rounded-full cursor-pointer transition-colors ease-in-out duration-200 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-indigo-400"
|
|
4
4
|
:class="{'bg-indigo-500': value, 'bg-gray-300': !value}"
|
data/lib/lookbook/engine.rb
CHANGED
|
@@ -126,6 +126,7 @@ module Lookbook
|
|
|
126
126
|
|
|
127
127
|
class << self
|
|
128
128
|
def websocket
|
|
129
|
+
return @websocket unless @websocket.nil?
|
|
129
130
|
if config.lookbook.auto_refresh
|
|
130
131
|
cable = ActionCable::Server::Configuration.new
|
|
131
132
|
cable.cable = {adapter: "async"}.with_indifferent_access
|
|
@@ -136,9 +137,9 @@ module Lookbook
|
|
|
136
137
|
@websocket ||= if Rails.version.to_f >= 6.0
|
|
137
138
|
ActionCable::Server::Base.new(config: cable)
|
|
138
139
|
else
|
|
139
|
-
websocket ||= ActionCable::Server::Base.new
|
|
140
|
-
websocket.config = cable
|
|
141
|
-
websocket
|
|
140
|
+
@websocket ||= ActionCable::Server::Base.new
|
|
141
|
+
@websocket.config = cable
|
|
142
|
+
@websocket
|
|
142
143
|
end
|
|
143
144
|
end
|
|
144
145
|
end
|
data/lib/lookbook/markdown.rb
CHANGED
|
@@ -12,6 +12,7 @@ module Lookbook
|
|
|
12
12
|
}
|
|
13
13
|
|
|
14
14
|
def self.render(text)
|
|
15
|
+
text&.gsub!("<!-- BEGIN inline template -->", "")&.gsub!("<!-- END inline template -->", "")
|
|
15
16
|
markdown = Redcarpet::Markdown.new(Renderer, Lookbook.config.markdown_options)
|
|
16
17
|
markdown.render(text).html_safe
|
|
17
18
|
end
|
data/lib/lookbook/version.rb
CHANGED
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: lookbook
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.9.
|
|
4
|
+
version: 0.9.2
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Mark Perkins
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: bin
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2022-
|
|
11
|
+
date: 2022-07-19 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: actioncable
|