lookbook 2.3.12 → 2.3.13

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.
Files changed (67) hide show
  1. checksums.yaml +4 -4
  2. data/app/components/lookbook/button/component.html.erb +11 -12
  3. data/app/components/lookbook/button/component.js +19 -31
  4. data/app/components/lookbook/button/component.rb +4 -0
  5. data/app/components/lookbook/button_group/component.html.erb +1 -1
  6. data/app/components/lookbook/code/component.html.erb +1 -1
  7. data/app/components/lookbook/copy_button/component.html.erb +1 -1
  8. data/app/components/lookbook/debug_menu/component.html.erb +1 -1
  9. data/app/components/lookbook/dimensions_display/component.html.erb +2 -2
  10. data/app/components/lookbook/display_options/editor/component.html.erb +2 -2
  11. data/app/components/lookbook/display_options/field/component.html.erb +1 -1
  12. data/app/components/lookbook/embed/component.html.erb +1 -1
  13. data/app/components/lookbook/file_source/component.html.erb +1 -1
  14. data/app/components/lookbook/icon_button/component.html.erb +2 -2
  15. data/app/components/lookbook/inspector_panel/component.html.erb +1 -1
  16. data/app/components/lookbook/logo/component.html.erb +1 -1
  17. data/app/components/lookbook/message/component.html.erb +1 -1
  18. data/app/components/lookbook/nav/component.html.erb +1 -1
  19. data/app/components/lookbook/nav/directory/component.html.erb +1 -1
  20. data/app/components/lookbook/nav/entity/component.html.erb +1 -1
  21. data/app/components/lookbook/page_tabs/component.html.erb +1 -1
  22. data/app/components/lookbook/params/editor/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/component.html.erb +1 -1
  26. data/app/components/lookbook/tab_panels/panel/component.html.erb +1 -1
  27. data/app/components/lookbook/tabs/component.html.erb +1 -1
  28. data/app/components/lookbook/tabs/dropdown_tab/component.html.erb +1 -1
  29. data/app/components/lookbook/tabs/tab/component.html.erb +1 -1
  30. data/app/components/lookbook/text_button/component.html.erb +2 -2
  31. data/app/components/lookbook/toolbar/component.html.erb +1 -1
  32. data/app/controllers/lookbook/application_controller.rb +17 -0
  33. data/app/views/layouts/lookbook/application.html.erb +3 -3
  34. data/app/views/layouts/lookbook/embed.html.erb +1 -1
  35. data/app/views/lookbook/embeds/show.html.erb +1 -1
  36. data/app/views/lookbook/errors/default.html.erb +1 -1
  37. data/app/views/lookbook/errors/not_found.html.erb +1 -1
  38. data/app/views/lookbook/index.html.erb +1 -1
  39. data/app/views/lookbook/inspector/inputs/_color.html.erb +1 -1
  40. data/app/views/lookbook/inspector/inputs/_range.html.erb +1 -1
  41. data/app/views/lookbook/inspector/inputs/_select.html.erb +1 -1
  42. data/app/views/lookbook/inspector/inputs/_text.html.erb +1 -1
  43. data/app/views/lookbook/inspector/inputs/_text_two_step.html.erb +1 -1
  44. data/app/views/lookbook/inspector/inputs/_textarea.html.erb +1 -1
  45. data/app/views/lookbook/inspector/panels/_notes.html.erb +1 -1
  46. data/app/views/lookbook/inspector/panels/_output.html.erb +1 -1
  47. data/app/views/lookbook/inspector/panels/_preview.html.erb +1 -1
  48. data/app/views/lookbook/inspector/panels/_source.html.erb +1 -1
  49. data/app/views/lookbook/inspector/show.html.erb +4 -4
  50. data/app/views/lookbook/pages/show.html.erb +1 -1
  51. data/app/views/lookbook/partials/_iframe_content_scripts.html.erb +1 -1
  52. data/app/views/lookbook/partials/_user_styles.html.erb +1 -1
  53. data/app/views/lookbook/previews/group.html.erb +1 -1
  54. data/app/views/lookbook/previews/preview.html.erb +3 -3
  55. data/app/views/lookbook/previews/show.html.erb +1 -1
  56. data/config/app.yml +0 -1
  57. data/lib/lookbook/preview_parser.rb +1 -1
  58. data/lib/lookbook/services/markdown_renderer.rb +12 -4
  59. data/lib/lookbook/version.rb +1 -1
  60. data/public/lookbook-assets/css/lookbook.css +74 -99
  61. data/public/lookbook-assets/css/lookbook.css.map +1 -1
  62. data/public/lookbook-assets/js/iframe.js +15 -6
  63. data/public/lookbook-assets/js/iframe.js.map +1 -1
  64. data/public/lookbook-assets/js/index.js +539 -399
  65. data/public/lookbook-assets/js/index.js.map +1 -1
  66. data/public/lookbook-assets/js/lookbook.js +26 -8
  67. metadata +1 -1
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 634043098ae2ae2c1e529d8ab5359e8b4894cc56679e47b71cc48da249c521ca
4
- data.tar.gz: cd679fad55997bf1fc1c0163d0b32b2511f1ce3320190976c878305913fe80b9
3
+ metadata.gz: 6690e132c2afade65dabcdd620bf4d8e67f6bfcbacd8d94ad5f156d443417eb9
4
+ data.tar.gz: fa40a220f164cef926db2e1ce4a6be8681ccac8069149b49d791e58157e1a2a8
5
5
  SHA512:
