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