@vknext/shared 1.3.7 → 1.4.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.
@@ -1 +1 @@
1
- import"../../../utils/parseSvg.js";import{waitHTMLBody as e}from"../../../utils/waitHTMLBody.js";import{waitHTMLHead as t}from"../../../utils/waitHTMLHead.js";const o=(o,n,i={})=>{const{checkInterval:d=100,timeout:r=null,waitForPageLoad:s=!1,once:l=!1}=i;let a=!0,c=null,u=null,m=null;const w=()=>{a=!1,c&&c.disconnect(),u&&clearInterval(u),m&&clearTimeout(m)},f=()=>{if(!a)return;const e=window[o];void 0!==e&&(n(e),l&&w())},v=()=>{f(),a&&(c=new MutationObserver((e=>{if(a)for(const t of e)if("childList"===t.type)for(const e of t.addedNodes)if(e.nodeType===Node.ELEMENT_NODE){const t=e;"SCRIPT"===t.tagName&&setTimeout(f,0);t.querySelectorAll("script").length>0&&setTimeout(f,0)}})),t().then((()=>{a&&c&&c.observe(document.head,{childList:!0,subtree:!0})})),e().then((()=>{a&&c&&c.observe(document.body,{childList:!0})})),u=window.setInterval(f,d),null!==r&&(m=window.setTimeout((()=>{w(),console.warn(`[watchGlobalProperty] Timeout waiting for variable: ${String(o)}`)}),r)))};if(s)if("complete"===document.readyState)v();else{const e=()=>{v(),window.removeEventListener("load",e)};window.addEventListener("load",e)}else if("loading"===document.readyState){const e=()=>{v(),document.removeEventListener("DOMContentLoaded",e)};document.addEventListener("DOMContentLoaded",e)}else v();return w};export{o as default};
1
+ import"../../../utils/parseSvg.js";import{waitHTMLBody as e}from"../../../utils/waitHTMLBody.js";import{waitHTMLHead as t}from"../../../utils/waitHTMLHead.js";const o=(o,n,i={})=>{const{checkInterval:d=100,timeout:r=null,waitForPageLoad:s=!1,once:l=!1}=i;let a=!0,c=null,u=null,m=null;const w=()=>{a=!1,c&&c.disconnect(),u&&clearInterval(u),m&&clearTimeout(m)};let f;const v=()=>{if(!a)return;const e=window[o];void 0!==e&&e!==f&&(f=e,n(e),l&&w())},L=()=>{v(),a&&(c=new MutationObserver((e=>{if(a)for(const t of e)if("childList"===t.type)for(const e of t.addedNodes)if(e.nodeType===Node.ELEMENT_NODE){const t=e;"SCRIPT"===t.tagName&&setTimeout(v,0);t.querySelectorAll("script").length>0&&setTimeout(v,0)}})),t().then((()=>{a&&c&&c.observe(document.head,{childList:!0,subtree:!0})})),e().then((()=>{a&&c&&c.observe(document.body,{childList:!0})})),u=window.setInterval(v,d),null!==r&&(m=window.setTimeout((()=>{w(),console.warn(`[watchGlobalProperty] Timeout waiting for variable: ${String(o)}`)}),r)))};if(s)if("complete"===document.readyState)L();else{const e=()=>{L(),window.removeEventListener("load",e)};window.addEventListener("load",e)}else if("loading"===document.readyState){const e=()=>{L(),document.removeEventListener("DOMContentLoaded",e)};document.addEventListener("DOMContentLoaded",e)}else L();return w};export{o as default};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vknext/shared",
3
- "version": "1.3.7",
3
+ "version": "1.4.0",
4
4
  "description": "vk next shared",
5
5
  "type": "module",
6
6
  "files": [