6
- metadata.gz: f0d330de3e7379c0f549b713dc61d762fc88af7a5015f57ab3fc4e71b4b74fe8ca66d506177e84d661048196ed07d12abdef2d5e087e9b54468d427356220119
7
- data.tar.gz: 37d98a9697d647294fcb4b2f8c718452b57d9a1b4d6941a32a3d8576a42e788ef673b328455cf22a8cbc4fa8afd529a6354034944c1536a9773629b61999cbf1
6
+ metadata.gz: 6590230a593eccba2833f205758255543ae6fdb4afea7ccc656909d7426a0032dc67163dfcb412c000c0d7b1fb78bc55070d4e738d05068d9bb6a21b6154166d
7
+ data.tar.gz: cb3f413449f297e41ec1a6706b11dcfb3589631a70252f4220466dcda5ade1e9ae8b909627ad923de8c9aa5471397085fcb50cbc6cacf81348cbfaf550ceaa02
@@ -1,18 +1,17 @@
1
- <%= lookbook_render button_component.new(
2
- id: id,
3
- icon: icon,
4
- **button_attrs,
5
- "x-on:keydown.esc.stop.document": "hideDropdown",
6
- "x-on:navigation:complete.window": "updateDropdown") do %>
7
- <%= content %>
8
- <% end %>
1
+ <div class="contents" key="<%= key %>">
2
+ <%= lookbook_render button_component.new(
3
+ id: id,
4
+ icon: icon,
5
+ **button_attrs,
6
+ "x-on:keydown.esc.stop.document": "hideDropdown") do %>
7
+ <%= content %>
8
+ <% end %>
9
9
 
10
- <% if dropdown? %>
11
- <% content_for :dropdowns do %>
12
- <div data-dropdown-id="<%= id %>">
10
+ <% if dropdown? %>
11
+ <div data-dropdown-id="<%= id %>" hidden>
13
12
  <div class="divide-y divide-lookbook-divider text-left">
14
13
  <%= dropdown %>
15
14
  </div>
16
15
  </div>
17
16
  <% end %>
