Class: CKEditor5::Rails::Assets::WebComponentBundle

Inherits:
Object
  • Object
show all
Includes:
ActionView::Helpers::TagHelper, Singleton
Defined in:
lib/ckeditor5/rails/assets/webcomponent_bundle.rb

Constant Summary collapse

WEBCOMPONENTS_PATH =
File.join(__dir__, 'webcomponents')
WEBCOMPONENTS_MODULES =
[
  'utils.mjs',
  'components/editable.mjs',
  'components/ui-part.mjs',
  'components/editor.mjs',
  'components/context.mjs'
].freeze

Instance Method Summary collapse

Instance Method Details

#sourceObject



20
21
22
# File 'lib/ckeditor5/rails/assets/webcomponent_bundle.rb', line 20

def source
  @source ||= compress_source(raw_source)
end

#to_html(nonce: nil) ⇒ Object



24
25
26
# File 'lib/ckeditor5/rails/assets/webcomponent_bundle.rb', line 24

def to_html(nonce: nil)
  tag.script(source, type: 'module', nonce: nonce)
end