app/components/lookbook/embed/inspector/component.html.erb in lookbook-2.0.5 vs app/components/lookbook/embed/inspector/component.html.erb in lookbook-2.1.0

- old
+ new

@@ -7,11 +7,11 @@ style: "border-top-left-radius: 6px; border-top-right-radius: 6px;" do |toolbar| %> <% toolbar.with_section padded: true do %> <h3 class="flex items-center space-x-1"> <strong class="text-lookbook-embed-title"><%= target.preview.label %></strong> <% if scenarios.many? %> - <%= select_tag("target", options_for_select(scenario_select_options, helpers.lookbook_embed_path(target.path)), "x-model": "targetPath", class: "!ml-2 compact") %> + <%= select_tag("target", options_for_select(scenario_select_options, helpers.lookbook_embed_path(target.lookup_path)), "x-model": "targetPath", class: "!ml-2 compact") %> <% else %> <span>(<%= target.label %>) </span> <% end %> </h3> <% end %> @@ -29,17 +29,17 @@ <% if actions.any? %> <% toolbar.with_section divide: :left do %> <%= lookbook_render :button_group do |group| %> <% if display_action?(:inspect) %> <% group.with_button icon: :eye, - href: helpers.lookbook_inspect_url(target.path, params), + href: helpers.lookbook_inspect_url(target.lookup_path, params), tooltip: "View in Inspector", target: "_top" %> <% end %> <% if display_action?(:open) %> <% group.with_button icon: :external_link, - href: helpers.lookbook_preview_url(target.path, params), + href: helpers.lookbook_preview_url(target.lookup_path, params), tooltip: "Open in new window", target: "_blank" %> <% end %> <% end %> <% end %> @@ -55,11 +55,11 @@ x-on:viewport:resize-progress="resizeIframe" x-on:viewport:resize-complete="resizeIframe" x-ref="viewportWrapper"> <%= lookbook_render :viewport, iframe_id: "#{id}-viewport", - src: helpers.lookbook_preview_path(target.path, request.query_parameters.merge(lookbook_timestamp: Time.now, lookbook_embed: true)), + src: helpers.lookbook_preview_path(target.lookup_path, request.query_parameters.merge(lookbook_timestamp: Time.now, lookbook_embed: true)), alpine_data: "store", resize_height: false, class: "mb-[-2px] transition-[height] duration-150", ":style": "`height: ${viewportCssHeight}`" %> @@ -78,9 +78,24 @@ <% tabs.with_tab name: panel.name, label: panel.label, hotkey: panel.hotkey, disabled: panel.disabled %> <% end %> + <% end %> + <% end %> + + <% toolbar.with_section align: :right, class: "flex-none relative z-10" do %> + <%= lookbook_render :button_group do |group| %> + <%= panels.select { |p| !p.disabled && p.copy }.each do |panel| %> + <% group.with_button id: "copy-panel-contents-button-#{panel.name}", + icon: :copy, + tooltip: "Copy panel contents", + copy: !!panel.copy, + "x-show": "store.activeTab === '#{panel.name}'", + cloak: true do %> + <%= panel.copy ? panel.copy : "" %> + <% end %> + <% end %> <% end %> <% end %> <% end %> <div class="bg-lookbook-drawer-bg">