18
- <% end %>
17
+ </div>
@@ -6,12 +6,7 @@ export default function buttonComponent() {
6
6
  let dropdown = null;
7
7
 
8
8
  return {
9
- updateAfterNavigate: true,
10
-
11
9
  init() {
12
- this.updateAfterNavigate =
13
- this.$el.dataset.updateAfterNavigate !== "false";
14
-
15
10
  if (this.$refs.tooltip) {
16
11
  tooltip = initTooltip(this, {
17
12
  target: this.$refs.icon,
@@ -19,24 +14,28 @@ export default function buttonComponent() {
19
14
  }
20
15
 
21
16
  if (this.dropdownContent) {
22
- dropdown = tippy(this.$el, {
23
- content: this.dropdownContent,
24
- trigger: "click",
25
- theme: "menu",
26
- triggerTarget: this.$el,
27
- interactive: true,
28
- zIndex: 99999,
29
- onShow: () => {
30
- if (!this.$store.settings.showTooltips) {
31
- return false;
32
- }
33
- this.$dispatch("dropdown:show", { dropdown: this });
34
- },
35
- onHide: () => this.$dispatch("dropdown:hide", { dropdown: this }),
36
- });
17
+ this.initDropdown();
37
18
  }
38
19
  },
39
20
 
21
+ initDropdown() {
22
+ dropdown = tippy(this.$el, {
23
+ content: this.dropdownContent,
24
+ trigger: "click",
25
+ theme: "menu",
26
+ triggerTarget: this.$el,
27
+ interactive: true,
28
+ zIndex: 99999,
29
+ onShow: () => {
30
+ if (!this.$store.settings.showTooltips) {
31
+ return false;
32
+ }
33
+ this.$dispatch("dropdown:show", { dropdown: this });
34
+ },
35
+ onHide: () => this.$dispatch("dropdown:hide", { dropdown: this }),
36
+ });
37
+ },
38
+
40
39
  get dropdownContent() {
41
40
  if (this.$root && this.$root.id) {
42
41
  const dropdown = document.querySelector(
@@ -53,17 +52,6 @@ export default function buttonComponent() {
53
52
  }
54
53
  },
55
54
 
56
- updateDropdown() {
57
- if (dropdown) {
58
- dropdown.hide();
59
- if (this.updateAfterNavigate) {
60
- this.$nextTick(() => {
61
- dropdown.setContent(this.dropdownContent);
62
- });
63
- }
64
- }
65
- },
66
-
67
55
  startSpin() {
68
56
  this._spinning = true;
69
57
  },
@@ -10,6 +10,10 @@ module Lookbook
10
10
  @button_attrs = html_attrs
11
11
  end
12
12
 
13
+ def key
14
+ Digest::SHA256.hexdigest(icon.to_s + dropdown.to_s + @button_attrs.to_json)
15
+ end
16
+
13
17
  def dropdown?
14
18
  dropdown.present?
15
19
  end
@@ -1,3 +1,3 @@
1
1
  <%= render_component_tag :div, class: "flex items-center" do %>
2
2
  <%= safe_join(buttons) %>
3
- <% end %>
3
+ <% end %>
@@ -8,4 +8,4 @@
8
8
  }
9
9
  ] do %>
10
10
  <%= Lookbook::CodeHighlighter.call(source, **@highlight_opts) %>
11
- <% end %>
11
+ <% end %>
@@ -8,4 +8,4 @@
8
8
  <% if content %>
9
9
  <div x-ref="copyTarget" class="hidden"><%== content %></div>
10
10
  <% end %>
11
- <% end %>
11
+ <% end %>
@@ -49,4 +49,4 @@
49
49
  <%== debug_data %>
50
50
  </div>
51
51
  <% end %>
52
- <% end %>
52
+ <% end %>
@@ -1,5 +1,5 @@
1
1
  <%= render_component_tag class: "flex items-center text-xs font-mono space-x-1 transition",
2
- ":class":"{'!opacity-100': resizing}",
2
+ "x-bind:class":"{'!opacity-100': resizing}",
3
3
  "x-on:viewport:resize-start.window": "resizing = true",
4
4
  "x-on:viewport:resize-complete.window": "resizing = false",
5
5
  "x-on:dom:update-start.window": "tearDown",
@@ -8,4 +8,4 @@
8
8
  <span x-text="`${width}px`"></span>
9
9
  <span class="opacity-70">x</span>
10
10
  <span x-text="`${height}px`"></span>
11
- <% end %>
11
+ <% end %>
@@ -1,6 +1,6 @@
1
1
  <%= render_component_tag class: "px-2" do %>
2
2
  <% if fields.many? %>
3
- <%= lookbook_render :button, id: "display-options-dropdown-button", icon: :settings, tooltip: "Display options", data: {update_after_navigate: false} do |button| %>
3
+ <%= lookbook_render :button, id: "display-options-dropdown-button", icon: :settings, tooltip: "Display options" do |button| %>
4
4
  <% button.with_dropdown do %>
5
5
  <div class="p-3 space-y-3">
6
6
  <%= safe_join(fields) %>
@@ -10,4 +10,4 @@
10
10
  <% else %>
11
11
  <%= safe_join(fields) %>
12
12
  <% end %>
13
- <% end %>
13
+ <% end %>
@@ -5,4 +5,4 @@
5
5
  </label>
6
6
  <%= select_tag(name, options_for_select(choices, value), "x-model": "value", class: "compact") %>
7
7
  </div>
8
- <% end %>
8
+ <% end %>
@@ -3,4 +3,4 @@
3
3
  preview="<%= preview_class %>"
4
4
  scenario="<%= scenario.name %>"
5
5
  <%= params_attrs_str %> panels="<%= panels.join(",") %>"
6
- actions="<%= actions.join(",") %>"></lookbook-embed>
6
+ actions="<%= actions.join(",") %>"></lookbook-embed>
@@ -6,4 +6,4 @@
6
6
  line_numbers: true do %>
7
7
  <%= trimmed_source %>
8
8
  <% end %>
9
- <% end %>
9
+ <% end %>
@@ -11,10 +11,10 @@
11
11
  disabled: disabled,
12
12
  aria: { label: tooltip } do %>
13
13
  <span x-ref="icon">
14
- <%= icons.present? ? safe_join(icons) : (lookbook_render(:icon, name: icon, size: icon_size, ":class": "{'animate-spin': _spinning}") if icon) %>
14
+ <%= icons.present? ? safe_join(icons) : (lookbook_render(:icon, name: icon, size: icon_size, "x-bind:class": "{'animate-spin': _spinning}") if icon) %>
15
15
  </span>
16
16
  <% if tooltip %>
17
17
  <label class="hidden" x-ref="tooltip"><%= tooltip %></label>
18
18
  <% end %>
19
19
  <%= content %>
20
- <% end %>
20
+ <% end %>
@@ -5,4 +5,4 @@
5
5
  <% if panel_styles %>
6
6
  <% content_for :user_styles do %><%= panel_styles %>
7
7
  <% end %>
8
- <% end %>
8
+ <% end %>
@@ -3,4 +3,4 @@
3
3
  <path d="M3.5 1H17v20H3.5A2.5 2.5 0 0 1 1 18.5v-15A2.5 2.5 0 0 1 3.5 1Z"/>
4
4
  <path d="M1.153 19.36c0-.737.261-1.188.596-1.57.417-.475.985-.79 1.751-.79H17M6.801 5.1v7.554L6.8 12.7h5.57"/>
5
5
  </g>
6
- </svg>
6
+ </svg>
@@ -23,4 +23,4 @@
23
23
  <%= lookbook_render :prose, size: :sm, content: content %>
24
24
  </div>
25
25
  </div>
26
- <% end %>
26
+ <% end %>
@@ -25,4 +25,4 @@
25
25
  </div>
26
26
  <% end %>
27
27
  </div>
28
- <% end %>
28
+ <% end %>
@@ -25,4 +25,4 @@
25
25
  <%= safe_join(children) %>
26
26
  </ul>
27
27
  <% end %>
28
- <% end %>
28
+ <% end %>
@@ -29,4 +29,4 @@
29
29
  <%= safe_join(children) %>
30
30
  </ul>
31
31
  <% end %>
32
- <% end %>
32
+ <% end %>
@@ -15,4 +15,4 @@
15
15
  <% end %>
16
16
  <% end %>
17
17
  <% end %>
18
- <% end %>
18
+ <% end %>
@@ -18,4 +18,4 @@
18
18
  <% if param_styles %>
19
19
  <% content_for :user_styles do %><%= param_styles %>
20
20
  <% end %>
21
- <% end %>
21
+ <% end %>
@@ -5,4 +5,4 @@
5
5
  prose-h1:font-bold
6
6
  " do %>
7
7
  <%== rendered_content %>
8
- <% end %>
8
+ <% end %>
@@ -10,4 +10,4 @@
10
10
  </div>
11
11
  <% end %>
12
12
  <% end %>
13
- <% end %>
13
+ <% end %>
@@ -2,4 +2,4 @@
2
2
  <div x-ref="panels" class="h-full">
3
3
  <%= safe_join(panels) %>
4
4
  </div>
5
- <% end %>
5
+ <% end %>
@@ -3,6 +3,6 @@
3
3
  "data-tab-panel": @name,
4
4
  cloak: true,
5
5
  class: "h-full",
6
- ":class": "{ hidden: !isActive($el) }" do %>
6
+ "x-bind:class": "{ hidden: !isActive($el) }" do %>
7
7
  <%== content %>
8
8
  <% end %>
@@ -17,4 +17,4 @@
17
17
  <%= safe_join(dropdown_tabs) %>
18
18
  </div>
19
19
  </div>
20
- <% end %>
20
+ <% end %>
@@ -8,7 +8,7 @@
8
8
  "py-2 text-base": @theme == :page,
9
9
  }
10
10
  ],
11
- ":class": "{
11
+ "x-bind:class": "{
12
12
  'border-lookbook-tabs-border-active': isSelected($el),
13
13
  'border-transparent text-lookbook-tabs-text hover:text-lookbook-tabs-text-hover': !isSelected($el),
14
14
  'hidden': visibleTabsCount >= #{@position}
@@ -9,7 +9,7 @@
9
9
  "px-2 text-lg relative -bottom-px": @theme == :page,
10
10
  }
11
11
  ],
12
- ":class": "{
12
+ "x-bind:class": "{
13
13
  'border-lookbook-tabs-border-active': isSelected($el),
14
14
  'border-transparent text-lookbook-tabs-text hover:text-lookbook-tabs-text-hover': !isSelected($el),
15
15
  '!text-lookbook-tabs-text-disabled': isDisabled($el),
@@ -13,7 +13,7 @@
13
13
 
14
14
  <span class="flex items-center space-x-2 justify-center">
15
15
  <span x-ref="icon">
16
- <%= icons.present? ? safe_join(icons) : (lookbook_render(:icon, name: icon, size: icon_size, ":class": "{'animate-spin': _spinning}") if icon) %>
16
+ <%= icons.present? ? safe_join(icons) : (lookbook_render(:icon, name: icon, size: icon_size, "x-bind:class": "{'animate-spin': _spinning}") if icon) %>
17
17
  </span>
18
18
  <% if content %>
19
19
  <span><%= content %></span>
@@ -23,4 +23,4 @@
23
23
  <% if tooltip %>
24
24
  <label class="hidden" x-ref="tooltip"><%= tooltip %></label>
25
25
  <% end %>
26
- <% end %>
26
+ <% end %>
@@ -2,4 +2,4 @@
2
2
  <div class="toolbar-sections flex items-stretch w-full h-10">
3
3
  <%= safe_join(sections) %>
4
4
  </div>
5
- <% end %>
5
+ <% end %>
@@ -10,6 +10,9 @@ module Lookbook
10
10
  helper Lookbook::ApplicationHelper
11
11
  helper Lookbook::UiElementsHelper
12
12
 
13
+ before_action :disable_annotations
14
+ after_action :restore_annotations
15
+
13
16
  before_action :assign_theme_overrides
14
17
  before_action :assign_instance_vars
15
18
 
@@ -37,6 +40,20 @@ module Lookbook
37
40
 
38
41
  protected
39
42
 
43
+ def disable_annotations
44
+ return unless ActionView::Base.respond_to?(:annotate_rendered_view_with_filenames)
45
+
46
+ @original_annotations_value = ActionView::Base.annotate_rendered_view_with_filenames
47
+ ActionView::Base.annotate_rendered_view_with_filenames = false
48
+ end
49
+
50
+ def restore_annotations
51
+ return if @original_annotations_value.nil?
52
+
53
+ ActionView::Base.annotate_rendered_view_with_filenames = @original_annotations_value
54
+ @original_annotations_value = nil
55
+ end
56
+
40
57
  def assign_theme_overrides
41
58
  @theme_overrides ||= Engine.theme.to_css
42
59
  end
@@ -22,10 +22,10 @@
22
22
 
23
23
  <%= lookbook_render :split_layout,
24
24
  alpine_data: "$store.layout.main",
25
- ":class": "$store.layout.mobile && '!block'" do |layout| %>
25
+ "x-bind:class": "$store.layout.mobile && '!block'" do |layout| %>
26
26
 
27
27
  <% layout.with_pane id: "app-sidebar", class: "flex flex-col bg-lookbook-sidebar-bg relative translate-x-0",
28
- ":class": "{
28
+ "x-bind:class": "{
29
29
  'transition': $store.layout.mobile,
30
30
  'translate-x-full': $store.layout.mobile && sidebarHidden,
31
31
  '!absolute right-0 bottom-0 top-[40px] h-[calc(100%_-_40px)] w-full max-w-[420px] z-[1001] border-l border-lookbook-divider': $store.layout.mobile
@@ -93,7 +93,7 @@
93
93
  <% end %>
94
94
  <% end %>
95
95
 
96
- <% layout.with_pane id: "app-main", class: "overflow-hidden h-full", ":class": "$store.layout.mobile && 'w-screen'" do %>
96
+ <% layout.with_pane id: "app-main", class: "overflow-hidden h-full", "x-bind:class": "$store.layout.mobile && 'w-screen'" do %>
97
97
  <%= content_for?(:main) ? yield(:main) : yield %>
98
98
  <% end %>
99
99
  <% end %>
@@ -31,4 +31,4 @@
31
31
  <%= yield :body %>
32
32
  <% else %>
33
33
  <%= render template: "layouts/lookbook/skeleton" %>
34
- <% end %>
34
+ <% end %>
@@ -9,4 +9,4 @@
9
9
  params: @passed_params,
10
10
  dynamic_display_options: @dynamic_display_options,
11
11
  static_display_options: @static_display_options
12
- } %>
12
+ } %>
@@ -37,4 +37,4 @@
37
37
  </div>
