app/components/lookbook/embed_code_dropdown/component.rb in lookbook-2.0.1 vs app/components/lookbook/embed_code_dropdown/component.rb in lookbook-2.0.2
- old
+ new
@@ -31,9 +31,18 @@
scenario: target.name,
**external_embed_params) { "" }
escape_once embed_tag
end
+ def embed_url
+ props = {
+ preview: preview_name,
+ scenario: target.name,
+ **external_embed_params.transform_keys { |k| k.tr("-", "_") }
+ }.to_json
+ "#{app_path}embed?props=#{CGI.escape(props)}"
+ end
+
private
def alpine_component
"embedCodeDropdownComponent"
end