Comparing version 2.6.34 to 2.6.35
@@ -763,2 +763,4 @@ declare type AllowFixed<T> = T extends RxList<infer U> ? U[] | T : T extends RxMap<infer K, infer V> ? [K, V][] | T : T extends Atom<infer U> ? U | T : T; | ||
declare type Order = [number, number]; | ||
declare const PATCH_PHASE = 2; | ||
@@ -1028,2 +1030,6 @@ | ||
set(index: number, value: T): T; | ||
reorder(newOrder: Order[]): void; | ||
reposition(start: number, newStart: number, limit?: number): void; | ||
swap(start: number, newStart: number, limit?: number): void; | ||
sortSelf(compare: (a: T, b: T) => number): void; | ||
at(index: number): T | undefined; | ||
@@ -1030,0 +1036,0 @@ forEach(handler: (item: T, index: number) => void): void; |
311
dist/axii.js
@@ -1,4 +0,4 @@ | ||
import { isAtom as B, atom as U, RxList as j, RxSet as te, RxMap as re, arrayComputed as ne, TrackOpTypes as k, TriggerOpTypes as I, destroyComputed as F, reactive as He, ReactiveEffect as Le, computed as ue, autorun as de, Notifier as se, isReactive as pe } from "data0"; | ||
import { isAtom as B, atom as U, RxList as j, RxSet as te, RxMap as re, arrayComputed as ne, TrackOpTypes as M, TriggerOpTypes as N, destroyComputed as F, reactive as He, ReactiveEffect as Le, computed as ue, autorun as de, Notifier as se, isReactive as pe } from "data0"; | ||
export * from "data0"; | ||
function Re(t, e) { | ||
function Oe(t, e) { | ||
for (let r in t) | ||
@@ -20,3 +20,3 @@ e(t[r], r); | ||
const J = (t) => (t == null ? void 0 : t.constructor) === Object; | ||
function T(t, e) { | ||
function A(t, e) { | ||
if (!t) | ||
@@ -38,3 +38,3 @@ throw new Error(e); | ||
} | ||
function Oe(t) { | ||
function Re(t) { | ||
return t.length ? new Promise((e) => { | ||
@@ -50,3 +50,3 @@ let r = 0; | ||
let ye = "px"; | ||
function Mt(t) { | ||
function kt(t) { | ||
ye = t; | ||
@@ -57,7 +57,7 @@ } | ||
} | ||
const Ne = /^(transform|translate|scale|rotate|skew|boxShadow|textShadow|transition)/; | ||
const Me = /^(boxShadow|textShadow|transition|animation|backgroundImage)/; | ||
function Z(t, e) { | ||
return e === void 0 ? "" : Array.isArray(e) ? Ne.test(t) ? e.join(",") : e.map((r) => Z(t, r)).join(" ") : typeof e == "number" && ve.test(t) ? $e(e) : e.toString(); | ||
return e === void 0 ? "" : Array.isArray(e) ? Me.test(t) ? e.join(",") : e.map((r) => Z(t, r)).join(" ") : typeof e == "number" && ve.test(t) ? $e(e) : e.toString(); | ||
} | ||
function ke(t, e, r) { | ||
function Ne(t, e, r) { | ||
try { | ||
@@ -78,3 +78,3 @@ t[e] = r; | ||
const W = /* @__PURE__ */ new WeakMap(); | ||
function Me(t) { | ||
function ke(t) { | ||
return t[0] === "o" && t[1] === "n"; | ||
@@ -84,3 +84,3 @@ } | ||
function z(t, e, r, n) { | ||
if (Array.isArray(r) && e !== "style" && e !== "className" && !Me(e)) | ||
if (Array.isArray(r) && e !== "style" && e !== "className" && !ke(e)) | ||
return z(t, e, r.at(-1), n); | ||
@@ -98,3 +98,3 @@ if (e === "uuid") { | ||
const a = s ? t._captureListeners || (t._captureListeners = {}) : t._listeners || (t._listeners = {}); | ||
T((a == null ? void 0 : a[i]) === void 0, `${e} already listened`), a[i] = r; | ||
A((a == null ? void 0 : a[i]) === void 0, `${e} already listened`), a[i] = r; | ||
return; | ||
@@ -104,5 +104,5 @@ } | ||
(!r || Array.isArray(r) && !r.length) && (t.style.cssText = r || ""), (Array.isArray(r) ? r : [r]).forEach((i) => { | ||
typeof i == "string" ? t.style.cssText = i : typeof i == "object" ? Re(i, (o, a) => { | ||
typeof i == "string" ? t.style.cssText = i : typeof i == "object" ? Oe(i, (o, a) => { | ||
t.style[a] = Z(a, o); | ||
}) : T(!1, "style can only be string or object."); | ||
}) : A(!1, "style can only be string or object."); | ||
}); | ||
@@ -117,3 +117,3 @@ return; | ||
c && (i = `${i} ${a}`); | ||
}) : typeof o == "string" ? i = `${i} ${o}` : T(!1, "className can only be string or {[k:string]:boolean}"); | ||
}) : typeof o == "string" ? i = `${i} ${o}` : A(!1, "className can only be string or {[k:string]:boolean}"); | ||
}), t.setAttribute("class", i); | ||
@@ -134,3 +134,3 @@ return; | ||
else if (e !== "list" && e !== "type" && !n && e in t) | ||
ke(t, e, r === null ? "" : r), r == null && t.removeAttribute(e); | ||
Ne(t, e, r === null ? "" : r), r == null && t.removeAttribute(e); | ||
else { | ||
@@ -148,3 +148,3 @@ const s = n && e !== (e = e.replace(/^xlink\:?/, "")); | ||
} | ||
function w(t, e, ...r) { | ||
function C(t, e, ...r) { | ||
const { _isSVG: n, ...s } = e || {}; | ||
@@ -167,9 +167,9 @@ let i; | ||
const h = l, m = h.unhandledChildren || []; | ||
c.push(...m.map((E) => ({ ...E, path: [d, ...E.path] }))); | ||
c.push(...m.map((g) => ({ ...g, path: [d, ...g.path] }))); | ||
const y = h.unhandledAttr || []; | ||
a.push(...y.map((E) => ({ ...E, path: [d, ...E.path] }))); | ||
const g = h.refHandles || []; | ||
f.push(...g.map((E) => ({ ...E, path: [d, ...E.path] }))); | ||
const b = h.detachStyledChildren || []; | ||
p.push(...b.map((E) => ({ ...E, path: [d, ...E.path] }))), delete h.unhandledChildren, delete h.unhandledAttr, delete h.refHandles, delete h.detachStyledChildren; | ||
a.push(...y.map((g) => ({ ...g, path: [d, ...g.path] }))); | ||
const E = h.refHandles || []; | ||
f.push(...E.map((g) => ({ ...g, path: [d, ...g.path] }))); | ||
const x = h.detachStyledChildren || []; | ||
p.push(...x.map((g) => ({ ...g, path: [d, ...g.path] }))), delete h.unhandledChildren, delete h.unhandledAttr, delete h.refHandles, delete h.detachStyledChildren; | ||
} else { | ||
@@ -180,3 +180,3 @@ const h = document.createComment("unhandledChild"); | ||
}), s && (s.ref && (f.push({ handle: s.ref, path: [], el: i }), delete s.ref), s.detachStyle && (p.push({ el: i, style: s.detachStyle, path: [] }), delete s.detachStyle), Object.entries(s).forEach(([l, d]) => { | ||
w.isValidAttribute(l, d) ? z(i, l, d, n) : a.push({ el: i, key: l, value: d, path: [] }); | ||
C.isValidAttribute(l, d) ? z(i, l, d, n) : a.push({ el: i, key: l, value: d, path: [] }); | ||
})); | ||
@@ -187,3 +187,3 @@ const u = i; | ||
function ie(t) { | ||
return typeof t == "string" || typeof t == "number" || t instanceof M; | ||
return typeof t == "string" || typeof t == "number" || t instanceof k; | ||
} | ||
@@ -195,18 +195,18 @@ function Ve(t) { | ||
} | ||
w.isValidAttribute = function(t, e) { | ||
return Array.isArray(e) ? e.every((r) => w.isValidAttribute(t, r)) : !!(typeof e != "object" && typeof e != "function" || t[0] === "o" && t[1] === "n" && typeof e == "function" || (Ve(e) || typeof e == "string") && t === "style" || J(e) && t === "className"); | ||
C.isValidAttribute = function(t, e) { | ||
return Array.isArray(e) ? e.every((r) => C.isValidAttribute(t, r)) : !!(typeof e != "object" && typeof e != "function" || t[0] === "o" && t[1] === "n" && typeof e == "function" || (Ve(e) || typeof e == "string") && t === "style" || J(e) && t === "className"); | ||
}; | ||
w.attachRef = function(t, e) { | ||
C.attachRef = function(t, e) { | ||
if (Array.isArray(e)) { | ||
e.forEach((r) => w.attachRef(t, r)); | ||
e.forEach((r) => C.attachRef(t, r)); | ||
return; | ||
} | ||
typeof e == "function" ? e(t) : typeof e == "object" ? e.current = t : T(!1, "ref should be function or object with current property"); | ||
typeof e == "function" ? e(t) : typeof e == "object" ? e.current = t : A(!1, "ref should be function or object with current property"); | ||
}; | ||
w.detachRef = function(t) { | ||
C.detachRef = function(t) { | ||
if (Array.isArray(t)) { | ||
t.forEach((e) => w.detachRef(e)); | ||
t.forEach((e) => C.detachRef(e)); | ||
return; | ||
} | ||
typeof t == "function" ? t(null) : typeof t == "object" ? t.current = null : T(!1, "ref should be function or object with current property"); | ||
typeof t == "function" ? t(null) : typeof t == "object" ? t.current = null : A(!1, "ref should be function or object with current property"); | ||
}; | ||
@@ -219,11 +219,11 @@ function Ee() { | ||
} | ||
function P(t, e) { | ||
const r = e.parentNode.insertBefore(t, e); | ||
function b(t, e) { | ||
const r = e.fixparentNode.insertBefore(t, e); | ||
return t.tagName === "OPTION" && Ce(t), r; | ||
} | ||
function Dt(t, e, ...r) { | ||
return w(t, { _isSVG: !0, ...e || {} }, r); | ||
return C(t, { _isSVG: !0, ...e || {} }, r); | ||
} | ||
function je(t, e, ...r) { | ||
return w(t, { _isSVG: !0, ...e || {} }, r); | ||
return C(t, { _isSVG: !0, ...e || {} }, r); | ||
} | ||
@@ -233,3 +233,3 @@ function Vt(t, e) { | ||
} | ||
class M { | ||
class k { | ||
constructor(e, r = "px") { | ||
@@ -242,3 +242,3 @@ this.value = e, this.unit = r, typeof e == "string" && (this.unit = "mixed"); | ||
clone() { | ||
return new M(this.value, this.unit); | ||
return new k(this.value, this.unit); | ||
} | ||
@@ -257,3 +257,3 @@ valueOf() { | ||
this.value = this.value + e; | ||
else if (typeof this.value == "number" && e instanceof M && this.unit === e.unit) | ||
else if (typeof this.value == "number" && e instanceof k && this.unit === e.unit) | ||
this.value = this.value + e.value; | ||
@@ -269,3 +269,3 @@ else { | ||
this.value = this.value - e; | ||
else if (typeof this.value == "number" && e instanceof M && this.unit === e.unit) | ||
else if (typeof this.value == "number" && e instanceof k && this.unit === e.unit) | ||
this.value = this.value - e.value; | ||
@@ -285,3 +285,3 @@ else { | ||
} | ||
function x(t) { | ||
function P(t) { | ||
function e(...r) { | ||
@@ -296,3 +296,3 @@ var s, i, o; | ||
get() { | ||
return x({ | ||
return P({ | ||
...t, | ||
@@ -311,3 +311,3 @@ required: !0, | ||
get() { | ||
return (a) => x({ | ||
return (a) => P({ | ||
...t, | ||
@@ -323,3 +323,3 @@ required: n.required, | ||
} | ||
function H(t, e) { | ||
function T(t, e) { | ||
const { | ||
@@ -339,3 +339,3 @@ stringify: r = JSON.stringify, | ||
get() { | ||
return H(t, { | ||
return T(t, { | ||
...e, | ||
@@ -353,3 +353,3 @@ required: !0, | ||
get() { | ||
return (c) => H(t, { | ||
return (c) => T(t, { | ||
...e, | ||
@@ -363,3 +363,3 @@ required: a.required, | ||
} | ||
const _e = x({ | ||
const _e = P({ | ||
stringify(t) { | ||
@@ -377,3 +377,3 @@ return t === null ? "" : oe(this.argv[0][0]) ? t.toString() : JSON.stringify(t); | ||
zeroValue: "" | ||
}, ze = H("string", Be), Ge = { | ||
}, ze = T("string", Be), Ge = { | ||
stringify(t) { | ||
@@ -388,3 +388,3 @@ return t.toString(); | ||
zeroValue: 0 | ||
}, qe = H("number", Ge), We = { zeroValue: null }, Ke = H((t) => typeof t == "object" && !Array.isArray(t), We), Xe = H((t) => Array.isArray(t), {}), Ye = { zeroValue: !1 }, Ue = H("bool", Ye), Je = { | ||
}, qe = T("number", Ge), We = { zeroValue: null }, Ke = T((t) => typeof t == "object" && !Array.isArray(t), We), Xe = T((t) => Array.isArray(t), {}), Ye = { zeroValue: !1 }, Ue = T("bool", Ye), Je = { | ||
stringify(t) { | ||
@@ -397,3 +397,3 @@ return t.toString(); | ||
} | ||
}, Ze = H("function", Je), Qe = H("symbol", {}), et = { | ||
}, Ze = T("function", Je), Qe = T("symbol", {}), et = { | ||
stringify() { | ||
@@ -408,3 +408,3 @@ throw new Error("type any can not stringify"); | ||
} | ||
}, G = H(() => !0, et), tt = x({ | ||
}, G = T(() => !0, et), tt = P({ | ||
check(t) { | ||
@@ -430,3 +430,3 @@ return this.argv[0].some((e) => e.check(t)); | ||
} | ||
}), rt = x({ | ||
}), rt = P({ | ||
check(t) { | ||
@@ -440,3 +440,3 @@ return Array.isArray(t) ? t.every((e) => this.argv[0].check(e)) : !1; | ||
zeroValue: [] | ||
}), nt = x({ | ||
}), nt = P({ | ||
check(t) { | ||
@@ -449,3 +449,3 @@ return !0; | ||
} | ||
}), st = x({ | ||
}), st = P({ | ||
check(t) { | ||
@@ -465,3 +465,3 @@ return Object.entries(this.argv[0]).every(([e, r]) => r.check(t[e])); | ||
function lt() { | ||
return x({ | ||
return P({ | ||
coerce: (t) => B(t) ? t : U(t) | ||
@@ -471,3 +471,3 @@ })(); | ||
function ht() { | ||
return x({ | ||
return P({ | ||
coerce: (t) => t instanceof j ? t : new j(t) | ||
@@ -477,3 +477,3 @@ })(); | ||
function ft() { | ||
return x({ | ||
return P({ | ||
coerce: (t) => t instanceof te ? t : new te(t) | ||
@@ -483,7 +483,7 @@ })(); | ||
function ut() { | ||
return x({ | ||
return P({ | ||
coerce: (t) => t instanceof re ? t : new re(t) | ||
})(); | ||
} | ||
const $ = { | ||
const v = { | ||
string: ze, | ||
@@ -527,3 +527,3 @@ number: qe, | ||
constructor(e, r, n) { | ||
this.source = e, this.placeholder = r, this.pathContext = n, this.createHost = ([s, i]) => R(s, i, { ...this.pathContext, hostPath: [...this.pathContext.hostPath, this] }); | ||
this.source = e, this.placeholder = r, this.pathContext = n, this.createHost = ([s, i]) => L(s, i, { ...this.pathContext, hostPath: [...this.pathContext.hostPath, this] }); | ||
} | ||
@@ -545,3 +545,3 @@ createPlaceholder(e) { | ||
function() { | ||
if (this.manualTrack(e.source, k.METHOD, I.METHOD), this.manualTrack(e.source, k.EXPLICIT_KEY_CHANGE, I.EXPLICIT_KEY_CHANGE), e.hostsComputed) | ||
if (this.manualTrack(e.source, M.METHOD, N.METHOD), this.manualTrack(e.source, M.EXPLICIT_KEY_CHANGE, N.EXPLICIT_KEY_CHANGE), e.hostsComputed) | ||
throw new Error("should never recompute reactiveArray"); | ||
@@ -586,7 +586,7 @@ return e.source.map(e.createPlaceholder); | ||
throw new Error("hostsComputed should not recompute"); | ||
this.manualTrack(e.placeholderAndItemComputed, k.METHOD, I.METHOD), this.manualTrack(e.placeholderAndItemComputed, k.EXPLICIT_KEY_CHANGE, I.EXPLICIT_KEY_CHANGE); | ||
const n = e.placeholderAndItemComputed.map(([o, a]) => R(o, a, { ...e.pathContext, hostPath: [...e.pathContext.hostPath, e] })), s = document.createDocumentFragment(); | ||
this.manualTrack(e.placeholderAndItemComputed, M.METHOD, N.METHOD), this.manualTrack(e.placeholderAndItemComputed, M.EXPLICIT_KEY_CHANGE, N.EXPLICIT_KEY_CHANGE); | ||
const n = e.placeholderAndItemComputed.map(([o, a]) => L(o, a, { ...e.pathContext, hostPath: [...e.pathContext.hostPath, e] })), s = document.createDocumentFragment(); | ||
return n.forEach((o) => { | ||
s.appendChild(o.placeholder), o.render(); | ||
}), P(s, e.placeholder), n; | ||
}), b(s, e.placeholder), n; | ||
}, | ||
@@ -600,3 +600,3 @@ function(n, s) { | ||
d.appendChild(h.placeholder), h.render(); | ||
}), P(d, e.placeholder), n.push(...l); | ||
}), b(d, e.placeholder), n.push(...l); | ||
} else if (i === "pop") | ||
@@ -610,3 +610,3 @@ n.pop().destroy(); | ||
d.appendChild(h.placeholder), h.render(); | ||
}), P(d, e.element), n.unshift(...l); | ||
}), b(d, e.element), n.unshift(...l); | ||
} else if (i === "splice") { | ||
@@ -621,3 +621,3 @@ const l = document.createDocumentFragment(), d = o.slice(2).map(e.createHost); | ||
const h = dt(o, n.length); | ||
P(l, ((c = n[o[0] + h]) == null ? void 0 : c.element) || e.placeholder), n.splice(o[0], h, ...d).forEach((y) => y.destroy()); | ||
b(l, ((c = n[o[0] + h]) == null ? void 0 : c.element) || e.placeholder), n.splice(o[0], h, ...d).forEach((y) => y.destroy()); | ||
} | ||
@@ -631,3 +631,3 @@ } else if (!i && a) | ||
var h; | ||
n[l].destroy(), n[l] = e.createHost(d), P(n[l].placeholder, ((h = n[parseInt(l, 10) + 1]) == null ? void 0 : h.element) || e.placeholder), n[l].render(); | ||
n[l].destroy(), n[l] = e.createHost(d), b(n[l].placeholder, ((h = n[parseInt(l, 10) + 1]) == null ? void 0 : h.element) || e.placeholder), n[l].render(); | ||
}); | ||
@@ -648,3 +648,3 @@ else | ||
typeof e != "function" && (ae.has(e) && console.error("static portal content can only be rendered once. Use function content for content has reactive parts."), ae.add(e)); | ||
const i = Ot(t, s); | ||
const i = Rt(t, s); | ||
return i.render(e), n(() => () => { | ||
@@ -669,3 +669,3 @@ i.destroy(); | ||
} | ||
function L(t) { | ||
function H(t) { | ||
return t ? Array.isArray(t) ? t : [t] : []; | ||
@@ -680,25 +680,25 @@ } | ||
function K(t, e, r) { | ||
return e && (t.startsWith("on") || t === "ref" || t === "style" || t === "classname" || t === "class") ? t === "style" ? L(e).concat(r) : L(r).concat(e) : r; | ||
return e && (t.startsWith("on") || t === "ref" || t === "style" || t === "classname" || t === "class") ? t === "style" ? H(e).concat(r) : H(r).concat(e) : r; | ||
} | ||
const q = "__config__", we = class N { | ||
const q = "__config__", we = class $ { | ||
constructor({ type: e, props: r = {}, children: n }, s, i) { | ||
this.placeholder = s, this.pathContext = i, this.layoutEffects = /* @__PURE__ */ new Set(), this.effects = /* @__PURE__ */ new Set(), this.destroyCallback = /* @__PURE__ */ new Set(), this.layoutEffectDestroyHandles = /* @__PURE__ */ new Set(), this.refs = He({}), this.itemConfig = {}, this.frame = [], this.exposed = {}, this.createHTMLOrSVGElement = (o, a, c, ...f) => { | ||
var b, E, C, O; | ||
var x, g, O, I; | ||
const p = typeof a == "function", u = c == null ? void 0 : c.as; | ||
if (c == null || delete c.as, T(u !== "self", '"self" is reserved, please use another element name.'), u && ((b = this.itemConfig[u]) != null && b.use) && ((E = this.itemConfig[u]) == null ? void 0 : E.use) instanceof Element) | ||
if (c == null || delete c.as, A(u !== "self", '"self" is reserved, please use another element name.'), u && ((x = this.itemConfig[u]) != null && x.use) && ((g = this.itemConfig[u]) == null ? void 0 : g.use) instanceof Element) | ||
return this.itemConfig[u].use; | ||
let l = f, { props: d, componentProps: h } = this.separateProps(c); | ||
const m = this.itemConfig[u]; | ||
u && m && (m.props && (p ? d = { ...c, ...m.props } : d = Et(c, m.props)), m.propMergeHandles && Object.entries(m.propMergeHandles).forEach(([A, v]) => { | ||
d[A] = v.reduce((Te, xe) => xe(Te, h), d[A]); | ||
}), m.propsMergeHandle && (d = m.propsMergeHandle.reduce((A, v) => v(A, h), d)), m.children && (l = m.children)); | ||
const y = ((C = this.itemConfig[u]) == null ? void 0 : C.use) || a; | ||
typeof y == "function" && !p && (h[wt] = d, d = h), typeof y == "function" && ((O = m == null ? void 0 : m.configProps) != null && O.length) && Object.assign(d, { [q]: m.configProps }), u && (d.ref = L(d.ref).concat((A) => this.refs[u] = A)); | ||
const g = o ? je(y, d, ...l) : w(y, d, ...l); | ||
u && m && (m.props && (p ? d = { ...c, ...m.props } : d = Et(c, m.props)), m.propMergeHandles && Object.entries(m.propMergeHandles).forEach(([S, R]) => { | ||
d[S] = R.reduce((Te, xe) => xe(Te, h), d[S]); | ||
}), m.propsMergeHandle && (d = m.propsMergeHandle.reduce((S, R) => R(S, h), d)), m.children && (l = m.children)); | ||
const y = ((O = this.itemConfig[u]) == null ? void 0 : O.use) || a; | ||
typeof y == "function" && !p && (h[wt] = d, d = h), typeof y == "function" && ((I = m == null ? void 0 : m.configProps) != null && I.length) && Object.assign(d, { [q]: m.configProps }), u && (d.ref = H(d.ref).concat((S) => this.refs[u] = S)); | ||
const E = o ? je(y, d, ...l) : C(y, d, ...l); | ||
if (typeof y != "function") { | ||
const A = this.pathContext.hostPath.filter((v) => v instanceof N).map((v) => v.props).reverse(); | ||
g.listenerBoundArgs = [A, h]; | ||
const S = this.pathContext.hostPath.filter((R) => R instanceof $).map((R) => R.props).reverse(); | ||
E.listenerBoundArgs = [S, h]; | ||
} | ||
return g; | ||
}, this.createElement = this.createHTMLOrSVGElement.bind(this, !1), this.createSVGElement = this.createHTMLOrSVGElement.bind(this, !0), this.createPortal = (o, a) => w(mt, { container: a, content: o }), this.useLayoutEffect = (o) => { | ||
return E; | ||
}, this.createElement = this.createHTMLOrSVGElement.bind(this, !1), this.createSVGElement = this.createHTMLOrSVGElement.bind(this, !0), this.createPortal = (o, a) => C(mt, { container: a, content: o }), this.useLayoutEffect = (o) => { | ||
this.layoutEffects.add(o); | ||
@@ -722,3 +722,3 @@ }, this.useEffect = (o) => { | ||
}); | ||
}, N.typeIds.has(e) || N.typeIds.set(e, N.typeIds.size), this.name = e.name, this.type = e, this.props = {}, this.refProp = r.ref, this.thisProp = r.__this, this.inputProps = r, this.children = n; | ||
}, $.typeIds.has(e) || $.typeIds.set(e, $.typeIds.size), this.name = e.name, this.type = e, this.props = {}, this.refProp = r.ref, this.thisProp = r.__this, this.inputProps = r, this.children = n; | ||
} | ||
@@ -729,17 +729,17 @@ parseItemConfigFromProp(e, r, n) { | ||
if (e[s] || (e[s] = {}), i === "_eventTarget") | ||
e[s].eventTarget = L(e[s].eventTarget).concat(n); | ||
e[s].eventTarget = H(e[s].eventTarget).concat(n); | ||
else if (i === "_use") | ||
e[s].use = n; | ||
else if (i === "_props") | ||
e[s].propsMergeHandle = L(e[s].propsMergeHandle).concat(n); | ||
e[s].propsMergeHandle = H(e[s].propsMergeHandle).concat(n); | ||
else if (i === "_children") | ||
e[s].children = n; | ||
else if (i === void 0 || i === "") | ||
e[s].configProps = L(e[s].configProps).concat(n); | ||
e[s].configProps = H(e[s].configProps).concat(n); | ||
else if ((i == null ? void 0 : i[0]) === "_") | ||
T(!1, `unsupported config item: ${s}`); | ||
A(!1, `unsupported config item: ${s}`); | ||
else if (i.endsWith("_")) { | ||
e[s].propMergeHandles || (e[s].propMergeHandles = {}); | ||
const o = i.slice(0, -1); | ||
e[s].propMergeHandles[o] = L(e[s].propMergeHandles[o]).concat(n); | ||
e[s].propMergeHandles[o] = H(e[s].propMergeHandles[o]).concat(n); | ||
} else | ||
@@ -751,3 +751,3 @@ e[s].props || (e[s].props = {}), e[s].props[i] = K(i, e[s].props[i], n); | ||
get typeId() { | ||
return N.typeIds.get(this.type); | ||
return $.typeIds.get(this.type); | ||
} | ||
@@ -808,3 +808,3 @@ get parentElement() { | ||
render() { | ||
this.element !== this.placeholder && T(!1, "should never rerender"), this.renderContext = { | ||
this.element !== this.placeholder && A(!1, "should never rerender"), this.renderContext = { | ||
Fragment: Ee, | ||
@@ -830,3 +830,3 @@ createElement: this.createElement, | ||
const i = this.type(s, this.renderContext); | ||
this.frame = e(), this.innerHost = R(i, this.placeholder, { ...this.pathContext, hostPath: [...this.pathContext.hostPath, this] }), this.innerHost.render(), this.refProp && this.attachRef(this.refProp), this.thisProp && this.attachThis(this.thisProp), this.effects.forEach((o) => { | ||
this.frame = e(), this.innerHost = L(i, this.placeholder, { ...this.pathContext, hostPath: [...this.pathContext.hostPath, this] }), this.innerHost.render(), this.refProp && this.attachRef(this.refProp), this.thisProp && this.attachThis(this.thisProp), this.effects.forEach((o) => { | ||
const a = o(); | ||
@@ -863,3 +863,3 @@ typeof a == "function" && this.destroyCallback.add(a); | ||
const r = t.bind(null); | ||
return r.propTypes = t.propTypes, r.boundProps = L(r.boundProps).concat(e), r; | ||
return r.propTypes = t.propTypes, r.boundProps = H(r.boundProps).concat(e), r; | ||
} | ||
@@ -915,4 +915,4 @@ function ce(t) { | ||
const n = this.source(), s = document.createComment("computed node"); | ||
P(s, this.placeholder); | ||
const i = R(n, s, { ...this.pathContext, hostPath: [...this.pathContext.hostPath, this] }); | ||
b(s, this.placeholder); | ||
const i = L(n, s, { ...this.pathContext, hostPath: [...this.pathContext.hostPath, this] }); | ||
se.instance.pauseTracking(), i.render(), se.instance.resetTracking(), r(() => { | ||
@@ -931,4 +931,4 @@ i.destroy(!1, !1); | ||
} | ||
const At = w.isValidAttribute; | ||
w.isValidAttribute = function(t, e) { | ||
const At = C.isValidAttribute; | ||
C.isValidAttribute = function(t, e) { | ||
return t.startsWith("on") ? !0 : Array.isArray(e) && e.some(le) || le(e) ? !1 : At(t, e); | ||
@@ -987,3 +987,3 @@ }; | ||
const f = X(c[0]); | ||
return f.length && he(s), Oe(c.slice(1).map((p) => () => { | ||
return f.length && he(s), Re(c.slice(1).map((p) => () => { | ||
const [u, l, d] = this.separateStyleObject(p, f); | ||
@@ -1052,3 +1052,3 @@ if (l && this.generateStyleContent(`.${o}`, l).forEach((h) => { | ||
(s = this.refHandles) == null || s.forEach(({ handle: i, el: o }) => { | ||
w.attachRef(o, i); | ||
C.attachRef(o, i); | ||
}); | ||
@@ -1062,3 +1062,3 @@ }; | ||
var e; | ||
T(this.element === this.placeholder, "should never rerender"), this.element = this.source instanceof DocumentFragment ? document.createComment("fragment start") : this.source, P(this.source, this.placeholder), this.collectInnerHost(), this.collectReactiveAttr(), this.collectRefHandles(), this.collectDetachStyledChildren(), (e = this.detachStyledChildren) != null && e.length && (this.forceHandleElement = !0), this.reactiveHosts.forEach((r) => r.render()), this.pathContext.root.attached ? this.attachRefs() : this.pathContext.root.on("attach", this.attachRefs); | ||
A(this.element === this.placeholder, "should never rerender"), this.element = this.source instanceof DocumentFragment ? document.createComment("fragment start") : this.source, b(this.source, this.placeholder), this.collectInnerHost(), this.collectReactiveAttr(), this.collectRefHandles(), this.collectDetachStyledChildren(), (e = this.detachStyledChildren) != null && e.length && (this.forceHandleElement = !0), this.reactiveHosts.forEach((r) => r.render()), this.pathContext.root.attached ? this.attachRefs() : this.pathContext.root.on("attach", this.attachRefs); | ||
} | ||
@@ -1071,3 +1071,3 @@ collectInnerHost() { | ||
this.reactiveHosts = r ? r.map( | ||
({ placeholder: n, child: s, path: i }) => R(s, n, { | ||
({ placeholder: n, child: s, path: i }) => L(s, n, { | ||
...this.pathContext, | ||
@@ -1113,3 +1113,3 @@ hostPath: [...this.pathContext.hostPath, this], | ||
r || (n = this.attrAutoruns) == null || n.forEach((o) => o()), (s = this.reactiveHosts) == null || s.forEach((o) => o.destroy(!0, r)), (i = this.refHandles) == null || i.forEach(({ handle: o }) => { | ||
w.detachRef(o); | ||
C.detachRef(o); | ||
}), this.removeElements(e); | ||
@@ -1168,6 +1168,6 @@ } | ||
e.appendChild(s); | ||
const i = R(r, s, { ...this.pathContext, hostPath: [...this.pathContext.hostPath, this] }); | ||
const i = L(r, s, { ...this.pathContext, hostPath: [...this.pathContext.hostPath, this] }); | ||
this.childHosts.push(i), n === 0 && (this.firstChild = i); | ||
} | ||
}), this.childHosts.forEach((r) => r.render()), P(e, this.placeholder); | ||
}), this.childHosts.forEach((r) => r.render()), b(e, this.placeholder); | ||
} else | ||
@@ -1203,5 +1203,5 @@ throw new Error("should never rerender"); | ||
const e = this; | ||
this.hosts = this.source.map((r) => R(r, document.createComment("rx list item"), { ...this.pathContext, hostPath: [...this.pathContext.hostPath, this] })), this.hostRenderComputed = ue( | ||
this.hosts = this.source.map((r) => L(r, document.createComment("rx list item"), { ...this.pathContext, hostPath: [...this.pathContext.hostPath, this] })), this.hostRenderComputed = ue( | ||
function() { | ||
return this.manualTrack(e.hosts, k.METHOD, I.METHOD), this.manualTrack(e.hosts, k.EXPLICIT_KEY_CHANGE, I.EXPLICIT_KEY_CHANGE), P(e.renderNewHosts(e.hosts), e.placeholder), null; | ||
return this.manualTrack(e.hosts, M.METHOD, N.METHOD), this.manualTrack(e.hosts, M.EXPLICIT_KEY_CHANGE, N.EXPLICIT_KEY_CHANGE), b(e.renderNewHosts(e.hosts), e.placeholder), null; | ||
}, | ||
@@ -1212,10 +1212,13 @@ function(n, s) { | ||
if (i === "splice") { | ||
const h = e.hosts.data.slice(o[0] + o.slice(2).length).find((C) => C.element.parentNode), m = o.slice(2), y = e.renderNewHosts(m); | ||
P(y, (h == null ? void 0 : h.element) || e.placeholder); | ||
const g = e.isOnlyChildrenOfParent(), b = p; | ||
if (b.length === e.hosts.length() && g && ((l = e.hosts) == null ? void 0 : l.data.every((C) => !C.forceHandleElement))) { | ||
const C = e.placeholder.parentNode; | ||
C instanceof HTMLElement && (C.innerHTML = ""), C.appendChild(e.placeholder), b.forEach((O) => O.destroy(!0)); | ||
const h = e.hosts.data.slice(o[0] + o.slice(2).length).find((g) => g.element.parentNode), m = o.slice(2); | ||
if (m.length) { | ||
const g = e.renderNewHosts(m); | ||
b(g, (h == null ? void 0 : h.element) || e.placeholder); | ||
} | ||
const y = e.isOnlyChildrenOfParent(), E = p; | ||
if (E.length === e.hosts.length() && y && ((l = e.hosts) == null ? void 0 : l.data.every((g) => !g.forceHandleElement))) { | ||
const g = e.placeholder.parentNode; | ||
g instanceof HTMLElement && (g.innerHTML = ""), g.appendChild(e.placeholder), E.forEach((O) => O.destroy(!0)); | ||
} else | ||
b.forEach((C) => C.destroy()); | ||
E.forEach((g) => g.destroy()); | ||
} else if (i === void 0 && c !== void 0) { | ||
@@ -1225,3 +1228,3 @@ const h = p; | ||
const m = c; | ||
P(e.hosts.at(m).placeholder, ((d = e.hosts.at(m + 1)) == null ? void 0 : d.element) || e.placeholder), e.hosts.at(m).render(); | ||
b(e.hosts.at(m).placeholder, ((d = e.hosts.at(m + 1)) == null ? void 0 : d.element) || e.placeholder), e.hosts.at(m).render(); | ||
} else | ||
@@ -1249,3 +1252,3 @@ throw new Error("unknown trigger info"); | ||
} | ||
class Rt { | ||
class Ot { | ||
constructor(e, r, n) { | ||
@@ -1255,3 +1258,3 @@ this.source = e, this.placeholder = r, this.pathContext = n, this.element = this.placeholder; | ||
render() { | ||
this.element = document.createTextNode(this.source.toString()), P(this.element, this.placeholder); | ||
this.element = document.createTextNode(this.source.toString()), b(this.element, this.placeholder); | ||
} | ||
@@ -1262,9 +1265,9 @@ destroy(e) { | ||
} | ||
function R(t, e, r) { | ||
function L(t, e, r) { | ||
if (!(e instanceof Comment)) | ||
throw new Error("incorrect placeholder type"); | ||
let n; | ||
return t instanceof j ? n = new Ht(t, e, r) : Array.isArray(t) ? pe(t) ? n = new pt(t, e, r) : n = new xt(t, e, r) : typeof t == "object" && typeof (t == null ? void 0 : t.type) == "function" ? n = new Q(t, e, r) : B(t) ? n = new St(t, e, r) : typeof t == "function" ? n = new bt(t, e, r) : t instanceof HTMLElement || t instanceof SVGElement || t instanceof DocumentFragment ? n = new Tt(t, e, r) : t == null ? n = new Lt(r) : typeof t == "string" || typeof t == "number" || typeof t == "boolean" ? n = new Rt(t, e, r) : T(!1, `unknown child type ${t}`), n; | ||
return t instanceof j ? n = new Ht(t, e, r) : Array.isArray(t) ? pe(t) ? n = new pt(t, e, r) : n = new xt(t, e, r) : typeof t == "object" && typeof (t == null ? void 0 : t.type) == "function" ? n = new Q(t, e, r) : B(t) ? n = new St(t, e, r) : typeof t == "function" ? n = new bt(t, e, r) : t instanceof HTMLElement || t instanceof SVGElement || t instanceof DocumentFragment ? n = new Tt(t, e, r) : t == null ? n = new Lt(r) : typeof t == "string" || typeof t == "number" || typeof t == "boolean" ? n = new Ot(t, e, r) : A(!1, `unknown child type ${t}`), n; | ||
} | ||
function Ot(t, e) { | ||
function Rt(t, e) { | ||
const r = /* @__PURE__ */ new Map(), n = e || { | ||
@@ -1280,3 +1283,3 @@ hostPath: [], | ||
const o = document.createComment("root"); | ||
return t.appendChild(o), s.host = R(i, o, n), s.host.render(), document.body.contains(t) && (s.dispatch("attach"), s.attached = !0), s.host; | ||
return t.appendChild(o), s.host = L(i, o, n), s.host.render(), document.body.contains(t) && (s.dispatch("attach"), s.attached = !0), s.host; | ||
}, | ||
@@ -1301,3 +1304,3 @@ destroy() { | ||
} | ||
function S(t) { | ||
function w(t) { | ||
return (e) => (r) => { | ||
@@ -1308,3 +1311,3 @@ if (t(r)) | ||
} | ||
const Ft = S((t) => t.key === "ArrowUp"), _t = S((t) => t.key === "ArrowDown"), Bt = S((t) => t.key === "ArrowLeft"), zt = S((t) => t.key === "ArrowRight"), Gt = S((t) => t.key === "Enter"), qt = S((t) => t.key === "Tab"), Wt = S((t) => t.key === "Escape"), Kt = S((t) => t.key === "Backspace"), Xt = S((t) => t.key === "Space"), Yt = S((t) => t.button === 0), Ut = S((t) => t.button === 2), Jt = S((t) => t.button === 1), Zt = (t, e) => S((r) => e != null && e.meta && !r.metaKey || e != null && e.ctrl && !r.ctrlKey || e != null && e.alt && !r.altKey || e != null && e.shift && !r.shiftKey ? !1 : r.key === t), Qt = S((t) => t.target === t.currentTarget); | ||
const Ft = w((t) => t.key === "ArrowUp"), _t = w((t) => t.key === "ArrowDown"), Bt = w((t) => t.key === "ArrowLeft"), zt = w((t) => t.key === "ArrowRight"), Gt = w((t) => t.key === "Enter"), qt = w((t) => t.key === "Tab"), Wt = w((t) => t.key === "Escape"), Kt = w((t) => t.key === "Backspace"), Xt = w((t) => t.key === "Space"), Yt = w((t) => t.button === 0), Ut = w((t) => t.button === 2), Jt = w((t) => t.button === 1), Zt = (t, e) => w((r) => e != null && e.meta && !r.metaKey || e != null && e.ctrl && !r.ctrlKey || e != null && e.alt && !r.altKey || e != null && e.shift && !r.shiftKey ? !1 : r.key === t), Qt = w((t) => t.target === t.currentTarget); | ||
function er(t) { | ||
@@ -1364,14 +1367,14 @@ let e; | ||
const $t = vt("Form"); | ||
function Nt({ name: t, children: e, onChange: r, onSubmit: n, onClear: s, onReset: i, values: o }, { | ||
function Mt({ name: t, children: e, onChange: r, onSubmit: n, onClear: s, onReset: i, values: o }, { | ||
createElement: a, | ||
context: c | ||
}) { | ||
const f = {}, p = (y, g, b) => { | ||
b ? (o.get(y) || o.set(y, new j([])), f[y] || (f[y] = []), o.get(y).push(g.value)(f[y]).push(g)) : (o.set(y, g.value), f[y] = g); | ||
}, u = (y, g, b) => { | ||
if (b) { | ||
const E = o.get(y), C = E.findIndex((A) => A === g.value); | ||
C() > -1 && E.splice(C(), 1); | ||
const O = f[y].findIndex((A) => A === g); | ||
O > -1 && f[y].splice(O, 1); | ||
const f = {}, p = (y, E, x) => { | ||
x ? (o.get(y) || o.set(y, new j([])), f[y] || (f[y] = []), o.get(y).push(E.value)(f[y]).push(E)) : (o.set(y, E.value), f[y] = E); | ||
}, u = (y, E, x) => { | ||
if (x) { | ||
const g = o.get(y), O = g.findIndex((S) => S === E.value); | ||
O() > -1 && g.splice(O(), 1); | ||
const I = f[y].findIndex((S) => S === E); | ||
I > -1 && f[y].splice(I, 1); | ||
} else | ||
@@ -1383,7 +1386,7 @@ o.delete(y), delete f[y]; | ||
Object.values(f).forEach((y) => { | ||
Array.isArray(y) ? y.forEach((g) => g.reset()) : y.reset(); | ||
Array.isArray(y) ? y.forEach((E) => E.reset()) : y.reset(); | ||
}), i == null || i(); | ||
}, h = () => { | ||
Object.values(f).forEach((y) => { | ||
Array.isArray(y) ? y.forEach((g) => g.clear()) : y.clear(); | ||
Array.isArray(y) ? y.forEach((E) => E.clear()) : y.clear(); | ||
}), s == null || s(); | ||
@@ -1395,10 +1398,10 @@ }, m = () => { | ||
} | ||
Nt.propTypes = { | ||
name: $.string.isRequired, | ||
values: $.rxMap(), | ||
children: $.any.isRequired, | ||
onChange: $.function, | ||
onSubmit: $.function, | ||
onClear: $.function, | ||
onReset: $.function | ||
Mt.propTypes = { | ||
name: v.string.isRequired, | ||
values: v.rxMap(), | ||
children: v.any.isRequired, | ||
onChange: v.function, | ||
onSubmit: v.function, | ||
onClear: v.function, | ||
onReset: v.function | ||
}; | ||
@@ -1453,3 +1456,3 @@ const ir = Symbol("ModalContext"); | ||
} else | ||
T(!1, "invalid options.position"); | ||
A(!1, "invalid options.position"); | ||
}; | ||
@@ -1506,5 +1509,5 @@ } | ||
} | ||
const kt = "dragmove"; | ||
const Nt = "dragmove"; | ||
function lr(t) { | ||
const e = (t == null ? void 0 : t.container) || document.body, r = (t == null ? void 0 : t.customEventName) || kt; | ||
const e = (t == null ? void 0 : t.container) || document.body, r = (t == null ? void 0 : t.customEventName) || Nt; | ||
return function(s) { | ||
@@ -1584,5 +1587,5 @@ const i = (o) => { | ||
sr as ContextProvider, | ||
kt as DEFAULT_DRAG_MOVE_EVENT, | ||
Nt as DEFAULT_DRAG_MOVE_EVENT, | ||
Ct as DataContext, | ||
Nt as Form, | ||
Mt as Form, | ||
$t as FormContext, | ||
@@ -1593,11 +1596,11 @@ Ee as Fragment, | ||
mt as Portal, | ||
$ as PropTypes, | ||
M as StyleSize, | ||
v as PropTypes, | ||
k as StyleSize, | ||
$e as autoUnit, | ||
jt as bindProps, | ||
vt as createContext, | ||
w as createElement, | ||
C as createElement, | ||
Dt as createElementNS, | ||
er as createEventTransfer, | ||
R as createHost, | ||
L as createHost, | ||
lr as createOnDragMove, | ||
@@ -1608,6 +1611,6 @@ hr as createReactiveDragPosition, | ||
yt as createRef, | ||
Ot as createRoot, | ||
Rt as createRoot, | ||
gt as createRxRef, | ||
Vt as dispatchEvent, | ||
S as eventAlias, | ||
w as eventAlias, | ||
K as mergeProp, | ||
@@ -1632,3 +1635,3 @@ Et as mergeProps, | ||
ar as reactiveSize, | ||
Mt as setAutoUnitType, | ||
kt as setAutoUnitType, | ||
tr as withCurrentRange, | ||
@@ -1635,0 +1638,0 @@ rr as withPreventDefault, |
{ | ||
"name": "axii", | ||
"version": "2.6.34", | ||
"version": "2.6.35", | ||
"description": "", | ||
@@ -36,4 +36,4 @@ "main": "index.js", | ||
"peerDependencies": { | ||
"data0": "^1.7.25" | ||
"data0": "^1.7.26" | ||
} | ||
} |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
536088
2935