Skip to content

Commit

Permalink
See pewresearch/pewresearch-org@eb87202 from refs/heads/release/5.0
Browse files Browse the repository at this point in the history
  • Loading branch information
prcdevgitbot committed Mar 11, 2024
1 parent 088c09c commit bb4a339
Show file tree
Hide file tree
Showing 14 changed files with 64 additions and 62 deletions.
4 changes: 3 additions & 1 deletion blocks/collapsible/build/render.php
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,9 @@

do_action('qm/debug', print_r($content, true));

$icon = \PRC\Platform\Icons\Render('light', 'circle-plus');;
ob_start();
\PRC\Platform\Icons\Render('light', 'circle-plus');
$icon = ob_get_clean();

if ( function_exists( 'apple_news_is_exporting' ) && apple_news_is_exporting() ) {
// echo wp_sprintf();
Expand Down
4 changes: 3 additions & 1 deletion blocks/collapsible/src/render.php
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,9 @@

do_action('qm/debug', print_r($content, true));

$icon = \PRC\Platform\Icons\Render('light', 'circle-plus');;
ob_start();
\PRC\Platform\Icons\Render('light', 'circle-plus');
$icon = ob_get_clean();

if ( function_exists( 'apple_news_is_exporting' ) && apple_news_is_exporting() ) {
// echo wp_sprintf();
Expand Down
10 changes: 1 addition & 9 deletions blocks/form-input-password/build/render.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,15 +20,7 @@
data-wp-each--condition="context.conditionsList"
data-wp-each-key="context.condition.id"
>
<li data-wp-class--is-valid="context.condition.met">
<span data-wp-class--icon-hidden="!context.condition.met">
<?php echo \PRC\Platform\Icons\Render('solid', 'check'); ?>
</span>
<span data-wp-class--icon-hidden="context.condition.met">
<?php echo \PRC\Platform\Icons\Render('regular', 'xmark'); ?>
</span>
<span class="password-analyzer__label" data-wp-text="context.condition.label"></span>
</li>
<li data-wp-class--is-valid="context.condition.met"><span data-wp-class--icon-hidden="!context.condition.met"><i class="fa fa-solid fa-check"></i></span><span data-wp-class--icon-hidden="context.condition.met"><i class="fa fa-regular fa-xmark"></i></span><span class="password-analyzer__label" data-wp-text="context.condition.label"></span></li>
</template>
</ul>
</div>
Expand Down
10 changes: 1 addition & 9 deletions blocks/form-input-password/src/render.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,15 +20,7 @@
data-wp-each--condition="context.conditionsList"
data-wp-each-key="context.condition.id"
>
<li data-wp-class--is-valid="context.condition.met">
<span data-wp-class--icon-hidden="!context.condition.met">
<?php echo \PRC\Platform\Icons\Render('solid', 'check'); ?>
</span>
<span data-wp-class--icon-hidden="context.condition.met">
<?php echo \PRC\Platform\Icons\Render('regular', 'xmark'); ?>
</span>
<span class="password-analyzer__label" data-wp-text="context.condition.label"></span>
</li>
<li data-wp-class--is-valid="context.condition.met"><span data-wp-class--icon-hidden="!context.condition.met"><i class="fa fa-solid fa-check"></i></span><span data-wp-class--icon-hidden="context.condition.met"><i class="fa fa-regular fa-xmark"></i></span><span class="password-analyzer__label" data-wp-text="context.condition.label"></span></li>
</template>
</ul>
</div>
Expand Down
8 changes: 4 additions & 4 deletions blocks/navigation-mega-menu/build/render.php
Original file line number Diff line number Diff line change
Expand Up @@ -90,11 +90,11 @@ class="wp-block-navigation-item__content wp-block-prc-block-navigation-mega-menu
<?php echo esc_html($display_label);?>
<span class="wp-block-prc-block-navigation-mega-menu__toggle-<?php echo $icon;?>-icon">
<?php if ( 'dropdown' === $icon ) {
echo \PRC\Platform\Icons\Render('solid', 'caret-down');
echo PRC\Platform\Icons\Render('solid', 'caret-down');
} elseif( 'mobile' === $icon ) {
echo \PRC\Platform\Icons\Render('light', 'bars');
echo '<i class="fa-light fa-bars"></i>';
} elseif ( 'search' === $icon ) {
echo \PRC\Platform\Icons\Render('solid', 'magnifying-glass');
echo '<i class="fa-solid fa-magnifying-glass"></i>';
}?>
</span>
</button>
Expand All @@ -113,7 +113,7 @@ class="wp-block-prc-block-navigation-mega-menu__container__close-button"
data-wp-on--click="actions.closeMenuOnClick"
type="button"
>
<?php echo \PRC\Platform\Icons\Render('light', 'circle-minus');?>
<i class="fa-light fa-circle-minus"></i>
</button>
</div>
</li>
8 changes: 4 additions & 4 deletions blocks/navigation-mega-menu/src/render.php
Original file line number Diff line number Diff line change
Expand Up @@ -90,11 +90,11 @@ class="wp-block-navigation-item__content wp-block-prc-block-navigation-mega-menu
<?php echo esc_html($display_label);?>
<span class="wp-block-prc-block-navigation-mega-menu__toggle-<?php echo $icon;?>-icon">
<?php if ( 'dropdown' === $icon ) {
echo \PRC\Platform\Icons\Render('solid', 'caret-down');
echo PRC\Platform\Icons\Render('solid', 'caret-down');
} elseif( 'mobile' === $icon ) {
echo \PRC\Platform\Icons\Render('light', 'bars');
echo '<i class="fa-light fa-bars"></i>';
} elseif ( 'search' === $icon ) {
echo \PRC\Platform\Icons\Render('solid', 'magnifying-glass');
echo '<i class="fa-solid fa-magnifying-glass"></i>';
}?>
</span>
</button>
Expand All @@ -113,7 +113,7 @@ class="wp-block-prc-block-navigation-mega-menu__container__close-button"
data-wp-on--click="actions.closeMenuOnClick"
type="button"
>
<?php echo \PRC\Platform\Icons\Render('light', 'circle-minus');?>
<i class="fa-light fa-circle-minus"></i>
</button>
</div>
</li>
28 changes: 16 additions & 12 deletions blocks/report-materials/report-materials.php
Original file line number Diff line number Diff line change
Expand Up @@ -72,27 +72,27 @@ public function get_item_label($item) {
public function get_item_icon($item) {
switch ($item['type']) {
case 'detailTable':
return 'table';
return 'fa-regular fa-table';
case 'link':
return 'link';
return 'fa-regular fa-link';
case 'presentation':
return 'presentation-screen';
return 'fa-solid fa-presentation-screen';
case 'pressRelease':
return 'file';
return 'fa-solid fa-file';
case 'promo':
return 'file';
return 'fa-solid fa-file';
case 'qA':
return 'file';
return 'fa-solid fa-file';
case 'questionnaire':
return 'clipboard';
return 'fa-solid fa-clipboard';
case 'report':
return 'file';
return 'fa-solid fa-file';
case 'supplemental':
return 'file';
return 'fa-solid fa-file';
case 'topline':
return 'clipboard';
return 'fa-solid fa-clipboard';
default:
return 'file';
return 'fa-solid fa-file';
}
}

Expand All @@ -116,7 +116,10 @@ public function render_block_callback( $attributes, $content, $block ) {
) . ' flex-align-center';

foreach ($materials as $material) {
$icon = \PRC\Platform\Icons\Render('solid', $this->get_item_icon($material));
$icon = wp_sprintf(
'<i class="%1$s"></i>',
$this->get_item_icon($material),
);
$content .= wp_sprintf(
'<li class="%1$s">%2$s<a href="%3$s" target="_blank">%4$s</a></li>',
$list_item_classnames,
Expand Down Expand Up @@ -180,3 +183,4 @@ public function block_init() {
}

}

5 changes: 1 addition & 4 deletions blocks/social-share-sheet/build/render.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,11 +27,8 @@
'data-wp-on--click' => 'actions.onClick',
));

$icon = \PRC\Platform\Icons\Render('sharp', 'up-from-bracket');

echo wp_sprintf(
'<a %1$s><span class="wp-block-prc-block-social-share-sheet__label">Share</span>%2$s</a>',
'<a %1$s><span class="wp-block-prc-block-social-share-sheet__label">Share</span><i class="fa-sharp fa-solid fa-up-from-bracket"></i></a>',
$block_wrapper_attrs,
$icon,
$content,
);
5 changes: 1 addition & 4 deletions blocks/social-share-sheet/src/render.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,11 +27,8 @@
'data-wp-on--click' => 'actions.onClick',
));