38
38
  </div>
39
39
  </div>
40
- </div>
40
+ </div>
@@ -7,4 +7,4 @@
7
7
  theme: :error do %>
8
8
  <%= @error.detail || "It may have been moved or deleted." %>
9
9
  <% end %>
10
- <% end %>
10
+ <% end %>
@@ -37,4 +37,4 @@ sidebar_panels_config = @config.preview_inspector.sidebar_panels.map(&:to_sym)
37
37
  <p>Select a preview from the nav to get started.</p>
38
38
  <% end %>
39
39
  <% end %>
40
- <% end %>
40
+ <% end %>
@@ -3,4 +3,4 @@
3
3
  type: "color",
4
4
  "x-on:change.stop": "",
5
5
  "x-on:blur": "value = $el.value",
6
- ) %>
6
+ ) %>
@@ -12,4 +12,4 @@
12
12
  <div class="flex-none px-2 opacity-60">
13
13
  <%= input_options[:max] %>
14
14
  </div>
15
- </div>
15
+ </div>
@@ -2,4 +2,4 @@
2
2
  options_for_select(choices || [], value),
3
3
  **input_options,
4
4
  "x-model": "value"
5
- ) %>
5
+ ) %>
@@ -2,4 +2,4 @@
2
2
  **input_options,
