Skip to content

Commit

Permalink
See pewresearch/pewresearch-org@94b715b from refs/tags/v1.0.13
Browse files Browse the repository at this point in the history
  • Loading branch information
prcdevgitbot committed Aug 15, 2024
1 parent 695aa68 commit dd754d8
Show file tree
Hide file tree
Showing 34 changed files with 18,960 additions and 340 deletions.
20 changes: 18 additions & 2 deletions includes/block-utils/index.php
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
<?php
namespace PRC\Platform\Block_Utils;
use WP_HTML_Tag_Processor;
use WP_Error;
use WP_HTML_Tag_Processor, WP_Block_Type_Registry, WP_Error;

/**
* FOR EVERY PHP UTIL THERE MUST BE AN ACCOMPANYING JS UTIL
Expand Down Expand Up @@ -169,6 +168,23 @@ function get_block_gap_support_value($attributes, $dimension_to_return = false)
return preg_match('/^var:preset\|spacing\|\d+$/', $block_gap) ? 'var(--wp--preset--spacing--' . substr($block_gap, strrpos($block_gap, '|') + 1) . ')' : $block_gap;
}

function get_block_attributes($block_name, $given_attributes) {
// We need to get the block name, then we need to get the block.json, then we need to get the attributes from that
$block = WP_Block_Type_Registry::get_instance()->get_registered($block_name);
$attributes = null;
$attributes = $block->get_attributes();
$modified_attributes = [];
foreach($attributes as $attr_name => $attr_data) {
if (array_key_exists($attr_name, $given_attributes)) {
$modified_attributes[$attr_name] = $given_attributes[$attr_name];
} elseif (array_key_exists('default', $attr_data)) {
$modified_attributes[$attr_name] = $attr_data['default'];
} else {
$modified_attributes[$attr_name] = null;
}
}
return $modified_attributes;
}

/**
* Port of classNames JS library, modernized with PHP 8 features.
Expand Down
5 changes: 2 additions & 3 deletions includes/facets/blocks/facet-template/facet-template.php
Original file line number Diff line number Diff line change
Expand Up @@ -105,10 +105,10 @@ public function render_dropdown_facet($facet, $inner_blocks) {
public function render_checkbox_radio_facet($facet, $inner_blocks) {
$facet_choices = $facet['choices'];
$selected_choices = $facet['selected'];
$field_template = $inner_blocks[0];
$field_template = $inner_blocks[0]; // The innerblocks should contain the template for how this block should be repeated for each value, or $fact_choices.
$content = '';
$expanded_content = '';
// make sure $selected_choices are first in the $facet_choices array
// make sure $selected_choices are first in the $facet_choices array, for a better user experience
$blocks_to_generate = [];
foreach ($facet_choices as $choice) {
$field = $field_template;
Expand Down Expand Up @@ -227,7 +227,6 @@ public function render_date_range_facet($facet, $inner_blocks) {
}

public function render_search_facet($facet, $inner_blocks) {
do_action('qm/debug', print_r($facet, true));
return '<p>Search Facet Here</p>';
}

Expand Down
3 changes: 2 additions & 1 deletion includes/facets/blocks/facets-context-provider/src/view.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,8 @@ function constructNewUrl(selected = false) {
});
// Remove any query args on the current url.
const stableUrl = window.location.href.split('?')[0];
// If our url has /page/x/ in it, we need to remove that, we're sending the user back to the first page.
// If our url has /page/x/ in it, we need to remove that
// we're sending the user back to the first page.
const stableUrlClean = stableUrl.replace(/\/page\/\d+\//, '/');
const newUrl = addQueryArgs(stableUrlClean, tmp);
// console.log(
Expand Down
3 changes: 0 additions & 3 deletions includes/facets/cache/WIP.md

This file was deleted.

25 changes: 17 additions & 8 deletions includes/firebase/build/module.js
Original file line number Diff line number Diff line change
Expand Up @@ -38,10 +38,13 @@ var __webpack_exports__ = {};
__webpack_require__.d(__webpack_exports__, {
yA: () => (/* binding */ _app),
j2: () => (/* binding */ _auth),
R4: () => (/* binding */ _confirmPasswordReset),
C3: () => (/* binding */ _db),
hg: () => (/* binding */ _onAuthStateChanged),
J1: () => (/* binding */ _sendPasswordResetEmail),
x9: () => (/* binding */ _signInWithEmailAndPassword),
CI: () => (/* binding */ _signOut)
CI: () => (/* binding */ _signOut),
RE: () => (/* binding */ _verifyPasswordResetCode)
});

