ajo 0.1.7 → 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 CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const l=require("./util-f79f2bb8.cjs"),$=new Set("area,base,br,col,command,embed,hr,img,input,keygen,link,meta,param,source,track,wbr".split(",")),m=e=>e.replace(/[&<>"']/g,r=>`&#${r.charCodeAt(0)};`),s=function*(e){for(e of l.normalize(e))if(typeof e=="string")yield e;else{const{nodeName:r,key:u,skip:c,memo:y,ref:p,children:d,...a}=e,i=l.entries(a).reduce((n,[o,t])=>o.startsWith("set:")||t==null||t===!1?n:t===!0?`${n} ${o}`:`${n} ${o}="${m(String(t))}"`,"");$.has(r)?yield`<${r}${i}>`:c?yield`<${r}${i}></${r}>`:(yield`<${r}${i}>`,yield*s(d),yield`</${r}>`)}},f=e=>[...s(e)].join("");exports.html=s;exports.render=f;
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
- import { n as d, e as $ } from "./util-32b33d65.js";
2
- const m = new Set("area,base,br,col,command,embed,hr,img,input,keygen,link,meta,param,source,track,wbr".split(",")), f = (e) => e.replace(/[&<>"']/g, (r) => `&#${r.charCodeAt(0)};`), o = function* (e) {
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: r, key: p, skip: c, memo: y, ref: u, children: l, ...a } = e, i = $(a).reduce((n, [s, t]) => s.startsWith("set:") || t == null || t === !1 ? n : t === !0 ? `${n} ${s}` : `${n} ${s}="${f(String(t))}"`, "");
8
- m.has(r) ? yield `<${r}${i}>` : c ? yield `<${r}${i}></${r}>` : (yield `<${r}${i}>`, yield* o(l), yield `</${r}>`);
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
- }, b = (e) => [...o(e)].join("");
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
- o as html,
13
- b as render
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=require("./jsx.cjs"),r=require("./dom.cjs"),n=require("./component.cjs"),o=require("./schedule.cjs");require("./util-f79f2bb8.cjs");require("./html.cjs");exports.Fragment=e.Fragment;exports.h=e.h;exports.render=r.render;exports.component=n.component;exports.schedule=o.schedule;
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
- import { Fragment as t, h as p } from "./jsx.js";
2
- import { render as n } from "./dom.js";
3
- import { component as c } from "./component.js";
4
- import { schedule as h } from "./schedule.js";
5
- import "./util-32b33d65.js";
6
- import "./html.js";
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
- t as Fragment,
9
- c as component,
10
- p as h,
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.7",
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
@@ -35,7 +35,7 @@ render(<Greet name="World" />, document.body)
35
35
  /** @jsx h */
36
36
  import { h, render, component } from 'ajo'
37
37
 
38
- const Counter = component(function* ({ init = 0 }) {
38
+ function* Counter({ init = 0 }) {
39
39
 
40
40
  let count = init
41
41
 
@@ -49,7 +49,7 @@ const Counter = component(function* ({ init = 0 }) {
49
49
  Current: {count}
50
50
  </button>
51
51
  )
52
- })
52
+ }
53
53
 
54
54
  render(<Counter arg:init={5} />, document.body)
55
55
  ```
@@ -1 +0,0 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const a=require("./jsx.cjs"),l=require("./util-f79f2bb8.cjs"),f=require("./html.cjs"),d=require("./dom.cjs");let p=0,m;const v=(n,{as:t}={})=>{var o;if(((o=n==null?void 0:n.constructor)==null?void 0:o.name)!=="GeneratorFunction")throw new TypeError("fn is not a generator function");const c=`host-${p++}`;return globalThis.document?(customElements.define(c,class extends x(t){*[Symbol.iterator](){for(;;)yield this.args}next(){var e;try{d.render((this[e=l.Iterator]??(this[e]=n.call(this,this.args))).next().value,this),typeof this[l.Ref]=="function"&&this[l.Ref](this)}catch(r){this.throw(r)}}throw(e){var r;for(let i=this;i;i=i.parentNode)if(typeof((r=i[l.Iterator])==null?void 0:r.throw)=="function")try{return d.render(i[l.Iterator].throw(e).value,i)}catch{continue}throw e}return(){var e;try{(e=this[l.Iterator])==null||e.return()}catch(r){this.throw(r)}finally{this[l.Iterator]=null}}},{extends:t}),({attrs:e={},args:r={},ref:i,...u})=>(w(e,r,u),a.h(t||c,l.assign(e,{is:t&&c,skip:!0,ref:h=>h&&l.assign(h,{[l.Ref]:s=>(s||h.return(),typeof i=="function"&&i(s)),args:r}).next()})))):({attrs:e={},args:r={},...i})=>{w(e,r,i);let u,h;try{const s=n.call(u={args:r,*[Symbol.iterator](){for(;;)yield r},next(){h=f.render(s.next().value)},throw(y){h=f.render(s.throw(y).value)},return(){s.return()}},r);u.next()}catch(s){u.throw(s)}finally{u.return()}return a.h(t||c,l.assign(e,{is:t&&c}),h)}},x=n=>{let t=(m??(m=new Map)).get(n);return t||(t=document.createElement(n).constructor,t===HTMLUnknownElement&&(t=HTMLElement),m.set(n,t)),t},w=(n,t,c)=>{for(const o in c)o.startsWith("arg:")?t[o.slice(4)]=c[o]:o==="children"?t[o]=c[o]:n[o]=c[o]};exports.component=v;
package/dist/component.js DELETED
@@ -1,86 +0,0 @@
1
- import { h as m } from "./jsx.js";
2
- import { a, I as u, R as f } from "./util-32b33d65.js";
3
- import { render as w } from "./html.js";
4
- import { render as d } from "./dom.js";
5
- let v = 0, y;
6
- const k = (n, { as: t } = {}) => {
7
- var o;
8
- if (((o = n == null ? void 0 : n.constructor) == null ? void 0 : o.name) !== "GeneratorFunction")
9
- throw new TypeError("fn is not a generator function");
10
- const l = `host-${v++}`;
11
- return globalThis.document ? (customElements.define(
12
- l,
13
- class extends E(t) {
14
- *[Symbol.iterator]() {
15
- for (; ; )
16
- yield this.args;
17
- }
18
- next() {
19
- var e;
20
- try {
21
- d((this[e = u] ?? (this[e] = n.call(this, this.args))).next().value, this), typeof this[f] == "function" && this[f](this);
22
- } catch (r) {
23
- this.throw(r);
24
- }
25
- }
26
- throw(e) {
27
- var r;
28
- for (let i = this; i; i = i.parentNode)
29
- if (typeof ((r = i[u]) == null ? void 0 : r.throw) == "function")
30
- try {
31
- return d(i[u].throw(e).value, i);
32
- } catch {
33
- continue;
34
- }
35
- throw e;
36
- }
37
- return() {
38
- var e;
39
- try {
40
- (e = this[u]) == null || e.return();
41
- } catch (r) {
42
- this.throw(r);
43
- } finally {
44
- this[u] = null;
45
- }
46
- }
47
- },
48
- { extends: t }
49
- ), ({ attrs: e = {}, args: r = {}, ref: i, ...s }) => (p(e, r, s), m(t || l, a(e, { is: t && l, skip: !0, ref: (h) => h && a(h, { [f]: (c) => (c || h.return(), typeof i == "function" && i(c)), args: r }).next() })))) : ({ attrs: e = {}, args: r = {}, ...i }) => {
50
- p(e, r, i);
51
- let s, h;
52
- try {
53
- const c = n.call(s = {
54
- args: r,
55
- *[Symbol.iterator]() {
56
- for (; ; )
57
- yield r;
58
- },
59
- next() {
60
- h = w(c.next().value);
61
- },
62
- throw(x) {
63
- h = w(c.throw(x).value);
64
- },
65
- return() {
66
- c.return();
67
- }
68
- }, r);
69
- s.next();
70
- } catch (c) {
71
- s.throw(c);
72
- } finally {
73
- s.return();
74
- }
75
- return m(t || l, a(e, { is: t && l }), h);
76
- };
77
- }, E = (n) => {
78
- let t = (y ?? (y = /* @__PURE__ */ new Map())).get(n);
79
- return t || (t = document.createElement(n).constructor, t === HTMLUnknownElement && (t = HTMLElement), y.set(n, t)), t;
80
- }, p = (n, t, l) => {
81
- for (const o in l)
82
- o.startsWith("arg:") ? t[o.slice(4)] = l[o] : o === "children" ? t[o] = l[o] : n[o] = l[o];
83
- };
84
- export {
85
- k as component
86
- };
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
- };
@@ -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
- };
@@ -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;