@anoki/fse-ui
Version:
FSE UI components library
137 lines (136 loc) • 2.27 kB
JavaScript
function r(e) {
return e !== null && typeof e == "object" && "constructor" in e && e.constructor === Object;
}
function o(e, n) {
e === void 0 && (e = {}), n === void 0 && (n = {});
const u = ["__proto__", "constructor", "prototype"];
Object.keys(n).filter((t) => u.indexOf(t) < 0).forEach((t) => {
typeof e[t] > "u" ? e[t] = n[t] : r(n[t]) && r(e[t]) && Object.keys(n[t]).length > 0 && o(e[t], n[t]);
});
}
const i = {
body: {},
addEventListener() {
},
removeEventListener() {
},
activeElement: {
blur() {
},
nodeName: ""
},
querySelector() {
return null;
},
querySelectorAll() {
return [];
},
getElementById() {
return null;
},
createEvent() {
return {
initEvent() {
}
};
},
createElement() {
return {
children: [],
childNodes: [],
style: {},
setAttribute() {
},
getElementsByTagName() {
return [];
}
};
},
createElementNS() {
return {};
},
importNode() {
return null;
},
location: {
hash: "",
host: "",
hostname: "",
href: "",
origin: "",
pathname: "",
protocol: "",
search: ""
}
};
function s() {
const e = typeof document < "u" ? document : {};
return o(e, i), e;
}
const c = {
document: i,
navigator: {
userAgent: ""
},
location: {
hash: "",
host: "",
hostname: "",
href: "",
origin: "",
pathname: "",
protocol: "",
search: ""
},
history: {
replaceState() {
},
pushState() {
},
go() {
},
back() {
}
},
CustomEvent: function() {
return this;
},
addEventListener() {
},
removeEventListener() {
},
getComputedStyle() {
return {
getPropertyValue() {
return "";
}
};
},
Image() {
},
Date() {
},
screen: {},
setTimeout() {
},
clearTimeout() {
},
matchMedia() {
return {};
},
requestAnimationFrame(e) {
return typeof setTimeout > "u" ? (e(), null) : setTimeout(e, 0);
},
cancelAnimationFrame(e) {
typeof setTimeout > "u" || clearTimeout(e);
}
};
function a() {
const e = typeof window < "u" ? window : {};
return o(e, c), e;
}
export {
a,
s as g
};
//# sourceMappingURL=index.es567.js.map