Making WordPress.org

Changeset 11116


Ignore:
Timestamp:
07/14/2021 02:33:29 PM (11 months ago)
Author:
ryelle
Message:

Pattern Directory: Sync with git WordPress/pattern-directory@274768973f555eaf35856299510e83e3e8510205

Location:
sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-patterns
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-patterns/build/index.asset.php

    r11114 r11116  
    1 <?php return array('dependencies' => array('lodash', 'react', 'wp-a11y', 'wp-api-fetch', 'wp-components', 'wp-compose', 'wp-core-data', 'wp-data', 'wp-data-controls', 'wp-element', 'wp-html-entities', 'wp-i18n', 'wp-keycodes', 'wp-polyfill', 'wp-primitives', 'wp-url'), 'version' => '1ecf0e6d85d330ba84dad2e603b05fde');
     1<?php return array('dependencies' => array('lodash', 'react', 'wp-a11y', 'wp-api-fetch', 'wp-components', 'wp-compose', 'wp-core-data', 'wp-data', 'wp-data-controls', 'wp-element', 'wp-html-entities', 'wp-i18n', 'wp-keycodes', 'wp-polyfill', 'wp-primitives', 'wp-url'), 'version' => 'dfdc4485e4a5c19ff90c9b383712c6bb');
  • sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-patterns/build/index.js

    r11114 r11116  
    75617561/***/ }),
    75627562
     7563/***/ "../../../../node_modules/dequal/dist/index.mjs":
     7564/*!****************************************************************************************!*\
     7565  !*** /Users/ryelle/Projects/Work/pattern-directory/node_modules/dequal/dist/index.mjs ***!
     7566  \****************************************************************************************/
     7567/*! exports provided: dequal */
     7568/***/ (function(__webpack_module__, __webpack_exports__, __webpack_require__) {
     7569
     7570"use strict";
     7571__webpack_require__.r(__webpack_exports__);
     7572/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "dequal", function() { return dequal; });
     7573var has = Object.prototype.hasOwnProperty;
     7574
     7575function find(iter, tar, key) {
     7576    for (key of iter.keys()) {
     7577        if (dequal(key, tar)) return key;
     7578    }
     7579}
     7580
     7581function dequal(foo, bar) {
     7582    var ctor, len, tmp;
     7583    if (foo === bar) return true;
     7584
     7585    if (foo && bar && (ctor=foo.constructor) === bar.constructor) {
     7586        if (ctor === Date) return foo.getTime() === bar.getTime();
     7587        if (ctor === RegExp) return foo.toString() === bar.toString();
     7588
     7589        if (ctor === Array) {
     7590            if ((len=foo.length) === bar.length) {
     7591                while (len-- && dequal(foo[len], bar[len]));
     7592            }
     7593            return len === -1;
     7594        }
     7595
     7596        if (ctor === Set) {
     7597            if (foo.size !== bar.size) {
     7598                return false;
     7599            }
     7600            for (len of foo) {
     7601                tmp = len;
     7602                if (tmp && typeof tmp === 'object') {
     7603                    tmp = find(bar, tmp);
     7604                    if (!tmp) return false;
     7605                }
     7606                if (!bar.has(tmp)) return false;
     7607            }
     7608            return true;
     7609        }
     7610
     7611        if (ctor === Map) {
     7612            if (foo.size !== bar.size) {
     7613                return false;
     7614            }
     7615            for (len of foo) {
     7616                tmp = len[0];
     7617                if (tmp && typeof tmp === 'object') {
     7618                    tmp = find(bar, tmp);
     7619                    if (!tmp) return false;
     7620                }
     7621                if (!dequal(len[1], bar.get(tmp))) {
     7622                    return false;
     7623                }
     7624            }
     7625            return true;
     7626        }
     7627
     7628        if (ctor === ArrayBuffer) {
     7629            foo = new Uint8Array(foo);
     7630            bar = new Uint8Array(bar);
     7631        } else if (ctor === DataView) {
     7632            if ((len=foo.byteLength) === bar.byteLength) {
     7633                while (len-- && foo.getInt8(len) === bar.getInt8(len));
     7634            }
     7635            return len === -1;
     7636        }
     7637
     7638        if (ArrayBuffer.isView(foo)) {
     7639            if ((len=foo.byteLength) === bar.byteLength) {
     7640                while (len-- && foo[len] === bar[len]);
     7641            }
     7642            return len === -1;
     7643        }
     7644
     7645        if (!ctor || typeof foo === 'object') {
     7646            len = 0;
     7647            for (ctor in foo) {
     7648                if (has.call(foo, ctor) && ++len && !has.call(bar, ctor)) return false;
     7649                if (!(ctor in bar) || !dequal(foo[ctor], bar[ctor])) return false;
     7650            }
     7651            return Object.keys(bar).length === len;
     7652        }
     7653    }
     7654
     7655    return foo !== foo && bar !== bar;
     7656}
     7657
     7658
     7659/***/ }),
     7660
    75637661/***/ "../../../../node_modules/react-use-gesture/dist/reactusegesture.esm.js":
    75647662/*!****************************************************************************************************************!*\
     
    1046010558/***/ }),
    1046110559
     10560/***/ "../../../../node_modules/use-deep-compare-effect/dist/use-deep-compare-effect.esm.js":
     10561/*!******************************************************************************************************************************!*\
     10562  !*** /Users/ryelle/Projects/Work/pattern-directory/node_modules/use-deep-compare-effect/dist/use-deep-compare-effect.esm.js ***!
     10563  \******************************************************************************************************************************/
     10564/*! exports provided: default, useDeepCompareEffectNoCheck */
     10565/***/ (function(module, __webpack_exports__, __webpack_require__) {
     10566
     10567"use strict";
     10568__webpack_require__.r(__webpack_exports__);
     10569/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "useDeepCompareEffectNoCheck", function() { return useDeepCompareEffectNoCheck; });
     10570/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ "react");
     10571/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);
     10572/* harmony import */ var dequal__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! dequal */ "../../../../node_modules/dequal/dist/index.mjs");
     10573
     10574
     10575
     10576function checkDeps(deps) {
     10577  if (!deps || !deps.length) {
     10578    throw new Error('useDeepCompareEffect should not be used with no dependencies. Use React.useEffect instead.');
     10579  }
     10580
     10581  if (deps.every(isPrimitive)) {
     10582    throw new Error('useDeepCompareEffect should not be used with dependencies that are all primitive values. Use React.useEffect instead.');
     10583  }
     10584}
     10585
     10586function isPrimitive(val) {
     10587  return val == null || /^[sbn]/.test(typeof val);
     10588}
     10589
     10590function useDeepCompareMemoize(value) {
     10591  var ref = Object(react__WEBPACK_IMPORTED_MODULE_0__["useRef"])();
     10592  var signalRef = Object(react__WEBPACK_IMPORTED_MODULE_0__["useRef"])(0);
     10593
     10594  if (!Object(dequal__WEBPACK_IMPORTED_MODULE_1__["dequal"])(value, ref.current)) {
     10595    ref.current = value;
     10596    signalRef.current += 1;
     10597  }
     10598
     10599  return [signalRef.current];
     10600}
     10601
     10602function useDeepCompareEffect(callback, dependencies) {
     10603  if (true) {
     10604    checkDeps(dependencies);
     10605  } // eslint-disable-next-line react-hooks/exhaustive-deps
     10606
     10607
     10608  return Object(react__WEBPACK_IMPORTED_MODULE_0__["useEffect"])(callback, useDeepCompareMemoize(dependencies));
     10609}
     10610
     10611function useDeepCompareEffectNoCheck(callback, dependencies) {
     10612  // eslint-disable-next-line react-hooks/exhaustive-deps
     10613  return Object(react__WEBPACK_IMPORTED_MODULE_0__["useEffect"])(callback, useDeepCompareMemoize(dependencies));
     10614}
     10615
     10616/* harmony default export */ __webpack_exports__["default"] = (useDeepCompareEffect);
     10617
     10618
     10619
     10620/***/ }),
     10621
    1046210622/***/ "./node_modules/classnames/index.js":
    1046310623/*!******************************************!*\
     
    1294213102"use strict";
    1294313103__webpack_require__.r(__webpack_exports__);
    12944 /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/element */ "@wordpress/element");
    12945 /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__);
     13104/* harmony import */ var use_deep_compare_effect__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! use-deep-compare-effect */ "../../../../node_modules/use-deep-compare-effect/dist/use-deep-compare-effect.esm.js");
    1294613105/* harmony import */ var _wordpress_data__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @wordpress/data */ "@wordpress/data");
    1294713106/* harmony import */ var _wordpress_data__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_wordpress_data__WEBPACK_IMPORTED_MODULE_1__);
     
    1295113110/* harmony import */ var _hooks__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../../hooks */ "./src/hooks/index.js");
    1295213111/* harmony import */ var _utils__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../../utils */ "./src/utils/index.js");
     13112/**
     13113 * External dependencies
     13114 */
     13115
    1295313116/**
    1295413117 * WordPress dependencies
     
    1302313186  if (myPatternStatus && 'page' !== myPatternStatus) {
    1302413187    query.status = myPatternStatus;
    13025   }
    13026 
    13027   Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["useEffect"])(() => {
     13188  } // Deep compare the object dependency, since `query` is a new object on every render.
     13189
     13190
     13191  Object(use_deep_compare_effect__WEBPACK_IMPORTED_MODULE_0__["default"])(() => {
    1302813192    if (queryReady) {
    1302913193      setCurrentQuery(query);
  • sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-patterns/package.json

    r11113 r11116  
    5757        "react-use-gesture": "9.1.3",
    5858        "rtlcss": "3.2.1",
    59         "sass": "1.34.1"
     59        "sass": "1.34.1",
     60        "use-deep-compare-effect": "1.6.1"
    6061    },
    6162    "eslintConfig": {
  • sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-patterns/src/components/query-monitor/index.js

    r11114 r11116  
     1/**
     2 * External dependencies
     3 */
     4import useDeepCompareEffect from 'use-deep-compare-effect';
     5
    16/**
    27 * WordPress dependencies
    38 */
    4 import { useEffect } from '@wordpress/element';
    59import { useDispatch, useSelect } from '@wordpress/data';
    610import { getQueryArgs } from '@wordpress/url';
     
    4044        [ categorySlug ]
    4145    );
     46
    4247    if ( categoryId ) {
    4348        query[ 'pattern-categories' ] = categoryId;
     
    6469    }
    6570
    66     useEffect( () => {
     71    // Deep compare the object dependency, since `query` is a new object on every render.
     72    useDeepCompareEffect( () => {
    6773        if ( queryReady ) {
    6874            setCurrentQuery( query );
Note: See TracChangeset for help on using the changeset viewer.