WordPress/wp-includes/js/dist/notices.js.map

1 line
22 KiB
Plaintext

{"version":3,"sources":["webpack://wp.[name]/webpack/bootstrap","webpack://wp.[name]/./node_modules/@babel/runtime/helpers/arrayWithoutHoles.js","webpack://wp.[name]/./node_modules/@babel/runtime/helpers/defineProperty.js","webpack://wp.[name]/./node_modules/@babel/runtime/helpers/interopRequireDefault.js","webpack://wp.[name]/./node_modules/@babel/runtime/helpers/interopRequireWildcard.js","webpack://wp.[name]/./node_modules/@babel/runtime/helpers/iterableToArray.js","webpack://wp.[name]/./node_modules/@babel/runtime/helpers/nonIterableSpread.js","webpack://wp.[name]/./node_modules/@babel/runtime/helpers/objectSpread.js","webpack://wp.[name]/./node_modules/@babel/runtime/helpers/toConsumableArray.js","webpack://wp.[name]//Users/riad/Workspace/a8c/gutenberg/packages/notices/src/index.js","webpack://wp.[name]//Users/riad/Workspace/a8c/gutenberg/packages/notices/src/store/actions.js","webpack://wp.[name]//Users/riad/Workspace/a8c/gutenberg/packages/notices/src/store/constants.js","webpack://wp.[name]//Users/riad/Workspace/a8c/gutenberg/packages/notices/src/store/controls.js","webpack://wp.[name]//Users/riad/Workspace/a8c/gutenberg/packages/notices/src/store/index.js","webpack://wp.[name]//Users/riad/Workspace/a8c/gutenberg/packages/notices/src/store/reducer.js","webpack://wp.[name]//Users/riad/Workspace/a8c/gutenberg/packages/notices/src/store/selectors.js","webpack://wp.[name]//Users/riad/Workspace/a8c/gutenberg/packages/notices/src/store/utils/on-sub-key.js","webpack://wp.[name]/external {\"this\":[\"wp\",\"a11y\"]}","webpack://wp.[name]/external {\"this\":[\"wp\",\"data\"]}","webpack://wp.[name]/external \"lodash\""],"names":["createNotice","status","DEFAULT_STATUS","content","options","speak","isDismissible","context","DEFAULT_CONTEXT","id","actions","__unstableHTML","String","type","message","notice","createSuccessNotice","createInfoNotice","createErrorNotice","createWarningNotice","removeNotice","SPEAK","action","reducer","selectors","controls","notices","state","DEFAULT_NOTICES","getNotices","onSubKey","actionProperty","key","undefined","nextKeyState"],"mappings":";;AAAA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;;AAGA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA,kDAA0C,gCAAgC;AAC1E;AACA;;AAEA;AACA;AACA;AACA,gEAAwD,kBAAkB;AAC1E;AACA,yDAAiD,cAAc;AAC/D;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iDAAyC,iCAAiC;AAC1E,wHAAgH,mBAAmB,EAAE;AACrI;AACA;;AAEA;AACA;AACA;AACA,mCAA2B,0BAA0B,EAAE;AACvD,yCAAiC,eAAe;AAChD;AACA;AACA;;AAEA;AACA,8DAAsD,+DAA+D;;AAErH;AACA;;;AAGA;AACA;;;;;;;;;;;;AClFA;AACA;AACA,iDAAiD,gBAAgB;AACjE;AACA;;AAEA;AACA;AACA;;AAEA,oC;;;;;;;;;;;ACVA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL,GAAG;AACH;AACA;;AAEA;AACA;;AAEA,iC;;;;;;;;;;;ACfA;AACA;AACA;AACA;AACA;;AAEA,wC;;;;;;;;;;;ACNA;AACA;AACA;AACA,GAAG;AACH;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA,WAAW;AACX;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA,yC;;;;;;;;;;;ACzBA;AACA;AACA;;AAEA,kC;;;;;;;;;;;ACJA;AACA;AACA;;AAEA,oC;;;;;;;;;;;ACJA,qBAAqB,mBAAO,CAAC,iFAAkB;;AAE/C;AACA,iBAAiB,sBAAsB;AACvC;AACA;;AAEA;AACA;AACA;AACA,OAAO;AACP;;AAEA;AACA;AACA,KAAK;AACL;;AAEA;AACA;;AAEA,+B;;;;;;;;;;;ACrBA,wBAAwB,mBAAO,CAAC,uFAAqB;;AAErD,sBAAsB,mB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,YAAY,GAAGX,OAAO,CAAEI,KAAK,CAAEK,GAAF,CAAP,EAAgBV,MAAhB,CAA5B;;AACA,UAAKY,YAAY,KAAKP,KAAK,CAAEK,GAAF,CAA3B,EAAqC;AACpC,eAAOL,KAAP;AACA;;AAED,6CACIA,KADJ,oCAEGK,GAFH,EAEUE,YAFV;AAIA,KAnB6C;AAAA,GAAtB;AAAA,CAAjB;;;eAqBQJ,Q;;;;;;;;;;;;;AC7Bf,aAAa,qCAAqC,EAAE,I;;;;;;;;;;;ACApD,aAAa,qCAAqC,EAAE,I;;;;;;;;;;;ACApD,aAAa,iCAAiC,EAAE,I","file":"notices.js","sourcesContent":[" \t// The module cache\n \tvar installedModules = {};\n\n \t// The require function\n \tfunction __webpack_require__(moduleId) {\n\n \t\t// Check if module is in cache\n \t\tif(installedModules[moduleId]) {\n \t\t\treturn installedModules[moduleId].exports;\n \t\t}\n \t\t// Create a new module (and put it into the cache)\n \t\tvar module = installedModules[moduleId] = {\n \t\t\ti: moduleId,\n \t\t\tl: false,\n \t\t\texports: {}\n \t\t};\n\n \t\t// Execute the module function\n \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n \t\t// Flag the module as loaded\n \t\tmodule.l = true;\n\n \t\t// Return the exports of the module\n \t\treturn module.exports;\n \t}\n\n\n \t// expose the modules object (__webpack_modules__)\n \t__webpack_require__.m = modules;\n\n \t// expose the module cache\n \t__webpack_require__.c = installedModules;\n\n \t// define getter function for harmony exports\n \t__webpack_require__.d = function(exports, name, getter) {\n \t\tif(!__webpack_require__.o(exports, name)) {\n \t\t\tObject.defineProperty(exports, name, { enumerable: true, get: getter });\n \t\t}\n \t};\n\n \t// define __esModule on exports\n \t__webpack_require__.r = function(exports) {\n \t\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n \t\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n \t\t}\n \t\tObject.defineProperty(exports, '__esModule', { value: true });\n \t};\n\n \t// create a fake namespace object\n \t// mode & 1: value is a module id, require it\n \t// mode & 2: merge all properties of value into the ns\n \t// mode & 4: return value when already ns object\n \t// mode & 8|1: behave like require\n \t__webpack_require__.t = function(value, mode) {\n \t\tif(mode & 1) value = __webpack_require__(value);\n \t\tif(mode & 8) return value;\n \t\tif((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;\n \t\tvar ns = Object.create(null);\n \t\t__webpack_require__.r(ns);\n \t\tObject.defineProperty(ns, 'default', { enumerable: true, value: value });\n \t\tif(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));\n \t\treturn ns;\n \t};\n\n \t// getDefaultExport function for compatibility with non-harmony modules\n \t__webpack_require__.n = function(module) {\n \t\tvar getter = module && module.__esModule ?\n \t\t\tfunction getDefault() { return module['default']; } :\n \t\t\tfunction getModuleExports() { return module; };\n \t\t__webpack_require__.d(getter, 'a', getter);\n \t\treturn getter;\n \t};\n\n \t// Object.prototype.hasOwnProperty.call\n \t__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };\n\n \t// __webpack_public_path__\n \t__webpack_require__.p = \"\";\n\n\n \t// Load entry module and return exports\n \treturn __webpack_require__(__webpack_require__.s = \"./node_modules/@wordpress/notices/build/index.js\");\n","function _arrayWithoutHoles(arr) {\n if (Array.isArray(arr)) {\n for (var i = 0, arr2 = new Array(arr.length); i < arr.length; i++) {\n arr2[i] = arr[i];\n }\n\n return arr2;\n }\n}\n\nmodule.exports = _arrayWithoutHoles;","function _defineProperty(obj, key, value) {\n if (key in obj) {\n Object.defineProperty(obj, key, {\n value: value,\n enumerable: true,\n configurable: true,\n writable: true\n });\n } else {\n obj[key] = value;\n }\n\n return obj;\n}\n\nmodule.exports = _defineProperty;","function _interopRequireDefault(obj) {\n return obj && obj.__esModule ? obj : {\n default: obj\n };\n}\n\nmodule.exports = _interopRequireDefault;","function _interopRequireWildcard(obj) {\n if (obj && obj.__esModule) {\n return obj;\n } else {\n var newObj = {};\n\n if (obj != null) {\n for (var key in obj) {\n if (Object.prototype.hasOwnProperty.call(obj, key)) {\n var desc = Object.defineProperty && Object.getOwnPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : {};\n\n if (desc.get || desc.set) {\n Object.defineProperty(newObj, key, desc);\n } else {\n newObj[key] = obj[key];\n }\n }\n }\n }\n\n newObj.default = obj;\n return newObj;\n }\n}\n\nmodule.exports = _interopRequireWildcard;","function _iterableToArray(iter) {\n if (Symbol.iterator in Object(iter) || Object.prototype.toString.call(iter) === \"[object Arguments]\") return Array.from(iter);\n}\n\nmodule.exports = _iterableToArray;","function _nonIterableSpread() {\n throw new TypeError(\"Invalid attempt to spread non-iterable instance\");\n}\n\nmodule.exports = _nonIterableSpread;","var defineProperty = require(\"./defineProperty\");\n\nfunction _objectSpread(target) {\n for (var i = 1; i < arguments.length; i++) {\n var source = arguments[i] != null ? arguments[i] : {};\n var ownKeys = Object.keys(source);\n\n if (typeof Object.getOwnPropertySymbols === 'function') {\n ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function (sym) {\n return Object.getOwnPropertyDescriptor(source, sym).enumerable;\n }));\n }\n\n ownKeys.forEach(function (key) {\n defineProperty(target, key, source[key]);\n });\n }\n\n return target;\n}\n\nmodule.exports = _objectSpread;","var arrayWithoutHoles = require(\"./arrayWithoutHoles\");\n\nvar iterableToArray = require(\"./iterableToArray\");\n\nvar nonIterableSpread = require(\"./nonIterableSpread\");\n\nfunction _toConsumableArray(arr) {\n return arrayWithoutHoles(arr) || iterableToArray(arr) || nonIterableSpread();\n}\n\nmodule.exports = _toConsumableArray;","/**\n * Internal dependencies\n */\nimport './store';\n","/**\n * External dependencies\n */\nimport { uniqueId } from 'lodash';\n\n/**\n * Internal dependencies\n */\nimport { DEFAULT_CONTEXT, DEFAULT_STATUS } from './constants';\n\n/**\n * Yields action objects used in signalling that a notice is to be created.\n *\n * @param {?string} status Notice status.\n * Defaults to `info`.\n * @param {string} content Notice message.\n * @param {?Object} options Notice options.\n * @param {?string} options.context Context under which to\n * group notice.\n * @param {?string} options.id Identifier for notice.\n * Automatically assigned\n * if not specified.\n * @param {?boolean} options.isDismissible Whether the notice can\n * be dismissed by user.\n * Defaults to `true`.\n * @param {?boolean} options.speak Whether the notice\n * content should be\n * announced to screen\n * readers. Defaults to\n * `true`.\n * @param {?Array<WPNoticeAction>} options.actions User actions to be\n * presented with notice.\n */\nexport function* createNotice( status = DEFAULT_STATUS, content, options = {} ) {\n\tconst {\n\t\tspeak = true,\n\t\tisDismissible = true,\n\t\tcontext = DEFAULT_CONTEXT,\n\t\tid = uniqueId( context ),\n\t\tactions = [],\n\t\t__unstableHTML,\n\t} = options;\n\n\t// The supported value shape of content is currently limited to plain text\n\t// strings. To avoid setting expectation that e.g. a WPElement could be\n\t// supported, cast to a string.\n\tcontent = String( content );\n\n\tif ( speak ) {\n\t\tyield { type: 'SPEAK', message: content };\n\t}\n\n\tyield {\n\t\ttype: 'CREATE_NOTICE',\n\t\tcontext,\n\t\tnotice: {\n\t\t\tid,\n\t\t\tstatus,\n\t\t\tcontent,\n\t\t\t__unstableHTML,\n\t\t\tisDismissible,\n\t\t\tactions,\n\t\t},\n\t};\n}\n\n/**\n * Returns an action object used in signalling that a success notice is to be\n * created. Refer to `createNotice` for options documentation.\n *\n * @see createNotice\n *\n * @param {string} content Notice message.\n * @param {?Object} options Optional notice options.\n *\n * @return {Object} Action object.\n */\nexport function createSuccessNotice( content, options ) {\n\treturn createNotice( 'success', content, options );\n}\n\n/**\n * Returns an action object used in signalling that an info notice is to be\n * created. Refer to `createNotice` for options documentation.\n *\n * @see createNotice\n *\n * @param {string} content Notice message.\n * @param {?Object} options Optional notice options.\n *\n * @return {Object} Action object.\n */\nexport function createInfoNotice( content, options ) {\n\treturn createNotice( 'info', content, options );\n}\n\n/**\n * Returns an action object used in signalling that an error notice is to be\n * created. Refer to `createNotice` for options documentation.\n *\n * @see createNotice\n *\n * @param {string} content Notice message.\n * @param {?Object} options Optional notice options.\n *\n * @return {Object} Action object.\n */\nexport function createErrorNotice( content, options ) {\n\treturn createNotice( 'error', content, options );\n}\n\n/**\n * Returns an action object used in signalling that a warning notice is to be\n * created. Refer to `createNotice` for options documentation.\n *\n * @see createNotice\n *\n * @param {string} content Notice message.\n * @param {?Object} options Optional notice options.\n *\n * @return {Object} Action object.\n */\nexport function createWarningNotice( content, options ) {\n\treturn createNotice( 'warning', content, options );\n}\n\n/**\n * Returns an action object used in signalling that a notice is to be removed.\n *\n * @param {string} id Notice unique identifier.\n * @param {?string} context Optional context (grouping) in which the notice is\n * intended to appear. Defaults to default context.\n *\n * @return {Object} Action object.\n */\nexport function removeNotice( id, context = DEFAULT_CONTEXT ) {\n\treturn {\n\t\ttype: 'REMOVE_NOTICE',\n\t\tid,\n\t\tcontext,\n\t};\n}\n","/**\n * Default context to use for notice grouping when not otherwise specified. Its\n * specific value doesn't hold much meaning, but it must be reasonably unique\n * and, more importantly, referenced consistently in the store implementation.\n *\n * @type {string}\n */\nexport const DEFAULT_CONTEXT = 'global';\n\n/**\n * Default notice status.\n *\n * @type {string}\n */\nexport const DEFAULT_STATUS = 'info';\n","/**\n * WordPress dependencies\n */\nimport { speak } from '@wordpress/a11y';\n\nexport default {\n\tSPEAK( action ) {\n\t\tspeak( action.message, 'assertive' );\n\t},\n};\n","/**\n * WordPress dependencies\n */\nimport { registerStore } from '@wordpress/data';\n\n/**\n * Internal dependencies\n */\nimport reducer from './reducer';\nimport * as actions from './actions';\nimport * as selectors from './selectors';\nimport controls from './controls';\n\nexport default registerStore( 'core/notices', {\n\treducer,\n\tactions,\n\tselectors,\n\tcontrols,\n} );\n","/**\n * External dependencies\n */\nimport { reject } from 'lodash';\n\n/**\n * Internal dependencies\n */\nimport onSubKey from './utils/on-sub-key';\n\n/**\n * Reducer returning the next notices state. The notices state is an object\n * where each key is a context, its value an array of notice objects.\n *\n * @param {Object} state Current state.\n * @param {Object} action Dispatched action.\n *\n * @return {Object} Updated state.\n */\nconst notices = onSubKey( 'context' )( ( state = [], action ) => {\n\tswitch ( action.type ) {\n\t\tcase 'CREATE_NOTICE':\n\t\t\t// Avoid duplicates on ID.\n\t\t\treturn [\n\t\t\t\t...reject( state, { id: action.notice.id } ),\n\t\t\t\taction.notice,\n\t\t\t];\n\n\t\tcase 'REMOVE_NOTICE':\n\t\t\treturn reject( state, { id: action.id } );\n\t}\n\n\treturn state;\n} );\n\nexport default notices;\n","/**\n * Internal dependencies\n */\nimport { DEFAULT_CONTEXT } from './constants';\n\n/**\n * The default empty set of notices to return when there are no notices\n * assigned for a given notices context. This can occur if the getNotices\n * selector is called without a notice ever having been created for the\n * context. A shared value is used to ensure referential equality between\n * sequential selector calls, since otherwise `[] !== []`.\n *\n * @type {Array}\n */\nconst DEFAULT_NOTICES = [];\n\n/**\n * Notice object.\n *\n * @property {string} id Unique identifier of notice.\n * @property {string} status Status of notice, one of `success`,\n * `info`, `error`, or `warning`. Defaults\n * to `info`.\n * @property {string} content Notice message.\n * @property {string} __unstableHTML Notice message as raw HTML. Intended to\n * serve primarily for compatibility of\n * server-rendered notices, and SHOULD NOT\n * be used for notices. It is subject to\n * removal without notice.\n * @property {boolean} isDismissible Whether the notice can be dismissed by\n * user. Defaults to `true`.\n * @property {WPNoticeAction[]} actions User actions to present with notice.\n *\n * @typedef {WPNotice}\n */\n\n/**\n * Object describing a user action option associated with a notice.\n *\n * @property {string} label Message to use as action label.\n * @property {?string} url Optional URL of resource if action incurs\n * browser navigation.\n * @property {?Function} callback Optional function to invoke when action is\n * triggered by user.\n *\n * @typedef {WPNoticeAction}\n */\n\n/**\n * Returns all notices as an array, optionally for a given context. Defaults to\n * the global context.\n *\n * @param {Object} state Notices state.\n * @param {?string} context Optional grouping context.\n *\n * @return {WPNotice[]} Array of notices.\n */\nexport function getNotices( state, context = DEFAULT_CONTEXT ) {\n\treturn state[ context ] || DEFAULT_NOTICES;\n}\n","/**\n * Higher-order reducer creator which creates a combined reducer object, keyed\n * by a property on the action object.\n *\n * @param {string} actionProperty Action property by which to key object.\n *\n * @return {Function} Higher-order reducer.\n */\nexport const onSubKey = ( actionProperty ) => ( reducer ) => ( state = {}, action ) => {\n\t// Retrieve subkey from action. Do not track if undefined; useful for cases\n\t// where reducer is scoped by action shape.\n\tconst key = action[ actionProperty ];\n\tif ( key === undefined ) {\n\t\treturn state;\n\t}\n\n\t// Avoid updating state if unchanged. Note that this also accounts for a\n\t// reducer which returns undefined on a key which is not yet tracked.\n\tconst nextKeyState = reducer( state[ key ], action );\n\tif ( nextKeyState === state[ key ] ) {\n\t\treturn state;\n\t}\n\n\treturn {\n\t\t...state,\n\t\t[ key ]: nextKeyState,\n\t};\n};\n\nexport default onSubKey;\n","(function() { module.exports = this[\"wp\"][\"a11y\"]; }());","(function() { module.exports = this[\"wp\"][\"data\"]; }());","(function() { module.exports = this[\"lodash\"]; }());"],"sourceRoot":""}