1
0
mirror of https://github.com/jaandrle/deka-dom-el synced 2025-04-05 13:15:53 +02:00

🐛 Node in enviroment

This commit is contained in:
Jan Andrle 2025-03-10 16:35:09 +01:00
parent ee7fe43369
commit bc2398a005
Signed by: jaandrle
GPG Key ID: B3A25AED155AFFAB
11 changed files with 23 additions and 19 deletions

View File

@ -91,6 +91,7 @@ var enviroment = {
setDeleteAttr,
ssr: "",
D: globalThis.document,
N: globalThis.Node,
F: globalThis.DocumentFragment,
H: globalThis.HTMLElement,
S: globalThis.SVGElement,
@ -231,9 +232,9 @@ function connectionsChangesObserverConstructor() {
if (store.size > 30)
await requestIdle();
const out = [];
if (!isInstance(element, Node)) return out;
if (!isInstance(element, enviroment.N)) return out;
for (const el of store.keys()) {
if (el === element || !isInstance(el, Node)) continue;
if (el === element || !isInstance(el, enviroment.N)) continue;
if (element.contains(el))
out.push(el);
}

File diff suppressed because one or more lines are too long

5
dist/esm.js vendored
View File

@ -58,6 +58,7 @@ var enviroment = {
setDeleteAttr,
ssr: "",
D: globalThis.document,
N: globalThis.Node,
F: globalThis.DocumentFragment,
H: globalThis.HTMLElement,
S: globalThis.SVGElement,
@ -198,9 +199,9 @@ function connectionsChangesObserverConstructor() {
if (store.size > 30)
await requestIdle();
const out = [];
if (!isInstance(element, Node)) return out;
if (!isInstance(element, enviroment.N)) return out;
for (const el of store.keys()) {
if (el === element || !isInstance(el, Node)) continue;
if (el === element || !isInstance(el, enviroment.N)) continue;
if (element.contains(el))
out.push(el);
}

2
dist/esm.min.js vendored

File diff suppressed because one or more lines are too long

View File

@ -136,6 +136,7 @@ var DDE = (() => {
setDeleteAttr,
ssr: "",
D: globalThis.document,
N: globalThis.Node,
F: globalThis.DocumentFragment,
H: globalThis.HTMLElement,
S: globalThis.SVGElement,
@ -276,9 +277,9 @@ var DDE = (() => {
if (store.size > 30)
await requestIdle();
const out = [];
if (!isInstance(element, Node)) return out;
if (!isInstance(element, enviroment.N)) return out;
for (const el of store.keys()) {
if (el === element || !isInstance(el, Node)) continue;
if (el === element || !isInstance(el, enviroment.N)) continue;
if (element.contains(el))
out.push(el);
}

File diff suppressed because one or more lines are too long

5
dist/iife.js vendored
View File

@ -100,6 +100,7 @@ var DDE = (() => {
setDeleteAttr,
ssr: "",
D: globalThis.document,
N: globalThis.Node,
F: globalThis.DocumentFragment,
H: globalThis.HTMLElement,
S: globalThis.SVGElement,
@ -240,9 +241,9 @@ var DDE = (() => {
if (store.size > 30)
await requestIdle();
const out = [];
if (!isInstance(element, Node)) return out;
if (!isInstance(element, enviroment.N)) return out;
for (const el of store.keys()) {
if (el === element || !isInstance(el, Node)) continue;
if (el === element || !isInstance(el, enviroment.N)) continue;
if (element.contains(el))
out.push(el);
}

2
dist/iife.min.js vendored

File diff suppressed because one or more lines are too long

View File

@ -1,4 +1,3 @@
//TODO: https://www.npmjs.com/package/html-element
import { enviroment as env } from './src/dom-common.js';
env.ssr= " ssr";
@ -17,7 +16,7 @@ env.setDeleteAttr= function(obj, prop, value){
if(value) return obj.setAttribute(prop, "");
obj.removeAttribute(prop);
};
const keys= { H: "HTMLElement", S: "SVGElement", F: "DocumentFragment", D: "document" };
const keys= { N: "Node", H: "HTMLElement", S: "SVGElement", F: "DocumentFragment", D: "document", M: "MutationObserver" };
let env_bk= {};
let dom_last;

View File

@ -14,6 +14,7 @@ export const enviroment= {
setDeleteAttr,
ssr: "",
D: globalThis.document,
N: globalThis.Node,
F: globalThis.DocumentFragment,
H: globalThis.HTMLElement,
S: globalThis.SVGElement,

View File

@ -167,9 +167,9 @@ function connectionsChangesObserverConstructor(){
if(store.size > 30)//TODO?: limit
await requestIdle();
const out= [];
if(!isInstance(element, Node)) return out;
if(!isInstance(element, env.N)) return out;
for(const el of store.keys()){
if(el===element || !isInstance(el, Node)) continue;
if(el===element || !isInstance(el, env.N)) continue;
if(element.contains(el))
out.push(el);
}