@wordpress/private-apis 1.11.0 → 1.12.1-next.082ed6819.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
+ ## 1.12.0 (2024-11-16)
6
+
5
7
  ## 1.11.0 (2024-10-30)
6
8
 
7
9
  ## 1.10.0 (2024-10-16)
@@ -11,20 +11,18 @@ exports.resetRegisteredPrivateApis = resetRegisteredPrivateApis;
11
11
  * wordpress/private-apis – the utilities to enable private cross-package
12
12
  * exports of private APIs.
13
13
  *
14
- * This "implementation.js" file is needed for the sake of the unit tests. It
14
+ * This "implementation.ts" file is needed for the sake of the unit tests. It
15
15
  * exports more than the public API of the package to aid in testing.
16
16
  */
17
17
 
18
18
  /**
19
19
  * The list of core modules allowed to opt-in to the private APIs.
20
20
  */
21
- const CORE_MODULES_USING_PRIVATE_APIS = ['@wordpress/block-directory', '@wordpress/block-editor', '@wordpress/block-library', '@wordpress/blocks', '@wordpress/commands', '@wordpress/components', '@wordpress/core-commands', '@wordpress/core-data', '@wordpress/customize-widgets', '@wordpress/data', '@wordpress/edit-post', '@wordpress/edit-site', '@wordpress/edit-widgets', '@wordpress/editor', '@wordpress/format-library', '@wordpress/patterns', '@wordpress/preferences', '@wordpress/reusable-blocks', '@wordpress/router', '@wordpress/dataviews', '@wordpress/fields'];
21
+ const CORE_MODULES_USING_PRIVATE_APIS = ['@wordpress/block-directory', '@wordpress/block-editor', '@wordpress/block-library', '@wordpress/blocks', '@wordpress/commands', '@wordpress/components', '@wordpress/core-commands', '@wordpress/core-data', '@wordpress/customize-widgets', '@wordpress/data', '@wordpress/edit-post', '@wordpress/edit-site', '@wordpress/edit-widgets', '@wordpress/editor', '@wordpress/format-library', '@wordpress/patterns', '@wordpress/preferences', '@wordpress/reusable-blocks', '@wordpress/router', '@wordpress/dataviews', '@wordpress/fields', '@wordpress/media-utils'];
22
22
 
23
23
  /**
24
24
  * A list of core modules that already opted-in to
25
25
  * the privateApis package.
26
- *
27
- * @type {string[]}
28
26
  */
29
27
  const registeredPrivateApis = [];
30
28
 
@@ -51,9 +49,9 @@ const allowReRegistration = globalThis.IS_WORDPRESS_CORE ? false : true;
51
49
  * Called by a @wordpress package wishing to opt-in to accessing or exposing
52
50
  * private private APIs.
53
51
  *
54
- * @param {string} consent The consent string.
55
- * @param {string} moduleName The name of the module that is opting in.
56
- * @return {{lock: typeof lock, unlock: typeof unlock}} An object containing the lock and unlock functions.
52
+ * @param consent The consent string.
53
+ * @param moduleName The name of the module that is opting in.
54
+ * @return An object containing the lock and unlock functions.
57
55
  */
