Skip to content

Commit

Permalink
See pewresearch/pewresearch-org@cbede6e from refs/heads/release/5.0
Browse files Browse the repository at this point in the history
  • Loading branch information
prcdevgitbot committed Mar 6, 2024
1 parent 4b021a4 commit 5d6ec56
Show file tree
Hide file tree
Showing 39 changed files with 20,015 additions and 75 deletions.
2 changes: 1 addition & 1 deletion blocks/core-navigation/build/index.asset.php
Original file line number Diff line number Diff line change
@@ -1 +1 @@
<?php return array('dependencies' => array('wp-blocks', 'wp-dom-ready', 'wp-hooks'), 'version' => '56c83ed099664c81616b');
<?php return array('dependencies' => array('wp-blocks', 'wp-dom-ready'), 'version' => 'd2f8f6f34180ea92f25c');
2 changes: 1 addition & 1 deletion blocks/core-navigation/build/index.js

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

2 changes: 1 addition & 1 deletion blocks/core-navigation/build/style-index.css

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

20 changes: 0 additions & 20 deletions blocks/core-navigation/src/index.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
/**
* WordPress Dependencies
*/
import { addFilter } from '@wordpress/hooks';
import domReady from '@wordpress/dom-ready';
import { registerBlockStyle, unregisterBlockStyle } from '@wordpress/blocks';

Expand Down Expand Up @@ -30,22 +29,3 @@ domReady(() => {
label: 'Divided Links',
});
});

addFilter(
'blocks.registerBlockType',
'prc-core-navigation-allowedblocks',
(settings, name) => {
if (name === 'core/navigation') {
return {
...settings,
allowedBlocks: [
...(settings.allowedBlocks ?? []),
'prc-user-accounts/login-logout',
'prc-block/logo',
'prc-block/navigation-mega-menu',
],
};
}
return settings;
}
);
30 changes: 3 additions & 27 deletions blocks/core-navigation/src/style.scss
Original file line number Diff line number Diff line change
Expand Up @@ -49,11 +49,11 @@


.wp-block-navigation.is-style-mega-menu {
margin-left: -1em!important;
margin-right: -1em!important;
max-width: calc(var(--wp--style--global--wide-size) + 2em)!important;
width: 100%;
position: relative;
.wp-block-navigation__container {
width: 100%;
}
.wp-block-navigation-item {
display: flex;
flex-grow: 1;
Expand All @@ -68,27 +68,3 @@
padding: 1em!important;
}
}
.wp-block-group:has( > .wp-block-navigation.is-style-mega-menu) {
display: flex;
justify-content: center;
}




// Main Mobile Menu Styling

.wp-block-navigation.is-style-mega-mobile-menu:has(.wp-block-navigation__responsive-container.is-menu-open) {
// .wp-block-navigation__responsive-container-open {
// &:after {
// content: "X"
// }
// svg {
// display: none;
// }
// }
.wp-block-navigation__responsive-container {
top: 50px;
}
}

