@wordpress/notices 4.18.0 → 4.19.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -2,6 +2,8 @@
2
2
 
3
3
  ## Unreleased
4
4
 
5
+ ## 4.19.0 (2024-02-09)
6
+
5
7
  ## 4.18.0 (2024-01-24)
6
8
 
7
9
  ## 4.17.0 (2024-01-10)
@@ -11,14 +11,12 @@ exports.DEFAULT_STATUS = exports.DEFAULT_CONTEXT = void 0;
11
11
  *
12
12
  * @type {string}
13
13
  */
14
- const DEFAULT_CONTEXT = 'global';
14
+ const DEFAULT_CONTEXT = exports.DEFAULT_CONTEXT = 'global';
15
15
 
16
16
  /**
17
17
  * Default notice status.
18
18
  *
19
19
  * @type {string}
20
20
  */
21
- exports.DEFAULT_CONTEXT = DEFAULT_CONTEXT;
22
- const DEFAULT_STATUS = 'info';
23
- exports.DEFAULT_STATUS = DEFAULT_STATUS;
21
+ const DEFAULT_STATUS = exports.DEFAULT_STATUS = 'info';
24
22
  //# sourceMappingURL=constants.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["DEFAULT_CONTEXT","exports","DEFAULT_STATUS"],"sources":["@wordpress/notices/src/store/constants.js"],"sourcesContent":["/**\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"],"mappings":";;;;;;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,MAAMA,eAAe,GAAG,QAAQ;;AAEvC;AACA;AACA;AACA;AACA;AAJAC,OAAA,CAAAD,eAAA,GAAAA,eAAA;AAKO,MAAME,cAAc,GAAG,MAAM;AAACD,OAAA,CAAAC,cAAA,GAAAA,cAAA"}
1
+ {"version":3,"names":["DEFAULT_CONTEXT","exports","DEFAULT_STATUS"],"sources":["@wordpress/notices/src/store/constants.js"],"sourcesContent":["/**\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"],"mappings":";;;;;;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,MAAMA,eAAe,GAAAC,OAAA,CAAAD,eAAA,GAAG,QAAQ;;AAEvC;AACA;AACA;AACA;AACA;AACO,MAAME,cAAc,GAAAD,OAAA,CAAAC,cAAA,GAAG,MAAM"}
@@ -8,10 +8,9 @@ var _a11y = require("@wordpress/a11y");
8
8
  /**
9
9
  * WordPress dependencies
10
10
  */
11
- var _default = {
11
+ var _default = exports.default = {
12
12
  SPEAK(action) {
13
13
  (0, _a11y.speak)(action.message, action.ariaLive || 'assertive');
14
14
  }
15
15
  };
16
- exports.default = _default;
17
16
  //# sourceMappingURL=controls.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["_a11y","require","_default","SPEAK","action","speak","message","ariaLive","exports","default"],"sources":["@wordpress/notices/src/store/controls.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { speak } from '@wordpress/a11y';\n\nexport default {\n\tSPEAK( action ) {\n\t\tspeak( action.message, action.ariaLive || 'assertive' );\n\t},\n};\n"],"mappings":";;;;;;AAGA,IAAAA,KAAA,GAAAC,OAAA;AAHA;AACA;AACA;AAFA,IAAAC,QAAA,GAKe;EACdC,KAAKA,CAAEC,MAAM,EAAG;IACf,IAAAC,WAAK,EAAED,MAAM,CAACE,OAAO,EAAEF,MAAM,CAACG,QAAQ,IAAI,WAAY,CAAC;EACxD;AACD,CAAC;AAAAC,OAAA,CAAAC,OAAA,GAAAP,QAAA"}
1
+ {"version":3,"names":["_a11y","require","_default","exports","default","SPEAK","action","speak","message","ariaLive"],"sources":["@wordpress/notices/src/store/controls.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { speak } from '@wordpress/a11y';\n\nexport default {\n\tSPEAK( action ) {\n\t\tspeak( action.message, action.ariaLive || 'assertive' );\n\t},\n};\n"],"mappings":";;;;;;AAGA,IAAAA,KAAA,GAAAC,OAAA;AAHA;AACA;AACA;AAFA,IAAAC,QAAA,GAAAC,OAAA,CAAAC,OAAA,GAKe;EACdC,KAAKA,CAAEC,MAAM,EAAG;IACf,IAAAC,WAAK,EAAED,MAAM,CAACE,OAAO,EAAEF,MAAM,CAACG,QAAQ,IAAI,WAAY,CAAC;EACxD;AACD,CAAC"}
@@ -9,8 +9,8 @@ var _data = require("@wordpress/data");
9
9
  var _reducer = _interopRequireDefault(require("./reducer"));
10
10
  var actions = _interopRequireWildcard(require("./actions"));
11
11
  var selectors = _interopRequireWildcard(require("./selectors"));
12
- function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
13
- function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
12
+ function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); }
13
+ function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
14
14
  /**
15
15
  * WordPress dependencies
16
16
  */