3
3
  type: input,
4
4
  "x-model.debounce.200ms": "value"
5
- ) %>
5
+ ) %>
@@ -16,4 +16,4 @@
16
16
  "x-show": "changed",
17
17
  "x-on:click": "applyChange" %>
18
18
  </div>
19
- </div>
19
+ </div>
@@ -2,4 +2,4 @@
2
2
  rows: 4,
3
3
  **input_options,
4
4
  "x-model.debounce.200ms": "value"
5
- ) %>
5
+ ) %>
@@ -16,4 +16,4 @@
16
16
  <%== items.any? ? items.first.notes : "<em class='opacity-50'>No notes provided.</em>" %>
17
17
  <% end %>
18
18
  </div>
19
- <% end %>
19
+ <% end %>
@@ -4,4 +4,4 @@
4
4
  <%- else -%>
5
5
  <%== scenarios.first.beautified_output -%>
6
6
  <%- end %>
7
- <% end %>
7
+ <% end %>
@@ -7,4 +7,4 @@
7
7
  class: "-inset-px relative",
8
8
  style: "width: calc(100% + 2px); height: calc(100% + 2px)"
9
9
  %>
10
- </div>
10
+ </div>
@@ -8,4 +8,4 @@
8
8
  <% scenario = scenarios.first %>
