lookbook 1.0.0.beta.3 → 1.0.0.beta.6

Sign up to get free protection for your applications and to get access to all the features.
Files changed (68) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +27 -254
  3. data/app/assets/lookbook/css/lookbook.css +1 -1
  4. data/app/assets/lookbook/css/themes/blue.css +57 -36
  5. data/app/assets/lookbook/css/themes/indigo.css +57 -36
  6. data/app/assets/lookbook/css/themes/zinc.css +57 -36
  7. data/app/assets/lookbook/css/tooltip.css +5 -5
  8. data/app/components/lookbook/base_component.rb +6 -4
  9. data/app/components/lookbook/button/component.html.erb +2 -2
  10. data/app/components/lookbook/copy_button/component.html.erb +3 -3
  11. data/app/components/lookbook/embed/component.html.erb +33 -33
  12. data/app/components/lookbook/embed/component.rb +8 -0
  13. data/app/components/lookbook/filter/component.html.erb +1 -1
  14. data/app/components/lookbook/header/component.html.erb +4 -4
  15. data/app/components/lookbook/header/component.rb +5 -0
  16. data/app/components/lookbook/inspector_panel/component.html.erb +4 -0
  17. data/app/components/lookbook/inspector_panel/component.rb +36 -0
  18. data/app/components/lookbook/nav/component.html.erb +4 -8
  19. data/app/components/lookbook/nav/component.rb +5 -7
  20. data/app/components/lookbook/nav/item/component.html.erb +12 -6
  21. data/app/components/lookbook/nav/item/component.rb +9 -2
  22. data/app/components/lookbook/page_tabs/component.html.erb +1 -1
  23. data/app/components/lookbook/prose/component.html.erb +1 -1
  24. data/app/components/lookbook/split_layout/component.html.erb +1 -1
  25. data/app/components/lookbook/tab_panels/panel/component.html.erb +2 -2
  26. data/app/components/lookbook/tabs/component.html.erb +2 -2
  27. data/app/components/lookbook/tabs/dropdown_tab/component.html.erb +2 -2
  28. data/app/components/lookbook/tabs/tab/component.html.erb +2 -2
  29. data/app/components/lookbook/tag_component.rb +5 -10
  30. data/app/components/lookbook/toolbar/component.html.erb +1 -1
  31. data/app/components/lookbook/viewport/component.css +1 -1
  32. data/app/components/lookbook/viewport/component.html.erb +1 -1
  33. data/app/controllers/lookbook/application_controller.rb +1 -1
  34. data/app/controllers/lookbook/pages_controller.rb +1 -0
  35. data/app/controllers/lookbook/previews_controller.rb +15 -3
  36. data/app/helpers/lookbook/application_helper.rb +0 -6
  37. data/app/helpers/lookbook/preview_helper.rb +2 -3
  38. data/app/views/layouts/lookbook/application.html.erb +76 -58
  39. data/app/views/layouts/lookbook/page.html.erb +36 -36
  40. data/app/views/layouts/lookbook/shell.html.erb +8 -48
  41. data/app/views/layouts/lookbook/skeleton.html.erb +0 -6
  42. data/app/views/lookbook/index.html.erb +24 -11
  43. data/app/views/lookbook/pages/show.html.erb +5 -5
  44. data/app/views/lookbook/previews/panels/_content.html.erb +1 -1
  45. data/app/views/lookbook/previews/panels/_notes.html.erb +2 -2
  46. data/app/views/lookbook/previews/panels/_params.html.erb +1 -1
  47. data/app/views/lookbook/previews/show.html.erb +12 -10
  48. data/lib/lookbook/config.rb +107 -74
  49. data/lib/lookbook/engine.rb +24 -6
  50. data/lib/lookbook/markdown.rb +3 -1
  51. data/lib/lookbook/page.rb +4 -0
  52. data/lib/lookbook/params.rb +12 -0
  53. data/lib/lookbook/preview.rb +35 -5
  54. data/lib/lookbook/store.rb +8 -0
  55. data/lib/lookbook/version.rb +1 -1
  56. data/lib/tasks/lookbook_tasks.rake +1 -1
  57. data/public/lookbook-assets/css/lookbook.css +330 -182
  58. data/public/lookbook-assets/css/lookbook.css.map +1 -1
  59. data/public/lookbook-assets/css/themes/blue.css +57 -36
  60. data/public/lookbook-assets/css/themes/blue.css.map +1 -1
  61. data/public/lookbook-assets/css/themes/indigo.css +57 -36
  62. data/public/lookbook-assets/css/themes/indigo.css.map +1 -1
  63. data/public/lookbook-assets/css/themes/zinc.css +57 -36
  64. data/public/lookbook-assets/css/themes/zinc.css.map +1 -1
  65. data/public/lookbook-assets/js/embed.js +193 -193
  66. data/public/lookbook-assets/js/lookbook.js +1179 -1336
  67. data/public/lookbook-assets/js/lookbook.js.map +1 -1
  68. metadata +6 -4
