start_controls_section( 'section_editor', [ 'label' => esc_html__( 'Text Editor', 'elementor' ), ] ); $this->add_control( 'editor', [ 'label' => '', 'type' => Controls_Manager::WYSIWYG, 'default' => '
' . esc_html__( 'Lorem ipsum dolor sit amet, consectetur adipiscing elit. Ut elit tellus, luctus nec ullamcorper mattis, pulvinar dapibus leo.', 'elementor' ) . '
', ] ); $this->add_control( 'drop_cap', [ 'label' => esc_html__( 'Drop Cap', 'elementor' ), 'type' => Controls_Manager::SWITCHER, 'label_off' => esc_html__( 'Off', 'elementor' ), 'label_on' => esc_html__( 'On', 'elementor' ), 'prefix_class' => 'elementor-drop-cap-', 'frontend_available' => true, ] ); $this->add_responsive_control( 'text_columns', [ 'label' => esc_html__( 'Columns', 'elementor' ), 'type' => Controls_Manager::SELECT, 'separator' => 'before', 'options' => [ '' => esc_html__( 'Default', 'elementor' ), '1' => esc_html__( '1', 'elementor' ), '2' => esc_html__( '2', 'elementor' ), '3' => esc_html__( '3', 'elementor' ), '4' => esc_html__( '4', 'elementor' ), '5' => esc_html__( '5', 'elementor' ), '6' => esc_html__( '6', 'elementor' ), '7' => esc_html__( '7', 'elementor' ), '8' => esc_html__( '8', 'elementor' ), '9' => esc_html__( '9', 'elementor' ), '10' => esc_html__( '10', 'elementor' ), ], 'selectors' => [ '{{WRAPPER}}' => 'columns: {{VALUE}};', ], ] ); $this->add_responsive_control( 'column_gap', [ 'label' => esc_html__( 'Columns Gap', 'elementor' ), 'type' => Controls_Manager::SLIDER, 'size_units' => [ 'px', '%', 'em', 'rem', 'vw', 'custom' ], 'range' => [ 'px' => [ 'max' => 100, ], '%' => [ 'max' => 10, 'step' => 0.1, ], 'vw' => [ 'max' => 10, 'step' => 0.1, ], 'em' => [ 'max' => 10, ], 'rem' => [ 'max' => 10, ], ], 'selectors' => [ '{{WRAPPER}}' => 'column-gap: {{SIZE}}{{UNIT}};', ], 'conditions' => [ 'relation' => 'or', 'terms' => [ [ 'name' => 'text_columns', 'operator' => '>', 'value' => 1, ], [ 'name' => 'text_columns', 'operator' => '===', 'value' => '', ], ], ], ] ); $this->end_controls_section(); $this->start_controls_section( 'section_style', [ 'label' => esc_html__( 'Text Editor', 'elementor' ), 'tab' => Controls_Manager::TAB_STYLE, ] ); $this->add_responsive_control( 'align', [ 'label' => esc_html__( 'Alignment', 'elementor' ), 'type' => Controls_Manager::CHOOSE, 'options' => [ 'left' => [ 'title' => esc_html__( 'Left', 'elementor' ), 'icon' => 'eicon-text-align-left', ], 'center' => [ 'title' => esc_html__( 'Center', 'elementor' ), 'icon' => 'eicon-text-align-center', ], 'right' => [ 'title' => esc_html__( 'Right', 'elementor' ), 'icon' => 'eicon-text-align-right', ], 'justify' => [ 'title' => esc_html__( 'Justified', 'elementor' ), 'icon' => 'eicon-text-align-justify', ], ], 'selectors' => [ '{{WRAPPER}}' => 'text-align: {{VALUE}};', ], ] ); $this->add_control( 'text_color', [ 'label' => esc_html__( 'Text Color', 'elementor' ), 'type' => Controls_Manager::COLOR, 'default' => '', 'selectors' => [ '{{WRAPPER}}' => 'color: {{VALUE}};', ], 'global' => [ 'default' => Global_Colors::COLOR_TEXT, ], ] ); $this->add_group_control( Group_Control_Typography::get_type(), [ 'name' => 'typography', 'global' => [ 'default' => Global_Typography::TYPOGRAPHY_TEXT, ], ] ); $this->add_group_control( Group_Control_Text_Shadow::get_type(), [ 'name' => 'text_shadow', 'selector' => '{{WRAPPER}}', ] ); $this->end_controls_section(); $this->start_controls_section( 'section_drop_cap', [ 'label' => esc_html__( 'Drop Cap', 'elementor' ), 'tab' => Controls_Manager::TAB_STYLE, 'condition' => [ 'drop_cap' => 'yes', ], ] ); $this->add_control( 'drop_cap_view', [ 'label' => esc_html__( 'View', 'elementor' ), 'type' => Controls_Manager::SELECT, 'options' => [ 'default' => esc_html__( 'Default', 'elementor' ), 'stacked' => esc_html__( 'Stacked', 'elementor' ), 'framed' => esc_html__( 'Framed', 'elementor' ), ], 'default' => 'default', 'prefix_class' => 'elementor-drop-cap-view-', ] ); $this->add_control( 'drop_cap_primary_color', [ 'label' => esc_html__( 'Primary Color', 'elementor' ), 'type' => Controls_Manager::COLOR, 'selectors' => [ '{{WRAPPER}}.elementor-drop-cap-view-stacked .elementor-drop-cap' => 'background-color: {{VALUE}};', '{{WRAPPER}}.elementor-drop-cap-view-framed .elementor-drop-cap, {{WRAPPER}}.elementor-drop-cap-view-default .elementor-drop-cap' => 'color: {{VALUE}}; border-color: {{VALUE}};', ], 'global' => [ 'default' => Global_Colors::COLOR_PRIMARY, ], ] ); $this->add_control( 'drop_cap_secondary_color', [ 'label' => esc_html__( 'Secondary Color', 'elementor' ), 'type' => Controls_Manager::COLOR, 'selectors' => [ '{{WRAPPER}}.elementor-drop-cap-view-framed .elementor-drop-cap' => 'background-color: {{VALUE}};', '{{WRAPPER}}.elementor-drop-cap-view-stacked .elementor-drop-cap' => 'color: {{VALUE}};', ], 'condition' => [ 'drop_cap_view!' => 'default', ], ] ); $this->add_group_control( Group_Control_Text_Shadow::get_type(), [ 'name' => 'drop_cap_shadow', 'selector' => '{{WRAPPER}} .elementor-drop-cap', ] ); $this->add_control( 'drop_cap_size', [ 'label' => esc_html__( 'Size', 'elementor' ), 'type' => Controls_Manager::SLIDER, 'size_units' => [ 'px', 'em', 'rem', 'custom' ], 'default' => [ 'size' => 5, ], 'range' => [ 'px' => [ 'max' => 30, ], 'em' => [ 'max' => 3, ], 'rem' => [ 'max' => 3, ], ], 'selectors' => [ '{{WRAPPER}} .elementor-drop-cap' => 'padding: {{SIZE}}{{UNIT}};', ], 'condition' => [ 'drop_cap_view!' => 'default', ], ] ); $this->add_control( 'drop_cap_space', [ 'label' => esc_html__( 'Space', 'elementor' ), 'type' => Controls_Manager::SLIDER, 'size_units' => [ 'px', 'em', 'rem', 'custom' ], 'default' => [ 'size' => 10, ], 'range' => [ 'px' => [ 'max' => 50, ], 'em' => [ 'max' => 5, ], 'rem' => [ 'max' => 5, ], ], 'selectors' => [ 'body:not(.rtl) {{WRAPPER}} .elementor-drop-cap' => 'margin-right: {{SIZE}}{{UNIT}};', 'body.rtl {{WRAPPER}} .elementor-drop-cap' => 'margin-left: {{SIZE}}{{UNIT}};', ], ] ); $this->add_control( 'drop_cap_border_radius', [ 'label' => esc_html__( 'Border Radius', 'elementor' ), 'type' => Controls_Manager::SLIDER, 'size_units' => [ 'px', '%', 'em', 'rem', 'custom' ], 'default' => [ 'unit' => '%', ], 'range' => [ '%' => [ 'max' => 50, ], ], 'selectors' => [ '{{WRAPPER}} .elementor-drop-cap' => 'border-radius: {{SIZE}}{{UNIT}};', ], 'condition' => [ 'drop_cap_view!' => 'default', ], ] ); $this->add_control( 'drop_cap_border_width', [ 'label' => esc_html__( 'Border Width', 'elementor' ), 'type' => Controls_Manager::DIMENSIONS, 'size_units' => [ 'px', '%', 'em', 'rem', 'vw', 'custom' ], 'selectors' => [ '{{WRAPPER}} .elementor-drop-cap' => 'border-width: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', ], 'condition' => [ 'drop_cap_view' => 'framed', ], ] ); $this->add_group_control( Group_Control_Typography::get_type(), [ 'name' => 'drop_cap_typography', 'selector' => '{{WRAPPER}} .elementor-drop-cap-letter', 'exclude' => [ 'letter_spacing', ], ] ); $this->end_controls_section(); } /** * Render text editor widget output on the frontend. * * Written in PHP and used to generate the final HTML. * * @since 1.0.0 * @access protected */ protected function render() { $should_render_inline_editing = Plugin::$instance->editor->is_edit_mode(); $editor_content = $this->get_settings_for_display( 'editor' ); $editor_content = $this->parse_text_editor( $editor_content ); if ( empty( $editor_content ) ) { return; } if ( $should_render_inline_editing ) { $this->add_render_attribute( 'editor', 'class', [ 'elementor-text-editor', 'elementor-clearfix' ] ); } $this->add_inline_editing_attributes( 'editor', 'advanced' ); ?>