ajo 0.1.6 → 0.1.8
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/html.cjs +1 -1
- package/dist/html.js +57 -9
- package/dist/index.cjs +1 -1
- package/dist/index.js +127 -11
- package/package.json +1 -17
- package/readme.md +4 -7
- package/dist/component.cjs +0 -1
- package/dist/component.js +0 -89
- package/dist/dom.cjs +0 -1
- package/dist/dom.js +0 -50
- package/dist/jsx.cjs +0 -1
- package/dist/jsx.js +0 -9
- package/dist/schedule.cjs +0 -1
- package/dist/schedule.js +0 -19
- package/dist/util-32b33d65.js +0 -21
- package/dist/util-f79f2bb8.cjs +0 -1
package/dist/html.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const{entries:p,hasOwn:g}=Object,m=e=>typeof e!="string"&&typeof(e==null?void 0:e[Symbol.iterator])=="function",y=e=>[...u(e)].join(""),u=function*(e){for(e of f(e))if(typeof e=="string")yield $(e);else{const{nodeName:t,key:r,skip:l,memo:n,ref:a,children:o,...c}=e;let i="";for(const[s,d]of p(c))s.startsWith("set:")||d==null||d===!1||(i+=d===!0?`${i} ${s}`:`${i} ${s}="${$(String(d))}"`);v.has(t)?yield`<${t}${i}>`:l?yield`<${t}${i}></${t}>`:typeof o=="string"?yield`<${t}${i}>${o}</${t}>`:(yield`<${t}${i}>`,yield*u(o),yield`</${t}>`)}},f=function*(e,t={value:""},r=!0){for(e of m(e)?e:[e])if(!(e==null||typeof e=="boolean"))if(g(e,"nodeName")){const{value:l}=t,{nodeName:n}=e,a=typeof n;if(l&&(yield l,t.value=""),a==="function")if(n.constructor.name==="GeneratorFunction"){const o={},c={};for(const[i,s]of p(e))i!=="is"&&(i==="children"?c.children=s:i.startsWith("arg:")?c[i.slice(4)]=s:o[i]=s);o.nodeName=e.is??n.is??"div",o.children=k(n,c),yield o}else delete e.nodeName,yield*f(n(e),t,!1);else a==="string"&&(yield e)}else m(e)?yield*f(e,t,!1):t.value+=e;r&&t.value&&(yield t.value)},v=new Set("area,base,br,col,command,embed,hr,img,input,keygen,link,meta,param,source,track,wbr".split(",")),$=e=>e.replace(/[&<>"']/g,t=>`&#${t.charCodeAt(0)};`),k=(e,t)=>{let r,l;try{const n=e.call(r={args:t,*[Symbol.iterator](){for(;;)yield t},refresh(){},next(){l=y(n.next().value)},throw(a){l=y(n.throw(a).value)},return(){n.return()}},t);r.next()}catch(n){r.throw(n)}finally{r.return()}return l};exports.html=u;exports.render=y;
|
package/dist/html.js
CHANGED
|
@@ -1,14 +1,62 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
for (e of d(e))
|
|
1
|
+
const { entries: $, hasOwn: g } = Object, f = (e) => typeof e != "string" && typeof (e == null ? void 0 : e[Symbol.iterator]) == "function", u = (e) => [...p(e)].join(""), p = function* (e) {
|
|
2
|
+
for (e of y(e))
|
|
4
3
|
if (typeof e == "string")
|
|
5
|
-
yield e;
|
|
4
|
+
yield m(e);
|
|
6
5
|
else {
|
|
7
|
-
const { nodeName:
|
|
8
|
-
|
|
6
|
+
const { nodeName: t, key: r, skip: l, memo: n, ref: a, children: o, ...c } = e;
|
|
7
|
+
let i = "";
|
|
8
|
+
for (const [s, d] of $(c))
|
|
9
|
+
s.startsWith("set:") || d == null || d === !1 || (i += d === !0 ? `${i} ${s}` : `${i} ${s}="${m(String(d))}"`);
|
|
10
|
+
k.has(t) ? yield `<${t}${i}>` : l ? yield `<${t}${i}></${t}>` : typeof o == "string" ? yield `<${t}${i}>${o}</${t}>` : (yield `<${t}${i}>`, yield* p(o), yield `</${t}>`);
|
|
9
11
|
}
|
|
10
|
-
},
|
|
12
|
+
}, y = function* (e, t = { value: "" }, r = !0) {
|
|
13
|
+
for (e of f(e) ? e : [e])
|
|
14
|
+
if (!(e == null || typeof e == "boolean"))
|
|
15
|
+
if (g(e, "nodeName")) {
|
|
16
|
+
const { value: l } = t, { nodeName: n } = e, a = typeof n;
|
|
17
|
+
if (l && (yield l, t.value = ""), a === "function")
|
|
18
|
+
if (n.constructor.name === "GeneratorFunction") {
|
|
19
|
+
const o = {}, c = {};
|
|
20
|
+
for (const [i, s] of $(e))
|
|
21
|
+
i !== "is" && (i === "children" ? c.children = s : i.startsWith("arg:") ? c[i.slice(4)] = s : o[i] = s);
|
|
22
|
+
o.nodeName = e.is ?? n.is ?? "div", o.children = v(n, c), yield o;
|
|
23
|
+
} else
|
|
24
|
+
delete e.nodeName, yield* y(n(e), t, !1);
|
|
25
|
+
else
|
|
26
|
+
a === "string" && (yield e);
|
|
27
|
+
} else
|
|
28
|
+
f(e) ? yield* y(e, t, !1) : t.value += e;
|
|
29
|
+
r && t.value && (yield t.value);
|
|
30
|
+
}, k = new Set("area,base,br,col,command,embed,hr,img,input,keygen,link,meta,param,source,track,wbr".split(",")), m = (e) => e.replace(/[&<>"']/g, (t) => `&#${t.charCodeAt(0)};`), v = (e, t) => {
|
|
31
|
+
let r, l;
|
|
32
|
+
try {
|
|
33
|
+
const n = e.call(r = {
|
|
34
|
+
args: t,
|
|
35
|
+
*[Symbol.iterator]() {
|
|
36
|
+
for (; ; )
|
|
37
|
+
yield t;
|
|
38
|
+
},
|
|
39
|
+
refresh() {
|
|
40
|
+
},
|
|
41
|
+
next() {
|
|
42
|
+
l = u(n.next().value);
|
|
43
|
+
},
|
|
44
|
+
throw(a) {
|
|
45
|
+
l = u(n.throw(a).value);
|
|
46
|
+
},
|
|
47
|
+
return() {
|
|
48
|
+
n.return();
|
|
49
|
+
}
|
|
50
|
+
}, t);
|
|
51
|
+
r.next();
|
|
52
|
+
} catch (n) {
|
|
53
|
+
r.throw(n);
|
|
54
|
+
} finally {
|
|
55
|
+
r.return();
|
|
56
|
+
}
|
|
57
|
+
return l;
|
|
58
|
+
};
|
|
11
59
|
export {
|
|
12
|
-
|
|
13
|
-
|
|
60
|
+
p as html,
|
|
61
|
+
u as render
|
|
14
62
|
};
|
package/dist/index.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const{isArray:S,prototype:{slice:A}}=Array,{assign:w,setPrototypeOf:N,hasOwn:E}=Object,v=e=>typeof e!="string"&&typeof(e==null?void 0:e[Symbol.iterator])=="function",C=({children:e})=>e,F=function(e,t){const{length:i}=arguments;return(t??(t={})).nodeName=e,"children"in t||i<3||(t.children=i===3?arguments[2]:A.call(arguments,2)),t},g=(e,t,i=t.namespaceURI)=>{let o=t.firstChild;for(e of $(e)){let n=o;if(typeof e=="string"){for(;n&&n.nodeType!=3;)n=n.nextSibling;n?n.data!=e&&(n.data=e):n=document.createTextNode(e)}else if(e instanceof Node)n=e;else{const{nodeName:c,xmlns:u=c==="svg"?"http://www.w3.org/2000/svg":i,key:a,skip:r,memo:d,ref:m,children:p}=e;for(;n&&!(n.localName===c&&(n.$key??(n.$key=a))==a);)n=n.nextSibling;if(n??(n=w(document.createElementNS(u,c),{$key:a})),d==null||M(n.$memo,n.$memo=d)){const{$attrs:y}=n,x={},h={};for(const s in w({},y,e)){if(s.startsWith("arg:")){h[s.slice(4)]=e[s];continue}if(O.has(s))continue;const f=x[s]=e[s];f!==(y==null?void 0:y[s])&&(s.startsWith("set:")?n[s.slice(4)]=f:f==null||f===!1?n.removeAttribute(s):n.setAttribute(s,f===!0?"":f))}n.$attrs=x,r||g(p,n,u),typeof m=="function"&&(n.$ref=m)(n,h)}}n===o?o=o.nextSibling:q(t,n,o)}for(;o;){const n=o.nextSibling;o.nodeType===1&&k(o),t.removeChild(o),o=n}},$=function*(e,t={value:""},i=!0){for(e of v(e)?e:[e])if(!(e==null||typeof e=="boolean"))if(E(e,"nodeName")){const{value:o}=t,{nodeName:n}=e,c=typeof n;if(o&&(yield o,t.value=""),c==="function")if(n.constructor.name==="GeneratorFunction"){const{is:u=n.is??"div",ref:a}=e;e.ref=(r,d)=>r&&(r.$gen??(r.$gen=(new I(r,u),n)),w(r,{$ref:(m,p)=>(m??r.return(),typeof a=="function"&&a(m,p)),$args:d}).next()),e.skip=!0,e.nodeName=u,delete e.is,"children"in e&&(e["arg:children"]=e.children,delete e.children),yield e}else delete e.nodeName,yield*$(n(e),t,!1);else c==="string"&&(yield e)}else v(e)?yield*$(e,t,!1):t.value+=e;i&&t.value&&(yield t.value)},M=(e,t)=>S(e)&&S(t)?e.some((i,o)=>i!==t[o]):e!==t,O=new Set("nodeName,xmlns,key,skip,memo,ref,children".split(",")),q=(e,t,i)=>{if(t.contains(document.activeElement)){const o=t.nextSibling;for(;i&&i!=t;){const n=i.nextSibling;e.insertBefore(i,o),i=n}}else e.insertBefore(t,i)},k=({children:e,$ref:t})=>{for(const i of e)k(i);typeof t=="function"&&t(null)};class I{constructor(t,i){N(t,N(this.constructor.prototype,U(i,t.namespaceURI).prototype))}*[Symbol.iterator](){for(;;)yield this.$args}refresh(){j(this)}next(){try{g((this.$it??(this.$it=this.$gen.call(this,this.$args))).next().value,this),typeof this.$ref=="function"&&this.$ref(this)}catch(t){this.throw(t)}}throw(t){var i;for(let o=this;o;o=o.parentNode)if(typeof((i=o.$it)==null?void 0:i.throw)=="function")try{return g(o.$it.throw(t).value,o)}catch{}throw t}return(){var t;try{(t=this.$it)==null||t.return()}catch(i){this.throw(i)}finally{this.$it=null}}}let b,l,T;const U=(e,t)=>{let i=(b??(b=new Map)).get(e);return i||({constructor:i}=document.createElementNS(t,e),b.set(e,i===HTMLUnknownElement?i=HTMLElement:i)),i},j=e=>{(l??(l=new Set)).has(e)&&l.delete(e);for(const t of l){if(t.contains(e))return;e.contains(t)&&l.delete(t)}l.add(e),T??(T=requestAnimationFrame(B))},B=()=>{for(const e of l)e.isConnected&&e.next();l.clear(),T=null};exports.Fragment=C;exports.h=F;exports.render=g;
|
package/dist/index.js
CHANGED
|
@@ -1,13 +1,129 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
1
|
+
const { isArray: N, prototype: { slice: E } } = Array, { assign: p, setPrototypeOf: S, hasOwn: T } = Object, v = (e) => typeof e != "string" && typeof (e == null ? void 0 : e[Symbol.iterator]) == "function", B = ({ children: e }) => e, H = function(e, t) {
|
|
2
|
+
const { length: i } = arguments;
|
|
3
|
+
return (t ?? (t = {})).nodeName = e, "children" in t || i < 3 || (t.children = i === 3 ? arguments[2] : E.call(arguments, 2)), t;
|
|
4
|
+
}, w = (e, t, i = t.namespaceURI) => {
|
|
5
|
+
let o = t.firstChild;
|
|
6
|
+
for (e of x(e)) {
|
|
7
|
+
let n = o;
|
|
8
|
+
if (typeof e == "string") {
|
|
9
|
+
for (; n && n.nodeType != 3; )
|
|
10
|
+
n = n.nextSibling;
|
|
11
|
+
n ? n.data != e && (n.data = e) : n = document.createTextNode(e);
|
|
12
|
+
} else if (e instanceof Node)
|
|
13
|
+
n = e;
|
|
14
|
+
else {
|
|
15
|
+
const { nodeName: c, xmlns: u = c === "svg" ? "http://www.w3.org/2000/svg" : i, key: a, skip: r, memo: d, ref: m, children: g } = e;
|
|
16
|
+
for (; n && !(n.localName === c && (n.$key ?? (n.$key = a)) == a); )
|
|
17
|
+
n = n.nextSibling;
|
|
18
|
+
if (n ?? (n = p(document.createElementNS(u, c), { $key: a })), d == null || C(n.$memo, n.$memo = d)) {
|
|
19
|
+
const { $attrs: y } = n, $ = {}, h = {};
|
|
20
|
+
for (const s in p({}, y, e)) {
|
|
21
|
+
if (s.startsWith("arg:")) {
|
|
22
|
+
h[s.slice(4)] = e[s];
|
|
23
|
+
continue;
|
|
24
|
+
}
|
|
25
|
+
if (q.has(s))
|
|
26
|
+
continue;
|
|
27
|
+
const f = $[s] = e[s];
|
|
28
|
+
f !== (y == null ? void 0 : y[s]) && (s.startsWith("set:") ? n[s.slice(4)] = f : f == null || f === !1 ? n.removeAttribute(s) : n.setAttribute(s, f === !0 ? "" : f));
|
|
29
|
+
}
|
|
30
|
+
n.$attrs = $, r || w(g, n, u), typeof m == "function" && (n.$ref = m)(n, h);
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
n === o ? o = o.nextSibling : F(t, n, o);
|
|
34
|
+
}
|
|
35
|
+
for (; o; ) {
|
|
36
|
+
const n = o.nextSibling;
|
|
37
|
+
o.nodeType === 1 && b(o), t.removeChild(o), o = n;
|
|
38
|
+
}
|
|
39
|
+
}, x = function* (e, t = { value: "" }, i = !0) {
|
|
40
|
+
for (e of v(e) ? e : [e])
|
|
41
|
+
if (!(e == null || typeof e == "boolean"))
|
|
42
|
+
if (T(e, "nodeName")) {
|
|
43
|
+
const { value: o } = t, { nodeName: n } = e, c = typeof n;
|
|
44
|
+
if (o && (yield o, t.value = ""), c === "function")
|
|
45
|
+
if (n.constructor.name === "GeneratorFunction") {
|
|
46
|
+
const { is: u = n.is ?? "div", ref: a } = e;
|
|
47
|
+
e.ref = (r, d) => r && (r.$gen ?? (r.$gen = (new I(r, u), n)), p(r, { $ref: (m, g) => (m ?? r.return(), typeof a == "function" && a(m, g)), $args: d }).next()), e.skip = !0, e.nodeName = u, delete e.is, "children" in e && (e["arg:children"] = e.children, delete e.children), yield e;
|
|
48
|
+
} else
|
|
49
|
+
delete e.nodeName, yield* x(n(e), t, !1);
|
|
50
|
+
else
|
|
51
|
+
c === "string" && (yield e);
|
|
52
|
+
} else
|
|
53
|
+
v(e) ? yield* x(e, t, !1) : t.value += e;
|
|
54
|
+
i && t.value && (yield t.value);
|
|
55
|
+
}, C = (e, t) => N(e) && N(t) ? e.some((i, o) => i !== t[o]) : e !== t, q = new Set("nodeName,xmlns,key,skip,memo,ref,children".split(",")), F = (e, t, i) => {
|
|
56
|
+
if (t.contains(document.activeElement)) {
|
|
57
|
+
const o = t.nextSibling;
|
|
58
|
+
for (; i && i != t; ) {
|
|
59
|
+
const n = i.nextSibling;
|
|
60
|
+
e.insertBefore(i, o), i = n;
|
|
61
|
+
}
|
|
62
|
+
} else
|
|
63
|
+
e.insertBefore(t, i);
|
|
64
|
+
}, b = ({ children: e, $ref: t }) => {
|
|
65
|
+
for (const i of e)
|
|
66
|
+
b(i);
|
|
67
|
+
typeof t == "function" && t(null);
|
|
68
|
+
};
|
|
69
|
+
class I {
|
|
70
|
+
constructor(t, i) {
|
|
71
|
+
S(t, S(this.constructor.prototype, M(i, t.namespaceURI).prototype));
|
|
72
|
+
}
|
|
73
|
+
*[Symbol.iterator]() {
|
|
74
|
+
for (; ; )
|
|
75
|
+
yield this.$args;
|
|
76
|
+
}
|
|
77
|
+
refresh() {
|
|
78
|
+
O(this);
|
|
79
|
+
}
|
|
80
|
+
next() {
|
|
81
|
+
try {
|
|
82
|
+
w((this.$it ?? (this.$it = this.$gen.call(this, this.$args))).next().value, this), typeof this.$ref == "function" && this.$ref(this);
|
|
83
|
+
} catch (t) {
|
|
84
|
+
this.throw(t);
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
throw(t) {
|
|
88
|
+
var i;
|
|
89
|
+
for (let o = this; o; o = o.parentNode)
|
|
90
|
+
if (typeof ((i = o.$it) == null ? void 0 : i.throw) == "function")
|
|
91
|
+
try {
|
|
92
|
+
return w(o.$it.throw(t).value, o);
|
|
93
|
+
} catch {
|
|
94
|
+
}
|
|
95
|
+
throw t;
|
|
96
|
+
}
|
|
97
|
+
return() {
|
|
98
|
+
var t;
|
|
99
|
+
try {
|
|
100
|
+
(t = this.$it) == null || t.return();
|
|
101
|
+
} catch (i) {
|
|
102
|
+
this.throw(i);
|
|
103
|
+
} finally {
|
|
104
|
+
this.$it = null;
|
|
105
|
+
}
|
|
106
|
+
}
|
|
107
|
+
}
|
|
108
|
+
let k, l, A;
|
|
109
|
+
const M = (e, t) => {
|
|
110
|
+
let i = (k ?? (k = /* @__PURE__ */ new Map())).get(e);
|
|
111
|
+
return i || ({ constructor: i } = document.createElementNS(t, e), k.set(e, i === HTMLUnknownElement ? i = HTMLElement : i)), i;
|
|
112
|
+
}, O = (e) => {
|
|
113
|
+
(l ?? (l = /* @__PURE__ */ new Set())).has(e) && l.delete(e);
|
|
114
|
+
for (const t of l) {
|
|
115
|
+
if (t.contains(e))
|
|
116
|
+
return;
|
|
117
|
+
e.contains(t) && l.delete(t);
|
|
118
|
+
}
|
|
119
|
+
l.add(e), A ?? (A = requestAnimationFrame(U));
|
|
120
|
+
}, U = () => {
|
|
121
|
+
for (const e of l)
|
|
122
|
+
e.isConnected && e.next();
|
|
123
|
+
l.clear(), A = null;
|
|
124
|
+
};
|
|
7
125
|
export {
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
n as render,
|
|
12
|
-
h as schedule
|
|
126
|
+
B as Fragment,
|
|
127
|
+
H as h,
|
|
128
|
+
w as render
|
|
13
129
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "ajo",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.8",
|
|
4
4
|
"description": "ajo is a JavaScript view library for building user interfaces",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"module": "./dist/index.js",
|
|
@@ -10,25 +10,9 @@
|
|
|
10
10
|
"import": "./dist/index.js",
|
|
11
11
|
"require": "./dist/index.cjs"
|
|
12
12
|
},
|
|
13
|
-
"./jsx": {
|
|
14
|
-
"import": "./dist/jsx.js",
|
|
15
|
-
"require": "./dist/jsx.umd.cjs"
|
|
16
|
-
},
|
|
17
|
-
"./dom": {
|
|
18
|
-
"import": "./dist/dom.js",
|
|
19
|
-
"require": "./dist/dom.umd.cjs"
|
|
20
|
-
},
|
|
21
13
|
"./html": {
|
|
22
14
|
"import": "./dist/html.js",
|
|
23
15
|
"require": "./dist/html.umd.cjs"
|
|
24
|
-
},
|
|
25
|
-
"./component": {
|
|
26
|
-
"import": "./dist/component.js",
|
|
27
|
-
"require": "./dist/component.umd.cjs"
|
|
28
|
-
},
|
|
29
|
-
"./schedule": {
|
|
30
|
-
"import": "./dist/schedule.js",
|
|
31
|
-
"require": "./dist/schedule.umd.cjs"
|
|
32
16
|
}
|
|
33
17
|
},
|
|
34
18
|
"files": [
|
package/readme.md
CHANGED
|
@@ -11,8 +11,7 @@ npm install ajo
|
|
|
11
11
|
|
|
12
12
|
```jsx
|
|
13
13
|
/** @jsx h */
|
|
14
|
-
import { h } from 'ajo'
|
|
15
|
-
import { render } from 'ajo/dom'
|
|
14
|
+
import { h, render } from 'ajo'
|
|
16
15
|
|
|
17
16
|
document.body.innerHTML = '<div>Hello World</div>'
|
|
18
17
|
|
|
@@ -34,11 +33,9 @@ render(<Greet name="World" />, document.body)
|
|
|
34
33
|
|
|
35
34
|
```jsx
|
|
36
35
|
/** @jsx h */
|
|
37
|
-
import { h } from 'ajo'
|
|
38
|
-
import { render } from 'ajo/dom'
|
|
39
|
-
import { component } from 'ajo/component'
|
|
36
|
+
import { h, render, component } from 'ajo'
|
|
40
37
|
|
|
41
|
-
|
|
38
|
+
function* Counter({ init = 0 }) {
|
|
42
39
|
|
|
43
40
|
let count = init
|
|
44
41
|
|
|
@@ -52,7 +49,7 @@ const Counter = component(function* ({ init = 0 }) {
|
|
|
52
49
|
Current: {count}
|
|
53
50
|
</button>
|
|
54
51
|
)
|
|
55
|
-
}
|
|
52
|
+
}
|
|
56
53
|
|
|
57
54
|
render(<Counter arg:init={5} />, document.body)
|
|
58
55
|
```
|
package/dist/component.cjs
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const d=require("./jsx.cjs"),o=require("./util-f79f2bb8.cjs"),f=require("./html.cjs"),m=require("./dom.cjs");let v=0,w;const x=(n,{as:t}={})=>{var a;if(((a=n==null?void 0:n.constructor)==null?void 0:a.name)!=="GeneratorFunction")throw new TypeError("fn is not a generator function");const i=`host-${v++}`;if(!globalThis.document)return({attrs:s={},args:e={},...c})=>{y(s,e,c);let r,u;try{const h=n.call(r={args:e,*[Symbol.iterator](){for(;;)yield e},next(){u=f.render(h.next().value)},throw(p){u=f.render(h.throw(p).value)},return(){h.return()}},e);r.next()}catch(h){r.throw(h)}finally{r.return()}return d.h(t||i,o.assign(s,{is:t&&i}),u)};class l extends b(t){*[Symbol.iterator](){for(;;)yield this.args}next(){var e;try{m.render((this[e=o.Iterator]??(this[e]=n.call(this,this.args))).next().value,this),typeof this[o.Ref]=="function"&&this[o.Ref](this)}catch(c){this.throw(c)}}throw(e){var c;for(let r=this;r;r=r.parentNode)if(typeof((c=r[o.Iterator])==null?void 0:c.throw)=="function")try{m.render(r[o.Iterator].throw(e).value,r);return}catch{continue}throw e}return(){var e;try{(e=this[o.Iterator])==null||e.return()}catch(c){this.throw(c)}finally{this[o.Iterator]=null}}disconnectedCallback(){this.return()}}return customElements.define(i,l,{extends:t}),({attrs:s={},args:e={},ref:c,...r})=>(y(s,e,r),d.h(t||i,o.assign(s,{is:t&&i,skip:!0,ref:u=>o.assign(u,{[o.Ref]:c,args:e}).next()})))},b=n=>{let t=(w??(w=new Map)).get(n);return t||(t=document.createElement(n).constructor,t===HTMLUnknownElement&&(t=HTMLElement),w.set(n,t)),t},y=(n,t,i)=>{for(const l in i)l.startsWith("arg:")?t[l.slice(4)]=i[l]:l==="children"?t[l]=i[l]:n[l]=i[l]};exports.component=x;
|
package/dist/component.js
DELETED
|
@@ -1,89 +0,0 @@
|
|
|
1
|
-
import { h as d } from "./jsx.js";
|
|
2
|
-
import { a, I as u, R as m } from "./util-32b33d65.js";
|
|
3
|
-
import { render as w } from "./html.js";
|
|
4
|
-
import { render as p } from "./dom.js";
|
|
5
|
-
let E = 0, y;
|
|
6
|
-
const C = (n, { as: t } = {}) => {
|
|
7
|
-
var f;
|
|
8
|
-
if (((f = n == null ? void 0 : n.constructor) == null ? void 0 : f.name) !== "GeneratorFunction")
|
|
9
|
-
throw new TypeError("fn is not a generator function");
|
|
10
|
-
const o = `host-${E++}`;
|
|
11
|
-
if (!globalThis.document)
|
|
12
|
-
return ({ attrs: c = {}, args: e = {}, ...l }) => {
|
|
13
|
-
x(c, e, l);
|
|
14
|
-
let r, s;
|
|
15
|
-
try {
|
|
16
|
-
const h = n.call(r = {
|
|
17
|
-
args: e,
|
|
18
|
-
*[Symbol.iterator]() {
|
|
19
|
-
for (; ; )
|
|
20
|
-
yield e;
|
|
21
|
-
},
|
|
22
|
-
next() {
|
|
23
|
-
s = w(h.next().value);
|
|
24
|
-
},
|
|
25
|
-
throw(v) {
|
|
26
|
-
s = w(h.throw(v).value);
|
|
27
|
-
},
|
|
28
|
-
return() {
|
|
29
|
-
h.return();
|
|
30
|
-
}
|
|
31
|
-
}, e);
|
|
32
|
-
r.next();
|
|
33
|
-
} catch (h) {
|
|
34
|
-
r.throw(h);
|
|
35
|
-
} finally {
|
|
36
|
-
r.return();
|
|
37
|
-
}
|
|
38
|
-
return d(t || o, a(c, { is: t && o }), s);
|
|
39
|
-
};
|
|
40
|
-
class i extends b(t) {
|
|
41
|
-
*[Symbol.iterator]() {
|
|
42
|
-
for (; ; )
|
|
43
|
-
yield this.args;
|
|
44
|
-
}
|
|
45
|
-
next() {
|
|
46
|
-
var e;
|
|
47
|
-
try {
|
|
48
|
-
p((this[e = u] ?? (this[e] = n.call(this, this.args))).next().value, this), typeof this[m] == "function" && this[m](this);
|
|
49
|
-
} catch (l) {
|
|
50
|
-
this.throw(l);
|
|
51
|
-
}
|
|
52
|
-
}
|
|
53
|
-
throw(e) {
|
|
54
|
-
var l;
|
|
55
|
-
for (let r = this; r; r = r.parentNode)
|
|
56
|
-
if (typeof ((l = r[u]) == null ? void 0 : l.throw) == "function")
|
|
57
|
-
try {
|
|
58
|
-
p(r[u].throw(e).value, r);
|
|
59
|
-
return;
|
|
60
|
-
} catch {
|
|
61
|
-
continue;
|
|
62
|
-
}
|
|
63
|
-
throw e;
|
|
64
|
-
}
|
|
65
|
-
return() {
|
|
66
|
-
var e;
|
|
67
|
-
try {
|
|
68
|
-
(e = this[u]) == null || e.return();
|
|
69
|
-
} catch (l) {
|
|
70
|
-
this.throw(l);
|
|
71
|
-
} finally {
|
|
72
|
-
this[u] = null;
|
|
73
|
-
}
|
|
74
|
-
}
|
|
75
|
-
disconnectedCallback() {
|
|
76
|
-
this.return();
|
|
77
|
-
}
|
|
78
|
-
}
|
|
79
|
-
return customElements.define(o, i, { extends: t }), ({ attrs: c = {}, args: e = {}, ref: l, ...r }) => (x(c, e, r), d(t || o, a(c, { is: t && o, skip: !0, ref: (s) => a(s, { [m]: l, args: e }).next() })));
|
|
80
|
-
}, b = (n) => {
|
|
81
|
-
let t = (y ?? (y = /* @__PURE__ */ new Map())).get(n);
|
|
82
|
-
return t || (t = document.createElement(n).constructor, t === HTMLUnknownElement && (t = HTMLElement), y.set(n, t)), t;
|
|
83
|
-
}, x = (n, t, o) => {
|
|
84
|
-
for (const i in o)
|
|
85
|
-
i.startsWith("arg:") ? t[i.slice(4)] = o[i] : i === "children" ? t[i] = o[i] : n[i] = o[i];
|
|
86
|
-
};
|
|
87
|
-
export {
|
|
88
|
-
C as component
|
|
89
|
-
};
|
package/dist/dom.cjs
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const s=require("./util-f79f2bb8.cjs"),a=(n,t,o)=>{var r;let i=t.firstChild;for(n of s.normalize(n)){let e=i;if(typeof n=="string"){for(;e&&e.nodeType!=3;)e=e.nextSibling;e?e.data!=n&&(e.data=n):e=document.createTextNode(n)}else{const{xmlns:c=o,nodeName:l,is:y,key:f,skip:b,memo:u,ref:m,children:x,...g}=n;for(;e&&!(e.localName===l&&(e[r=s.Key]??(e[r]=f))==f);)e=e.nextSibling;e??(e=v(c,l,y,f)),(u==null||S(e[s.Memo],e[s.Memo]=u))&&(A(g,e),b||a(x,e,c),typeof m=="function"&&(e[s.Ref]=m)(e))}e===i?i=i.nextSibling:p(t,e,i)}for(;i;){const e=i.nextSibling;t.removeChild(i),i.nodeType===1&&d(i),i=e}},S=(n,t)=>s.isArray(n)&&s.isArray(t)?n.some((o,i)=>o!==t[i]):n!==t,v=(n,t,o,i)=>{const r=n?document.createElementNS(n,t,{is:o}):document.createElement(t,{is:o});return r[s.Key]=i,r},A=(n,t)=>{var i;const o=t[i=s.Attrs]??(t[i]=s.slice.call(t.attributes).reduce((r,{name:e,value:c})=>(r[e]=c,r),{}));for(const r in{...o,...t[s.Attrs]=n}){const e=n[r];e!==o[r]&&(r.startsWith("set:")?t[r.slice(4)]=e:e==null||e===!1?t.removeAttribute(r):t.setAttribute(r,e===!0?"":e))}},p=(n,t,o)=>{if(t.contains(document.activeElement)){const i=t.nextSibling;for(;o&&o!=t;){const r=o.nextSibling;n.insertBefore(o,i),o=r}}else n.insertBefore(t,o)},d=n=>{var t;for(const o of n.children)d(o);(t=n[s.Ref])==null||t.call(n,null)};exports.render=a;
|
package/dist/dom.js
DELETED
|
@@ -1,50 +0,0 @@
|
|
|
1
|
-
import { n as A, K as d, M as m, R as b, i as u, A as x, s as w } from "./util-32b33d65.js";
|
|
2
|
-
const N = (n, t, s) => {
|
|
3
|
-
var o;
|
|
4
|
-
let i = t.firstChild;
|
|
5
|
-
for (n of A(n)) {
|
|
6
|
-
let e = i;
|
|
7
|
-
if (typeof n == "string") {
|
|
8
|
-
for (; e && e.nodeType != 3; )
|
|
9
|
-
e = e.nextSibling;
|
|
10
|
-
e ? e.data != n && (e.data = n) : e = document.createTextNode(n);
|
|
11
|
-
} else {
|
|
12
|
-
const { xmlns: r = s, nodeName: f, is: y, key: c, skip: S, memo: a, ref: l, children: p, ...v } = n;
|
|
13
|
-
for (; e && !(e.localName === f && (e[o = d] ?? (e[o] = c)) == c); )
|
|
14
|
-
e = e.nextSibling;
|
|
15
|
-
e ?? (e = T(r, f, y, c)), (a == null || E(e[m], e[m] = a)) && (k(v, e), S || N(p, e, r), typeof l == "function" && (e[b] = l)(e));
|
|
16
|
-
}
|
|
17
|
-
e === i ? i = i.nextSibling : B(t, e, i);
|
|
18
|
-
}
|
|
19
|
-
for (; i; ) {
|
|
20
|
-
const e = i.nextSibling;
|
|
21
|
-
t.removeChild(i), i.nodeType === 1 && g(i), i = e;
|
|
22
|
-
}
|
|
23
|
-
}, E = (n, t) => u(n) && u(t) ? n.some((s, i) => s !== t[i]) : n !== t, T = (n, t, s, i) => {
|
|
24
|
-
const o = n ? document.createElementNS(n, t, { is: s }) : document.createElement(t, { is: s });
|
|
25
|
-
return o[d] = i, o;
|
|
26
|
-
}, k = (n, t) => {
|
|
27
|
-
var i;
|
|
28
|
-
const s = t[i = x] ?? (t[i] = w.call(t.attributes).reduce((o, { name: e, value: r }) => (o[e] = r, o), {}));
|
|
29
|
-
for (const o in { ...s, ...t[x] = n }) {
|
|
30
|
-
const e = n[o];
|
|
31
|
-
e !== s[o] && (o.startsWith("set:") ? t[o.slice(4)] = e : e == null || e === !1 ? t.removeAttribute(o) : t.setAttribute(o, e === !0 ? "" : e));
|
|
32
|
-
}
|
|
33
|
-
}, B = (n, t, s) => {
|
|
34
|
-
if (t.contains(document.activeElement)) {
|
|
35
|
-
const i = t.nextSibling;
|
|
36
|
-
for (; s && s != t; ) {
|
|
37
|
-
const o = s.nextSibling;
|
|
38
|
-
n.insertBefore(s, i), s = o;
|
|
39
|
-
}
|
|
40
|
-
} else
|
|
41
|
-
n.insertBefore(t, s);
|
|
42
|
-
}, g = (n) => {
|
|
43
|
-
var t;
|
|
44
|
-
for (const s of n.children)
|
|
45
|
-
g(s);
|
|
46
|
-
(t = n[b]) == null || t.call(n, null);
|
|
47
|
-
};
|
|
48
|
-
export {
|
|
49
|
-
N as render
|
|
50
|
-
};
|
package/dist/jsx.cjs
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const c=require("./util-f79f2bb8.cjs"),i=({children:e})=>e,l=function(e,r){const n={...r,nodeName:e},{length:t}=arguments;return"children"in n||t<3||(n.children=t===3?arguments[2]:c.slice.call(arguments,2)),n};exports.Fragment=i;exports.h=l;
|
package/dist/jsx.js
DELETED
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import { s } from "./util-32b33d65.js";
|
|
2
|
-
const o = ({ children: n }) => n, i = function(n, r) {
|
|
3
|
-
const t = { ...r, nodeName: n }, { length: e } = arguments;
|
|
4
|
-
return "children" in t || e < 3 || (t.children = e === 3 ? arguments[2] : s.call(arguments, 2)), t;
|
|
5
|
-
};
|
|
6
|
-
export {
|
|
7
|
-
o as Fragment,
|
|
8
|
-
i as h
|
|
9
|
-
};
|
package/dist/schedule.cjs
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});let t,r;const c=e=>{if(!(e instanceof HTMLElement&&typeof(e==null?void 0:e.next)=="function"))throw new TypeError("el must be a web component with a next method");t??(t=new Set),t.has(e)&&t.delete(e);for(const n of t){if(n.contains(e))return o(e);e.contains(n)&&t.delete(n)}return t.add(e),o(e)},o=e=>(r??(r=requestAnimationFrame(u)),()=>t.delete(e)),u=()=>{for(const e of t)e.isConnected&&e.next();t.clear(),r=null};exports.schedule=c;
|
package/dist/schedule.js
DELETED
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
let n, r;
|
|
2
|
-
const i = (e) => {
|
|
3
|
-
if (!(e instanceof HTMLElement && typeof (e == null ? void 0 : e.next) == "function"))
|
|
4
|
-
throw new TypeError("el must be a web component with a next method");
|
|
5
|
-
n ?? (n = /* @__PURE__ */ new Set()), n.has(e) && n.delete(e);
|
|
6
|
-
for (const t of n) {
|
|
7
|
-
if (t.contains(e))
|
|
8
|
-
return o(e);
|
|
9
|
-
e.contains(t) && n.delete(t);
|
|
10
|
-
}
|
|
11
|
-
return n.add(e), o(e);
|
|
12
|
-
}, o = (e) => (r ?? (r = requestAnimationFrame(c)), () => n.delete(e)), c = () => {
|
|
13
|
-
for (const e of n)
|
|
14
|
-
e.isConnected && e.next();
|
|
15
|
-
n.clear(), r = null;
|
|
16
|
-
};
|
|
17
|
-
export {
|
|
18
|
-
i as schedule
|
|
19
|
-
};
|
package/dist/util-32b33d65.js
DELETED
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
const { isArray: o, prototype: { slice: y } } = Array, { assign: c, entries: m } = Object, r = Symbol(), v = Symbol(), d = Symbol(), p = Symbol(), u = Symbol(), t = function* (e, a = { value: "" }, i = !0) {
|
|
2
|
-
for (e of o(e) ? e : [e]) {
|
|
3
|
-
if (e == null || typeof e == "boolean")
|
|
4
|
-
continue;
|
|
5
|
-
const { nodeName: s, ...n } = e, l = typeof s;
|
|
6
|
-
l === "string" ? (a.value && (yield a.value, a.value = ""), yield e) : l === "function" ? yield* t(s(n), a, !1) : o(e) ? yield* t(e, a, !1) : a.value += e;
|
|
7
|
-
}
|
|
8
|
-
i && a.value && (yield a.value);
|
|
9
|
-
};
|
|
10
|
-
export {
|
|
11
|
-
p as A,
|
|
12
|
-
u as I,
|
|
13
|
-
r as K,
|
|
14
|
-
v as M,
|
|
15
|
-
d as R,
|
|
16
|
-
c as a,
|
|
17
|
-
m as e,
|
|
18
|
-
o as i,
|
|
19
|
-
t as n,
|
|
20
|
-
y as s
|
|
21
|
-
};
|
package/dist/util-f79f2bb8.cjs
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";const{isArray:l,prototype:{slice:y}}=Array,{assign:r,entries:c}=Object,m=Symbol(),v=Symbol(),d=Symbol(),u=Symbol(),p=Symbol(),o=function*(e,t={value:""},a=!0){for(e of l(e)?e:[e]){if(e==null||typeof e=="boolean")continue;const{nodeName:i,...n}=e,s=typeof i;s==="string"?(t.value&&(yield t.value,t.value=""),yield e):s==="function"?yield*o(i(n),t,!1):l(e)?yield*o(e,t,!1):t.value+=e}a&&t.value&&(yield t.value)};exports.Attrs=u;exports.Iterator=p;exports.Key=m;exports.Memo=v;exports.Ref=d;exports.assign=r;exports.entries=c;exports.isArray=l;exports.normalize=o;exports.slice=y;
|