Comparing version 2.6.70 to 2.6.72
408
dist/axii.js
@@ -1,4 +0,4 @@ | ||
import { isAtom as q, atom as Q, RxList as _, RxSet as re, RxMap as ne, reactive as Pe, ReactiveEffect as Te, computed as pe, destroyComputed as me, autorun as ye, Notifier as se, isReactive as ve, TrackOpTypes as ie, TriggerOpTypes as oe } from "data0"; | ||
import { isAtom as W, atom as Q, RxList as _, RxSet as re, RxMap as ne, reactive as Te, ReactiveEffect as ve, computed as pe, destroyComputed as me, autorun as ye, Notifier as se, isReactive as Re, TrackOpTypes as ie, TriggerOpTypes as oe } from "data0"; | ||
export * from "data0"; | ||
function Re(t, e) { | ||
function Le(t, e) { | ||
for (let r in t) | ||
@@ -18,3 +18,3 @@ e(t[r], r); | ||
} | ||
const G = (t) => (t == null ? void 0 : t.constructor) === Object; | ||
const q = (t) => (t == null ? void 0 : t.constructor) === Object; | ||
function C(t, e) { | ||
@@ -33,3 +33,3 @@ if (!t) | ||
} | ||
function Le(t) { | ||
function ke(t) { | ||
return t.length ? new Promise((e) => { | ||
@@ -45,13 +45,13 @@ let r = 0; | ||
let Ee = "px"; | ||
function Vt(t) { | ||
function It(t) { | ||
Ee = t; | ||
} | ||
function ke(t) { | ||
function He(t) { | ||
return typeof t == "string" ? t : `${t}${Ee}`; | ||
} | ||
const He = /^(boxShadow|textShadow|transition|animation|backgroundImage)/; | ||
const Oe = /^(boxShadow|textShadow|transition|animation|backgroundImage)/; | ||
function ee(t, e) { | ||
return e === void 0 ? "" : Array.isArray(e) ? He.test(t) ? e.join(",") : e.map((r) => ee(t, r)).join(" ") : typeof e == "number" && $e.test(t) ? ke(e) : e.toString(); | ||
return e === void 0 ? "" : Array.isArray(e) ? Oe.test(t) ? e.join(",") : e.map((r) => ee(t, r)).join(" ") : typeof e == "number" && $e.test(t) ? He(e) : e.toString(); | ||
} | ||
function Oe(t, e, r) { | ||
function Ne(t, e, r) { | ||
try { | ||
@@ -67,3 +67,3 @@ t[e] = r; | ||
} | ||
function Ne(t) { | ||
function Ve(t) { | ||
const e = this._captureListeners[t.type]; | ||
@@ -73,8 +73,8 @@ return Array.isArray(e) ? e.forEach((r) => r == null ? void 0 : r(t, ...this.listenerBoundArgs || [])) : e == null ? void 0 : e(t, ...this.listenerBoundArgs || []); | ||
const X = /* @__PURE__ */ new WeakMap(); | ||
function Ve(t) { | ||
function Ie(t) { | ||
return t[0] === "o" && t[1] === "n"; | ||
} | ||
const Ie = /^(strokeWidth|strokeLinecap|strokeLinejoin|strokeMiterlimit|strokeDashoffset|strokeDasharray|strokeOpacity|fillOpacity|stopOpacity)/; | ||
const Me = /^(strokeWidth|strokeLinecap|strokeLinejoin|strokeMiterlimit|strokeDashoffset|strokeDasharray|strokeOpacity|fillOpacity|stopOpacity)/; | ||
function V(t, e, r, n) { | ||
if (Array.isArray(r) && e !== "style" && e !== "className" && !Ve(e)) | ||
if (Array.isArray(r) && e !== "style" && e !== "className" && !Ie(e)) | ||
return V(t, e, r.at(-1), n); | ||
@@ -89,3 +89,3 @@ if (e === "uuid") { | ||
i === "change" && (i = "input"); | ||
const o = s ? Ne : Se; | ||
const o = s ? Ve : Se; | ||
r ? t.addEventListener(i, o, s) : t.removeEventListener(i, o, s); | ||
@@ -98,3 +98,3 @@ const a = s ? t._captureListeners || (t._captureListeners = {}) : t._listeners || (t._listeners = {}); | ||
(!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" ? Le(i, (o, a) => { | ||
t.style[a] = ee(a, o); | ||
@@ -127,3 +127,3 @@ }) : C(!1, "style can only be string or object."); | ||
else if (e !== "list" && e !== "type" && !n && e in t) | ||
Oe(t, e, r === null ? "" : r), r == null && t.removeAttribute(e); | ||
Ne(t, e, r === null ? "" : r), r == null && t.removeAttribute(e); | ||
else { | ||
@@ -136,3 +136,3 @@ const s = n && e !== (e = e.replace(/^xlink\:?/, "")); | ||
else { | ||
const i = n && Ie.test(e) ? e.replace(/([a-z])([A-Z])/g, "$1-$2").toLowerCase() : e; | ||
const i = n && Me.test(e) ? e.replace(/([a-z])([A-Z])/g, "$1-$2").toLowerCase() : e; | ||
t.setAttribute(i, r); | ||
@@ -154,3 +154,3 @@ } | ||
f.forEach((h, E) => { | ||
var b, P, v, R; | ||
var w, P, v, R; | ||
if (h != null) | ||
@@ -162,3 +162,3 @@ if (typeof h == "string" || typeof h == "number") | ||
const y = h; | ||
(b = y.unhandledChildren) != null && b.length && (p.push(...y.unhandledChildren.map((S) => ({ ...S, path: [E, ...S.path] }))), y.unhandledChildren = void 0), (P = y.unhandledAttr) != null && P.length && (l.push(...y.unhandledAttr.map((S) => ({ ...S, path: [E, ...S.path] }))), y.unhandledAttr = void 0), (v = y.refHandles) != null && v.length && (d.push(...y.refHandles.map((S) => ({ ...S, path: [E, ...S.path] }))), y.refHandles = void 0), (R = y.detachStyledChildren) != null && R.length && (m.push(...y.detachStyledChildren.map((S) => ({ ...S, path: [E, ...S.path] }))), y.detachStyledChildren = void 0); | ||
(w = y.unhandledChildren) != null && w.length && (p.push(...y.unhandledChildren.map((S) => ({ ...S, path: [E, ...S.path] }))), y.unhandledChildren = void 0), (P = y.unhandledAttr) != null && P.length && (l.push(...y.unhandledAttr.map((S) => ({ ...S, path: [E, ...S.path] }))), y.unhandledAttr = void 0), (v = y.refHandles) != null && v.length && (d.push(...y.refHandles.map((S) => ({ ...S, path: [E, ...S.path] }))), y.refHandles = void 0), (R = y.detachStyledChildren) != null && R.length && (m.push(...y.detachStyledChildren.map((S) => ({ ...S, path: [E, ...S.path] }))), y.detachStyledChildren = void 0); | ||
} else { | ||
@@ -183,4 +183,4 @@ const y = document.createComment("unhandledChild"); | ||
} | ||
function Me(t) { | ||
return G(t) && Object.entries(t).every( | ||
function De(t) { | ||
return q(t) && Object.entries(t).every( | ||
([e, r]) => /[a-zA-Z\-]+/.test(e) && ae(r) || Array.isArray(r) && r.every(ae) | ||
@@ -193,3 +193,3 @@ ); | ||
const r = typeof e; | ||
return !!(r !== "object" && r !== "function" || t[0] === "o" && t[1] === "n" && r === "function" || t === "style" && (Me(e) || r === "string") || t === "className" && G(e)); | ||
return !!(r !== "object" && r !== "function" || t[0] === "o" && t[1] === "n" && r === "function" || t === "style" && (De(e) || r === "string") || t === "className" && q(e)); | ||
}; | ||
@@ -216,7 +216,7 @@ A.attachRef = function(t, e) { | ||
} | ||
function k(t, e) { | ||
function $(t, e) { | ||
const r = e.parentNode.insertBefore(t, e); | ||
return t instanceof HTMLOptionElement && Ae(t), r; | ||
} | ||
function It(t, e, ...r) { | ||
function Mt(t, e, ...r) { | ||
return A(t, { _isSVG: !0, ...e || {} }, r); | ||
@@ -227,3 +227,3 @@ } | ||
} | ||
function Mt(t, e) { | ||
function Dt(t, e) { | ||
return Se.call(t, e); | ||
@@ -276,9 +276,9 @@ } | ||
} | ||
function Dt(t, { children: e, ...r }) { | ||
function Ft(t, { children: e, ...r }) { | ||
return A(t, r, [e]); | ||
} | ||
function Ft(t, { children: e, ...r }) { | ||
function _t(t, { children: e, ...r }) { | ||
return Array.isArray(e) ? A(t, r, e) : A(t, r, e ? [e] : []); | ||
} | ||
function De() { | ||
function Fe() { | ||
} | ||
@@ -360,3 +360,3 @@ function ce(t) { | ||
} | ||
const Fe = x({ | ||
const _e = x({ | ||
stringify(t) { | ||
@@ -372,5 +372,5 @@ return t === null ? "" : ce(this.argv[0][0]) ? t.toString() : JSON.stringify(t); | ||
zeroValue: [] | ||
}), _e = { | ||
}), Be = { | ||
zeroValue: "" | ||
}, Be = T("string", _e), ze = { | ||
}, ze = T("string", Be), We = { | ||
stringify(t) { | ||
@@ -384,3 +384,3 @@ return t.toString(); | ||
zeroValue: 0 | ||
}, qe = T("number", ze), Ge = { zeroValue: null }, We = T((t) => typeof t == "object" && !Array.isArray(t), Ge), Ke = T((t) => Array.isArray(t), {}), Xe = { zeroValue: !1 }, Ye = T("bool", Xe), Ue = { | ||
}, qe = T("number", We), Ge = { zeroValue: null }, Ke = T((t) => typeof t == "object" && !Array.isArray(t), Ge), Xe = T((t) => Array.isArray(t), {}), Ye = { zeroValue: !1 }, Ue = T("bool", Ye), Je = { | ||
stringify(t) { | ||
@@ -393,3 +393,3 @@ return t.toString(); | ||
} | ||
}, Je = T("function", Ue), Ze = T("symbol", {}), Qe = { | ||
}, Ze = T("function", Je), Qe = T("symbol", {}), et = { | ||
stringify() { | ||
@@ -404,3 +404,3 @@ throw new Error("type any can not stringify"); | ||
} | ||
}, W = T(() => !0, Qe), et = x({ | ||
}, G = T(() => !0, et), tt = x({ | ||
check(t) { | ||
@@ -425,3 +425,3 @@ return this.argv[0].some((e) => e.check(t)); | ||
} | ||
}), tt = x({ | ||
}), rt = x({ | ||
check(t) { | ||
@@ -435,3 +435,3 @@ return Array.isArray(t) ? t.every((e) => this.argv[0].check(e)) : !1; | ||
zeroValue: [] | ||
}), rt = x({ | ||
}), nt = x({ | ||
check(t) { | ||
@@ -444,3 +444,3 @@ return !0; | ||
} | ||
}), nt = x({ | ||
}), st = x({ | ||
check(t) { | ||
@@ -458,9 +458,9 @@ return Object.entries(this.argv[0]).every(([e, r]) => r.check(t[e])); | ||
} | ||
}), st = W, it = W, ot = W, at = De; | ||
function ct() { | ||
}), it = G, ot = G, at = G, ct = Fe; | ||
function ht() { | ||
return x({ | ||
coerce: (t) => q(t) ? t : Q(t) | ||
coerce: (t) => W(t) ? t : Q(t) | ||
})(); | ||
} | ||
function ht() { | ||
function lt() { | ||
return x({ | ||
@@ -470,3 +470,3 @@ coerce: (t) => t instanceof _ ? t : new _(t) | ||
} | ||
function lt() { | ||
function ut() { | ||
return x({ | ||
@@ -476,3 +476,3 @@ coerce: (t) => t instanceof re ? t : new re(t) | ||
} | ||
function ut() { | ||
function ft() { | ||
return x({ | ||
@@ -483,37 +483,37 @@ coerce: (t) => t instanceof ne ? t : new ne(t) | ||
const H = { | ||
string: Be, | ||
string: ze, | ||
number: qe, | ||
object: We, | ||
array: Ke, | ||
bool: Ye, | ||
function: Je, | ||
symbol: Ze, | ||
node: st, | ||
element: it, | ||
elementType: ot, | ||
object: Ke, | ||
array: Xe, | ||
bool: Ue, | ||
function: Ze, | ||
symbol: Qe, | ||
node: it, | ||
element: ot, | ||
elementType: at, | ||
// instanceOf | ||
// 枚举值 | ||
oneOf: Fe, | ||
oneOf: _e, | ||
// 枚举类型 | ||
oneOfType: et, | ||
oneOfType: tt, | ||
// 数组类型,里面的值应该只能跟类型 | ||
arrayOf: tt, | ||
arrayOf: rt, | ||
// objectOf, | ||
// 对象结构的嵌套类型。shape + arrayOf + oneOfType + any 可以描述任何 schema。 | ||
shapeOf: rt, | ||
shapeOf: nt, | ||
// map 类型,就是简单的 kv,应该是 shape 的子集。 | ||
map: nt, | ||
map: st, | ||
// exact, | ||
// customProps/customArrayProps | ||
any: W, | ||
checkPropTypes: at, | ||
any: G, | ||
checkPropTypes: ct, | ||
// reactive types | ||
atom: ct, | ||
rxList: ht, | ||
rxSet: lt, | ||
rxMap: ut | ||
atom: ht, | ||
rxList: lt, | ||
rxSet: ut, | ||
rxMap: ft | ||
}, he = /* @__PURE__ */ new WeakSet(); | ||
function ft({ container: t, content: e, destroyOnUnmount: r }, { useEffect: n, pathContext: s }) { | ||
function dt({ container: t, content: e, destroyOnUnmount: r }, { useEffect: n, pathContext: s }) { | ||
typeof e != "function" && (he.has(e) && console.error("static portal content can only be rendered once. Use function content for content has reactive parts."), he.add(e)); | ||
const i = Lt(t, s); | ||
const i = kt(t, s); | ||
return i.render(e), n(() => () => { | ||
@@ -523,3 +523,3 @@ i.destroy(); | ||
} | ||
function dt() { | ||
function pt() { | ||
return { | ||
@@ -529,3 +529,3 @@ current: null | ||
} | ||
function pt() { | ||
function mt() { | ||
const t = Q(null); | ||
@@ -546,6 +546,6 @@ return new Proxy({}, { | ||
} | ||
function $(t) { | ||
function k(t) { | ||
return t ? Array.isArray(t) ? t : [t] : []; | ||
} | ||
function mt(t, e) { | ||
function yt(t, e) { | ||
const r = { ...t }; | ||
@@ -559,18 +559,18 @@ for (const n in e) { | ||
function Y(t, e, r) { | ||
return e && (t.startsWith("on") || t === "ref" || t === "style" || t === "classname" || t === "class") ? t === "style" ? $(e).concat(r) : $(r).concat(e) : r; | ||
return e && (t.startsWith("on") || t === "ref" || t === "style" || t === "classname" || t === "class") ? t === "style" ? k(e).concat(r) : k(r).concat(e) : r; | ||
} | ||
const K = "__config__", L = class L { | ||
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 = Pe({}), this.itemConfig = {}, this.frame = [], this.exposed = {}, this.createHTMLOrSVGElement = (o, a, c, ...l) => { | ||
var b, P, v, R; | ||
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 = Te({}), this.itemConfig = {}, this.frame = [], this.exposed = {}, this.createHTMLOrSVGElement = (o, a, c, ...l) => { | ||
var w, P, v, R; | ||
const p = typeof a == "function", d = c == null ? void 0 : c.as; | ||
if (c == null || delete c.as, C(d !== "self", '"self" is reserved, please use another element name.'), d && ((b = this.itemConfig[d]) != null && b.use) && ((P = this.itemConfig[d]) == null ? void 0 : P.use) instanceof Element) | ||
if (c == null || delete c.as, C(d !== "self", '"self" is reserved, please use another element name.'), d && ((w = this.itemConfig[d]) != null && w.use) && ((P = this.itemConfig[d]) == null ? void 0 : P.use) instanceof Element) | ||
return this.itemConfig[d].use; | ||
let m = l, { props: f, componentProps: g } = this.separateProps(c); | ||
const u = this.itemConfig[d]; | ||
d && u && (u.props && (p ? f = { ...c, ...u.props } : f = mt(c, u.props)), u.propMergeHandles && Object.entries(u.propMergeHandles).forEach(([y, S]) => { | ||
f[y] = S.reduce((Ce, xe) => xe(Ce, g), f[y]); | ||
d && u && (u.props && (p ? f = { ...c, ...u.props } : f = yt(c, u.props)), u.propMergeHandles && Object.entries(u.propMergeHandles).forEach(([y, S]) => { | ||
f[y] = S.reduce((xe, Pe) => Pe(xe, g), f[y]); | ||
}), u.propsMergeHandle && (f = u.propsMergeHandle.reduce((y, S) => S(y, g), f)), u.children && (m = u.children)); | ||
const h = ((v = this.itemConfig[d]) == null ? void 0 : v.use) || a; | ||
typeof h == "function" && !p && (g[gt] = f, f = g), typeof h == "function" && ((R = u == null ? void 0 : u.configProps) != null && R.length) && Object.assign(f, { [K]: u.configProps }), d && (f.ref = $(f.ref).concat((y) => this.refs[d] = y)); | ||
typeof h == "function" && !p && (g[Et] = f, f = g), typeof h == "function" && ((R = u == null ? void 0 : u.configProps) != null && R.length) && Object.assign(f, { [K]: u.configProps }), d && (f.ref = k(f.ref).concat((y) => this.refs[d] = y)); | ||
const E = o ? je(h, f, ...m) : A(h, f, ...m); | ||
@@ -585,7 +585,7 @@ if (typeof h != "function") { | ||
return E; | ||
}, this.createElement = this.createHTMLOrSVGElement.bind(this, !1), this.createSVGElement = this.createHTMLOrSVGElement.bind(this, !0), this.createPortal = (o, a) => A(ft, { container: a, content: o }), this.useLayoutEffect = (o) => { | ||
}, this.createElement = this.createHTMLOrSVGElement.bind(this, !1), this.createSVGElement = this.createHTMLOrSVGElement.bind(this, !0), this.createPortal = (o, a) => A(dt, { container: a, content: o }), this.useLayoutEffect = (o) => { | ||
this.layoutEffects.add(o); | ||
}, this.useEffect = (o) => { | ||
this.effects.add(o); | ||
}, this.createRef = dt, this.createRxRef = pt, this.cleanupsOfExternalTarget = /* @__PURE__ */ new Set(), this.createStateFromRef = (o, a) => { | ||
}, this.createRef = pt, this.createRxRef = mt, this.cleanupsOfExternalTarget = /* @__PURE__ */ new Set(), this.createStateFromRef = (o, a) => { | ||
let c; | ||
@@ -611,11 +611,11 @@ const l = (d) => { | ||
if (e[s] || (e[s] = {}), i === "_eventTarget") | ||
e[s].eventTarget = $(e[s].eventTarget).concat(n); | ||
e[s].eventTarget = k(e[s].eventTarget).concat(n); | ||
else if (i === "_use") | ||
e[s].use = n; | ||
else if (i === "_props") | ||
e[s].propsMergeHandle = $(e[s].propsMergeHandle).concat(n); | ||
e[s].propsMergeHandle = k(e[s].propsMergeHandle).concat(n); | ||
else if (i === "_children") | ||
e[s].children = n; | ||
else if (i === void 0 || i === "") | ||
e[s].configProps = $(e[s].configProps).concat(n); | ||
e[s].configProps = k(e[s].configProps).concat(n); | ||
else if ((i == null ? void 0 : i[0]) === "_") | ||
@@ -626,3 +626,3 @@ C(!1, `unsupported config item: ${s}`); | ||
const o = i.slice(0, -1); | ||
e[s].propMergeHandles[o] = $(e[s].propMergeHandles[o]).concat(n); | ||
e[s].propMergeHandles[o] = k(e[s].propMergeHandles[o]).concat(n); | ||
} else | ||
@@ -698,3 +698,3 @@ e[s].props || (e[s].props = {}), e[s].props[i] = Y(i, e[s].props[i], n); | ||
pathContext: this.pathContext, | ||
context: new yt(this.pathContext.hostPath), | ||
context: new gt(this.pathContext.hostPath), | ||
createPortal: this.createPortal, | ||
@@ -707,3 +707,3 @@ createRef: this.createRef, | ||
}; | ||
const e = Te.collectEffect(), { props: r, itemConfig: n } = this.getFinalPropsAndItemConfig(); | ||
const e = ve.collectEffect(), { props: r, itemConfig: n } = this.getFinalPropsAndItemConfig(); | ||
this.itemConfig = n, this.props = r; | ||
@@ -727,3 +727,3 @@ const s = this.type.propTypes ? this.normalizePropsWithCoerceValue(this.type.propTypes, r) : r; | ||
let I = L; | ||
class yt { | ||
class gt { | ||
constructor(e) { | ||
@@ -744,6 +744,6 @@ this.hostPath = e, this.valueByType = /* @__PURE__ */ new Map(); | ||
} | ||
const gt = "__nativeAttrs"; | ||
function _t(t, e) { | ||
const Et = "__nativeAttrs"; | ||
function Bt(t, e) { | ||
const r = t.bind(null); | ||
return r.propTypes = t.propTypes, r.boundProps = $(r.boundProps).concat(e), r; | ||
return r.propTypes = t.propTypes, r.boundProps = k(r.boundProps).concat(e), r; | ||
} | ||
@@ -753,3 +753,3 @@ function le(t) { | ||
} | ||
class Et { | ||
class St { | ||
constructor(e, r, n) { | ||
@@ -785,3 +785,3 @@ this.source = e, this.placeholder = r, this.pathContext = n, this.stopAutoRun = () => { | ||
} | ||
class St { | ||
class At { | ||
constructor(e, r, n) { | ||
@@ -801,3 +801,3 @@ this.source = e, this.placeholder = r, this.pathContext = n, this.fragmentParent = document.createDocumentFragment(); | ||
const n = this.source(), s = document.createComment("computed node"); | ||
k(s, this.placeholder); | ||
$(s, this.placeholder); | ||
const i = O(n, s, { ...this.pathContext, hostPath: M(this, this.pathContext.hostPath) }); | ||
@@ -817,17 +817,17 @@ se.instance.pauseTracking(), i.render(), se.instance.resetTracking(), r(() => { | ||
} | ||
const At = A.isValidAttribute; | ||
const wt = A.isValidAttribute; | ||
A.isValidAttribute = function(t, e) { | ||
return t.startsWith("on") ? !0 : Array.isArray(e) && e.some(ue) || ue(e) ? !1 : At(t, e); | ||
return t.startsWith("on") ? !0 : Array.isArray(e) && e.some(ue) || ue(e) ? !1 : wt(t, e); | ||
}; | ||
function ue(t) { | ||
return ve(t) || q(t) || typeof t == "function"; | ||
return Re(t) || W(t) || typeof t == "function"; | ||
} | ||
function j(t) { | ||
return q(t) || typeof t == "function"; | ||
function D(t) { | ||
return W(t) || typeof t == "function"; | ||
} | ||
function be(t) { | ||
function we(t) { | ||
if (Array.isArray(t)) | ||
return t.some(be); | ||
return t.some(we); | ||
for (const e in t) | ||
if (e.startsWith(":") || G(t[e])) | ||
if (e.startsWith(":") || q(t[e])) | ||
return !0; | ||
@@ -839,2 +839,10 @@ return !1; | ||
} | ||
function be(t) { | ||
if (Array.isArray(t)) | ||
return t.some(be); | ||
for (const e in t) | ||
if (e.startsWith("--")) | ||
return !0; | ||
return !1; | ||
} | ||
function U(t) { | ||
@@ -844,4 +852,4 @@ var e, r; | ||
} | ||
function we(t) { | ||
return Array.isArray(t) ? t.some(we) : t["@keyframes"] !== void 0; | ||
function Ce(t) { | ||
return Array.isArray(t) ? t.some(Ce) : t["@keyframes"] !== void 0; | ||
} | ||
@@ -858,3 +866,3 @@ function fe(t) { | ||
} | ||
function wt(t, e) { | ||
function Ct(t, e) { | ||
let r; | ||
@@ -872,3 +880,3 @@ const n = []; | ||
} | ||
class Ct { | ||
class xt { | ||
constructor() { | ||
@@ -887,3 +895,3 @@ this.styleScripts = /* @__PURE__ */ new Map(), this.elToStyleId = /* @__PURE__ */ new WeakMap(); | ||
} | ||
return wt(e, r); | ||
return Ct(e, r); | ||
} | ||
@@ -902,3 +910,3 @@ stringifyStyleObject(e) { | ||
const l = U(c[0]); | ||
return l.length && fe(s), Le(c.slice(1).map((p) => () => { | ||
return l.length && fe(s), ke(c.slice(1).map((p) => () => { | ||
const [d, m, f] = this.separateStyleObject(p, l); | ||
@@ -917,3 +925,3 @@ if (m && this.generateStyleContent(`.${o}`, m).forEach((g) => { | ||
isNestedStyleObject(e, r) { | ||
return e !== "@keyframes" && G(r); | ||
return e !== "@keyframes" && q(r); | ||
} | ||
@@ -968,3 +976,3 @@ separateStyleObject(e, r) { | ||
} | ||
const xt = { | ||
const Pt = { | ||
autoGenerateTestId: !1 | ||
@@ -982,3 +990,3 @@ }, z = class z { | ||
var e, r, n; | ||
C(this.element === this.placeholder, "should never rerender"), this.element = this.source instanceof DocumentFragment ? document.createComment("fragment start") : this.source, this.collectInnerHost(), this.collectReactiveAttr(), this.collectRefHandles(), this.collectDetachStyledChildren(), (e = this.detachStyledChildren) != null && e.length && (this.forceHandleElement = !0), (r = this.reactiveHosts) == null || r.forEach((s) => s.render()), k(this.element, this.placeholder), this.source instanceof DocumentFragment && k(this.source, this.placeholder), (n = this.refHandles) != null && n.length && (this.pathContext.root.attached ? this.attachRefs() : this.removeAttachListener = this.pathContext.root.on("attach", this.attachRefs)); | ||
C(this.element === this.placeholder, "should never rerender"), this.element = this.source instanceof DocumentFragment ? document.createComment("fragment start") : this.source, this.collectInnerHost(), this.collectReactiveAttr(), this.collectRefHandles(), this.collectDetachStyledChildren(), (e = this.detachStyledChildren) != null && e.length && (this.forceHandleElement = !0), (r = this.reactiveHosts) == null || r.forEach((s) => s.render()), $(this.element, this.placeholder), this.source instanceof DocumentFragment && $(this.source, this.placeholder), (n = this.refHandles) != null && n.length && (this.pathContext.root.attached ? this.attachRefs() : this.removeAttachListener = this.pathContext.root.on("attach", this.attachRefs)); | ||
} | ||
@@ -1004,4 +1012,4 @@ collectInnerHost() { | ||
updateAttribute(e, r, n, s, i) { | ||
const o = Array.isArray(n) ? n.map((a) => j(a) ? a() : a) : j(n) ? n() : n; | ||
if (r === "style" && (be(o) || te(o) || we(o))) | ||
const o = Array.isArray(n) ? n.map((a) => D(a) ? a() : a) : D(n) ? n() : n; | ||
if (r === "style" && (we(o) || te(o) || Ce(o) || be(o))) | ||
return z.styleManager.update(this.pathContext.hostPath, s, o, e, !1); | ||
@@ -1017,3 +1025,3 @@ V(e, r, o, i); | ||
generateTestId(e, r) { | ||
if (!xt.autoGenerateTestId) return; | ||
if (!Pt.autoGenerateTestId) return; | ||
const n = bt(this.pathContext.hostPath, r); | ||
@@ -1034,3 +1042,3 @@ V(e, "data-testid", n); | ||
(n = this.detachStyledChildren) == null || n.forEach(({ el: l, style: p }) => { | ||
const d = getComputedStyle(l).transitionProperty.split(",").map((u) => u.trim()), m = Array.isArray(p) ? Object.assign({}, ...p.map((u) => j(u) ? u() : u)) : j(p) ? p() : p, f = Object.keys(m); | ||
const d = getComputedStyle(l).transitionProperty.split(",").map((u) => u.trim()), m = Array.isArray(p) ? Object.assign({}, ...p.map((u) => D(u) ? u() : u)) : D(p) ? p() : p, f = Object.keys(m); | ||
(d.includes("all") || f.some((u) => d.includes(u))) && i.add(l), m.animation && o.add(l); | ||
@@ -1040,6 +1048,6 @@ }), await Promise.all(((s = this.detachStyledChildren) == null ? void 0 : s.map(({ el: l, style: p, path: d }) => this.updateAttribute(l, "style", p, d, l instanceof SVGElement))) || []); | ||
await Promise.all([ | ||
...a.map((l) => D(l, "transitionrun")), | ||
...a.map((l) => D(l, "transitionend")), | ||
...c.map((l) => D(l, "animationrun")), | ||
...c.map((l) => D(l, "animationend")) | ||
...a.map((l) => j(l, "transitionrun")), | ||
...a.map((l) => j(l, "transitionend")), | ||
...c.map((l) => j(l, "animationrun")), | ||
...c.map((l) => j(l, "animationend")) | ||
]); | ||
@@ -1051,5 +1059,5 @@ } | ||
}; | ||
z.styleManager = new Ct(); | ||
z.styleManager = new xt(); | ||
let J = z; | ||
function D(t, e) { | ||
function j(t, e) { | ||
return new Promise((r) => { | ||
@@ -1059,3 +1067,3 @@ t.addEventListener(e, r, { once: !0 }); | ||
} | ||
class Pt { | ||
class Tt { | ||
constructor(e, r, n) { | ||
@@ -1083,3 +1091,3 @@ this.source = e, this.placeholder = r, this.pathContext = n, this.computed = void 0, this.childHosts = [], this.parentElement = r.parentElement; | ||
} | ||
}), this.childHosts.forEach((r) => r.render()), k(e, this.placeholder); | ||
}), this.childHosts.forEach((r) => r.render()), $(e, this.placeholder); | ||
} else | ||
@@ -1092,3 +1100,3 @@ throw new Error("should never rerender"); | ||
} | ||
class Tt { | ||
class vt { | ||
constructor(e, r, n) { | ||
@@ -1111,3 +1119,3 @@ this.source = e, this.placeholder = r, this.pathContext = n; | ||
function() { | ||
return this.manualTrack(e.hosts, ie.METHOD, oe.METHOD), this.manualTrack(e.hosts, ie.EXPLICIT_KEY_CHANGE, oe.EXPLICIT_KEY_CHANGE), k(e.renderNewHosts(e.hosts), e.placeholder), null; | ||
return this.manualTrack(e.hosts, ie.METHOD, oe.METHOD), this.manualTrack(e.hosts, ie.EXPLICIT_KEY_CHANGE, oe.EXPLICIT_KEY_CHANGE), $(e.renderNewHosts(e.hosts), e.placeholder), null; | ||
}, | ||
@@ -1130,3 +1138,3 @@ function(n, s) { | ||
const E = e.renderNewHosts(g); | ||
k(E, (f == null ? void 0 : f.element) || e.placeholder); | ||
$(E, (f == null ? void 0 : f.element) || e.placeholder); | ||
} | ||
@@ -1136,3 +1144,3 @@ const h = p; | ||
!h[0].element.previousSibling && // 删除的Host 是父 Host 的第一个,说明从头删到了尾 | ||
h.every((b) => !b.forceHandleElement) ? (e.placeholder.parentNode.replaceChildren(e.placeholder), h.forEach((P) => P.destroy(!0))) : h.forEach((b) => b.destroy())); | ||
h.every((w) => !w.forceHandleElement) ? (e.placeholder.parentNode.replaceChildren(e.placeholder), h.forEach((P) => P.destroy(!0))) : h.forEach((w) => w.destroy())); | ||
} else if (i === void 0 && c !== void 0) { | ||
@@ -1142,3 +1150,3 @@ const f = p; | ||
const g = c; | ||
k(e.hosts.at(g).placeholder, ((m = e.hosts.at(g + 1)) == null ? void 0 : m.element) || e.placeholder), e.hosts.at(g).render(); | ||
$(e.hosts.at(g).placeholder, ((m = e.hosts.at(g + 1)) == null ? void 0 : m.element) || e.placeholder), e.hosts.at(g).render(); | ||
} else | ||
@@ -1156,3 +1164,3 @@ throw new Error("unknown trigger info"); | ||
} | ||
class vt { | ||
class Rt { | ||
constructor(e, r) { | ||
@@ -1169,3 +1177,3 @@ this.pathContext = e, this.placeholder = r, this.element = document.createComment("empty"); | ||
} | ||
class Rt { | ||
class Lt { | ||
constructor(e, r, n) { | ||
@@ -1175,3 +1183,3 @@ this.source = e, this.placeholder = r, this.pathContext = n, this.element = this.placeholder; | ||
render() { | ||
this.element = document.createTextNode(this.source.toString()), k(this.element, this.placeholder); | ||
this.element = document.createTextNode(this.source.toString()), $(this.element, this.placeholder); | ||
} | ||
@@ -1185,7 +1193,7 @@ destroy(e) { | ||
let n; | ||
return t instanceof HTMLElement || t instanceof SVGElement || t instanceof DocumentFragment ? n = new J(t, e, r) : typeof t == "string" || typeof t == "number" || typeof t == "boolean" ? n = new Rt(t, e, r) : Array.isArray(t) ? n = new Pt(t, e, r) : t == null ? n = new vt(r, e) : t instanceof _ ? n = new Tt(t, e, r) : typeof t == "object" && typeof (t == null ? void 0 : t.type) == "function" ? n = new I(t, e, r) : q(t) ? n = new Et(t, e, r) : typeof t == "function" ? n = new St(t, e, r) : C(!1, `unknown child type ${t}`), n; | ||
return t instanceof HTMLElement || t instanceof SVGElement || t instanceof DocumentFragment ? n = new J(t, e, r) : typeof t == "string" || typeof t == "number" || typeof t == "boolean" ? n = new Lt(t, e, r) : Array.isArray(t) ? n = new Tt(t, e, r) : t == null ? n = new Rt(r, e) : t instanceof _ ? n = new vt(t, e, r) : typeof t == "object" && typeof (t == null ? void 0 : t.type) == "function" ? n = new I(t, e, r) : W(t) ? n = new St(t, e, r) : typeof t == "function" ? n = new At(t, e, r) : C(!1, `unknown child type ${t}`), n; | ||
} | ||
function Lt(t, e) { | ||
function kt(t, e) { | ||
const r = /* @__PURE__ */ new Map(), n = e || { | ||
hostPath: [], | ||
hostPath: null, | ||
elementPath: [] | ||
@@ -1219,3 +1227,3 @@ }, s = { | ||
} | ||
function w(t) { | ||
function b(t) { | ||
return (e) => (r) => { | ||
@@ -1226,4 +1234,4 @@ if (t(r)) | ||
} | ||
const Bt = w((t) => t.key === "ArrowUp"), zt = w((t) => t.key === "ArrowDown"), qt = w((t) => t.key === "ArrowLeft"), Gt = w((t) => t.key === "ArrowRight"), Wt = w((t) => t.key === "Enter"), Kt = w((t) => t.key === "Tab"), Xt = w((t) => t.key === "Escape"), Yt = w((t) => t.key === "Backspace"), Ut = w((t) => t.key === "Space"), Jt = w((t) => t.button === 0), Zt = w((t) => t.button === 2), Qt = w((t) => t.button === 1), er = (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), tr = w((t) => t.target === t.currentTarget); | ||
function rr(t) { | ||
const zt = b((t) => t.key === "ArrowUp"), Wt = b((t) => t.key === "ArrowDown"), qt = b((t) => t.key === "ArrowLeft"), Gt = b((t) => t.key === "ArrowRight"), Kt = b((t) => t.key === "Enter"), Xt = b((t) => t.key === "Tab"), Yt = b((t) => t.key === "Escape"), Ut = b((t) => t.key === "Backspace"), Jt = b((t) => t.key === "Space"), Zt = b((t) => t.button === 0), Qt = b((t) => t.button === 2), er = b((t) => t.button === 1), tr = (t, e) => b((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), rr = b((t) => t.target === t.currentTarget); | ||
function nr(t) { | ||
let e; | ||
@@ -1251,3 +1259,3 @@ function r(s) { | ||
} | ||
function nr(t) { | ||
function sr(t) { | ||
return (e) => { | ||
@@ -1259,3 +1267,3 @@ var n; | ||
} | ||
function sr(t) { | ||
function ir(t) { | ||
return (e) => { | ||
@@ -1265,3 +1273,3 @@ e.preventDefault(), t(e); | ||
} | ||
function ir(t) { | ||
function or(t) { | ||
return (e) => { | ||
@@ -1271,3 +1279,3 @@ e.stopPropagation(), t(e); | ||
} | ||
function or({ contextType: t, value: e, children: r }, { context: n }) { | ||
function ar({ contextType: t, value: e, children: r }, { context: n }) { | ||
return n.set(t, e), r; | ||
@@ -1285,11 +1293,11 @@ } | ||
} | ||
const kt = $t("Form"); | ||
function Ht({ name: t, children: e, onChange: r, onSubmit: n, onClear: s, onReset: i, values: o }, { | ||
const Ht = $t("Form"); | ||
function Ot({ name: t, children: e, onChange: r, onSubmit: n, onClear: s, onReset: i, values: o }, { | ||
createElement: a, | ||
context: c | ||
}) { | ||
const l = {}, p = (h, E, b) => { | ||
b ? (o.get(h) || o.set(h, new _([])), l[h] || (l[h] = []), o.get(h).push(E.value)(l[h]).push(E)) : (o.set(h, E.value), l[h] = E); | ||
}, d = (h, E, b) => { | ||
if (b) { | ||
const l = {}, p = (h, E, w) => { | ||
w ? (o.get(h) || o.set(h, new _([])), l[h] || (l[h] = []), o.get(h).push(E.value)(l[h]).push(E)) : (o.set(h, E.value), l[h] = E); | ||
}, d = (h, E, w) => { | ||
if (w) { | ||
const P = o.get(h), v = P.findIndex((y) => y === E.value); | ||
@@ -1314,5 +1322,5 @@ v() > -1 && P.splice(v(), 1); | ||
}; | ||
return c.set(kt, { name: t, register: p, unregister: d, onChange: u, submit: m, reset: f, clear: g }), e; | ||
return c.set(Ht, { name: t, register: p, unregister: d, onChange: u, submit: m, reset: f, clear: g }), e; | ||
} | ||
Ht.propTypes = { | ||
Ot.propTypes = { | ||
name: H.string.isRequired, | ||
@@ -1326,4 +1334,4 @@ values: H.rxMap(), | ||
}; | ||
const ar = Symbol("ModalContext"); | ||
function cr(t) { | ||
const cr = Symbol("ModalContext"); | ||
function hr(t) { | ||
return (e, r) => { | ||
@@ -1394,3 +1402,3 @@ if (e === window) { | ||
}); | ||
function hr(t, e) { | ||
function lr(t, e) { | ||
if (t === window) { | ||
@@ -1418,3 +1426,3 @@ const r = () => { | ||
} | ||
function lr(t, e) { | ||
function ur(t, e) { | ||
const r = () => { | ||
@@ -1429,5 +1437,5 @@ e(!0); | ||
} | ||
const Ot = "dragmove"; | ||
function ur(t) { | ||
const e = (t == null ? void 0 : t.container) || document.body, r = (t == null ? void 0 : t.customEventName) || Ot; | ||
const Nt = "dragmove"; | ||
function fr(t) { | ||
const e = (t == null ? void 0 : t.container) || document.body, r = (t == null ? void 0 : t.customEventName) || Nt; | ||
return function(s) { | ||
@@ -1457,3 +1465,3 @@ const i = (o) => { | ||
} | ||
function fr(t) { | ||
function dr(t) { | ||
return function(r, n) { | ||
@@ -1480,3 +1488,3 @@ const s = (i) => { | ||
} | ||
function dr(t) { | ||
function pr(t) { | ||
return function(r, n) { | ||
@@ -1493,3 +1501,3 @@ const s = (i) => { | ||
} | ||
function pr(t, e) { | ||
function mr(t, e) { | ||
const r = () => { | ||
@@ -1509,58 +1517,58 @@ e({ | ||
I as ComponentHost, | ||
or as ContextProvider, | ||
Ot as DEFAULT_DRAG_MOVE_EVENT, | ||
yt as DataContext, | ||
Ht as Form, | ||
kt as FormContext, | ||
ar as ContextProvider, | ||
Nt as DEFAULT_DRAG_MOVE_EVENT, | ||
gt as DataContext, | ||
Ot as Form, | ||
Ht as FormContext, | ||
F as Fragment, | ||
ar as ModalContext, | ||
gt as N_ATTR, | ||
ft as Portal, | ||
cr as ModalContext, | ||
Et as N_ATTR, | ||
dt as Portal, | ||
H as PropTypes, | ||
J as StaticHost, | ||
xt as StaticHostConfig, | ||
Pt as StaticHostConfig, | ||
N as StyleSize, | ||
ke as autoUnit, | ||
_t as bindProps, | ||
He as autoUnit, | ||
Bt as bindProps, | ||
$t as createContext, | ||
A as createElement, | ||
It as createElementNS, | ||
rr as createEventTransfer, | ||
Mt as createElementNS, | ||
nr as createEventTransfer, | ||
O as createHost, | ||
ur as createOnDragMove, | ||
fr as createReactiveDragPosition, | ||
dr as createReactiveDragTarget, | ||
cr as createReactivePosition, | ||
dt as createRef, | ||
Lt as createRoot, | ||
pt as createRxRef, | ||
Mt as dispatchEvent, | ||
w as eventAlias, | ||
Dt as jsx, | ||
Ft as jsxDEV, | ||
fr as createOnDragMove, | ||
dr as createReactiveDragPosition, | ||
pr as createReactiveDragTarget, | ||
hr as createReactivePosition, | ||
pt as createRef, | ||
kt as createRoot, | ||
mt as createRxRef, | ||
Dt as dispatchEvent, | ||
b as eventAlias, | ||
Ft as jsx, | ||
_t as jsxDEV, | ||
jt as jsxs, | ||
Y as mergeProp, | ||
mt as mergeProps, | ||
Yt as onBackspaceKey, | ||
zt as onDownKey, | ||
Xt as onESCKey, | ||
Wt as onEnterKey, | ||
er as onKey, | ||
yt as mergeProps, | ||
Ut as onBackspaceKey, | ||
Wt as onDownKey, | ||
Yt as onESCKey, | ||
Kt as onEnterKey, | ||
tr as onKey, | ||
qt as onLeftKey, | ||
Jt as onLeftMouseDown, | ||
Qt as onMiddleMouseDown, | ||
Zt as onLeftMouseDown, | ||
er as onMiddleMouseDown, | ||
Gt as onRightKey, | ||
Zt as onRightMouseDown, | ||
tr as onSelf, | ||
Ut as onSpaceKey, | ||
Kt as onTabKey, | ||
Bt as onUpKey, | ||
lr as reactiveFocused, | ||
pr as reactiveScrollPosition, | ||
hr as reactiveSize, | ||
Vt as setAutoUnitType, | ||
nr as withCurrentRange, | ||
sr as withPreventDefault, | ||
ir as withStopPropagation | ||
Qt as onRightMouseDown, | ||
rr as onSelf, | ||
Jt as onSpaceKey, | ||
Xt as onTabKey, | ||
zt as onUpKey, | ||
ur as reactiveFocused, | ||
mr as reactiveScrollPosition, | ||
lr as reactiveSize, | ||
It as setAutoUnitType, | ||
sr as withCurrentRange, | ||
ir as withPreventDefault, | ||
or as withStopPropagation | ||
}; | ||
//# sourceMappingURL=axii.js.map |
{ | ||
"name": "axii", | ||
"version": "2.6.70", | ||
"version": "2.6.72", | ||
"description": "", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
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
515985
2960