@@ -1,76 +1,94 @@
1
1
  <% content_for :shell do %>
2
- <%= render_component :split_layout,
3
- alpine_data: "$store.layout.main",
4
- ":class": "$store.layout.mobile && '!block'" do |layout| %>
2
+ <% if Lookbook.previews? || Lookbook.pages? %>
3
+ <%= render_component :split_layout,
4
+ alpine_data: "$store.layout.main",
5
+ ":class": "$store.layout.mobile && '!block'" do |layout| %>
5
6
 
6
- <% layout.pane class: "flex flex-col bg-lookbook-sidebar relative translate-x-0",
7
- ":class": "{
8
- 'transition': $store.layout.mobile,
9
- 'translate-x-full': $store.layout.mobile && sidebarHidden,
10
- '!absolute right-0 bottom-0 top-[40px] h-[calc(100%_-_40px)] w-full max-w-[420px] z-50 border-l border-lookbook-divider': $store.layout.mobile
11
- }",
12
- "@click.outside": "closeMobileSidebar",
13
- x_cloak: true do %>
7
+ <% layout.pane id: "app-sidebar", class: "flex flex-col bg-lookbook-sidebar-bg relative translate-x-0",
8
+ ":class": "{
9
+ 'transition': $store.layout.mobile,
10
+ 'translate-x-full': $store.layout.mobile && sidebarHidden,
11
+ '!absolute right-0 bottom-0 top-[40px] h-[calc(100%_-_40px)] w-full max-w-[420px] z-50 border-l border-lookbook-divider': $store.layout.mobile
12
+ }",
13
+ "@click.outside": "closeMobileSidebar",
14
+ cloak: true do %>
14
15
 
15
- <%= render_component :split_layout,
16
- alpine_data: "$store.layout.#{Lookbook.pages.any? ? "sidebar" : "singleSectionSidebar"}",
17
- style: "height: calc(100vh - 2.5rem);" do |layout| %>
18
- <% layout.pane class: "overflow-hidden" do %>
19
- <%= render_component :nav,
20
- collection: Lookbook.previews,
21
- alpine_data: "$store.nav.previews",
22
- label: "Previews",
23
- collapse_singles: true do |nav| %>
24
- <% nav.filter store: "$store.nav.previews.filter", placeholder: "Filter by preview name&hellip;" %>
16
+ <%= render_component :split_layout,
17
+ alpine_data: "$store.layout.#{Lookbook.pages? && Lookbook.previews? ? "sidebar" : "singleSectionSidebar"}",
18
+ style: "height: calc(100vh - 2.5rem);" do |layout| %>
19
+
20
+ <% if Lookbook.previews? %>
21
+ <% layout.pane class: "overflow-hidden" do %>
22
+ <%= render_component :nav,
23
+ id: "previews-nav",
24
+ collection: Lookbook.previews,
25
+ alpine_data: "$store.nav.previews",
26
+ collapse_singles: true do |nav| %>
27
+ <%= nav.toolbar do |toolbar| %>
28
+ <% toolbar.section padded: true do %>
29
+ <h4 class="pt-1">Previews</h4>
30
+ <% end %>
31
+ <% end %>
32
+ <% nav.filter store: "$store.nav.previews.filter", placeholder: "Filter previews by name&hellip;" %>
33
+ <% end %>
34
+ <% end %>
25
35
  <% end %>
26
- <% end %>
27
36
 
28
- <% if Lookbook.pages.any? %>
29
- <% layout.pane class: "overflow-hidden" do %>
30
- <%= render_component :nav,
31
- collection: Lookbook.pages,
32
- alpine_data: "$store.nav.pages",
33
- label: "Pages" %>
37
+ <% if Lookbook.pages? %>
38
+ <% layout.pane class: "overflow-hidden" do %>
39
+ <%= render_component :nav,
40
+ id: "pages-nav",
41
+ collection: Lookbook.pages,
42
+ alpine_data: "$store.nav.pages" do |nav| %>
43
+ <%= nav.toolbar do |toolbar| %>
44
+ <% toolbar.section padded: true do %>
45
+ <h4 class="pt-1">Pages</h4>
46
+ <% end %>
47
+ <% end %>
48
+ <% end %>
49
+ <% end %>
34
50
  <% end %>