@@ -24,11 +24,10 @@ function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj &&
24
24
  *
25
25
  * @see https://github.com/WordPress/gutenberg/blob/HEAD/packages/data/README.md#createReduxStore
26
26
  */
27
- const store = (0, _data.createReduxStore)('core/notices', {
27
+ const store = exports.store = (0, _data.createReduxStore)('core/notices', {
28
28
  reducer: _reducer.default,
29
29
  actions,
30
30
  selectors
31
31
  });
32
- exports.store = store;
33
32
  (0, _data.register)(store);
34
33
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["_data","require","_reducer","_interopRequireDefault","actions","_interopRequireWildcard","selectors","_getRequireWildcardCache","nodeInterop","WeakMap","cacheBabelInterop","cacheNodeInterop","obj","__esModule","default","cache","has","get","newObj","hasPropertyDescriptor","Object","defineProperty","getOwnPropertyDescriptor","key","prototype","hasOwnProperty","call","desc","set","store","createReduxStore","reducer","exports","register"],"sources":["@wordpress/notices/src/store/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { createReduxStore, register } from '@wordpress/data';\n\n/**\n * Internal dependencies\n */\nimport reducer from './reducer';\nimport * as actions from './actions';\nimport * as selectors from './selectors';\n\n/**\n * Store definition for the notices namespace.\n *\n * @see https://github.com/WordPress/gutenberg/blob/HEAD/packages/data/README.md#createRedu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,GAAA,SAAAL,MAAA,CAAAJ,OAAA,GAAAF,GAAA,MAAAG,KAAA,IAAAA,KAAA,CAAAa,GAAA,CAAAhB,GAAA,EAAAM,MAAA,YAAAA,MAAA;AAVzC;AACA;AACA;;AAGA;AACA;AACA;;AAKA;AACA;AACA;AACA;AACA;AACO,MAAMW,KAAK,GAAG,IAAAC,sBAAgB,EAAE,cAAc,EAAE;EACtDC,OAAO,EAAPA,gBAAO;EACP3B,OAAO;EACPE;AACD,CAAE,CAAC;AAAC0B,OAAA,CAAAH,KAAA,GAAAA,KAAA;AAEJ,IAAAI,cAAQ,EAAEJ,KAAM,CAAC"}
1
+ {"version":3,"names":["_data","require","_reducer","_interopRequireDefault","actions","_interopRequireWildcard","selectors","_getRequireWildcardCache","e","WeakMap","r","t","__esModule","default","has","get","n","__proto__","a","Object","defineProperty","getOwnPropertyDescriptor","u","prototype","hasOwnProperty","call","i","set","store","exports","createReduxStore","reducer","register"],"sources":["@wordpress/notices/src/store/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { createReduxStore, register } from '@wordpress/data';\n\n/**\n * Internal dependencies\n */\nimport reducer from './reducer';\nimport * as actions from './actions';\nimport * as selectors from './selectors';\n\n/**\n * Store definition for the notices namespace.\n *\n * @see https://github.com/WordPress/gutenberg/blob/HEAD/packages/data/README.md#createReduxStore\n */\nexport const store = createReduxStore( 'core/notices', {\n\treducer,\n\tactions,\n\tselectors,\n} );\n\nregister( store );\n"],"mappings":";;;;;;;AAGA,IAAAA,KAAA,GAAAC,OAAA;AAKA,IAAAC,QAAA,GAAAC,sBAAA,CAAAF,OAAA;AACA,IAAAG,OAAA,GAAAC,uBAAA,CAAAJ,OAAA;AACA,IAAAK,SAAA,GAAAD,uBAAA,CAAAJ,OAAA;AAAyC,SAAAM,yBAAAC,CAAA,6BAAAC,OAAA,mBAAAC,CAAA,OAAAD,OAAA,IAAAE,CAAA,OAAAF,OAAA,YAAAF,wBAAA,YAAAA,CAAAC,CAAA,WAAAA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 @@ const notices = (0, _onSubKey.default)('context')((state = [], action) => {
41
41
  }
42
42
  return state;
43
43
  });
