[ Index ]

PHP Cross Reference of WordPress

title

Body

[close]

/wp-includes/js/dist/ -> nux.js (source)

   1  this["wp"] = this["wp"] || {}; this["wp"]["nux"] =
   2  /******/ (function(modules) { // webpackBootstrap
   3  /******/     // The module cache
   4  /******/     var installedModules = {};
   5  /******/
   6  /******/     // The require function
   7  /******/ 	function __webpack_require__(moduleId) {
   8  /******/
   9  /******/         // Check if module is in cache
  10  /******/         if(installedModules[moduleId]) {
  11  /******/             return installedModules[moduleId].exports;
  12  /******/         }
  13  /******/         // Create a new module (and put it into the cache)
  14  /******/         var module = installedModules[moduleId] = {
  15  /******/             i: moduleId,
  16  /******/             l: false,
  17  /******/             exports: {}
  18  /******/         };
  19  /******/
  20  /******/         // Execute the module function
  21  /******/         modules[moduleId].call(module.exports, module, module.exports, __webpack_require__);
  22  /******/
  23  /******/         // Flag the module as loaded
  24  /******/         module.l = true;
  25  /******/
  26  /******/         // Return the exports of the module
  27  /******/         return module.exports;
  28  /******/     }
  29  /******/
  30  /******/
  31  /******/     // expose the modules object (__webpack_modules__)
  32  /******/     __webpack_require__.m = modules;
  33  /******/
  34  /******/     // expose the module cache
  35  /******/     __webpack_require__.c = installedModules;
  36  /******/
  37  /******/     // define getter function for harmony exports
  38  /******/     __webpack_require__.d = function(exports, name, getter) {
  39  /******/         if(!__webpack_require__.o(exports, name)) {
  40  /******/             Object.defineProperty(exports, name, { enumerable: true, get: getter });
  41  /******/         }
  42  /******/     };
  43  /******/
  44  /******/     // define __esModule on exports
  45  /******/     __webpack_require__.r = function(exports) {
  46  /******/         if(typeof Symbol !== 'undefined' && Symbol.toStringTag) {
  47  /******/             Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
  48  /******/         }
  49  /******/         Object.defineProperty(exports, '__esModule', { value: true });
  50  /******/     };
  51  /******/
  52  /******/     // create a fake namespace object
  53  /******/     // mode & 1: value is a module id, require it
  54  /******/     // mode & 2: merge all properties of value into the ns
  55  /******/     // mode & 4: return value when already ns object
  56  /******/     // mode & 8|1: behave like require
  57  /******/     __webpack_require__.t = function(value, mode) {
  58  /******/         if(mode & 1) value = __webpack_require__(value);
  59  /******/         if(mode & 8) return value;
  60  /******/         if((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;
  61  /******/         var ns = Object.create(null);
  62  /******/         __webpack_require__.r(ns);
  63  /******/         Object.defineProperty(ns, 'default', { enumerable: true, value: value });
  64  /******/         if(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));
  65  /******/         return ns;
  66  /******/     };
  67  /******/
  68  /******/     // getDefaultExport function for compatibility with non-harmony modules
  69  /******/     __webpack_require__.n = function(module) {
  70  /******/         var getter = module && module.__esModule ?
  71  /******/ 			function getDefault() { return module['default']; } :
  72  /******/ 			function getModuleExports() { return module; };
  73  /******/         __webpack_require__.d(getter, 'a', getter);
  74  /******/         return getter;
  75  /******/     };
  76  /******/
  77  /******/     // Object.prototype.hasOwnProperty.call
  78  /******/     __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };
  79  /******/
  80  /******/     // __webpack_public_path__
  81  /******/     __webpack_require__.p = "";
  82  /******/
  83  /******/
  84  /******/     // Load entry module and return exports
  85  /******/     return __webpack_require__(__webpack_require__.s = 479);
  86  /******/ })
  87  /************************************************************************/
  88  /******/ ({
  89  
  90  /***/ 0:
  91  /***/ (function(module, exports) {
  92  
  93  (function() { module.exports = window["wp"]["element"]; }());
  94  
  95  /***/ }),
  96  
  97  /***/ 1:
  98  /***/ (function(module, exports) {
  99  
 100  (function() { module.exports = window["wp"]["i18n"]; }());
 101  
 102  /***/ }),
 103  
 104  /***/ 11:
 105  /***/ (function(module, __webpack_exports__, __webpack_require__) {
 106  
 107  "use strict";
 108  
 109  // EXPORTS
 110  __webpack_require__.d(__webpack_exports__, "a", function() { return /* binding */ _slicedToArray; });
 111  
 112  // EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/arrayWithHoles.js
 113  var arrayWithHoles = __webpack_require__(38);
 114  
 115  // CONCATENATED MODULE: ./node_modules/@babel/runtime/helpers/esm/iterableToArrayLimit.js
 116  function _iterableToArrayLimit(arr, i) {
 117    if (typeof Symbol === "undefined" || !(Symbol.iterator in Object(arr))) return;
 118    var _arr = [];
 119    var _n = true;
 120    var _d = false;
 121    var _e = undefined;
 122  
 123    try {
 124      for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) {
 125        _arr.push(_s.value);
 126  
 127        if (i && _arr.length === i) break;
 128      }
 129    } catch (err) {
 130      _d = true;
 131      _e = err;
 132    } finally {
 133      try {
 134        if (!_n && _i["return"] != null) _i["return"]();
 135      } finally {
 136        if (_d) throw _e;
 137      }
 138    }
 139  
 140    return _arr;
 141  }
 142  // EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/unsupportedIterableToArray.js
 143  var unsupportedIterableToArray = __webpack_require__(31);
 144  
 145  // EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/nonIterableRest.js
 146  var nonIterableRest = __webpack_require__(39);
 147  
 148  // CONCATENATED MODULE: ./node_modules/@babel/runtime/helpers/esm/slicedToArray.js
 149  
 150  
 151  
 152  
 153  function _slicedToArray(arr, i) {
 154    return Object(arrayWithHoles["a" /* default */])(arr) || _iterableToArrayLimit(arr, i) || Object(unsupportedIterableToArray["a" /* default */])(arr, i) || Object(nonIterableRest["a" /* default */])();
 155  }
 156  
 157  /***/ }),
 158  
 159  /***/ 12:
 160  /***/ (function(module, exports) {
 161  
 162  (function() { module.exports = window["wp"]["compose"]; }());
 163  
 164  /***/ }),
 165  
 166  /***/ 15:
 167  /***/ (function(module, __webpack_exports__, __webpack_require__) {
 168  
 169  "use strict";
 170  
 171  // EXPORTS
 172  __webpack_require__.d(__webpack_exports__, "a", function() { return /* binding */ _toConsumableArray; });
 173  
 174  // EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/arrayLikeToArray.js
 175  var arrayLikeToArray = __webpack_require__(24);
 176  
 177  // CONCATENATED MODULE: ./node_modules/@babel/runtime/helpers/esm/arrayWithoutHoles.js
 178  
 179  function _arrayWithoutHoles(arr) {
 180    if (Array.isArray(arr)) return Object(arrayLikeToArray["a" /* default */])(arr);
 181  }
 182  // EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/iterableToArray.js
 183  var iterableToArray = __webpack_require__(37);
 184  
 185  // EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/unsupportedIterableToArray.js
 186  var unsupportedIterableToArray = __webpack_require__(31);
 187  
 188  // CONCATENATED MODULE: ./node_modules/@babel/runtime/helpers/esm/nonIterableSpread.js
 189  function _nonIterableSpread() {
 190    throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
 191  }
 192  // CONCATENATED MODULE: ./node_modules/@babel/runtime/helpers/esm/toConsumableArray.js
 193  
 194  
 195  
 196  
 197  function _toConsumableArray(arr) {
 198    return _arrayWithoutHoles(arr) || Object(iterableToArray["a" /* default */])(arr) || Object(unsupportedIterableToArray["a" /* default */])(arr) || _nonIterableSpread();
 199  }
 200  
 201  /***/ }),
 202  
 203  /***/ 160:
 204  /***/ (function(module, __webpack_exports__, __webpack_require__) {
 205  
 206  "use strict";
 207  /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(0);
 208  /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__);
 209  /* harmony import */ var _wordpress_primitives__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(7);
 210  /* harmony import */ var _wordpress_primitives__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_wordpress_primitives__WEBPACK_IMPORTED_MODULE_1__);
 211  
 212  
 213  /**
 214   * WordPress dependencies
 215   */
 216  
 217  var close = Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])(_wordpress_primitives__WEBPACK_IMPORTED_MODULE_1__["SVG"], {
 218    xmlns: "http://www.w3.org/2000/svg",
 219    viewBox: "0 0 24 24"
 220  }, Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])(_wordpress_primitives__WEBPACK_IMPORTED_MODULE_1__["Path"], {
 221    d: "M13 11.8l6.1-6.3-1-1-6.1 6.2-6.1-6.2-1 1 6.1 6.3-6.5 6.7 1 1 6.5-6.6 6.5 6.6 1-1z"
 222  }));
 223  /* harmony default export */ __webpack_exports__["a"] = (close);
 224  
 225  
 226  /***/ }),
 227  
 228  /***/ 2:
 229  /***/ (function(module, exports) {
 230  
 231  (function() { module.exports = window["lodash"]; }());
 232  
 233  /***/ }),
 234  
 235  /***/ 24:
 236  /***/ (function(module, __webpack_exports__, __webpack_require__) {
 237  
 238  "use strict";
 239  /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return _arrayLikeToArray; });
 240  function _arrayLikeToArray(arr, len) {
 241    if (len == null || len > arr.length) len = arr.length;
 242  
 243    for (var i = 0, arr2 = new Array(len); i < len; i++) {
 244      arr2[i] = arr[i];
 245    }
 246  
 247    return arr2;
 248  }
 249  
 250  /***/ }),
 251  
 252  /***/ 3:
 253  /***/ (function(module, exports) {
 254  
 255  (function() { module.exports = window["wp"]["components"]; }());
 256  
 257  /***/ }),
 258  
 259  /***/ 31:
 260  /***/ (function(module, __webpack_exports__, __webpack_require__) {
 261  
 262  "use strict";
 263  /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return _unsupportedIterableToArray; });
 264  /* harmony import */ var _babel_runtime_helpers_esm_arrayLikeToArray__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(24);
 265  
 266  function _unsupportedIterableToArray(o, minLen) {
 267    if (!o) return;
 268    if (typeof o === "string") return Object(_babel_runtime_helpers_esm_arrayLikeToArray__WEBPACK_IMPORTED_MODULE_0__[/* default */ "a"])(o, minLen);
 269    var n = Object.prototype.toString.call(o).slice(8, -1);
 270    if (n === "Object" && o.constructor) n = o.constructor.name;
 271    if (n === "Map" || n === "Set") return Array.from(o);
 272    if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return Object(_babel_runtime_helpers_esm_arrayLikeToArray__WEBPACK_IMPORTED_MODULE_0__[/* default */ "a"])(o, minLen);
 273  }
 274  
 275  /***/ }),
 276  
 277  /***/ 35:
 278  /***/ (function(module, exports) {
 279  
 280  (function() { module.exports = window["wp"]["deprecated"]; }());
 281  
 282  /***/ }),
 283  
 284  /***/ 37:
 285  /***/ (function(module, __webpack_exports__, __webpack_require__) {
 286  
 287  "use strict";
 288  /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return _iterableToArray; });
 289  function _iterableToArray(iter) {
 290    if (typeof Symbol !== "undefined" && Symbol.iterator in Object(iter)) return Array.from(iter);
 291  }
 292  
 293  /***/ }),
 294  
 295  /***/ 38:
 296  /***/ (function(module, __webpack_exports__, __webpack_require__) {
 297  
 298  "use strict";
 299  /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return _arrayWithHoles; });
 300  function _arrayWithHoles(arr) {
 301    if (Array.isArray(arr)) return arr;
 302  }
 303  
 304  /***/ }),
 305  
 306  /***/ 39:
 307  /***/ (function(module, __webpack_exports__, __webpack_require__) {
 308  
 309  "use strict";
 310  /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return _nonIterableRest; });
 311  function _nonIterableRest() {
 312    throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
 313  }
 314  
 315  /***/ }),
 316  
 317  /***/ 4:
 318  /***/ (function(module, exports) {
 319  
 320  (function() { module.exports = window["wp"]["data"]; }());
 321  
 322  /***/ }),
 323  
 324  /***/ 41:
 325  /***/ (function(module, __webpack_exports__, __webpack_require__) {
 326  
 327  "use strict";
 328  
 329  
 330  var LEAF_KEY, hasWeakMap;
 331  
 332  /**
 333   * Arbitrary value used as key for referencing cache object in WeakMap tree.
 334   *
 335   * @type {Object}
 336   */
 337  LEAF_KEY = {};
 338  
 339  /**
 340   * Whether environment supports WeakMap.
 341   *
 342   * @type {boolean}
 343   */
 344  hasWeakMap = typeof WeakMap !== 'undefined';
 345  
 346  /**
 347   * Returns the first argument as the sole entry in an array.
 348   *
 349   * @param {*} value Value to return.
 350   *
 351   * @return {Array} Value returned as entry in array.
 352   */
 353  function arrayOf( value ) {
 354      return [ value ];
 355  }
 356  
 357  /**
 358   * Returns true if the value passed is object-like, or false otherwise. A value
 359   * is object-like if it can support property assignment, e.g. object or array.
 360   *
 361   * @param {*} value Value to test.
 362   *
 363   * @return {boolean} Whether value is object-like.
 364   */
 365  function isObjectLike( value ) {
 366      return !! value && 'object' === typeof value;
 367  }
 368  
 369  /**
 370   * Creates and returns a new cache object.
 371   *
 372   * @return {Object} Cache object.
 373   */
 374  function createCache() {
 375      var cache = {
 376          clear: function() {
 377              cache.head = null;
 378          },
 379      };
 380  
 381      return cache;
 382  }
 383  
 384  /**
 385   * Returns true if entries within the two arrays are strictly equal by
 386   * reference from a starting index.
 387   *
 388   * @param {Array}  a         First array.
 389   * @param {Array}  b         Second array.
 390   * @param {number} fromIndex Index from which to start comparison.
 391   *
 392   * @return {boolean} Whether arrays are shallowly equal.
 393   */
 394  function isShallowEqual( a, b, fromIndex ) {
 395      var i;
 396  
 397      if ( a.length !== b.length ) {
 398          return false;
 399      }
 400  
 401      for ( i = fromIndex; i < a.length; i++ ) {
 402          if ( a[ i ] !== b[ i ] ) {
 403              return false;
 404          }
 405      }
 406  
 407      return true;
 408  }
 409  
 410  /**
 411   * Returns a memoized selector function. The getDependants function argument is
 412   * called before the memoized selector and is expected to return an immutable
 413   * reference or array of references on which the selector depends for computing
 414   * its own return value. The memoize cache is preserved only as long as those
 415   * dependant references remain the same. If getDependants returns a different
 416   * reference(s), the cache is cleared and the selector value regenerated.
 417   *
 418   * @param {Function} selector      Selector function.
 419   * @param {Function} getDependants Dependant getter returning an immutable
 420   *                                 reference or array of reference used in
 421   *                                 cache bust consideration.
 422   *
 423   * @return {Function} Memoized selector.
 424   */
 425  /* harmony default export */ __webpack_exports__["a"] = (function( selector, getDependants ) {
 426      var rootCache, getCache;
 427  
 428      // Use object source as dependant if getter not provided
 429      if ( ! getDependants ) {
 430          getDependants = arrayOf;
 431      }
 432  
 433      /**
 434       * Returns the root cache. If WeakMap is supported, this is assigned to the
 435       * root WeakMap cache set, otherwise it is a shared instance of the default
 436       * cache object.
 437       *
 438       * @return {(WeakMap|Object)} Root cache object.
 439       */
 440  	function getRootCache() {
 441          return rootCache;
 442      }
 443  
 444      /**
 445       * Returns the cache for a given dependants array. When possible, a WeakMap
 446       * will be used to create a unique cache for each set of dependants. This
 447       * is feasible due to the nature of WeakMap in allowing garbage collection
 448       * to occur on entries where the key object is no longer referenced. Since
 449       * WeakMap requires the key to be an object, this is only possible when the
 450       * dependant is object-like. The root cache is created as a hierarchy where
 451       * each top-level key is the first entry in a dependants set, the value a
 452       * WeakMap where each key is the next dependant, and so on. This continues
 453       * so long as the dependants are object-like. If no dependants are object-
 454       * like, then the cache is shared across all invocations.
 455       *
 456       * @see isObjectLike
 457       *
 458       * @param {Array} dependants Selector dependants.
 459       *
 460       * @return {Object} Cache object.
 461       */
 462  	function getWeakMapCache( dependants ) {
 463          var caches = rootCache,
 464              isUniqueByDependants = true,
 465              i, dependant, map, cache;
 466  
 467          for ( i = 0; i < dependants.length; i++ ) {
 468              dependant = dependants[ i ];
 469  
 470              // Can only compose WeakMap from object-like key.
 471              if ( ! isObjectLike( dependant ) ) {
 472                  isUniqueByDependants = false;
 473                  break;
 474              }
 475  
 476              // Does current segment of cache already have a WeakMap?
 477              if ( caches.has( dependant ) ) {
 478                  // Traverse into nested WeakMap.
 479                  caches = caches.get( dependant );
 480              } else {
 481                  // Create, set, and traverse into a new one.
 482                  map = new WeakMap();
 483                  caches.set( dependant, map );
 484                  caches = map;
 485              }
 486          }
 487  
 488          // We use an arbitrary (but consistent) object as key for the last item
 489          // in the WeakMap to serve as our running cache.
 490          if ( ! caches.has( LEAF_KEY ) ) {
 491              cache = createCache();
 492              cache.isUniqueByDependants = isUniqueByDependants;
 493              caches.set( LEAF_KEY, cache );
 494          }
 495  
 496          return caches.get( LEAF_KEY );
 497      }
 498  
 499      // Assign cache handler by availability of WeakMap
 500      getCache = hasWeakMap ? getWeakMapCache : getRootCache;
 501  
 502      /**
 503       * Resets root memoization cache.
 504       */
 505  	function clear() {
 506          rootCache = hasWeakMap ? new WeakMap() : createCache();
 507      }
 508  
 509      // eslint-disable-next-line jsdoc/check-param-names
 510      /**
 511       * The augmented selector call, considering first whether dependants have
 512       * changed before passing it to underlying memoize function.
 513       *
 514       * @param {Object} source    Source object for derivation.
 515       * @param {...*}   extraArgs Additional arguments to pass to selector.
 516       *
 517       * @return {*} Selector result.
 518       */
 519  	function callSelector( /* source, ...extraArgs */ ) {
 520          var len = arguments.length,
 521              cache, node, i, args, dependants;
 522  
 523          // Create copy of arguments (avoid leaking deoptimization).
 524          args = new Array( len );
 525          for ( i = 0; i < len; i++ ) {
 526              args[ i ] = arguments[ i ];
 527          }
 528  
 529          dependants = getDependants.apply( null, args );
 530          cache = getCache( dependants );
 531  
 532          // If not guaranteed uniqueness by dependants (primitive type or lack
 533          // of WeakMap support), shallow compare against last dependants and, if
 534          // references have changed, destroy cache to recalculate result.
 535          if ( ! cache.isUniqueByDependants ) {
 536              if ( cache.lastDependants && ! isShallowEqual( dependants, cache.lastDependants, 0 ) ) {
 537                  cache.clear();
 538              }
 539  
 540              cache.lastDependants = dependants;
 541          }
 542  
 543          node = cache.head;
 544          while ( node ) {
 545              // Check whether node arguments match arguments
 546              if ( ! isShallowEqual( node.args, args, 1 ) ) {
 547                  node = node.next;
 548                  continue;
 549              }
 550  
 551              // At this point we can assume we've found a match
 552  
 553              // Surface matched node to head if not already
 554              if ( node !== cache.head ) {
 555                  // Adjust siblings to point to each other.
 556                  node.prev.next = node.next;
 557                  if ( node.next ) {
 558                      node.next.prev = node.prev;
 559                  }
 560  
 561                  node.next = cache.head;
 562                  node.prev = null;
 563                  cache.head.prev = node;
 564                  cache.head = node;
 565              }
 566  
 567              // Return immediately
 568              return node.val;
 569          }
 570  
 571          // No cached value found. Continue to insertion phase:
 572  
 573          node = {
 574              // Generate the result from original function
 575              val: selector.apply( null, args ),
 576          };
 577  
 578          // Avoid including the source object in the cache.
 579          args[ 0 ] = null;
 580          node.args = args;
 581  
 582          // Don't need to check whether node is already head, since it would
 583          // have been returned above already if it was
 584  
 585          // Shift existing head down list
 586          if ( cache.head ) {
 587              cache.head.prev = node;
 588              node.next = cache.head;
 589          }
 590  
 591          cache.head = node;
 592  
 593          return node.val;
 594      }
 595  
 596      callSelector.getDependants = getDependants;
 597      callSelector.clear = clear;
 598      clear();
 599  
 600      return callSelector;
 601  });
 602  
 603  
 604  /***/ }),
 605  
 606  /***/ 479:
 607  /***/ (function(module, __webpack_exports__, __webpack_require__) {
 608  
 609  "use strict";
 610  // ESM COMPAT FLAG
 611  __webpack_require__.r(__webpack_exports__);
 612  
 613  // EXPORTS
 614  __webpack_require__.d(__webpack_exports__, "store", function() { return /* reexport */ store; });
 615  __webpack_require__.d(__webpack_exports__, "DotTip", function() { return /* reexport */ dot_tip; });
 616  
 617  // NAMESPACE OBJECT: ./node_modules/@wordpress/nux/build-module/store/actions.js
 618  var actions_namespaceObject = {};
 619  __webpack_require__.r(actions_namespaceObject);
 620  __webpack_require__.d(actions_namespaceObject, "triggerGuide", function() { return triggerGuide; });
 621  __webpack_require__.d(actions_namespaceObject, "dismissTip", function() { return dismissTip; });
 622  __webpack_require__.d(actions_namespaceObject, "disableTips", function() { return disableTips; });
 623  __webpack_require__.d(actions_namespaceObject, "enableTips", function() { return enableTips; });
 624  
 625  // NAMESPACE OBJECT: ./node_modules/@wordpress/nux/build-module/store/selectors.js
 626  var selectors_namespaceObject = {};
 627  __webpack_require__.r(selectors_namespaceObject);
 628  __webpack_require__.d(selectors_namespaceObject, "getAssociatedGuide", function() { return getAssociatedGuide; });
 629  __webpack_require__.d(selectors_namespaceObject, "isTipVisible", function() { return isTipVisible; });
 630  __webpack_require__.d(selectors_namespaceObject, "areTipsEnabled", function() { return selectors_areTipsEnabled; });
 631  
 632  // EXTERNAL MODULE: external ["wp","deprecated"]
 633  var external_wp_deprecated_ = __webpack_require__(35);
 634  var external_wp_deprecated_default = /*#__PURE__*/__webpack_require__.n(external_wp_deprecated_);
 635  
 636  // EXTERNAL MODULE: external ["wp","data"]
 637  var external_wp_data_ = __webpack_require__(4);
 638  
 639  // EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/defineProperty.js
 640  var defineProperty = __webpack_require__(5);
 641  
 642  // EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/toConsumableArray.js + 2 modules
 643  var toConsumableArray = __webpack_require__(15);
 644  
 645  // CONCATENATED MODULE: ./node_modules/@wordpress/nux/build-module/store/reducer.js
 646  
 647  
 648  
 649  function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; }
 650  
 651  function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { Object(defineProperty["a" /* default */])(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
 652  
 653  /**
 654   * WordPress dependencies
 655   */
 656  
 657  /**
 658   * Reducer that tracks which tips are in a guide. Each guide is represented by
 659   * an array which contains the tip identifiers contained within that guide.
 660   *
 661   * @param {Array} state  Current state.
 662   * @param {Object} action Dispatched action.
 663   *
 664   * @return {Array} Updated state.
 665   */
 666  
 667  function guides() {
 668    var state = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];
 669    var action = arguments.length > 1 ? arguments[1] : undefined;
 670  
 671    switch (action.type) {
 672      case 'TRIGGER_GUIDE':
 673        return [].concat(Object(toConsumableArray["a" /* default */])(state), [action.tipIds]);
 674    }
 675  
 676    return state;
 677  }
 678  /**
 679   * Reducer that tracks whether or not tips are globally enabled.
 680   *
 681   * @param {boolean} state Current state.
 682   * @param {Object} action Dispatched action.
 683   *
 684   * @return {boolean} Updated state.
 685   */
 686  
 687  function areTipsEnabled() {
 688    var state = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : true;
 689    var action = arguments.length > 1 ? arguments[1] : undefined;
 690  
 691    switch (action.type) {
 692      case 'DISABLE_TIPS':
 693        return false;
 694  
 695      case 'ENABLE_TIPS':
 696        return true;
 697    }
 698  
 699    return state;
 700  }
 701  /**
 702   * Reducer that tracks which tips have been dismissed. If the state object
 703   * contains a tip identifier, then that tip is dismissed.
 704   *
 705   * @param {Object} state  Current state.
 706   * @param {Object} action Dispatched action.
 707   *
 708   * @return {Object} Updated state.
 709   */
 710  
 711  function dismissedTips() {
 712    var state = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
 713    var action = arguments.length > 1 ? arguments[1] : undefined;
 714  
 715    switch (action.type) {
 716      case 'DISMISS_TIP':
 717        return _objectSpread(_objectSpread({}, state), {}, Object(defineProperty["a" /* default */])({}, action.id, true));
 718  
 719      case 'ENABLE_TIPS':
 720        return {};
 721    }
 722  
 723    return state;
 724  }
 725  var preferences = Object(external_wp_data_["combineReducers"])({
 726    areTipsEnabled: areTipsEnabled,
 727    dismissedTips: dismissedTips
 728  });
 729  /* harmony default export */ var reducer = (Object(external_wp_data_["combineReducers"])({
 730    guides: guides,
 731    preferences: preferences
 732  }));
 733  
 734  // CONCATENATED MODULE: ./node_modules/@wordpress/nux/build-module/store/actions.js
 735  /**
 736   * Returns an action object that, when dispatched, presents a guide that takes
 737   * the user through a series of tips step by step.
 738   *
 739   * @param {string[]} tipIds Which tips to show in the guide.
 740   *
 741   * @return {Object} Action object.
 742   */
 743  function triggerGuide(tipIds) {
 744    return {
 745      type: 'TRIGGER_GUIDE',
 746      tipIds: tipIds
 747    };
 748  }
 749  /**
 750   * Returns an action object that, when dispatched, dismisses the given tip. A
 751   * dismissed tip will not show again.
 752   *
 753   * @param {string} id The tip to dismiss.
 754   *
 755   * @return {Object} Action object.
 756   */
 757  
 758  function dismissTip(id) {
 759    return {
 760      type: 'DISMISS_TIP',
 761      id: id
 762    };
 763  }
 764  /**
 765   * Returns an action object that, when dispatched, prevents all tips from
 766   * showing again.
 767   *
 768   * @return {Object} Action object.
 769   */
 770  
 771  function disableTips() {
 772    return {
 773      type: 'DISABLE_TIPS'
 774    };
 775  }
 776  /**
 777   * Returns an action object that, when dispatched, makes all tips show again.
 778   *
 779   * @return {Object} Action object.
 780   */
 781  
 782  function enableTips() {
 783    return {
 784      type: 'ENABLE_TIPS'
 785    };
 786  }
 787  
 788  // EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/slicedToArray.js + 1 modules
 789  var slicedToArray = __webpack_require__(11);
 790  
 791  // EXTERNAL MODULE: ./node_modules/rememo/es/rememo.js
 792  var rememo = __webpack_require__(41);
 793  
 794  // EXTERNAL MODULE: external "lodash"
 795  var external_lodash_ = __webpack_require__(2);
 796  
 797  // CONCATENATED MODULE: ./node_modules/@wordpress/nux/build-module/store/selectors.js
 798  
 799  
 800  function _createForOfIteratorHelper(o, allowArrayLike) { var it; if (typeof Symbol === "undefined" || o[Symbol.iterator] == null) { if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") { if (it) o = it; var i = 0; var F = function F() {}; return { s: F, n: function n() { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }, e: function e(_e) { throw _e; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var normalCompletion = true, didErr = false, err; return { s: function s() { it = o[Symbol.iterator](); }, n: function n() { var step = it.next(); normalCompletion = step.done; return step; }, e: function e(_e2) { didErr = true; err = _e2; }, f: function f() { try { if (!normalCompletion && it.return != null) it.return(); } finally { if (didErr) throw err; } } }; }
 801  
 802  function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
 803  
 804  function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }
 805  
 806  /**
 807   * External dependencies
 808   */
 809  
 810  
 811  /**
 812   * An object containing information about a guide.
 813   *
 814   * @typedef {Object} NUXGuideInfo
 815   * @property {string[]} tipIds       Which tips the guide contains.
 816   * @property {?string}  currentTipId The guide's currently showing tip.
 817   * @property {?string}  nextTipId    The guide's next tip to show.
 818   */
 819  
 820  /**
 821   * Returns an object describing the guide, if any, that the given tip is a part
 822   * of.
 823   *
 824   * @param {Object} state Global application state.
 825   * @param {string} tipId The tip to query.
 826   *
 827   * @return {?NUXGuideInfo} Information about the associated guide.
 828   */
 829  
 830  var getAssociatedGuide = Object(rememo["a" /* default */])(function (state, tipId) {
 831    var _iterator = _createForOfIteratorHelper(state.guides),
 832        _step;
 833  
 834    try {
 835      for (_iterator.s(); !(_step = _iterator.n()).done;) {
 836        var tipIds = _step.value;
 837  
 838        if (Object(external_lodash_["includes"])(tipIds, tipId)) {
 839          var nonDismissedTips = Object(external_lodash_["difference"])(tipIds, Object(external_lodash_["keys"])(state.preferences.dismissedTips));
 840  
 841          var _nonDismissedTips = Object(slicedToArray["a" /* default */])(nonDismissedTips, 2),
 842              _nonDismissedTips$ = _nonDismissedTips[0],
 843              currentTipId = _nonDismissedTips$ === void 0 ? null : _nonDismissedTips$,
 844              _nonDismissedTips$2 = _nonDismissedTips[1],
 845              nextTipId = _nonDismissedTips$2 === void 0 ? null : _nonDismissedTips$2;
 846  
 847          return {
 848            tipIds: tipIds,
 849            currentTipId: currentTipId,
 850            nextTipId: nextTipId
 851          };
 852        }
 853      }
 854    } catch (err) {
 855      _iterator.e(err);
 856    } finally {
 857      _iterator.f();
 858    }
 859  
 860    return null;
 861  }, function (state) {
 862    return [state.guides, state.preferences.dismissedTips];
 863  });
 864  /**
 865   * Determines whether or not the given tip is showing. Tips are hidden if they
 866   * are disabled, have been dismissed, or are not the current tip in any
 867   * guide that they have been added to.
 868   *
 869   * @param {Object} state Global application state.
 870   * @param {string} tipId The tip to query.
 871   *
 872   * @return {boolean} Whether or not the given tip is showing.
 873   */
 874  
 875  function isTipVisible(state, tipId) {
 876    if (!state.preferences.areTipsEnabled) {
 877      return false;
 878    }
 879  
 880    if (Object(external_lodash_["has"])(state.preferences.dismissedTips, [tipId])) {
 881      return false;
 882    }
 883  
 884    var associatedGuide = getAssociatedGuide(state, tipId);
 885  
 886    if (associatedGuide && associatedGuide.currentTipId !== tipId) {
 887      return false;
 888    }
 889  
 890    return true;
 891  }
 892  /**
 893   * Returns whether or not tips are globally enabled.
 894   *
 895   * @param {Object} state Global application state.
 896   *
 897   * @return {boolean} Whether tips are globally enabled.
 898   */
 899  
 900  function selectors_areTipsEnabled(state) {
 901    return state.preferences.areTipsEnabled;
 902  }
 903  
 904  // CONCATENATED MODULE: ./node_modules/@wordpress/nux/build-module/store/index.js
 905  /**
 906   * WordPress dependencies
 907   */
 908  
 909  /**
 910   * Internal dependencies
 911   */
 912  
 913  
 914  
 915  
 916  var STORE_NAME = 'core/nux';
 917  /**
 918   * Store definition for the nux namespace.
 919   *
 920   * @see https://github.com/WordPress/gutenberg/blob/HEAD/packages/data/README.md#createReduxStore
 921   *
 922   * @type {Object}
 923   */
 924  
 925  var store = Object(external_wp_data_["createReduxStore"])(STORE_NAME, {
 926    reducer: reducer,
 927    actions: actions_namespaceObject,
 928    selectors: selectors_namespaceObject,
 929    persist: ['preferences']
 930  }); // Once we build a more generic persistence plugin that works across types of stores
 931  // we'd be able to replace this with a register call.
 932  
 933  Object(external_wp_data_["registerStore"])(STORE_NAME, {
 934    reducer: reducer,
 935    actions: actions_namespaceObject,
 936    selectors: selectors_namespaceObject,
 937    persist: ['preferences']
 938  });
 939  
 940  // EXTERNAL MODULE: external ["wp","element"]
 941  var external_wp_element_ = __webpack_require__(0);
 942  
 943  // EXTERNAL MODULE: external ["wp","compose"]
 944  var external_wp_compose_ = __webpack_require__(12);
 945  
 946  // EXTERNAL MODULE: external ["wp","components"]
 947  var external_wp_components_ = __webpack_require__(3);
 948  
 949  // EXTERNAL MODULE: external ["wp","i18n"]
 950  var external_wp_i18n_ = __webpack_require__(1);
 951  
 952  // EXTERNAL MODULE: ./node_modules/@wordpress/icons/build-module/library/close.js
 953  var library_close = __webpack_require__(160);
 954  
 955  // CONCATENATED MODULE: ./node_modules/@wordpress/nux/build-module/components/dot-tip/index.js
 956  
 957  
 958  /**
 959   * WordPress dependencies
 960   */
 961  
 962  
 963  
 964  
 965  
 966  
 967  
 968  function onClick(event) {
 969    // Tips are often nested within buttons. We stop propagation so that clicking
 970    // on a tip doesn't result in the button being clicked.
 971    event.stopPropagation();
 972  }
 973  
 974  function DotTip(_ref) {
 975    var _ref$position = _ref.position,
 976        position = _ref$position === void 0 ? 'middle right' : _ref$position,
 977        children = _ref.children,
 978        isVisible = _ref.isVisible,
 979        hasNextTip = _ref.hasNextTip,
 980        onDismiss = _ref.onDismiss,
 981        onDisable = _ref.onDisable;
 982    var anchorParent = Object(external_wp_element_["useRef"])(null);
 983    var onFocusOutsideCallback = Object(external_wp_element_["useCallback"])(function (event) {
 984      if (!anchorParent.current) {
 985        return;
 986      }
 987  
 988      if (anchorParent.current.contains(event.relatedTarget)) {
 989        return;
 990      }
 991  
 992      onDisable();
 993    }, [onDisable, anchorParent]);
 994  
 995    if (!isVisible) {
 996      return null;
 997    }
 998  
 999    return Object(external_wp_element_["createElement"])(external_wp_components_["Popover"], {
1000      className: "nux-dot-tip",
1001      position: position,
1002      noArrow: true,
1003      focusOnMount: "container",
1004      shouldAnchorIncludePadding: true,
1005      role: "dialog",
1006      "aria-label": Object(external_wp_i18n_["__"])('Editor tips'),
1007      onClick: onClick,
1008      onFocusOutside: onFocusOutsideCallback
1009    }, Object(external_wp_element_["createElement"])("p", null, children), Object(external_wp_element_["createElement"])("p", null, Object(external_wp_element_["createElement"])(external_wp_components_["Button"], {
1010      isLink: true,
1011      onClick: onDismiss
1012    }, hasNextTip ? Object(external_wp_i18n_["__"])('See next tip') : Object(external_wp_i18n_["__"])('Got it'))), Object(external_wp_element_["createElement"])(external_wp_components_["Button"], {
1013      className: "nux-dot-tip__disable",
1014      icon: library_close["a" /* default */],
1015      label: Object(external_wp_i18n_["__"])('Disable tips'),
1016      onClick: onDisable
1017    }));
1018  }
1019  /* harmony default export */ var dot_tip = (Object(external_wp_compose_["compose"])(Object(external_wp_data_["withSelect"])(function (select, _ref2) {
1020    var tipId = _ref2.tipId;
1021  
1022    var _select = select('core/nux'),
1023        isTipVisible = _select.isTipVisible,
1024        getAssociatedGuide = _select.getAssociatedGuide;
1025  
1026    var associatedGuide = getAssociatedGuide(tipId);
1027    return {
1028      isVisible: isTipVisible(tipId),
1029      hasNextTip: !!(associatedGuide && associatedGuide.nextTipId)
1030    };
1031  }), Object(external_wp_data_["withDispatch"])(function (dispatch, _ref3) {
1032    var tipId = _ref3.tipId;
1033  
1034    var _dispatch = dispatch('core/nux'),
1035        dismissTip = _dispatch.dismissTip,
1036        disableTips = _dispatch.disableTips;
1037  
1038    return {
1039      onDismiss: function onDismiss() {
1040        dismissTip(tipId);
1041      },
1042      onDisable: function onDisable() {
1043        disableTips();
1044      }
1045    };
1046  }))(DotTip));
1047  
1048  // CONCATENATED MODULE: ./node_modules/@wordpress/nux/build-module/index.js
1049  /**
1050   * WordPress dependencies
1051   */
1052  
1053  
1054  
1055  external_wp_deprecated_default()('wp.nux', {
1056    hint: 'wp.components.Guide can be used to show a user guide.'
1057  });
1058  
1059  
1060  /***/ }),
1061  
1062  /***/ 5:
1063  /***/ (function(module, __webpack_exports__, __webpack_require__) {
1064  
1065  "use strict";
1066  /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return _defineProperty; });
1067  function _defineProperty(obj, key, value) {
1068    if (key in obj) {
1069      Object.defineProperty(obj, key, {
1070        value: value,
1071        enumerable: true,
1072        configurable: true,
1073        writable: true
1074      });
1075    } else {
1076      obj[key] = value;
1077    }
1078  
1079    return obj;
1080  }
1081  
1082  /***/ }),
1083  
1084  /***/ 7:
1085  /***/ (function(module, exports) {
1086  
1087  (function() { module.exports = window["wp"]["primitives"]; }());
1088  
1089  /***/ })
1090  
1091  /******/ });


Generated: Sat Mar 6 01:00:04 2021 Cross-referenced by PHPXref 0.7.1