19 changes: 9 additions & 10 deletions blocks/core-query/core-query.php
Original file line number Diff line number Diff line change
Expand Up @@ -40,19 +40,18 @@ public function __construct($loader) {

public function init($loader = null) {
if ( null !== $loader ) {
$loader->add_action('init', $this, 'register_assets');
$loader->add_action('init', $this, 'hard_enable_enhanced_pagination', 100);
$loader->add_action('enqueue_block_editor_assets', $this, 'register_editor_script');
$loader->add_filter('prc_platform_pub_listing_default_args', $this, 'set_starting_defaults_for_pub_listing_query_args', 1, 1);
// $this->loader->add_filter( 'pre_render_block', $core_query, 'filter_pub_listing_query_args', 10, 3);
$loader->add_action( 'init', $this, 'register_assets' );
$loader->add_action( 'init', $this, 'hard_enable_enhanced_pagination', 100 );
$loader->add_action( 'enqueue_block_editor_assets', $this, 'register_editor_script');
$loader->add_filter( 'prc_platform_pub_listing_default_args', $this, 'set_starting_defaults_for_pub_listing_query_args', 1, 1 );
$loader->add_filter( 'pre_render_block', $this, 'filter_pub_listing_query_args', 10, 3 );

$loader->add_filter( 'render_block_data', $this, 'default_enhanced_pagination_on', 1001, 1);
$loader->add_filter('render_block_context', $this, 'hijack_query_block_context', 100, 3);
$loader->add_filter( 'render_block_data', $this, 'default_enhanced_pagination_on', 1001, 1 );
$loader->add_filter( 'render_block_context', $this, 'hijack_query_block_context', 100, 3 );

$loader->add_filter( 'rest_post_query', $this, 'filter_pub_listing_rest_query', 10, 2 );
// $this->loader->add_filter( 'query_loop_block_query_vars', $core_query, 'filter_pub_listing_query_args', 10, 2 );
$loader->add_action('pre_get_posts', $this, 'set_starting_defaults_for_post_type_for_pre_get_posts', 10, 1);
$loader->add_filter( 'block_type_metadata', $this, 'default_tax_query_to_OR', 100, 1);
$loader->add_action( 'pre_get_posts', $this, 'set_starting_defaults_for_post_type_for_pre_get_posts', 10, 1 );
$loader->add_filter( 'block_type_metadata', $this, 'default_tax_query_to_OR', 100, 1 );
$loader->add_filter( 'block_type_metadata_settings', $this, 'update_context', 100, 2 );
}
}
Expand Down
29 changes: 19 additions & 10 deletions blocks/core-query/src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,19 +30,18 @@ const PublicationListingTemplate = [
{
showLabel: true,
},
]
],
];

