Sha256: 528480db23477ccb42d89a165983e297c771bcf927e2414a09334bea5b8c3d35

Contents?: true

Size: 705 Bytes

Versions: 25

Compression:

Stored size: 705 Bytes

Contents

module Lookbook
  class Embed::Component < Lookbook::BaseComponent
    def initialize(id:, example:, params: {}, opts: {}, max_height: nil, **html_attrs)
      @id = id
      @target = example
      @params = params
      @opts = opts
      @max_height = max_height
      super(**html_attrs)
    end

    protected

    def lookbook_inspect_path(*args)
      Lookbook::Engine.routes.url_helpers.lookbook_inspect_path(*args)
    end

    def lookbook_preview_path(*args)
      Lookbook::Engine.routes.url_helpers.lookbook_preview_path(*args)
    end

    def alpine_data
      [alpine_encode(@id), "$store.pages.embeds"].join(",")
    end

    def alpine_component
      "embedComponent"
    end
  end
end

Version data entries

25 entries across 25 versions & 1 rubygems

Version Path
lookbook-1.5.5 app/components/lookbook/embed/component.rb
lookbook-1.5.4 app/components/lookbook/embed/component.rb
lookbook-1.5.3 app/components/lookbook/embed/component.rb
lookbook-1.5.2 app/components/lookbook/embed/component.rb
lookbook-1.5.1 app/components/lookbook/embed/component.rb
lookbook-1.5.0 app/components/lookbook/embed/component.rb
lookbook-1.4.5 app/components/lookbook/embed/component.rb
lookbook-1.4.4 app/components/lookbook/embed/component.rb
lookbook-1.4.3 app/components/lookbook/embed/component.rb
lookbook-1.4.2 app/components/lookbook/embed/component.rb
lookbook-1.4.1 app/components/lookbook/embed/component.rb
lookbook-1.4.0 app/components/lookbook/embed/component.rb
lookbook-1.3.4 app/components/lookbook/embed/component.rb
lookbook-1.3.3 app/components/lookbook/embed/component.rb
lookbook-1.3.1 app/components/lookbook/embed/component.rb
lookbook-1.3.0 app/components/lookbook/embed/component.rb
lookbook-1.2.1 app/components/lookbook/embed/component.rb
lookbook-1.2.0 app/components/lookbook/embed/component.rb
lookbook-1.1.1 app/components/lookbook/embed/component.rb
lookbook-1.1.0 app/components/lookbook/embed/component.rb