$icon = \PRC\Platform\Icons\Render('sharp', 'up-from-bracket');

echo wp_sprintf(
'<a %1$s><span class="wp-block-prc-block-social-share-sheet__label">Share</span>%2$s</a>',
'<a %1$s><span class="wp-block-prc-block-social-share-sheet__label">Share</span><i class="fa-sharp fa-solid fa-up-from-bracket"></i></a>',
$block_wrapper_attrs,
$icon,
$content,
);
14 changes: 11 additions & 3 deletions blocks/taxonomy-list-link/build/render.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,14 @@
$enable_sub_menu = $attributes['enableSubMenu'] ?? false;
$block_template = $enable_sub_menu && !empty($content) ? '<div %1$s>%2$s<div class="wp-block-prc-block-taxonomy-list-link__sub-menu">%3$s</div></div>' : '<div %1$s>%2$s</div>';
$label_template = !empty( $attributes['url'] ) ? '<a href="%1$s" class="wp-block-prc-block-taxonomy-list-link__label">%2$s</a>' : '<span class="wp-block-prc-block-taxonomy-list-link__label">%2$s</span>';
$label_template = $is_sub_heading ? $label_template . \PRC\Platform\Icons\Render('solid', 'chevron-right') : $label_template;
$label_template = $is_sub_heading ? $label_template . '<i class="fa-solid fa-chevron-right fa-xs"></i>' : $label_template;
$label_template = $enable_sub_menu && !empty($content) ? ( empty( $attributes['url'] ) ? '<span class="wp-block-prc-block-taxonomy-list-link__label wp-block-prc-block-taxonomy-list-link__toggle">%2$s</span>%3$s' : '<a href="%1$s" class="wp-block-prc-block-taxonomy-list-link__label">%2$s</a>%3$s' ) : $label_template;