58
56
  const __dangerousOptInToUnstableAPIsOnlyForCoreModules = (consent, moduleName) => {
59
57
  if (!CORE_MODULES_USING_PRIVATE_APIS.includes(moduleName)) {
@@ -96,8 +94,8 @@ const __dangerousOptInToUnstableAPIsOnlyForCoreModules = (consent, moduleName) =
96
94
  * // { a: 1 }
97
95
  * ```
98
96
  *
99
- * @param {any} object The object to bind the private data to.
100
- * @param {any} privateData The private data to bind to the object.
97
+ * @param object The object to bind the private data to.
98
+ * @param privateData The private data to bind to the object.
101
99
  */
102
100
  exports.__dangerousOptInToUnstableAPIsOnlyForCoreModules = __dangerousOptInToUnstableAPIsOnlyForCoreModules;
103
101
  function lock(object, privateData) {
@@ -130,8 +128,8 @@ function lock(object, privateData) {
130
128
  * // { a: 1 }
131
129
  * ```
132
130
  *
133
- * @param {any} object The object to unlock the private data from.
134
- * @return {any} The private data bound to the object.
131
+ * @param object The object to unlock the private data from.
132
+ * @return The private data bound to the object.
135
133
  */
136
134
  function unlock(object) {
137
135
  if (!object) {
@@ -156,7 +154,7 @@ const __private = Symbol('Private API ID');
156
154
  * Private function to allow the unit tests to allow
157
155
  * a mock module to access the private APIs.
158
156
  *
159
- * @param {string} name The name of the module.
157
+ * @param name The name of the module.
160
158
  */
161
159
  function allowCoreModule(name) {
162
160
  CORE_MODULES_USING_PRIVATE_APIS.push(name);
@@ -1 +1 @@
1
- {"version":3,"names":["CORE_MODULES_USING_PRIVATE_APIS","registeredPrivateApis","requiredConsent","allowReRegistration","globalThis","IS_WORDPRESS_CORE","__dangerousOptInToUnstableAPIsOnlyForCoreModules","consent","moduleName","includes","Error","push","lock","unlock","exports","object","privateData","__private","lockedData","set","get","WeakMap","Symbol","allowCoreModule","name","resetAllowedCoreModules","length","pop","resetRegisteredPrivateApis"],"sources":["@wordpress/private-apis/src/implementation.js"],"sourcesContent":["/**\n * wordpress/private-apis – the utilities to enable private cross-package\n * exports of private APIs.\n *\n * This \"implementation.js\" file is needed for the sake of the unit tests. It\n * exports more than the public API of the package to aid in testing.\n */\n\n/**\n * The list of core modules allowed to opt-in to the private APIs.\n */\nconst CORE_MODULES_USING_PRIVATE_APIS = [\n\t'@wordpress/block-directory',\n\t'@wordpress/block-editor',\n\t'@wordpress/block-library',\n\t'@wordpress/blocks',\n\t'@wordpress/commands',\n\t'@wordpress/components',\n\t'@wordpress/core-commands',\n\t'@wordpress/core-data',\n\t'@wordpress/customize-widgets',\n\t'@wordpress/data',\n\t'@wordpress/edit-post',\n\t'@wordpress/edit-site',\n\t'@wordpress/edit-widgets',\n\t'@wordpress/editor',\n\t'@wordpress/format-library',\n\t'@wordpress/patterns',\n\t'@wordpress/preferences',\n\t'@wordpress/reusable-blocks',\n\t'@wordpress/router',\n\t'@wordpress/dataviews',\n\t'@wordpress/fields',\n];\n\n/**\n * A list of core modules that already opted-in to\n * the privateApis package.\n *\n * @type {string[]}\n */\nconst registeredPrivateApis = [];\n\n/*\n * Warning for theme and plugin developers.\n *\n * The use of private developer APIs is intended for use by WordPress Core\n * and the Gutenberg plugin exclusively.\n *\n * Dangerously opting in to using these APIs is NOT RECOMMENDED. Furthermore,\n * the WordPress Core philosophy to strive to maintain backward compatibility\n * for third-party developers DOES NOT APPLY to private APIs.\n *\n * THE CONSENT STRING FOR OPTING IN TO THESE APIS MAY CHANGE AT ANY TIME AND\n * WITHOUT NOTICE. THIS CHANGE WILL BREAK EXISTING THIRD-PARTY CODE. SUCH A\n * CHANGE MAY OCCUR IN EITHER A MAJOR OR MINOR RELEASE.\n */\nconst requiredConsent =\n\t'I acknowledge private features are not for use in themes or plugins and doing so will break in the next version of WordPress.';\n\n// The safety measure is meant for WordPress core where IS_WORDPRESS_CORE is set to true.\nconst allowReRegistration = globalThis.IS_WORDPRESS_CORE ? false : true;\n\n/**\n * Called by a @wordpress package wishing to opt-in to accessing or exposing\n * private private APIs.\n *\n * @param {string} consent The consent string.\n * @param {string} moduleName The name of the module that is opting in.\n * @return {{lock: typeof lock, unlock: typeof unlock}} An object containing the lock and unlock functions.\n */\nexport const __dangerousOptInToUnstableAPIsOnlyForCoreModules = (\n\tconsent,\n\tmoduleName\n) => {\n\tif ( ! CORE_MODULES_USING_PRIVATE_APIS.includes( moduleName ) ) {\n\t\tthrow new Error(\n\t\t\t`You tried to opt-in to unstable APIs as module \"${ moduleName }\". ` +\n\t\t\t\t'This feature is only for JavaScript modules shipped with WordPress core. ' +\n\t\t\t\t'Please do not use it in plugins and themes as the unstable APIs will be removed ' +\n\t\t\t\t'without a warning. If you ignore this error and depend on unstable features, ' +\n\t\t\t\t'your product will inevitably break on one of the next WordPress releases.'\n\t\t);\n\t}\n\tif (\n\t\t! allowReRegistration &&\n\t\tregisteredPrivateApis.includes( moduleName )\n\t) {\n\t\t// This check doesn't play well with Story Books / Hot Module Reloading\n\t\t// and isn't included in the Gutenberg plugin. It only matters in the\n\t\t// WordPress core release.\n\t\tthrow new Error(\n\t\t\t`You tried to opt-in to unstable APIs as module \"${ moduleName }\" which is already registered. ` +\n\t\t\t\t'This feature is only for JavaScript modules shipped with WordPress core. ' +\n\t\t\t\t'Please do not use it in plugins and themes as the unstable APIs will be removed ' +\n\t\t\t\t'without a warning. If you ignore this error and depend on unstable features, ' +\n\t\t\t\t'your product will inevitably break on one of the next WordPress releases.'\n\t\t);\n\t}\n\tif ( consent !== requiredConsent ) {\n\t\tthrow new Error(\n\t\t\t`You tried to opt-in to unstable APIs without confirming you know the consequences. ` +\n\t\t\t\t'This feature is only for JavaScript modules shipped with WordPress core. ' +\n\t\t\t\t'Please do not use it in plugins and themes as the unstable APIs will removed ' +\n\t\t\t\t'without a warning. If you ignore this error and depend on unstable features, ' +\n\t\t\t\t'your product will inevitably break on the next WordPress release.'\n\t\t);\n\t}\n\tregisteredPrivateApis.push( moduleName );\n\n\treturn {\n\t\tlock,\n\t\tunlock,\n\t};\n};\n\n/**\n * Binds private data to an object.\n * It does not alter the passed object in any way, only\n * registers it in an internal map of private data.\n *\n * The private data can't be accessed by any other means\n * than the `unlock` function.\n *\n * @example\n * ```js\n * const object = {};\n * const privateData = { a: 1 };\n * lock( object, privateData );\n *\n * object\n * // {}\n *\n * unlock( object );\n * // { a: 1 }\n * ```\n *\n * @param {any} object The object to bind the private data to.\n * @param {any} privateData The private data to bind to the object.\n */\nfunction lock( object, privateData ) {\n\tif ( ! object ) {\n\t\tthrow new Error( 'Cannot lock an undefined object.' );\n\t}\n\tif ( ! ( __private in object ) ) {\n\t\tobject[ __private ] = {};\n\t}\n\tlockedData.set( object[ __private ], privateData );\n}\n\n/**\n * Unlocks the private data bound to an object.\n *\n * It does not alter the passed object in any way, only\n * returns the private data paired with it using the `lock()`\n * function.\n *\n * @example\n * ```js\n * const object = {};\n * const privateData = { a: 1 };\n * lock( object, privateData );\n *\n * object\n * // {}\n *\n * unlock( object );\n * // { a: 1 }\n * ```\n *\n * @param {any} object The object to unlock the private data from.\n * @return {any} The private data bound to the object.\n */\nfunction unlock( object ) {\n\tif ( ! object ) {\n\t\tthrow new Error( 'Cannot unlock an undefined object.' );\n\t}\n\tif ( ! ( __private in object ) ) {\n\t\tthrow new Error(\n\t\t\t'Cannot unlock an object that was not locked before. '\n\t\t);\n\t}\n\n\treturn lockedData.get( object[ __private ] );\n}\n\nconst lockedData = new WeakMap();\n\n/**\n * Used by lock() and unlock() to uniquely identify the private data\n * related to a containing object.\n */\nconst __private = Symbol( 'Private API ID' );\n\n// Unit tests utilities:\n\n/**\n * Private function to allow the unit tests to allow\n * a mock module to access the private APIs.\n *\n * @param {string} name The name of the module.\n */\nexport function allowCoreModule( name ) {\n\tCORE_MODULES_USING_PRIVATE_APIS.push( name );\n}\n\n/**\n * Private function to allow the unit tests to set\n * a custom list of allowed modules.\n */\nexport function resetAllowedCoreModules() {\n\twhile ( CORE_MODULES_USING_PRIVATE_APIS.length ) {\n\t\tCORE_MODULES_USING_PRIVATE_APIS.pop();\n\t}\n}\n/**\n * Private function to allow the unit tests to reset\n * the list of registered private apis.\n */\nexport function resetRegisteredPrivateApis() {\n\twhile ( registeredPrivateApis.length ) {\n\t\tregisteredPrivateApis.pop();\n\t}\n}\n"],"mappings":";;;;;;;;;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,MAAMA,+BAA+B,GAAG,CACvC,4BAA4B,EAC5B,yBAAyB,EACzB,0BAA0B,EAC1B,mBAAmB,EACnB,qBAAqB,EACrB,uBAAuB,EACvB,0BAA0B,EAC1B,sBAAsB,EACtB,8BAA8B,EAC9B,iBAAiB,EACjB,sBAAsB,EACtB,sBAAsB,EACtB,yBAAyB,EACzB,mBAAmB,EACnB,2BAA2B,EAC3B,qBAAqB,EACrB,wBAAwB,EACxB,4BAA4B,EAC5B,mBAAmB,EACnB,sBAAsB,EACtB,mBAAmB,CACnB;;AAED;AACA;AACA;AACA;AACA;AACA;AACA,MAAMC,qBAAqB,GAAG,EAAE;;AAEhC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAMC,eAAe,GACpB,+HAA+H;;AAEhI;AACA,MAAMC,mBAAmB,GAAGC,UAAU,CAACC,iBAAiB,GAAG,KAAK,GAAG,IAAI;;AAEvE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,MAAMC,gDAAgD,GAAGA,CAC/DC,OAAO,EACPC,UAAU,KACN;EACJ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;AACA;AACA,SAASH,MAAMA,CAAEE,MAAM,EAAG;EACzB,IAAK,CAAEA,MAAM,EAAG;IACf,MAAM,IAAIL,KAAK,CAAE,oCAAqC,CAAC;EACxD;EACA,IAAK,EAAIO,SAAS,IAAIF,MAAM,CAAE,EAAG;IAChC,MAAM,IAAIL,KAAK,CACd,sDACD,CAAC;EACF;EAEA,OAAOQ,UAAU,CAACE,GAAG,CAAEL,MAAM,CAAEE,SAAS,CAAG,CAAC;AAC7C;AAEA,MAAMC,UAAU,GAAG,IAAIG,OAAO,CAAC,CAAC;;AAEhC;AACA;AACA;AACA;AACA,MAAMJ,SAAS,GAAGK,MAAM,CAAE,gBAAiB,CAAC;;AAE5C;;AAEA;AACA;AACA;AACA;AACA;AACA;AACO,SAASC,eAAeA,CAAEC,IAAI,EAAG;EACvCxB,+BAA+B,CAACW,IAAI,CAAEa,IAAK,CAAC;AAC7C;;AAEA;AACA;AACA;AACA;AACO,SAASC,uBAAuBA,CAAA,EAAG;EACzC,OAAQzB,+BAA+B,CAAC0B,MAAM,EAAG;IAChD1B,+BAA+B,CAAC2B,GAAG,CAAC,CAAC;EACtC;AACD;AACA;AACA;AACA;AACA;AACO,SAASC,0BAA0BA,CAAA,EAAG;EAC5C,OAAQ3B,qBAAqB,CAACyB,MAAM,EAAG;IACtCzB,qBAAqB,CAAC0B,GAAG,CAAC,CAAC;EAC5B;AACD","ignoreList":[]}
1
+ {"version":3,"names":["CORE_MODULES_USING_PRIVATE_APIS","registeredPrivateApis","requiredConsent","allowReRegistration","globalThis","IS_WORDPRESS_CORE","__dangerousOptInToUnstableAPIsOnlyForCoreModules","consent","moduleName","includes","Error","push","lock","unlock","exports","object","privateData","__private","lockedData","set","get","WeakMap","Symbol","allowCoreModule","name","resetAllowedCoreModules","length","pop","resetRegisteredPrivateApis"],"sources":["@wordpress/private-apis/src/implementation.ts"],"sourcesContent":["/**\n * wordpress/private-apis – the utilities to enable private cross-package\n * exports of private APIs.\n *\n * This \"implementation.ts\" file is needed for the sake of the unit tests. It\n * exports more than the public API of the package to aid in testing.\n */\n\n/**\n * The list of core modules allowed to opt-in to the private APIs.\n */\nconst CORE_MODULES_USING_PRIVATE_APIS = [\n\t'@wordpress/block-directory',\n\t'@wordpress/block-editor',\n\t'@wordpress/block-library',\n\t'@wordpress/blocks',\n\t'@wordpress/commands',\n\t'@wordpress/components',\n\t'@wordpress/core-commands',\n\t'@wordpress/core-data',\n\t'@wordpress/customize-widgets',\n\t'@wordpress/data',\n\t'@wordpress/edit-post',\n\t'@wordpress/edit-site',\n\t'@wordpress/edit-widgets',\n\t'@wordpress/editor',\n\t'@wordpress/format-library',\n\t'@wordpress/patterns',\n\t'@wordpress/preferences',\n\t'@wordpress/reusable-blocks',\n\t'@wordpress/router',\n\t'@wordpress/dataviews',\n\t'@wordpress/fields',\n\t'@wordpress/media-utils',\n];\n\n/**\n * A list of core modules that already opted-in to\n * the privateApis package.\n */\nconst registeredPrivateApis: Array< string > = [];\n\n/*\n * Warning for theme and plugin developers.\n *\n * The use of private developer APIs is intended for use by WordPress Core\n * and the Gutenberg plugin exclusively.\n *\n * Dangerously opting in to using these APIs is NOT RECOMMENDED. Furthermore,\n * the WordPress Core philosophy to strive to maintain backward compatibility\n * for third-party developers DOES NOT APPLY to private APIs.\n *\n * THE CONSENT STRING FOR OPTING IN TO THESE APIS MAY CHANGE AT ANY TIME AND\n * WITHOUT NOTICE. THIS CHANGE WILL BREAK EXISTING THIRD-PARTY CODE. SUCH A\n * CHANGE MAY OCCUR IN EITHER A MAJOR OR MINOR RELEASE.\n */\nconst requiredConsent =\n\t'I acknowledge private features are not for use in themes or plugins and doing so will break in the next version of WordPress.';\n\n// The safety measure is meant for WordPress core where IS_WORDPRESS_CORE is set to true.\nconst allowReRegistration = globalThis.IS_WORDPRESS_CORE ? false : true;\n\n/**\n * Called by a @wordpress package wishing to opt-in to accessing or exposing\n * private private APIs.\n *\n * @param consent The consent string.\n * @param moduleName The name of the module that is opting in.\n * @return An object containing the lock and unlock functions.\n */\nexport const __dangerousOptInToUnstableAPIsOnlyForCoreModules = (\n\tconsent: string,\n\tmoduleName: string\n) => {\n\tif ( ! CORE_MODULES_USING_PRIVATE_APIS.includes( moduleName ) ) {\n\t\tthrow new Error(\n\t\t\t`You tried to opt-in to unstable APIs as module \"${ moduleName }\". ` +\n\t\t\t\t'This feature is only for JavaScript modules shipped with WordPress core. ' +\n\t\t\t\t'Please do not use it in plugins and themes as the unstable APIs will be removed ' +\n\t\t\t\t'without a warning. If you ignore this error and depend on unstable features, ' +\n\t\t\t\t'your product will inevitably break on one of the next WordPress releases.'\n\t\t);\n\t}\n\tif (\n\t\t! allowReRegistration &&\n\t\tregisteredPrivateApis.includes( moduleName )\n\t) {\n\t\t// This check doesn't play well with Story Books / Hot Module Reloading\n\t\t// and isn't included in the Gutenberg plugin. It only matters in the\n\t\t// WordPress core release.\n\t\tthrow new Error(\n\t\t\t`You tried to opt-in to unstable APIs as module \"${ moduleName }\" which is already registered. ` +\n\t\t\t\t'This feature is only for JavaScript modules shipped with WordPress core. ' +\n\t\t\t\t'Please do not use it in plugins and themes as the unstable APIs will be removed ' +\n\t\t\t\t'without a warning. If you ignore this error and depend on unstable features, ' +\n\t\t\t\t'your product will inevitably break on one of the next WordPress releases.'\n\t\t);\n\t}\n\tif ( consent !== requiredConsent ) {\n\t\tthrow new Error(\n\t\t\t`You tried to opt-in to unstable APIs without confirming you know the consequences. ` +\n\t\t\t\t'This feature is only for JavaScript modules shipped with WordPress core. ' +\n\t\t\t\t'Please do not use it in plugins and themes as the unstable APIs will removed ' +\n\t\t\t\t'without a warning. If you ignore this error and depend on unstable features, ' +\n\t\t\t\t'your product will inevitably break on the next WordPress release.'\n\t\t);\n\t}\n\tregisteredPrivateApis.push( moduleName );\n\n\treturn {\n\t\tlock,\n\t\tunlock,\n\t};\n};\n\n/**\n * Binds private data to an object.\n * It does not alter the passed object in any way, only\n * registers it in an internal map of private data.\n *\n * The private data can't be accessed by any other means\n * than the `unlock` function.\n *\n * @example\n * ```js\n * const object = {};\n * const privateData = { a: 1 };\n * lock( object, privateData );\n *\n * object\n * // {}\n *\n * unlock( object );\n * // { a: 1 }\n * ```\n *\n * @param object The object to bind the private data to.\n * @param privateData The private data to bind to the object.\n */\nfunction lock( object: Record< symbol, WeakKey >, privateData: unknown ) {\n\tif ( ! object ) {\n\t\tthrow new Error( 'Cannot lock an undefined object.' );\n\t}\n\tif ( ! ( __private in object ) ) {\n\t\tobject[ __private ] = {};\n\t}\n\tlockedData.set( object[ __private ], privateData );\n}\n\n/**\n * Unlocks the private data bound to an object.\n *\n * It does not alter the passed object in any way, only\n * returns the private data paired with it using the `lock()`\n * function.\n *\n * @example\n * ```js\n * const object = {};\n * const privateData = { a: 1 };\n * lock( object, privateData );\n *\n * object\n * // {}\n *\n * unlock( object );\n * // { a: 1 }\n * ```\n *\n * @param object The object to unlock the private data from.\n * @return The private data bound to the object.\n */\nfunction unlock( object: Record< symbol, WeakKey > ) {\n\tif ( ! object ) {\n\t\tthrow new Error( 'Cannot unlock an undefined object.' );\n\t}\n\tif ( ! ( __private in object ) ) {\n\t\tthrow new Error(\n\t\t\t'Cannot unlock an object that was not locked before. '\n\t\t);\n\t}\n\n\treturn lockedData.get( object[ __private ] );\n}\n\nconst lockedData = new WeakMap();\n\n/**\n * Used by lock() and unlock() to uniquely identify the private data\n * related to a containing object.\n */\nconst __private = Symbol( 'Private API ID' );\n\n// Unit tests utilities:\n\n/**\n * Private function to allow the unit tests to allow\n * a mock module to access the private APIs.\n *\n * @param name The name of the module.\n */\nexport function allowCoreModule( name: string ) {\n\tCORE_MODULES_USING_PRIVATE_APIS.push( name );\n}\n\n/**\n * Private function to allow the unit tests to set\n * a custom list of allowed modules.\n */\nexport function resetAllowedCoreModules() {\n\twhile ( CORE_MODULES_USING_PRIVATE_APIS.length ) {\n\t\tCORE_MODULES_USING_PRIVATE_APIS.pop();\n\t}\n}\n/**\n * Private function to allow the unit tests to reset\n * the list of registered private apis.\n */\nexport function resetRegisteredPrivateApis() {\n\twhile ( registeredPrivateApis.length ) {\n\t\tregisteredPrivateApis.pop();\n\t}\n}\n"],"mappings":";;;;;;;;;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,MAAMA,+BAA+B,GAAG,CACvC,4BAA4B,EAC5B,yBAAyB,EACzB,0BAA0B,EAC1B,mBAAmB,EACnB,qBAAqB,EACrB,uBAAuB,EACvB,0BAA0B,EAC1B,sBAAsB,EACtB,8BAA8B,EAC9B,iBAAiB,EACjB,sBAAsB,EACtB,sBAAsB,EACtB,yBAAyB,EACzB,mBAAmB,EACnB,2BAA2B,EAC3B,qBAAqB,EACrB,wBAAwB,EACxB,4BAA4B,EAC5B,mBAAmB,EACnB,sBAAsB,EACtB,mBAAmB,EACnB,wBAAwB,CACxB;;AAED;AACA;AACA;AACA;AACA,MAAMC,qBAAsC,GAAG,EAAE;;AAEjD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAMC,eAAe,GACpB,+HAA+H;;AAEhI;AACA,MAAMC,mBAAmB,GAAGC,UAAU,CAACC,iBAAiB,GAAG,KAAK,GAAG,IAAI;;AAEvE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,MAAMC,gDAAgD,GAAGA,CAC/DC,OAAe,EACfC,UAAkB,KACd;EACJ,IAAK,CAAER,+BAA+B,CAACS,QAAQ,CAAED,UAAW,CAAC,EAAG;IAC/D,MAAM,IAAIE,KAAK,CACd,mDAAoDF,UAAU,KAAM,GACnE,2EAA2E,GAC3E,kFAAkF,GAClF,+EAA+E,GAC/E,2EACF,CAAC;EACF;EACA,IACC,CAAEL,mBAAmB,IACrBF,qBAAqB,CAACQ,QAAQ,CAAED,UAAW,CAAC,EAC3C;IACD;IACA;IACA;IACA,MAAM,IAAIE,KAAK,CACd,mDAAoDF,UAAU,iCAAkC,GAC/F,2EAA2E,GAC3E,kFAAkF,GAClF,+EAA+E,GAC/E,2E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MJ,SAAS,GAAGK,MAAM,CAAE,gBAAiB,CAAC;;AAE5C;;AAEA;AACA;AACA;AACA;AACA;AACA;AACO,SAASC,eAAeA,CAAEC,IAAY,EAAG;EAC/CxB,+BAA+B,CAACW,IAAI,CAAEa,IAAK,CAAC;AAC7C;;AAEA;AACA;AACA;AACA;AACO,SAASC,uBAAuBA,CAAA,EAAG;EACzC,OAAQzB,+BAA+B,CAAC0B,MAAM,EAAG;IAChD1B,+BAA+B,CAAC2B,GAAG,CAAC,CAAC;EACtC;AACD;AACA;AACA;AACA;AACA;AACO,SAASC,0BAA0BA,CAAA,EAAG;EAC5C,OAAQ3B,qBAAqB,CAACyB,MAAM,EAAG;IACtCzB,qBAAqB,CAAC0B,GAAG,CAAC,CAAC;EAC5B;AACD","ignoreList":[]}
@@ -1 +1 @@
1
- {"version":3,"names":["_implementation","require"],"sources":["@wordpress/private-apis/src/index.js"],"sourcesContent":["export { __dangerousOptInToUnstableAPIsOnlyForCoreModules } from './implementation';\n"],"mappings":";;;;;;;;;;;AAAA,IAAAA,eAAA,GAAAC,OAAA","ignoreList":[]}
1
+ {"version":3,"names":["_implementation","require"],"sources":["@wordpress/private-apis/src/index.ts"],"sourcesContent":["export { __dangerousOptInToUnstableAPIsOnlyForCoreModules } from './implementation';\n"],"mappings":";;;;;;;;;;;AAAA,IAAAA,eAAA,GAAAC,OAAA","ignoreList":[]}
@@ -2,20 +2,18 @@
2
2
  * wordpress/private-apis – the utilities to enable private cross-package
3
3
  * exports of private APIs.
4
4
  *
5
- * This "implementation.js" file is needed for the sake of the unit tests. It
5
+ * This "implementation.ts" file is needed for the sake of the unit tests. It
6
6
  * exports more than the public API of the package to aid in testing.
7
7
  */
8
8
 
9
9
  /**
10
10
  * The list of core modules allowed to opt-in to the private APIs.
11
11
  */
12
- const CORE_MODULES_USING_PRIVATE_APIS = ['@wordpress/block-directory', '@wordpress/block-editor', '@wordpress/block-library', '@wordpress/blocks', '@wordpress/commands', '@wordpress/components', '@wordpress/core-commands', '@wordpress/core-data', '@wordpress/customize-widgets', '@wordpress/data', '@wordpress/edit-post', '@wordpress/edit-site', '@wordpress/edit-widgets', '@wordpress/editor', '@wordpress/format-library', '@wordpress/patterns', '@wordpress/preferences', '@wordpress/reusable-blocks', '@wordpress/router', '@wordpress/dataviews', '@wordpress/fields'];
12
+ const CORE_MODULES_USING_PRIVATE_APIS = ['@wordpress/block-directory', '@wordpress/block-editor', '@wordpress/block-library', '@wordpress/blocks', '@wordpress/commands', '@wordpress/components', '@wordpress/core-commands', '@wordpress/core-data', '@wordpress/customize-widgets', '@wordpress/data', '@wordpress/edit-post', '@wordpress/edit-site', '@wordpress/edit-widgets', '@wordpress/editor', '@wordpress/format-library', '@wordpress/patterns', '@wordpress/preferences', '@wordpress/reusable-blocks', '@wordpress/router', '@wordpress/dataviews', '@wordpress/fields', '@wordpress/media-utils'];
13
13
 
14
14
  /**
15
15
  * A list of core modules that already opted-in to
16
16
  * the privateApis package.
17
- *
18
- * @type {string[]}
19
17
  */
20
18
  const registeredPrivateApis = [];
21
19
 
@@ -42,9 +40,9 @@ const allowReRegistration = globalThis.IS_WORDPRESS_CORE ? false : true;
42
40
  * Called by a @wordpress package wishing to opt-in to accessing or exposing
43
41
  * private private APIs.
44
42
  *
45
- * @param {string} consent The consent string.
46
- * @param {string} moduleName The name of the module that is opting in.
47
- * @return {{lock: typeof lock, unlock: typeof unlock}} An object containing the lock and unlock functions.
43
+ * @param consent The consent string.
44
+ * @param moduleName The name of the module that is opting in.
45
+ * @return An object containing the lock and unlock functions.
48
46
  */
49
47
  export const __dangerousOptInToUnstableAPIsOnlyForCoreModules = (consent, moduleName) => {
50
48
  if (!CORE_MODULES_USING_PRIVATE_APIS.includes(moduleName)) {
@@ -87,8 +85,8 @@ export const __dangerousOptInToUnstableAPIsOnlyForCoreModules = (consent, module
87
85
  * // { a: 1 }
88
86
  * ```
89
87
  *
90
- * @param {any} object The object to bind the private data to.
91
- * @param {any} privateData The private data to bind to the object.
88
+ * @param object The object to bind the private data to.
89
+ * @param privateData The private data to bind to the object.
92
90
  */
93
91
  function lock(object, privateData) {
94
92
  if (!object) {
@@ -120,8 +118,8 @@ function lock(object, privateData) {
120
118
  * // { a: 1 }
121
119
  * ```
122
120
  *
123
- * @param {any} object The object to unlock the private data from.
124
- * @return {any} The private data bound to the object.
121
+ * @param object The object to unlock the private data from.
122
+ * @return The private data bound to the object.
125
123
  */
126
124
  function unlock(object) {
127
125
  if (!object) {
@@ -146,7 +144,7 @@ const __private = Symbol('Private API ID');
146
144
  * Private function to allow the unit tests to allow
147
145
  * a mock module to access the private APIs.
148
146
  *
149
- * @param {string} name The name of the module.
147
+ * @param name The name of the module.
150
148
  */
151
149
  export function allowCoreModule(name) {
152
150
  CORE_MODULES_USING_PRIVATE_APIS.push(name);
@@ -1 +1 @@
1
- {"version":3,"names":["CORE_MODULES_USING_PRIVATE_APIS","registeredPrivateApis","requiredConsent","allowReRegistration","globalThis","IS_WORDPRESS_CORE","__dangerousOptInToUnstableAPIsOnlyForCoreModules","consent","moduleName","includes","Error","push","lock","unlock","object","privateData","__private","lockedData","set","get","WeakMap","Symbol","allowCoreModule","name","resetAllowedCoreModules","length","pop","resetRegisteredPrivateApis"],"sources":["@wordpress/private-apis/src/implementation.js"],"sourcesContent":["/**\n * wordpress/private-apis – the utilities to enable private cross-package\n * exports of private APIs.\n *\n * This \"implementation.js\" file is needed for the sake of the unit tests. It\n * exports more than the public API of the package to aid in testing.\n */\n\n/**\n * The list of core modules allowed to opt-in to the private APIs.\n */\nconst CORE_MODULES_USING_PRIVATE_APIS = [\n\t'@wordpress/block-directory',\n\t'@wordpress/block-editor',\n\t'@wordpress/block-library',\n\t'@wordpress/blocks',\n\t'@wordpress/commands',\n\t'@wordpress/components',\n\t'@wordpress/core-commands',\n\t'@wordpress/core-data',\n\t'@wordpress/customize-widgets',\n\t'@wordpress/data',\n\t'@wordpress/edit-post',\n\t'@wordpress/edit-site',\n\t'@wordpress/edit-widgets',\n\t'@wordpress/editor',\n\t'@wordpress/format-library',\n\t'@wordpress/patterns',\n\t'@wordpress/preferences',\n\t'@wordpress/reusable-blocks',\n\t'@wordpress/router',\n\t'@wordpress/dataviews',\n\t'@wordpress/fields',\n];\n\n/**\n * A list of core modules that already opted-in to\n * the privateApis package.\n *\n * @type {string[]}\n */\nconst registeredPrivateApis = [];\n\n/*\n * Warning for theme and plugin developers.\n *\n * The use of private developer APIs is intended for use by WordPress Core\n * and the Gutenberg plugin exclusively.\n *\n * Dangerously opting in to using these APIs is NOT RECOMMENDED. Furthermore,\n * the WordPress Core philosophy to strive to maintain backward compatibility\n * for third-party developers DOES NOT APPLY to private APIs.\n *\n * THE CONSENT STRING FOR OPTING IN TO THESE APIS MAY CHANGE AT ANY TIME AND\n * WITHOUT NOTICE. THIS CHANGE WILL BREAK EXISTING THIRD-PARTY CODE. SUCH A\n * CHANGE MAY OCCUR IN EITHER A MAJOR OR MINOR RELEASE.\n */\nconst requiredConsent =\n\t'I acknowledge private features are not for use in themes or plugins and doing so will break in the next version of WordPress.';\n\n// The safety measure is meant for WordPress core where IS_WORDPRESS_CORE is set to true.\nconst allowReRegistration = globalThis.IS_WORDPRESS_CORE ? false : true;\n\n/**\n * Called by a @wordpress package wishing to opt-in to accessing or exposing\n * private private APIs.\n *\n * @param {string} consent The consent string.\n * @param {string} moduleName The name of the module that is opting in.\n * @return {{lock: typeof lock, unlock: typeof unlock}} An object containing the lock and unlock functions.\n */\nexport const __dangerousOptInToUnstableAPIsOnlyForCoreModules = (\n\tconsent,\n\tmoduleName\n) => {\n\tif ( ! CORE_MODULES_USING_PRIVATE_APIS.includes( moduleName ) ) {\n\t\tthrow new Error(\n\t\t\t`You tried to opt-in to unstable APIs as module \"${ moduleName }\". ` +\n\t\t\t\t'This feature is only for JavaScript modules shipped with WordPress core. ' +\n\t\t\t\t'Please do not use it in plugins and themes as the unstable APIs will be removed ' +\n\t\t\t\t'without a warning. If you ignore this error and depend on unstable features, ' +\n\t\t\t\t'your product will inevitably break on one of the next WordPress releases.'\n\t\t);\n\t}\n\tif (\n\t\t! allowReRegistration &&\n\t\tregisteredPrivateApis.includes( moduleName )\n\t) {\n\t\t// This check doesn't play well with Story Books / Hot Module Reloading\n\t\t// and isn't included in the Gutenberg plugin. It only matters in the\n\t\t// WordPress core release.\n\t\tthrow new Error(\n\t\t\t`You tried to opt-in to unstable APIs as module \"${ moduleName }\" which is already registered. ` +\n\t\t\t\t'This feature is only for JavaScript modules shipped with WordPress core. ' +\n\t\t\t\t'Please do not use it in plugins and themes as the unstable APIs will be removed ' +\n\t\t\t\t'without a warning. If you ignore this error and depend on unstable features, ' +\n\t\t\t\t'your product will inevitably break on one of the next WordPress releases.'\n\t\t);\n\t}\n\tif ( consent !== requiredConsent ) {\n\t\tthrow new Error(\n\t\t\t`You tried to opt-in to unstable APIs without confirming you know the consequences. ` +\n\t\t\t\t'This feature is only for JavaScript modules shipped with WordPress core. ' +\n\t\t\t\t'Please do not use it in plugins and themes as the unstable APIs will removed ' +\n\t\t\t\t'without a warning. If you ignore this error and depend on unstable features, ' +\n\t\t\t\t'your product will inevitably break on the next WordPress release.'\n\t\t);\n\t}\n\tregisteredPrivateApis.push( moduleName );\n\n\treturn {\n\t\tlock,\n\t\tunlock,\n\t};\n};\n\n/**\n * Binds private data to an object.\n * It does not alter the passed object in any way, only\n * registers it in an internal map of private data.\n *\n * The private data can't be accessed by any other means\n * than the `unlock` function.\n *\n * @example\n * ```js\n * const object = {};\n * const privateData = { a: 1 };\n * lock( object, privateData );\n *\n * object\n * // {}\n *\n * unlock( object );\n * // { a: 1 }\n * ```\n *\n * @param {any} object The object to bind the private data to.\n * @param {any} privateData The private data to bind to the object.\n */\nfunction lock( object, privateData ) {\n\tif ( ! object ) {\n\t\tthrow new Error( 'Cannot lock an undefined object.' );\n\t}\n\tif ( ! ( __private in object ) ) {\n\t\tobject[ __private ] = {};\n\t}\n\tlockedData.set( object[ __private ], privateData );\n}\n\n/**\n * Unlocks the private data bound to an object.\n *\n * It does not alter the passed object in any way, only\n * returns the private data paired with it using the `lock()`\n * function.\n *\n * @example\n * ```js\n * const object = {};\n * const privateData = { a: 1 };\n * lock( object, privateData );\n *\n * object\n * // {}\n *\n * unlock( object );\n * // { a: 1 }\n * ```\n *\n * @param {any} object The object to unlock the private data from.\n * @return {any} The private data bound to the object.\n */\nfunction unlock( object ) {\n\tif ( ! object ) {\n\t\tthrow new Error( 'Cannot unlock an undefined object.' );\n\t}\n\tif ( ! ( __private in object ) ) {\n\t\tthrow new Error(\n\t\t\t'Cannot unlock an object that was not locked before. '\n\t\t);\n\t}\n\n\treturn lockedData.get( object[ __private ] );\n}\n\nconst lockedData = new WeakMap();\n\n/**\n * Used by lock() and unlock() to uniquely identify the private data\n * related to a containing object.\n */\nconst __private = Symbol( 'Private API ID' );\n\n// Unit tests utilities:\n\n/**\n * Private function to allow the unit tests to allow\n * a mock module to access the private APIs.\n *\n * @param {string} name The name of the module.\n */\nexport function allowCoreModule( name ) {\n\tCORE_MODULES_USING_PRIVATE_APIS.push( name );\n}\n\n/**\n * Private function to allow the unit tests to set\n * a custom list of allowed modules.\n */\nexport function resetAllowedCoreModules() {\n\twhile ( CORE_MODULES_USING_PRIVATE_APIS.length ) {\n\t\tCORE_MODULES_USING_PRIVATE_APIS.pop();\n\t}\n}\n/**\n * Private function to allow the unit tests to reset\n * the list of registered private apis.\n */\nexport function resetRegisteredPrivateApis() {\n\twhile ( registeredPrivateApis.length ) {\n\t\tregisteredPrivateApis.pop();\n\t}\n}\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,MAAMA,+BAA+B,GAAG,CACvC,4BAA4B,EAC5B,yBAAyB,EACzB,0BAA0B,EAC1B,mBAAmB,EACnB,qBAAqB,EACrB,uBAAuB,EACvB,0BAA0B,EAC1B,sBAAsB,EACtB,8BAA8B,EAC9B,iBAAiB,EACjB,sBAAsB,EACtB,sBAAsB,EACtB,yBAAyB,EACzB,mBAAmB,EACnB,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M,EAAG;IACtCxB,qBAAqB,CAACyB,GAAG,CAAC,CAAC;EAC5B;AACD","ignoreList":[]}
1
+ {"version":3,"names":["CORE_MODULES_USING_PRIVATE_APIS","registeredPrivateApis","requiredConsent","allowReRegistration","globalThis","IS_WORDPRESS_CORE","__dangerousOptInToUnstableAPIsOnlyForCoreModules","consent","moduleName","includes","Error","push","lock","unlock","object","privateData","__private","lockedData","set","get","WeakMap","Symbol","allowCoreModule","name","resetAllowedCoreModules","length","pop","resetRegisteredPrivateApis"],"sources":["@wordpress/private-apis/src/implementation.ts"],"sourcesContent":["/**\n * wordpress/private-apis – the utilities to enable private cross-package\n * exports of private APIs.\n *\n * This \"implementation.ts\" file is needed for the sake of the unit tests. It\n * exports more than the public API of the package to aid in testing.\n */\n\n/**\n * The list of core modules allowed to opt-in to the private APIs.\n */\nconst CORE_MODULES_USING_PRIVATE_APIS = [\n\t'@wordpress/block-directory',\n\t'@wordpress/block-editor',\n\t'@wordpress/block-library',\n\t'@wordpress/blocks',\n\t'@wordpress/commands',\n\t'@wordpress/components',\n\t'@wordpress/core-commands',\n\t'@wordpress/core-data',\n\t'@wordpress/customize-widgets',\n\t'@wordpress/data',\n\t'@wordpress/edit-post',\n\t'@wordpress/edit-site',\n\t'@wordpress/edit-widgets',\n\t'@wordpress/editor',\n\t'@wordpress/format-library',\n\t'@wordpress/patterns',\n\t'@wordpress/preferences',\n\t'@wordpress/reusable-blocks',\n\t'@wordpress/router',\n\t'@wordpress/dataviews',\n\t'@wordpress/fields',\n\t'@wordpress/media-utils',\n];\n\n/**\n * A list of core modules that already opted-in to\n * the privateApis package.\n */\nconst registeredPrivateApis: Array< string > = [];\n\n/*\n * Warning for theme and plugin developers.\n *\n * The use of private developer APIs is intended for use by WordPress Core\n * and the Gutenberg plugin exclusively.\n *\n * Dangerously opting in to using these APIs is NOT RECOMMENDED. Furthermore,\n * the WordPress Core philosophy to strive to maintain backward compatibility\n * for third-party developers DOES NOT APPLY to private APIs.\n *\n * THE CONSENT STRING FOR OPTING IN TO THESE APIS MAY CHANGE AT ANY TIME AND\n * WITHOUT NOTICE. THIS CHANGE WILL BREAK EXISTING THIRD-PARTY CODE. SUCH A\n * CHANGE MAY OCCUR IN EITHER A MAJOR OR MINOR RELEASE.\n */\nconst requiredConsent =\n\t'I acknowledge private features are not for use in themes or plugins and doing so will break in the next version of WordPress.';\n\n// The safety measure is meant for WordPress core where IS_WORDPRESS_CORE is set to true.\nconst allowReRegistration = globalThis.IS_WORDPRESS_CORE ? false : true;\n\n/**\n * Called by a @wordpress package wishing to opt-in to accessing or exposing\n * private private APIs.\n *\n * @param consent The consent string.\n * @param moduleName The name of the module that is opting in.\n * @return An object containing the lock and unlock functions.\n */\nexport const __dangerousOptInToUnstableAPIsOnlyForCoreModules = (\n\tconsent: string,\n\tmoduleName: string\n) => {\n\tif ( ! CORE_MODULES_USING_PRIVATE_APIS.includes( moduleName ) ) {\n\t\tthrow new Error(\n\t\t\t`You tried to opt-in to unstable APIs as module \"${ moduleName }\". ` +\n\t\t\t\t'This feature is only for JavaScript modules shipped with WordPress core. ' +\n\t\t\t\t'Please do not use it in plugins and themes as the unstable APIs will be removed ' +\n\t\t\t\t'without a warning. If you ignore this error and depend on unstable features, ' +\n\t\t\t\t'your product will inevitably break on one of the next WordPress releases.'\n\t\t);\n\t}\n\tif (\n\t\t! allowReRegistration &&\n\t\tregisteredPrivateApis.includes( moduleName )\n\t) {\n\t\t// This check doesn't play well with Story Books / Hot Module Reloading\n\t\t// and isn't included in the Gutenberg plugin. It only matters in the\n\t\t// WordPress core release.\n\t\tthrow new Error(\n\t\t\t`You tried to opt-in to unstable APIs as module \"${ moduleName }\" which is already registered. ` +\n\t\t\t\t'This feature is only for JavaScript modules shipped with WordPress core. ' +\n\t\t\t\t'Please do not use it in plugins and themes as the unstable APIs will be removed ' +\n\t\t\t\t'without a warning. If you ignore this error and depend on unstable features, ' +\n\t\t\t\t'your product will inevitably break on one of the next WordPress releases.'\n\t\t);\n\t}\n\tif ( consent !== requiredConsent ) {\n\t\tthrow new Error(\n\t\t\t`You tried to opt-in to unstable APIs without confirming you know the consequences. ` +\n\t\t\t\t'This feature is only for JavaScript modules shipped with WordPress core. ' +\n\t\t\t\t'Please do not use it in plugins and themes as the unstable APIs will removed ' +\n\t\t\t\t'without a warning. If you ignore this error and depend on unstable features, ' +\n\t\t\t\t'your product will inevitably break on the next WordPress release.'\n\t\t);\n\t}\n\tregisteredPrivateApis.push( moduleName );\n\n\treturn {\n\t\tlock,\n\t\tunlock,\n\t};\n};\n\n/**\n * Binds private data to an object.\n * It does not alter the passed object in any way, only\n * registers it in an internal map of private data.\n *\n * The private data can't be accessed by any other means\n * than the `unlock` function.\n *\n * @example\n * ```js\n * const object = {};\n * const privateData = { a: 1 };\n * lock( object, privateData );\n *\n * object\n * // {}\n *\n * unlock( object );\n * // { a: 1 }\n * ```\n *\n * @param object The object to bind the private data to.\n * @param privateData The private data to bind to the object.\n */\nfunction lock( object: Record< symbol, WeakKey >, privateData: unknown ) {\n\tif ( ! object ) {\n\t\tthrow new Error( 'Cannot lock an undefined object.' );\n\t}\n\tif ( ! ( __private in object ) ) {\n\t\tobject[ __private ] = {};\n\t}\n\tlockedData.set( object[ __private ], privateData );\n}\n\n/**\n * Unlocks the private data bound to an object.\n *\n * It does not alter the passed object in any way, only\n * returns the private data paired with it using the `lock()`\n * function.\n *\n * @example\n * ```js\n * const object = {};\n * const privateData = { a: 1 };\n * lock( object, privateData );\n *\n * object\n * // {}\n *\n * unlock( object );\n * // { a: 1 }\n * ```\n *\n * @param object The object to unlock the private data from.\n * @return The private data bound to the object.\n */\nfunction unlock( object: Record< symbol, WeakKey > ) {\n\tif ( ! object ) {\n\t\tthrow new Error( 'Cannot unlock an undefined object.' );\n\t}\n\tif ( ! ( __private in object ) ) {\n\t\tthrow new Error(\n\t\t\t'Cannot unlock an object that was not locked before. '\n\t\t);\n\t}\n\n\treturn lockedData.get( object[ __private ] );\n}\n\nconst lockedData = new WeakMap();\n\n/**\n * Used by lock() and unlock() to uniquely identify the private data\n * related to a containing object.\n */\nconst __private = Symbol( 'Private API ID' );\n\n// Unit tests utilities:\n\n/**\n * Private function to allow the unit tests to allow\n * a mock module to access the private APIs.\n *\n * @param name The name of the module.\n */\nexport function allowCoreModule( name: string ) {\n\tCORE_MODULES_USING_PRIVATE_APIS.push( name );\n}\n\n/**\n * Private function to allow the unit tests to set\n * a custom list of allowed modules.\n */\nexport function resetAllowedCoreModules() {\n\twhile ( CORE_MODULES_USING_PRIVATE_APIS.length ) {\n\t\tCORE_MODULES_USING_PRIVATE_APIS.pop();\n\t}\n}\n/**\n * Private function to allow the unit tests to reset\n * the list of registered private apis.\n */\nexport function resetRegisteredPrivateApis() {\n\twhile ( registeredPrivateApis.length ) {\n\t\tregisteredPrivateApis.pop();\n\t}\n}\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,MAAMA,+BAA+B,GAAG,CACvC,4BAA4B,EAC5B,yBAAyB,EACzB,0BAA0B,EAC1B,mBAAmB,EACnB,qBAAqB,EACrB,uBAAuB,EACvB,0BAA0B,EAC1B,sBAAsB,EACtB,8BAA8B,EAC9B,iBAAiB,EACjB,sBAAsB,EACtB,sBAAsB,EACtB,yBAAyB,EACzB,mBAAmB,EACnB,2BAA2B,EAC3B,qBAAqB,EACrB,wBAAwB,EACxB,4BAA4B,EAC5B,mBAAmB,EACnB,sBAAsB,EACtB,mBAAmB,EACnB,wBAAwB,CACxB;;AAED;AACA;AACA;AACA;AACA,MAAMC,qBAAsC,GAAG,EAAE;;AAEjD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAMC,eAAe,GACpB,+HAA+H;;AAEhI;AACA,MAAMC,mBAAmB,GAAGC,UAAU,CAACC,iBAAiB,GAAG,KAAK,GAAG,IAAI;;AAEvE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,MAAMC,gDAAgD,GA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AACA;AACA,SAASF,MAAMA,CAAEC,MAAiC,EAAG;EACpD,IAAK,CAAEA,MAAM,EAAG;IACf,MAAM,IAAIJ,KAAK,CAAE,oCAAqC,CAAC;EACxD;EACA,IAAK,EAAIM,SAAS,IAAIF,MAAM,CAAE,EAAG;IAChC,MAAM,IAAIJ,KAAK,CACd,sDACD,CAAC;EACF;EAEA,OAAOO,UAAU,CAACE,GAAG,CAAEL,MAAM,CAAEE,SAAS,CAAG,CAAC;AAC7C;AAEA,MAAMC,UAAU,GAAG,IAAIG,OAAO,CAAC,CAAC;;AAEhC;AACA;AACA;AACA;AACA,MAAMJ,SAAS,GAAGK,MAAM,CAAE,gBAAiB,CAAC;;AAE5C;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,SAASC,eAAeA,CAAEC,IAAY,EAAG;EAC/CvB,+BAA+B,CAACW,IAAI,CAAEY,IAAK,CAAC;AAC7C;;AAEA;AACA;AACA;AACA;AACA,OAAO,SAASC,uBAAuBA,CAAA,EAAG;EACzC,OAAQxB,+BAA+B,CAACyB,MAAM,EAAG;IAChDzB,+BAA+B,CAAC0B,GAAG,CAAC,CAAC;EACtC;AACD;AACA;AACA;AACA;AACA;AACA,OAAO,SAASC,0BAA0BA,CAAA,EAAG;EAC5C,OAAQ1B,qBAAqB,CAACwB,MAAM,EAAG;IACtCxB,qBAAqB,CAACyB,GAAG,CAAC,CAAC;EAC5B;AACD","ignoreList":[]}
@@ -1 +1 @@
1
- {"version":3,"names":["__dangerousOptInToUnstableAPIsOnlyForCoreModules"],"sources":["@wordpress/private-apis/src/index.js"],"sourcesContent":["export { __dangerousOptInToUnstableAPIsOnlyForCoreModules } from './implementation';\n"],"mappings":"AAAA,SAASA,gDAAgD,QAAQ,kBAAkB","ignoreList":[]}
1
+ {"version":3,"names":["__dangerousOptInToUnstableAPIsOnlyForCoreModules"],"sources":["@wordpress/private-apis/src/index.ts"],"sourcesContent":["export { __dangerousOptInToUnstableAPIsOnlyForCoreModules } from './implementation';\n"],"mappings":"AAAA,SAASA,gDAAgD,QAAQ,kBAAkB","ignoreList":[]}
@@ -1,21 +1,19 @@
1
1
  /**
2
- * Private function to allow the unit tests to allow
3
- * a mock module to access the private APIs.
2
+ * wordpress/private-apis the utilities to enable private cross-package
3
+ * exports of private APIs.
4
4
  *
5
- * @param {string} name The name of the module.
6
- */
7
- export function allowCoreModule(name: string): void;
8
- /**
9
- * Private function to allow the unit tests to set
10
- * a custom list of allowed modules.
5
+ * This "implementation.ts" file is needed for the sake of the unit tests. It
6
+ * exports more than the public API of the package to aid in testing.
11
7
  */
12
- export function resetAllowedCoreModules(): void;
13
8
  /**
14
- * Private function to allow the unit tests to reset
15
- * the list of registered private apis.
9
+ * Called by a @wordpress package wishing to opt-in to accessing or exposing
10
+ * private private APIs.
11
+ *
12
+ * @param consent The consent string.
13
+ * @param moduleName The name of the module that is opting in.
14
+ * @return An object containing the lock and unlock functions.
16
15
  */
17
- export function resetRegisteredPrivateApis(): void;
18
- export function __dangerousOptInToUnstableAPIsOnlyForCoreModules(consent: string, moduleName: string): {
16
+ export declare const __dangerousOptInToUnstableAPIsOnlyForCoreModules: (consent: string, moduleName: string) => {
19
17
  lock: typeof lock;
20
18
  unlock: typeof unlock;
21
19
  };
@@ -40,10 +38,10 @@ export function __dangerousOptInToUnstableAPIsOnlyForCoreModules(consent: string
40
38
  * // { a: 1 }
41
39
  * ```
42
40
  *
43
- * @param {any} object The object to bind the private data to.
44
- * @param {any} privateData The private data to bind to the object.
41
+ * @param object The object to bind the private data to.
42
+ * @param privateData The private data to bind to the object.
45
43
  */
46
- declare function lock(object: any, privateData: any): void;
44
+ declare function lock(object: Record<symbol, WeakKey>, privateData: unknown): void;
47
45
  /**
48
46
  * Unlocks the private data bound to an object.
49
47
  *
@@ -64,9 +62,26 @@ declare function lock(object: any, privateData: any): void;
64
62
  * // { a: 1 }
65
63
  * ```
66
64
  *
67
- * @param {any} object The object to unlock the private data from.
68
- * @return {any} The private data bound to the object.
65
+ * @param object The object to unlock the private data from.
66
+ * @return The private data bound to the object.
67
+ */
68
+ declare function unlock(object: Record<symbol, WeakKey>): any;
69
+ /**
70
+ * Private function to allow the unit tests to allow
71
+ * a mock module to access the private APIs.
72
+ *
73
+ * @param name The name of the module.
74
+ */
75
+ export declare function allowCoreModule(name: string): void;
76
+ /**
77
+ * Private function to allow the unit tests to set
78
+ * a custom list of allowed modules.
79
+ */
80
+ export declare function resetAllowedCoreModules(): void;
81
+ /**
82
+ * Private function to allow the unit tests to reset
83
+ * the list of registered private apis.
69
84
  */
70
- declare function unlock(object: any): any;
85
+ export declare function resetRegisteredPrivateApis(): void;
71
86
  export {};
72
87
  //# sourceMappingURL=implementation.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"implementation.d.ts","sourceRoot":"","sources":["../src/implementation.js"],"names":[],"mappings":"AAoMA;;;;;GAKG;AACH,sCAFW,MAAM,QAIhB;AAED;;;GAGG;AACH,gDAIC;AACD;;;GAGG;AACH,mDAIC;AAxJM,0EAJI,MAAM,cACN,MAAM,GACL;IAAC,IAAI,EAAE,OAAO,IAAI,CAAC;IAAC,MAAM,EAAE,OAAO,MAAM,CAAA;CAAC,CA6CrD;AAED;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AACH,8BAHW,GAAG,eACH,GAAG,QAUb;AAED;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,gCAHW,GAAG,GACF,GAAG,CAad"}
1
+ {"version":3,"file":"implementation.d.ts","sourceRoot":"","sources":["../src/implementation.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAwDH;;;;;;;GAOG;AACH,eAAO,MAAM,gDAAgD,YACnD,MAAM,cACH,MAAM;;;CAyClB,CAAC;AAEF;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AACH,iBAAS,IAAI,CAAE,MAAM,EAAE,MAAM,CAAE,MAAM,EAAE,OAAO,CAAE,EAAE,WAAW,EAAE,OAAO,QAQrE;AAED;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,iBAAS,MAAM,CAAE,MAAM,EAAE,MAAM,CAAE,MAAM,EAAE,OAAO,CAAE,OAWjD;AAYD;;;;;GAKG;AACH,wBAAgB,eAAe,CAAE,IAAI,EAAE,MAAM,QAE5C;AAED;;;GAGG;AACH,wBAAgB,uBAAuB,SAItC;AACD;;;GAGG;AACH,wBAAgB,0BAA0B,SAIzC"}
@@ -1,2 +1,2 @@
1
- export { __dangerousOptInToUnstableAPIsOnlyForCoreModules } from "./implementation";
1
+ export { __dangerousOptInToUnstableAPIsOnlyForCoreModules } from './implementation';
2
2
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.js"],"names":[],"mappings":""}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gDAAgD,EAAE,MAAM,kBAAkB,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@wordpress/private-apis",
3
- "version": "1.11.0",
3
+ "version": "1.12.1-next.082ed6819.0",
4
4
  "description": "Internal experimental APIs for WordPress core.",
5
5
  "author": "The WordPress Contributors",
6
6
  "license": "GPL-2.0-or-later",
@@ -26,6 +26,7 @@
26
26
  "main": "build/index.js",
27
27
  "module": "build-module/index.js",
28
28
  "react-native": "src/index",
29
+ "wpScript": true,
29
30
  "types": "build-types",
30
31
  "sideEffects": false,
31
32
  "dependencies": {
@@ -34,6 +35,5 @@
34
35
  "publishConfig": {
35
36
  "access": "public"
36
37
  },
37
- "wpScript": true,
38
- "gitHead": "dcf4613b33b0eda14e203ac30f700ed0db70347f"
38
+ "gitHead": "2bb7bad15ddb8e88210fab7d4a1ef1565466e424"
39
39
  }
@@ -2,7 +2,7 @@
2
2
  * wordpress/private-apis – the utilities to enable private cross-package
3
3
  * exports of private APIs.
4
4
  *
5
- * This "implementation.js" file is needed for the sake of the unit tests. It
5
+ * This "implementation.ts" file is needed for the sake of the unit tests. It
6
6
  * exports more than the public API of the package to aid in testing.
7
7
  */
8
8
 
@@ -31,15 +31,14 @@ const CORE_MODULES_USING_PRIVATE_APIS = [
31
31
  '@wordpress/router',
32
32
  '@wordpress/dataviews',
33
33
  '@wordpress/fields',
34
+ '@wordpress/media-utils',
34
35
  ];
35
36
 
36
37
  /**
37
38
  * A list of core modules that already opted-in to
38
39
  * the privateApis package.
39
- *
40
- * @type {string[]}
41
40
  */
42
- const registeredPrivateApis = [];
41
+ const registeredPrivateApis: Array< string > = [];
43
42
 
44
43
  /*
45
44
  * Warning for theme and plugin developers.
@@ -65,13 +64,13 @@ const allowReRegistration = globalThis.IS_WORDPRESS_CORE ? false : true;
65
64
  * Called by a @wordpress package wishing to opt-in to accessing or exposing
66
65
  * private private APIs.
67
66
  *
68
- * @param {string} consent The consent string.
69
- * @param {string} moduleName The name of the module that is opting in.
70
- * @return {{lock: typeof lock, unlock: typeof unlock}} An object containing the lock and unlock functions.
67
+ * @param consent The consent string.
68
+ * @param moduleName The name of the module that is opting in.
69
+ * @return An object containing the lock and unlock functions.
71
70
  */
72
71
  export const __dangerousOptInToUnstableAPIsOnlyForCoreModules = (
73
- consent,
74
- moduleName
72
+ consent: string,
73
+ moduleName: string
75
74
  ) => {
76
75
  if ( ! CORE_MODULES_USING_PRIVATE_APIS.includes( moduleName ) ) {
77
76
  throw new Error(
@@ -135,10 +134,10 @@ export const __dangerousOptInToUnstableAPIsOnlyForCoreModules = (
135
134
  * // { a: 1 }
136
135
  * ```
137
136
  *
138
- * @param {any} object The object to bind the private data to.
139
- * @param {any} privateData The private data to bind to the object.
137
+ * @param object The object to bind the private data to.
138
+ * @param privateData The private data to bind to the object.
140
139
  */
141
- function lock( object, privateData ) {
140
+ function lock( object: Record< symbol, WeakKey >, privateData: unknown ) {
142
141
  if ( ! object ) {
143
142
  throw new Error( 'Cannot lock an undefined object.' );
144
143
  }
@@ -168,10 +167,10 @@ function lock( object, privateData ) {
168
167
  * // { a: 1 }
169
168
  * ```
170
169
  *
171
- * @param {any} object The object to unlock the private data from.
172
- * @return {any} The private data bound to the object.
170
+ * @param object The object to unlock the private data from.
171
+ * @return The private data bound to the object.
173
172
  */
174
- function unlock( object ) {
173
+ function unlock( object: Record< symbol, WeakKey > ) {
175
174
  if ( ! object ) {
176
175
  throw new Error( 'Cannot unlock an undefined object.' );
177
176
  }
@@ -198,9 +197,9 @@ const __private = Symbol( 'Private API ID' );
198
197
  * Private function to allow the unit tests to allow
199
198
  * a mock module to access the private APIs.
200
199
  *
201
- * @param {string} name The name of the module.
200
+ * @param name The name of the module.
202
201
  */
203
- export function allowCoreModule( name ) {
202
+ export function allowCoreModule( name: string ) {
204
203
  CORE_MODULES_USING_PRIVATE_APIS.push( name );
205
204
  }
206
205
 
@@ -1 +1 @@
1
- {"program":{"fileNames":["../../node_modules/typescript/lib/lib.es5.d.ts","../../node_modules/typescript/lib/lib.es2015.d.ts","../../node_modules/typescript/lib/lib.es2016.d.ts","../../node_modules/typescript/lib/lib.es2017.d.ts","../../node_modules/typescript/lib/lib.es2018.d.ts","../../node_modules/typescript/lib/lib.es2019.d.ts","../../node_modules/typescript/lib/lib.es2020.d.ts","../../node_modules/typescript/lib/lib.es2021.d.ts","../../node_modules/typescript/lib/lib.es2022.d.ts","../../node_modules/typescript/lib/lib.es2023.d.ts","../../node_modules/typescript/lib/lib.esnext.d.ts","../../node_modules/typescript/lib/lib.dom.d.ts","../../node_modules/typescript/lib/lib.dom.iterable.d.ts","../../node_modules/typescript/lib/lib.es2015.core.d.ts","../../node_modules/typescript/lib/lib.es2015.collection.d.ts","../../node_modules/typescript/lib/lib.es2015.generator.d.ts","../../node_modules/typescript/lib/lib.es2015.iterable.d.ts","../../node_modules/typescript/lib/lib.es2015.promise.d.ts","../../node_modules/typescript/lib/lib.es2015.proxy.d.ts","../../node_modules/typescript/lib/lib.es2015.reflect.d.ts","../../node_modules/typescript/lib/lib.es2015.symbol.d.ts","../../node_modules/typescript/lib/lib.es2015.symbol.wellknown.d.ts","../../node_modules/typescript/lib/lib.es2016.array.include.d.ts","../../node_modules/typescript/lib/lib.es2016.intl.d.ts","../../node_modules/typescript/lib/lib.es2017.date.d.ts","../../node_modules/typescript/lib/lib.es2017.object.d.ts","../../node_modules/typescript/lib/lib.es2017.sharedmemory.d.ts","../../node_modules/typescript/lib/lib.es2017.string.d.ts","../../node_modules/typescript/lib/lib.es2017.intl.d.ts","../../node_modules/typescript/lib/lib.es2017.typedarrays.d.ts","../../node_modules/typescript/lib/lib.es2018.asyncgenerator.d.ts","../../node_modules/typescript/lib/lib.es2018.asynciterable.d.ts","../../node_modules/typescript/lib/lib.es2018.intl.d.ts","../../node_modules/typescript/lib/lib.es2018.promise.d.ts","../../node_modules/typescript/lib/lib.es2018.regexp.d.ts","../../node_modules/typescript/lib/lib.es2019.array.d.ts","../../node_modules/typescript/lib/lib.es2019.object.d.ts","../../node_modules/typescript/lib/lib.es2019.string.d.ts","../../node_modules/typescript/lib/lib.es2019.symbol.d.ts","../../node_modules/typescript/lib/lib.es2019.intl.d.ts","../../node_modules/typescript/lib/lib.es2020.bigint.d.ts","../../node_modules/typescript/lib/lib.es2020.date.d.ts","../../node_modules/typescript/lib/lib.es2020.promise.d.ts","../../node_modules/typescript/lib/lib.es2020.sharedmemory.d.ts","../../node_modules/typescript/lib/lib.es2020.string.d.ts","../../node_modules/typescript/lib/lib.es2020.symbol.wellknown.d.ts","../../node_modules/typescript/lib/lib.es2020.intl.d.ts","../../node_modules/typescript/lib/lib.es2020.number.d.ts","../../node_modules/typescript/lib/lib.es2021.promise.d.ts","../../node_modules/typescript/lib/lib.es2021.string.d.ts","../../node_modules/typescript/lib/lib.es2021.weakref.d.ts","../../node_modules/typescript/lib/lib.es2021.intl.d.ts","../../node_modules/typescript/lib/lib.es2022.array.d.ts","../../node_modules/typescript/lib/lib.es2022.error.d.ts","../../node_modules/typescript/lib/lib.es2022.intl.d.ts","../../node_modules/typescript/lib/lib.es2022.object.d.ts","../../node_modules/typescript/lib/lib.es2022.sharedmemory.d.ts","../../node_modules/typescript/lib/lib.es2022.string.d.ts","../../node_modules/typescript/lib/lib.es2022.regexp.d.ts","../../node_modules/typescript/lib/lib.es2023.array.d.ts","../../node_modules/typescript/lib/lib.es2023.collection.d.ts","../../node_modules/typescript/lib/lib.es2023.intl.d.ts","../../node_modules/typescript/lib/lib.esnext.array.d.ts","../../node_modules/typescript/lib/lib.esnext.collection.d.ts","../../node_modules/typescript/lib/lib.esnext.intl.d.ts","../../node_modules/typescript/lib/lib.esnext.disposable.d.ts","../../node_modules/typescript/lib/lib.esnext.string.d.ts","../../node_modules/typescript/lib/lib.esnext.promise.d.ts","../../node_modules/typescript/lib/lib.esnext.decorators.d.ts","../../node_modules/typescript/lib/lib.esnext.object.d.ts","../../node_modules/typescript/lib/lib.esnext.regexp.d.ts","../../node_modules/typescript/lib/lib.decorators.d.ts","../../node_modules/typescript/lib/lib.decorators.legacy.d.ts","./src/implementation.js","./src/index.js","../../typings/gutenberg-env/index.d.ts"],"fileInfos":[{"version":"44e584d4f6444f58791784f1d530875970993129442a847597db702a073ca68c","affectsGlobalScope":true},"45b7ab580deca34ae9729e97c13cfd999df04416a79116c3bfb483804f85ded4","3facaf05f0c5fc569c5649dd359892c98a85557e3e0c847964caeb67076f4d75","9a68c0c07ae2fa71b44384a839b7b8d81662a236d4b9ac30916718f7510b1b2d","5e1c4c362065a6b95ff952c0eab010f04dcd2c3494e813b493ecfd4fcb9fc0d8","68d73b4a11549f9c0b7d352d10e91e5dca8faa3322bfb77b661839c42b1ddec7","5efce4fc3c29ea84e8928f97adec086e3dc876365e0982cc8479a07954a3efd4","feecb1be483ed332fad555aff858affd90a48ab19ba7272ee084704eb7167569","5514e54f17d6d74ecefedc73c504eadffdeda79c7ea205cf9febead32d45c4bc","27bdc30a0e32783366a5abeda841bc22757c1797de8681bbe81fbc735eeb1c10","17edc026abf73c5c2dd508652d63f68ec4efd9d4856e3469890d27598209feb5",{"version":"4af6b0c727b7a2896463d512fafd23634229adf69ac7c00e2ae15a09cb084fad","affectsGlobalScope":true},{"version":"9c00a480825408b6a24c63c1b71362232927247595d7c97659bc24dc68ae0757","affectsGlobalScope":true},{"version":"6920e1448680767498a0b77c6a00a8e77d14d62c3da8967b171f1ddffa3c18e4","affectsGlobalScope":true},{"version":"dc2df20b1bcdc8c2d34af4926e2c3ab15ffe1160a63e58b7e09833f616efff44","affectsGlobalScope":true},{"version":"4443e68b35f3332f753eacc66a04ac1d2053b8b035a0e0ac1d455392b5e243b3","affectsGlobalScope":true},{"version":"bc47685641087c015972a3f072480889f0d6c65515f12bd85222f49a98952ed7","affectsGlobalScope":true},{"version":"0dc1e7ceda9b8b9b455c3a2d67b0412feab00bd2f66656cd8850e8831b08b537","affectsGlobalScope":true},{"version":"ce691fb9e5c64efb9547083e4a34091bcbe5bdb41027e310ebba8f7d96a98671","affectsGlobalScope":true},{"version":"8d697a2a929a5fcb38b7a65594020fcef05ec1630804a33748829c5ff53640d0","affectsGlobalScope":true},{"version":"4ff2a353abf8a80ee399af572debb8faab2d33ad38c4b4474cff7f26e7653b8d","affectsGlobalScope":true},{"version":"93495ff27b8746f55d19fcbcdbaccc99fd95f19d057aed1bd2c0cafe1335fbf0","affectsGlobalScope":true},{"version":"6fc23bb8c3965964be8c597310a2878b53a0306edb71d4b5a4dfe760186bcc01","affectsGlobalScope":true},{"version":"ea011c76963fb15ef1cdd7ce6a6808b46322c527de2077b6cfdf23ae6f5f9ec7","affectsGlobalScope":true},{"version":"38f0219c9e23c915ef9790ab1d680440d95419ad264816fa15009a8851e79119","affectsGlobalScope":true},{"version":"bb42a7797d996412ecdc5b2787720de477103a0b2e53058569069a0e2bae6c7e","affectsGlobalScope":true},{"version":"4738f2420687fd85629c9efb470793bb753709c2379e5f85bc1815d875ceadcd","affectsGlobalScope":true},{"version":"2f11ff796926e0832f9ae148008138ad583bd181899ab7dd768a2666700b1893","affectsGlobalScope":true},{"version":"4de680d5bb41c17f7f68e0419412ca23c98d5749dcaaea1896172f06435891fc","affectsGlobalScope":true},{"version":"9fc46429fbe091ac5ad2608c657201eb68b6f1b8341bd6d670047d32ed0a88fa","affectsGlobalScope":true},{"version":"61c37c1de663cf4171e1192466e52c7a382afa58da01b1dc75058f032ddf0839","affectsGlobalScope":true},{"version":"b541a838a13f9234aba650a825393ffc2292dc0fc87681a5d81ef0c96d281e7a","affectsGlobalScope":true},{"version":"9e9fbd7030c440b33d021da145d3232984c8bb7916f277e8ffd3dc2e3eae2bdb","affectsGlobalScope":true},{"version":"811ec78f7fefcabbda4bfa93b3eb67d9ae166ef95f9bff989d964061cbf81a0c","affectsGlobalScope":true},{"version":"717937616a17072082152a2ef351cb51f98802fb4b2fdabd32399843875974ca","affectsGlobalScope":true},{"version":"d7e7d9b7b50e5f22c915b525acc5a49a7a6584cf8f62d0569e557c5cfc4b2ac2","affectsGlobalScope":true},{"version":"71c37f4c9543f31dfced6c7840e068c5a5aacb7b89111a4364b1d5276b852557","affectsGlobalScope":true},{"version":"576711e016cf4f1804676043e6a0a5414252560eb57de9faceee34d79798c850","affectsGlobalScope":true},{"version":"89c1b1281ba7b8a96efc676b11b264de7a8374c5ea1e6617f11880a13fc56dc6","affectsGlobalScope":true},{"version":"74f7fa2d027d5b33eb0471c8e82a6c87216223181ec31247c357a3e8e2fddc5b","affectsGlobalScope":true},{"version":"ae37d6ccd1560b0203ab88d46987393adaaa78c919e51acf32fb82c86502e98c","affectsGlobalScope":true},{"version":"063600664504610fe3e99b717a1223f8b1900087fab0b4cad1496a114744f8df","affectsGlobalScope":true},{"version":"934019d7e3c81950f9a8426d093458b65d5aff2c7c1511233c0fd5b941e608ab","affectsGlobalScope":true},{"version":"bf14a426dbbf1022d11bd08d6b8e709a2e9d246f0c6c1032f3b2edb9a902adbe","affectsGlobalScope":true},{"version":"5e07ed3809d48205d5b985642a59f2eba47c402374a7cf8006b686f79efadcbd","affectsGlobalScope":true},{"version":"2b72d528b2e2fe3c57889ca7baef5e13a56c957b946906d03767c642f386bbc3","affectsGlobalScope":true},{"version":"479553e3779be7d4f68e9f40cdb82d038e5ef7592010100410723ceced22a0f7","affectsGlobalScope":true},{"version":"368af93f74c9c932edd84c58883e736c9e3d53cec1fe24c0b0ff451f529ceab1","affectsGlobalScope":true},{"version":"af3dd424cf267428f30ccfc376f47a2c0114546b55c44d8c0f1d57d841e28d74","affectsGlobalScope":true},{"version":"995c005ab91a498455ea8dfb63aa9f83fa2ea793c3d8aa344be4a1678d06d399","affectsGlobalScope":true},{"version":"d3d7b04b45033f57351c8434f60b6be1ea71a2dfec2d0a0c3c83badbb0e3e693","affectsGlobalScope":true},{"version":"956d27abdea9652e8368ce029bb1e0b9174e9678a273529f426df4b3d90abd60","affectsGlobalScope":true},{"version":"4fa6ed14e98aa80b91f61b9805c653ee82af3502dc21c9da5268d3857772ca05","affectsGlobalScope":true},{"version":"e6633e05da3ff36e6da2ec170d0d03ccf33de50ca4dc6f5aeecb572cedd162fb","affectsGlobalScope":true},{"version":"d8670852241d4c6e03f2b89d67497a4bbefe29ecaa5a444e2c11a9b05e6fccc6","affectsGlobalScope":true},{"version":"8444af78980e3b20b49324f4a16ba35024fef3ee069a0eb67616ea6ca821c47a","affectsGlobalScope":true},{"version":"caccc56c72713969e1cfe5c3d44e5bab151544d9d2b373d7dbe5a1e4166652be","affectsGlobalScope":true},{"version":"3287d9d085fbd618c3971944b65b4be57859f5415f495b33a6adc994edd2f004","affectsGlobalScope":true},{"version":"b4b67b1a91182421f5df999988c690f14d813b9850b40acd06ed44691f6727ad","affectsGlobalScope":true},{"version":"08a58483392df5fcc1db57d782e87734f77ae9eab42516028acbfe46f29a3ef7","affectsGlobalScope":true},{"version":"436aaf437562f276ec2ddbee2f2cdedac7664c1e4c1d2c36839ddd582eeb3d0a","affectsGlobalScope":true},{"version":"8e3c06ea092138bf9fa5e874a1fdbc9d54805d074bee1de31b99a11e2fec239d","affectsGlobalScope":true},{"version":"0b11f3ca66aa33124202c80b70cd203219c3d4460cfc165e0707aa9ec710fc53","affectsGlobalScope":true},{"version":"6a3f5a0129cc80cf439ab71164334d649b47059a4f5afca90282362407d0c87f","affectsGlobalScope":true},{"version":"811c71eee4aa0ac5f7adf713323a5c41b0cf6c4e17367a34fbce379e12bbf0a4","affectsGlobalScope":true},{"version":"15b98a533864d324e5f57cd3cfc0579b231df58c1c0f6063ea0fcb13c3c74ff9","affectsGlobalScope":true},{"version":"0a6282c8827e4b9a95f4bf4f5c205673ada31b982f50572d27103df8ceb8013c","affectsGlobalScope":true},{"version":"ac77cb3e8c6d3565793eb90a8373ee8033146315a3dbead3bde8db5eaf5e5ec6","affectsGlobalScope":true},{"version":"d4b1d2c51d058fc21ec2629fff7a76249dec2e36e12960ea056e3ef89174080f","affectsGlobalScope":true},{"version":"2fef54945a13095fdb9b84f705f2b5994597640c46afeb2ce78352fab4cb3279","affectsGlobalScope":true},{"version":"56e4ed5aab5f5920980066a9409bfaf53e6d21d3f8d020c17e4de584d29600ad","affectsGlobalScope":true},{"version":"33358442698bb565130f52ba79bfd3d4d484ac85fe33f3cb1759c54d18201393","affectsGlobalScope":true},{"version":"782dec38049b92d4e85c1585fbea5474a219c6984a35b004963b00beb1aab538","affectsGlobalScope":true},{"version":"547e3dca0ef22ef9dcfe2046a390e1f5c86acac2cdb4dde8a150593c9488bf5a","signature":"142d6426a67811d7bb2211ec07461b73302abc1c58f1b7c62a7f084d05717228"},{"version":"9562b4736c07eaf98388858acff6157eafae0b51df775cbba5bfdf4733de00b3","signature":"af7111a79dd6691e3168ce5b0feb86dc18b4e296e30d4994448b61f899967dd5"},{"version":"cd62baba8e325afe998a6537894fcc0420146c242e1b6fdfdaaadfd21dc0d969","affectsGlobalScope":true}],"root":[74,75],"options":{"allowJs":true,"allowSyntheticDefaultImports":true,"checkJs":true,"composite":true,"declaration":true,"declarationDir":"./build-types","declarationMap":true,"emitDeclarationOnly":true,"esModuleInterop":false,"jsx":1,"module":99,"noFallthroughCasesInSwitch":true,"noImplicitReturns":true,"rootDir":"./src","skipDefaultLibCheck":true,"strict":true,"target":99},"fileIdsList":[[74]],"referencedMap":[[75,1]],"latestChangedDtsFile":"./build-types/index.d.ts"},"version":"5.5.3"}
1
+ {"program":{"fileNames":["../../node_modules/typescript/lib/lib.es5.d.ts","../../node_modules/typescript/lib/lib.es2015.d.ts","../../node_modules/typescript/lib/lib.es2016.d.ts","../../node_modules/typescript/lib/lib.es2017.d.ts","../../node_modules/typescript/lib/lib.es2018.d.ts","../../node_modules/typescript/lib/lib.es2019.d.ts","../../node_modules/typescript/lib/lib.es2020.d.ts","../../node_modules/typescript/lib/lib.es2021.d.ts","../../node_modules/typescript/lib/lib.es2022.d.ts","../../node_modules/typescript/lib/lib.es2023.d.ts","../../node_modules/typescript/lib/lib.esnext.d.ts","../../node_modules/typescript/lib/lib.dom.d.ts","../../node_modules/typescript/lib/lib.dom.iterable.d.ts","../../node_modules/typescript/lib/lib.es2015.core.d.ts","../../node_modules/typescript/lib/lib.es2015.collection.d.ts","../../node_modules/typescript/lib/lib.es2015.generator.d.ts","../../node_modules/typescript/lib/lib.es2015.iterable.d.ts","../../node_modules/typescript/lib/lib.es2015.promise.d.ts","../../node_modules/typescript/lib/lib.es2015.proxy.d.ts","../../node_modules/typescript/lib/lib.es2015.reflect.d.ts","../../node_modules/typescript/lib/lib.es2015.symbol.d.ts","../../node_modules/typescript/lib/lib.es2015.symbol.wellknown.d.ts","../../node_modules/typescript/lib/lib.es2016.array.include.d.ts","../../node_modules/typescript/lib/lib.es2016.intl.d.ts","../../node_modules/typescript/lib/lib.es2017.date.d.ts","../../node_modules/typescript/lib/lib.es2017.object.d.ts","../../node_modules/typescript/lib/lib.es2017.sharedmemory.d.ts","../../node_modules/typescript/lib/lib.es2017.string.d.ts","../../node_modules/typescript/lib/lib.es2017.intl.d.ts","../../node_modules/typescript/lib/lib.es2017.typedarrays.d.ts","../../node_modules/typescript/lib/lib.es2018.asyncgenerator.d.ts","../../node_modules/typescript/lib/lib.es2018.asynciterable.d.ts","../../node_modules/typescript/lib/lib.es2018.intl.d.ts","../../node_modules/typescript/lib/lib.es2018.promise.d.ts","../../node_modules/typescript/lib/lib.es2018.regexp.d.ts","../../node_modules/typescript/lib/lib.es2019.array.d.ts","../../node_modules/typescript/lib/lib.es2019.object.d.ts","../../node_modules/typescript/lib/lib.es2019.string.d.ts","../../node_modules/typescript/lib/lib.es2019.symbol.d.ts","../../node_modules/typescript/lib/lib.es2019.intl.d.ts","../../node_modules/typescript/lib/lib.es2020.bigint.d.ts","../../node_modules/typescript/lib/lib.es2020.date.d.ts","../../node_modules/typescript/lib/lib.es2020.promise.d.ts","../../node_modules/typescript/lib/lib.es2020.sharedmemory.d.ts","../../node_modules/typescript/lib/lib.es2020.string.d.ts","../../node_modules/typescript/lib/lib.es2020.symbol.wellknown.d.ts","../../node_modules/typescript/lib/lib.es2020.intl.d.ts","../../node_modules/typescript/lib/lib.es2020.number.d.ts","../../node_modules/typescript/lib/lib.es2021.promise.d.ts","../../node_modules/typescript/lib/lib.es2021.string.d.ts","../../node_modules/typescript/lib/lib.es2021.weakref.d.ts","../../node_modules/typescript/lib/lib.es2021.intl.d.ts","../../node_modules/typescript/lib/lib.es2022.array.d.ts","../../node_modules/typescript/lib/lib.es2022.error.d.ts","../../node_modules/typescript/lib/lib.es2022.intl.d.ts","../../node_modules/typescript/lib/lib.es2022.object.d.ts","../../node_modules/typescript/lib/lib.es2022.sharedmemory.d.ts","../../node_modules/typescript/lib/lib.es2022.string.d.ts","../../node_modules/typescript/lib/lib.es2022.regexp.d.ts","../../node_modules/typescript/lib/lib.es2023.array.d.ts","../../node_modules/typescript/lib/lib.es2023.collection.d.ts","../../node_modules/typescript/lib/lib.es2023.intl.d.ts","../../node_modules/typescript/lib/lib.esnext.array.d.ts","../../node_modules/typescript/lib/lib.esnext.collection.d.ts","../../node_modules/typescript/lib/lib.esnext.intl.d.ts","../../node_modules/typescript/lib/lib.esnext.disposable.d.ts","../../node_modules/typescript/lib/lib.esnext.string.d.ts","../../node_modules/typescript/lib/lib.esnext.promise.d.ts","../../node_modules/typescript/lib/lib.esnext.decorators.d.ts","../../node_modules/typescript/lib/lib.esnext.object.d.ts","../../node_modules/typescript/lib/lib.esnext.regexp.d.ts","../../node_modules/typescript/lib/lib.decorators.d.ts","../../node_modules/typescript/lib/lib.decorators.legacy.d.ts","./src/implementation.ts","./src/index.ts","../../typings/gutenberg-env/index.d.ts"],"fileInfos":[{"version":"44e584d4f6444f58791784f1d530875970993129442a847597db702a073ca68c","affectsGlobalScope":true},"45b7ab580deca34ae9729e97c13cfd999df04416a79116c3bfb483804f85ded4","3facaf05f0c5fc569c5649dd359892c98a85557e3e0c847964caeb67076f4d75","9a68c0c07ae2fa71b44384a839b7b8d81662a236d4b9ac30916718f7510b1b2d","5e1c4c362065a6b95ff952c0eab010f04dcd2c3494e813b493ecfd4fcb9fc0d8","68d73b4a11549f9c0b7d352d10e91e5dca8faa3322bfb77b661839c42b1ddec7","5efce4fc3c29ea84e8928f97adec086e3dc876365e0982cc8479a07954a3efd4","feecb1be483ed332fad555aff858affd90a48ab19ba7272ee084704eb7167569","5514e54f17d6d74ecefedc73c504eadffdeda79c7ea205cf9febead32d45c4bc","27bdc30a0e32783366a5abeda841bc22757c1797de8681bbe81fbc735eeb1c10","17edc026abf73c5c2dd508652d63f68ec4efd9d4856e3469890d27598209feb5",{"version":"4af6b0c727b7a2896463d512fafd23634229adf69ac7c00e2ae15a09cb084fad","affectsGlobalScope":true},{"version":"9c00a480825408b6a24c63c1b71362232927247595d7c97659bc24dc68ae0757","affectsGlobalScope":true},{"version":"6920e1448680767498a0b77c6a00a8e77d14d62c3da8967b171f1ddffa3c18e4","affectsGlobalScope":true},{"version":"dc2df20b1bcdc8c2d34af4926e2c3ab15ffe1160a63e58b7e09833f616efff44","affectsGlobalScope":true},{"version":"4443e68b35f3332f753eacc66a04ac1d2053b8b035a0e0ac1d455392b5e243b3","affectsGlobalScope":true},{"version":"bc47685641087c015972a3f072480889f0d6c65515f12bd85222f49a98952ed7","affectsGlobalScope":true},{"version":"0dc1e7ceda9b8b9b455c3a2d67b0412feab00bd2f66656cd8850e8831b08b537","affectsGlobalScope":true},{"version":"ce691fb9e5c64efb9547083e4a34091bcbe5bdb41027e310ebba8f7d96a98671","affectsGlobalScope":true},{"version":"8d697a2a929a5fcb38b7a65594020fcef05ec1630804a33748829c5ff53640d0","affectsGlobalScope":true},{"version":"4ff2a353abf8a80ee399af572debb8faab2d33ad38c4b4474cff7f26e7653b8d","affectsGlobalScope":true},{"version":"93495ff27b8746f55d19fcbcdbaccc99fd95f19d057aed1bd2c0cafe1335fbf0","affectsGlobalScope":true},{"version":"6fc23bb8c3965964be8c597310a2878b53a0306edb71d4b5a4dfe760186bcc01","affectsGlobalScope":true},{"version":"ea011c76963fb15ef1cdd7ce6a6808b46322c527de2077b6cfdf23ae6f5f9ec7","affectsGlobalScope":true},{"version":"38f0219c9e23c915ef9790ab1d680440d95419ad264816fa15009a8851e79119","affectsGlobalScope":true},{"version":"bb42a7797d996412ecdc5b2787720de477103a0b2e53058569069a0e2bae6c7e","affectsGlobalScope":true},{"version":"4738f2420687fd85629c9efb470793bb753709c2379e5f85bc1815d875ceadcd","affectsGlobalScope":true},{"version":"2f11ff796926e0832f9ae148008138ad583bd181899ab7dd768a2666700b1893","affectsGlobalScope":true},{"version":"4de680d5bb41c17f7f68e0419412ca23c98d5749dcaaea1896172f06435891fc","affectsGlobalScope":true},{"version":"9fc46429fbe091ac5ad2608c657201eb68b6f1b8341bd6d670047d32ed0a88fa","affectsGlobalScope":true},{"version":"61c37c1de663cf4171e1192466e52c7a382afa58da01b1dc75058f032ddf0839","affectsGlobalScope":true},{"version":"b541a838a13f9234aba650a825393ffc2292dc0fc87681a5d81ef0c96d281e7a","affectsGlobalScope":true},{"version":"9e9fbd7030c440b33d021da145d3232984c8bb7916f277e8ffd3dc2e3eae2bdb","affectsGlobalScope":true},{"version":"811ec78f7fefcabbda4bfa93b3eb67d9ae166ef95f9bff989d964061cbf81a0c","affectsGlobalScope":true},{"version":"717937616a17072082152a2ef351cb51f98802fb4b2fdabd32399843875974ca","affectsGlobalScope":true},{"version":"d7e7d9b7b50e5f22c915b525acc5a49a7a6584cf8f62d0569e557c5cfc4b2ac2","affectsGlobalScope":true},{"version":"71c37f4c9543f31dfced6c7840e068c5a5aacb7b89111a4364b1d5276b852557","affectsGlobalScope":true},{"version":"576711e016cf4f1804676043e6a0a5414252560eb57de9faceee34d79798c850","affectsGlobalScope":true},{"version":"89c1b1281ba7b8a96efc676b11b264de7a8374c5ea1e6617f11880a13fc56dc6","affectsGlobalScope":true},{"version":"74f7fa2d027d5b33eb0471c8e82a6c87216223181ec31247c357a3e8e2fddc5b","affectsGlobalScope":true},{"version":"ae37d6ccd1560b0203ab88d46987393adaaa78c919e51acf32fb82c86502e98c","affectsGlobalScope":true},{"version":"063600664504610fe3e99b717a1223f8b1900087fab0b4cad1496a114744f8df","affectsGlobalScope":true},{"version":"934019d7e3c81950f9a8426d093458b65d5aff2c7c1511233c0fd5b941e608ab","affectsGlobalScope":true},{"version":"bf14a426dbbf1022d11bd08d6b8e709a2e9d246f0c6c1032f3b2edb9a902adbe","affectsGlobalScope":true},{"version":"5e07ed3809d48205d5b985642a59f2eba47c402374a7cf8006b686f79efadcbd","affectsGlobalScope":true},{"version":"2b72d528b2e2fe3c57889ca7baef5e13a56c957b946906d03767c642f386bbc3","affectsGlobalScope":true},{"version":"479553e3779be7d4f68e9f40cdb82d038e5ef7592010100410723ceced22a0f7","affectsGlobalScope":true},{"version":"368af93f74c9c932edd84c58883e736c9e3d53cec1fe24c0b0ff451f529ceab1","affectsGlobalScope":true},{"version":"af3dd424cf267428f30ccfc376f47a2c0114546b55c44d8c0f1d57d841e28d74","affectsGlobalScope":true},{"version":"995c005ab91a498455ea8dfb63aa9f83fa2ea793c3d8aa344be4a1678d06d399","affectsGlobalScope":true},{"version":"d3d7b04b45033f57351c8434f60b6be1ea71a2dfec2d0a0c3c83badbb0e3e693","affectsGlobalScope":true},{"version":"956d27abdea9652e8368ce029bb1e0b9174e9678a273529f426df4b3d90abd60","affectsGlobalScope":true},{"version":"4fa6ed14e98aa80b91f61b9805c653ee82af3502dc21c9da5268d3857772ca05","affectsGlobalScope":true},{"version":"e6633e05da3ff36e6da2ec170d0d03ccf33de50ca4dc6f5aeecb572cedd162fb","affectsGlobalScope":true},{"version":"d8670852241d4c6e03f2b89d67497a4bbefe29ecaa5a444e2c11a9b05e6fccc6","affectsGlobalScope":true},{"version":"8444af78980e3b20b49324f4a16ba35024fef3ee069a0eb67616ea6ca821c47a","affectsGlobalScope":true},{"version":"caccc56c72713969e1cfe5c3d44e5bab151544d9d2b373d7dbe5a1e4166652be","affectsGlobalScope":true},{"version":"3287d9d085fbd618c3971944b65b4be57859f5415f495b33a6adc994edd2f004","affectsGlobalScope":true},{"version":"b4b67b1a91182421f5df999988c690f14d813b9850b40acd06ed44691f6727ad","affectsGlobalScope":true},{"version":"08a58483392df5fcc1db57d782e87734f77ae9eab42516028acbfe46f29a3ef7","affectsGlobalScope":true},{"version":"436aaf437562f276ec2ddbee2f2cdedac7664c1e4c1d2c36839ddd582eeb3d0a","affectsGlobalScope":true},{"version":"8e3c06ea092138bf9fa5e874a1fdbc9d54805d074bee1de31b99a11e2fec239d","affectsGlobalScope":true},{"version":"0b11f3ca66aa33124202c80b70cd203219c3d4460cfc165e0707aa9ec710fc53","affectsGlobalScope":true},{"version":"6a3f5a0129cc80cf439ab71164334d649b47059a4f5afca90282362407d0c87f","affectsGlobalScope":true},{"version":"811c71eee4aa0ac5f7adf713323a5c41b0cf6c4e17367a34fbce379e12bbf0a4","affectsGlobalScope":true},{"version":"15b98a533864d324e5f57cd3cfc0579b231df58c1c0f6063ea0fcb13c3c74ff9","affectsGlobalScope":true},{"version":"0a6282c8827e4b9a95f4bf4f5c205673ada31b982f50572d27103df8ceb8013c","affectsGlobalScope":true},{"version":"ac77cb3e8c6d3565793eb90a8373ee8033146315a3dbead3bde8db5eaf5e5ec6","affectsGlobalScope":true},{"version":"d4b1d2c51d058fc21ec2629fff7a76249dec2e36e12960ea056e3ef89174080f","affectsGlobalScope":true},{"version":"2fef54945a13095fdb9b84f705f2b5994597640c46afeb2ce78352fab4cb3279","affectsGlobalScope":true},{"version":"56e4ed5aab5f5920980066a9409bfaf53e6d21d3f8d020c17e4de584d29600ad","affectsGlobalScope":true},{"version":"33358442698bb565130f52ba79bfd3d4d484ac85fe33f3cb1759c54d18201393","affectsGlobalScope":true},{"version":"782dec38049b92d4e85c1585fbea5474a219c6984a35b004963b00beb1aab538","affectsGlobalScope":true},{"version":"ea6ce74b19a549b090a827a323a378cde58f08c0d2d1f4b4ce749f4c17abf69d","signature":"cb94716c65b36705d8692894c7c125567225cefc271c27a6ec18964e8d503d10"},"9562b4736c07eaf98388858acff6157eafae0b51df775cbba5bfdf4733de00b3",{"version":"cd62baba8e325afe998a6537894fcc0420146c242e1b6fdfdaaadfd21dc0d969","affectsGlobalScope":true}],"root":[74,75],"options":{"allowJs":true,"allowSyntheticDefaultImports":true,"checkJs":true,"composite":true,"declaration":true,"declarationDir":"./build-types","declarationMap":true,"emitDeclarationOnly":true,"esModuleInterop":false,"jsx":1,"module":99,"noFallthroughCasesInSwitch":true,"noImplicitReturns":true,"rootDir":"./src","skipDefaultLibCheck":true,"strict":true,"target":99},"fileIdsList":[[74]],"referencedMap":[[75,1]],"latestChangedDtsFile":"./build-types/index.d.ts"},"version":"5.5.3"}
File without changes