ajo 0.1.4 → 0.1.5
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/ajo.js +72 -72
- package/dist/ajo.umd.cjs +1 -1
- package/package.json +1 -1
package/dist/ajo.js
CHANGED
|
@@ -1,121 +1,121 @@
|
|
|
1
|
-
var
|
|
2
|
-
var
|
|
3
|
-
var
|
|
4
|
-
const { isArray:
|
|
5
|
-
const
|
|
6
|
-
return "children" in
|
|
7
|
-
},
|
|
8
|
-
for (t of
|
|
1
|
+
var A = Object.defineProperty;
|
|
2
|
+
var C = (t, e, o) => e in t ? A(t, e, { enumerable: !0, configurable: !0, writable: !0, value: o }) : t[e] = o;
|
|
3
|
+
var y = (t, e, o) => (C(t, typeof e != "symbol" ? e + "" : e, o), o);
|
|
4
|
+
const { isArray: v, prototype: { slice: T } } = Array, { assign: b, entries: O } = Object, R = ({ children: t }) => t, M = function(t, e) {
|
|
5
|
+
const o = { ...e, nodeName: t }, { length: i } = arguments;
|
|
6
|
+
return "children" in o || i < 3 || (o.children = i === 3 ? arguments[2] : T.call(arguments, 2)), o;
|
|
7
|
+
}, w = function* (t, e = { value: "" }, o = !0) {
|
|
8
|
+
for (t of v(t) ? t : [t]) {
|
|
9
9
|
if (t == null || typeof t == "boolean")
|
|
10
10
|
continue;
|
|
11
|
-
const { nodeName:
|
|
12
|
-
|
|
11
|
+
const { nodeName: i, ...n } = t, s = typeof i;
|
|
12
|
+
s === "string" ? (e.value && (yield e.value, e.value = ""), yield t) : s === "function" ? yield* w(i(n), e, !1) : v(t) ? yield* w(t, e, !1) : e.value += t;
|
|
13
13
|
}
|
|
14
|
-
|
|
15
|
-
},
|
|
16
|
-
let
|
|
17
|
-
for (t of
|
|
18
|
-
let n =
|
|
14
|
+
o && e.value && (yield e.value);
|
|
15
|
+
}, g = Symbol(), E = Symbol(), p = Symbol(), u = Symbol(), m = Symbol(), S = (t, e, o) => {
|
|
16
|
+
let i = e.firstChild;
|
|
17
|
+
for (t of w(t)) {
|
|
18
|
+
let n = i;
|
|
19
19
|
if (typeof t == "string") {
|
|
20
20
|
for (; n && n.nodeType != 3; )
|
|
21
21
|
n = n.nextSibling;
|
|
22
22
|
n ? n.data != t && (n.data = t) : n = document.createTextNode(t);
|
|
23
23
|
} else {
|
|
24
|
-
const { xmlns:
|
|
25
|
-
for (; n && !(n.localName ===
|
|
24
|
+
const { xmlns: s = o, nodeName: d, is: f, key: a, skip: r, memo: c, ref: l, children: h, ...q } = t;
|
|
25
|
+
for (; n && !(n.localName === d && (n[g] ?? (n[g] = a)) == a); )
|
|
26
26
|
n = n.nextSibling;
|
|
27
|
-
n ?? (n =
|
|
27
|
+
n ?? (n = H(s, d, f, a)), (c == null || F(n[E], n[E] = c)) && (B(q, n), r || S(h, n, s), typeof l == "function" && l(n));
|
|
28
28
|
}
|
|
29
|
-
n ===
|
|
29
|
+
n === i ? i = i.nextSibling : L(e, n, i);
|
|
30
30
|
}
|
|
31
|
-
for (;
|
|
32
|
-
const n =
|
|
33
|
-
e.removeChild(
|
|
31
|
+
for (; i; ) {
|
|
32
|
+
const n = i.nextSibling;
|
|
33
|
+
e.removeChild(i), i = n;
|
|
34
34
|
}
|
|
35
|
-
},
|
|
36
|
-
const n = t ? document.createElementNS(t, e, { is:
|
|
37
|
-
return n[
|
|
38
|
-
},
|
|
39
|
-
const
|
|
40
|
-
for (const
|
|
41
|
-
const n = t[
|
|
42
|
-
n !== i
|
|
35
|
+
}, F = (t, e) => v(t) && v(e) ? t.some((o, i) => o !== e[i]) : t !== e, H = (t, e, o, i) => {
|
|
36
|
+
const n = t ? document.createElementNS(t, e, { is: o }) : document.createElement(e, { is: o });
|
|
37
|
+
return n[g] = i, n;
|
|
38
|
+
}, B = (t, e) => {
|
|
39
|
+
const o = e[p] ?? (e[p] = T.call(e.attributes).reduce((i, { name: n, value: s }) => (i[n] = s, i), {}));
|
|
40
|
+
for (const i in { ...o, ...e[p] = t }) {
|
|
41
|
+
const n = t[i];
|
|
42
|
+
n !== o[i] && (i.startsWith("set:") ? e[i.slice(4)] = n : n == null || n === !1 ? e.removeAttribute(i) : e.setAttribute(i, n === !0 ? "" : n));
|
|
43
43
|
}
|
|
44
|
-
},
|
|
44
|
+
}, L = (t, e, o) => {
|
|
45
45
|
if (e.contains(document.activeElement)) {
|
|
46
|
-
const
|
|
47
|
-
for (;
|
|
48
|
-
const n =
|
|
49
|
-
t.insertBefore(
|
|
46
|
+
const i = e.nextSibling;
|
|
47
|
+
for (; o && o != e; ) {
|
|
48
|
+
const n = o.nextSibling;
|
|
49
|
+
t.insertBefore(o, i), o = n;
|
|
50
50
|
}
|
|
51
51
|
} else
|
|
52
|
-
t.insertBefore(e,
|
|
52
|
+
t.insertBefore(e, o);
|
|
53
53
|
};
|
|
54
|
-
let
|
|
55
|
-
const
|
|
56
|
-
var n;
|
|
54
|
+
let W = 0, N = null, x, k;
|
|
55
|
+
const U = (t, { as: e } = {}) => {
|
|
56
|
+
var n, s, d;
|
|
57
57
|
if (((n = t == null ? void 0 : t.constructor) == null ? void 0 : n.name) !== "GeneratorFunction")
|
|
58
58
|
throw new TypeError("fn is not a generator function");
|
|
59
|
-
const
|
|
60
|
-
class
|
|
59
|
+
const o = `host-${W++}`;
|
|
60
|
+
class i extends z(e) {
|
|
61
61
|
constructor() {
|
|
62
62
|
super(...arguments);
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
63
|
+
y(this, s);
|
|
64
|
+
y(this, d);
|
|
65
|
+
y(this, "args");
|
|
66
66
|
}
|
|
67
67
|
refresh() {
|
|
68
|
-
|
|
68
|
+
j(this);
|
|
69
69
|
}
|
|
70
70
|
next() {
|
|
71
71
|
try {
|
|
72
|
-
|
|
73
|
-
} catch (
|
|
74
|
-
this.throw(
|
|
72
|
+
S((this[u] ?? (this[u] = t.call(this, this.args))).next().value, this), typeof this[m] == "function" && this[m](this);
|
|
73
|
+
} catch (r) {
|
|
74
|
+
this.throw(r);
|
|
75
75
|
}
|
|
76
76
|
}
|
|
77
|
-
throw(
|
|
77
|
+
throw(r) {
|
|
78
78
|
var c;
|
|
79
|
-
for (let
|
|
80
|
-
if (typeof ((c =
|
|
79
|
+
for (let l = this; l; l = l.parentNode)
|
|
80
|
+
if (typeof ((c = l[u]) == null ? void 0 : c.throw) == "function")
|
|
81
81
|
try {
|
|
82
|
-
return
|
|
82
|
+
return S(l[u].throw(r).value, l);
|
|
83
83
|
} catch {
|
|
84
84
|
continue;
|
|
85
85
|
}
|
|
86
|
-
throw
|
|
86
|
+
throw r;
|
|
87
87
|
}
|
|
88
|
-
*[Symbol.iterator]() {
|
|
88
|
+
*[(s = u, d = m, Symbol.iterator)]() {
|
|
89
89
|
for (; ; )
|
|
90
90
|
yield this.args;
|
|
91
91
|
}
|
|
92
92
|
disconnectedCallback() {
|
|
93
|
-
var
|
|
93
|
+
var r;
|
|
94
94
|
try {
|
|
95
|
-
(
|
|
95
|
+
(r = this[u]) == null || r.return(), typeof this[m] == "function" && this[m](null);
|
|
96
96
|
} finally {
|
|
97
|
-
this
|
|
97
|
+
this[u] = null;
|
|
98
98
|
}
|
|
99
99
|
}
|
|
100
100
|
}
|
|
101
|
-
return customElements.define(
|
|
102
|
-
for (const
|
|
103
|
-
|
|
104
|
-
return
|
|
101
|
+
return customElements.define(o, i, { extends: e }), ({ attrs: f = {}, args: a = {}, ref: r, ...c }) => {
|
|
102
|
+
for (const l in c)
|
|
103
|
+
l.startsWith("arg:") ? a[l.slice(4)] = c[l] : (l === "children" ? a : f)[l] = c[l];
|
|
104
|
+
return M(e || o, b(f, { is: e && o, skip: !0, ref: (l) => b(l, { args: a, ref: r }).refresh() }));
|
|
105
105
|
};
|
|
106
|
-
},
|
|
107
|
-
(
|
|
108
|
-
for (const e of
|
|
106
|
+
}, j = (t) => {
|
|
107
|
+
(x ?? (x = /* @__PURE__ */ new Set())).add(t), N ?? (N = requestAnimationFrame(() => {
|
|
108
|
+
for (const e of x)
|
|
109
109
|
e.isConnected && e.next();
|
|
110
|
-
|
|
110
|
+
x.clear(), N = null;
|
|
111
111
|
}));
|
|
112
|
-
},
|
|
113
|
-
let e = (
|
|
114
|
-
return e || (e = document.createElement(t).constructor, e === HTMLUnknownElement && (e = HTMLElement),
|
|
112
|
+
}, z = (t) => {
|
|
113
|
+
let e = (k ?? (k = /* @__PURE__ */ new Map())).get(t);
|
|
114
|
+
return e || (e = document.createElement(t).constructor, e === HTMLUnknownElement && (e = HTMLElement), k.set(t, e)), e;
|
|
115
115
|
};
|
|
116
116
|
export {
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
117
|
+
R as Fragment,
|
|
118
|
+
U as component,
|
|
119
|
+
M as h,
|
|
120
|
+
S as render
|
|
121
121
|
};
|
package/dist/ajo.umd.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(s,
|
|
1
|
+
(function(s,r){typeof exports=="object"&&typeof module<"u"?r(exports):typeof define=="function"&&define.amd?define(["exports"],r):(s=typeof globalThis<"u"?globalThis:s||self,r(s.ajo={}))})(this,function(s){"use strict";var G=Object.defineProperty;var P=(s,r,f)=>r in s?G(s,r,{enumerable:!0,configurable:!0,writable:!0,value:f}):s[r]=f;var w=(s,r,f)=>(P(s,typeof r!="symbol"?r+"":r,f),f);const{isArray:r,prototype:{slice:f}}=Array,{assign:E,entries:R}=Object,q=({children:t})=>t,T=function(t,e){const o={...e,nodeName:t},{length:i}=arguments;return"children"in o||i<3||(o.children=i===3?arguments[2]:f.call(arguments,2)),o},x=function*(t,e={value:""},o=!0){for(t of r(t)?t:[t]){if(t==null||typeof t=="boolean")continue;const{nodeName:i,...n}=t,u=typeof i;u==="string"?(e.value&&(yield e.value,e.value=""),yield t):u==="function"?yield*x(i(n),e,!1):r(t)?yield*x(t,e,!1):e.value+=t}o&&e.value&&(yield e.value)},g=Symbol(),N=Symbol(),v=Symbol(),m=Symbol(),y=Symbol(),S=(t,e,o)=>{let i=e.firstChild;for(t of x(t)){let n=i;if(typeof t=="string"){for(;n&&n.nodeType!=3;)n=n.nextSibling;n?n.data!=t&&(n.data=t):n=document.createTextNode(t)}else{const{xmlns:u=o,nodeName:h,is:p,key:d,skip:c,memo:a,ref:l,children:j,...z}=t;for(;n&&!(n.localName===h&&(n[g]??(n[g]=d))==d);)n=n.nextSibling;n??(n=C(u,h,p,d)),(a==null||A(n[N],n[N]=a))&&(F(z,n),c||S(j,n,u),typeof l=="function"&&l(n))}n===i?i=i.nextSibling:H(e,n,i)}for(;i;){const n=i.nextSibling;e.removeChild(i),i=n}},A=(t,e)=>r(t)&&r(e)?t.some((o,i)=>o!==e[i]):t!==e,C=(t,e,o,i)=>{const n=t?document.createElementNS(t,e,{is:o}):document.createElement(e,{is:o});return n[g]=i,n},F=(t,e)=>{const o=e[v]??(e[v]=f.call(e.attributes).reduce((i,{name:n,value:u})=>(i[n]=u,i),{}));for(const i in{...o,...e[v]=t}){const n=t[i];n!==o[i]&&(i.startsWith("set:")?e[i.slice(4)]=n:n==null||n===!1?e.removeAttribute(i):e.setAttribute(i,n===!0?"":n))}},H=(t,e,o)=>{if(e.contains(document.activeElement)){const i=e.nextSibling;for(;o&&o!=e;){const n=o.nextSibling;t.insertBefore(o,i),o=n}}else t.insertBefore(e,o)};let B=0,k=null,b,M;const L=(t,{as:e}={})=>{var n,u,h;if(((n=t==null?void 0:t.constructor)==null?void 0:n.name)!=="GeneratorFunction")throw new TypeError("fn is not a generator function");const o=`host-${B++}`;class i extends W(e){constructor(){super(...arguments);w(this,u);w(this,h);w(this,"args")}refresh(){O(this)}next(){try{S((this[m]??(this[m]=t.call(this,this.args))).next().value,this),typeof this[y]=="function"&&this[y](this)}catch(c){this.throw(c)}}throw(c){var a;for(let l=this;l;l=l.parentNode)if(typeof((a=l[m])==null?void 0:a.throw)=="function")try{return S(l[m].throw(c).value,l)}catch{continue}throw c}*[(u=m,h=y,Symbol.iterator)](){for(;;)yield this.args}disconnectedCallback(){var c;try{(c=this[m])==null||c.return(),typeof this[y]=="function"&&this[y](null)}finally{this[m]=null}}}return customElements.define(o,i,{extends:e}),({attrs:p={},args:d={},ref:c,...a})=>{for(const l in a)l.startsWith("arg:")?d[l.slice(4)]=a[l]:(l==="children"?d:p)[l]=a[l];return T(e||o,E(p,{is:e&&o,skip:!0,ref:l=>E(l,{args:d,ref:c}).refresh()}))}},O=t=>{(b??(b=new Set)).add(t),k??(k=requestAnimationFrame(()=>{for(const e of b)e.isConnected&&e.next();b.clear(),k=null}))},W=t=>{let e=(M??(M=new Map)).get(t);return e||(e=document.createElement(t).constructor,e===HTMLUnknownElement&&(e=HTMLElement),M.set(t,e)),e};s.Fragment=q,s.component=L,s.h=T,s.render=S,Object.defineProperty(s,Symbol.toStringTag,{value:"Module"})});
|