$icon_template =\PRC\Platform\Icons\Render('light', 'circle-plus') . \PRC\Platform\Icons\Render('light', 'circle-minus');
$icon_template = wp_sprintf(
'<i class="%1$s"></i><i class="%2$s"></i>',
'fa-light fa-circle-plus',
'fa-light fa-circle-minus'
);

/**
* Build an array with CSS classes defining the colors
Expand All @@ -32,7 +36,11 @@

if ( array_key_exists('className', $attributes) && 'is-style-sub-expand' === $attributes['className'] ) {
$attributes['label'] = "More";
$icon_template = \PRC\Platform\Icons\Render('light', 'plus') . \PRC\Platform\Icons\Render('light', 'minus');
$icon_template = wp_sprintf(
'<i class="%1$s"></i><i class="%2$s"></i>',
'fa-light fa-plus fa-xs',
'fa-light fa-minus fa-xs'
);
}

$block_id = 'item-' . md5( wp_json_encode( $attributes ) );
Expand Down
14 changes: 11 additions & 3 deletions blocks/taxonomy-list-link/src/render.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,14 @@
$enable_sub_menu = $attributes['enableSubMenu'] ?? false;
$block_template = $enable_sub_menu && !empty($content) ? '<div %1$s>%2$s<div class="wp-block-prc-block-taxonomy-list-link__sub-menu">%3$s</div></div>' : '<div %1$s>%2$s</div>';
$label_template = !empty( $attributes['url'] ) ? '<a href="%1$s" class="wp-block-prc-block-taxonomy-list-link__label">%2$s</a>' : '<span class="wp-block-prc-block-taxonomy-list-link__label">%2$s</span>';
$label_template = $is_sub_heading ? $label_template . \PRC\Platform\Icons\Render('solid', 'chevron-right') : $label_template;
$label_template = $is_sub_heading ? $label_template . '<i class="fa-solid fa-chevron-right fa-xs"></i>' : $label_template;
$label_template = $enable_sub_menu && !empty($content) ? ( empty( $attributes['url'] ) ? '<span class="wp-block-prc-block-taxonomy-list-link__label wp-block-prc-block-taxonomy-list-link__toggle">%2$s</span>%3$s' : '<a href="%1$s" class="wp-block-prc-block-taxonomy-list-link__label">%2$s</a>%3$s' ) : $label_template;

$icon_template =\PRC\Platform\Icons\Render('light', 'circle-plus') . \PRC\Platform\Icons\Render('light', 'circle-minus');
$icon_template = wp_sprintf(
'<i class="%1$s"></i><i class="%2$s"></i>',
'fa-light fa-circle-plus',
'fa-light fa-circle-minus'
);

/**
* Build an array with CSS classes defining the colors
Expand All @@ -32,7 +36,11 @@

if ( array_key_exists('className', $attributes) && 'is-style-sub-expand' === $attributes['className'] ) {
$attributes['label'] = "More";
$icon_template = \PRC\Platform\Icons\Render('light', 'plus') . \PRC\Platform\Icons\Render('light', 'minus');
$icon_template = wp_sprintf(
'<i class="%1$s"></i><i class="%2$s"></i>',
'fa-light fa-plus fa-xs',
'fa-light fa-minus fa-xs'
);
}

$block_id = 'item-' . md5( wp_json_encode( $attributes ) );
Expand Down
2 changes: 1 addition & 1 deletion blocks/yoast-seo-breadcrumbs/build/style-index.css

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

12 changes: 6 additions & 6 deletions blocks/yoast-seo-breadcrumbs/src/style.scss
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,12 @@
display: -webkit-box;
-webkit-line-clamp: 1;
-webkit-box-orient: vertical;
// override default icon styles
.icon {
font-size: 12px !important;
color: var(--wp--preset--color--ui-gray-light) !important;
margin-inline-start: 0.3em !important;
margin-inline-end: 0.3em !important;

.fa-chevron-right {
font-size: 12px;
color: var(--wp--preset--color--ui-gray-light);
margin-inline-start: 0.3em;
margin-inline-end: 0.3em;
}
}
}
2 changes: 1 addition & 1 deletion blocks/yoast-seo-breadcrumbs/yoast-seo-breadcrumbs.php
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ public function enqueue_assets() {
* @hook wpseo_breadcrumb_separator
*/
public function modify_separator($separator) {
return \PRC\Platform\Icons\Render('solid', 'chevron-right');
return '<i class="fa fa-solid fa-chevron-right"></i>';
}

/**
Expand Down

0 comments on commit bb4a339

Please sign in to comment.