lookbook 0.9.1 → 0.9.2

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: e7dfafad463df617a30ac6baff60536568771276737340b18f094bb4ad29b90a
4
- data.tar.gz: 24221d0a990d8181f7fec06bd2acc24d21599b33778b25591054a1d279317d6c
3
+ metadata.gz: 3aef0fb4a6cbd200e129c3557e1b49188be466dcf73b0447964239f98cdb1263
4
+ data.tar.gz: 7a04c0d210854191cd18424aaac033201200ab3a26883a8884b6fe2646530b53
5
5
  SHA512:
6
- metadata.gz: a84d78ab4e4bd953f0f3b012a6cf8056efe57f37656ed9ba9839ed99c65cf824a510b1286eede9a4b3640cd9ee25575f0c58fd6998752169303fa5a29df10ec8
7
- data.tar.gz: 0d516c5a151d34929594abb832827783fa8ceba7a95c2bbea7113a094a1320a5e8b394cab441f551cf6f9d0d4c715a72f00d14a414684e6995362344bc19de08
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", require: "view_component/engine"
55
+ gem "view_component"
56
56
  gem "lookbook"
57
57
  ```
58
58
 
@@ -2,6 +2,6 @@
2
2
  name="<%= name %>"
3
3
  class="form-input"
4
4
  x-model="value"
5
- x-data="param('<%= name %>', '<%= value %>')">
5
+ x-data="param('<%= name %>', '<%= j(value) %>')">
6
6
  <%= options_for_select(options, value) %>
7
7
  </select>
@@ -3,6 +3,6 @@
3
3
  type="<%= input_type %>"
4
4
  name="<%= name %>"
5
5
  value="<%= value %>"
6
- x-data="param('<%= name %>', '<%= value %>', {debounce: 300})"
6
+ x-data="param('<%= name %>', '<%= j(value) %>', {debounce: 300})"
7
7
  x-model="value"
8
8
  @keyup.stop>
@@ -4,5 +4,5 @@
4
4
  rows="4"
5
5
  @keyup.stop
6
6
  x-model="value"
7
- x-data="param('<%= name %>', '<%= value %>', {debounce: 300})"
7
+ x-data="param('<%= name %>', '<%= j(value) %>', {debounce: 300})"
8
8
  ><%= value %></textarea>
@@ -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}"
@@ -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
@@ -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
@@ -1,3 +1,3 @@
1
1
  module Lookbook
2
- VERSION = "0.9.1"
2
+ VERSION = "0.9.2"
3
3
  end
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.1
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-06-29 00:00:00.000000000 Z
11
+ date: 2022-07-19 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: actioncable