@wordpress/dom-ready 4.32.0 → 4.32.1-next.b8c8708f3.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/build/index.js CHANGED
@@ -1,51 +1,34 @@
1
1
  "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
6
+ var __export = (target, all) => {
7
+ for (var name in all)
8
+ __defProp(target, name, { get: all[name], enumerable: true });
9
+ };
10
+ var __copyProps = (to, from, except, desc) => {
11
+ if (from && typeof from === "object" || typeof from === "function") {
12
+ for (let key of __getOwnPropNames(from))
13
+ if (!__hasOwnProp.call(to, key) && key !== except)
14
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
15
+ }
16
+ return to;
17
+ };
18
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
+ var index_exports = {};
20
+ __export(index_exports, {
21
+ default: () => domReady
5
22
  });
6
- exports.default = domReady;
7
- /**
8
- * @typedef {() => void} Callback
9
- *
10
- * TODO: Remove this typedef and inline `() => void` type.
11
- *
12
- * This typedef is used so that a descriptive type is provided in our
13
- * automatically generated documentation.
14
- *
15
- * An in-line type `() => void` would be preferable, but the generated
16
- * documentation is `null` in that case.
17
- *
18
- * @see https://github.com/WordPress/gutenberg/issues/18045
19
- */
20
-
21
- /**
22
- * Specify a function to execute when the DOM is fully loaded.
23
- *
24
- * @param {Callback} callback A function to execute after the DOM is ready.
25
- *
26
- * @example
27
- * ```js
28
- * import domReady from '@wordpress/dom-ready';
29
- *
30
- * domReady( function() {
31
- * //do something after DOM loads.
32
- * } );
33
- * ```
34
- *
35
- * @return {void}
36
- */
23
+ module.exports = __toCommonJS(index_exports);
37
24
  function domReady(callback) {
38
- if (typeof document === 'undefined') {
25
+ if (typeof document === "undefined") {
39
26
  return;
40
27
  }
41
- if (document.readyState === 'complete' ||
42
- // DOMContentLoaded + Images/Styles/etc loaded, so we call directly.
43
- document.readyState === 'interactive' // DOMContentLoaded fires at this point, so we call directly.
44
- ) {
28
+ if (document.readyState === "complete" || // DOMContentLoaded + Images/Styles/etc loaded, so we call directly.
29
+ document.readyState === "interactive") {
45
30
  return void callback();
46
31
  }
47
-
48
- // DOMContentLoaded has not fired yet, delay callback until then.
49
- document.addEventListener('DOMContentLoaded', callback);
32
+ document.addEventListener("DOMContentLoaded", callback);
50
33
  }
51
- //# sourceMappingURL=index.js.map
34
+ //# sourceMappingURL=index.js.map
@@ -1 +1,7 @@
1
- {"version":3,"names":["domReady","callback","document","readyState","addEventListener"],"sources":["@wordpress/dom-ready/src/index.js"],"sourcesContent":["/**\n * @typedef {() => void} Callback\n *\n * TODO: Remove this typedef and inline `() => void` type.\n *\n * This typedef is used so that a descriptive type is provided in our\n * automatically generated documentation.\n *\n * An in-line type `() => void` would be preferable, but the generated\n * documentation is `null` in that case.\n *\n * @see https://github.com/WordPress/gutenberg/issues/18045\n */\n\n/**\n * Specify a function to execute when the DOM is fully loaded.\n *\n * @param {Callback} callback A function to execute after the DOM is ready.\n *\n * @example\n * ```js\n * import domReady from '@wordpress/dom-ready';\n *\n * domReady( function() {\n * \t//do something after DOM loads.\n * } );\n * ```\n *\n * @return {void}\n */\nexport default function domReady( callback ) {\n\tif ( typeof document === 'undefined' ) {\n\t\treturn;\n\t}\n\n\tif (\n\t\tdocument.readyState === 'complete' || // DOMContentLoaded + Images/Styles/etc loaded, so we call directly.\n\t\tdocument.readyState === 'interactive' // DOMContentLoaded fires at this point, so we call directly.\n\t) {\n\t\treturn void callback();\n\t}\n\n\t// DOMContentLoaded has not fired yet, delay callback until then.\n\tdocument.addEventListener( 'DOMContentLoaded', callback );\n}\n"],"mappings":";;;;;;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACe,SAASA,QAAQA,CAAEC,QAAQ,EAAG;EAC5C,IAAK,OAAOC,QAAQ,KAAK,WAAW,EAAG;IACtC;EACD;EAEA,IACCA,QAAQ,CAACC,UAAU,KAAK,UAAU;EAAI;EACtCD,QAAQ,CAACC,UAAU,KAAK,aAAa,CAAC;EAAA,EACrC;IACD,OAAO,KAAKF,QAAQ,CAAC,CAAC;EACvB;;EAEA;EACAC,QAAQ,CAACE,gBAAgB,CAAE,kBAAkB,EAAEH,QAAS,CAAC;AAC1D","ignoreList":[]}
1
+ {
2
+ "version": 3,
3
+ "sources": ["../src/index.js"],
4
+ "sourcesContent": ["/**\n * @typedef {() => void} Callback\n *\n * TODO: Remove this typedef and inline `() => void` type.\n *\n * This typedef is used so that a descriptive type is provided in our\n * automatically generated documentation.\n *\n * An in-line type `() => void` would be preferable, but the generated\n * documentation is `null` in that case.\n *\n * @see https://github.com/WordPress/gutenberg/issues/18045\n */\n\n/**\n * Specify a function to execute when the DOM is fully loaded.\n *\n * @param {Callback} callback A function to execute after the DOM is ready.\n *\n * @example\n * ```js\n * import domReady from '@wordpress/dom-ready';\n *\n * domReady( function() {\n * \t//do something after DOM loads.\n * } );\n * ```\n *\n * @return {void}\n */\nexport default function domReady( callback ) {\n\tif ( typeof document === 'undefined' ) {\n\t\treturn;\n\t}\n\n\tif (\n\t\tdocument.readyState === 'complete' || // DOMContentLoaded + Images/Styles/etc loaded, so we call directly.\n\t\tdocument.readyState === 'interactive' // DOMContentLoaded fires at this point, so we call directly.\n\t) {\n\t\treturn void callback();\n\t}\n\n\t// DOMContentLoaded has not fired yet, delay callback until then.\n\tdocument.addEventListener( 'DOMContentLoaded', callback );\n}\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AA8Be,SAAR,SAA2B,UAAW;AAC5C,MAAK,OAAO,aAAa,aAAc;AACtC;AAAA,EACD;AAEA,MACC,SAAS,eAAe;AAAA,EACxB,SAAS,eAAe,eACvB;AACD,WAAO,KAAK,SAAS;AAAA,EACtB;AAGA,WAAS,iBAAkB,oBAAoB,QAAS;AACzD;",
6
+ "names": []
7
+ }
@@ -1,45 +1,14 @@
1
- /**
2
- * @typedef {() => void} Callback
3
- *
4
- * TODO: Remove this typedef and inline `() => void` type.
5
- *
6
- * This typedef is used so that a descriptive type is provided in our
7
- * automatically generated documentation.
8
- *
9
- * An in-line type `() => void` would be preferable, but the generated
10
- * documentation is `null` in that case.
11
- *
12
- * @see https://github.com/WordPress/gutenberg/issues/18045
13
- */
14
-
15
- /**
16
- * Specify a function to execute when the DOM is fully loaded.
17
- *
18
- * @param {Callback} callback A function to execute after the DOM is ready.
19
- *
20
- * @example
21
- * ```js
22
- * import domReady from '@wordpress/dom-ready';
23
- *
24
- * domReady( function() {
25
- * //do something after DOM loads.
26
- * } );
27
- * ```
28
- *
29
- * @return {void}
30
- */
31
- export default function domReady(callback) {
32
- if (typeof document === 'undefined') {
1
+ function domReady(callback) {
2
+ if (typeof document === "undefined") {
33
3
  return;
34
4
  }
35
- if (document.readyState === 'complete' ||
36
- // DOMContentLoaded + Images/Styles/etc loaded, so we call directly.
37
- document.readyState === 'interactive' // DOMContentLoaded fires at this point, so we call directly.
38
- ) {
5
+ if (document.readyState === "complete" || // DOMContentLoaded + Images/Styles/etc loaded, so we call directly.
6
+ document.readyState === "interactive") {
39
7
  return void callback();
40
8
  }
41
-
42
- // DOMContentLoaded has not fired yet, delay callback until then.
43
- document.addEventListener('DOMContentLoaded', callback);
9
+ document.addEventListener("DOMContentLoaded", callback);
44
10
  }
45
- //# sourceMappingURL=index.js.map
11
+ export {
12
+ domReady as default
13
+ };
14
+ //# sourceMappingURL=index.js.map
@@ -1 +1,7 @@
1
- {"version":3,"names":["domReady","callback","document","readyState","addEventListener"],"sources":["@wordpress/dom-ready/src/index.js"],"sourcesContent":["/**\n * @typedef {() => void} Callback\n *\n * TODO: Remove this typedef and inline `() => void` type.\n *\n * This typedef is used so that a descriptive type is provided in our\n * automatically generated documentation.\n *\n * An in-line type `() => void` would be preferable, but the generated\n * documentation is `null` in that case.\n *\n * @see https://github.com/WordPress/gutenberg/issues/18045\n */\n\n/**\n * Specify a function to execute when the DOM is fully loaded.\n *\n * @param {Callback} callback A function to execute after the DOM is ready.\n *\n * @example\n * ```js\n * import domReady from '@wordpress/dom-ready';\n *\n * domReady( function() {\n * \t//do something after DOM loads.\n * } );\n * ```\n *\n * @return {void}\n */\nexport default function domReady( callback ) {\n\tif ( typeof document === 'undefined' ) {\n\t\treturn;\n\t}\n\n\tif (\n\t\tdocument.readyState === 'complete' || // DOMContentLoaded + Images/Styles/etc loaded, so we call directly.\n\t\tdocument.readyState === 'interactive' // DOMContentLoaded fires at this point, so we call directly.\n\t) {\n\t\treturn void callback();\n\t}\n\n\t// DOMContentLoaded has not fired yet, delay callback until then.\n\tdocument.addEventListener( 'DOMContentLoaded', callback );\n}\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,SAASA,QAAQA,CAAEC,QAAQ,EAAG;EAC5C,IAAK,OAAOC,QAAQ,KAAK,WAAW,EAAG;IACtC;EACD;EAEA,IACCA,QAAQ,CAACC,UAAU,KAAK,UAAU;EAAI;EACtCD,QAAQ,CAACC,UAAU,KAAK,aAAa,CAAC;EAAA,EACrC;IACD,OAAO,KAAKF,QAAQ,CAAC,CAAC;EACvB;;EAEA;EACAC,QAAQ,CAACE,gBAAgB,CAAE,kBAAkB,EAAEH,QAAS,CAAC;AAC1D","ignoreList":[]}
1
+ {
2
+ "version": 3,
3
+ "sources": ["../src/index.js"],
4
+ "sourcesContent": ["/**\n * @typedef {() => void} Callback\n *\n * TODO: Remove this typedef and inline `() => void` type.\n *\n * This typedef is used so that a descriptive type is provided in our\n * automatically generated documentation.\n *\n * An in-line type `() => void` would be preferable, but the generated\n * documentation is `null` in that case.\n *\n * @see https://github.com/WordPress/gutenberg/issues/18045\n */\n\n/**\n * Specify a function to execute when the DOM is fully loaded.\n *\n * @param {Callback} callback A function to execute after the DOM is ready.\n *\n * @example\n * ```js\n * import domReady from '@wordpress/dom-ready';\n *\n * domReady( function() {\n * \t//do something after DOM loads.\n * } );\n * ```\n *\n * @return {void}\n */\nexport default function domReady( callback ) {\n\tif ( typeof document === 'undefined' ) {\n\t\treturn;\n\t}\n\n\tif (\n\t\tdocument.readyState === 'complete' || // DOMContentLoaded + Images/Styles/etc loaded, so we call directly.\n\t\tdocument.readyState === 'interactive' // DOMContentLoaded fires at this point, so we call directly.\n\t) {\n\t\treturn void callback();\n\t}\n\n\t// DOMContentLoaded has not fired yet, delay callback until then.\n\tdocument.addEventListener( 'DOMContentLoaded', callback );\n}\n"],
5
+ "mappings": "AA8Be,SAAR,SAA2B,UAAW;AAC5C,MAAK,OAAO,aAAa,aAAc;AACtC;AAAA,EACD;AAEA,MACC,SAAS,eAAe;AAAA,EACxB,SAAS,eAAe,eACvB;AACD,WAAO,KAAK,SAAS;AAAA,EACtB;AAGA,WAAS,iBAAkB,oBAAoB,QAAS;AACzD;",
6
+ "names": []
7
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@wordpress/dom-ready",
3
- "version": "4.32.0",
3
+ "version": "4.32.1-next.b8c8708f3.0",
4
4
  "description": "Execute callback after the DOM is loaded.",
5
5
  "author": "The WordPress Contributors",
6
6
  "license": "GPL-2.0-or-later",
@@ -24,15 +24,21 @@
24
24
  },
25
25
  "main": "build/index.js",
26
26
  "module": "build-module/index.js",
27
+ "exports": {
28
+ ".": {
29
+ "types": "./build-types/index.d.ts",
30
+ "import": "./build-module/index.js",
31
+ "require": "./build/index.js"
32
+ },
33
+ "./package.json": "./package.json"
34
+ },
27
35
  "react-native": "src/index",
28
36
  "wpScript": true,
37
+ "wpScriptDefaultExport": true,
29
38
  "types": "build-types",
30
39
  "sideEffects": false,
31
- "dependencies": {
32
- "@babel/runtime": "7.25.7"
33
- },
34
40
  "publishConfig": {
35
41
  "access": "public"
36
42
  },
37
- "gitHead": "a030b4c0e0695239b942c7dc18511782b64f10ed"
43
+ "gitHead": "67cfd7e661931aeb0d06bec894599d287a4f8d0f"
38
44
  }