44
- var _default = notices;
45
- exports.default = _default;
44
+ var _default = exports.default = notices;
46
45
  //# sourceMappingURL=reducer.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["_onSubKey","_interopRequireDefault","require","notices","onSubKey","state","action","type","filter","id","notice","ids","includes","noticeType","_default","exports","default"],"sources":["@wordpress/notices/src/store/reducer.js"],"sourcesContent":["/**\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...state.filter( ( { id } ) => id !== action.notice.id ),\n\t\t\t\taction.notice,\n\t\t\t];\n\n\t\tcase 'REMOVE_NOTICE':\n\t\t\treturn state.filter( ( { id } ) => id !== action.id );\n\n\t\tcase 'REMOVE_NOTICES':\n\t\t\treturn state.filter( ( { id } ) => ! action.ids.includes( id ) );\n\n\t\tcase 'REMOVE_ALL_NOTICES':\n\t\t\treturn state.filter( ( { type } ) => type !== action.noticeType );\n\t}\n\n\treturn state;\n} );\n\nexport default notices;\n"],"mappings":";;;;;;;AAGA,IAAAA,SAAA,GAAAC,sBAAA,CAAAC,OAAA;AAHA;AACA;AACA;;AAGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAMC,OAAO,GAAG,IAAAC,iBAAQ,EAAE,SAAU,CAAC,CAAE,CAAEC,KAAK,GAAG,EAAE,EAAEC,MAAM,KAAM;EAChE,QAASA,MAAM,CAACC,IAAI;IACnB,KAAK,eAAe;MACnB;MACA,OAAO,CACN,GAAGF,KAAK,CAACG,MAAM,CAAE,CAAE;QAAEC;MAAG,CAAC,KAAMA,EAAE,KAAKH,MAAM,CAACI,MAAM,CAACD,EAAG,CAAC,EACxDH,MAAM,CAACI,MAAM,CACb;IAEF,KAAK,eAAe;MACnB,OAAOL,KAAK,CAACG,MAAM,CAAE,CAAE;QAAEC;MAAG,CAAC,KAAMA,EAAE,KAAKH,MAAM,CAACG,EAAG,CAAC;IAEtD,KAAK,gBAAgB;MACpB,OAAOJ,KAAK,CAACG,MAAM,CAAE,CAAE;QAAEC;MAAG,CAAC,KAAM,CAAEH,MAAM,CAACK,GAAG,CAACC,QAAQ,CAAEH,EAAG,CAAE,CAAC;IAEjE,KAAK,oBAAoB;MACxB,OAAOJ,KAAK,CAACG,MAAM,CAAE,CAAE;QAAED;MAAK,CAAC,KAAMA,IAAI,KAAKD,MAAM,CAACO,UAAW,CAAC;EACnE;EAEA,OAAOR,KAAK;AACb,CAAE,CAAC;AAAC,IAAAS,QAAA,GAEWX,OAAO;AAAAY,OAAA,CAAAC,OAAA,GAAAF,QAAA"}
