Sha256: e3294c6efa28a04c825bd0b603a38e8e0f1c8da266990e34dfa913a929ec0064

Contents?: true

Size: 447 Bytes

Versions: 40

Compression:

Stored size: 447 Bytes

Contents

module Lookbook
  class InspectorPanel::Component < Lookbook::BaseComponent
    attr_reader :panel_styles, :panel_html

    def initialize(name:, **attrs)
      @name = name
      super(**attrs)
    end

    def id
      Utils.id("panel", @name)
    end

    def before_render
      styles, html = StylesExtractor.call(content)
      @panel_styles = styles.map { |s| "##{id} #{s}" }.join("\n")
      @panel_html = html.html_safe
    end
  end
end

Version data entries

40 entries across 40 versions & 1 rubygems

Version Path
lookbook-2.0.0.beta.9 app/components/lookbook/inspector_panel/component.rb
lookbook-2.0.0.beta.8 app/components/lookbook/inspector_panel/component.rb
lookbook-2.0.0.beta.7 app/components/lookbook/inspector_panel/component.rb
lookbook-2.0.0.beta.6 app/components/lookbook/inspector_panel/component.rb
lookbook-2.0.0.beta.5 app/components/lookbook/inspector_panel/component.rb
lookbook-2.0.0.beta.4 app/components/lookbook/inspector_panel/component.rb
lookbook-2.0.0.beta.3 app/components/lookbook/inspector_panel/component.rb
lookbook-2.0.0.beta.2 app/components/lookbook/inspector_panel/component.rb
lookbook-1.5.3 app/components/lookbook/inspector_panel/component.rb
lookbook-2.0.0.beta.1 app/components/lookbook/inspector_panel/component.rb
lookbook-1.5.2 app/components/lookbook/inspector_panel/component.rb
lookbook-2.0.0.beta.0 app/components/lookbook/inspector_panel/component.rb
lookbook-1.5.1 app/components/lookbook/inspector_panel/component.rb
lookbook-1.5.0 app/components/lookbook/inspector_panel/component.rb
lookbook-1.4.5 app/components/lookbook/inspector_panel/component.rb
lookbook-1.4.4 app/components/lookbook/inspector_panel/component.rb
lookbook-1.4.3 app/components/lookbook/inspector_panel/component.rb
lookbook-1.4.2 app/components/lookbook/inspector_panel/component.rb
lookbook-1.4.1 app/components/lookbook/inspector_panel/component.rb
lookbook-1.4.0 app/components/lookbook/inspector_panel/component.rb