@wordpress/dom-ready 4.34.0 → 4.34.1-next.2f1c7c01b.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
@@ -16,6 +16,8 @@ var __copyProps = (to, from, except, desc) => {
16
16
  return to;
17
17
  };
18
18
  var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
+
20
+ // packages/dom-ready/src/index.js
19
21
  var index_exports = {};
20
22
  __export(index_exports, {
21
23
  default: () => domReady
@@ -2,6 +2,6 @@
2
2
  "version": 3,
3
3
  "sources": ["../src/index.js"],
4
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;",
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
6
  "names": []
7
7
  }
@@ -1,3 +1,4 @@
1
+ // packages/dom-ready/src/index.js
1
2
  function domReady(callback) {
2
3
  if (typeof document === "undefined") {
3
4
  return;
@@ -2,6 +2,6 @@
2
2
  "version": 3,
3
3
  "sources": ["../src/index.js"],
4
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;",
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
6
  "names": []
7
7
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@wordpress/dom-ready",
3
- "version": "4.34.0",
3
+ "version": "4.34.1-next.2f1c7c01b.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",
@@ -40,5 +40,5 @@
40
40
  "publishConfig": {
41
41
  "access": "public"
42
42
  },
43
- "gitHead": "ceebff807958d2e8fc755b5a20473939c78b4d1d"
43
+ "gitHead": "c6ddcdf455bc02567a2c9e03de6862a2061b85e8"
44
44
  }