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


Generated: Thu Apr 9 01:00:03 2020 Cross-referenced by PHPXref 0.7.1