Class: Coco::App::Blocks::SlideEditor
- Includes:
- Coco::AppHelper, BookHelper, FormatHelper
- Defined in:
- app/components/coco/app/blocks/slide_editor/slide_editor.rb
Constant Summary
Constants included from Concerns::AcceptsTagAttributes
Concerns::AcceptsTagAttributes::TAG_ATTRIBUTE_NAMES
Instance Method Summary collapse
- #alpine_props ⇒ Object
- #bg_color_css ⇒ Object
- #bg_image_src ⇒ Object
- #generate_thumbnail? ⇒ Boolean
-
#initialize(generate_thumbnail: true, **kwargs) ⇒ SlideEditor
constructor
A new instance of SlideEditor.
- #slide_args ⇒ Object
- #text_color_css ⇒ Object
Methods included from FormatHelper
Methods included from BookHelper
#coco_editable_slide, #coco_media_slide
Methods included from Coco::AppHelper
#coco_button, #coco_button_group, #coco_color_picker_button, #coco_confirm_button, #coco_dropdown_button, #coco_fields, #coco_form_button, #coco_form_for, #coco_form_with, #coco_image_picker_button, #coco_link, #coco_menu_button, #coco_notice, #coco_seamless_textarea, #coco_snackbar, #coco_system_banner, #coco_toast, #coco_toolbar
Methods inherited from Component
#accepts_options?, after_initialize, before_initialize, before_render, new
Methods included from Coco::AlpineHelper
Methods included from TagHelper
#prefix_attr_keys, #random_id, #style_str
Methods included from ComponentHelper
#coco_component, #resolve_component
Methods included from BaseHelper
#coco_embed, #coco_icon, #coco_image, #coco_placeholder, #coco_tag
Methods included from Concerns::Translatable
Methods included from Concerns::HasName
Methods included from Concerns::AcceptsTagAttributes
Constructor Details
#initialize(generate_thumbnail: true, **kwargs) ⇒ SlideEditor
Returns a new instance of SlideEditor.
38 39 40 |
# File 'app/components/coco/app/blocks/slide_editor/slide_editor.rb', line 38 def initialize(generate_thumbnail: true, **kwargs) @generate_thumbnail = generate_thumbnail end |
Instance Method Details
#alpine_props ⇒ Object
53 54 55 56 57 58 59 60 61 |
# File 'app/components/coco/app/blocks/slide_editor/slide_editor.rb', line 53 def alpine_props { bg_color: bg_color_css, text_color: text_color_css, title: title&.value, text_1: text_1&.value, bg_image: bg_image_src } end |
#bg_color_css ⇒ Object
63 64 65 |
# File 'app/components/coco/app/blocks/slide_editor/slide_editor.rb', line 63 def bg_color_css [:selected] if end |
#bg_image_src ⇒ Object
71 72 73 |
# File 'app/components/coco/app/blocks/slide_editor/slide_editor.rb', line 71 def bg_image_src [:src] if end |
#generate_thumbnail? ⇒ Boolean
42 |
# File 'app/components/coco/app/blocks/slide_editor/slide_editor.rb', line 42 def generate_thumbnail? = @generate_thumbnail |
#slide_args ⇒ Object
44 45 46 47 48 49 50 51 |
# File 'app/components/coco/app/blocks/slide_editor/slide_editor.rb', line 44 def { bg_image: bg_image_src, bg_color_hex: bg_color_css, text_color_hex: text_color_css, render_empty: true } end |
#text_color_css ⇒ Object
67 68 69 |
# File 'app/components/coco/app/blocks/slide_editor/slide_editor.rb', line 67 def text_color_css [:selected] if end |