9
9
  <%= lookbook_render :code, language: scenario.source_lang[:name], line_numbers: true, full_height: true do %><%== scenario.source %><% end %>
10
10
  <% end %>
11
- </div>
11
+ </div>
@@ -2,7 +2,7 @@
2
2
  <%= lookbook_render :split_layout,
3
3
  id: "inspector",
4
4
  alpine_data: "$store.layout.inspector",
5
- ":class": "($store.inspector.drawer.hidden || #{@drawer_panels.none?}) && '!grid-rows-[1fr] !grid-cols-[1fr]'",
5
+ "x-bind:class": "($store.inspector.drawer.hidden || #{@drawer_panels.none?}) && '!grid-rows-[1fr] !grid-cols-[1fr]'",
6
6
  data: {
7
7
  "preview-target": @target.id
8
8
  } do |layout| %>
@@ -11,7 +11,7 @@
11
11
  "x-effect": "forceOrientation = (layoutWidth < $store.inspector.minVerticalSplitWidth) ? 'horizontal' : null" do %>
12
12
 
13
13
  <%= lookbook_render :toolbar, id: "main-toolbar" do |toolbar| %>
14
- <% toolbar.with_section ":class": "layoutResizing && 'overflow-hidden'" do %>
14
+ <% toolbar.with_section "x-bind:class": "layoutResizing && 'overflow-hidden'" do %>
15
15
  <%= lookbook_render :tabs, alpine_data: "$store.inspector.main", id: "inspector-tabs-main" do |tabs| %>
