Clear Code, small organized
All checks were successful
Deploy Docs to Synology / deploy (push) Successful in 3s
All checks were successful
Deploy Docs to Synology / deploy (push) Successful in 3s
This commit is contained in:
17
dist/sigpro.esm.js
vendored
17
dist/sigpro.esm.js
vendored
@@ -12,6 +12,9 @@ var effectQueue = new Set;
|
|||||||
var proxyCache = new WeakMap;
|
var proxyCache = new WeakMap;
|
||||||
var ITER = Symbol("iter");
|
var ITER = Symbol("iter");
|
||||||
var MOUNTED_NODES = new WeakMap;
|
var MOUNTED_NODES = new WeakMap;
|
||||||
|
var SVG_NS = "http://www.w3.org/2000/svg";
|
||||||
|
var XLINK_NS = "http://www.w3.org/1999/xlink";
|
||||||
|
var SVG_TAGS = new Set("svg,path,circle,rect,line,polyline,polygon,g,defs,text,textPath,tspan,use,symbol,image,marker,ellipse".split(","));
|
||||||
var dispose = (eff) => {
|
var dispose = (eff) => {
|
||||||
if (!eff || eff._disposed)
|
if (!eff || eff._disposed)
|
||||||
return;
|
return;
|
||||||
@@ -149,9 +152,6 @@ var $ = (val, key = null) => {
|
|||||||
computed._dirty = true;
|
computed._dirty = true;
|
||||||
computed._deps = null;
|
computed._deps = null;
|
||||||
computed._disposed = false;
|
computed._disposed = false;
|
||||||
computed.stop = () => {};
|
|
||||||
if (activeOwner)
|
|
||||||
onUnmount(computed.stop);
|
|
||||||
return computed;
|
return computed;
|
||||||
}
|
}
|
||||||
if (key)
|
if (key)
|
||||||
@@ -287,12 +287,10 @@ var h = (tag, props = {}, children = []) => {
|
|||||||
isArr(node) ? node.forEach(attach) : attach(node);
|
isArr(node) ? node.forEach(attach) : attach(node);
|
||||||
return node;
|
return node;
|
||||||
}
|
}
|
||||||
const isSVG = /^(svg|path|circle|rect|line|poly(line|gon)|g|defs|text(path)?|tspan|use|symbol|image|marker|ellipse)$/i.test(tag);
|
const isSVG = SVG_TAGS.has(tag);
|
||||||
const el = isSVG ? doc.createElementNS("http://www.w3.org/2000/svg", tag) : doc.createElement(tag);
|
const el = isSVG ? doc.createElementNS(SVG_NS, tag) : doc.createElement(tag);
|
||||||
el._cleanups = new Set;
|
el._cleanups = new Set;
|
||||||
for (let k in props) {
|
for (const k of Object.keys(props)) {
|
||||||
if (!props.hasOwnProperty(k))
|
|
||||||
continue;
|
|
||||||
let v = props[k];
|
let v = props[k];
|
||||||
if (k === "ref") {
|
if (k === "ref") {
|
||||||
isFunc(v) ? v(el) : v.current = el;
|
isFunc(v) ? v(el) : v.current = el;
|
||||||
@@ -300,8 +298,7 @@ var h = (tag, props = {}, children = []) => {
|
|||||||
}
|
}
|
||||||
if (isSVG && k.startsWith("xlink:")) {
|
if (isSVG && k.startsWith("xlink:")) {
|
||||||
const cleanVal = validateAttr(k.slice(6), v);
|
const cleanVal = validateAttr(k.slice(6), v);
|
||||||
let lnk = "http://www.w3.org/1999/xlink";
|
cleanVal == null ? el.removeAttributeNS(XLINK_NS, k.slice(6)) : el.setAttributeNS(XLINK_NS, k.slice(6), cleanVal);
|
||||||
cleanVal == null ? el.removeAttributeNS(lnk, k.slice(6)) : el.setAttributeNS(lnk, k.slice(6), cleanVal);
|
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
if (k.startsWith("on")) {
|
if (k.startsWith("on")) {
|
||||||
|
|||||||
2
dist/sigpro.esm.min.js
vendored
2
dist/sigpro.esm.min.js
vendored
File diff suppressed because one or more lines are too long
17
dist/sigpro.js
vendored
17
dist/sigpro.js
vendored
@@ -68,6 +68,9 @@
|
|||||||
var proxyCache = new WeakMap;
|
var proxyCache = new WeakMap;
|
||||||
var ITER = Symbol("iter");
|
var ITER = Symbol("iter");
|
||||||
var MOUNTED_NODES = new WeakMap;
|
var MOUNTED_NODES = new WeakMap;
|
||||||
|
var SVG_NS = "http://www.w3.org/2000/svg";
|
||||||
|
var XLINK_NS = "http://www.w3.org/1999/xlink";
|
||||||
|
var SVG_TAGS = new Set("svg,path,circle,rect,line,polyline,polygon,g,defs,text,textPath,tspan,use,symbol,image,marker,ellipse".split(","));
|
||||||
var dispose = (eff) => {
|
var dispose = (eff) => {
|
||||||
if (!eff || eff._disposed)
|
if (!eff || eff._disposed)
|
||||||
return;
|
return;
|
||||||
@@ -205,9 +208,6 @@
|
|||||||
computed._dirty = true;
|
computed._dirty = true;
|
||||||
computed._deps = null;
|
computed._deps = null;
|
||||||
computed._disposed = false;
|
computed._disposed = false;
|
||||||
computed.stop = () => {};
|
|
||||||
if (activeOwner)
|
|
||||||
onUnmount(computed.stop);
|
|
||||||
return computed;
|
return computed;
|
||||||
}
|
}
|
||||||
if (key)
|
if (key)
|
||||||
@@ -343,12 +343,10 @@
|
|||||||
isArr(node) ? node.forEach(attach) : attach(node);
|
isArr(node) ? node.forEach(attach) : attach(node);
|
||||||
return node;
|
return node;
|
||||||
}
|
}
|
||||||
const isSVG = /^(svg|path|circle|rect|line|poly(line|gon)|g|defs|text(path)?|tspan|use|symbol|image|marker|ellipse)$/i.test(tag);
|
const isSVG = SVG_TAGS.has(tag);
|
||||||
const el = isSVG ? doc.createElementNS("http://www.w3.org/2000/svg", tag) : doc.createElement(tag);
|
const el = isSVG ? doc.createElementNS(SVG_NS, tag) : doc.createElement(tag);
|
||||||
el._cleanups = new Set;
|
el._cleanups = new Set;
|
||||||
for (let k in props) {
|
for (const k of Object.keys(props)) {
|
||||||
if (!props.hasOwnProperty(k))
|
|
||||||
continue;
|
|
||||||
let v = props[k];
|
let v = props[k];
|
||||||
if (k === "ref") {
|
if (k === "ref") {
|
||||||
isFunc(v) ? v(el) : v.current = el;
|
isFunc(v) ? v(el) : v.current = el;
|
||||||
@@ -356,8 +354,7 @@
|
|||||||
}
|
}
|
||||||
if (isSVG && k.startsWith("xlink:")) {
|
if (isSVG && k.startsWith("xlink:")) {
|
||||||
const cleanVal = validateAttr(k.slice(6), v);
|
const cleanVal = validateAttr(k.slice(6), v);
|
||||||
let lnk = "http://www.w3.org/1999/xlink";
|
cleanVal == null ? el.removeAttributeNS(XLINK_NS, k.slice(6)) : el.setAttributeNS(XLINK_NS, k.slice(6), cleanVal);
|
||||||
cleanVal == null ? el.removeAttributeNS(lnk, k.slice(6)) : el.setAttributeNS(lnk, k.slice(6), cleanVal);
|
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
if (k.startsWith("on")) {
|
if (k.startsWith("on")) {
|
||||||
|
|||||||
2
dist/sigpro.min.js
vendored
2
dist/sigpro.min.js
vendored
File diff suppressed because one or more lines are too long
@@ -68,6 +68,9 @@
|
|||||||
var proxyCache = new WeakMap;
|
var proxyCache = new WeakMap;
|
||||||
var ITER = Symbol("iter");
|
var ITER = Symbol("iter");
|
||||||
var MOUNTED_NODES = new WeakMap;
|
var MOUNTED_NODES = new WeakMap;
|
||||||
|
var SVG_NS = "http://www.w3.org/2000/svg";
|
||||||
|
var XLINK_NS = "http://www.w3.org/1999/xlink";
|
||||||
|
var SVG_TAGS = new Set("svg,path,circle,rect,line,polyline,polygon,g,defs,text,textPath,tspan,use,symbol,image,marker,ellipse".split(","));
|
||||||
var dispose = (eff) => {
|
var dispose = (eff) => {
|
||||||
if (!eff || eff._disposed)
|
if (!eff || eff._disposed)
|
||||||
return;
|
return;
|
||||||
@@ -205,9 +208,6 @@
|
|||||||
computed._dirty = true;
|
computed._dirty = true;
|
||||||
computed._deps = null;
|
computed._deps = null;
|
||||||
computed._disposed = false;
|
computed._disposed = false;
|
||||||
computed.stop = () => {};
|
|
||||||
if (activeOwner)
|
|
||||||
onUnmount(computed.stop);
|
|
||||||
return computed;
|
return computed;
|
||||||
}
|
}
|
||||||
if (key)
|
if (key)
|
||||||
@@ -343,12 +343,10 @@
|
|||||||
isArr(node) ? node.forEach(attach) : attach(node);
|
isArr(node) ? node.forEach(attach) : attach(node);
|
||||||
return node;
|
return node;
|
||||||
}
|
}
|
||||||
const isSVG = /^(svg|path|circle|rect|line|poly(line|gon)|g|defs|text(path)?|tspan|use|symbol|image|marker|ellipse)$/i.test(tag);
|
const isSVG = SVG_TAGS.has(tag);
|
||||||
const el = isSVG ? doc.createElementNS("http://www.w3.org/2000/svg", tag) : doc.createElement(tag);
|
const el = isSVG ? doc.createElementNS(SVG_NS, tag) : doc.createElement(tag);
|
||||||
el._cleanups = new Set;
|
el._cleanups = new Set;
|
||||||
for (let k in props) {
|
for (const k of Object.keys(props)) {
|
||||||
if (!props.hasOwnProperty(k))
|
|
||||||
continue;
|
|
||||||
let v = props[k];
|
let v = props[k];
|
||||||
if (k === "ref") {
|
if (k === "ref") {
|
||||||
isFunc(v) ? v(el) : v.current = el;
|
isFunc(v) ? v(el) : v.current = el;
|
||||||
@@ -356,8 +354,7 @@
|
|||||||
}
|
}
|
||||||
if (isSVG && k.startsWith("xlink:")) {
|
if (isSVG && k.startsWith("xlink:")) {
|
||||||
const cleanVal = validateAttr(k.slice(6), v);
|
const cleanVal = validateAttr(k.slice(6), v);
|
||||||
let lnk = "http://www.w3.org/1999/xlink";
|
cleanVal == null ? el.removeAttributeNS(XLINK_NS, k.slice(6)) : el.setAttributeNS(XLINK_NS, k.slice(6), cleanVal);
|
||||||
cleanVal == null ? el.removeAttributeNS(lnk, k.slice(6)) : el.setAttributeNS(lnk, k.slice(6), cleanVal);
|
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
if (k.startsWith("on")) {
|
if (k.startsWith("on")) {
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "sigpro",
|
"name": "sigpro",
|
||||||
"version": "1.2.21",
|
"version": "1.2.22",
|
||||||
"type": "module",
|
"type": "module",
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"main": "./dist/sigpro.esm.min.js",
|
"main": "./dist/sigpro.esm.min.js",
|
||||||
|
|||||||
27
sigpro.js
27
sigpro.js
@@ -13,6 +13,10 @@ const proxyCache = new WeakMap()
|
|||||||
const ITER = Symbol('iter')
|
const ITER = Symbol('iter')
|
||||||
const MOUNTED_NODES = new WeakMap()
|
const MOUNTED_NODES = new WeakMap()
|
||||||
|
|
||||||
|
const SVG_NS = "http://www.w3.org/2000/svg"
|
||||||
|
const XLINK_NS = "http://www.w3.org/1999/xlink"
|
||||||
|
const SVG_TAGS = new Set("svg,path,circle,rect,line,polyline,polygon,g,defs,text,textPath,tspan,use,symbol,image,marker,ellipse".split(","))
|
||||||
|
|
||||||
const dispose = eff => {
|
const dispose = eff => {
|
||||||
if (!eff || eff._disposed) return
|
if (!eff || eff._disposed) return
|
||||||
eff._disposed = true
|
eff._disposed = true
|
||||||
@@ -97,8 +101,8 @@ const batch = fn => {
|
|||||||
|
|
||||||
const trackUpdate = (subs, trigger = false) => {
|
const trackUpdate = (subs, trigger = false) => {
|
||||||
if (!trigger && activeEffect && !activeEffect._disposed) {
|
if (!trigger && activeEffect && !activeEffect._disposed) {
|
||||||
subs.add(activeEffect)
|
subs.add(activeEffect);
|
||||||
; (activeEffect._deps ||= new Set()).add(subs)
|
(activeEffect._deps ||= new Set()).add(subs)
|
||||||
} else if (trigger && subs.size > 0) {
|
} else if (trigger && subs.size > 0) {
|
||||||
let hasQueue = false
|
let hasQueue = false
|
||||||
for (const e of subs) {
|
for (const e of subs) {
|
||||||
@@ -142,8 +146,6 @@ const $ = (val, key = null) => {
|
|||||||
computed._dirty = true
|
computed._dirty = true
|
||||||
computed._deps = null
|
computed._deps = null
|
||||||
computed._disposed = false
|
computed._disposed = false
|
||||||
computed.stop = () => { }
|
|
||||||
if (activeOwner) onUnmount(computed.stop)
|
|
||||||
return computed
|
return computed
|
||||||
}
|
}
|
||||||
if (key) try { val = JSON.parse(localStorage.getItem(key)) ?? val } catch (e) { }
|
if (key) try { val = JSON.parse(localStorage.getItem(key)) ?? val } catch (e) { }
|
||||||
@@ -281,24 +283,23 @@ const h = (tag, props = {}, children = []) => {
|
|||||||
isArr(node) ? node.forEach(attach) : attach(node)
|
isArr(node) ? node.forEach(attach) : attach(node)
|
||||||
return node
|
return node
|
||||||
}
|
}
|
||||||
const isSVG = /^(svg|path|circle|rect|line|poly(line|gon)|g|defs|text(path)?|tspan|use|symbol|image|marker|ellipse)$/i.test(tag);
|
|
||||||
const el = isSVG ? doc.createElementNS("http://www.w3.org/2000/svg", tag) : doc.createElement(tag)
|
const isSVG = SVG_TAGS.has(tag)
|
||||||
|
const el = isSVG ? doc.createElementNS(SVG_NS, tag) : doc.createElement(tag)
|
||||||
el._cleanups = new Set()
|
el._cleanups = new Set()
|
||||||
|
|
||||||
for (let k in props) {
|
for (const k of Object.keys(props)) {
|
||||||
if (!props.hasOwnProperty(k)) continue
|
|
||||||
let v = props[k]
|
let v = props[k]
|
||||||
if (k === "ref") {
|
if (k === "ref") {
|
||||||
isFunc(v) ? v(el) : (v.current = el)
|
isFunc(v) ? v(el) : (v.current = el)
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
if (isSVG && k.startsWith("xlink:")) {
|
if (isSVG && k.startsWith("xlink:")) {
|
||||||
const cleanVal = validateAttr(k.slice(6), v);
|
const cleanVal = validateAttr(k.slice(6), v)
|
||||||
let lnk = "http://www.w3.org/1999/xlink"
|
|
||||||
cleanVal == null
|
cleanVal == null
|
||||||
? el.removeAttributeNS(lnk, k.slice(6))
|
? el.removeAttributeNS(XLINK_NS, k.slice(6))
|
||||||
: el.setAttributeNS(lnk, k.slice(6), cleanVal);
|
: el.setAttributeNS(XLINK_NS, k.slice(6), cleanVal)
|
||||||
continue;
|
continue
|
||||||
}
|
}
|
||||||
if (k.startsWith("on")) {
|
if (k.startsWith("on")) {
|
||||||
const ev = k.slice(2).toLowerCase()
|
const ev = k.slice(2).toLowerCase()
|
||||||
|
|||||||
Reference in New Issue
Block a user