35
51
  <% end %>
36
52
 
37
- <% end %>
38
-
39
- <% if Lookbook::Preview.errors.any? %>
40
- <div x-data="{hidden: false}" class="flex-none border-t border-lookbook-divider absolute bottom-0 left-0 right-0" x-show="!hidden">
41
- <%= render_component :toolbar do |toolbar| %>
42
- <% toolbar.section padded: true, class: "flex items-center" do %>
43
- <%= icon :alert_triangle, size: 4, class: "text-red-700" %>
44
- <span class="ml-2">Preview load errors</span>
45
- <% end %>
46
- <% toolbar.section align: :right do %>
47
- <% render_component :button, icon: :x, "@click": "hidden = !hidden" %>
53
+ <% if Lookbook::Preview.errors.any? %>
54
+ <div x-data="{hidden: false}" class="flex-none border-t border-lookbook-divider absolute bottom-0 left-0 right-0" x-show="!hidden">
55
+ <%= render_component :toolbar do |toolbar| %>
56
+ <% toolbar.section padded: true, class: "flex items-center" do %>
57
+ <%= icon :alert_triangle, size: 4, class: "text-red-700" %>
58
+ <span class="ml-2">Preview load errors</span>
59
+ <% end %>
60
+ <% toolbar.section align: :right do %>
61
+ <% render_component :button, icon: :x, "@click": "hidden = !hidden" %>
62
+ <% end %>
48
63
  <% end %>
49
- <% end %>
50
64
 
51
- <div class="h-full max-h-[300px] overflow-hidden">
52
- <div class="bg-red-50 w-full overflow-auto h-full">
53
- <ul class="text-sm divide-y divide-red-200">
54
- <% Lookbook::Preview.errors.each do |error| %>
55
- <% error = error.is_a?(Lookbook::Error) ? error : Lookbook::Error.new(error) %>
56
- <li class="px-4 py-3">
57
- <h4 class="break-all leading-tight text-xs ">
58
- <%= error.file_name %><%= ":#{error.line_number}" if error.line_number %>
59
- </h4>
60
- <pre class="text-red-800 text-xs mt-2 whitespace-pre-wrap opacity-80 font-mono"><%= error.message %></pre>
61
- </li>
62
- <% end %>
63
- </ul>
65
+ <div class="h-full max-h-[300px] overflow-hidden">
66
+ <div class="bg-red-50 w-full overflow-auto h-full">
67
+ <ul class="text-sm divide-y divide-red-200">
68
+ <% Lookbook::Preview.errors.each do |error| %>
69
+ <% error = error.is_a?(Lookbook::Error) ? error : Lookbook::Error.new(error) %>
70
+ <li class="px-4 py-3">
71
+ <h4 class="break-all leading-tight text-xs ">
72
+ <%= error.file_name %><%= ":#{error.line_number}" if error.line_number %>
73
+ </h4>
74
+ <pre class="text-red-800 text-xs mt-2 whitespace-pre-wrap opacity-80 font-mono"><%= error.message %></pre>
75
+ </li>
76
+ <% end %>
77
+ </ul>
78
+ </div>
64
79
  </div>
65
80
  </div>
66
- </div>
81
+ <% end %>
67
82
  <% end %>
68
- <% end %>
69
83
 
70
- <% layout.pane class: "overflow-hidden", ":class": "$store.layout.mobile && 'w-screen'" do %>
71
- <%= content_for?(:main) ? yield(:main) : yield %>
84
+ <% layout.pane id: "app-main", class: "overflow-hidden h-full", ":class": "$store.layout.mobile && 'w-screen'" do %>
85
+ <%= content_for?(:main) ? yield(:main) : yield %>
86
+ <% end %>
72
87
  <% end %>
73
-
88
+ <% else %>
89
+ <div id="app-main" class="w-screen h-full overflow-hidden">
90
+ <%= content_for?(:main) ? yield(:main) : yield %>
91
+ </div>
74
92
  <% end %>
