@wordpress/plugins 7.10.0 → 7.12.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,10 @@
2
2
 
3
3
  ## Unreleased
4
4
 
5
+ ## 7.12.0 (2024-11-16)
6
+
7
+ ## 7.11.0 (2024-10-30)
8
+
5
9
  ## 7.10.0 (2024-10-16)
6
10
 
7
11
  ## 7.9.0 (2024-10-03)
package/README.md CHANGED
@@ -192,6 +192,8 @@ _Returns_
192
192
 
193
193
  #### withPluginContext
194
194
 
195
+ > **Deprecated** 6.8.0 Use `usePluginContext` hook instead.
196
+
195
197
  A Higher Order Component used to inject Plugin context to the wrapped component.
196
198
 
197
199
  _Parameters_
@@ -1,5 +1,6 @@
1
1
  "use strict";
2
2
 
3
+ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
3
4
  Object.defineProperty(exports, "__esModule", {
4
5
  value: true
5
6
  });
@@ -8,6 +9,7 @@ exports.usePluginContext = usePluginContext;
8
9
  exports.withPluginContext = void 0;
9
10
  var _element = require("@wordpress/element");
10
11
  var _compose = require("@wordpress/compose");
12
+ var _deprecated = _interopRequireDefault(require("@wordpress/deprecated"));
11
13
  var _jsxRuntime = require("react/jsx-runtime");
12
14
  /**
13
15
  * WordPress dependencies
@@ -36,6 +38,8 @@ function usePluginContext() {
36
38
  * A Higher Order Component used to inject Plugin context to the
37
39
  * wrapped component.
38
40
  *
41
+ * @deprecated 6.8.0 Use `usePluginContext` hook instead.
42
+ *
39
43
  * @param mapContextToProps Function called on every context change,
40
44
  * expected to return object of props to
41
45
  * merge with the component's own props.
@@ -43,6 +47,10 @@ function usePluginContext() {
43
47
  * @return {Component} Enhanced component with injected context as props.
44
48
  */
