lookbook 0.2.3 → 0.2.4

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: c35cb307d0756229c0ef4be7e46fcdaa9815abc1988d78e48390c2b7fe7b470a
4
- data.tar.gz: '01179fd9cb5d1949b04882565f5d2288f3a8575e0164dfd901951b51e7069557'
3
+ metadata.gz: f643b8df09b68fb0e91d8dd522b186d8bcb8e58fa7883841a112a82a4ec81f8d
4
+ data.tar.gz: f97771056316f5e652a9850c2ac6495fb1c934135fada28af6557c7cd602e90a
5
5
  SHA512:
6
- metadata.gz: 7ca421666db35f1c09076e4c6a0699c958ef64e9c7a35cdcc47122d734695d4df5913230860f1c1885a0b658f2274a0268e846dafce18ea27995317610be8823
7
- data.tar.gz: 2c35614a77dba59d2c4e5d3f5ab490ec44d3e3af065ba1dd5004ec0cfedcc1b8ab99fc7bacf3060efb80d50c7965c50110149967ffc189284810eb67b5e6557d
6
+ metadata.gz: a4dc35a94c6173b687c903f098b5f0c05d8025c9171efa05ed0eb24993685c8495b7497f30df0f7d4550b2609f4dcbd0263624f8b1c9a7ed740bfd66dc48d288
7
+ data.tar.gz: 1f63d7ae4b684c46f89e0bfe683dbc83e0bf5daca16ced87c6061f0e7ea8c8da0c9131de71b9fd6dad7990211108fcad25d35ff5669b31b95eac78c6db70d48b
data/README.md CHANGED
@@ -193,6 +193,18 @@ If you wish to add additional paths to listen for changes in, you can use the `l
193
193
  config.lookbook.listen_paths << Rails.root.join('app/other/directory')
194
194
  ```
195
195
 
196
+ ## Troubleshooting
197
+
198
+ #### Blank preview window
199
+
200
+ Certain setups (for example when using `Rack::LiveReload`) can cause an issue with the way that the preview iframe displays the rendered component preview (i.e. using the `srcdoc` attribute to avoid extra requests).
201
+
202
+ If you are seeing a blank preview window, but the source and output tabs are both displaying code as expected, you can disable the use of the `srcdoc` attribute using the following configuration option:
203
+
204
+ ```ruby
205
+ config.lookbook.preview_srcdoc = false
206
+ ```
207
+
196
208
  ## Contributing
197
209
 
198
210
  Lookbook is very much a small hobby/side project at the moment. I'd love to hear from anyone who is interested in contributing but I'm terrible at replying to emails or messages, so don't be surprised if I take forever to get back to you. It's not personal 😜
@@ -2,7 +2,7 @@
2
2
  <div class="h-full relative mx-auto bg-white" x-data="preview" :style="`width: ${$store.preview.width}`">
3
3
  <iframe
4
4
  src="<%= url_for lookbook.preview_path %>"
5
- srcdoc="<%== @preview_srcdoc %>"
5
+ <% if config.preview_srcdoc %>srcdoc="<%== @preview_srcdoc %>"<% end %>
6
6
  frameborder="0"
7
7
  class="h-full w-full border-l border-gray-300 pr-4 -mx-px"
8
8
  x-data="sizeObserver"
@@ -28,6 +28,7 @@ module Lookbook
28
28
  options.preview_paths += vc_options.preview_paths
29
29
 
30
30
  options.preview_controller = vc_options.preview_controller if options.preview_controller.nil?
31
+ options.preview_srcdoc = true if options.preview_srcdoc.nil?
31
32
 
32
33
  options.listen_paths = options.listen_paths.map(&:to_s)
33
34
  options.listen_paths += options.preview_paths
@@ -1,3 +1,3 @@
1
1
  module Lookbook
2
- VERSION = "0.2.3"
2
+ VERSION = "0.2.4"
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.2.3
4
+ version: 0.2.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Mark Perkins
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2021-09-06 00:00:00.000000000 Z
11
+ date: 2021-09-09 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails