shadow-dom-selector 3.0.0 → 3.0.1
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/dist/esm/index.d.ts +2 -1
- package/dist/esm/index.js +1 -1
- package/dist/index.d.ts +2 -1
- package/dist/index.js +1 -1
- package/package.json +1 -1
package/dist/esm/index.d.ts
CHANGED
|
@@ -16,9 +16,10 @@ declare function asyncQuerySelectorAll<E extends Element = Element>(selectors: s
|
|
|
16
16
|
declare function asyncShadowRootQuerySelector(root: Document | Element, selectors: string, asyncParams?: AsyncParams): Promise<ShadowRoot | null>;
|
|
17
17
|
declare function asyncShadowRootQuerySelector(selectors: string, asyncParams?: AsyncParams): Promise<ShadowRoot | null>;
|
|
18
18
|
declare class AsyncSelector<T extends Document | Element | ShadowRoot> {
|
|
19
|
-
#private;
|
|
20
19
|
constructor(asyncParams?: AsyncParams);
|
|
21
20
|
constructor(root?: T | Promise<T | NodeListOf<Element>>, asyncParams?: AsyncParams);
|
|
21
|
+
private _element;
|
|
22
|
+
private _asyncParams;
|
|
22
23
|
get element(): Promise<T | null>;
|
|
23
24
|
get [SHADOW_ROOT_SELECTOR](): AsyncSelector<ShadowRoot>;
|
|
24
25
|
get all(): Promise<NodeListOf<Element>>;
|
package/dist/esm/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
function t(t,n,e,o){return new(e||(e=Promise))((function(r,i){function l(t){try{s(o.next(t))}catch(t){i(t)}}function u(t){try{s(o.throw(t))}catch(t){i(t)}}function s(t){var n;t.done?r(t.value):(n=t.value,n instanceof e?n:new e((function(t){t(n)}))).then(l,u)}s((o=o.apply(t,n||[])).next())}))}function n(t,n,e,o){if("a"===e&&!o)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof n?t!==n||!o:!n.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===e?o:"a"===e?o.call(t):o?o.value:n.get(t)}function e(t,n,e,o,r){if("m"===o)throw new TypeError("Private method is not writable");if("a"===o&&!r)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof n?t!==n||!r:!n.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===o?r.call(t,e):r?r.value=e:n.set(t,e),e}"function"==typeof SuppressedError&&SuppressedError;const o="$",r=":host",i="invalid selector",l=10,u=10,s=t=>{const[n,e]=t;return(o=n)&&(o instanceof Document||o instanceof Element)&&"string"==typeof e;var o};function c(t,n){return function(t){return t.split(",").map((t=>t.trim()))}(t).map((t=>{const e=function(t){return t.split(o).map((t=>t.trim()))}(t);return n(e)}))}function f(t,n,e,o,r=!1){return new Promise((l=>{let u=0;const s=()=>{const c=r?t.querySelectorAll(n):t.querySelector(n);r&&c.length||!r&&null!==c?l(c):(u++,u<e?setTimeout(s,o):l(r?document.querySelectorAll(i):null))};s()}))}function a(t,n,e){return new Promise((o=>{let r=0;const i=()=>{const l=t.shadowRoot;l?o(l):(r++,r<n?setTimeout(i,e):o(null))};i()}))}function d(t,n){return`${t} cannot be used with a selector ending in a shadowRoot (${o}).${n?` If you want to select a shadowRoot, use ${n} instead.`:""}`}function h(t,n){return`${t} must be used with a selector ending in a shadowRoot (${o}). If you don't want to select a shadowRoot, use ${n} instead.`}function y(t){return t instanceof Promise?t:Promise.resolve(t)}function w(){return`You can not select a shadowRoot (${o}) of the document.`}function v(t,n){var e,o;let i=null;const l=t.length;for(let u=0;u<l;u++){if(0===u)if(t[u].length)i=n.querySelector(t[u]);else{if(n instanceof Document)throw new SyntaxError(w());i=(null===(e=n.shadowRoot)||void 0===e?void 0:e.querySelector(t[++u]))||null}else i=(null===(o=i.shadowRoot)||void 0===o?void 0:o.querySelector(`${r} ${t[u]}`))||null;if(null===i)return null}return i}function g(t,n){var e;const o=[...t],i=o.pop();if(!o.length)return n.querySelectorAll(i);return(null===(e=v(o,n).shadowRoot)||void 0===e?void 0:e.querySelectorAll(`${r} ${i}`))||null}function m(t,n){if(1===t.length&&!t[0].length){if(n instanceof Document)throw new SyntaxError(w());return n.shadowRoot}const e=v(t,n);return(null==e?void 0:e.shadowRoot)||null}function p(n,e,o,i){return t(this,void 0,void 0,(function*(){let t=null;const l=n.length;for(let u=0;u<l;u++){if(0===u)if(n[u].length)t=yield f(e,n[u],o,i);else{if(e instanceof Document)throw new SyntaxError(w());t=e.shadowRoot?yield f(e.shadowRoot,n[++u],o,i):null}else{const e=yield a(t,o,i);t=e?yield f(e,`${r} ${n[u]}`,o,i):null}if(null===t)return null}return t}))}function S(n,e,o,i){return t(this,void 0,void 0,(function*(){const t=[...n],l=t.pop();if(!t.length)return yield f(e,l,o,i,!0);const u=yield p(t,e,o,i),s=u?yield a(u,o,i):null;return s?yield f(s,`${r} ${l}`,o,i,!0):null}))}function E(n,e,o,r){return t(this,void 0,void 0,(function*(){if(1===n.length&&!n[0].length){if(e instanceof Document)throw new SyntaxError(w());return a(e,o,r)}const t=yield p(n,e,o,r);return t?yield a(t,o,r):null}))}function R(t,n){const e=c(t,(t=>{if(!t[t.length-1].length)throw new SyntaxError(d("querySelector","shadowRootQuerySelector"));return t})),o=e.length;for(let t=0;t<o;t++){const o=v(e[t],n);if(o)return o}return null}function $(t,n){const e=c(t,(t=>{if(!t[t.length-1].length)throw new SyntaxError(d("querySelectorAll"));return t})),o=e.length;for(let t=0;t<o;t++){const o=g(e[t],n);if(null==o?void 0:o.length)return o}return document.querySelectorAll(i)}function q(t,n){const e=c(t,(t=>{if(t.pop().length)throw new SyntaxError(h("shadowRootQuerySelector","querySelector"));return t})),o=e.length;for(let t=0;t<o;t++){const o=m(e[t],n);if(o)return o}return null}function x(n,e,o,r){return t(this,void 0,void 0,(function*(){const t=c(n,(t=>{if(!t[t.length-1].length)throw new SyntaxError(d("asyncQuerySelector","asyncShadowRootQuerySelector"));return t})),i=t.length;for(let n=0;n<i;n++){const i=yield p(t[n],e,o,r);if(i)return i}return null}))}function P(n,e,o,r){return t(this,void 0,void 0,(function*(){const t=c(n,(t=>{if(!t[t.length-1].length)throw new SyntaxError(d("asyncQuerySelectorAll"));return t})),l=t.length;for(let n=0;n<l;n++){const i=yield S(t[n],e,o,r);if(null==i?void 0:i.length)return i}return document.querySelectorAll(i)}))}function b(n,e,o,r){return t(this,void 0,void 0,(function*(){const t=c(n,(t=>{if(t.pop().length)throw new SyntaxError(h("asyncShadowRootQuerySelector","asyncQuerySelector"));return t})),i=t.length;for(let n=0;n<i;n++){const i=yield E(t[n],e,o,r);if(i)return i}return null}))}var A,N;function L(...t){const[n,e]=t;return"string"==typeof n?R(n,document):R(e,n)}function Q(...t){const[n,e]=t;return"string"==typeof n?$(n,document):$(e,n)}function T(...t){const[n,e]=t;return"string"==typeof n?q(n,document):q(e,n)}function D(...n){return t(this,void 0,void 0,(function*(){if(s(n)){const[t,e,o]=n;return yield x(e,t,(null==o?void 0:o.retries)||l,(null==o?void 0:o.delay)||u)}const[t,e]=n;return yield x(t,document,(null==e?void 0:e.retries)||l,(null==e?void 0:e.delay)||u)}))}function j(...n){return t(this,void 0,void 0,(function*(){if(s(n)){const[t,e,o]=n;return yield P(e,t,(null==o?void 0:o.retries)||l,(null==o?void 0:o.delay)||u)}const[t,e]=n;return P(t,document,(null==e?void 0:e.retries)||l,(null==e?void 0:e.delay)||u)}))}function k(...n){return t(this,void 0,void 0,(function*(){if(s(n)){const[t,e,o]=n;return yield b(e,t,(null==o?void 0:o.retries)||l,(null==o?void 0:o.delay)||u)}const[t,e]=n;return b(t,document,(null==e?void 0:e.retries)||l,(null==e?void 0:e.delay)||u)}))}class C{constructor(t,n){A.set(this,void 0),N.set(this,void 0),t instanceof Node||t instanceof Promise?(e(this,A,t,"f"),e(this,N,Object.assign({retries:l,delay:u},n||{}),"f")):(e(this,A,document,"f"),e(this,N,Object.assign({retries:l,delay:u},t||{}),"f"))}get element(){return y(n(this,A,"f")).then((t=>t instanceof NodeList?t[0]||null:t))}get[(A=new WeakMap,N=new WeakMap,o)](){const t=y(n(this,A,"f")).then((t=>t instanceof Document||t instanceof ShadowRoot||null===t||t instanceof NodeList&&0===t.length?null:t instanceof NodeList?a(t[0],n(this,N,"f").retries,n(this,N,"f").delay):a(t,n(this,N,"f").retries,n(this,N,"f").delay)));return new C(t,n(this,N,"f"))}get all(){return y(n(this,A,"f")).then((t=>t instanceof NodeList?t:document.querySelectorAll(i)))}get asyncParams(){return n(this,N,"f")}eq(e){return t(this,void 0,void 0,(function*(){return y(n(this,A,"f")).then((t=>t instanceof NodeList&&t[e]||null))}))}query(t){const e=y(n(this,A,"f")).then((e=>null===e||e instanceof NodeList&&0===e.length?null:e instanceof NodeList?f(e[0],t,n(this,N,"f").retries,n(this,N,"f").delay,!0):f(e,t,n(this,N,"f").retries,n(this,N,"f").delay,!0)));return new C(e,n(this,N,"f"))}}export{C as AsyncSelector,D as asyncQuerySelector,j as asyncQuerySelectorAll,k as asyncShadowRootQuerySelector,L as querySelector,Q as querySelectorAll,T as shadowRootQuerySelector};
|
|
1
|
+
var e=function(){return e=Object.assign||function(e){for(var n,t=1,r=arguments.length;t<r;t++)for(var o in n=arguments[t])Object.prototype.hasOwnProperty.call(n,o)&&(e[o]=n[o]);return e},e.apply(this,arguments)};function n(e,n,t,r){return new(t||(t=Promise))((function(o,u){function a(e){try{l(r.next(e))}catch(e){u(e)}}function c(e){try{l(r.throw(e))}catch(e){u(e)}}function l(e){var n;e.done?o(e.value):(n=e.value,n instanceof t?n:new t((function(e){e(n)}))).then(a,c)}l((r=r.apply(e,n||[])).next())}))}function t(e,n){var t,r,o,u,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return u={next:c(0),throw:c(1),return:c(2)},"function"==typeof Symbol&&(u[Symbol.iterator]=function(){return this}),u;function c(c){return function(l){return function(c){if(t)throw new TypeError("Generator is already executing.");for(;u&&(u=0,c[0]&&(a=0)),a;)try{if(t=1,r&&(o=2&c[0]?r.return:c[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,c[1])).done)return o;switch(r=0,o&&(c=[2&c[0],o.value]),c[0]){case 0:case 1:o=c;break;case 4:return a.label++,{value:c[1],done:!1};case 5:a.label++,r=c[1],c=[0];continue;case 7:c=a.ops.pop(),a.trys.pop();continue;default:if(!(o=a.trys,(o=o.length>0&&o[o.length-1])||6!==c[0]&&2!==c[0])){a=0;continue}if(3===c[0]&&(!o||c[1]>o[0]&&c[1]<o[3])){a.label=c[1];break}if(6===c[0]&&a.label<o[1]){a.label=o[1],o=c;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(c);break}o[2]&&a.ops.pop(),a.trys.pop();continue}c=n.call(e,a)}catch(e){c=[6,e],r=0}finally{t=o=0}if(5&c[0])throw c[1];return{value:c[0]?c[1]:void 0,done:!0}}([c,l])}}}function r(e,n,t){if(t||2===arguments.length)for(var r,o=0,u=n.length;o<u;o++)!r&&o in n||(r||(r=Array.prototype.slice.call(n,0,o)),r[o]=n[o]);return e.concat(r||Array.prototype.slice.call(n))}"function"==typeof SuppressedError&&SuppressedError;var o="$",u=":host",a="invalid selector",c=10,l=10,i=function(e){var n,t=e[0],r=e[1];return(n=t)&&(n instanceof Document||n instanceof Element)&&"string"==typeof r};function s(e,n){return function(e){return e.split(",").map((function(e){return e.trim()}))}(e).map((function(e){var t=function(e){return e.split(o).map((function(e){return e.trim()}))}(e);return n(t)}))}function f(e,n,t,r,o){return void 0===o&&(o=!1),new Promise((function(u){var c=0,l=function(){var i=o?e.querySelectorAll(n):e.querySelector(n);o&&i.length||!o&&null!==i?u(i):++c<t?setTimeout(l,r):u(o?document.querySelectorAll(a):null)};l()}))}function h(e,n,t){return new Promise((function(r){var o=0,u=function(){var a=e.shadowRoot;a?r(a):++o<n?setTimeout(u,t):r(null)};u()}))}function d(e,n){var t=n?" If you want to select a shadowRoot, use ".concat(n," instead."):"";return"".concat(e," cannot be used with a selector ending in a shadowRoot (").concat(o,").").concat(t)}function y(e,n){return"".concat(e," must be used with a selector ending in a shadowRoot (").concat(o,"). If you don't want to select a shadowRoot, use ").concat(n," instead.")}function v(e){return e instanceof Promise?e:Promise.resolve(e)}function w(){return"You can not select a shadowRoot (".concat(o,") of the document.")}function p(e,n){for(var t,r,o=null,a=e.length,c=0;c<a;c++){if(0===c)if(e[c].length)o=n.querySelector(e[c]);else{if(n instanceof Document)throw new SyntaxError(w());o=(null===(t=n.shadowRoot)||void 0===t?void 0:t.querySelector(e[++c]))||null}else o=(null===(r=o.shadowRoot)||void 0===r?void 0:r.querySelector("".concat(u," ").concat(e[c])))||null;if(null===o)return null}return o}function m(e,n){var t,o=r([],e,!0),a=o.pop();return o.length?(null===(t=p(o,n).shadowRoot)||void 0===t?void 0:t.querySelectorAll("".concat(u," ").concat(a)))||null:n.querySelectorAll(a)}function g(e,n){if(1===e.length&&!e[0].length){if(n instanceof Document)throw new SyntaxError(w());return n.shadowRoot}var t=p(e,n);return(null==t?void 0:t.shadowRoot)||null}function b(e,r,o,a){return n(this,void 0,void 0,(function(){var n,c,l,i,s,d;return t(this,(function(t){switch(t.label){case 0:n=null,c=e.length,l=0,t.label=1;case 1:if(!(l<c))return[3,15];if(0!==l)return[3,8];if(e[l].length)return[3,5];if(r instanceof Document)throw new SyntaxError(w());return r.shadowRoot?[4,f(r.shadowRoot,e[++l],o,a)]:[3,3];case 2:return i=t.sent(),[3,4];case 3:i=null,t.label=4;case 4:return n=i,[3,7];case 5:return[4,f(r,e[l],o,a)];case 6:n=t.sent(),t.label=7;case 7:return[3,13];case 8:return[4,h(n,o,a)];case 9:return(s=t.sent())?[4,f(s,"".concat(u," ").concat(e[l]),o,a)]:[3,11];case 10:return d=t.sent(),[3,12];case 11:d=null,t.label=12;case 12:n=d,t.label=13;case 13:if(null===n)return[2,null];t.label=14;case 14:return l++,[3,1];case 15:return[2,n]}}))}))}function S(e,o,a,c){return n(this,void 0,void 0,(function(){var n,l,i,s,d,y;return t(this,(function(t){switch(t.label){case 0:return n=r([],e,!0),l=n.pop(),n.length?[3,2]:[4,f(o,l,a,c,!0)];case 1:return[2,t.sent()];case 2:return[4,b(n,o,a,c)];case 3:return(i=t.sent())?[4,h(i,a,c)]:[3,5];case 4:return d=t.sent(),[3,6];case 5:d=null,t.label=6;case 6:return(s=d)?[4,f(s,"".concat(u," ").concat(l),a,c,!0)]:[3,8];case 7:return y=t.sent(),[3,9];case 8:y=null,t.label=9;case 9:return[2,y]}}))}))}function P(e,r,o,u){return n(this,void 0,void 0,(function(){var n,a;return t(this,(function(t){switch(t.label){case 0:if(1===e.length&&!e[0].length){if(r instanceof Document)throw new SyntaxError(w());return[2,h(r,o,u)]}return[4,b(e,r,o,u)];case 1:return(n=t.sent())?[4,h(n,o,u)]:[3,3];case 2:return a=t.sent(),[3,4];case 3:a=null,t.label=4;case 4:return[2,a]}}))}))}function _(e,n){for(var t=s(e,(function(e){if(!e[e.length-1].length)throw new SyntaxError(d("querySelector","shadowRootQuerySelector"));return e})),r=t.length,o=0;o<r;o++){var u=p(t[o],n);if(u)return u}return null}function R(e,n){for(var t=s(e,(function(e){if(!e[e.length-1].length)throw new SyntaxError(d("querySelectorAll"));return e})),r=t.length,o=0;o<r;o++){var u=m(t[o],n);if(null==u?void 0:u.length)return u}return document.querySelectorAll(a)}function q(e,n){for(var t=s(e,(function(e){if(e.pop().length)throw new SyntaxError(y("shadowRootQuerySelector","querySelector"));return e})),r=t.length,o=0;o<r;o++){var u=g(t[o],n);if(u)return u}return null}function x(e,r,o,u){return n(this,void 0,void 0,(function(){var n,a,c,l;return t(this,(function(t){switch(t.label){case 0:n=s(e,(function(e){if(!e[e.length-1].length)throw new SyntaxError(d("asyncQuerySelector","asyncShadowRootQuerySelector"));return e})),a=n.length,c=0,t.label=1;case 1:return c<a?[4,b(n[c],r,o,u)]:[3,4];case 2:if(l=t.sent())return[2,l];t.label=3;case 3:return c++,[3,1];case 4:return[2,null]}}))}))}function E(e,r,o,u){return n(this,void 0,void 0,(function(){var n,c,l,i;return t(this,(function(t){switch(t.label){case 0:n=s(e,(function(e){if(!e[e.length-1].length)throw new SyntaxError(d("asyncQuerySelectorAll"));return e})),c=n.length,l=0,t.label=1;case 1:return l<c?[4,S(n[l],r,o,u)]:[3,4];case 2:if(null==(i=t.sent())?void 0:i.length)return[2,i];t.label=3;case 3:return l++,[3,1];case 4:return[2,document.querySelectorAll(a)]}}))}))}function A(e,r,o,u){return n(this,void 0,void 0,(function(){var n,a,c,l;return t(this,(function(t){switch(t.label){case 0:n=s(e,(function(e){if(e.pop().length)throw new SyntaxError(y("asyncShadowRootQuerySelector","asyncQuerySelector"));return e})),a=n.length,c=0,t.label=1;case 1:return c<a?[4,P(n[c],r,o,u)]:[3,4];case 2:if(l=t.sent())return[2,l];t.label=3;case 3:return c++,[3,1];case 4:return[2,null]}}))}))}function N(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];var t=e[0],r=e[1];return"string"==typeof t?_(t,document):_(r,t)}function L(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];var t=e[0],r=e[1];return"string"==typeof t?R(t,document):R(r,t)}function O(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];var t=e[0],r=e[1];return"string"==typeof t?q(t,document):q(r,t)}function Q(){for(var e=[],r=0;r<arguments.length;r++)e[r]=arguments[r];return n(this,void 0,void 0,(function(){var n,r,o,u,a;return t(this,(function(t){switch(t.label){case 0:return i(e)?(n=e[0],r=e[1],o=e[2],[4,x(r,n,(null==o?void 0:o.retries)||c,(null==o?void 0:o.delay)||l)]):[3,2];case 1:case 3:return[2,t.sent()];case 2:return u=e[0],a=e[1],[4,x(u,document,(null==a?void 0:a.retries)||c,(null==a?void 0:a.delay)||l)]}}))}))}function j(){for(var e=[],r=0;r<arguments.length;r++)e[r]=arguments[r];return n(this,void 0,void 0,(function(){var n,r,o,u,a;return t(this,(function(t){switch(t.label){case 0:return i(e)?(n=e[0],r=e[1],o=e[2],[4,E(r,n,(null==o?void 0:o.retries)||c,(null==o?void 0:o.delay)||l)]):[3,2];case 1:return[2,t.sent()];case 2:return u=e[0],a=e[1],[2,E(u,document,(null==a?void 0:a.retries)||c,(null==a?void 0:a.delay)||l)]}}))}))}function D(){for(var e=[],r=0;r<arguments.length;r++)e[r]=arguments[r];return n(this,void 0,void 0,(function(){var n,r,o,u,a;return t(this,(function(t){switch(t.label){case 0:return i(e)?(n=e[0],r=e[1],o=e[2],[4,A(r,n,(null==o?void 0:o.retries)||c,(null==o?void 0:o.delay)||l)]):[3,2];case 1:return[2,t.sent()];case 2:return u=e[0],a=e[1],[2,A(u,document,(null==a?void 0:a.retries)||c,(null==a?void 0:a.delay)||l)]}}))}))}var k=function(){function r(n,t){n instanceof Node||n instanceof Promise?(this._element=n,this._asyncParams=e({retries:c,delay:l},t||{})):(this._element=document,this._asyncParams=e({retries:c,delay:l},n||{}))}return Object.defineProperty(r.prototype,"element",{get:function(){return v(this._element).then((function(e){return e instanceof NodeList?e[0]||null:e}))},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,o,{get:function(){var e=this;return new r(v(this._element).then((function(n){return n instanceof Document||n instanceof ShadowRoot||null===n||n instanceof NodeList&&0===n.length?null:n instanceof NodeList?h(n[0],e._asyncParams.retries,e._asyncParams.delay):h(n,e._asyncParams.retries,e._asyncParams.delay)})),this._asyncParams)},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"all",{get:function(){return v(this._element).then((function(e){return e instanceof NodeList?e:document.querySelectorAll(a)}))},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"asyncParams",{get:function(){return this._asyncParams},enumerable:!1,configurable:!0}),r.prototype.eq=function(e){return n(this,void 0,void 0,(function(){return t(this,(function(n){return[2,v(this._element).then((function(n){return n instanceof NodeList&&n[e]||null}))]}))}))},r.prototype.query=function(e){var n=this;return new r(v(this._element).then((function(t){return null===t||t instanceof NodeList&&0===t.length?null:t instanceof NodeList?f(t[0],e,n._asyncParams.retries,n._asyncParams.delay,!0):f(t,e,n._asyncParams.retries,n._asyncParams.delay,!0)})),this._asyncParams)},r}();export{k as AsyncSelector,Q as asyncQuerySelector,j as asyncQuerySelectorAll,D as asyncShadowRootQuerySelector,N as querySelector,L as querySelectorAll,O as shadowRootQuerySelector};
|
package/dist/index.d.ts
CHANGED
|
@@ -16,9 +16,10 @@ declare function asyncQuerySelectorAll<E extends Element = Element>(selectors: s
|
|
|
16
16
|
declare function asyncShadowRootQuerySelector(root: Document | Element, selectors: string, asyncParams?: AsyncParams): Promise<ShadowRoot | null>;
|
|
17
17
|
declare function asyncShadowRootQuerySelector(selectors: string, asyncParams?: AsyncParams): Promise<ShadowRoot | null>;
|
|
18
18
|
declare class AsyncSelector<T extends Document | Element | ShadowRoot> {
|
|
19
|
-
#private;
|
|
20
19
|
constructor(asyncParams?: AsyncParams);
|
|
21
20
|
constructor(root?: T | Promise<T | NodeListOf<Element>>, asyncParams?: AsyncParams);
|
|
21
|
+
private _element;
|
|
22
|
+
private _asyncParams;
|
|
22
23
|
get element(): Promise<T | null>;
|
|
23
24
|
get [SHADOW_ROOT_SELECTOR](): AsyncSelector<ShadowRoot>;
|
|
24
25
|
get all(): Promise<NodeListOf<Element>>;
|
package/dist/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports):"function"==typeof define&&define.amd?define(["exports"],e):e((t="undefined"!=typeof globalThis?globalThis:t||self).ShadowDomSelector={})}(this,(function(t){"use strict";function e(t,e,n,o){return new(n||(n=Promise))((function(r,i){function l(t){try{s(o.next(t))}catch(t){i(t)}}function u(t){try{s(o.throw(t))}catch(t){i(t)}}function s(t){var e;t.done?r(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(l,u)}s((o=o.apply(t,e||[])).next())}))}function n(t,e,n,o){if("a"===n&&!o)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof e?t!==e||!o:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===n?o:"a"===n?o.call(t):o?o.value:e.get(t)}function o(t,e,n,o,r){if("m"===o)throw new TypeError("Private method is not writable");if("a"===o&&!r)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof e?t!==e||!r:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===o?r.call(t,n):r?r.value=n:e.set(t,n),n}"function"==typeof SuppressedError&&SuppressedError;const r="$",i=":host",l="invalid selector",u=10,s=10,c=t=>{const[e,n]=t;return(o=e)&&(o instanceof Document||o instanceof Element)&&"string"==typeof n;var o};function f(t,e){return function(t){return t.split(",").map((t=>t.trim()))}(t).map((t=>{const n=function(t){return t.split(r).map((t=>t.trim()))}(t);return e(n)}))}function d(t,e,n,o,r=!1){return new Promise((i=>{let u=0;const s=()=>{const c=r?t.querySelectorAll(e):t.querySelector(e);r&&c.length||!r&&null!==c?i(c):(u++,u<n?setTimeout(s,o):i(r?document.querySelectorAll(l):null))};s()}))}function a(t,e,n){return new Promise((o=>{let r=0;const i=()=>{const l=t.shadowRoot;l?o(l):(r++,r<e?setTimeout(i,n):o(null))};i()}))}function h(t,e){return`${t} cannot be used with a selector ending in a shadowRoot (${r}).${e?` If you want to select a shadowRoot, use ${e} instead.`:""}`}function y(t,e){return`${t} must be used with a selector ending in a shadowRoot (${r}). If you don't want to select a shadowRoot, use ${e} instead.`}function w(t){return t instanceof Promise?t:Promise.resolve(t)}function v(){return`You can not select a shadowRoot (${r}) of the document.`}function g(t,e){var n,o;let r=null;const l=t.length;for(let u=0;u<l;u++){if(0===u)if(t[u].length)r=e.querySelector(t[u]);else{if(e instanceof Document)throw new SyntaxError(v());r=(null===(n=e.shadowRoot)||void 0===n?void 0:n.querySelector(t[++u]))||null}else r=(null===(o=r.shadowRoot)||void 0===o?void 0:o.querySelector(`${i} ${t[u]}`))||null;if(null===r)return null}return r}function m(t,e){var n;const o=[...t],r=o.pop();if(!o.length)return e.querySelectorAll(r);return(null===(n=g(o,e).shadowRoot)||void 0===n?void 0:n.querySelectorAll(`${i} ${r}`))||null}function S(t,e){if(1===t.length&&!t[0].length){if(e instanceof Document)throw new SyntaxError(v());return e.shadowRoot}const n=g(t,e);return(null==n?void 0:n.shadowRoot)||null}function p(t,n,o,r){return e(this,void 0,void 0,(function*(){let e=null;const l=t.length;for(let u=0;u<l;u++){if(0===u)if(t[u].length)e=yield d(n,t[u],o,r);else{if(n instanceof Document)throw new SyntaxError(v());e=n.shadowRoot?yield d(n.shadowRoot,t[++u],o,r):null}else{const n=yield a(e,o,r);e=n?yield d(n,`${i} ${t[u]}`,o,r):null}if(null===e)return null}return e}))}function R(t,n,o,r){return e(this,void 0,void 0,(function*(){const e=[...t],l=e.pop();if(!e.length)return yield d(n,l,o,r,!0);const u=yield p(e,n,o,r),s=u?yield a(u,o,r):null;return s?yield d(s,`${i} ${l}`,o,r,!0):null}))}function q(t,n,o,r){return e(this,void 0,void 0,(function*(){if(1===t.length&&!t[0].length){if(n instanceof Document)throw new SyntaxError(v());return a(n,o,r)}const e=yield p(t,n,o,r);return e?yield a(e,o,r):null}))}function E(t,e){const n=f(t,(t=>{if(!t[t.length-1].length)throw new SyntaxError(h("querySelector","shadowRootQuerySelector"));return t})),o=n.length;for(let t=0;t<o;t++){const o=g(n[t],e);if(o)return o}return null}function $(t,e){const n=f(t,(t=>{if(!t[t.length-1].length)throw new SyntaxError(h("querySelectorAll"));return t})),o=n.length;for(let t=0;t<o;t++){const o=m(n[t],e);if(null==o?void 0:o.length)return o}return document.querySelectorAll(l)}function x(t,e){const n=f(t,(t=>{if(t.pop().length)throw new SyntaxError(y("shadowRootQuerySelector","querySelector"));return t})),o=n.length;for(let t=0;t<o;t++){const o=S(n[t],e);if(o)return o}return null}function b(t,n,o,r){return e(this,void 0,void 0,(function*(){const e=f(t,(t=>{if(!t[t.length-1].length)throw new SyntaxError(h("asyncQuerySelector","asyncShadowRootQuerySelector"));return t})),i=e.length;for(let t=0;t<i;t++){const i=yield p(e[t],n,o,r);if(i)return i}return null}))}function A(t,n,o,r){return e(this,void 0,void 0,(function*(){const e=f(t,(t=>{if(!t[t.length-1].length)throw new SyntaxError(h("asyncQuerySelectorAll"));return t})),i=e.length;for(let t=0;t<i;t++){const i=yield R(e[t],n,o,r);if(null==i?void 0:i.length)return i}return document.querySelectorAll(l)}))}function Q(t,n,o,r){return e(this,void 0,void 0,(function*(){const e=f(t,(t=>{if(t.pop().length)throw new SyntaxError(y("asyncShadowRootQuerySelector","asyncQuerySelector"));return t})),i=e.length;for(let t=0;t<i;t++){const i=yield q(e[t],n,o,r);if(i)return i}return null}))}var P,T;class N{constructor(t,e){P.set(this,void 0),T.set(this,void 0),t instanceof Node||t instanceof Promise?(o(this,P,t,"f"),o(this,T,Object.assign({retries:u,delay:s},e||{}),"f")):(o(this,P,document,"f"),o(this,T,Object.assign({retries:u,delay:s},t||{}),"f"))}get element(){return w(n(this,P,"f")).then((t=>t instanceof NodeList?t[0]||null:t))}get[(P=new WeakMap,T=new WeakMap,r)](){const t=w(n(this,P,"f")).then((t=>t instanceof Document||t instanceof ShadowRoot||null===t||t instanceof NodeList&&0===t.length?null:t instanceof NodeList?a(t[0],n(this,T,"f").retries,n(this,T,"f").delay):a(t,n(this,T,"f").retries,n(this,T,"f").delay)));return new N(t,n(this,T,"f"))}get all(){return w(n(this,P,"f")).then((t=>t instanceof NodeList?t:document.querySelectorAll(l)))}get asyncParams(){return n(this,T,"f")}eq(t){return e(this,void 0,void 0,(function*(){return w(n(this,P,"f")).then((e=>e instanceof NodeList&&e[t]||null))}))}query(t){const e=w(n(this,P,"f")).then((e=>null===e||e instanceof NodeList&&0===e.length?null:e instanceof NodeList?d(e[0],t,n(this,T,"f").retries,n(this,T,"f").delay,!0):d(e,t,n(this,T,"f").retries,n(this,T,"f").delay,!0)));return new N(e,n(this,T,"f"))}}t.AsyncSelector=N,t.asyncQuerySelector=function(...t){return e(this,void 0,void 0,(function*(){if(c(t)){const[e,n,o]=t;return yield b(n,e,(null==o?void 0:o.retries)||u,(null==o?void 0:o.delay)||s)}const[e,n]=t;return yield b(e,document,(null==n?void 0:n.retries)||u,(null==n?void 0:n.delay)||s)}))},t.asyncQuerySelectorAll=function(...t){return e(this,void 0,void 0,(function*(){if(c(t)){const[e,n,o]=t;return yield A(n,e,(null==o?void 0:o.retries)||u,(null==o?void 0:o.delay)||s)}const[e,n]=t;return A(e,document,(null==n?void 0:n.retries)||u,(null==n?void 0:n.delay)||s)}))},t.asyncShadowRootQuerySelector=function(...t){return e(this,void 0,void 0,(function*(){if(c(t)){const[e,n,o]=t;return yield Q(n,e,(null==o?void 0:o.retries)||u,(null==o?void 0:o.delay)||s)}const[e,n]=t;return Q(e,document,(null==n?void 0:n.retries)||u,(null==n?void 0:n.delay)||s)}))},t.querySelector=function(...t){const[e,n]=t;return"string"==typeof e?E(e,document):E(n,e)},t.querySelectorAll=function(...t){const[e,n]=t;return"string"==typeof e?$(e,document):$(n,e)},t.shadowRootQuerySelector=function(...t){const[e,n]=t;return"string"==typeof e?x(e,document):x(n,e)}}));
|
|
1
|
+
!function(e,n){"object"==typeof exports&&"undefined"!=typeof module?n(exports):"function"==typeof define&&define.amd?define(["exports"],n):n((e="undefined"!=typeof globalThis?globalThis:e||self).ShadowDomSelector={})}(this,(function(e){"use strict";var n=function(){return n=Object.assign||function(e){for(var n,t=1,r=arguments.length;t<r;t++)for(var o in n=arguments[t])Object.prototype.hasOwnProperty.call(n,o)&&(e[o]=n[o]);return e},n.apply(this,arguments)};function t(e,n,t,r){return new(t||(t=Promise))((function(o,u){function c(e){try{l(r.next(e))}catch(e){u(e)}}function a(e){try{l(r.throw(e))}catch(e){u(e)}}function l(e){var n;e.done?o(e.value):(n=e.value,n instanceof t?n:new t((function(e){e(n)}))).then(c,a)}l((r=r.apply(e,n||[])).next())}))}function r(e,n){var t,r,o,u,c={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return u={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(u[Symbol.iterator]=function(){return this}),u;function a(a){return function(l){return function(a){if(t)throw new TypeError("Generator is already executing.");for(;u&&(u=0,a[0]&&(c=0)),c;)try{if(t=1,r&&(o=2&a[0]?r.return:a[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,a[1])).done)return o;switch(r=0,o&&(a=[2&a[0],o.value]),a[0]){case 0:case 1:o=a;break;case 4:return c.label++,{value:a[1],done:!1};case 5:c.label++,r=a[1],a=[0];continue;case 7:a=c.ops.pop(),c.trys.pop();continue;default:if(!(o=c.trys,(o=o.length>0&&o[o.length-1])||6!==a[0]&&2!==a[0])){c=0;continue}if(3===a[0]&&(!o||a[1]>o[0]&&a[1]<o[3])){c.label=a[1];break}if(6===a[0]&&c.label<o[1]){c.label=o[1],o=a;break}if(o&&c.label<o[2]){c.label=o[2],c.ops.push(a);break}o[2]&&c.ops.pop(),c.trys.pop();continue}a=n.call(e,c)}catch(e){a=[6,e],r=0}finally{t=o=0}if(5&a[0])throw a[1];return{value:a[0]?a[1]:void 0,done:!0}}([a,l])}}}function o(e,n,t){if(t||2===arguments.length)for(var r,o=0,u=n.length;o<u;o++)!r&&o in n||(r||(r=Array.prototype.slice.call(n,0,o)),r[o]=n[o]);return e.concat(r||Array.prototype.slice.call(n))}"function"==typeof SuppressedError&&SuppressedError;var u="$",c=":host",a="invalid selector",l=10,i=10,s=function(e){var n,t=e[0],r=e[1];return(n=t)&&(n instanceof Document||n instanceof Element)&&"string"==typeof r};function f(e,n){return function(e){return e.split(",").map((function(e){return e.trim()}))}(e).map((function(e){var t=function(e){return e.split(u).map((function(e){return e.trim()}))}(e);return n(t)}))}function h(e,n,t,r,o){return void 0===o&&(o=!1),new Promise((function(u){var c=0,l=function(){var i=o?e.querySelectorAll(n):e.querySelector(n);o&&i.length||!o&&null!==i?u(i):++c<t?setTimeout(l,r):u(o?document.querySelectorAll(a):null)};l()}))}function d(e,n,t){return new Promise((function(r){var o=0,u=function(){var c=e.shadowRoot;c?r(c):++o<n?setTimeout(u,t):r(null)};u()}))}function y(e,n){var t=n?" If you want to select a shadowRoot, use ".concat(n," instead."):"";return"".concat(e," cannot be used with a selector ending in a shadowRoot (").concat(u,").").concat(t)}function v(e,n){return"".concat(e," must be used with a selector ending in a shadowRoot (").concat(u,"). If you don't want to select a shadowRoot, use ").concat(n," instead.")}function p(e){return e instanceof Promise?e:Promise.resolve(e)}function w(){return"You can not select a shadowRoot (".concat(u,") of the document.")}function m(e,n){for(var t,r,o=null,u=e.length,a=0;a<u;a++){if(0===a)if(e[a].length)o=n.querySelector(e[a]);else{if(n instanceof Document)throw new SyntaxError(w());o=(null===(t=n.shadowRoot)||void 0===t?void 0:t.querySelector(e[++a]))||null}else o=(null===(r=o.shadowRoot)||void 0===r?void 0:r.querySelector("".concat(c," ").concat(e[a])))||null;if(null===o)return null}return o}function g(e,n){var t,r=o([],e,!0),u=r.pop();return r.length?(null===(t=m(r,n).shadowRoot)||void 0===t?void 0:t.querySelectorAll("".concat(c," ").concat(u)))||null:n.querySelectorAll(u)}function b(e,n){if(1===e.length&&!e[0].length){if(n instanceof Document)throw new SyntaxError(w());return n.shadowRoot}var t=m(e,n);return(null==t?void 0:t.shadowRoot)||null}function S(e,n,o,u){return t(this,void 0,void 0,(function(){var t,a,l,i,s,f;return r(this,(function(r){switch(r.label){case 0:t=null,a=e.length,l=0,r.label=1;case 1:if(!(l<a))return[3,15];if(0!==l)return[3,8];if(e[l].length)return[3,5];if(n instanceof Document)throw new SyntaxError(w());return n.shadowRoot?[4,h(n.shadowRoot,e[++l],o,u)]:[3,3];case 2:return i=r.sent(),[3,4];case 3:i=null,r.label=4;case 4:return t=i,[3,7];case 5:return[4,h(n,e[l],o,u)];case 6:t=r.sent(),r.label=7;case 7:return[3,13];case 8:return[4,d(t,o,u)];case 9:return(s=r.sent())?[4,h(s,"".concat(c," ").concat(e[l]),o,u)]:[3,11];case 10:return f=r.sent(),[3,12];case 11:f=null,r.label=12;case 12:t=f,r.label=13;case 13:if(null===t)return[2,null];r.label=14;case 14:return l++,[3,1];case 15:return[2,t]}}))}))}function P(e,n,u,a){return t(this,void 0,void 0,(function(){var t,l,i,s,f,y;return r(this,(function(r){switch(r.label){case 0:return t=o([],e,!0),l=t.pop(),t.length?[3,2]:[4,h(n,l,u,a,!0)];case 1:return[2,r.sent()];case 2:return[4,S(t,n,u,a)];case 3:return(i=r.sent())?[4,d(i,u,a)]:[3,5];case 4:return f=r.sent(),[3,6];case 5:f=null,r.label=6;case 6:return(s=f)?[4,h(s,"".concat(c," ").concat(l),u,a,!0)]:[3,8];case 7:return y=r.sent(),[3,9];case 8:y=null,r.label=9;case 9:return[2,y]}}))}))}function R(e,n,o,u){return t(this,void 0,void 0,(function(){var t,c;return r(this,(function(r){switch(r.label){case 0:if(1===e.length&&!e[0].length){if(n instanceof Document)throw new SyntaxError(w());return[2,d(n,o,u)]}return[4,S(e,n,o,u)];case 1:return(t=r.sent())?[4,d(t,o,u)]:[3,3];case 2:return c=r.sent(),[3,4];case 3:c=null,r.label=4;case 4:return[2,c]}}))}))}function _(e,n){for(var t=f(e,(function(e){if(!e[e.length-1].length)throw new SyntaxError(y("querySelector","shadowRootQuerySelector"));return e})),r=t.length,o=0;o<r;o++){var u=m(t[o],n);if(u)return u}return null}function q(e,n){for(var t=f(e,(function(e){if(!e[e.length-1].length)throw new SyntaxError(y("querySelectorAll"));return e})),r=t.length,o=0;o<r;o++){var u=g(t[o],n);if(null==u?void 0:u.length)return u}return document.querySelectorAll(a)}function x(e,n){for(var t=f(e,(function(e){if(e.pop().length)throw new SyntaxError(v("shadowRootQuerySelector","querySelector"));return e})),r=t.length,o=0;o<r;o++){var u=b(t[o],n);if(u)return u}return null}function A(e,n,o,u){return t(this,void 0,void 0,(function(){var t,c,a,l;return r(this,(function(r){switch(r.label){case 0:t=f(e,(function(e){if(!e[e.length-1].length)throw new SyntaxError(y("asyncQuerySelector","asyncShadowRootQuerySelector"));return e})),c=t.length,a=0,r.label=1;case 1:return a<c?[4,S(t[a],n,o,u)]:[3,4];case 2:if(l=r.sent())return[2,l];r.label=3;case 3:return a++,[3,1];case 4:return[2,null]}}))}))}function E(e,n,o,u){return t(this,void 0,void 0,(function(){var t,c,l,i;return r(this,(function(r){switch(r.label){case 0:t=f(e,(function(e){if(!e[e.length-1].length)throw new SyntaxError(y("asyncQuerySelectorAll"));return e})),c=t.length,l=0,r.label=1;case 1:return l<c?[4,P(t[l],n,o,u)]:[3,4];case 2:if(null==(i=r.sent())?void 0:i.length)return[2,i];r.label=3;case 3:return l++,[3,1];case 4:return[2,document.querySelectorAll(a)]}}))}))}function Q(e,n,o,u){return t(this,void 0,void 0,(function(){var t,c,a,l;return r(this,(function(r){switch(r.label){case 0:t=f(e,(function(e){if(e.pop().length)throw new SyntaxError(v("asyncShadowRootQuerySelector","asyncQuerySelector"));return e})),c=t.length,a=0,r.label=1;case 1:return a<c?[4,R(t[a],n,o,u)]:[3,4];case 2:if(l=r.sent())return[2,l];r.label=3;case 3:return a++,[3,1];case 4:return[2,null]}}))}))}var N=function(){function e(e,t){e instanceof Node||e instanceof Promise?(this._element=e,this._asyncParams=n({retries:l,delay:i},t||{})):(this._element=document,this._asyncParams=n({retries:l,delay:i},e||{}))}return Object.defineProperty(e.prototype,"element",{get:function(){return p(this._element).then((function(e){return e instanceof NodeList?e[0]||null:e}))},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,u,{get:function(){var n=this;return new e(p(this._element).then((function(e){return e instanceof Document||e instanceof ShadowRoot||null===e||e instanceof NodeList&&0===e.length?null:e instanceof NodeList?d(e[0],n._asyncParams.retries,n._asyncParams.delay):d(e,n._asyncParams.retries,n._asyncParams.delay)})),this._asyncParams)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"all",{get:function(){return p(this._element).then((function(e){return e instanceof NodeList?e:document.querySelectorAll(a)}))},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"asyncParams",{get:function(){return this._asyncParams},enumerable:!1,configurable:!0}),e.prototype.eq=function(e){return t(this,void 0,void 0,(function(){return r(this,(function(n){return[2,p(this._element).then((function(n){return n instanceof NodeList&&n[e]||null}))]}))}))},e.prototype.query=function(n){var t=this;return new e(p(this._element).then((function(e){return null===e||e instanceof NodeList&&0===e.length?null:e instanceof NodeList?h(e[0],n,t._asyncParams.retries,t._asyncParams.delay,!0):h(e,n,t._asyncParams.retries,t._asyncParams.delay,!0)})),this._asyncParams)},e}();e.AsyncSelector=N,e.asyncQuerySelector=function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];return t(this,void 0,void 0,(function(){var n,t,o,u,c;return r(this,(function(r){switch(r.label){case 0:return s(e)?(n=e[0],t=e[1],o=e[2],[4,A(t,n,(null==o?void 0:o.retries)||l,(null==o?void 0:o.delay)||i)]):[3,2];case 1:case 3:return[2,r.sent()];case 2:return u=e[0],c=e[1],[4,A(u,document,(null==c?void 0:c.retries)||l,(null==c?void 0:c.delay)||i)]}}))}))},e.asyncQuerySelectorAll=function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];return t(this,void 0,void 0,(function(){var n,t,o,u,c;return r(this,(function(r){switch(r.label){case 0:return s(e)?(n=e[0],t=e[1],o=e[2],[4,E(t,n,(null==o?void 0:o.retries)||l,(null==o?void 0:o.delay)||i)]):[3,2];case 1:return[2,r.sent()];case 2:return u=e[0],c=e[1],[2,E(u,document,(null==c?void 0:c.retries)||l,(null==c?void 0:c.delay)||i)]}}))}))},e.asyncShadowRootQuerySelector=function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];return t(this,void 0,void 0,(function(){var n,t,o,u,c;return r(this,(function(r){switch(r.label){case 0:return s(e)?(n=e[0],t=e[1],o=e[2],[4,Q(t,n,(null==o?void 0:o.retries)||l,(null==o?void 0:o.delay)||i)]):[3,2];case 1:return[2,r.sent()];case 2:return u=e[0],c=e[1],[2,Q(u,document,(null==c?void 0:c.retries)||l,(null==c?void 0:c.delay)||i)]}}))}))},e.querySelector=function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];var t=e[0],r=e[1];return"string"==typeof t?_(t,document):_(r,t)},e.querySelectorAll=function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];var t=e[0],r=e[1];return"string"==typeof t?q(t,document):q(r,t)},e.shadowRootQuerySelector=function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];var t=e[0],r=e[1];return"string"==typeof t?x(t,document):x(r,t)}}));
|
package/package.json
CHANGED