75
93
  <div class="absolute opacity-0 bg-black inset-0 top-[39px] z-[-1] transition-opacity" :class="($store.layout.mobile && !sidebarHidden) && '!opacity-30 !z-40'" data-cloak></div>
76
94
  <% end %>
@@ -4,45 +4,45 @@
4
4
  x-data="{}"
5
5
  @navigation:complete.window="$refs.scroller.scrollTop = 0">
6
6
 
7
- <div class="h-full bg-lookbook-page relative">
8
- <% unless @error %>
9
-
10
- <div class="absolute top-0 right-0 pt-1 pr-0 pl-1 pb-1 rounded-bl-md">
11
- <div class="bg-lookbook-page opacity-90 absolute inset-0 w-full h-full z-0"></div>
12
- <div class="relative z-10 flex items-center">
7
+ <div class="h-full bg-lookbook-page-bg relative">
8
+ <% unless @error %>
13
9
 
14
- <% if @previous_page %>
15
- <%= render_component :button,
16
- size: :lg,
17
- icon: :chevron_left,
18
- tooltip: "Previous page",
19
- href: lookbook_page_path(@previous_page.lookup_path),
20
- class: "pr-0.5 bg-transparent" %>
21
- <% else %>
22
- <%= render_component :button,
23
- size: :lg,
24
- icon: :chevron_left,
25
- disabled: true,
26
- class: "opacity-50 !cursor-default pr-0.5 bg-transparent" %>
27
- <% end %>
10
+ <div class="absolute top-0 right-0 pt-1 pr-0 pl-1 pb-1 rounded-bl-md">
11
+ <div class="bg-lookbook-page-bg opacity-90 absolute inset-0 w-full h-full z-0"></div>
12
+ <div class="relative z-10 flex items-center">
13
+
14
+ <% if @previous_page %>
15
+ <%= render_component :button,
16
+ size: :lg,
17
+ icon: :chevron_left,
18
+ tooltip: "Previous page",
19
+ href: lookbook_page_path(@previous_page.lookup_path),
20
+ class: "pr-0.5 bg-transparent" %>
21
+ <% else %>
22
+ <%= render_component :button,
23
+ size: :lg,
24
+ icon: :chevron_left,
25
+ disabled: true,
26
+ class: "opacity-50 !cursor-default pr-0.5 bg-transparent" %>
27
+ <% end %>
28
28
 
29
- <% if @next_page %>
30
- <%= render_component :button,
31
- size: :lg,
32
- icon: :chevron_right,
33
- tooltip: "Next page",
34
- href: lookbook_page_path(@next_page.lookup_path),
35
- class: "pl-0.5 bg-transparent" %>
36
- <% else %>
37
- <%= render_component :button,
38
- size: :lg,
39
- icon: :chevron_right,
40
- disabled: true,
41
- class: "opacity-50 !cursor-default pl-0.5 bg-transparent" %>
42
- <% end %>
29
+ <% if @next_page %>
30
+ <%= render_component :button,
31
+ size: :lg,
32
+ icon: :chevron_right,
33
+ tooltip: "Next page",
34
+ href: lookbook_page_path(@next_page.lookup_path),
35
+ class: "pl-0.5 bg-transparent" %>
36
+ <% else %>
37
+ <%= render_component :button,
38
+ size: :lg,
39
+ icon: :chevron_right,
40
+ disabled: true,
41
+ class: "opacity-50 !cursor-default pl-0.5 bg-transparent" %>
42
+ <% end %>
43
+ </div>
43
44
  </div>
44
- </div>
45
- <% end %>
45
+ <% end %>
46
46
 
47
47
  <%= yield %>
48
48
  </div>
@@ -7,58 +7,18 @@
7
7
  @navigation:start="closeMobileSidebar"
8
8
  class="w-screen h-screen grid grid-rows-[40px_1fr] relative">
9
9
 
10
- <%= render_component :header do |header| %>
11
- <% header.branding { config.project_name } %>
10
+ <% if content_for? :panel_css %>
11
+ <style media="all" id="panel-styles">
12
+ <%= content_for :panel_css -%>
13
+ </style>
12
14
  <% end %>
13
15
 