;// CONCATENATED MODULE: ./node_modules/@firebase/util/dist/index.esm2017.js
Expand Down Expand Up @@ -3144,7 +3147,7 @@ function isVersionServiceProvider(provider) {
}

const name$p = "@firebase/app";
const version$1 = "0.10.6";
const version$1 = "0.10.7";

/**
* @license
Expand Down Expand Up @@ -3213,7 +3216,7 @@ const name$2 = "@firebase/vertexai-preview";
const name$1 = "@firebase/firestore-compat";

const index_esm2017_name = "firebase";
const version = "10.12.3";
const version = "10.12.4";

/**
* @license
Expand Down Expand Up @@ -4230,7 +4233,7 @@ registerCoreComponents('');


var index_esm_name = "firebase";
var index_esm_version = "10.12.3";
var index_esm_version = "10.12.4";

/**
* @license
Expand Down Expand Up @@ -10422,7 +10425,7 @@ async function sendPasswordResetEmail(auth, email, actionCodeSettings) {
* @public
*/
async function confirmPasswordReset(auth, oobCode, newPassword) {
await resetPassword(getModularInstance(auth), {
await resetPassword(index_esm2017_getModularInstance(auth), {
oobCode,
newPassword
})
Expand Down Expand Up @@ -10457,7 +10460,7 @@ async function applyActionCode(auth, oobCode) {
* @public
*/
async function checkActionCode(auth, oobCode) {
const authModular = getModularInstance(auth);
const authModular = index_esm2017_getModularInstance(auth);
const response = await resetPassword(authModular, { oobCode });
// Email could be empty only if the request type is EMAIL_SIGNIN or
// VERIFY_AND_CHANGE_EMAIL.
Expand Down Expand Up @@ -10508,7 +10511,7 @@ async function checkActionCode(auth, oobCode) {
* @public
*/
async function verifyPasswordResetCode(auth, code) {
const { data } = await checkActionCode(getModularInstance(auth), code);
const { data } = await checkActionCode(index_esm2017_getModularInstance(auth), code);
// Email should always be present since a code was sent to it
return data.email;
}
Expand Down Expand Up @@ -29400,12 +29403,18 @@ const _auth = getAuth();
const _signInWithEmailAndPassword = signInWithEmailAndPassword;
const _onAuthStateChanged = onAuthStateChanged;
const _signOut = signOut;
const _sendPasswordResetEmail = sendPasswordResetEmail;
const _confirmPasswordReset = confirmPasswordReset;
const _verifyPasswordResetCode = verifyPasswordResetCode;
const _db = getDatabase();

var __webpack_exports__app = __webpack_exports__.yA;
var __webpack_exports__auth = __webpack_exports__.j2;
var __webpack_exports__confirmPasswordReset = __webpack_exports__.R4;
var __webpack_exports__getDatabase = __webpack_exports__.C3;
var __webpack_exports__onAuthStateChanged = __webpack_exports__.hg;
var __webpack_exports__sendPasswordResetEmail = __webpack_exports__.J1;
var __webpack_exports__signInWithEmailAndPassword = __webpack_exports__.x9;
var __webpack_exports__signOut = __webpack_exports__.CI;
export { __webpack_exports__app as app, __webpack_exports__auth as auth, __webpack_exports__getDatabase as getDatabase, __webpack_exports__onAuthStateChanged as onAuthStateChanged, __webpack_exports__signInWithEmailAndPassword as signInWithEmailAndPassword, __webpack_exports__signOut as signOut };
var __webpack_exports__verifyPasswordResetCode = __webpack_exports__.RE;
export { __webpack_exports__app as app, __webpack_exports__auth as auth, __webpack_exports__confirmPasswordReset as confirmPasswordReset, __webpack_exports__getDatabase as getDatabase, __webpack_exports__onAuthStateChanged as onAuthStateChanged, __webpack_exports__sendPasswordResetEmail as sendPasswordResetEmail, __webpack_exports__signInWithEmailAndPassword as signInWithEmailAndPassword, __webpack_exports__signOut as signOut, __webpack_exports__verifyPasswordResetCode as verifyPasswordResetCode };
2 changes: 1 addition & 1 deletion includes/firebase/build/module.min.asset.php
Original file line number Diff line number Diff line change
@@ -1 +1 @@
<?php return array('dependencies' => array(), 'version' => '7f705e4fa6a2b94b2bd8', 'type' => 'module');
<?php return array('dependencies' => array(), 'version' => '5d98a9eb029dbeca56fb', 'type' => 'module');
2 changes: 1 addition & 1 deletion includes/firebase/build/module.min.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion includes/firebase/build/module.min.js.map

Large diffs are not rendered by default.

Loading

0 comments on commit dd754d8

Please sign in to comment.