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.3.4 app/components/lookbook/inspector_panel/component.rb
lookbook-2.3.3 app/components/lookbook/inspector_panel/component.rb
lookbook-2.3.2 app/components/lookbook/inspector_panel/component.rb
lookbook-2.3.0 app/components/lookbook/inspector_panel/component.rb
lookbook-2.2.2 app/components/lookbook/inspector_panel/component.rb
lookbook-2.2.1 app/components/lookbook/inspector_panel/component.rb
lookbook-2.2.0 app/components/lookbook/inspector_panel/component.rb
lookbook-2.1.1 app/components/lookbook/inspector_panel/component.rb
lookbook-2.1.0 app/components/lookbook/inspector_panel/component.rb
lookbook-2.0.5 app/components/lookbook/inspector_panel/component.rb
lookbook-2.0.4 app/components/lookbook/inspector_panel/component.rb
lookbook-2.0.3 app/components/lookbook/inspector_panel/component.rb
lookbook-2.0.2 app/components/lookbook/inspector_panel/component.rb
lookbook-2.0.1 app/components/lookbook/inspector_panel/component.rb
lookbook-2.0.0 app/components/lookbook/inspector_panel/component.rb
lookbook-2.0.0.rc.3 app/components/lookbook/inspector_panel/component.rb
lookbook-1.5.5 app/components/lookbook/inspector_panel/component.rb
lookbook-1.5.4 app/components/lookbook/inspector_panel/component.rb
lookbook-2.0.0.rc.2 app/components/lookbook/inspector_panel/component.rb
lookbook-2.0.0.rc.1 app/components/lookbook/inspector_panel/component.rb