14
- <% if false %>
15
- <%= render_component :toolbar, class: "group !bg-lookbook-header !text-lookbook-header-text" do |toolbar| %>
16
- <% toolbar.section padded: true do %>
17
- <%= render_component :branding,
18
- text: config.project_name,
19
- href: landing_path if config.project_name %>
20
- <% end %>
21
- <% toolbar.section padded: false, align: :right, class: "flex items-center" do %>
22
- <%= render_component :button_group, class: "relative -top-px" do |group| %>
23
- <% if Rails.env == "development" %>
24
- <% group.button icon: :help_circle, class: "opacity-50 hover:opacity-100 transition !text-lookbook-header-text" do |button| %>
25
- <% button.dropdown do %>
26
- <%= tag.div class: "divide-y divide-lookbook-divider" do %>
27
- <div class="flex items-center text-xs px-3 py-2">
28
- <span class="opacity-60 mr-1">Lookbook</span>
29
- <span class="mr-6">v<%= Lookbook::VERSION %></span>
30
- <a href="https://github.com/allmarkedup/lookbook" target="_blank" class="ml-auto opacity-70">
31
- <%= icon :github, size: 3 %>
32
- </a>
33
- </div>
34
- <div class="px-3 py-2">
35
- <a href="#"
36
- class="text-xs underline"
37
- @click.stop="localStorage.clear(); window.location.reload();">
38
- Clear local storage
39
- </a>
40
- </div>
41
- <% end %>
42
- <% end %>
43
- <% end %>
44
- <% end %>
45
- <% group.button icon: :menu,
46
- "@click.stop": "toggleSidebar",
47
- x_show: "$store.layout.mobile && sidebarHidden",
48
- class: "!text-lookbook-header-text" %>
49
- <% group.button icon: :x,
50
- "@click.stop": "toggleSidebar",
51
- x_show: "$store.layout.mobile && !sidebarHidden",
52
- "@keydown.esc.window": "closeMobileSidebar",
53
- class: "!text-lookbook-header-text" %>
54
- <% end %>
55
- <% end %>
56
- <% end %>
16
+ <%= render_component :header, id: "app-header", debug_menu: config.debug_menu do |header| %>
17
+ <% header.branding { config.project_name } %>
57
18
  <% end %>
58
-
19
+
59
20
  <%= content_for?(:shell) ? yield(:shell) : yield %>
60
21
  </div>
61
22
  <% end %>
62
23
 
63
- <%= render template: "layouts/lookbook/skeleton" %>
64
- 0
24
+ <%= render template: "layouts/lookbook/skeleton" %>
@@ -13,12 +13,6 @@
13
13
  </style>
14
14
  <% end %>
15
15
 
16
- <% if content_for? :styles %>
17
- <style media="all">
18
- <%= content_for :styles %>
19
- </style>
20
- <% end %>
21
-
22
16
  <% if config.ui_favicon != false %>
23
17
  <link rel="icon" href="<%= config.ui_favicon || "data:image/svg+xml,<svg xmlns=%22http://www.w3.org/2000/svg%22 viewBox=%220 0 100 100%22><text y=%22.9em%22 font-size=%2290%22>👀</text></svg>" %>">
24
18
  <% end %>
@@ -1,14 +1,27 @@
1
- <div id="welcome-message" class="flex flex-col h-full w-full">
2
- <div class="flex flex-col items-center justify-center h-full">
3
- <div class="p-4 text-center mx-auto">
4
- <%= icon :layers, size: 10, class: "opacity-30 mx-auto" %>
5
- <div class="mt-6 text-base opacity-40">
6
- <% if Lookbook.previews.any? %>
7
- <h5>Select a preview to get started</h5>
8
- <% else %>
9
- <p>Create a <a href="https://viewcomponent.org/guide/previews.html" target="_blank">preview file</a> to get started.</p>
10
- <% end %>
1
+ <div id="landing" class="flex flex-col items-center justify-center h-full w-full">
2
+ <div class="p-4 text-center mx-auto">
3
+ <% if Lookbook.previews? %>
4
+ <div id="landing-with-content">
5
+ <h5 class="text-lg opacity-50"><%= config.project_name %></h5>
6
+ <div class="mt-2 italic opacity-30 max-w-[400px]">
7
+ <p>
8
+ Select a preview from the nav to get started.
9
+ </p>
10
+ </div>
11
11
  </div>
12
- </div>
12
+ <% else %>
13
+ <div id="landing-no-content">
14
+ <h5 class="text-lg font-bold opacity-80"><%= config.project_name %></h5>
15
+ <div class="mt-3 italic opacity-40 max-w-[400px]">
16
+ <p>
17
+ Nothing here yet!
18
+ <a class="underline" href="https://viewcomponent.org/guide/previews.html" target="_blank">
19
+ Create a preview
20
+ </a>
21
+ to get started.
22
+ </p>
23
+ </div>
24
+ </div>
25
+ <% end %>
13
26
  </div>