1
+ {"version":3,"names":["_onSubKey","_interopRequireDefault","require","notices","onSubKey","state","action","type","filter","id","notice","ids","includes","noticeType","_default","exports","default"],"sources":["@wordpress/notices/src/store/reducer.js"],"sourcesContent":["/**\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...state.filter( ( { id } ) => id !== action.notice.id ),\n\t\t\t\taction.notice,\n\t\t\t];\n\n\t\tcase 'REMOVE_NOTICE':\n\t\t\treturn state.filter( ( { id } ) => id !== action.id );\n\n\t\tcase 'REMOVE_NOTICES':\n\t\t\treturn state.filter( ( { id } ) => ! action.ids.includes( id ) );\n\n\t\tcase 'REMOVE_ALL_NOTICES':\n\t\t\treturn state.filter( ( { type } ) => type !== action.noticeType );\n\t}\n\n\treturn state;\n} );\n\nexport default notices;\n"],"mappings":";;;;;;;AAGA,IAAAA,SAAA,GAAAC,sBAAA,CAAAC,OAAA;AAHA;AACA;AACA;;AAGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAMC,OAAO,GAAG,IAAAC,iBAAQ,EAAE,SAAU,CAAC,CAAE,CAAEC,KAAK,GAAG,EAAE,EAAEC,MAAM,KAAM;EAChE,QAASA,MAAM,CAACC,IAAI;IACnB,KAAK,eAAe;MACnB;MACA,OAAO,CACN,GAAGF,KAAK,CAACG,MAAM,CAAE,CAAE;QAAEC;MAAG,CAAC,KAAMA,EAAE,KAAKH,MAAM,CAACI,MAAM,CAACD,EAAG,CAAC,EACxDH,MAAM,CAACI,MAAM,CACb;IAEF,KAAK,eAAe;MACnB,OAAOL,KAAK,CAACG,MAAM,CAAE,CAAE;QAAEC;MAAG,CAAC,KAAMA,EAAE,KAAKH,MAAM,CAACG,EAAG,CAAC;IAEtD,KAAK,gBAAgB;MACpB,OAAOJ,KAAK,CAACG,MAAM,CAAE,CAAE;QAAEC;MAAG,CAAC,KAAM,CAAEH,MAAM,CAACK,GAAG,CAACC,QAAQ,CAAEH,EAAG,CAAE,CAAC;IAEjE,KAAK,oBAAoB;MACxB,OAAOJ,KAAK,CAACG,MAAM,CAAE,CAAE;QAAED;MAAK,CAAC,KAAMA,IAAI,KAAKD,MAAM,CAACO,UAAW,CAAC;EACnE;EAEA,OAAOR,KAAK;AACb,CAAE,CAAC;AAAC,IAAAS,QAAA,GAAAC,OAAA,CAAAC,OAAA,GAEWb,OAAO"}
@@ -32,6 +32,5 @@ const onSubKey = actionProperty => reducer => (state = {}, action) => {
32
32
  };
33
33
  };
34
34
  exports.onSubKey = onSubKey;
35
- var _default = onSubKey;
36
- exports.default = _default;
35
+ var _default = exports.default = onSubKey;
37
36
  //# sourceMappingURL=on-sub-key.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["onSubKey","actionProperty","reducer","state","action","key","undefined","nextKeyState","exports","_default","default"],"sources":["@wordpress/notices/src/store/utils/on-sub-key.js"],"sourcesContent":["/**\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 =\n\t( actionProperty ) =>\n\t( reducer ) =>\n\t( state = {}, action ) => {\n\t\t// Retrieve subkey from action. Do not track if undefined; useful for cases\n\t\t// where reducer is scoped by action shape.\n\t\tconst key = action[ actionProperty ];\n\t\tif ( key === undefined ) {\n\t\t\treturn state;\n\t\t}\n\n\t\t// Avoid updating state if unchanged. Note that this also accounts for a\n\t\t// reducer which returns undefined on a key which is not yet tracked.\n\t\tconst nextKeyState = reducer( state[ key ], action );\n\t\tif ( nextKeyState === state[ key ] ) {\n\t\t\treturn state;\n\t\t}\n\n\t\treturn {\n\t\t\t...state,\n\t\t\t[ key ]: nextKeyState,\n\t\t};\n\t};\n\nexport default onSubKey;\n"],"mappings":";;;;;;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,MAAMA,QAAQ,GAClBC,cAAc,IACdC,OAAO,IACT,CAAEC,KAAK,GAAG,CAAC,CAAC,EAAEC,MAAM,KAAM;EACzB;EACA;EACA,MAAMC,GAAG,GAAGD,MAAM,CAAEH,cAAc,CAAE;EACpC,IAAKI,GAAG,KAAKC,SAAS,EAAG;IACxB,OAAOH,KAAK;EACb;;EAEA;EACA;EACA,MAAMI,YAAY,GAAGL,OAAO,CAAEC,KAAK,CAAEE,GAAG,CAAE,EAAED,MAAO,CAAC;EACpD,IAAKG,YAAY,KAAKJ,KAAK,CAAEE,GAAG,CAAE,EAAG;IACpC,OAAOF,KAAK;EACb;EAEA,OAAO;IACN,GAAGA,KAAK;IACR,CAAEE,GAAG,GAAIE;EACV,CAAC;AACF,CAAC;AAACC,OAAA,CAAAR,QAAA,GAAAA,QAAA;AAAA,IAAAS,QAAA,GAEYT,QAAQ;AAAAQ,OAAA,CAAAE,OAAA,GAAAD,QAAA"}
