'canvas/progress', 'title' => esc_html__( 'Progress', 'canvas' ), 'description' => '', 'category' => 'canvas', 'keywords' => array(), 'icon' => '', 'supports' => array( 'className' => true, 'anchor' => true, 'html' => false, 'canvasSpacings' => true, 'canvasBorder' => true, 'canvasResponsive' => true, ), 'styles' => array( array( 'name' => 'cnvs-block-progress-primary', 'label' => esc_html__( 'Primary', 'canvas' ), ), array( 'name' => 'cnvs-block-progress-success', 'label' => esc_html__( 'Success', 'canvas' ), ), array( 'name' => 'cnvs-block-progress-info', 'label' => esc_html__( 'Info', 'canvas' ), ), array( 'name' => 'cnvs-block-progress-warning', 'label' => esc_html__( 'Warning', 'canvas' ), ), array( 'name' => 'cnvs-block-progress-danger', 'label' => esc_html__( 'Danger', 'canvas' ), ), array( 'name' => 'cnvs-block-progress-dark', 'label' => esc_html__( 'Dark', 'canvas' ), ), ), 'location' => array(), 'sections' => array( 'general' => array( 'title' => esc_html__( 'Block Settings', 'canvas' ), 'priority' => 5, 'open' => true, ), ), 'layouts' => array(), // Set fields just for add block attributes. // Editor render for this block is custom JSX // so we don't need to render fields automatically. 'fields' => array( array( 'key' => 'width', 'label' => esc_html__( 'Width', 'canvas' ), 'type' => 'number', 'section' => 'general', 'min' => 1, 'max' => 100, 'default' => 70, 'output' => array( array( 'element' => '$ .cnvs-block-progress-bar', 'property' => 'width', 'units' => '%', ), ), ), array( 'key' => 'height', 'label' => esc_html__( 'Height', 'canvas' ), 'type' => 'number', 'section' => 'general', 'min' => 1, 'max' => 20, 'default' => 14, 'output' => array( array( 'property' => 'height', 'units' => 'px', ), ), ), array( 'key' => 'striped', 'label' => esc_html__( 'Striped', 'canvas' ), 'type' => 'toggle', 'section' => 'general', 'default' => true, ), array( 'key' => 'animated', 'label' => esc_html__( 'Animated', 'canvas' ), 'type' => 'toggle', 'section' => 'general', 'default' => false, 'active_callback' => array( array( 'field' => 'striped', ), ), ), array( 'key' => 'displayPercent', 'label' => esc_html__( 'Display Percent', 'canvas' ), 'type' => 'toggle', 'section' => 'general', 'default' => false, ), ), 'template' => dirname( __FILE__ ) . '/block-progress/render.php', // enqueue registered scripts/styles. 'style' => 'canvas-block-progress-style', 'editor_style' => 'canvas-block-progress-editor-style', 'editor_script' => 'canvas-block-progress-editor-script', ); return $blocks; } } new CNVS_Block_Progress();