Comparing version 2.6.60 to 2.6.61
@@ -1313,2 +1313,8 @@ 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; | ||
/* Excluded from this release type: StaticHost */ | ||
export declare const StaticHostConfig: { | ||
autoGenerateTestId: boolean; | ||
}; | ||
export declare const STATUS_CLEAN = 3; | ||
@@ -1324,2 +1330,21 @@ | ||
declare class StyleManager { | ||
styleScripts: Map<string, CSSStyleSheet>; | ||
elToStyleId: WeakMap<HTMLElement, string>; | ||
getStyleSheetId(hostPath: Host[], elementPath: number[], el: ExtendedElement | null): string; | ||
stringifyStyleObject(styleObject: { | ||
[k: string]: any; | ||
}): string; | ||
update(hostPath: Host[], elementPath: number[], styleObject: StyleObject | StyleObject[], el: ExtendedElement, isStatic?: boolean): Promise<unknown>; | ||
isNestedStyleObject(key: string, styleObject: any): boolean; | ||
separateStyleObject(styleObject: StyleObject, transitionPropertyNames: string[]): [StyleObject?, StyleObject?, StyleObject?]; | ||
stringifyKeyFrameObject(keyframeObject: StyleObject): string; | ||
generateInlineAnimationContent(selector: string, styleObject: StyleObject): string[]; | ||
generateStyleContent(selector: string, styleObject: StyleObject): string[]; | ||
} | ||
declare type StyleObject = { | ||
[k: string]: any; | ||
}; | ||
/** | ||
@@ -1326,0 +1351,0 @@ * @category Common Utility |
540
dist/axii.js
@@ -1,4 +0,4 @@ | ||
import { isAtom as G, atom as Q, RxList as F, RxSet as ne, RxMap as se, arrayComputed as ie, TrackOpTypes as $, TriggerOpTypes as N, destroyComputed as _, reactive as xe, ReactiveEffect as Le, computed as pe, autorun as me, Notifier as oe, isReactive as ye } from "data0"; | ||
import { isAtom as q, atom as Q, RxList as _, RxSet as ne, RxMap as se, arrayComputed as ie, TrackOpTypes as I, TriggerOpTypes as $, destroyComputed as G, reactive as Le, ReactiveEffect as He, computed as pe, autorun as me, Notifier as oe, isReactive as ye } from "data0"; | ||
export * from "data0"; | ||
function He(t, e) { | ||
function Re(t, e) { | ||
for (let r in t) | ||
@@ -32,3 +32,3 @@ e(t[r], r); | ||
} | ||
function Re(t) { | ||
function Oe(t) { | ||
return t.length ? new Promise((e) => { | ||
@@ -42,8 +42,8 @@ let r = 0; | ||
} | ||
const Oe = /^(width|height|top|left|right|bottom|margin|padding|border|fontSize|maxWidth|maxHeight|minHeight|minWidth|gap|flexBasis|columnGap|rowGap)/; | ||
const ve = /^(width|height|top|left|right|bottom|margin|padding|border|fontSize|maxWidth|maxHeight|minHeight|minWidth|gap|flexBasis|columnGap|rowGap)/; | ||
let Ee = "px"; | ||
function Dt(t) { | ||
function Mt(t) { | ||
Ee = t; | ||
} | ||
function ve(t) { | ||
function Ie(t) { | ||
return typeof t == "string" ? t : `${t}${Ee}`; | ||
@@ -53,3 +53,3 @@ } | ||
function te(t, e) { | ||
return e === void 0 ? "" : Array.isArray(e) ? $e.test(t) ? e.join(",") : e.map((r) => te(t, r)).join(" ") : typeof e == "number" && Oe.test(t) ? ve(e) : e.toString(); | ||
return e === void 0 ? "" : Array.isArray(e) ? $e.test(t) ? e.join(",") : e.map((r) => te(t, r)).join(" ") : typeof e == "number" && ve.test(t) ? Ie(e) : e.toString(); | ||
} | ||
@@ -63,3 +63,3 @@ function Ne(t, e, r) { | ||
} | ||
function we(t) { | ||
function Ce(t) { | ||
const e = this._listeners[t.type]; | ||
@@ -73,9 +73,9 @@ 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 Ie(t) { | ||
function Me(t) { | ||
return t[0] === "o" && t[1] === "n"; | ||
} | ||
const Me = /^(strokeWidth|strokeLinecap|strokeLinejoin|strokeMiterlimit|strokeDashoffset|strokeDasharray|strokeOpacity|fillOpacity|stopOpacity)/; | ||
function q(t, e, r, n) { | ||
if (Array.isArray(r) && e !== "style" && e !== "className" && !Ie(e)) | ||
return q(t, e, r.at(-1), n); | ||
const ke = /^(strokeWidth|strokeLinecap|strokeLinejoin|strokeMiterlimit|strokeDashoffset|strokeDasharray|strokeOpacity|fillOpacity|stopOpacity)/; | ||
function k(t, e, r, n) { | ||
if (Array.isArray(r) && e !== "style" && e !== "className" && !Me(e)) | ||
return k(t, e, r.at(-1), n); | ||
if (e === "uuid") { | ||
@@ -89,3 +89,3 @@ t.setAttribute("data-uuid", r); | ||
i === "change" && (i = "input"); | ||
const o = s ? De : we; | ||
const o = s ? De : Ce; | ||
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" ? He(i, (o, a) => { | ||
typeof i == "string" ? t.style.cssText = i : typeof i == "object" ? Re(i, (o, a) => { | ||
t.style[a] = te(a, o); | ||
@@ -134,3 +134,3 @@ }) : A(!1, "style can only be string or object."); | ||
else { | ||
const i = n && Me.test(e) ? e.replace(/([a-z])([A-Z])/g, "$1-$2").toLowerCase() : e; | ||
const i = n && ke.test(e) ? e.replace(/([a-z])([A-Z])/g, "$1-$2").toLowerCase() : e; | ||
t.setAttribute(i, r); | ||
@@ -144,3 +144,3 @@ } | ||
const o = r.length ? r : s.children || []; | ||
if (t === Ce) | ||
if (t === we) | ||
i = document.createDocumentFragment(); | ||
@@ -151,3 +151,3 @@ else if (typeof t == "string") | ||
return { type: t, props: s, children: o }; | ||
const a = [], c = [], f = [], p = []; | ||
const a = [], c = [], u = [], p = []; | ||
o == null || o.forEach((l, h) => { | ||
@@ -159,19 +159,19 @@ if (l != null) | ||
i.appendChild(l); | ||
const u = l, y = u.unhandledChildren || []; | ||
const f = l, y = f.unhandledChildren || []; | ||
c.push(...y.map((E) => ({ ...E, path: [h, ...E.path] }))); | ||
const m = u.unhandledAttr || []; | ||
const m = f.unhandledAttr || []; | ||
a.push(...m.map((E) => ({ ...E, path: [h, ...E.path] }))); | ||
const w = u.refHandles || []; | ||
f.push(...w.map((E) => ({ ...E, path: [h, ...E.path] }))); | ||
const x = u.detachStyledChildren || []; | ||
p.push(...x.map((E) => ({ ...E, path: [h, ...E.path] }))), delete u.unhandledChildren, delete u.unhandledAttr, delete u.refHandles, delete u.detachStyledChildren; | ||
const C = f.refHandles || []; | ||
u.push(...C.map((E) => ({ ...E, path: [h, ...E.path] }))); | ||
const x = f.detachStyledChildren || []; | ||
p.push(...x.map((E) => ({ ...E, path: [h, ...E.path] }))), delete f.unhandledChildren, delete f.unhandledAttr, delete f.refHandles, delete f.detachStyledChildren; | ||
} else { | ||
const u = document.createComment("unhandledChild"); | ||
i.appendChild(u), c.push({ placeholder: u, child: l, path: [h] }); | ||
const f = document.createComment("unhandledChild"); | ||
i.appendChild(f), c.push({ placeholder: f, child: l, path: [h] }); | ||
} | ||
}), 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, h]) => { | ||
g.isValidAttribute(l, h) ? q(i, l, h, n) : a.push({ el: i, key: l, value: h, path: [] }); | ||
}), s && (s.ref && (u.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, h]) => { | ||
g.isValidAttribute(l, h) ? k(i, l, h, n) : a.push({ el: i, key: l, value: h, path: [] }); | ||
})); | ||
const d = i; | ||
return c.length && (d.unhandledChildren = c), a && (d.unhandledAttr = a), f.length && (d.refHandles = f), p.length && (d.detachStyledChildren = p), i; | ||
return c.length && (d.unhandledChildren = c), a && (d.unhandledAttr = a), u.length && (d.refHandles = u), p.length && (d.detachStyledChildren = p), i; | ||
} | ||
@@ -181,3 +181,3 @@ function ae(t) { | ||
} | ||
function ke(t) { | ||
function Ve(t) { | ||
return ee(t) && Object.entries(t).every( | ||
@@ -188,3 +188,3 @@ ([e, r]) => /[a-zA-Z\-]+/.test(e) && ae(r) || Array.isArray(r) && r.every(ae) | ||
g.isValidAttribute = function(t, e) { | ||
return Array.isArray(e) ? e.every((r) => g.isValidAttribute(t, r)) : !!(typeof e != "object" && typeof e != "function" || t[0] === "o" && t[1] === "n" && typeof e == "function" || (ke(e) || typeof e == "string") && t === "style" || ee(e) && t === "className"); | ||
return Array.isArray(e) ? e.every((r) => g.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" || ee(e) && t === "className"); | ||
}; | ||
@@ -205,3 +205,3 @@ g.attachRef = function(t, e) { | ||
}; | ||
function Ce() { | ||
function we() { | ||
} | ||
@@ -216,10 +216,10 @@ function Se(t) { | ||
} | ||
function It(t, e, ...r) { | ||
function kt(t, e, ...r) { | ||
return g(t, { _isSVG: !0, ...e || {} }, r); | ||
} | ||
function Ve(t, e, ...r) { | ||
function je(t, e, ...r) { | ||
return g(t, { _isSVG: !0, ...e || {} }, r); | ||
} | ||
function Mt(t, e) { | ||
return we.call(t, e); | ||
function Vt(t, e) { | ||
return Ce.call(t, e); | ||
} | ||
@@ -268,12 +268,12 @@ class M { | ||
} | ||
function kt(t, { children: e, ...r }) { | ||
function jt(t, { children: e, ...r }) { | ||
return g(t, r, e); | ||
} | ||
function Vt(t, { children: e, ...r }) { | ||
function Ft(t, { children: e, ...r }) { | ||
return g(t, r, [e]); | ||
} | ||
function jt(t, { children: e, ...r }) { | ||
function _t(t, { children: e, ...r }) { | ||
return Array.isArray(e) ? g(t, r, e) : g(t, r, e ? [e] : []); | ||
} | ||
function je() { | ||
function Fe() { | ||
} | ||
@@ -355,3 +355,3 @@ function ce(t) { | ||
} | ||
const Fe = P({ | ||
const _e = P({ | ||
stringify(t) { | ||
@@ -367,5 +367,5 @@ return t === null ? "" : ce(this.argv[0][0]) ? t.toString() : JSON.stringify(t); | ||
zeroValue: [] | ||
}), _e = { | ||
}), Ge = { | ||
zeroValue: "" | ||
}, ze = T("string", _e), Be = { | ||
}, ze = T("string", Ge), Be = { | ||
stringify(t) { | ||
@@ -379,3 +379,3 @@ return t.toString(); | ||
zeroValue: 0 | ||
}, Ge = T("number", Be), qe = { zeroValue: null }, We = T((t) => typeof t == "object" && !Array.isArray(t), qe), Ke = T((t) => Array.isArray(t), {}), Xe = { zeroValue: !1 }, Ye = T("bool", Xe), Ue = { | ||
}, qe = T("number", Be), 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) { | ||
@@ -388,3 +388,3 @@ return t.toString(); | ||
} | ||
}, Je = T("function", Ue), Ze = T("symbol", {}), Qe = { | ||
}, Ze = T("function", Je), Qe = T("symbol", {}), et = { | ||
stringify() { | ||
@@ -399,3 +399,3 @@ throw new Error("type any can not stringify"); | ||
} | ||
}, W = T(() => !0, Qe), et = P({ | ||
}, W = T(() => !0, et), tt = P({ | ||
check(t) { | ||
@@ -420,3 +420,3 @@ return this.argv[0].some((e) => e.check(t)); | ||
} | ||
}), tt = P({ | ||
}), rt = P({ | ||
check(t) { | ||
@@ -430,3 +430,3 @@ return Array.isArray(t) ? t.every((e) => this.argv[0].check(e)) : !1; | ||
zeroValue: [] | ||
}), rt = P({ | ||
}), nt = P({ | ||
check(t) { | ||
@@ -439,3 +439,3 @@ return !0; | ||
} | ||
}), nt = P({ | ||
}), st = P({ | ||
check(t) { | ||
@@ -453,14 +453,14 @@ return Object.entries(this.argv[0]).every(([e, r]) => r.check(t[e])); | ||
} | ||
}), st = W, it = W, ot = W, at = je; | ||
function ct() { | ||
}), it = W, ot = W, at = W, ct = Fe; | ||
function lt() { | ||
return P({ | ||
coerce: (t) => G(t) ? t : Q(t) | ||
coerce: (t) => q(t) ? t : Q(t) | ||
})(); | ||
} | ||
function lt() { | ||
function ht() { | ||
return P({ | ||
coerce: (t) => t instanceof F ? t : new F(t) | ||
coerce: (t) => t instanceof _ ? t : new _(t) | ||
})(); | ||
} | ||
function ht() { | ||
function ut() { | ||
return P({ | ||
@@ -477,38 +477,38 @@ coerce: (t) => t instanceof ne ? t : new ne(t) | ||
string: ze, | ||
number: Ge, | ||
object: We, | ||
array: Ke, | ||
bool: Ye, | ||
function: Je, | ||
symbol: Ze, | ||
node: st, | ||
element: it, | ||
elementType: ot, | ||
number: qe, | ||
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, | ||
checkPropTypes: ct, | ||
// reactive types | ||
atom: ct, | ||
rxList: lt, | ||
rxSet: ht, | ||
atom: lt, | ||
rxList: ht, | ||
rxSet: ut, | ||
rxMap: ft | ||
}; | ||
function ut(t, e) { | ||
function dt(t, e) { | ||
const r = t[1] === void 0 ? t.length < 2 ? 1 / 0 : 0 : t[1], n = r < 0 ? 0 : r; | ||
return n !== 1 / 0 ? n : e - t[0]; | ||
} | ||
class dt { | ||
class pt { | ||
constructor(e, r, n) { | ||
@@ -532,3 +532,3 @@ this.source = e, this.placeholder = r, this.pathContext = n, this.createHost = ([s, i]) => R(s, i, { ...this.pathContext, hostPath: [...this.pathContext.hostPath, this] }); | ||
function() { | ||
if (this.manualTrack(e.source, $.METHOD, N.METHOD), this.manualTrack(e.source, $.EXPLICIT_KEY_CHANGE, N.EXPLICIT_KEY_CHANGE), e.hostsComputed) | ||
if (this.manualTrack(e.source, I.METHOD, $.METHOD), this.manualTrack(e.source, I.EXPLICIT_KEY_CHANGE, $.EXPLICIT_KEY_CHANGE), e.hostsComputed) | ||
throw new Error("should never recompute reactiveArray"); | ||
@@ -539,3 +539,3 @@ return e.source.map(e.createPlaceholder); | ||
s.forEach(({ method: i, argv: o, result: a }) => { | ||
var c, f, p; | ||
var c, u, p; | ||
if (i === "push") { | ||
@@ -557,3 +557,3 @@ const d = o.map(e.createPlaceholder); | ||
throw new Error("can not use obj[key] = value to add item to reactive array, use push instead."); | ||
}), (f = a.remove) == null || f.forEach(({}) => { | ||
}), (u = a.remove) == null || u.forEach(({}) => { | ||
throw new Error("can not use delete obj[key] to delete item, use splice instead."); | ||
@@ -574,3 +574,3 @@ }), (p = a.update) == null || p.forEach(({ key: d, newValue: l }) => { | ||
if ((i = e.hostsComputed) != null && i.length) throw new Error("hostsComputed should not recompute"); | ||
this.manualTrack(e.placeholderAndItemComputed, $.METHOD, N.METHOD), this.manualTrack(e.placeholderAndItemComputed, $.EXPLICIT_KEY_CHANGE, N.EXPLICIT_KEY_CHANGE); | ||
this.manualTrack(e.placeholderAndItemComputed, I.METHOD, $.METHOD), this.manualTrack(e.placeholderAndItemComputed, I.EXPLICIT_KEY_CHANGE, $.EXPLICIT_KEY_CHANGE); | ||
const n = e.placeholderAndItemComputed.map(([o, a]) => R(o, a, { ...e.pathContext, hostPath: [...e.pathContext.hostPath, e] })), s = document.createDocumentFragment(); | ||
@@ -583,7 +583,7 @@ return n.forEach((o) => { | ||
s.forEach(({ method: i, argv: o, result: a }) => { | ||
var c, f, p, d; | ||
var c, u, p, d; | ||
if (i === "push") { | ||
const l = o.map(e.createHost), h = document.createDocumentFragment(); | ||
l.forEach((u) => { | ||
h.appendChild(u.placeholder), u.render(); | ||
l.forEach((f) => { | ||
h.appendChild(f.placeholder), f.render(); | ||
}), S(h, e.placeholder), n.push(...l); | ||
@@ -596,18 +596,18 @@ } else if (i === "pop") | ||
const l = o.map(e.createHost), h = document.createDocumentFragment(); | ||
l.forEach((u) => { | ||
h.appendChild(u.placeholder), u.render(); | ||
l.forEach((f) => { | ||
h.appendChild(f.placeholder), f.render(); | ||
}), S(h, e.element), n.unshift(...l); | ||
} else if (i === "splice") { | ||
const l = document.createDocumentFragment(), h = o.slice(2).map(e.createHost); | ||
if (h.forEach((u) => { | ||
l.appendChild(u.placeholder), u.render(); | ||
if (h.forEach((f) => { | ||
l.appendChild(f.placeholder), f.render(); | ||
}), o[0] === 0 && o[1] >= n.length && e.isOnlyChildrenOfParent()) { | ||
const u = e.placeholder.parentNode; | ||
!h.length && u instanceof HTMLElement ? (u.innerHTML = "", u.appendChild(l)) : u.replaceChildren(l), u.appendChild(e.placeholder), n.forEach((y) => y.destroy(!0)), n.splice(0, 1 / 0, ...h); | ||
const f = e.placeholder.parentNode; | ||
!h.length && f instanceof HTMLElement ? (f.innerHTML = "", f.appendChild(l)) : f.replaceChildren(l), f.appendChild(e.placeholder), n.forEach((y) => y.destroy(!0)), n.splice(0, 1 / 0, ...h); | ||
} else { | ||
const u = ut(o, n.length); | ||
S(l, ((c = n[o[0] + u]) == null ? void 0 : c.element) || e.placeholder), n.splice(o[0], u, ...h).forEach((m) => m.destroy()); | ||
const f = dt(o, n.length); | ||
S(l, ((c = n[o[0] + f]) == null ? void 0 : c.element) || e.placeholder), n.splice(o[0], f, ...h).forEach((m) => m.destroy()); | ||
} | ||
} else if (!i && a) | ||
(f = a.add) == null || f.forEach(({}) => { | ||
(u = a.add) == null || u.forEach(({}) => { | ||
throw new Error("should never occur"); | ||
@@ -617,4 +617,4 @@ }), (p = a.remove) == null || p.forEach(({}) => { | ||
}), (d = a.update) == null || d.forEach(({ key: l, newValue: h }) => { | ||
var u; | ||
n[l].destroy(), n[l] = e.createHost(h), S(n[l].placeholder, ((u = n[parseInt(l, 10) + 1]) == null ? void 0 : u.element) || e.placeholder), n[l].render(); | ||
var f; | ||
n[l].destroy(), n[l] = e.createHost(h), S(n[l].placeholder, ((f = n[parseInt(l, 10) + 1]) == null ? void 0 : f.element) || e.placeholder), n[l].render(); | ||
}); | ||
@@ -629,9 +629,9 @@ else | ||
destroy(e, r) { | ||
r || (_(this.hostsComputed), _(this.placeholderAndItemComputed)), this.hostsComputed.forEach((n) => n.destroy(e)), e || this.placeholder.remove(); | ||
r || (G(this.hostsComputed), G(this.placeholderAndItemComputed)), this.hostsComputed.forEach((n) => n.destroy(e)), e || this.placeholder.remove(); | ||
} | ||
} | ||
const le = /* @__PURE__ */ new WeakSet(); | ||
function pt({ container: t, content: e, destroyOnUnmount: r }, { useEffect: n, pathContext: s }) { | ||
function mt({ container: t, content: e, destroyOnUnmount: r }, { useEffect: n, pathContext: s }) { | ||
typeof e != "function" && (le.has(e) && console.error("static portal content can only be rendered once. Use function content for content has reactive parts."), le.add(e)); | ||
const i = Ht(t, s); | ||
const i = Ot(t, s); | ||
return i.render(e), n(() => () => { | ||
@@ -641,3 +641,3 @@ i.destroy(); | ||
} | ||
function mt() { | ||
function yt() { | ||
return { | ||
@@ -647,3 +647,3 @@ current: null | ||
} | ||
function yt() { | ||
function gt() { | ||
const t = Q(null); | ||
@@ -661,3 +661,3 @@ return new Proxy({}, { | ||
} | ||
function gt(t, e) { | ||
function Et(t, e) { | ||
const r = { ...t }; | ||
@@ -673,30 +673,30 @@ return Object.entries(e).forEach(([n, s]) => { | ||
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 = xe({}), this.itemConfig = {}, this.frame = [], this.exposed = {}, this.createHTMLOrSVGElement = (o, a, c, ...f) => { | ||
var x, E, D, 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 = Le({}), this.itemConfig = {}, this.frame = [], this.exposed = {}, this.createHTMLOrSVGElement = (o, a, c, ...u) => { | ||
var x, E, N, D; | ||
const p = typeof a == "function", d = c == null ? void 0 : c.as; | ||
if (c == null || delete c.as, A(d !== "self", '"self" is reserved, please use another element name.'), d && ((x = this.itemConfig[d]) != null && x.use) && ((E = this.itemConfig[d]) == null ? void 0 : E.use) instanceof Element) | ||
return this.itemConfig[d].use; | ||
let l = f, { props: h, componentProps: u } = this.separateProps(c); | ||
let l = u, { props: h, componentProps: f } = this.separateProps(c); | ||
const y = this.itemConfig[d]; | ||
d && y && (y.props && (p ? h = { ...c, ...y.props } : h = gt(c, y.props)), y.propMergeHandles && Object.entries(y.propMergeHandles).forEach(([b, O]) => { | ||
h[b] = O.reduce((Pe, Te) => Te(Pe, u), h[b]); | ||
}), y.propsMergeHandle && (h = y.propsMergeHandle.reduce((b, O) => O(b, u), h)), y.children && (l = y.children)); | ||
const m = ((D = this.itemConfig[d]) == null ? void 0 : D.use) || a; | ||
typeof m == "function" && !p && (u[wt] = h, h = u), typeof m == "function" && ((I = y == null ? void 0 : y.configProps) != null && I.length) && Object.assign(h, { [K]: y.configProps }), d && (h.ref = H(h.ref).concat((b) => this.refs[d] = b)); | ||
const w = o ? Ve(m, h, ...l) : g(m, h, ...l); | ||
d && y && (y.props && (p ? h = { ...c, ...y.props } : h = Et(c, y.props)), y.propMergeHandles && Object.entries(y.propMergeHandles).forEach(([b, O]) => { | ||
h[b] = O.reduce((Te, xe) => xe(Te, f), h[b]); | ||
}), y.propsMergeHandle && (h = y.propsMergeHandle.reduce((b, O) => O(b, f), h)), y.children && (l = y.children)); | ||
const m = ((N = this.itemConfig[d]) == null ? void 0 : N.use) || a; | ||
typeof m == "function" && !p && (f[wt] = h, h = f), typeof m == "function" && ((D = y == null ? void 0 : y.configProps) != null && D.length) && Object.assign(h, { [K]: y.configProps }), d && (h.ref = H(h.ref).concat((b) => this.refs[d] = b)); | ||
const C = o ? je(m, h, ...l) : g(m, h, ...l); | ||
if (typeof m != "function") { | ||
const b = this.pathContext.hostPath.filter((O) => O instanceof L).map((O) => O.props).reverse(); | ||
w.listenerBoundArgs = [b, u]; | ||
C.listenerBoundArgs = [b, f]; | ||
} | ||
return w; | ||
}, this.createElement = this.createHTMLOrSVGElement.bind(this, !1), this.createSVGElement = this.createHTMLOrSVGElement.bind(this, !0), this.createPortal = (o, a) => g(pt, { container: a, content: o }), this.useLayoutEffect = (o) => { | ||
return C; | ||
}, this.createElement = this.createHTMLOrSVGElement.bind(this, !1), this.createSVGElement = this.createHTMLOrSVGElement.bind(this, !0), this.createPortal = (o, a) => g(mt, { container: a, content: o }), this.useLayoutEffect = (o) => { | ||
this.layoutEffects.add(o); | ||
}, this.useEffect = (o) => { | ||
this.effects.add(o); | ||
}, this.createRef = mt, this.createRxRef = yt, this.cleanupsOfExternalTarget = /* @__PURE__ */ new Set(), this.createStateFromRef = (o, a) => { | ||
}, this.createRef = yt, this.createRxRef = gt, this.cleanupsOfExternalTarget = /* @__PURE__ */ new Set(), this.createStateFromRef = (o, a) => { | ||
let c; | ||
const f = (d) => { | ||
const u = (d) => { | ||
a && c && this.cleanupsOfExternalTarget.delete(c), c == null || c(), d !== null ? (c = o(d, p), a && c && this.cleanupsOfExternalTarget.add(c)) : (c = void 0, p(null)); | ||
}, p = new Proxy(Q(null), { | ||
get: (d, l) => l === "ref" ? f : d[l] | ||
get: (d, l) => l === "ref" ? u : d[l] | ||
}); | ||
@@ -795,3 +795,3 @@ return a && p.ref(a), p; | ||
this.element !== this.placeholder && A(!1, "should never rerender"), this.renderContext = { | ||
Fragment: Ce, | ||
Fragment: we, | ||
createElement: this.createElement, | ||
@@ -803,3 +803,3 @@ createSVGElement: this.createSVGElement, | ||
pathContext: this.pathContext, | ||
context: new Et(this.pathContext.hostPath), | ||
context: new Ct(this.pathContext.hostPath), | ||
createPortal: this.createPortal, | ||
@@ -812,3 +812,3 @@ createRef: this.createRef, | ||
}; | ||
const e = Le.collectEffect(), { props: r, itemConfig: n } = this.getFinalPropsAndItemConfig(); | ||
const e = He.collectEffect(), { props: r, itemConfig: n } = this.getFinalPropsAndItemConfig(); | ||
this.itemConfig = n, this.props = r; | ||
@@ -831,4 +831,4 @@ const s = this.type.propTypes ? this.normalizePropsWithCoerceValue(this.type.propTypes, r) : r; | ||
L.typeIds = /* @__PURE__ */ new Map(); | ||
let k = L; | ||
class Et { | ||
let V = L; | ||
class Ct { | ||
constructor(e) { | ||
@@ -840,3 +840,3 @@ this.hostPath = e, this.valueByType = /* @__PURE__ */ new Map(); | ||
const n = this.hostPath[r]; | ||
if (n instanceof k && n.renderContext.context.valueByType.has(e)) | ||
if (n instanceof V && n.renderContext.context.valueByType.has(e)) | ||
return n.renderContext.context.valueByType.get(e); | ||
@@ -850,3 +850,3 @@ } | ||
const wt = "__nativeAttrs"; | ||
function Ft(t, e) { | ||
function Gt(t, e) { | ||
const r = t.bind(null); | ||
@@ -858,3 +858,3 @@ return r.propTypes = t.propTypes, r.boundProps = H(r.boundProps).concat(e), r; | ||
} | ||
class Ct { | ||
class St { | ||
constructor(e, r, n) { | ||
@@ -887,6 +887,6 @@ this.source = e, this.placeholder = r, this.pathContext = n, this.stopAutoRun = () => { | ||
destroy(e, r) { | ||
r || _(this.computed), e || (this.element.remove(), this.placeholder.remove()); | ||
r || G(this.computed), e || (this.element.remove(), this.placeholder.remove()); | ||
} | ||
} | ||
class St { | ||
class bt { | ||
constructor(e, r, n) { | ||
@@ -921,11 +921,11 @@ this.source = e, this.placeholder = r, this.pathContext = n, this.fragmentParent = document.createDocumentFragment(); | ||
} | ||
const bt = g.isValidAttribute; | ||
const At = g.isValidAttribute; | ||
g.isValidAttribute = function(t, e) { | ||
return t.startsWith("on") ? !0 : Array.isArray(e) && e.some(fe) || fe(e) ? !1 : bt(t, e); | ||
return t.startsWith("on") ? !0 : Array.isArray(e) && e.some(ue) || ue(e) ? !1 : At(t, e); | ||
}; | ||
function fe(t) { | ||
return ye(t) || G(t) || typeof t == "function"; | ||
function ue(t) { | ||
return ye(t) || q(t) || typeof t == "function"; | ||
} | ||
function V(t) { | ||
return G(t) || typeof t == "function"; | ||
function j(t) { | ||
return q(t) || typeof t == "function"; | ||
} | ||
@@ -945,6 +945,10 @@ function be(t) { | ||
} | ||
function ue(t) { | ||
function fe(t) { | ||
t.offsetHeight; | ||
} | ||
class At { | ||
function Pe(t, e) { | ||
const r = t.findLastIndex((i) => i instanceof V), n = r === -1 ? void 0 : t[r], s = r === -1 ? t : t.slice(r + 1); | ||
return `gen-${(n == null ? void 0 : n.typeId) ?? "global"}-${s.map((i) => i.pathContext.elementPath.join("_")).join("-")}-${e.join("_")}`; | ||
} | ||
class Pt { | ||
constructor() { | ||
@@ -955,12 +959,11 @@ this.styleScripts = /* @__PURE__ */ new Map(), this.elToStyleId = /* @__PURE__ */ new WeakMap(); | ||
if (n) { | ||
const a = this.elToStyleId.get(n); | ||
if (a) | ||
return a; | ||
const s = this.elToStyleId.get(n); | ||
if (s) | ||
return s; | ||
{ | ||
const c = `gen-${Math.random().toString(36).slice(2)}`; | ||
return this.elToStyleId.set(n, c), c; | ||
const i = `gen-${Math.random().toString(36).slice(2)}`; | ||
return this.elToStyleId.set(n, i), i; | ||
} | ||
} | ||
const s = e.findLastIndex((a) => a instanceof k), i = s === -1 ? void 0 : e[s], o = s === -1 ? e : e.slice(s + 1); | ||
return `gen-${(i == null ? void 0 : i.typeId) ?? "global"}-${o.map((a) => a.pathContext.elementPath.join("_")).join("-")}-${r.join("_")}`; | ||
return Pe(e, r); | ||
} | ||
@@ -978,14 +981,14 @@ stringifyStyleObject(e) { | ||
`)); | ||
const f = U(c[0]); | ||
return f.length && ue(s), Re(c.slice(1).map((p) => () => { | ||
const [d, l, h] = this.separateStyleObject(p, f); | ||
if (l && this.generateStyleContent(`.${o}`, l).forEach((u) => { | ||
a.insertRule(u, a.cssRules.length); | ||
const u = U(c[0]); | ||
return u.length && fe(s), Oe(c.slice(1).map((p) => () => { | ||
const [d, l, h] = this.separateStyleObject(p, u); | ||
if (l && this.generateStyleContent(`.${o}`, l).forEach((f) => { | ||
a.insertRule(f, a.cssRules.length); | ||
}), d) { | ||
const u = U(d); | ||
f.push(...u), this.generateStyleContent(`.${o}`, d).forEach((y) => { | ||
const f = U(d); | ||
u.push(...f), this.generateStyleContent(`.${o}`, d).forEach((y) => { | ||
a.insertRule(y, a.cssRules.length); | ||
}); | ||
} | ||
h && q(s, "style", h), re(p) && ue(s); | ||
h && k(s, "style", h), re(p) && fe(s); | ||
})); | ||
@@ -1034,8 +1037,8 @@ } | ||
}`], a = this.generateInlineAnimationContent(e, i); | ||
return o.push(...a), s.reduce((c, [f, p]) => { | ||
if (f.startsWith("@")) | ||
return c.concat(`${f} { | ||
return o.push(...a), s.reduce((c, [u, p]) => { | ||
if (u.startsWith("@")) | ||
return c.concat(`${u} { | ||
${this.generateStyleContent(e, p)} | ||
}`); | ||
const d = /^(\s?)+&/.test(f) ? f.replace("&", e) : `${e} ${f}`; | ||
const d = /^(\s?)+&/.test(u) ? u.replace("&", e) : `${e} ${u}`; | ||
return c.concat(this.generateStyleContent(d, p)); | ||
@@ -1045,3 +1048,5 @@ }, o); | ||
} | ||
const B = class B { | ||
const Tt = { | ||
autoGenerateTestId: !1 | ||
}, B = class B { | ||
constructor(e, r, n) { | ||
@@ -1079,3 +1084,3 @@ this.source = e, this.placeholder = r, this.pathContext = n, this.forceHandleElement = !1, this.computed = void 0, this.element = this.placeholder, this.attachRefs = () => { | ||
this.attrAutoruns = [], n == null || n.forEach(({ el: s, key: i, value: o, path: a }) => { | ||
i.includes(":") || this.attrAutoruns.push(me(() => { | ||
s.hasAttribute("data-testid") || this.generateTestId(s, a), i.includes(":") || this.attrAutoruns.push(me(() => { | ||
this.updateAttribute(s, i, o, a, r); | ||
@@ -1086,6 +1091,6 @@ }, !0)); | ||
updateAttribute(e, r, n, s, i) { | ||
const o = Array.isArray(n) ? n.map((a) => V(a) ? a() : a) : V(n) ? n() : n; | ||
const o = Array.isArray(n) ? n.map((a) => j(a) ? a() : a) : j(n) ? n() : n; | ||
if (r === "style" && (be(o) || re(o) || Ae(o))) | ||
return B.styleManager.update(this.pathContext.hostPath, s, o, e, !1); | ||
q(e, r, o, i); | ||
k(e, r, o, i); | ||
} | ||
@@ -1104,2 +1109,7 @@ collectRefHandles() { | ||
} | ||
generateTestId(e, r) { | ||
if (!Tt.autoGenerateTestId) return; | ||
const n = Pe(this.pathContext.hostPath, r); | ||
k(e, "data-testid", n); | ||
} | ||
destroy(e, r) { | ||
@@ -1116,12 +1126,12 @@ var n, s, i; | ||
const i = /* @__PURE__ */ new Set(), o = /* @__PURE__ */ new Set(); | ||
(n = this.detachStyledChildren) == null || n.forEach(({ el: f, style: p }) => { | ||
const d = getComputedStyle(f).transitionProperty.split(",").map((y) => y.trim()), l = Array.isArray(p) ? Object.assign({}, ...p.map((y) => V(y) ? y() : y)) : V(p) ? p() : p, h = Object.keys(l); | ||
(d.includes("all") || h.some((y) => d.includes(y))) && i.add(f), l.animation && o.add(f); | ||
}), await Promise.all(((s = this.detachStyledChildren) == null ? void 0 : s.map(({ el: f, style: p, path: d }) => this.updateAttribute(f, "style", p, d, f instanceof SVGElement))) || []); | ||
(n = this.detachStyledChildren) == null || n.forEach(({ el: u, style: p }) => { | ||
const d = getComputedStyle(u).transitionProperty.split(",").map((y) => y.trim()), l = Array.isArray(p) ? Object.assign({}, ...p.map((y) => j(y) ? y() : y)) : j(p) ? p() : p, h = Object.keys(l); | ||
(d.includes("all") || h.some((y) => d.includes(y))) && i.add(u), l.animation && o.add(u); | ||
}), await Promise.all(((s = this.detachStyledChildren) == null ? void 0 : s.map(({ el: u, style: p, path: d }) => this.updateAttribute(u, "style", p, d, u instanceof SVGElement))) || []); | ||
const a = Array.from(i), c = Array.from(o); | ||
await Promise.all([ | ||
...a.map((f) => j(f, "transitionrun")), | ||
...a.map((f) => j(f, "transitionend")), | ||
...c.map((f) => j(f, "animationrun")), | ||
...c.map((f) => j(f, "animationend")) | ||
...a.map((u) => F(u, "transitionrun")), | ||
...a.map((u) => F(u, "transitionend")), | ||
...c.map((u) => F(u, "animationrun")), | ||
...c.map((u) => F(u, "animationend")) | ||
]); | ||
@@ -1133,5 +1143,5 @@ } | ||
}; | ||
B.styleManager = new At(); | ||
B.styleManager = new Pt(); | ||
let J = B; | ||
function j(t, e) { | ||
function F(t, e) { | ||
return new Promise((r) => { | ||
@@ -1141,3 +1151,3 @@ t.addEventListener(e, r, { once: !0 }); | ||
} | ||
class Pt { | ||
class xt { | ||
constructor(e, r, n) { | ||
@@ -1176,3 +1186,3 @@ this.source = e, this.placeholder = r, this.pathContext = n, this.computed = void 0, this.childHosts = []; | ||
} | ||
class Tt { | ||
class Lt { | ||
constructor(e, r, n) { | ||
@@ -1202,11 +1212,11 @@ this.source = e, this.placeholder = r, this.pathContext = n; | ||
function() { | ||
return this.manualTrack(e.hosts, $.METHOD, N.METHOD), this.manualTrack(e.hosts, $.EXPLICIT_KEY_CHANGE, N.EXPLICIT_KEY_CHANGE), S(e.renderNewHosts(e.hosts), e.placeholder), null; | ||
return this.manualTrack(e.hosts, I.METHOD, $.METHOD), this.manualTrack(e.hosts, I.EXPLICIT_KEY_CHANGE, $.EXPLICIT_KEY_CHANGE), S(e.renderNewHosts(e.hosts), e.placeholder), null; | ||
}, | ||
function(n, s) { | ||
s.forEach(({ method: i, argv: o, result: a, key: c, newValue: f, methodResult: p }, d) => { | ||
s.forEach(({ method: i, argv: o, result: a, key: c, newValue: u, methodResult: p }, d) => { | ||
var l; | ||
if (i === "splice") { | ||
const h = e.hosts.data.slice(o[0] + o.slice(2).length).find((m) => m.element.parentNode), u = o.slice(2); | ||
if (u.length) { | ||
const m = e.renderNewHosts(u); | ||
const h = e.hosts.data.slice(o[0] + o.slice(2).length).find((m) => m.element.parentNode), f = o.slice(2); | ||
if (f.length) { | ||
const m = e.renderNewHosts(f); | ||
S(m, (h == null ? void 0 : h.element) || e.placeholder); | ||
@@ -1218,4 +1228,4 @@ } | ||
h == null || h.destroy(); | ||
const u = c; | ||
S(e.hosts.at(u).placeholder, ((l = e.hosts.at(u + 1)) == null ? void 0 : l.element) || e.placeholder), e.hosts.at(u).render(); | ||
const f = c; | ||
S(e.hosts.at(f).placeholder, ((l = e.hosts.at(f + 1)) == null ? void 0 : l.element) || e.placeholder), e.hosts.at(f).render(); | ||
} else | ||
@@ -1230,6 +1240,6 @@ throw new Error("unknown trigger info"); | ||
var n; | ||
r || ((n = this.hosts) == null || n.destroy(), _(this.hostRenderComputed)), this.hosts.forEach((s) => s.destroy(e)), e || this.placeholder.remove(); | ||
r || ((n = this.hosts) == null || n.destroy(), G(this.hostRenderComputed)), this.hosts.forEach((s) => s.destroy(e)), e || this.placeholder.remove(); | ||
} | ||
} | ||
class xt { | ||
class Ht { | ||
constructor(e, r) { | ||
@@ -1246,3 +1256,3 @@ this.pathContext = e, this.placeholder = r, this.element = document.createComment("empty"); | ||
} | ||
class Lt { | ||
class Rt { | ||
constructor(e, r, n) { | ||
@@ -1261,5 +1271,5 @@ this.source = e, this.placeholder = r, this.pathContext = n, this.element = this.placeholder; | ||
let n; | ||
return t instanceof F ? n = new Tt(t, e, r) : Array.isArray(t) ? ye(t) ? n = new dt(t, e, r) : n = new Pt(t, e, r) : typeof t == "object" && typeof (t == null ? void 0 : t.type) == "function" ? n = new k(t, e, r) : G(t) ? n = new Ct(t, e, r) : typeof t == "function" ? n = new St(t, e, r) : t instanceof HTMLElement || t instanceof SVGElement || t instanceof DocumentFragment ? n = new J(t, e, r) : t == null ? n = new xt(r, e) : typeof t == "string" || typeof t == "number" || typeof t == "boolean" ? n = new Lt(t, e, r) : A(!1, `unknown child type ${t}`), n; | ||
return t instanceof _ ? n = new Lt(t, e, r) : Array.isArray(t) ? ye(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 V(t, e, r) : q(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 J(t, e, r) : t == null ? n = new Ht(r, e) : typeof t == "string" || typeof t == "number" || typeof t == "boolean" ? n = new Rt(t, e, r) : A(!1, `unknown child type ${t}`), n; | ||
} | ||
function Ht(t, e) { | ||
function Ot(t, e) { | ||
const r = /* @__PURE__ */ new Map(), n = e || { | ||
@@ -1295,3 +1305,3 @@ hostPath: [], | ||
} | ||
function C(t) { | ||
function w(t) { | ||
return (e) => (r) => { | ||
@@ -1302,4 +1312,4 @@ if (t(r)) | ||
} | ||
const _t = C((t) => t.key === "ArrowUp"), zt = C((t) => t.key === "ArrowDown"), Bt = C((t) => t.key === "ArrowLeft"), Gt = C((t) => t.key === "ArrowRight"), qt = C((t) => t.key === "Enter"), Wt = C((t) => t.key === "Tab"), Kt = C((t) => t.key === "Escape"), Xt = C((t) => t.key === "Backspace"), Yt = C((t) => t.key === "Space"), Ut = C((t) => t.button === 0), Jt = C((t) => t.button === 2), Zt = C((t) => t.button === 1), Qt = (t, e) => C((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), er = C((t) => t.target === t.currentTarget); | ||
function tr(t) { | ||
const zt = w((t) => t.key === "ArrowUp"), Bt = w((t) => t.key === "ArrowDown"), qt = w((t) => t.key === "ArrowLeft"), Wt = w((t) => t.key === "ArrowRight"), Kt = w((t) => t.key === "Enter"), Xt = w((t) => t.key === "Tab"), Yt = w((t) => t.key === "Escape"), Ut = w((t) => t.key === "Backspace"), Jt = w((t) => t.key === "Space"), Zt = w((t) => t.button === 0), Qt = w((t) => t.button === 2), er = w((t) => t.button === 1), tr = (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), rr = w((t) => t.target === t.currentTarget); | ||
function nr(t) { | ||
let e; | ||
@@ -1327,3 +1337,3 @@ function r(s) { | ||
} | ||
function rr(t) { | ||
function sr(t) { | ||
return (e) => { | ||
@@ -1335,3 +1345,3 @@ var n; | ||
} | ||
function nr(t) { | ||
function ir(t) { | ||
return (e) => { | ||
@@ -1341,3 +1351,3 @@ e.preventDefault(), t(e); | ||
} | ||
function sr(t) { | ||
function or(t) { | ||
return (e) => { | ||
@@ -1347,6 +1357,6 @@ e.stopPropagation(), t(e); | ||
} | ||
function ir({ contextType: t, value: e, children: r }, { context: n }) { | ||
function ar({ contextType: t, value: e, children: r }, { context: n }) { | ||
return n.set(t, e), r; | ||
} | ||
function Rt(t) { | ||
function vt(t) { | ||
const e = { | ||
@@ -1361,26 +1371,26 @@ name: t, | ||
} | ||
const Ot = Rt("Form"); | ||
function vt({ name: t, children: e, onChange: r, onSubmit: n, onClear: s, onReset: i, values: o }, { | ||
const It = vt("Form"); | ||
function $t({ name: t, children: e, onChange: r, onSubmit: n, onClear: s, onReset: i, values: o }, { | ||
createElement: a, | ||
context: c | ||
}) { | ||
const f = {}, p = (m, w, x) => { | ||
x ? (o.get(m) || o.set(m, new F([])), f[m] || (f[m] = []), o.get(m).push(w.value)(f[m]).push(w)) : (o.set(m, w.value), f[m] = w); | ||
}, d = (m, w, x) => { | ||
const u = {}, p = (m, C, x) => { | ||
x ? (o.get(m) || o.set(m, new _([])), u[m] || (u[m] = []), o.get(m).push(C.value)(u[m]).push(C)) : (o.set(m, C.value), u[m] = C); | ||
}, d = (m, C, x) => { | ||
if (x) { | ||
const E = o.get(m), D = E.findIndex((b) => b === w.value); | ||
D() > -1 && E.splice(D(), 1); | ||
const I = f[m].findIndex((b) => b === w); | ||
I > -1 && f[m].splice(I, 1); | ||
const E = o.get(m), N = E.findIndex((b) => b === C.value); | ||
N() > -1 && E.splice(N(), 1); | ||
const D = u[m].findIndex((b) => b === C); | ||
D > -1 && u[m].splice(D, 1); | ||
} else | ||
o.delete(m), delete f[m]; | ||
o.delete(m), delete u[m]; | ||
}, l = () => { | ||
n == null || n(o); | ||
}, h = () => { | ||
Object.values(f).forEach((m) => { | ||
Array.isArray(m) ? m.forEach((w) => w.reset()) : m.reset(); | ||
Object.values(u).forEach((m) => { | ||
Array.isArray(m) ? m.forEach((C) => C.reset()) : m.reset(); | ||
}), i == null || i(); | ||
}, u = () => { | ||
Object.values(f).forEach((m) => { | ||
Array.isArray(m) ? m.forEach((w) => w.clear()) : m.clear(); | ||
}, f = () => { | ||
Object.values(u).forEach((m) => { | ||
Array.isArray(m) ? m.forEach((C) => C.clear()) : m.clear(); | ||
}), s == null || s(); | ||
@@ -1390,5 +1400,5 @@ }, y = () => { | ||
}; | ||
return c.set(Ot, { name: t, register: p, unregister: d, onChange: y, submit: l, reset: h, clear: u }), e; | ||
return c.set(It, { name: t, register: p, unregister: d, onChange: y, submit: l, reset: h, clear: f }), e; | ||
} | ||
vt.propTypes = { | ||
$t.propTypes = { | ||
name: v.string.isRequired, | ||
@@ -1402,4 +1412,4 @@ values: v.rxMap(), | ||
}; | ||
const or = Symbol("ModalContext"); | ||
function ar(t) { | ||
const cr = Symbol("ModalContext"); | ||
function lr(t) { | ||
return (e, r) => { | ||
@@ -1470,3 +1480,3 @@ if (e === window) { | ||
}); | ||
function cr(t, e) { | ||
function hr(t, e) { | ||
if (t === window) { | ||
@@ -1494,3 +1504,3 @@ const r = () => { | ||
} | ||
function lr(t, e) { | ||
function ur(t, e) { | ||
const r = () => { | ||
@@ -1505,9 +1515,9 @@ e(!0); | ||
} | ||
const $t = "dragmove"; | ||
function hr(t) { | ||
const e = (t == null ? void 0 : t.container) || document.body, r = (t == null ? void 0 : t.customEventName) || $t; | ||
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) { | ||
const i = (o) => { | ||
const a = o.clientX, c = o.clientY; | ||
let f = a, p = c; | ||
let u = a, p = c; | ||
const d = (l) => { | ||
@@ -1519,3 +1529,3 @@ const h = { | ||
deltaYFromStart: l.clientY - c, | ||
deltaX: l.clientX - f, | ||
deltaX: l.clientX - u, | ||
deltaY: l.clientY - p | ||
@@ -1534,3 +1544,3 @@ }; | ||
} | ||
function fr(t) { | ||
function dr(t) { | ||
return function(r, n) { | ||
@@ -1557,3 +1567,3 @@ const s = (i) => { | ||
} | ||
function ur(t) { | ||
function pr(t) { | ||
return function(r, n) { | ||
@@ -1570,3 +1580,3 @@ const s = (i) => { | ||
} | ||
function dr(t, e) { | ||
function mr(t, e) { | ||
const r = () => { | ||
@@ -1585,57 +1595,59 @@ e({ | ||
export { | ||
k as ComponentHost, | ||
ir as ContextProvider, | ||
$t as DEFAULT_DRAG_MOVE_EVENT, | ||
Et as DataContext, | ||
vt as Form, | ||
Ot as FormContext, | ||
Ce as Fragment, | ||
or as ModalContext, | ||
V as ComponentHost, | ||
ar as ContextProvider, | ||
Nt as DEFAULT_DRAG_MOVE_EVENT, | ||
Ct as DataContext, | ||
$t as Form, | ||
It as FormContext, | ||
we as Fragment, | ||
cr as ModalContext, | ||
wt as N_ATTR, | ||
pt as Portal, | ||
mt as Portal, | ||
v as PropTypes, | ||
J as StaticHost, | ||
Tt as StaticHostConfig, | ||
M as StyleSize, | ||
ve as autoUnit, | ||
Ft as bindProps, | ||
Rt as createContext, | ||
Ie as autoUnit, | ||
Gt as bindProps, | ||
vt as createContext, | ||
g as createElement, | ||
It as createElementNS, | ||
tr as createEventTransfer, | ||
kt as createElementNS, | ||
nr as createEventTransfer, | ||
R as createHost, | ||
hr as createOnDragMove, | ||
fr as createReactiveDragPosition, | ||
ur as createReactiveDragTarget, | ||
ar as createReactivePosition, | ||
mt as createRef, | ||
Ht as createRoot, | ||
yt as createRxRef, | ||
Mt as dispatchEvent, | ||
C as eventAlias, | ||
Vt as jsx, | ||
jt as jsxDEV, | ||
kt as jsxs, | ||
fr as createOnDragMove, | ||
dr as createReactiveDragPosition, | ||
pr as createReactiveDragTarget, | ||
lr as createReactivePosition, | ||
yt as createRef, | ||
Ot as createRoot, | ||
gt as createRxRef, | ||
Vt as dispatchEvent, | ||
w as eventAlias, | ||
Ft as jsx, | ||
_t as jsxDEV, | ||
jt as jsxs, | ||
Y as mergeProp, | ||
gt as mergeProps, | ||
Xt as onBackspaceKey, | ||
zt as onDownKey, | ||
Kt as onESCKey, | ||
qt as onEnterKey, | ||
Qt as onKey, | ||
Bt as onLeftKey, | ||
Ut as onLeftMouseDown, | ||
Zt as onMiddleMouseDown, | ||
Gt as onRightKey, | ||
Jt as onRightMouseDown, | ||
er as onSelf, | ||
Yt as onSpaceKey, | ||
Wt as onTabKey, | ||
_t as onUpKey, | ||
lr as reactiveFocused, | ||
dr as reactiveScrollPosition, | ||
cr as reactiveSize, | ||
Dt as setAutoUnitType, | ||
rr as withCurrentRange, | ||
nr as withPreventDefault, | ||
sr as withStopPropagation | ||
Et as mergeProps, | ||
Ut as onBackspaceKey, | ||
Bt as onDownKey, | ||
Yt as onESCKey, | ||
Kt as onEnterKey, | ||
tr as onKey, | ||
qt as onLeftKey, | ||
Zt as onLeftMouseDown, | ||
er as onMiddleMouseDown, | ||
Wt as onRightKey, | ||
Qt as onRightMouseDown, | ||
rr as onSelf, | ||
Jt as onSpaceKey, | ||
Xt as onTabKey, | ||
zt as onUpKey, | ||
ur as reactiveFocused, | ||
mr as reactiveScrollPosition, | ||
hr as reactiveSize, | ||
Mt as setAutoUnitType, | ||
sr as withCurrentRange, | ||
ir as withPreventDefault, | ||
or as withStopPropagation | ||
}; | ||
//# sourceMappingURL=axii.js.map |
{ | ||
"name": "axii", | ||
"version": "2.6.60", | ||
"version": "2.6.61", | ||
"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
549323
3049