[ Index ] |
PHP Cross Reference of WordPress |
[Summary view] [Print] [Text view]
1 this["wp"] = this["wp"] || {}; this["wp"]["notices"] = 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 = 475); 86 /******/ }) 87 /************************************************************************/ 88 /******/ ({ 89 90 /***/ 15: 91 /***/ (function(module, __webpack_exports__, __webpack_require__) { 92 93 "use strict"; 94 95 // EXPORTS 96 __webpack_require__.d(__webpack_exports__, "a", function() { return /* binding */ _toConsumableArray; }); 97 98 // EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/arrayLikeToArray.js 99 var arrayLikeToArray = __webpack_require__(24); 100 101 // CONCATENATED MODULE: ./node_modules/@babel/runtime/helpers/esm/arrayWithoutHoles.js 102 103 function _arrayWithoutHoles(arr) { 104 if (Array.isArray(arr)) return Object(arrayLikeToArray["a" /* default */])(arr); 105 } 106 // EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/iterableToArray.js 107 var iterableToArray = __webpack_require__(37); 108 109 // EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/unsupportedIterableToArray.js 110 var unsupportedIterableToArray = __webpack_require__(31); 111 112 // CONCATENATED MODULE: ./node_modules/@babel/runtime/helpers/esm/nonIterableSpread.js 113 function _nonIterableSpread() { 114 throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); 115 } 116 // CONCATENATED MODULE: ./node_modules/@babel/runtime/helpers/esm/toConsumableArray.js 117 118 119 120 121 function _toConsumableArray(arr) { 122 return _arrayWithoutHoles(arr) || Object(iterableToArray["a" /* default */])(arr) || Object(unsupportedIterableToArray["a" /* default */])(arr) || _nonIterableSpread(); 123 } 124 125 /***/ }), 126 127 /***/ 2: 128 /***/ (function(module, exports) { 129 130 (function() { module.exports = window["lodash"]; }()); 131 132 /***/ }), 133 134 /***/ 24: 135 /***/ (function(module, __webpack_exports__, __webpack_require__) { 136 137 "use strict"; 138 /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return _arrayLikeToArray; }); 139 function _arrayLikeToArray(arr, len) { 140 if (len == null || len > arr.length) len = arr.length; 141 142 for (var i = 0, arr2 = new Array(len); i < len; i++) { 143 arr2[i] = arr[i]; 144 } 145 146 return arr2; 147 } 148 149 /***/ }), 150 151 /***/ 31: 152 /***/ (function(module, __webpack_exports__, __webpack_require__) { 153 154 "use strict"; 155 /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return _unsupportedIterableToArray; }); 156 /* harmony import */ var _babel_runtime_helpers_esm_arrayLikeToArray__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(24); 157 158 function _unsupportedIterableToArray(o, minLen) { 159 if (!o) return; 160 if (typeof o === "string") return Object(_babel_runtime_helpers_esm_arrayLikeToArray__WEBPACK_IMPORTED_MODULE_0__[/* default */ "a"])(o, minLen); 161 var n = Object.prototype.toString.call(o).slice(8, -1); 162 if (n === "Object" && o.constructor) n = o.constructor.name; 163 if (n === "Map" || n === "Set") return Array.from(o); 164 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); 165 } 166 167 /***/ }), 168 169 /***/ 37: 170 /***/ (function(module, __webpack_exports__, __webpack_require__) { 171 172 "use strict"; 173 /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return _iterableToArray; }); 174 function _iterableToArray(iter) { 175 if (typeof Symbol !== "undefined" && Symbol.iterator in Object(iter)) return Array.from(iter); 176 } 177 178 /***/ }), 179 180 /***/ 4: 181 /***/ (function(module, exports) { 182 183 (function() { module.exports = window["wp"]["data"]; }()); 184 185 /***/ }), 186 187 /***/ 475: 188 /***/ (function(module, __webpack_exports__, __webpack_require__) { 189 190 "use strict"; 191 // ESM COMPAT FLAG 192 __webpack_require__.r(__webpack_exports__); 193 194 // EXPORTS 195 __webpack_require__.d(__webpack_exports__, "store", function() { return /* reexport */ store; }); 196 197 // NAMESPACE OBJECT: ./node_modules/@wordpress/notices/build-module/store/actions.js 198 var actions_namespaceObject = {}; 199 __webpack_require__.r(actions_namespaceObject); 200 __webpack_require__.d(actions_namespaceObject, "createNotice", function() { return createNotice; }); 201 __webpack_require__.d(actions_namespaceObject, "createSuccessNotice", function() { return createSuccessNotice; }); 202 __webpack_require__.d(actions_namespaceObject, "createInfoNotice", function() { return createInfoNotice; }); 203 __webpack_require__.d(actions_namespaceObject, "createErrorNotice", function() { return createErrorNotice; }); 204 __webpack_require__.d(actions_namespaceObject, "createWarningNotice", function() { return createWarningNotice; }); 205 __webpack_require__.d(actions_namespaceObject, "removeNotice", function() { return removeNotice; }); 206 207 // NAMESPACE OBJECT: ./node_modules/@wordpress/notices/build-module/store/selectors.js 208 var selectors_namespaceObject = {}; 209 __webpack_require__.r(selectors_namespaceObject); 210 __webpack_require__.d(selectors_namespaceObject, "getNotices", function() { return getNotices; }); 211 212 // EXTERNAL MODULE: external ["wp","data"] 213 var external_wp_data_ = __webpack_require__(4); 214 215 // EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/toConsumableArray.js + 2 modules 216 var toConsumableArray = __webpack_require__(15); 217 218 // EXTERNAL MODULE: external "lodash" 219 var external_lodash_ = __webpack_require__(2); 220 221 // EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/defineProperty.js 222 var defineProperty = __webpack_require__(5); 223 224 // CONCATENATED MODULE: ./node_modules/@wordpress/notices/build-module/store/utils/on-sub-key.js 225 226 227 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; } 228 229 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; } 230 231 /** 232 * Higher-order reducer creator which creates a combined reducer object, keyed 233 * by a property on the action object. 234 * 235 * @param {string} actionProperty Action property by which to key object. 236 * 237 * @return {Function} Higher-order reducer. 238 */ 239 var on_sub_key_onSubKey = function onSubKey(actionProperty) { 240 return function (reducer) { 241 return function () { 242 var state = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}; 243 var action = arguments.length > 1 ? arguments[1] : undefined; 244 // Retrieve subkey from action. Do not track if undefined; useful for cases 245 // where reducer is scoped by action shape. 246 var key = action[actionProperty]; 247 248 if (key === undefined) { 249 return state; 250 } // Avoid updating state if unchanged. Note that this also accounts for a 251 // reducer which returns undefined on a key which is not yet tracked. 252 253 254 var nextKeyState = reducer(state[key], action); 255 256 if (nextKeyState === state[key]) { 257 return state; 258 } 259 260 return _objectSpread(_objectSpread({}, state), {}, Object(defineProperty["a" /* default */])({}, key, nextKeyState)); 261 }; 262 }; 263 }; 264 /* harmony default export */ var on_sub_key = (on_sub_key_onSubKey); 265 266 // CONCATENATED MODULE: ./node_modules/@wordpress/notices/build-module/store/reducer.js 267 268 269 /** 270 * External dependencies 271 */ 272 273 /** 274 * Internal dependencies 275 */ 276 277 278 /** 279 * Reducer returning the next notices state. The notices state is an object 280 * where each key is a context, its value an array of notice objects. 281 * 282 * @param {Object} state Current state. 283 * @param {Object} action Dispatched action. 284 * 285 * @return {Object} Updated state. 286 */ 287 288 var notices = on_sub_key('context')(function () { 289 var state = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : []; 290 var action = arguments.length > 1 ? arguments[1] : undefined; 291 292 switch (action.type) { 293 case 'CREATE_NOTICE': 294 // Avoid duplicates on ID. 295 return [].concat(Object(toConsumableArray["a" /* default */])(Object(external_lodash_["reject"])(state, { 296 id: action.notice.id 297 })), [action.notice]); 298 299 case 'REMOVE_NOTICE': 300 return Object(external_lodash_["reject"])(state, { 301 id: action.id 302 }); 303 } 304 305 return state; 306 }); 307 /* harmony default export */ var store_reducer = (notices); 308 309 // CONCATENATED MODULE: ./node_modules/@wordpress/notices/build-module/store/constants.js 310 /** 311 * Default context to use for notice grouping when not otherwise specified. Its 312 * specific value doesn't hold much meaning, but it must be reasonably unique 313 * and, more importantly, referenced consistently in the store implementation. 314 * 315 * @type {string} 316 */ 317 var DEFAULT_CONTEXT = 'global'; 318 /** 319 * Default notice status. 320 * 321 * @type {string} 322 */ 323 324 var DEFAULT_STATUS = 'info'; 325 326 // CONCATENATED MODULE: ./node_modules/@wordpress/notices/build-module/store/actions.js 327 /** 328 * External dependencies 329 */ 330 331 /** 332 * Internal dependencies 333 */ 334 335 336 /** 337 * @typedef {Object} WPNoticeAction Object describing a user action option associated with a notice. 338 * 339 * @property {string} label Message to use as action label. 340 * @property {?string} url Optional URL of resource if action incurs 341 * browser navigation. 342 * @property {?Function} onClick Optional function to invoke when action is 343 * triggered by user. 344 * 345 */ 346 347 /** 348 * Returns an action object used in signalling that a notice is to be created. 349 * 350 * @param {string} [status='info'] Notice status. 351 * @param {string} content Notice message. 352 * @param {Object} [options] Notice options. 353 * @param {string} [options.context='global'] Context under which to 354 * group notice. 355 * @param {string} [options.id] Identifier for notice. 356 * Automatically assigned 357 * if not specified. 358 * @param {boolean} [options.isDismissible=true] Whether the notice can 359 * be dismissed by user. 360 * @param {string} [options.type='default'] Type of notice, one of 361 * `default`, or `snackbar`. 362 * @param {boolean} [options.speak=true] Whether the notice 363 * content should be 364 * announced to screen 365 * readers. 366 * @param {Array<WPNoticeAction>} [options.actions] User actions to be 367 * presented with notice. 368 * @param {Object} [options.icon] An icon displayed with the notice. 369 * @param {boolean} [options.explicitDismiss] Whether the notice includes 370 * an explict dismiss button and 371 * can't be dismissed by clicking 372 * the body of the notice. 373 * @param {Function} [options.onDismiss] Called when the notice is dismissed. 374 * 375 * @return {Object} Action object. 376 */ 377 378 function createNotice() { 379 var status = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : DEFAULT_STATUS; 380 var content = arguments.length > 1 ? arguments[1] : undefined; 381 var options = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {}; 382 var _options$speak = options.speak, 383 speak = _options$speak === void 0 ? true : _options$speak, 384 _options$isDismissibl = options.isDismissible, 385 isDismissible = _options$isDismissibl === void 0 ? true : _options$isDismissibl, 386 _options$context = options.context, 387 context = _options$context === void 0 ? DEFAULT_CONTEXT : _options$context, 388 _options$id = options.id, 389 id = _options$id === void 0 ? Object(external_lodash_["uniqueId"])(context) : _options$id, 390 _options$actions = options.actions, 391 actions = _options$actions === void 0 ? [] : _options$actions, 392 _options$type = options.type, 393 type = _options$type === void 0 ? 'default' : _options$type, 394 __unstableHTML = options.__unstableHTML, 395 _options$icon = options.icon, 396 icon = _options$icon === void 0 ? null : _options$icon, 397 _options$explicitDism = options.explicitDismiss, 398 explicitDismiss = _options$explicitDism === void 0 ? false : _options$explicitDism, 399 _options$onDismiss = options.onDismiss, 400 onDismiss = _options$onDismiss === void 0 ? null : _options$onDismiss; // The supported value shape of content is currently limited to plain text 401 // strings. To avoid setting expectation that e.g. a WPElement could be 402 // supported, cast to a string. 403 404 content = String(content); 405 return { 406 type: 'CREATE_NOTICE', 407 context: context, 408 notice: { 409 id: id, 410 status: status, 411 content: content, 412 spokenMessage: speak ? content : null, 413 __unstableHTML: __unstableHTML, 414 isDismissible: isDismissible, 415 actions: actions, 416 type: type, 417 icon: icon, 418 explicitDismiss: explicitDismiss, 419 onDismiss: onDismiss 420 } 421 }; 422 } 423 /** 424 * Returns an action object used in signalling that a success notice is to be 425 * created. Refer to `createNotice` for options documentation. 426 * 427 * @see createNotice 428 * 429 * @param {string} content Notice message. 430 * @param {Object} [options] Optional notice options. 431 * 432 * @return {Object} Action object. 433 */ 434 435 function createSuccessNotice(content, options) { 436 return createNotice('success', content, options); 437 } 438 /** 439 * Returns an action object used in signalling that an info notice is to be 440 * created. Refer to `createNotice` for options documentation. 441 * 442 * @see createNotice 443 * 444 * @param {string} content Notice message. 445 * @param {Object} [options] Optional notice options. 446 * 447 * @return {Object} Action object. 448 */ 449 450 function createInfoNotice(content, options) { 451 return createNotice('info', content, options); 452 } 453 /** 454 * Returns an action object used in signalling that an error notice is to be 455 * created. Refer to `createNotice` for options documentation. 456 * 457 * @see createNotice 458 * 459 * @param {string} content Notice message. 460 * @param {Object} [options] Optional notice options. 461 * 462 * @return {Object} Action object. 463 */ 464 465 function createErrorNotice(content, options) { 466 return createNotice('error', content, options); 467 } 468 /** 469 * Returns an action object used in signalling that a warning notice is to be 470 * created. Refer to `createNotice` for options documentation. 471 * 472 * @see createNotice 473 * 474 * @param {string} content Notice message. 475 * @param {Object} [options] Optional notice options. 476 * 477 * @return {Object} Action object. 478 */ 479 480 function createWarningNotice(content, options) { 481 return createNotice('warning', content, options); 482 } 483 /** 484 * Returns an action object used in signalling that a notice is to be removed. 485 * 486 * @param {string} id Notice unique identifier. 487 * @param {string} [context='global'] Optional context (grouping) in which the notice is 488 * intended to appear. Defaults to default context. 489 * 490 * @return {Object} Action object. 491 */ 492 493 function removeNotice(id) { 494 var context = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : DEFAULT_CONTEXT; 495 return { 496 type: 'REMOVE_NOTICE', 497 id: id, 498 context: context 499 }; 500 } 501 502 // CONCATENATED MODULE: ./node_modules/@wordpress/notices/build-module/store/selectors.js 503 /** 504 * Internal dependencies 505 */ 506 507 /** @typedef {import('./actions').WPNoticeAction} WPNoticeAction */ 508 509 /** 510 * The default empty set of notices to return when there are no notices 511 * assigned for a given notices context. This can occur if the getNotices 512 * selector is called without a notice ever having been created for the 513 * context. A shared value is used to ensure referential equality between 514 * sequential selector calls, since otherwise `[] !== []`. 515 * 516 * @type {Array} 517 */ 518 519 var DEFAULT_NOTICES = []; 520 /** 521 * @typedef {Object} WPNotice Notice object. 522 * 523 * @property {string} id Unique identifier of notice. 524 * @property {string} status Status of notice, one of `success`, 525 * `info`, `error`, or `warning`. Defaults 526 * to `info`. 527 * @property {string} content Notice message. 528 * @property {string} spokenMessage Audibly announced message text used by 529 * assistive technologies. 530 * @property {string} __unstableHTML Notice message as raw HTML. Intended to 531 * serve primarily for compatibility of 532 * server-rendered notices, and SHOULD NOT 533 * be used for notices. It is subject to 534 * removal without notice. 535 * @property {boolean} isDismissible Whether the notice can be dismissed by 536 * user. Defaults to `true`. 537 * @property {string} type Type of notice, one of `default`, 538 * or `snackbar`. Defaults to `default`. 539 * @property {boolean} speak Whether the notice content should be 540 * announced to screen readers. Defaults to 541 * `true`. 542 * @property {WPNoticeAction[]} actions User actions to present with notice. 543 * 544 */ 545 546 /** 547 * Returns all notices as an array, optionally for a given context. Defaults to 548 * the global context. 549 * 550 * @param {Object} state Notices state. 551 * @param {?string} context Optional grouping context. 552 * 553 * @return {WPNotice[]} Array of notices. 554 */ 555 556 function getNotices(state) { 557 var context = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : DEFAULT_CONTEXT; 558 return state[context] || DEFAULT_NOTICES; 559 } 560 561 // CONCATENATED MODULE: ./node_modules/@wordpress/notices/build-module/store/index.js 562 /** 563 * WordPress dependencies 564 */ 565 566 /** 567 * Internal dependencies 568 */ 569 570 571 572 573 /** 574 * Store definition for the notices namespace. 575 * 576 * @see https://github.com/WordPress/gutenberg/blob/HEAD/packages/data/README.md#createReduxStore 577 * 578 * @type {Object} 579 */ 580 581 var store = Object(external_wp_data_["createReduxStore"])('core/notices', { 582 reducer: store_reducer, 583 actions: actions_namespaceObject, 584 selectors: selectors_namespaceObject 585 }); 586 Object(external_wp_data_["register"])(store); 587 588 // CONCATENATED MODULE: ./node_modules/@wordpress/notices/build-module/index.js 589 590 591 592 /***/ }), 593 594 /***/ 5: 595 /***/ (function(module, __webpack_exports__, __webpack_require__) { 596 597 "use strict"; 598 /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return _defineProperty; }); 599 function _defineProperty(obj, key, value) { 600 if (key in obj) { 601 Object.defineProperty(obj, key, { 602 value: value, 603 enumerable: true, 604 configurable: true, 605 writable: true 606 }); 607 } else { 608 obj[key] = value; 609 } 610 611 return obj; 612 } 613 614 /***/ }) 615 616 /******/ });
title
Description
Body
title
Description
Body
title
Description
Body
title
Body
Generated: Sat Mar 6 01:00:04 2021 | Cross-referenced by PHPXref 0.7.1 |