/**
* Publication Listing Query
* Changes the default query to only include posts that are published and have a parent, also sets the default post types to post, short-read, fact-sheet, interactives, and quizzes.
*/
const NAMESPACE = "prc-block/pub-listing-query"
const NAMESPACE = 'prc-block/pub-listing-query';
const pubListingVariation = {
name: NAMESPACE,
title: 'Publication Listing Query',
description:
'Query posts in the style of a "Publication Listing".',
description: 'Query posts in the style of a "Publication Listing".',
attributes: {
namespace: NAMESPACE,
query: {
Expand All @@ -55,8 +54,15 @@ const pubListingVariation = {
},
enhancedPagination: true,
},
allowedControls: ['order', 'taxQuery', 'search', 'author', 'sticky', 'inherit'],
isActive: ({query}) => {
allowedControls: [
'order',
'taxQuery',
'search',
'author',
'sticky',
'inherit',
],
isActive: ({ query }) => {
return query.isPubListingQuery;
},
innerBlocks: PublicationListingTemplate,
Expand All @@ -78,14 +84,17 @@ addFilter(
if (BLOCKNAME !== name || namespace !== NAMESPACE) {
return <BlockEdit {...props} />;
}
const blockAreaContextPostIds = useSelect(select => {
return select('prc-platform/block-area-context').getPostIds()
const blockAreaContextPostIds = useSelect((select) => {
return select('prc-platform/block-area-context').getPostIds();
});

const tmpExclude = attributes.query?.exclude || [];
attributes.query.exclude = [...blockAreaContextPostIds, ...tmpExclude];
attributes.query.exclude = [
...blockAreaContextPostIds,
...tmpExclude,
];

return <BlockEdit {...props}/>;
return <BlockEdit {...props} />;
};
}, 'withBlockAreaContextWatcher')
);
2 changes: 1 addition & 1 deletion blocks/grid-controller/src/block.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"apiVersion": 3,
"name": "prc-block/grid-controller",
"version": "0.1.0",
"title": "Grid",
"title": "Grid Columns",
"category": "design",
"description": "Display content in multiple columns using CSS grid with blocks added to each column.",
"keywords": [
Expand Down
2 changes: 1 addition & 1 deletion blocks/logo/build/index.asset.php
Original file line number Diff line number Diff line change
@@ -1 +1 @@
<?php return array('dependencies' => array('classnames', 'react', 'wp-block-editor', 'wp-blocks', 'wp-components', 'wp-data', 'wp-element', 'wp-polyfill'), 'version' => 'e14eaee38624a24afc15');
<?php return array('dependencies' => array('classnames', 'react', 'wp-block-editor', 'wp-blocks', 'wp-components', 'wp-data', 'wp-element', 'wp-hooks', 'wp-polyfill'), 'version' => '70e46b6d760fb4aae6bb');
2 changes: 1 addition & 1 deletion blocks/logo/build/index.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion blocks/logo/build/index.js.map

Large diffs are not rendered by default.

21 changes: 20 additions & 1 deletion blocks/logo/src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
* WordPress Dependencies
*/
import { registerBlockType } from '@wordpress/blocks';
import { addFilter } from '@wordpress/hooks';

/**
* Internal Dependencies
Expand Down Expand Up @@ -45,4 +46,22 @@ const settings = {
*/
registerBlockType(name, { ...metadata, ...settings });

// registerDashboardIcon();
/**
* Make mega menu available to core/navigation block
*/
addFilter(
'blocks.registerBlockType',
'prc-block-logo-add-to-navigation',
(blockSettings, blockName) => {
if (blockName === 'core/navigation') {
return {
...blockSettings,
allowedBlocks: [
...(blockSettings.allowedBlocks ?? []),
'prc-block/logo',
],
};
}
return blockSettings;
}
);
3 changes: 3 additions & 0 deletions blocks/navigation-mega-menu/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# Mega Menu Block

This is a fork of https://github.com/ndiego/mega-menu-block
71 changes: 71 additions & 0 deletions blocks/navigation-mega-menu/build/block.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
{
"$schema": "https://schemas.wp.org/trunk/block.json",
"apiVersion": 3,
"name": "prc-block/navigation-mega-menu",
"version": "0.1.0",
"title": "Navigation Mega Menu",
"category": "design",
"description": "Mega menu that supports multiple overlay types and animations.",
"parent": [
"core/navigation"
],
"example": {},
"attributes": {
"label": {
"type": "string"
},
"description": {
"type": "string"
},
"title": {
"type": "string"
},
"url": {
"type": "string"
},
"menuSlug": {
"type": "string"
},
"animation": {
"type": "string",
"enum": [
"fade",
"slide"
]
}
},
"supports": {
"html": false,
"interactivity": true,
"renaming": true,
"reusable": false,
"color": {
"background": true,
"text": true
},
"typography": {
"fontSize": true,
"lineHeight": true,
"__experimentalFontFamily": true,
"__experimentalFontWeight": true,
"__experimentalFontStyle": true,
"__experimentalTextTransform": true,
"__experimentalTextDecoration": true,
"__experimentalLetterSpacing": true,
"__experimentalDefaultControls": {
"fontSize": true
}
},
"__experimentalBorder": {
"color": true,
"width": true
},
"__experimentalSlashInserter": true
},
"textdomain": "prc-navigation-mega-menu-block",
"editorScript": "file:./index.js",
"editorStyle": "file:./index.css",
"style": "file:./style-index.css",
"render": "file:./render.php",
"viewScriptModule": "file:./view.js"
}
1 change: 1 addition & 0 deletions blocks/navigation-mega-menu/build/index.asset.php
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
<?php return array('dependencies' => array('classnames', 'prc-components', 'react', 'wp-block-editor', 'wp-blocks', 'wp-components', 'wp-core-data', 'wp-data', 'wp-element', 'wp-hooks', 'wp-i18n', 'wp-polyfill'), 'version' => '2b75d03da7399aa5f033');
1 change: 1 addition & 0 deletions blocks/navigation-mega-menu/build/index.css
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
.wp-block-prc-block-navigation-mega-menu__container{z-index:11!important}
Loading

0 comments on commit 5d6ec56

Please sign in to comment.