Comparing version 2.6.49 to 2.6.50
@@ -89,2 +89,5 @@ 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; | ||
/** | ||
* @category Basic | ||
*/ | ||
export declare type Component = { | ||
@@ -100,71 +103,3 @@ (props: any, injectHandles: RenderContext): JSXElement; | ||
export declare class ComponentHost implements Host { | ||
placeholder: UnhandledPlaceholder; | ||
pathContext: PathContext; | ||
static typeIds: Map<Function, number>; | ||
type: Component; | ||
innerHost?: Host; | ||
props: Props; | ||
layoutEffects: Set<EffectHandle>; | ||
effects: Set<EffectHandle>; | ||
destroyCallback: Set<any>; | ||
layoutEffectDestroyHandles: Set<any>; | ||
refs: { | ||
[k: string]: any; | ||
}; | ||
itemConfig: { | ||
[k: string]: ConfigItem; | ||
}; | ||
children: any; | ||
frame?: ManualCleanup[]; | ||
name: string; | ||
exposed: { | ||
[k: string]: any; | ||
}; | ||
renderContext?: RenderContext; | ||
refProp?: RefObject | RefFn; | ||
thisProp?: RefObject | RefFn; | ||
inputProps: Props; | ||
deleteLayoutEffectCallback?: () => void; | ||
constructor({ type, props: inputProps, children }: ComponentNode, placeholder: UnhandledPlaceholder, pathContext: PathContext); | ||
parseItemConfigFromProp(itemConfig: any, key: string, value: any): any; | ||
get typeId(): number; | ||
get parentElement(): HTMLElement | null; | ||
get element(): HTMLElement | Comment | SVGElement | Text; | ||
separateProps(rawProps: AttributesArg): { | ||
props: Props; | ||
componentProps: Props; | ||
}; | ||
createHTMLOrSVGElement: (isSVG: boolean, type: JSXElementType, rawProps: AttributesArg, ...children: any[]) => ReturnType<typeof createElement>; | ||
createElement: (type: JSXElementType, rawProps: AttributesArg, ...children: any[]) => HTMLElement | SVGElement | DocumentFragment | ComponentNode; | ||
createSVGElement: (type: JSXElementType, rawProps: AttributesArg, ...children: any[]) => HTMLElement | SVGElement | DocumentFragment | ComponentNode; | ||
createPortal: (content: JSX.Element | ComponentNode | Function, container: HTMLElement) => HTMLElement | SVGElement | DocumentFragment | ComponentNode; | ||
useLayoutEffect: (callback: EffectHandle) => void; | ||
useEffect: (callback: EffectHandle) => void; | ||
createRef: typeof createRef; | ||
createRxRef: typeof createRxRef; | ||
normalizePropsByPropTypes(propTypes: NonNullable<Component["propTypes"]>, props: Props): Props; | ||
normalizePropsWithCoerceValue(propTypes: NonNullable<Component["propTypes"]>, props: Props): Props; | ||
attachRef(ref: RefObject | RefFn): void; | ||
attachThis(ref: RefObject | RefFn): void; | ||
detachRef(ref: RefObject | RefFn): void; | ||
cleanupsOfExternalTarget: Set<() => void>; | ||
createStateFromRef: <T>(transform: StateTransformer<T>, externalTarget?: any) => StateFromRef<T>; | ||
expose: (value: any, name?: string) => any; | ||
onCleanup: (callback: () => any) => void; | ||
evaluateBoundProps(inputProps: Props, renderContext: RenderContext): any[]; | ||
parseAndMergeProps(last: { | ||
props: Props; | ||
itemConfig: ConfigItem; | ||
componentProp: Props; | ||
}, current: Props): { | ||
props: Props; | ||
itemConfig: ConfigItem; | ||
componentProp: Props; | ||
}; | ||
getFinalPropsAndItemConfig(): any; | ||
render(): void; | ||
runLayoutEffect: () => void; | ||
destroy(parentHandle?: boolean, parentHandleComputed?: boolean): void; | ||
} | ||
/* Excluded from this release type: ComponentHost */ | ||
@@ -281,4 +216,10 @@ export declare type ComponentNode = { | ||
/** | ||
* @category Basic | ||
*/ | ||
export declare function ContextProvider({ contextType, value, children }: ContextProviderProps, { context }: RenderContext): any; | ||
/** | ||
* @category Basic | ||
*/ | ||
export declare type ContextProviderProps = { | ||
@@ -292,2 +233,5 @@ contextType: any; | ||
/** | ||
* @category Basic | ||
*/ | ||
export declare function createContext<T>(name: string): { | ||
@@ -309,8 +253,16 @@ name: string; | ||
var isValidAttribute: (name: string, value: any) => boolean; | ||
var attachRef: (el: HTMLElement, ref: RefObject | RefFn | (RefObject | RefFn)[]) => void; | ||
var detachRef: (ref: RefObject | RefFn | (RefObject | RefFn)[]) => void; | ||
var attachRef: (el: HTMLElement, ref: (RefFn | RefObject) | (RefFn | RefObject)[]) => void; | ||
var detachRef: (ref: (RefFn | RefObject) | (RefFn | RefObject)[]) => void; | ||
} | ||
/** | ||
* @category Miscellaneous | ||
*/ | ||
export declare type CreateElementFn = (type: JSXElementType, rawProps: AttributesArg, ...children: any[]) => JSXElement; | ||
export declare function createElementNS(type: string, props: AttributesArg, ...children: any[]): HTMLElement | SVGElement | DocumentFragment | ComponentNode; | ||
/** | ||
* @category Event Utility | ||
*/ | ||
export declare function createEventTransfer(transform?: (e: Event) => Event | null | undefined): { | ||
@@ -321,22 +273,68 @@ source: (sourceEvent: Event) => void; | ||
export declare function createHost(source: any, placeholder: UnhandledPlaceholder, context: PathContext): Host; | ||
/* Excluded from this release type: createHost */ | ||
export declare function createName<T extends AnyFn>(originFn: T): NameProxyType<T>; | ||
/** | ||
* @category Reactive State Utility | ||
*/ | ||
export declare function createOnDragMove(options?: DragMoveOptions): (ref: HTMLElement) => () => void; | ||
/** | ||
* @category Basic | ||
*/ | ||
export declare type CreatePortalFn = (children: JSXElement | Function, container: HTMLElement) => JSXElement; | ||
/** | ||
* @category Reactive State Utility | ||
*/ | ||
export declare function createReactiveDragPosition(shouldRecord: Atom<any>): (ref: HTMLElement, position: Atom<DragPosition | null>) => () => void; | ||
/** | ||
* @category Reactive State Utility | ||
*/ | ||
export declare function createReactiveDragTarget(getSnapshot: (ref: HTMLElement) => any): (ref: HTMLElement, value: Atom<any>) => () => void; | ||
/** | ||
* @category Reactive State Utility | ||
*/ | ||
export declare function createReactivePosition(options: ReactivePositionOptions): (elOrWindow: HTMLElement | Window, value: Atom<PositionObject | null>) => (() => void) | undefined; | ||
/** | ||
* @category Basic | ||
*/ | ||
export declare function createRef(): RefObject; | ||
/** | ||
* @category Basic | ||
*/ | ||
export declare type CreateRefFn = () => RefObject; | ||
/** | ||
* @category Basic | ||
*/ | ||
export declare function createRoot(element: HTMLElement, parentContext?: PathContext): Root; | ||
/** | ||
* @category Basic | ||
*/ | ||
export declare function createRxRef(): RefObject; | ||
/** | ||
* @category Basic | ||
*/ | ||
export declare type CreateRxRefFn = () => RefObject; | ||
export declare function createSelection<T>(source: RxList<T>, currentValues: RxSet<T | number> | Atom<T | null | number>, autoResetValue?: boolean): RxList<[T, Atom<boolean>]>; | ||
/** | ||
* @category Basic | ||
*/ | ||
export declare type CreateStateFromRefFn = <T>(transform: StateTransformer<T>, options?: any, externalTarget?: any) => StateFromRef<T>; | ||
/** | ||
* @category Basic | ||
*/ | ||
export declare type CreateSVGElementFn = (type: string, rawProps: AttributesArg, ...children: any[]) => JSXElement; | ||
export declare class DataContext { | ||
@@ -385,5 +383,7 @@ hostPath: Host[]; | ||
declare function dispatchEvent_2(target: ExtendedElement, event: Event): any; | ||
export { dispatchEvent_2 as dispatchEvent } | ||
/* Excluded from this release type: dispatchEvent_2 */ | ||
/** | ||
* @category Reactive State Utility | ||
*/ | ||
export declare type DragMoveDetail = { | ||
@@ -401,2 +401,5 @@ clientX: number; | ||
/** | ||
* @category Reactive State Utility | ||
*/ | ||
export declare type DragPosition = { | ||
@@ -413,2 +416,5 @@ clientX: number; | ||
/** | ||
* @category Event Utility | ||
*/ | ||
export declare function eventAlias<T extends Event>(match: (e: T) => boolean): (handle: (e: T) => any) => (e: T) => any; | ||
@@ -420,2 +426,7 @@ | ||
/** | ||
* @category Basic | ||
*/ | ||
export declare type ExposeFn = <T>(value: T, name?: string) => T; | ||
declare interface ExtendedElement extends HTMLElement { | ||
@@ -447,3 +458,3 @@ _listeners?: { | ||
export declare function Form({ name, children, onChange, onSubmit, onClear, onReset, values }: FormProps, { createElement, context }: RenderContext): any; | ||
/* Excluded declaration from this release type: Form */ | ||
@@ -486,23 +497,7 @@ export declare namespace Form { | ||
export declare const FormContext: { | ||
name: string; | ||
Provider({ value, children }: ContextProviderProps, { context }: RenderContext): any; | ||
valueType: FormContextValue; | ||
}; | ||
/* Excluded from this release type: FormContext */ | ||
export declare type FormContextValue = { | ||
name: string; | ||
register: (name: string, instance: FormItemInstance, multiple?: boolean) => void; | ||
unregister: (name: string, instance: FormItemInstance, multiple?: boolean) => void; | ||
onChange: FormProps['onChange']; | ||
submit: () => void; | ||
clear: () => void; | ||
reset: () => void; | ||
}; | ||
/* Excluded from this release type: FormContextValue */ | ||
export declare type FormItemInstance = { | ||
reset: () => void; | ||
clear: () => void; | ||
value: any; | ||
}; | ||
/* Excluded from this release type: FormItemInstance */ | ||
@@ -519,2 +514,5 @@ export declare type FormProps = { | ||
/** | ||
* @category Basic | ||
*/ | ||
export declare function Fragment(): void; | ||
@@ -548,12 +546,3 @@ | ||
export declare interface Host { | ||
element: HTMLElement | Comment | Text | SVGElement; | ||
placeholder: Comment; | ||
pathContext: PathContext; | ||
computed?: ReturnType<typeof computed>; | ||
render: () => void; | ||
forceHandleElement?: boolean; | ||
destroy: (parentHandleElement?: boolean, parentHandleComputed?: boolean) => void; | ||
revoke?: () => void; | ||
} | ||
/* Excluded from this release type: Host */ | ||
@@ -606,2 +595,4 @@ export declare function incBool(): void; | ||
export declare function jsx(type: JSXElementType, { children, ...rawProps }: AttributesArg): ComponentNode | HTMLElement | DocumentFragment | SVGElement; | ||
export declare type JSXElement = ComponentNode | HTMLElement | Comment | DocumentFragment | SVGElement | string | number | undefined | null; | ||
@@ -611,2 +602,4 @@ | ||
export declare function jsxs(type: JSXElementType, { children, ...rawProps }: AttributesArg): ComponentNode | HTMLElement | DocumentFragment | SVGElement; | ||
declare type KeyItemPair = { | ||
@@ -685,12 +678,9 @@ key?: any; | ||
export declare function mergeProp(key: string, originValue: any, value: any): any; | ||
/* Excluded from this release type: mergeProp */ | ||
export declare function mergeProps(origin: { | ||
[k: string]: any; | ||
}, newProps: { | ||
[k: string]: any; | ||
}): { | ||
[x: string]: any; | ||
}; | ||
/* Excluded from this release type: mergeProps */ | ||
/** | ||
* @category Common Utility | ||
*/ | ||
export declare const ModalContext: unique symbol; | ||
@@ -739,2 +729,5 @@ | ||
/** | ||
* @category Event Utility | ||
*/ | ||
export declare const onBackspaceKey: (handle: (e: KeyboardEvent) => any) => (e: KeyboardEvent) => any; | ||
@@ -744,10 +737,30 @@ | ||
/** | ||
* @category Basic | ||
*/ | ||
export declare type OnCleanupFn = (arg: () => any) => void; | ||
/** | ||
* @category Event Utility | ||
*/ | ||
export declare const onDownKey: (handle: (e: KeyboardEvent) => any) => (e: KeyboardEvent) => any; | ||
/** | ||
* @category Event Utility | ||
*/ | ||
export declare const onEnterKey: (handle: (e: KeyboardEvent) => any) => (e: KeyboardEvent) => any; | ||
/** | ||
* @category Event Utility | ||
*/ | ||
export declare const onESCKey: (handle: (e: KeyboardEvent) => any) => (e: KeyboardEvent) => any; | ||
/** | ||
* @category Event Utility | ||
*/ | ||
export declare const onKey: (key: string, config?: onKeyConfig) => (handle: (e: KeyboardEvent) => any) => (e: KeyboardEvent) => any; | ||
/** | ||
* @category Event Utility | ||
*/ | ||
export declare type onKeyConfig = { | ||
@@ -760,16 +773,40 @@ meta?: boolean; | ||
/** | ||
* @category Event Utility | ||
*/ | ||
export declare const onLeftKey: (handle: (e: KeyboardEvent) => any) => (e: KeyboardEvent) => any; | ||
/** | ||
* @category Event Utility | ||
*/ | ||
export declare const onLeftMouseDown: (handle: (e: MouseEvent) => any) => (e: MouseEvent) => any; | ||
/** | ||
* @category Event Utility | ||
*/ | ||
export declare const onMiddleMouseDown: (handle: (e: MouseEvent) => any) => (e: MouseEvent) => any; | ||
/** | ||
* @category Event Utility | ||
*/ | ||
export declare const onRightKey: (handle: (e: KeyboardEvent) => any) => (e: KeyboardEvent) => any; | ||
/** | ||
* @category Event Utility | ||
*/ | ||
export declare const onRightMouseDown: (handle: (e: MouseEvent) => any) => (e: MouseEvent) => any; | ||
/** | ||
* @category Event Utility | ||
*/ | ||
export declare const onSelf: (handle: (e: Event) => any) => (e: Event) => any; | ||
/** | ||
* @category Event Utility | ||
*/ | ||
export declare const onSpaceKey: (handle: (e: KeyboardEvent) => any) => (e: KeyboardEvent) => any; | ||
/** | ||
* @category Event Utility | ||
*/ | ||
export declare const onTabKey: (handle: (e: KeyboardEvent) => any) => (e: KeyboardEvent) => any; | ||
@@ -781,2 +818,5 @@ | ||
/** | ||
* @category Event Utility | ||
*/ | ||
export declare const onUpKey: (handle: (e: KeyboardEvent) => any) => (e: KeyboardEvent) => any; | ||
@@ -793,8 +833,3 @@ | ||
export declare type PathContext = { | ||
[k: string]: any; | ||
root: Root; | ||
hostPath: Host[]; | ||
elementPath: number[]; | ||
}; | ||
/* Excluded from this release type: PathContext */ | ||
@@ -807,4 +842,10 @@ declare type Phase = typeof FULL_RECOMPUTE_PHASE | typeof PATCH_PHASE; | ||
/** | ||
* @category Basic | ||
*/ | ||
export declare function Portal({ container, content, destroyOnUnmount }: PortalProps, { useEffect, pathContext }: RenderContext): null; | ||
/** | ||
* @category Basic | ||
*/ | ||
declare type PortalProps = { | ||
@@ -816,2 +857,5 @@ container: HTMLElement; | ||
/** | ||
* @category Reactive State Utility | ||
*/ | ||
export declare type PositionObject = { | ||
@@ -897,3 +941,3 @@ top: number; | ||
}>; | ||
oneOfType: <T_1>(...argv: any[]) => TypeChecker<T_1, { | ||
oneOfType: <T>(...argv: any[]) => TypeChecker<T, { | ||
check(this: TypeChecker<any, any>, v: any): any; | ||
@@ -903,3 +947,3 @@ stringify(this: TypeChecker<any, any>, v: any): any; | ||
}>; | ||
arrayOf: <T_2>(...argv: any[]) => TypeChecker<T_2, { | ||
arrayOf: <T>(...argv: any[]) => TypeChecker<T, { | ||
check(this: TypeChecker<any, any>, v: any): boolean; | ||
@@ -910,3 +954,3 @@ stringify(v: any): void; | ||
}>; | ||
shapeOf: <T_3>(...argv: any[]) => TypeChecker<T_3, { | ||
shapeOf: <T>(...argv: any[]) => TypeChecker<T, { | ||
check(v: any): true; | ||
@@ -916,3 +960,3 @@ stringify(v: any): void; | ||
}>; | ||
map: <T_4>(...argv: any[]) => TypeChecker<T_4, { | ||
map: <T>(...argv: any[]) => TypeChecker<T, { | ||
check(this: TypeChecker<any, any>, v: any): boolean; | ||
@@ -987,2 +1031,5 @@ stringify(this: TypeChecker<any, any>, v: any): string; | ||
/** | ||
* @category Reactive State Utility | ||
*/ | ||
export declare function reactiveFocused(target: HTMLElement, value: Atom<boolean | null>): () => void; | ||
@@ -994,4 +1041,10 @@ | ||
/** | ||
* @category Reactive State Utility | ||
*/ | ||
export declare function reactiveScrollPosition(ref: HTMLElement, position: Atom<ScrollPosition | null>): () => void; | ||
/** | ||
* @category Reactive State Utility | ||
*/ | ||
export declare function reactiveSize(target: HTMLElement | Window, value: Atom<SizeObject | null>): () => void; | ||
@@ -1015,9 +1068,12 @@ | ||
/** | ||
* @category Basic | ||
*/ | ||
export declare type RenderContext = { | ||
createElement: (type: JSXElementType, rawProps: AttributesArg, ...children: any[]) => JSXElement; | ||
createSVGElement: (type: string, rawProps: AttributesArg, ...children: any[]) => JSXElement; | ||
createElement: CreateElementFn; | ||
createSVGElement: CreateSVGElementFn; | ||
Fragment: typeof Fragment; | ||
useLayoutEffect: (arg: EffectHandle) => void; | ||
useEffect: (arg: EffectHandle) => void; | ||
onCleanup: (arg: () => any) => void; | ||
useLayoutEffect: UseLayoutEffectFn; | ||
useEffect: UseEffectFn; | ||
onCleanup: OnCleanupFn; | ||
refs: { | ||
@@ -1027,8 +1083,8 @@ [k: string]: HTMLElement; | ||
context: DataContext; | ||
pathContext: PathContext; | ||
createPortal: (children: JSXElement | Function, container: HTMLElement) => JSXElement; | ||
createRef: () => RefObject; | ||
createRxRef: () => RefObject; | ||
createStateFromRef: <T>(transform: StateTransformer<T>, options?: any, externalTarget?: any) => StateFromRef<T>; | ||
expose: <T>(value: T, name?: string) => T; | ||
/* Excluded from this release type: pathContext */ | ||
createPortal: CreatePortalFn; | ||
createRef: CreateRefFn; | ||
createRxRef: CreateRxRefFn; | ||
createStateFromRef: CreateStateFromRefFn; | ||
expose: ExposeFn; | ||
}; | ||
@@ -1038,2 +1094,5 @@ | ||
/** | ||
* @category Basic | ||
*/ | ||
declare type Root = { | ||
@@ -1196,2 +1255,5 @@ element: HTMLElement; | ||
/** | ||
* @category Reactive State Utility | ||
*/ | ||
export declare type ScrollPosition = { | ||
@@ -1258,2 +1320,5 @@ scrollTop: number; | ||
/** | ||
* @category Reactive State Utility | ||
*/ | ||
export declare type SizeObject = { | ||
@@ -1288,2 +1353,5 @@ width: number; | ||
/** | ||
* @category Common Utility | ||
*/ | ||
export declare class StyleSize { | ||
@@ -1430,8 +1498,27 @@ value: number | string; | ||
/** | ||
* @category Basic | ||
*/ | ||
export declare type UseEffectFn = (arg: EffectHandle) => void; | ||
/** | ||
* @category Basic | ||
*/ | ||
export declare type UseLayoutEffectFn = (arg: EffectHandle) => void; | ||
declare type WeakCollections = WeakMap<any, any> | WeakSet<any>; | ||
/** | ||
* @category Event Utility | ||
*/ | ||
export declare function withCurrentRange<T extends Event>(handle: (e: T, range: Range | undefined) => any): (e: T) => void; | ||
/** | ||
* @category Event Utility | ||
*/ | ||
export declare function withPreventDefault<T extends Event>(handle: (e: T) => any): (e: T) => void; | ||
/** | ||
* @category Event Utility | ||
*/ | ||
export declare function withStopPropagation<T extends Event>(handle: (e: T) => any): (e: T) => void; | ||
@@ -1438,0 +1525,0 @@ |
603
dist/axii.js
@@ -1,8 +0,8 @@ | ||
import { isAtom as z, atom as U, RxList as j, RxSet as te, RxMap as re, arrayComputed as ne, TrackOpTypes as $, 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"; | ||
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"; | ||
export * from "data0"; | ||
function Re(t, e) { | ||
function He(t, e) { | ||
for (let r in t) | ||
e(t[r], r); | ||
} | ||
function me(t, e, r = !1) { | ||
function ge(t, e, r = !1) { | ||
if (t.parentElement !== e.parentElement) | ||
@@ -13,4 +13,3 @@ throw new Error("placeholder and element parentElement not same"); | ||
const s = n; | ||
if (n = s.nextSibling, !n) | ||
throw new Error("can not find nextSibling"); | ||
if (n = s.nextSibling, !n) throw new Error("can not find nextSibling"); | ||
s.remove(); | ||
@@ -20,3 +19,3 @@ } | ||
} | ||
const J = (t) => (t == null ? void 0 : t.constructor) === Object; | ||
const ee = (t) => (t == null ? void 0 : t.constructor) === Object; | ||
function A(t, e) { | ||
@@ -26,16 +25,12 @@ if (!t) | ||
} | ||
function _(t, e) { | ||
if (t === e) | ||
return !0; | ||
if (typeof t != "object" || typeof e != "object" || t === null || e === null) | ||
return !1; | ||
function z(t, e) { | ||
if (t === e) return !0; | ||
if (typeof t != "object" || typeof e != "object" || t === null || e === null) return !1; | ||
const r = Object.keys(t), n = Object.keys(e); | ||
if (r.length !== n.length) | ||
return !1; | ||
if (r.length !== n.length) return !1; | ||
for (let s of r) | ||
if (t[s] !== e[s]) | ||
return !1; | ||
if (t[s] !== e[s]) return !1; | ||
return !0; | ||
} | ||
function Oe(t) { | ||
function Re(t) { | ||
return t.length ? new Promise((e) => { | ||
@@ -49,15 +44,15 @@ let r = 0; | ||
} | ||
const ve = /^(width|height|top|left|right|bottom|margin|padding|border|fontSize|maxWidth|maxHeight|minHeight|minWidth|gap|flexBasis|columnGap|rowGap)/; | ||
let ye = "px"; | ||
function Mt(t) { | ||
ye = t; | ||
const Oe = /^(width|height|top|left|right|bottom|margin|padding|border|fontSize|maxWidth|maxHeight|minHeight|minWidth|gap|flexBasis|columnGap|rowGap)/; | ||
let Ee = "px"; | ||
function It(t) { | ||
Ee = t; | ||
} | ||
function $e(t) { | ||
return typeof t == "string" ? t : `${t}${ye}`; | ||
function ve(t) { | ||
return typeof t == "string" ? t : `${t}${Ee}`; | ||
} | ||
const Ne = /^(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(); | ||
const $e = /^(boxShadow|textShadow|transition|animation|backgroundImage)/; | ||
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(); | ||
} | ||
function Ie(t, e, r) { | ||
function Ne(t, e, r) { | ||
try { | ||
@@ -69,18 +64,18 @@ t[e] = r; | ||
} | ||
function ge(t) { | ||
function we(t) { | ||
const e = this._listeners[t.type]; | ||
return Array.isArray(e) ? e.forEach((r) => r == null ? void 0 : r(t, ...this.listenerBoundArgs || [])) : e == null ? void 0 : e(t, ...this.listenerBoundArgs || []); | ||
} | ||
function De(t) { | ||
function Ie(t) { | ||
const e = this._captureListeners[t.type]; | ||
return Array.isArray(e) ? e.forEach((r) => r == null ? void 0 : r(t, ...this.listenerBoundArgs || [])) : e == null ? void 0 : e(t, ...this.listenerBoundArgs || []); | ||
} | ||
const W = /* @__PURE__ */ new WeakMap(); | ||
function Me(t) { | ||
const X = /* @__PURE__ */ new WeakMap(); | ||
function De(t) { | ||
return t[0] === "o" && t[1] === "n"; | ||
} | ||
const ke = /^(strokeWidth|strokeLinecap|strokeLinejoin|strokeMiterlimit|strokeDashoffset|strokeDasharray|strokeOpacity|fillOpacity|stopOpacity)/; | ||
function B(t, e, r, n) { | ||
if (Array.isArray(r) && e !== "style" && e !== "className" && !Me(e)) | ||
return B(t, e, r.at(-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" && !De(e)) | ||
return q(t, e, r.at(-1), n); | ||
if (e === "uuid") { | ||
@@ -94,3 +89,3 @@ t.setAttribute("data-uuid", r); | ||
i === "change" && (i = "input"); | ||
const o = s ? De : ge; | ||
const o = s ? Ie : we; | ||
r ? t.addEventListener(i, o, s) : t.removeEventListener(i, o, s); | ||
@@ -103,4 +98,4 @@ const c = 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, c) => { | ||
t.style[c] = Z(c, o); | ||
typeof i == "string" ? t.style.cssText = i : typeof i == "object" ? He(i, (o, c) => { | ||
t.style[c] = te(c, o); | ||
}) : A(!1, "style can only be string or object."); | ||
@@ -120,32 +115,31 @@ }); | ||
} | ||
if (!(e === "key" || e === "ref")) | ||
if (e === "class" && !n) | ||
t.className = r || ""; | ||
else if (e === "value") | ||
t.value = r, t.tagName === "SELECT" ? W.set(t, r) : t.tagName === "OPTION" ? Ce(t) : t.tagName === "INPUT" && t.type === "checkbox" ? r ? t.setAttribute("checked", "true") : t.removeAttribute("checked") : t.tagName === "INPUT" && t.type === "text" && r === void 0 && (t.value = ""); | ||
else if (e === "checked" && t.tagName === "INPUT" && t.type === "checkbox") | ||
r ? t.setAttribute("checked", "true") : t.removeAttribute("checked"); | ||
else if (e === "disabled") | ||
r ? t.setAttribute("disabled", "true") : t.removeAttribute("disabled"); | ||
else if (e === "dangerouslySetInnerHTML") | ||
r && (t.innerHTML = r || ""); | ||
else if (e !== "list" && e !== "type" && !n && e in t) | ||
Ie(t, e, r === null ? "" : r), r == null && t.removeAttribute(e); | ||
if (!(e === "key" || e === "ref")) if (e === "class" && !n) | ||
t.className = r || ""; | ||
else if (e === "value") | ||
t.value = r, t.tagName === "SELECT" ? X.set(t, r) : t.tagName === "OPTION" ? Se(t) : t.tagName === "INPUT" && t.type === "checkbox" ? r ? t.setAttribute("checked", "true") : t.removeAttribute("checked") : t.tagName === "INPUT" && t.type === "text" && r === void 0 && (t.value = ""); | ||
else if (e === "checked" && t.tagName === "INPUT" && t.type === "checkbox") | ||
r ? t.setAttribute("checked", "true") : t.removeAttribute("checked"); | ||
else if (e === "disabled") | ||
r ? t.setAttribute("disabled", "true") : t.removeAttribute("disabled"); | ||
else if (e === "dangerouslySetInnerHTML") | ||
r && (t.innerHTML = r || ""); | ||
else if (e !== "list" && e !== "type" && !n && e in t) | ||
Ne(t, e, r === null ? "" : r), r == null && t.removeAttribute(e); | ||
else { | ||
const s = n && e !== (e = e.replace(/^xlink\:?/, "")); | ||
if (r == null || r === !1) | ||
s ? t.removeAttributeNS("http://www.w3.org/1999/xlink", e.toLowerCase()) : e.toLowerCase() === "contenteditable" && r === !1 ? t.setAttribute(e, "false") : t.removeAttribute(e); | ||
else if (typeof r != "function" && s) | ||
t.setAttributeNS("http://www.w3.org/1999/xlink", e.toLowerCase(), r); | ||
else { | ||
const s = n && e !== (e = e.replace(/^xlink\:?/, "")); | ||
if (r == null || r === !1) | ||
s ? t.removeAttributeNS("http://www.w3.org/1999/xlink", e.toLowerCase()) : e.toLowerCase() === "contenteditable" && r === !1 ? t.setAttribute(e, "false") : t.removeAttribute(e); | ||
else if (typeof r != "function" && s) | ||
t.setAttributeNS("http://www.w3.org/1999/xlink", e.toLowerCase(), r); | ||
else { | ||
const i = n && ke.test(e) ? e.replace(/([a-z])([A-Z])/g, "$1-$2").toLowerCase() : e; | ||
t.setAttribute(i, r); | ||
} | ||
const i = n && Me.test(e) ? e.replace(/([a-z])([A-Z])/g, "$1-$2").toLowerCase() : e; | ||
t.setAttribute(i, r); | ||
} | ||
} | ||
} | ||
function C(t, e, ...r) { | ||
function E(t, e, ...r) { | ||
const { _isSVG: n, ...s } = e || {}; | ||
let i; | ||
const o = r.length ? r : s.children || []; | ||
if (t === Ee) | ||
if (t === Ce) | ||
i = document.createDocumentFragment(); | ||
@@ -167,4 +161,4 @@ else if (typeof t == "string") | ||
c.push(...m.map((g) => ({ ...g, path: [h, ...g.path] }))); | ||
const E = u.refHandles || []; | ||
f.push(...E.map((g) => ({ ...g, path: [h, ...g.path] }))); | ||
const w = u.refHandles || []; | ||
f.push(...w.map((g) => ({ ...g, path: [h, ...g.path] }))); | ||
const x = u.detachStyledChildren || []; | ||
@@ -177,3 +171,3 @@ p.push(...x.map((g) => ({ ...g, path: [h, ...g.path] }))), delete u.unhandledChildren, delete u.unhandledAttr, delete u.refHandles, delete u.detachStyledChildren; | ||
}), 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]) => { | ||
C.isValidAttribute(l, h) ? B(i, l, h, n) : c.push({ el: i, key: l, value: h, path: [] }); | ||
E.isValidAttribute(l, h) ? q(i, l, h, n) : c.push({ el: i, key: l, value: h, path: [] }); | ||
})); | ||
@@ -183,16 +177,16 @@ const d = i; | ||
} | ||
function ie(t) { | ||
function ce(t) { | ||
return typeof t == "string" || typeof t == "number" || t instanceof M; | ||
} | ||
function Ve(t) { | ||
return J(t) && Object.entries(t).every( | ||
([e, r]) => /[a-zA-Z\-]+/.test(e) && ie(r) || Array.isArray(r) && r.every(ie) | ||
function ke(t) { | ||
return ee(t) && Object.entries(t).every( | ||
([e, r]) => /[a-zA-Z\-]+/.test(e) && ce(r) || Array.isArray(r) && r.every(ce) | ||
); | ||
} | ||
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"); | ||
E.isValidAttribute = function(t, e) { | ||
return Array.isArray(e) ? e.every((r) => E.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"); | ||
}; | ||
C.attachRef = function(t, e) { | ||
E.attachRef = function(t, e) { | ||
if (Array.isArray(e)) { | ||
e.forEach((r) => C.attachRef(t, r)); | ||
e.forEach((r) => E.attachRef(t, r)); | ||
return; | ||
@@ -202,5 +196,5 @@ } | ||
}; | ||
C.detachRef = function(t) { | ||
E.detachRef = function(t) { | ||
if (Array.isArray(t)) { | ||
t.forEach((e) => C.detachRef(e)); | ||
t.forEach((e) => E.detachRef(e)); | ||
return; | ||
@@ -210,20 +204,20 @@ } | ||
}; | ||
function Ee() { | ||
function Ce() { | ||
} | ||
function Ce(t) { | ||
function Se(t) { | ||
const e = t.parentElement; | ||
W.has(e) && (e.value = W.get(e)); | ||
X.has(e) && (e.value = X.get(e)); | ||
} | ||
function S(t, e) { | ||
const r = e.parentNode.insertBefore(t, e); | ||
return t.tagName === "OPTION" && Ce(t), r; | ||
return t.tagName === "OPTION" && Se(t), r; | ||
} | ||
function kt(t, e, ...r) { | ||
return C(t, { _isSVG: !0, ...e || {} }, r); | ||
function Dt(t, e, ...r) { | ||
return E(t, { _isSVG: !0, ...e || {} }, r); | ||
} | ||
function je(t, e, ...r) { | ||
return C(t, { _isSVG: !0, ...e || {} }, r); | ||
function Ve(t, e, ...r) { | ||
return E(t, { _isSVG: !0, ...e || {} }, r); | ||
} | ||
function Vt(t, e) { | ||
return ge.call(t, e); | ||
function Mt(t, e) { | ||
return we.call(t, e); | ||
} | ||
@@ -272,5 +266,11 @@ class M { | ||
} | ||
function Fe() { | ||
function kt(t, { children: e, ...r }) { | ||
return E(t, r, e); | ||
} | ||
function oe(t) { | ||
function Vt(t, { children: e, ...r }) { | ||
return E(t, r, [e]); | ||
} | ||
function je() { | ||
} | ||
function ae(t) { | ||
const e = typeof t; | ||
@@ -284,4 +284,3 @@ return e === "string" || e === "number"; | ||
var a; | ||
if (!((a = n.check) != null && a.call(n, c))) | ||
return new Error("type check failed"); | ||
if (!((a = n.check) != null && a.call(n, c))) return new Error("type check failed"); | ||
} | ||
@@ -352,8 +351,8 @@ return n.argv = r, n.stringify = (s = t.stringify) == null ? void 0 : s.bind(n), n.parse = (i = t.parse) == null ? void 0 : i.bind(n), n.check = (o = t.check) == null ? void 0 : o.bind(n), n.is = t.is || ((c) => c === e), n.zeroValue = t.zeroValue, n.required = t.required, n.createDefaultValue = t.createDefaultValue, n.coerce = t.coerce, n.required || Object.defineProperty(n, "isRequired", { | ||
} | ||
const _e = P({ | ||
const Fe = P({ | ||
stringify(t) { | ||
return t === null ? "" : oe(this.argv[0][0]) ? t.toString() : JSON.stringify(t); | ||
return t === null ? "" : ae(this.argv[0][0]) ? t.toString() : JSON.stringify(t); | ||
}, | ||
parse(t) { | ||
return oe(this.argv[0][0]) ? typeof this.argv[0][0] == "string" ? t : parseFloat(t) : JSON.parse(t); | ||
return ae(this.argv[0][0]) ? typeof this.argv[0][0] == "string" ? t : parseFloat(t) : JSON.parse(t); | ||
}, | ||
@@ -364,5 +363,5 @@ check(t) { | ||
zeroValue: [] | ||
}), ze = { | ||
}), _e = { | ||
zeroValue: "" | ||
}, Be = T("string", ze), Ge = { | ||
}, ze = T("string", _e), Be = { | ||
stringify(t) { | ||
@@ -372,8 +371,7 @@ return t.toString(); | ||
parse(t) { | ||
if (/-?\d+(\.\d+)?/.test(t)) | ||
return parseFloat(t); | ||
if (/-?\d+(\.\d+)?/.test(t)) return parseFloat(t); | ||
throw new Error(`${t} is not a number`); | ||
}, | ||
zeroValue: 0 | ||
}, 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 = { | ||
}, 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 = { | ||
stringify(t) { | ||
@@ -386,3 +384,3 @@ return t.toString(); | ||
} | ||
}, Ze = T("function", Je), Qe = T("symbol", {}), et = { | ||
}, Je = T("function", Ue), Ze = T("symbol", {}), Qe = { | ||
stringify() { | ||
@@ -397,3 +395,3 @@ throw new Error("type any can not stringify"); | ||
} | ||
}, G = T(() => !0, et), tt = P({ | ||
}, W = T(() => !0, Qe), et = P({ | ||
check(t) { | ||
@@ -415,7 +413,6 @@ return this.argv[0].some((e) => e.check(t)); | ||
return !1; | ||
})) | ||
throw new Error(`can not parse ${t}`); | ||
})) throw new Error(`can not parse ${t}`); | ||
return e; | ||
} | ||
}), rt = P({ | ||
}), tt = P({ | ||
check(t) { | ||
@@ -429,3 +426,3 @@ return Array.isArray(t) ? t.every((e) => this.argv[0].check(e)) : !1; | ||
zeroValue: [] | ||
}), nt = P({ | ||
}), rt = P({ | ||
check(t) { | ||
@@ -438,3 +435,3 @@ return !0; | ||
} | ||
}), st = P({ | ||
}), nt = P({ | ||
check(t) { | ||
@@ -452,6 +449,11 @@ return Object.entries(this.argv[0]).every(([e, r]) => r.check(t[e])); | ||
} | ||
}), it = G, ot = G, ct = G, at = Fe; | ||
}), st = W, it = W, ot = W, ct = je; | ||
function at() { | ||
return P({ | ||
coerce: (t) => G(t) ? t : Q(t) | ||
})(); | ||
} | ||
function lt() { | ||
return P({ | ||
coerce: (t) => z(t) ? t : U(t) | ||
coerce: (t) => t instanceof F ? t : new F(t) | ||
})(); | ||
@@ -461,3 +463,3 @@ } | ||
return P({ | ||
coerce: (t) => t instanceof j ? t : new j(t) | ||
coerce: (t) => t instanceof ne ? t : new ne(t) | ||
})(); | ||
@@ -467,50 +469,45 @@ } | ||
return P({ | ||
coerce: (t) => t instanceof te ? t : new te(t) | ||
coerce: (t) => t instanceof se ? t : new se(t) | ||
})(); | ||
} | ||
function ut() { | ||
return P({ | ||
coerce: (t) => t instanceof re ? t : new re(t) | ||
})(); | ||
} | ||
const O = { | ||
string: Be, | ||
number: qe, | ||
object: Ke, | ||
array: Xe, | ||
bool: Ue, | ||
function: Ze, | ||
symbol: Qe, | ||
node: it, | ||
element: ot, | ||
elementType: ct, | ||
const v = { | ||
string: ze, | ||
number: Ge, | ||
object: We, | ||
array: Ke, | ||
bool: Ye, | ||
function: Je, | ||
symbol: Ze, | ||
node: st, | ||
element: it, | ||
elementType: ot, | ||
// instanceOf | ||
// 枚举值 | ||
oneOf: _e, | ||
oneOf: Fe, | ||
// 枚举类型 | ||
oneOfType: tt, | ||
oneOfType: et, | ||
// 数组类型,里面的值应该只能跟类型 | ||
arrayOf: rt, | ||
arrayOf: tt, | ||
// objectOf, | ||
// 对象结构的嵌套类型。shape + arrayOf + oneOfType + any 可以描述任何 schema。 | ||
shapeOf: nt, | ||
shapeOf: rt, | ||
// map 类型,就是简单的 kv,应该是 shape 的子集。 | ||
map: st, | ||
map: nt, | ||
// exact, | ||
// customProps/customArrayProps | ||
any: G, | ||
checkPropTypes: at, | ||
any: W, | ||
checkPropTypes: ct, | ||
// reactive types | ||
atom: lt, | ||
rxList: ht, | ||
rxSet: ft, | ||
rxMap: ut | ||
atom: at, | ||
rxList: lt, | ||
rxSet: ht, | ||
rxMap: ft | ||
}; | ||
function dt(t, e) { | ||
function ut(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 pt { | ||
class dt { | ||
constructor(e, r, n) { | ||
this.source = e, this.placeholder = r, this.pathContext = n, this.createHost = ([s, i]) => L(s, i, { ...this.pathContext, hostPath: [...this.pathContext.hostPath, this] }); | ||
this.source = e, this.placeholder = r, this.pathContext = n, this.createHost = ([s, i]) => R(s, i, { ...this.pathContext, hostPath: [...this.pathContext.hostPath, this] }); | ||
} | ||
@@ -530,3 +527,3 @@ createPlaceholder(e) { | ||
const e = this; | ||
this.placeholderAndItemComputed = ne( | ||
this.placeholderAndItemComputed = ie( | ||
function() { | ||
@@ -568,9 +565,8 @@ if (this.manualTrack(e.source, $.METHOD, N.METHOD), this.manualTrack(e.source, $.EXPLICIT_KEY_CHANGE, N.EXPLICIT_KEY_CHANGE), e.hostsComputed) | ||
} | ||
), this.hostsComputed = ne( | ||
), this.hostsComputed = ie( | ||
function() { | ||
var i; | ||
if ((i = e.hostsComputed) != null && i.length) | ||
throw new Error("hostsComputed should not recompute"); | ||
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); | ||
const n = e.placeholderAndItemComputed.map(([o, c]) => L(o, c, { ...e.pathContext, hostPath: [...e.pathContext.hostPath, e] })), s = document.createDocumentFragment(); | ||
const n = e.placeholderAndItemComputed.map(([o, c]) => R(o, c, { ...e.pathContext, hostPath: [...e.pathContext.hostPath, e] })), s = document.createDocumentFragment(); | ||
return n.forEach((o) => { | ||
@@ -605,3 +601,3 @@ s.appendChild(o.placeholder), o.render(); | ||
} else { | ||
const u = dt(o, n.length); | ||
const u = ut(o, n.length); | ||
S(l, ((a = n[o[0] + u]) == null ? void 0 : a.element) || e.placeholder), n.splice(o[0], u, ...h).forEach((m) => m.destroy()); | ||
@@ -626,9 +622,9 @@ } | ||
destroy(e, r) { | ||
r || (F(this.hostsComputed), F(this.placeholderAndItemComputed)), this.hostsComputed.forEach((n) => n.destroy(e)), e || this.placeholder.remove(); | ||
r || (_(this.hostsComputed), _(this.placeholderAndItemComputed)), this.hostsComputed.forEach((n) => n.destroy(e)), e || this.placeholder.remove(); | ||
} | ||
} | ||
const ce = /* @__PURE__ */ new WeakSet(); | ||
function mt({ container: t, content: e, destroyOnUnmount: r }, { useEffect: n, pathContext: s }) { | ||
typeof e != "function" && (ce.has(e) && console.error("static portal content can only be rendered once. Use function content for content has reactive parts."), ce.add(e)); | ||
const i = Ot(t, s); | ||
const le = /* @__PURE__ */ new WeakSet(); | ||
function pt({ 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); | ||
return i.render(e), n(() => () => { | ||
@@ -638,3 +634,3 @@ i.destroy(); | ||
} | ||
function yt() { | ||
function mt() { | ||
return { | ||
@@ -644,4 +640,4 @@ current: null | ||
} | ||
function gt() { | ||
const t = U(null); | ||
function yt() { | ||
const t = Q(null); | ||
return new Proxy({}, { | ||
@@ -658,14 +654,14 @@ get: (e, r) => { | ||
} | ||
function Et(t, e) { | ||
function gt(t, e) { | ||
const r = { ...t }; | ||
return Object.entries(e).forEach(([n, s]) => { | ||
r[n] = K(n, t[n], s); | ||
r[n] = Y(n, t[n], s); | ||
}), r; | ||
} | ||
function K(t, e, r) { | ||
function Y(t, 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 v { | ||
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 = He({}), this.itemConfig = {}, this.frame = [], this.exposed = {}, this.createHTMLOrSVGElement = (o, c, a, ...f) => { | ||
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, c, a, ...f) => { | ||
var x, g, I, D; | ||
@@ -677,22 +673,22 @@ const p = typeof c == "function", d = a == null ? void 0 : a.as; | ||
const y = this.itemConfig[d]; | ||
d && y && (y.props && (p ? h = { ...a, ...y.props } : h = Et(a, y.props)), y.propMergeHandles && Object.entries(y.propMergeHandles).forEach(([b, R]) => { | ||
h[b] = R.reduce((Te, xe) => xe(Te, u), h[b]); | ||
}), y.propsMergeHandle && (h = y.propsMergeHandle.reduce((b, R) => R(b, u), h)), y.children && (l = y.children)); | ||
d && y && (y.props && (p ? h = { ...a, ...y.props } : h = gt(a, 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 = ((I = this.itemConfig[d]) == null ? void 0 : I.use) || c; | ||
typeof m == "function" && !p && (u[wt] = h, h = u), typeof m == "function" && ((D = y == null ? void 0 : y.configProps) != null && D.length) && Object.assign(h, { [q]: y.configProps }), d && (h.ref = H(h.ref).concat((b) => this.refs[d] = b)); | ||
const E = o ? je(m, h, ...l) : C(m, h, ...l); | ||
typeof m == "function" && !p && (u[wt] = h, h = u), 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 w = o ? Ve(m, h, ...l) : E(m, h, ...l); | ||
if (typeof m != "function") { | ||
const b = this.pathContext.hostPath.filter((R) => R instanceof v).map((R) => R.props).reverse(); | ||
E.listenerBoundArgs = [b, u]; | ||
const b = this.pathContext.hostPath.filter((O) => O instanceof L).map((O) => O.props).reverse(); | ||
w.listenerBoundArgs = [b, u]; | ||
} | ||
return E; | ||
}, this.createElement = this.createHTMLOrSVGElement.bind(this, !1), this.createSVGElement = this.createHTMLOrSVGElement.bind(this, !0), this.createPortal = (o, c) => C(mt, { container: c, content: o }), this.useLayoutEffect = (o) => { | ||
return w; | ||
}, this.createElement = this.createHTMLOrSVGElement.bind(this, !1), this.createSVGElement = this.createHTMLOrSVGElement.bind(this, !0), this.createPortal = (o, c) => E(pt, { container: c, content: o }), this.useLayoutEffect = (o) => { | ||
this.layoutEffects.add(o); | ||
}, this.useEffect = (o) => { | ||
this.effects.add(o); | ||
}, this.createRef = yt, this.createRxRef = gt, this.cleanupsOfExternalTarget = /* @__PURE__ */ new Set(), this.createStateFromRef = (o, c) => { | ||
}, this.createRef = mt, this.createRxRef = yt, this.cleanupsOfExternalTarget = /* @__PURE__ */ new Set(), this.createStateFromRef = (o, c) => { | ||
let a; | ||
const f = (d) => { | ||
c && a && this.cleanupsOfExternalTarget.delete(a), a == null || a(), d !== null ? (a = o(d, p), c && a && this.cleanupsOfExternalTarget.add(a)) : (a = void 0, p(null)); | ||
}, p = new Proxy(U(null), { | ||
}, p = new Proxy(Q(null), { | ||
get: (d, l) => l === "ref" ? f : d[l] | ||
@@ -708,3 +704,3 @@ }); | ||
}); | ||
}, v.typeIds.has(e) || v.typeIds.set(e, v.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; | ||
}, L.typeIds.has(e) || L.typeIds.set(e, L.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; | ||
} | ||
@@ -731,3 +727,3 @@ parseItemConfigFromProp(e, r, n) { | ||
} else | ||
e[s].props || (e[s].props = {}), e[s].props[i] = K(i, e[s].props[i], n); | ||
e[s].props || (e[s].props = {}), e[s].props[i] = Y(i, e[s].props[i], n); | ||
} | ||
@@ -737,3 +733,3 @@ return e; | ||
get typeId() { | ||
return v.typeIds.get(this.type); | ||
return L.typeIds.get(this.type); | ||
} | ||
@@ -786,3 +782,3 @@ get parentElement() { | ||
return Object.entries(r).forEach(([n, s]) => { | ||
n === q || (n[0] === "$" ? e.itemConfig = this.parseItemConfigFromProp(e.itemConfig, n, s) : e.props[n] = K(n, e.props[n], s)); | ||
n === K || (n[0] === "$" ? e.itemConfig = this.parseItemConfigFromProp(e.itemConfig, n, s) : e.props[n] = Y(n, e.props[n], s)); | ||
}), e; | ||
@@ -792,7 +788,7 @@ } | ||
const e = this.type.propTypes ? this.normalizePropsByPropTypes(this.type.propTypes, this.inputProps) : this.inputProps; | ||
return this.evaluateBoundProps(e, this.renderContext).concat(e, ...this.inputProps[q] || []).reduce((s, i) => this.parseAndMergeProps(s, i), { props: {}, itemConfig: {}, componentProp: {} }); | ||
return this.evaluateBoundProps(e, this.renderContext).concat(e, ...this.inputProps[K] || []).reduce((s, i) => this.parseAndMergeProps(s, i), { props: {}, itemConfig: {}, componentProp: {} }); | ||
} | ||
render() { | ||
this.element !== this.placeholder && A(!1, "should never rerender"), this.renderContext = { | ||
Fragment: Ee, | ||
Fragment: Ce, | ||
createElement: this.createElement, | ||
@@ -804,3 +800,3 @@ createSVGElement: this.createSVGElement, | ||
pathContext: this.pathContext, | ||
context: new Ct(this.pathContext.hostPath), | ||
context: new Et(this.pathContext.hostPath), | ||
createPortal: this.createPortal, | ||
@@ -818,3 +814,3 @@ createRef: this.createRef, | ||
const i = this.type(s, this.renderContext); | ||
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) => { | ||
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) => { | ||
const c = o(); | ||
@@ -831,5 +827,5 @@ typeof c == "function" && this.destroyCallback.add(c); | ||
}; | ||
we.typeIds = /* @__PURE__ */ new Map(); | ||
let Q = we; | ||
class Ct { | ||
L.typeIds = /* @__PURE__ */ new Map(); | ||
let k = L; | ||
class Et { | ||
constructor(e) { | ||
@@ -841,3 +837,3 @@ this.hostPath = e, this.valueByType = /* @__PURE__ */ new Map(); | ||
const n = this.hostPath[r]; | ||
if (n instanceof Q && n.renderContext.context.valueByType.has(e)) | ||
if (n instanceof k && n.renderContext.context.valueByType.has(e)) | ||
return n.renderContext.context.valueByType.get(e); | ||
@@ -855,6 +851,6 @@ } | ||
} | ||
function ae(t) { | ||
function he(t) { | ||
return t != null && t.toString ? t.toString() : t === void 0 ? "undefined" : JSON.stringify(t); | ||
} | ||
class St { | ||
class Ct { | ||
constructor(e, r, n) { | ||
@@ -869,9 +865,9 @@ this.source = e, this.placeholder = r, this.pathContext = n, this.stopAutoRun = () => { | ||
if (this.element === this.placeholder) { | ||
const r = document.createTextNode(ae(e)); | ||
const r = document.createTextNode(he(e)); | ||
this.parentElement.replaceChild(r, this.placeholder), this.element = r; | ||
} else | ||
this.element.nodeValue = ae(e); | ||
this.element.nodeValue = he(e); | ||
} | ||
render() { | ||
this.computed = ue( | ||
this.computed = pe( | ||
() => { | ||
@@ -888,6 +884,6 @@ this.replace(this.source()); | ||
destroy(e, r) { | ||
r || F(this.computed), e || (this.element.remove(), this.placeholder.remove()); | ||
r || _(this.computed), e || (this.element.remove(), this.placeholder.remove()); | ||
} | ||
} | ||
class bt { | ||
class St { | ||
constructor(e, r, n) { | ||
@@ -905,7 +901,7 @@ this.source = e, this.placeholder = r, this.pathContext = n, this.fragmentParent = document.createDocumentFragment(); | ||
let e = !1; | ||
this.stopAutoRender = de(({ onCleanup: r }) => { | ||
this.stopAutoRender = me(({ onCleanup: r }) => { | ||
const n = this.source(), s = document.createComment("computed node"); | ||
S(s, this.placeholder); | ||
const i = L(n, s, { ...this.pathContext, hostPath: [...this.pathContext.hostPath, this] }); | ||
se.instance.pauseTracking(), i.render(), se.instance.resetTracking(), r(() => { | ||
const i = R(n, s, { ...this.pathContext, hostPath: [...this.pathContext.hostPath, this] }); | ||
oe.instance.pauseTracking(), i.render(), oe.instance.resetTracking(), r(() => { | ||
i.destroy(!1, !1); | ||
@@ -923,29 +919,29 @@ }); | ||
} | ||
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); | ||
const bt = E.isValidAttribute; | ||
E.isValidAttribute = function(t, e) { | ||
return t.startsWith("on") ? !0 : Array.isArray(e) && e.some(fe) || fe(e) ? !1 : bt(t, e); | ||
}; | ||
function le(t) { | ||
return pe(t) || z(t) || typeof t == "function"; | ||
function fe(t) { | ||
return ye(t) || G(t) || typeof t == "function"; | ||
} | ||
function k(t) { | ||
return z(t) || typeof t == "function"; | ||
function V(t) { | ||
return G(t) || typeof t == "function"; | ||
} | ||
function Se(t) { | ||
return Array.isArray(t) ? t.some(Se) : Object.entries(t).some(([e, r]) => e.startsWith(":") || typeof r == "object" && r !== null); | ||
function be(t) { | ||
return Array.isArray(t) ? t.some(be) : Object.entries(t).some(([e, r]) => e.startsWith(":") || typeof r == "object" && r !== null); | ||
} | ||
function ee(t) { | ||
return Array.isArray(t) ? t.some(ee) : t.transition !== void 0 || t.transitionProperty !== null; | ||
function re(t) { | ||
return Array.isArray(t) ? t.some(re) : t.transition !== void 0 || t.transitionProperty !== null; | ||
} | ||
function X(t) { | ||
function U(t) { | ||
var e, r; | ||
return Array.isArray(t) ? t.flatMap(X) : ((e = t.transitionProperty) == null ? void 0 : e.split(",").map((n) => n.trim())) ?? ((r = t.transition) == null ? void 0 : r.split(",").map((n) => n.split(/\s+/)[0])) ?? []; | ||
return Array.isArray(t) ? t.flatMap(U) : ((e = t.transitionProperty) == null ? void 0 : e.split(",").map((n) => n.trim())) ?? ((r = t.transition) == null ? void 0 : r.split(",").map((n) => n.split(/\s+/)[0])) ?? []; | ||
} | ||
function be(t) { | ||
return Array.isArray(t) ? t.some(be) : t["@keyframes"] !== void 0; | ||
function Ae(t) { | ||
return Array.isArray(t) ? t.some(Ae) : t["@keyframes"] !== void 0; | ||
} | ||
function he(t) { | ||
function ue(t) { | ||
t.offsetHeight; | ||
} | ||
class Pt { | ||
class At { | ||
constructor() { | ||
@@ -964,7 +960,7 @@ this.styleScripts = /* @__PURE__ */ new Map(), this.elToStyleId = /* @__PURE__ */ new WeakMap(); | ||
} | ||
const s = e.findLastIndex((c) => c instanceof Q), i = s === -1 ? void 0 : e[s], o = s === -1 ? e : e.slice(s + 1); | ||
const s = e.findLastIndex((c) => c 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((c) => c.pathContext.elementPath.join("_")).join("-")}-${r.join("_")}`; | ||
} | ||
stringifyStyleObject(e) { | ||
return Object.entries(e).map(([r, n]) => `${r.replace(/([A-Z])/g, "-$1").toLowerCase()}:${Z(r, n)};`).join(` | ||
return Object.entries(e).map(([r, n]) => `${r.replace(/([A-Z])/g, "-$1").toLowerCase()}:${te(r, n)};`).join(` | ||
`); | ||
@@ -979,4 +975,4 @@ } | ||
`)); | ||
const f = X(a[0]); | ||
return f.length && he(s), Oe(a.slice(1).map((p) => () => { | ||
const f = U(a[0]); | ||
return f.length && ue(s), Re(a.slice(1).map((p) => () => { | ||
const [d, l, h] = this.separateStyleObject(p, f); | ||
@@ -986,3 +982,3 @@ if (l && this.generateStyleContent(`.${o}`, l).forEach((u) => { | ||
}), d) { | ||
const u = X(d); | ||
const u = U(d); | ||
f.push(...u), this.generateStyleContent(`.${o}`, d).forEach((y) => { | ||
@@ -992,7 +988,7 @@ c.insertRule(y, c.cssRules.length); | ||
} | ||
h && B(s, "style", h), ee(p) && he(s); | ||
h && q(s, "style", h), re(p) && ue(s); | ||
})); | ||
} | ||
isNestedStyleObject(e, r) { | ||
return e !== "@keyframes" && J(r); | ||
return e !== "@keyframes" && ee(r); | ||
} | ||
@@ -1047,3 +1043,3 @@ separateStyleObject(e, r) { | ||
} | ||
const Ae = class Pe { | ||
const B = class B { | ||
constructor(e, r, n) { | ||
@@ -1053,3 +1049,3 @@ this.source = e, this.placeholder = r, this.pathContext = n, this.forceHandleElement = !1, this.computed = void 0, this.element = this.placeholder, this.attachRefs = () => { | ||
(s = this.refHandles) == null || s.forEach(({ handle: i, el: o }) => { | ||
C.attachRef(o, i); | ||
E.attachRef(o, i); | ||
}); | ||
@@ -1067,7 +1063,6 @@ }; | ||
const e = this.source; | ||
if (!(e instanceof HTMLElement || e instanceof DocumentFragment || e instanceof SVGElement)) | ||
return; | ||
if (!(e instanceof HTMLElement || e instanceof DocumentFragment || e instanceof SVGElement)) return; | ||
const { unhandledChildren: r } = e; | ||
this.reactiveHosts = r ? r.map( | ||
({ placeholder: n, child: s, path: i }) => L(s, n, { | ||
({ placeholder: n, child: s, path: i }) => R(s, n, { | ||
...this.pathContext, | ||
@@ -1081,7 +1076,6 @@ hostPath: [...this.pathContext.hostPath, this], | ||
const e = this.source; | ||
if (!(e instanceof HTMLElement || e instanceof DocumentFragment || e instanceof SVGElement)) | ||
return; | ||
if (!(e instanceof HTMLElement || e instanceof DocumentFragment || e instanceof SVGElement)) return; | ||
const r = e instanceof SVGElement, { unhandledAttr: n } = e; | ||
this.attrAutoruns = [], n == null || n.forEach(({ el: s, key: i, value: o, path: c }) => { | ||
i.includes(":") || this.attrAutoruns.push(de(() => { | ||
i.includes(":") || this.attrAutoruns.push(me(() => { | ||
this.updateAttribute(s, i, o, c, r); | ||
@@ -1092,11 +1086,10 @@ }, !0)); | ||
updateAttribute(e, r, n, s, i) { | ||
const o = Array.isArray(n) ? n.map((c) => k(c) ? c() : c) : k(n) ? n() : n; | ||
if (r === "style" && (Se(o) || ee(o) || be(o))) | ||
return Pe.styleManager.update(this.pathContext.hostPath, s, o, e, !1); | ||
B(e, r, o, i); | ||
const o = Array.isArray(n) ? n.map((c) => V(c) ? c() : c) : V(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); | ||
} | ||
collectRefHandles() { | ||
const e = this.source; | ||
if (!(e instanceof HTMLElement || e instanceof DocumentFragment || e instanceof SVGElement)) | ||
return; | ||
if (!(e instanceof HTMLElement || e instanceof DocumentFragment || e instanceof SVGElement)) return; | ||
const { refHandles: r } = e; | ||
@@ -1107,4 +1100,3 @@ this.refHandles = r; | ||
const e = this.source; | ||
if (!(e instanceof HTMLElement || e instanceof DocumentFragment || e instanceof SVGElement)) | ||
return; | ||
if (!(e instanceof HTMLElement || e instanceof DocumentFragment || e instanceof SVGElement)) return; | ||
const { detachStyledChildren: r } = e; | ||
@@ -1116,3 +1108,3 @@ this.detachStyledChildren = r; | ||
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 }) => { | ||
C.detachRef(o); | ||
E.detachRef(o); | ||
}), this.removeElements(e); | ||
@@ -1126,3 +1118,3 @@ } | ||
(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) => k(y) ? y() : y)) : k(p) ? p() : p, h = Object.keys(l); | ||
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); | ||
@@ -1132,15 +1124,15 @@ }), 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))) || []); | ||
await Promise.all([ | ||
...c.map((f) => V(f, "transitionrun")), | ||
...c.map((f) => V(f, "transitionend")), | ||
...a.map((f) => V(f, "animationrun")), | ||
...a.map((f) => V(f, "animationend")) | ||
...c.map((f) => j(f, "transitionrun")), | ||
...c.map((f) => j(f, "transitionend")), | ||
...a.map((f) => j(f, "animationrun")), | ||
...a.map((f) => j(f, "animationend")) | ||
]); | ||
} | ||
me(this.element, this.placeholder, !0); | ||
ge(this.element, this.placeholder, !0); | ||
} | ||
} | ||
}; | ||
Ae.styleManager = new Pt(); | ||
let Tt = Ae; | ||
function V(t, e) { | ||
B.styleManager = new At(); | ||
let J = B; | ||
function j(t, e) { | ||
return new Promise((r) => { | ||
@@ -1150,3 +1142,3 @@ t.addEventListener(e, r, { once: !0 }); | ||
} | ||
class xt { | ||
class Pt { | ||
constructor(e, r, n) { | ||
@@ -1174,3 +1166,3 @@ this.source = e, this.placeholder = r, this.pathContext = n, this.computed = void 0, this.childHosts = []; | ||
e.appendChild(s); | ||
const i = L(r, s, { ...this.pathContext, hostPath: [...this.pathContext.hostPath, this] }); | ||
const i = R(r, s, { ...this.pathContext, hostPath: [...this.pathContext.hostPath, this] }); | ||
this.childHosts.push(i), n === 0 && (this.firstChild = i); | ||
@@ -1183,6 +1175,6 @@ } | ||
destroy(e, r) { | ||
e || (me(this.element, this.placeholder, !0), this.childHosts.forEach((n) => n.destroy(!0, r))); | ||
e || (ge(this.element, this.placeholder, !0), this.childHosts.forEach((n) => n.destroy(!0, r))); | ||
} | ||
} | ||
class Ht { | ||
class Tt { | ||
constructor(e, r, n) { | ||
@@ -1210,3 +1202,3 @@ this.source = e, this.placeholder = r, this.pathContext = n; | ||
const e = this; | ||
this.hosts = this.source.map((r) => L(r, document.createComment("rx list item"), { ...this.pathContext, hostPath: [...this.pathContext.hostPath, this] })), this.hostRenderComputed = ue( | ||
this.hosts = this.source.map((r) => R(r, document.createComment("rx list item"), { ...this.pathContext, hostPath: [...this.pathContext.hostPath, this] })), this.hostRenderComputed = pe( | ||
function() { | ||
@@ -1239,6 +1231,6 @@ 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; | ||
var n; | ||
r || ((n = this.hosts) == null || n.destroy(), F(this.hostRenderComputed)), this.hosts.forEach((s) => s.destroy(e)), e || this.placeholder.remove(); | ||
r || ((n = this.hosts) == null || n.destroy(), _(this.hostRenderComputed)), this.hosts.forEach((s) => s.destroy(e)), e || this.placeholder.remove(); | ||
} | ||
} | ||
class Lt { | ||
class xt { | ||
constructor(e, r) { | ||
@@ -1255,3 +1247,3 @@ this.pathContext = e, this.placeholder = r, this.element = document.createComment("empty"); | ||
} | ||
class Rt { | ||
class Lt { | ||
constructor(e, r, n) { | ||
@@ -1267,9 +1259,8 @@ this.source = e, this.placeholder = r, this.pathContext = n, this.element = this.placeholder; | ||
} | ||
function L(t, e, r) { | ||
if (!(e instanceof Comment)) | ||
throw new Error("incorrect placeholder type"); | ||
function R(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) : z(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, e) : typeof t == "string" || typeof t == "number" || typeof t == "boolean" ? n = new Rt(t, e, r) : A(!1, `unknown child type ${t}`), 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; | ||
} | ||
function Ot(t, e) { | ||
function Ht(t, e) { | ||
const r = /* @__PURE__ */ new Map(), n = e || { | ||
@@ -1285,3 +1276,3 @@ hostPath: [], | ||
const o = document.createComment("root"); | ||
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; | ||
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; | ||
}, | ||
@@ -1306,3 +1297,3 @@ destroy() { | ||
} | ||
function w(t) { | ||
function C(t) { | ||
return (e) => (r) => { | ||
@@ -1313,3 +1304,3 @@ if (t(r)) | ||
} | ||
const Ft = w((t) => t.key === "ArrowUp"), _t = w((t) => t.key === "ArrowDown"), zt = w((t) => t.key === "ArrowLeft"), Bt = 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); | ||
const Ft = C((t) => t.key === "ArrowUp"), _t = C((t) => t.key === "ArrowDown"), zt = C((t) => t.key === "ArrowLeft"), Bt = C((t) => t.key === "ArrowRight"), Gt = C((t) => t.key === "Enter"), qt = C((t) => t.key === "Tab"), Wt = C((t) => t.key === "Escape"), Kt = C((t) => t.key === "Backspace"), Xt = C((t) => t.key === "Space"), Yt = C((t) => t.button === 0), Ut = C((t) => t.button === 2), Jt = C((t) => t.button === 1), Zt = (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), Qt = C((t) => t.target === t.currentTarget); | ||
function er(t) { | ||
@@ -1358,3 +1349,3 @@ let e; | ||
} | ||
function vt(t) { | ||
function Rt(t) { | ||
const e = { | ||
@@ -1369,14 +1360,14 @@ name: t, | ||
} | ||
const $t = vt("Form"); | ||
function Nt({ name: t, children: e, onChange: r, onSubmit: n, onClear: s, onReset: i, values: o }, { | ||
const Ot = Rt("Form"); | ||
function vt({ name: t, children: e, onChange: r, onSubmit: n, onClear: s, onReset: i, values: o }, { | ||
createElement: c, | ||
context: a | ||
}) { | ||
const f = {}, p = (m, E, x) => { | ||
x ? (o.get(m) || o.set(m, new j([])), f[m] || (f[m] = []), o.get(m).push(E.value)(f[m]).push(E)) : (o.set(m, E.value), f[m] = E); | ||
}, d = (m, E, x) => { | ||
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) => { | ||
if (x) { | ||
const g = o.get(m), I = g.findIndex((b) => b === E.value); | ||
const g = o.get(m), I = g.findIndex((b) => b === w.value); | ||
I() > -1 && g.splice(I(), 1); | ||
const D = f[m].findIndex((b) => b === E); | ||
const D = f[m].findIndex((b) => b === w); | ||
D > -1 && f[m].splice(D, 1); | ||
@@ -1389,7 +1380,7 @@ } else | ||
Object.values(f).forEach((m) => { | ||
Array.isArray(m) ? m.forEach((E) => E.reset()) : m.reset(); | ||
Array.isArray(m) ? m.forEach((w) => w.reset()) : m.reset(); | ||
}), i == null || i(); | ||
}, u = () => { | ||
Object.values(f).forEach((m) => { | ||
Array.isArray(m) ? m.forEach((E) => E.clear()) : m.clear(); | ||
Array.isArray(m) ? m.forEach((w) => w.clear()) : m.clear(); | ||
}), s == null || s(); | ||
@@ -1399,12 +1390,12 @@ }, y = () => { | ||
}; | ||
return a.set($t, { name: t, register: p, unregister: d, onChange: y, submit: l, reset: h, clear: u }), e; | ||
return a.set(Ot, { name: t, register: p, unregister: d, onChange: y, submit: l, reset: h, clear: u }), e; | ||
} | ||
Nt.propTypes = { | ||
name: O.string.isRequired, | ||
values: O.rxMap(), | ||
children: O.any.isRequired, | ||
onChange: O.function, | ||
onSubmit: O.function, | ||
onClear: O.function, | ||
onReset: O.function | ||
vt.propTypes = { | ||
name: v.string.isRequired, | ||
values: v.rxMap(), | ||
children: v.any.isRequired, | ||
onChange: v.function, | ||
onSubmit: v.function, | ||
onClear: v.function, | ||
onReset: v.function | ||
}; | ||
@@ -1422,3 +1413,3 @@ const ir = Symbol("ModalContext"); | ||
}; | ||
return _(o, r()) || r(o), o; | ||
return z(o, r()) || r(o), o; | ||
})(); | ||
@@ -1434,3 +1425,3 @@ return; | ||
}; | ||
return _(o, r()) || r(o), o; | ||
return z(o, r()) || r(o), o; | ||
}; | ||
@@ -1464,5 +1455,5 @@ if (Array.isArray(t)) { | ||
} | ||
const Y = /* @__PURE__ */ new WeakMap(), fe = new ResizeObserver((t) => { | ||
const Z = /* @__PURE__ */ new WeakMap(), de = new ResizeObserver((t) => { | ||
t.forEach((e) => { | ||
const r = e.target, n = Y.get(r); | ||
const r = e.target, n = Z.get(r); | ||
if (n) { | ||
@@ -1477,3 +1468,3 @@ const s = { | ||
}; | ||
_(s, n()) || n(s); | ||
z(s, n()) || n(s); | ||
} | ||
@@ -1489,3 +1480,3 @@ }); | ||
}; | ||
return _(n, e()) || e(n), n; | ||
return z(n, e()) || e(n), n; | ||
}; | ||
@@ -1496,3 +1487,3 @@ return window.addEventListener("resize", r), r(), () => { | ||
} else { | ||
fe.observe(t), Y.set(t, e); | ||
de.observe(t), Z.set(t, e); | ||
const r = t.getBoundingClientRect(); | ||
@@ -1503,3 +1494,3 @@ return e({ | ||
}), () => { | ||
fe.unobserve(t), Y.delete(t), e(null); | ||
de.unobserve(t), Z.delete(t), e(null); | ||
}; | ||
@@ -1518,5 +1509,5 @@ } | ||
} | ||
const It = "dragmove"; | ||
const $t = "dragmove"; | ||
function lr(t) { | ||
const e = (t == null ? void 0 : t.container) || document.body, r = (t == null ? void 0 : t.customEventName) || It; | ||
const e = (t == null ? void 0 : t.container) || document.body, r = (t == null ? void 0 : t.customEventName) || $t; | ||
return function(s) { | ||
@@ -1594,21 +1585,21 @@ const i = (o) => { | ||
export { | ||
Q as ComponentHost, | ||
k as ComponentHost, | ||
sr as ContextProvider, | ||
It as DEFAULT_DRAG_MOVE_EVENT, | ||
Ct as DataContext, | ||
Nt as Form, | ||
$t as FormContext, | ||
Ee as Fragment, | ||
$t as DEFAULT_DRAG_MOVE_EVENT, | ||
Et as DataContext, | ||
vt as Form, | ||
Ot as FormContext, | ||
Ce as Fragment, | ||
ir as ModalContext, | ||
wt as N_ATTR, | ||
mt as Portal, | ||
O as PropTypes, | ||
pt as Portal, | ||
v as PropTypes, | ||
M as StyleSize, | ||
$e as autoUnit, | ||
ve as autoUnit, | ||
jt as bindProps, | ||
vt as createContext, | ||
C as createElement, | ||
kt as createElementNS, | ||
Rt as createContext, | ||
E as createElement, | ||
Dt as createElementNS, | ||
er as createEventTransfer, | ||
L as createHost, | ||
R as createHost, | ||
lr as createOnDragMove, | ||
@@ -1618,9 +1609,11 @@ hr as createReactiveDragPosition, | ||
or as createReactivePosition, | ||
yt as createRef, | ||
Ot as createRoot, | ||
gt as createRxRef, | ||
Vt as dispatchEvent, | ||
w as eventAlias, | ||
K as mergeProp, | ||
Et as mergeProps, | ||
mt as createRef, | ||
Ht as createRoot, | ||
yt as createRxRef, | ||
Mt as dispatchEvent, | ||
C as eventAlias, | ||
Vt as jsx, | ||
kt as jsxs, | ||
Y as mergeProp, | ||
gt as mergeProps, | ||
Kt as onBackspaceKey, | ||
@@ -1643,3 +1636,3 @@ _t as onDownKey, | ||
cr as reactiveSize, | ||
Mt as setAutoUnitType, | ||
It as setAutoUnitType, | ||
tr as withCurrentRange, | ||
@@ -1646,0 +1639,0 @@ rr as withPreventDefault, |
{ | ||
"name": "axii", | ||
"version": "2.6.49", | ||
"version": "2.6.50", | ||
"description": "", | ||
@@ -24,2 +24,7 @@ "main": "index.js", | ||
"types": "./dist/axii.d.ts" | ||
}, | ||
"./jsx-dev-runtime": { | ||
"import": "./dist/axii.js", | ||
"require": "./dist/axii.umd.cjs", | ||
"types": "./dist/axii.d.ts" | ||
} | ||
@@ -30,7 +35,8 @@ }, | ||
"@testing-library/user-event": "^14.5.2", | ||
"typescript": "^5.3.3", | ||
"vite": "^4.5.2", | ||
"@types/node": "^22.9.3", | ||
"typescript": "5.6", | ||
"vite": "^5.4.11", | ||
"vite-plugin-dts": "^4.0.3", | ||
"vite-tsconfig-paths": "^4.3.1", | ||
"vitest": "^1.3.0" | ||
"vitest": "^2.1.5" | ||
}, | ||
@@ -37,0 +43,0 @@ "peerDependencies": { |
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
No README
QualityPackage does not have a README. This may indicate a failed publish or a low quality package.
Found 1 instance in 1 package
543483
7
3008
1
1
7