16
16
  <%= @main_panels.each do |panel| %>
17
17
  <% tabs.with_tab name: panel.name,
@@ -99,7 +99,7 @@
99
99
  "x-show": "!$store.inspector.drawer.hidden && #{@drawer_panels.any?}" do %>
100
100
 
101
101
  <%= lookbook_render :toolbar, id: "drawer-toolbar" do |toolbar| %>
102
- <% toolbar.with_section ":class": "layoutResizing && 'overflow-hidden'" do %>
102
+ <% toolbar.with_section "x-bind:class": "layoutResizing && 'overflow-hidden'" do %>
103
103
  <%= lookbook_render :tabs, alpine_data: "$store.inspector.drawer", id: "inspector-tabs-drawer" do |tabs| %>
104
104
  <%= @drawer_panels.each do |panel| %>
105
105
  <% tabs.with_tab name: panel.name,
@@ -133,7 +133,7 @@
133
133
  tooltip: "Pin drawer on right",
134
134
  "x-on:click": "switchOrientation",
135
135
  "x-show": "horizontal",
136
- ":class": "{'pointer-events-none opacity-50 !cursor-not-allowed': horizontal && layoutWidth <= $store.inspector.minVerticalSplitWidth}",
136
+ "x-bind:class": "{'pointer-events-none opacity-50 !cursor-not-allowed': horizontal && layoutWidth <= $store.inspector.minVerticalSplitWidth}",
137
137
  cloak: true %>
138
138
 
139
139
  <% group.with_button id: "drawer-to-bottom-button",
@@ -95,4 +95,4 @@
95
95
  </div>
96
96
  </div>
97
97
  </div>
98
- </main>
98
+ </main>
@@ -1 +1 @@
1
- <script src="<%= lookbook_asset_path("/js/iframe.js") %>" defer></script>
1
+ <script src="<%= lookbook_asset_path("/js/iframe.js") %>" defer></script>
@@ -2,4 +2,4 @@
2
2
  <style media="all" id="user-styles">
3
3
  <%= content_for :user_styles -%>
4
4
  </style>
5
- <% end %>
5
+ <% end %>
@@ -12,4 +12,4 @@
12
12
  <% else %>
13
13
  <%# Render a single scenario %>
14
14
  <%= scenarios.first.output %>
15
- <% end %>
15
+ <% end %>
@@ -1,9 +1,9 @@
1
1
  <% if @render_args[:component] %>
2
2
  <% if defined?(Phlex::SGML) && @render_args[:component].is_a?(Phlex::SGML) %>
3
- <% if defined?(Phlex::VERSION) && Gem::Version.new(Phlex::VERSION) >= Gem::Version.new("2.0.0") %>
4
- <%= raw(@render_args[:component].call(context: { rails_view_context: self }, &@render_args[:block])) %>
5
- <% else %>
3
+ <% if defined?(Phlex::VERSION) && Gem::Version.new(Phlex::VERSION) < Gem::Version.new("2.0.0") %>
6
4
  <%= raw(@render_args[:component].call(view_context: self, &@render_args[:block])) %>
5
+ <% else %>
6
+ <%= render(@render_args[:component], @render_args[:args], &@render_args[:block]) %>
7
7
  <% end %>
8
8
  <% else %>
9
9
  <%= render(@render_args[:component], @render_args[:args], &@render_args[:block]) %>
@@ -1 +1 @@
1
- <%= @preview_html %>
1
+ <%= @preview_html %>
data/config/app.yml CHANGED
@@ -41,7 +41,6 @@ shared:
41
41
  disable_indented_code_blocks: true
42
42
  strikethrough: true
43
43
  highlight: true
44
- with_toc_data: true
45
44
  lax_spacing: true
46
45
 
47
46
  highlighter_options:
@@ -6,7 +6,7 @@ module Lookbook
6
6
  @paths = paths
7
7
  @after_parse_callbacks = []
8
8
  @after_parse_once_callbacks = []
9
- @parsing = Mutex.new
9
+ @parsing = Monitor.new
10
10
 
11
11
  define_tags(tags)
12
12
  YARD::Parser::SourceParser.after_parse_list { run_callbacks }