45
49
  const withPluginContext = mapContextToProps => (0, _compose.createHigherOrderComponent)(OriginalComponent => {
50
+ (0, _deprecated.default)('wp.plugins.withPluginContext', {
51
+ since: '6.8.0',
52
+ alternative: 'wp.plugins.usePluginContext'
53
+ });
46
54
  return props => /*#__PURE__*/(0, _jsxRuntime.jsx)(Context.Consumer, {
47
55
  children: context => /*#__PURE__*/(0, _jsxRuntime.jsx)(OriginalComponent, {
48
56
  ...props,
@@ -1 +1 @@
1
- {"version":3,"names":["_element","require","_compose","_jsxRuntime","Context","createContext","name","icon","PluginContextProvider","exports","Provider","usePluginContext","useContext","withPluginContext","mapContextToProps","createHigherOrderComponent","OriginalComponent","props","jsx","Consumer","children","context"],"sources":["@wordpress/plugins/src/components/plugin-context/index.tsx"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { createContext, useContext } from '@wordpress/element';\nimport { createHigherOrderComponent } from '@wordpress/compose';\n\n/**\n * Internal dependencies\n */\nimport type { WPPlugin } from '../../api';\n\nexport interface PluginContext {\n\tname: null | WPPlugin[ 'name' ];\n\ticon: null | WPPlugin[ 'icon' ];\n}\n\nconst Context = createContext< PluginContext >( {\n\tname: null,\n\ticon: null,\n} );\n\nexport const PluginContextProvider = Context.Provider;\n\n/**\n * A hook that returns the plugin context.\n *\n * @return {PluginContext} Plugin context\n */\nexport function usePluginContext() {\n\treturn useContext( Context );\n}\n\n/**\n * A Higher Order Component used to inject Plugin context to the\n * wrapped component.\n *\n * @param mapContextToProps Function called on every context change,\n * expected to return object of props to\n * merge with the component's own props.\n *\n * @return {Component} Enhanced component with injected context as props.\n */\nexport const withPluginContext = (\n\tmapContextToProps: < T >(\n\t\tcontext: PluginContext,\n\t\tprops: T\n\t) => T & PluginContext\n) =>\n\tcreateHigherOrderComponent( ( OriginalComponent ) => {\n\t\treturn ( props ) => (\n\t\t\t<Context.Consumer>\n\t\t\t\t{ ( context ) => (\n\t\t\t\t\t<OriginalComponent\n\t\t\t\t\t\t{ ...props }\n\t\t\t\t\t\t{ ...mapContextToProps( context, props ) }\n\t\t\t\t\t/>\n\t\t\t\t) }\n\t\t\t</Context.Consumer>\n\t\t);\n\t}, 'withPluginContext' );\n"],"mappings":";;;;;;;;AAGA,IAAAA,QAAA,GAAAC,OAAA;AACA,IAAAC,QAAA,GAAAD,OAAA;AAAgE,IAAAE,WAAA,GAAAF,OAAA;AAJhE;AACA;AACA;;AAIA;AACA;AACA;;AAQA,MAAMG,OAAO,GAAG,IAAAC,sBAAa,EAAmB;EAC/CC,IAAI,EAAE,IAAI;EACVC,IAAI,EAAE;AACP,CAAE,CAAC;AAEI,MAAMC,qBAAqB,GAAAC,OAAA,CAAAD,qBAAA,GAAGJ,OAAO,CAACM,QAAQ;;AAErD;AACA;AACA;AACA;AACA;AACO,SAASC,gBAAgBA,CAAA,EAAG;EAClC,OAAO,IAAAC,mBAAU,EAAER,OAAQ,CAAC;AAC7B;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,MAAMS,iBAAiB,GAC7BC,iBAGsB,IAEtB,IAAAC,mCAA0B,EAAIC,iBAAiB,IAAM;EACpD,OAASC,KAAK,iBACb,IAAAd,WAAA,CAAAe,GAAA,EAACd,OAAO,CAACe,QAAQ;IAAAC,QAAA,EACZC,OAAO,iBACV,IAAAlB,WAAA,CAAAe,GAAA,EAACF,iBAAiB;MAAA,GACZC,KAAK;MAAA,GACLH,iBAAiB,CAAEO,OAAO,EAAEJ,KAAM;IAAC,CACxC;EACD,CACgB,CAClB;AACF,CAAC,EAAE,mBAAoB,CAAC;AAACR,OAAA,CAAAI,iBAAA,GAAAA,iBAAA","ignoreList":[]}
1
+ {"version":3,"names":["_element","require","_compose","_deprecated","_interopRequireDefault","_jsxRuntime","Context","createContext","name","icon","PluginContextProvider","exports","Provider","usePluginContext","useContext","withPluginContext","mapContextToProps","createHigherOrderComponent","OriginalComponent","deprecated","since","alternative","props","jsx","Consumer","children","context"],"sources":["@wordpress/plugins/src/components/plugin-context/index.tsx"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { createContext, useContext } from '@wordpress/element';\nimport { createHigherOrderComponent } from '@wordpress/compose';\nimport deprecated from '@wordpress/deprecated';\n\n/**\n * Internal dependencies\n */\nimport type { WPPlugin } from '../../api';\n\nexport interface PluginContext {\n\tname: null | WPPlugin[ 'name' ];\n\ticon: null | WPPlugin[ 'icon' ];\n}\n\nconst Context = createContext< PluginContext >( {\n\tname: null,\n\ticon: null,\n} );\n\nexport const PluginContextProvider = Context.Provider;\n\n/**\n * A hook that returns the plugin context.\n *\n * @return {PluginContext} Plugin context\n */\nexport function usePluginContext() {\n\treturn useContext( Context );\n}\n\n/**\n * A Higher Order Component used to inject Plugin context to the\n * wrapped component.\n *\n * @deprecated 6.8.0 Use `usePluginContext` hook instead.\n *\n * @param mapContextToProps Function called on every context change,\n * expected to return object of props to\n * merge with the component's own props.\n *\n * @return {Component} Enhanced component with injected context as props.\n */\nexport const withPluginContext = (\n\tmapContextToProps: < T >(\n\t\tcontext: PluginContext,\n\t\tprops: T\n\t) => T & PluginContext\n) =>\n\tcreateHigherOrderComponent( ( OriginalComponent ) => {\n\t\tdeprecated( 'wp.plugins.withPluginContext', {\n\t\t\tsince: '6.8.0',\n\t\t\talternative: 'wp.plugins.usePluginContext',\n\t\t} );\n\t\treturn ( props ) => (\n\t\t\t<Context.Consumer>\n\t\t\t\t{ ( context ) => (\n\t\t\t\t\t<OriginalComponent\n\t\t\t\t\t\t{ ...props }\n\t\t\t\t\t\t{ ...mapContextToProps( context, props ) }\n\t\t\t\t\t/>\n\t\t\t\t) }\n\t\t\t</Context.Consumer>\n\t\t);\n\t}, 'withPluginContext' );\n"],"mappings":";;;;;;;;;AAGA,IAAAA,QAAA,GAAAC,OAAA;AACA,IAAAC,QAAA,GAAAD,OAAA;AACA,IAAAE,WAAA,GAAAC,sBAAA,CAAAH,OAAA;AAA+C,IAAAI,WAAA,GAAAJ,OAAA;AAL/C;AACA;AACA;;AAKA;AACA;AACA;;AAQA,MAAMK,OAAO,GAAG,IAAAC,sBAAa,EAAmB;EAC/CC,IAAI,EAAE,IAAI;EACVC,IAAI,EAAE;AACP,CAAE,CAAC;AAEI,MAAMC,qBAAqB,GAAAC,OAAA,CAAAD,qBAAA,GAAGJ,OAAO,CAACM,QAAQ;;AAErD;AACA;AACA;AACA;AACA;AACO,SAASC,gBAAgBA,CAAA,EAAG;EAClC,OAAO,IAAAC,mBAAU,EAAER,OAAQ,CAAC;AAC7B;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,MAAMS,iBAAiB,GAC7BC,iBAGsB,IAEtB,IAAAC,mCAA0B,EAAIC,iBAAiB,IAAM;EACpD,IAAAC,mBAAU,EAAE,8BAA8B,EAAE;IAC3CC,KAAK,EAAE,OAAO;IACdC,WAAW,EAAE;EACd,CAAE,CAAC;EACH,OAASC,KAAK,iBACb,IAAAjB,WAAA,CAAAkB,GAAA,EAACjB,OAAO,CAACkB,QAAQ;IAAAC,QAAA,EACZC,OAAO,iBACV,IAAArB,WAAA,CAAAkB,GAAA,EAACL,iBAAiB;MAAA,GACZI,KAAK;MAAA,GACLN,iBAAiB,CAAEU,OAAO,EAAEJ,KAAM;IAAC,CACxC;EACD,CACgB,CAClB;AACF,CAAC,EAAE,mBAAoB,CAAC;AAACX,OAAA,CAAAI,iBAAA,GAAAA,iBAAA","ignoreList":[]}
@@ -3,6 +3,7 @@
3
3
  */
4
4
  import { createContext, useContext } from '@wordpress/element';
5
5
  import { createHigherOrderComponent } from '@wordpress/compose';
6
+ import deprecated from '@wordpress/deprecated';
6
7
 
7
8
  /**
8
9
  * Internal dependencies
@@ -27,6 +28,8 @@ export function usePluginContext() {
27
28
  * A Higher Order Component used to inject Plugin context to the
28
29
  * wrapped component.
29
30
  *
31
+ * @deprecated 6.8.0 Use `usePluginContext` hook instead.
32
+ *
30
33
  * @param mapContextToProps Function called on every context change,
31
34
  * expected to return object of props to
32
35
  * merge with the component's own props.
@@ -34,6 +37,10 @@ export function usePluginContext() {
34
37
  * @return {Component} Enhanced component with injected context as props.
35
38
  */
36
39
  export const withPluginContext = mapContextToProps => createHigherOrderComponent(OriginalComponent => {
40
+ deprecated('wp.plugins.withPluginContext', {
41
+ since: '6.8.0',
42
+ alternative: 'wp.plugins.usePluginContext'
43
+ });
37
44
  return props => /*#__PURE__*/_jsx(Context.Consumer, {
38
45
  children: context => /*#__PURE__*/_jsx(OriginalComponent, {
39
46
  ...props,
@@ -1 +1 @@
1
- {"version":3,"names":["createContext","useContext","createHigherOrderComponent","jsx","_jsx","Context","name","icon","PluginContextProvider","Provider","usePluginContext","withPluginContext","mapContextToProps","OriginalComponent","props","Consumer","children","context"],"sources":["@wordpress/plugins/src/components/plugin-context/index.tsx"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { createContext, useContext } from '@wordpress/element';\nimport { createHigherOrderComponent } from '@wordpress/compose';\n\n/**\n * Internal dependencies\n */\nimport type { WPPlugin } from '../../api';\n\nexport interface PluginContext {\n\tname: null | WPPlugin[ 'name' ];\n\ticon: null | WPPlugin[ 'icon' ];\n}\n\nconst Context = createContext< PluginContext >( {\n\tname: null,\n\ticon: null,\n} );\n\nexport const PluginContextProvider = Context.Provider;\n\n/**\n * A hook that returns the plugin context.\n *\n * @return {PluginContext} Plugin context\n */\nexport function usePluginContext() {\n\treturn useContext( Context );\n}\n\n/**\n * A Higher Order Component used to inject Plugin context to the\n * wrapped component.\n *\n * @param mapContextToProps Function called on every context change,\n * expected to return object of props to\n * merge with the component's own props.\n *\n * @return {Component} Enhanced component with injected context as props.\n */\nexport const withPluginContext = (\n\tmapContextToProps: < T >(\n\t\tcontext: PluginContext,\n\t\tprops: T\n\t) => T & PluginContext\n) =>\n\tcreateHigherOrderComponent( ( OriginalComponent ) => {\n\t\treturn ( props ) => (\n\t\t\t<Context.Consumer>\n\t\t\t\t{ ( context ) => (\n\t\t\t\t\t<OriginalComponent\n\t\t\t\t\t\t{ ...props }\n\t\t\t\t\t\t{ ...mapContextToProps( context, props ) }\n\t\t\t\t\t/>\n\t\t\t\t) }\n\t\t\t</Context.Consumer>\n\t\t);\n\t}, 'withPluginContext' );\n"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,aAAa,EAAEC,UAAU,QAAQ,oBAAoB;AAC9D,SAASC,0BAA0B,QAAQ,oBAAoB;;AAE/D;AACA;AACA;AAFA,SAAAC,GAAA,IAAAC,IAAA;AAUA,MAAMC,OAAO,GAAGL,aAAa,CAAmB;EAC/CM,IAAI,EAAE,IAAI;EACVC,IAAI,EAAE;AACP,CAAE,CAAC;AAEH,OAAO,MAAMC,qBAAqB,GAAGH,OAAO,CAACI,QAAQ;;AAErD;AACA;AACA;AACA;AACA;AACA,OAAO,SAASC,gBAAgBA,CAAA,EAAG;EAClC,OAAOT,UAAU,CAAEI,OAAQ,CAAC;AAC7B;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,MAAMM,iBAAiB,GAC7BC,iBAGsB,IAEtBV,0BAA0B,CAAIW,iBAAiB,IAAM;EACpD,OAASC,KAAK,iBACbV,IAAA,CAACC,OAAO,CAACU,QAAQ;IAAAC,QAAA,EACZC,OAAO,iBACVb,IAAA,CAACS,iBAAiB;MAAA,GACZC,KAAK;MAAA,GACLF,iBAAiB,CAAEK,OAAO,EAAEH,KAAM;IAAC,CACxC;EACD,CACgB,CAClB;AACF,CAAC,EAAE,mBAAoB,CAAC","ignoreList":[]}
1
+ {"version":3,"names":["createContext","useContext","createHigherOrderComponent","deprecated","jsx","_jsx","Context","name","icon","PluginContextProvider","Provider","usePluginContext","withPluginContext","mapContextToProps","OriginalComponent","since","alternative","props","Consumer","children","context"],"sources":["@wordpress/plugins/src/components/plugin-context/index.tsx"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { createContext, useContext } from '@wordpress/element';\nimport { createHigherOrderComponent } from '@wordpress/compose';\nimport deprecated from '@wordpress/deprecated';\n\n/**\n * Internal dependencies\n */\nimport type { WPPlugin } from '../../api';\n\nexport interface PluginContext {\n\tname: null | WPPlugin[ 'name' ];\n\ticon: null | WPPlugin[ 'icon' ];\n}\n\nconst Context = createContext< PluginContext >( {\n\tname: null,\n\ticon: null,\n} );\n\nexport const PluginContextProvider = Context.Provider;\n\n/**\n * A hook that returns the plugin context.\n *\n * @return {PluginContext} Plugin context\n */\nexport function usePluginContext() {\n\treturn useContext( Context );\n}\n\n/**\n * A Higher Order Component used to inject Plugin context to the\n * wrapped component.\n *\n * @deprecated 6.8.0 Use `usePluginContext` hook instead.\n *\n * @param mapContextToProps Function called on every context change,\n * expected to return object of props to\n * merge with the component's own props.\n *\n * @return {Component} Enhanced component with injected context as props.\n */\nexport const withPluginContext = (\n\tmapContextToProps: < T >(\n\t\tcontext: PluginContext,\n\t\tprops: T\n\t) => T & PluginContext\n) =>\n\tcreateHigherOrderComponent( ( OriginalComponent ) => {\n\t\tdeprecated( 'wp.plugins.withPluginContext', {\n\t\t\tsince: '6.8.0',\n\t\t\talternative: 'wp.plugins.usePluginContext',\n\t\t} );\n\t\treturn ( props ) => (\n\t\t\t<Context.Consumer>\n\t\t\t\t{ ( context ) => (\n\t\t\t\t\t<OriginalComponent\n\t\t\t\t\t\t{ ...props }\n\t\t\t\t\t\t{ ...mapContextToProps( context, props ) }\n\t\t\t\t\t/>\n\t\t\t\t) }\n\t\t\t</Context.Consumer>\n\t\t);\n\t}, 'withPluginContext' );\n"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,aAAa,EAAEC,UAAU,QAAQ,oBAAoB;AAC9D,SAASC,0BAA0B,QAAQ,oBAAoB;AAC/D,OAAOC,UAAU,MAAM,uBAAuB;;AAE9C;AACA;AACA;AAFA,SAAAC,GAAA,IAAAC,IAAA;AAUA,MAAMC,OAAO,GAAGN,aAAa,CAAmB;EAC/CO,IAAI,EAAE,IAAI;EACVC,IAAI,EAAE;AACP,CAAE,CAAC;AAEH,OAAO,MAAMC,qBAAqB,GAAGH,OAAO,CAACI,QAAQ;;AAErD;AACA;AACA;AACA;AACA;AACA,OAAO,SAASC,gBAAgBA,CAAA,EAAG;EAClC,OAAOV,UAAU,CAAEK,OAAQ,CAAC;AAC7B;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,MAAMM,iBAAiB,GAC7BC,iBAGsB,IAEtBX,0BAA0B,CAAIY,iBAAiB,IAAM;EACpDX,UAAU,CAAE,8BAA8B,EAAE;IAC3CY,KAAK,EAAE,OAAO;IACdC,WAAW,EAAE;EACd,CAAE,CAAC;EACH,OAASC,KAAK,iBACbZ,IAAA,CAACC,OAAO,CAACY,QAAQ;IAAAC,QAAA,EACZC,OAAO,iBACVf,IAAA,CAACS,iBAAiB;MAAA,GACZG,KAAK;MAAA,GACLJ,iBAAiB,CAAEO,OAAO,EAAEH,KAAM;IAAC,CACxC;EACD,CACgB,CAClB;AACF,CAAC,EAAE,mBAAoB,CAAC","ignoreList":[]}
@@ -17,6 +17,8 @@ export declare function usePluginContext(): PluginContext;
17
17
  * A Higher Order Component used to inject Plugin context to the
18
18
  * wrapped component.
19
19
  *
20
+ * @deprecated 6.8.0 Use `usePluginContext` hook instead.
21
+ *
20
22
  * @param mapContextToProps Function called on every context change,
21
23
  * expected to return object of props to
22
24
  * merge with the component's own props.
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/plugin-context/index.tsx"],"names":[],"mappings":"AAMA;;GAEG;AACH,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,WAAW,CAAC;AAE1C,MAAM,WAAW,aAAa;IAC7B,IAAI,EAAE,IAAI,GAAG,QAAQ,CAAE,MAAM,CAAE,CAAC;IAChC,IAAI,EAAE,IAAI,GAAG,QAAQ,CAAE,MAAM,CAAE,CAAC;CAChC;AAOD,eAAO,MAAM,qBAAqB,yCAAmB,CAAC;AAEtD;;;;GAIG;AACH,wBAAgB,gBAAgB,kBAE/B;AAED;;;;;;;;;GASG;AACH,eAAO,MAAM,iBAAiB,sBACV,CAAE,CAAC,EACrB,OAAO,EAAE,aAAa,EACtB,KAAK,EAAE,CAAC,KACJ,CAAC,GAAG,aAAa,+FAaE,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/plugin-context/index.tsx"],"names":[],"mappings":"AAOA;;GAEG;AACH,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,WAAW,CAAC;AAE1C,MAAM,WAAW,aAAa;IAC7B,IAAI,EAAE,IAAI,GAAG,QAAQ,CAAE,MAAM,CAAE,CAAC;IAChC,IAAI,EAAE,IAAI,GAAG,QAAQ,CAAE,MAAM,CAAE,CAAC;CAChC;AAOD,eAAO,MAAM,qBAAqB,yCAAmB,CAAC;AAEtD;;;;GAIG;AACH,wBAAgB,gBAAgB,kBAE/B;AAED;;;;;;;;;;;GAWG;AACH,eAAO,MAAM,iBAAiB,sBACV,CAAE,CAAC,EACrB,OAAO,EAAE,aAAa,EACtB,KAAK,EAAE,CAAC,KACJ,CAAC,GAAG,aAAa,+FAiBE,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@wordpress/plugins",
3
- "version": "7.10.0",
3
+ "version": "7.12.0",
4
4
  "description": "Plugins module for WordPress.",
5
5
  "author": "The WordPress Contributors",
6
6
  "license": "GPL-2.0-or-later",
@@ -25,15 +25,17 @@
25
25
  "main": "build/index.js",
26
26
  "module": "build-module/index.js",
27
27
  "react-native": "src/index",
28
+ "wpScript": true,
28
29
  "types": "build-types",
29
30
  "dependencies": {
30
31
  "@babel/runtime": "7.25.7",
31
- "@wordpress/components": "^28.10.0",
32
- "@wordpress/compose": "^7.10.0",
33
- "@wordpress/element": "^6.10.0",
34
- "@wordpress/hooks": "^4.10.0",
35
- "@wordpress/icons": "^10.10.0",
36
- "@wordpress/is-shallow-equal": "^5.10.0",
32
+ "@wordpress/components": "*",
33
+ "@wordpress/compose": "*",
34
+ "@wordpress/deprecated": "*",
35
+ "@wordpress/element": "*",
36
+ "@wordpress/hooks": "*",
37
+ "@wordpress/icons": "*",
38
+ "@wordpress/is-shallow-equal": "*",
37
39
  "memize": "^2.0.1"
38
40
  },
39
41
  "peerDependencies": {
@@ -43,5 +45,5 @@
43
45
  "publishConfig": {
44
46
  "access": "public"
45
47
  },
46
- "gitHead": "ab34a7ac935fd1478eac63b596242d83270897ee"
48
+ "gitHead": "510540d99f3d222a96f08d3d7b66c9e7a726f705"
47
49
  }
@@ -3,6 +3,7 @@
3
3
  */
4
4
  import { createContext, useContext } from '@wordpress/element';
5
5
  import { createHigherOrderComponent } from '@wordpress/compose';
6
+ import deprecated from '@wordpress/deprecated';
6
7
 
7
8
  /**
8
9
  * Internal dependencies
@@ -34,6 +35,8 @@ export function usePluginContext() {
34
35
  * A Higher Order Component used to inject Plugin context to the
35
36
  * wrapped component.
36
37
  *
38
+ * @deprecated 6.8.0 Use `usePluginContext` hook instead.
39
+ *
37
40
  * @param mapContextToProps Function called on every context change,
38
41
  * expected to return object of props to
39
42
  * merge with the component's own props.
@@ -47,6 +50,10 @@ export const withPluginContext = (
47
50
  ) => T & PluginContext
48
51
  ) =>
49
52
  createHigherOrderComponent( ( OriginalComponent ) => {
53
+ deprecated( 'wp.plugins.withPluginContext', {
54
+ since: '6.8.0',
55
+ alternative: 'wp.plugins.usePluginContext',
56
+ } );
50
57
  return ( props ) => (
51
58
  <Context.Consumer>
52
59
  { ( context ) => (
package/tsconfig.json CHANGED
@@ -9,6 +9,7 @@
9
9
  "references": [
10
10
  { "path": "../components" },
11
11
  { "path": "../compose" },
12
+ { "path": "../deprecated" },
12
13
  { "path": "../element" },
13
14
  { "path": "../hooks" },
14
15
  { "path": "../icons" },