1
+ {"version":3,"names":["onSubKey","actionProperty","reducer","state","action","key","undefined","nextKeyState","exports","_default","default"],"sources":["@wordpress/notices/src/store/utils/on-sub-key.js"],"sourcesContent":["/**\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 =\n\t( actionProperty ) =>\n\t( reducer ) =>\n\t( state = {}, action ) => {\n\t\t// Retrieve subkey from action. Do not track if undefined; useful for cases\n\t\t// where reducer is scoped by action shape.\n\t\tconst key = action[ actionProperty ];\n\t\tif ( key === undefined ) {\n\t\t\treturn state;\n\t\t}\n\n\t\t// Avoid updating state if unchanged. Note that this also accounts for a\n\t\t// reducer which returns undefined on a key which is not yet tracked.\n\t\tconst nextKeyState = reducer( state[ key ], action );\n\t\tif ( nextKeyState === state[ key ] ) {\n\t\t\treturn state;\n\t\t}\n\n\t\treturn {\n\t\t\t...state,\n\t\t\t[ key ]: nextKeyState,\n\t\t};\n\t};\n\nexport default onSubKey;\n"],"mappings":";;;;;;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,MAAMA,QAAQ,GAClBC,cAAc,IACdC,OAAO,IACT,CAAEC,KAAK,GAAG,CAAC,CAAC,EAAEC,MAAM,KAAM;EACzB;EACA;EACA,MAAMC,GAAG,GAAGD,MAAM,CAAEH,cAAc,CAAE;EACpC,IAAKI,GAAG,KAAKC,SAAS,EAAG;IACxB,OAAOH,KAAK;EACb;;EAEA;EACA;EACA,MAAMI,YAAY,GAAGL,OAAO,CAAEC,KAAK,CAAEE,GAAG,CAAE,EAAED,MAAO,CAAC;EACpD,IAAKG,YAAY,KAAKJ,KAAK,CAAEE,GAAG,CAAE,EAAG;IACpC,OAAOF,KAAK;EACb;EAEA,OAAO;IACN,GAAGA,KAAK;IACR,CAAEE,GAAG,GAAIE;EACV,CAAC;AACF,CAAC;AAACC,OAAA,CAAAR,QAAA,GAAAA,QAAA;AAAA,IAAAS,QAAA,GAAAD,OAAA,CAAAE,OAAA,GAEYV,QAAQ"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@wordpress/notices",
3
- "version": "4.18.0",
3
+ "version": "4.19.0",
4
4
  "description": "State management for notices.",
5
5
  "author": "The WordPress Contributors",
6
6
  "license": "GPL-2.0-or-later",
@@ -27,8 +27,8 @@
27
27
  "types": "build-types",
28
28
  "dependencies": {
29
29
  "@babel/runtime": "^7.16.0",
30
- "@wordpress/a11y": "^3.50.0",
31
- "@wordpress/data": "^9.20.0"
30
+ "@wordpress/a11y": "^3.51.0",
31
+ "@wordpress/data": "^9.21.0"
32
32
  },
33
33
  "peerDependencies": {
34
34
  "react": "^18.0.0"
@@ -36,5 +36,5 @@
36
36
  "publishConfig": {
37
37
  "access": "public"
38
38
  },
39
- "gitHead": "45de2cb4212fed7f2763e95f10300d1ff9d0ec08"
39
+ "gitHead": "eb796371e9630636a4a8837033807b0c4a06ed67"
40
40
  }