14
27
  </div>
@@ -1,17 +1,17 @@
1
1
  <div class="px-4 md:px-10 pt-8 md:pt-10 overflow-auto scroll-smooth w-full max-h-full pb-12" x-ref="scroller">
2
- <div class="w-full max-w-3xl mx-auto h-full flex flex-col">
2
+ <div class="w-full max-w-screen-lg mx-auto h-full flex flex-col">
3
3
  <% if @page.header? %>
4
- <header class="mb-8 prose max-w-none flex-none">
4
+ <header id="page-header" class="mb-8 prose max-w-none flex-none">
5
5
  <h1><%= @page.title %></h1>
6
6
  </header>
7
7
  <% end %>
8
8
 
9
- <%= render_component :prose, markdown: false, class: "max-w-none flex-none" do %>
9
+ <%= render_component :prose, id: "page-content", markdown: false, class: "max-w-none flex-none" do %>
10
10
  <%= @page_content %>
11
11
  <% end %>
12
12
 
13
13
  <% if @page.sections.any? %>
14
- <%= render_component :page_tabs, markdown: false, class: "mt-6" do |page_tabs| %>
14
+ <%= render_component :page_tabs, id: "page-tabbed-sections", markdown: false, class: "mt-6" do |page_tabs| %>
15
15
  <% @page.sections.each do |section| %>
16
16
  <% page_tabs.tab name: "page-section-#{section.name}", label: section.label do %>
17
17
  <%= page_controller.render_page(section) %>
@@ -21,7 +21,7 @@
21
21
  <% end %>
22
22
 
23
23
  <% if @page.footer? && @pages.many? %>
24
- <footer class="flex items-center justify-between border-t border-gray-300 mt-12 pt-8 pb-10 ">
24
+ <footer id="page-footer" class="flex items-center justify-between border-t border-gray-300 mt-12 pt-8 pb-10 ">
25
25
  <% if @previous_page %>
26
26
  <a href="<%= lookbook_page_path @previous_page.lookup_path %>"
27
27
  class="flex items-center flex-none">
@@ -1,4 +1,4 @@
1
- <div class="p-4 bg-lookbook-prose h-full">
1
+ <div class="p-4 bg-lookbook-prose-bg h-full">
2
2
  <% if panel.content.present? %>
3
3
  <%= render_component :prose, markdown: true do %>
4
4
  <%== panel.content %>
@@ -1,6 +1,6 @@
1
1
  <% items = examples.select { |example| example.notes.present? } %>
2
2
  <% if items.many? %>
3
- <div class="divide-y divide-dashed divide-lookbook-divider bg-lookbook-prose h-full w-full">
3
+ <div class="divide-y divide-dashed divide-lookbook-divider bg-lookbook-prose-bg h-full w-full">
4
4
  <% items.each do |item| %>
5
5
  <div class="px-4 py-6 relative">
6
6
  <h6 class="italic font-mono mb-4 opacity-40">
@@ -11,7 +11,7 @@
11
11
  <% end %>
12
12
  </div>
13
13
  <% else %>
14
- <div class="p-4 bg-lookbook-prose w-full h-full">
14
+ <div class="p-4 bg-lookbook-prose-bg w-full h-full">
15
15
  <%= render_component :prose do %>
16
16
  <%== items.any? ? items.first.notes : "<em class='opacity-50'>No notes provided.</em>" %>
17
17
  <% end %>
@@ -1,5 +1,5 @@
1
1
  <% if preview.params.none? %>
2
- <div class="p-4 w-full h-full bg-lookbook-prose">
2
+ <div class="p-4 w-full h-full bg-lookbook-prose-bg">
3
3
  <%= render_component :prose do %>
4
4
  <em class='opacity-50'>No params configured.</em>
5
5
  <% end %>
@@ -3,7 +3,7 @@
3
3
  ":class": "($store.inspector.drawer.hidden || #{@drawer_panels.none?}) && '!grid-rows-[1fr] !grid-cols-[1fr]'" do |layout| %>
4
4
 
5
5
  <%= layout.pane class: "flex flex-col h-full overflow-hidden",
