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