6
- x_effect: "forceOrientation = (layoutWidth < $store.inspector.minVerticalSplitWidth) ? 'horizontal' : null" do %>
6
+ "x-effect": "forceOrientation = (layoutWidth < $store.inspector.minVerticalSplitWidth) ? 'horizontal' : null" do %>
7
7
 
8
8
  <%= render_component :toolbar do |toolbar| %>
9
9
  <% toolbar.section ":class": "layoutResizing && 'overflow-hidden'" do %>
@@ -38,7 +38,7 @@
38
38
  "@click.stop": "startSpin(); $dispatch('viewport:reload'); stopSpin(500);" %>
39
39
 
40
40
  <% group.button icon: :external_link,
41
- href: lookbook_preview_path(@example.lookup_path),
41
+ href: lookbook_preview_path(@example.lookup_path, request.query_parameters),
42
42
  tooltip: "Open preview in new window",
43
43
  target: "_blank" %>
44
44
 
@@ -46,7 +46,7 @@
46
46
  tooltip: "Show drawer",
47
47
  "@click": "$store.inspector.drawer.hidden = false",
48
48
  class: "rotate-180",
49
- x_show: "$store.inspector.drawer.hidden",
49
+ "x-show": "$store.inspector.drawer.hidden",
50
50
  cloak: true %>
51
51
  <% end %>
52
52
  <% end %>
@@ -63,8 +63,8 @@
63
63
  </div>
64
64
  <% end %>
65
65
 
66
- <%= layout.pane class: "flex flex-col h-full overflow-hidden bg-lookbook-drawer",
67
- x_show: "!$store.inspector.drawer.hidden && #{@drawer_panels.any?}" do %>
66
+ <%= layout.pane class: "flex flex-col h-full overflow-hidden bg-lookbook-drawer-bg",
67
+ "x-show": "!$store.inspector.drawer.hidden && #{@drawer_panels.any?}" do %>
68
68
 
69
69
  <%= render_component :toolbar do |toolbar| %>
70
70
  <% toolbar.section ":class": "layoutResizing && 'overflow-hidden'" do %>
@@ -84,7 +84,7 @@
84
84
  <% group.button icon: :copy,
85
85
  tooltip: "Copy panel contents",
86
86
  copy: !!panel.copy,
87
- x_show: "$store.inspector.drawer.activeTab === '#{panel.name}'",
87
+ "x-show": "$store.inspector.drawer.activeTab === '#{panel.name}'",
88
88
  cloak: true do %>
89
89
  <%== panel.copy ? panel.copy : "" %>
90
90
  <% end %>
@@ -98,18 +98,18 @@
98
98
  <% group.button icon: :corner_up_right,
99
99
  tooltip: "Move drawer to right",
100
100
  "@click": "switchOrientation",
101
- x_show: "horizontal && layoutWidth > $store.inspector.minVerticalSplitWidth",
101
+ "x-show": "horizontal && layoutWidth > $store.inspector.minVerticalSplitWidth",
102
102
  cloak: true %>
103
103
 
104
104
  <% group.button icon: :corner_up_right,
105
- x_show: "horizontal && layoutWidth <= $store.inspector.minVerticalSplitWidth",
105
+ "x-show": "horizontal && layoutWidth <= $store.inspector.minVerticalSplitWidth",
106
106
  disabled: true,
107
107
  cloak: true %>
108
108
 
109
109
  <% group.button icon: :corner_left_down,
110
110
  tooltip: "Move drawer to bottom",
111
111
  "@click": "switchOrientation",
112
- x_show: "vertical",
112
+ "x-show": "vertical",
113
113
  cloak: true %>
114
114
 
115
115
  <% group.button icon: :x_circle,
@@ -124,7 +124,9 @@
124
124
  <%= render_component :tab_panels, alpine_data: "$store.inspector.drawer" do |tabs| %>
125
125
  <% @drawer_panels.each do |panel| %>
126
126
  <% tabs.panel id: panel.id, name: panel.name, class: [panel.panel_classes, { "p-4": panel.padded, "prose": panel.prose }] do %>
127
- <%= render panel.partial, **@inspector_data, panel: panel, **panel.locals %>
127
+ <%= render_component :inspector_panel, **panel.slice(:id, :name, :system) do %>
128
+ <%= render panel.partial, **@inspector_data, panel: panel, **panel.locals %>
129
+ <% end %>
128
130
  <% end %>
129
131
  <% end %>
130
132
  <% end %>