@pyreon/core 0.11.5 → 0.11.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +2 -2
- package/lib/analysis/index.js.html +1 -1
- package/lib/index.js +33 -5
- package/lib/index.js.map +1 -1
- package/lib/jsx-dev-runtime.js.map +1 -1
- package/lib/jsx-runtime.js.map +1 -1
- package/lib/types/index.d.ts +145 -98
- package/lib/types/index.d.ts.map +1 -1
- package/lib/types/jsx-dev-runtime.d.ts +94 -94
- package/lib/types/jsx-runtime.d.ts +94 -94
- package/package.json +11 -11
- package/src/component.ts +2 -2
- package/src/context.ts +75 -4
- package/src/dynamic.ts +4 -4
- package/src/error-boundary.ts +10 -10
- package/src/for.ts +8 -2
- package/src/h.ts +4 -4
- package/src/index.ts +30 -27
- package/src/jsx-dev-runtime.ts +1 -1
- package/src/jsx-runtime.ts +108 -108
- package/src/lazy.ts +4 -4
- package/src/lifecycle.ts +6 -6
- package/src/portal.ts +2 -2
- package/src/show.ts +4 -4
- package/src/style.ts +51 -51
- package/src/suspense.ts +8 -8
- package/src/telemetry.ts +1 -1
- package/src/tests/component.test.ts +60 -60
- package/src/tests/context.test.ts +102 -102
- package/src/tests/core.test.ts +376 -376
- package/src/tests/cx.test.ts +34 -34
- package/src/tests/dynamic.test.ts +28 -28
- package/src/tests/error-boundary.test.ts +51 -51
- package/src/tests/for.test.ts +26 -26
- package/src/tests/h.test.ts +100 -100
- package/src/tests/jsx-compat.test.tsx +41 -41
- package/src/tests/lazy.test.ts +28 -28
- package/src/tests/lifecycle.test.ts +35 -35
- package/src/tests/map-array.test.ts +36 -36
- package/src/tests/portal.test.ts +21 -21
- package/src/tests/props-extended.test.ts +51 -51
- package/src/tests/props.test.ts +62 -62
- package/src/tests/ref.test.ts +20 -20
- package/src/tests/show.test.ts +94 -94
- package/src/tests/style.test.ts +101 -101
- package/src/tests/suspense.test.ts +44 -44
- package/src/tests/telemetry.test.ts +35 -35
package/lib/jsx-runtime.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"jsx-runtime.js","names":[],"sources":["../src/h.ts","../src/jsx-runtime.ts"],"sourcesContent":["import type { ComponentFn, Props, VNode, VNodeChild } from \"./types\"\n\n/** Marker for fragment nodes — renders children without a wrapper element */\nexport const Fragment: unique symbol = Symbol(\"Pyreon.Fragment\")\n\n/**\n * Hyperscript function — the compiled output of JSX.\n * `<div class=\"x\">hello</div>` → `h(\"div\", { class: \"x\" }, \"hello\")`\n *\n * Generic on P so TypeScript validates props match the component's signature\n * at the call site, then stores the result in the loosely-typed VNode.\n */\n/** Shared empty props sentinel — identity-checked in mountElement to skip applyProps. */\nexport const EMPTY_PROPS: Props = {} as Props\n\n/** Makes `children` optional in P (if present) so it can be passed as rest args to h(). */\ntype PropsWithOptionalChildren<P extends Props> = Omit<P, \"children\"> &\n (\"children\" extends keyof P ? { children?: P[\"children\"] } : unknown)\n\n// Overload: component with typed props — children is optional in the props object\n// because it can be passed as rest args. Extra keys are allowed via `& Props`.\nexport function h<P extends Props>(\n type: ComponentFn<P>,\n props: (PropsWithOptionalChildren<P> & Props) | null,\n ...children: VNodeChild[]\n): VNode\n// Overload: intrinsic element, symbol, generic/dynamic component, or mixed union\nexport function h(\n type: string | ((p: any) => VNodeChild) | symbol,\n props: Props | null,\n ...children: VNodeChild[]\n): VNode\nexport function h<P extends Props>(\n type: string | ComponentFn<P> | symbol,\n props: P | null,\n ...children: VNodeChild[]\n): VNode {\n return {\n type: type as string | ComponentFn | symbol,\n props: (props ?? EMPTY_PROPS) as Props,\n children: normalizeChildren(children),\n key: (props?.key as string | number | null) ?? null,\n }\n}\n\nfunction normalizeChildren(children: VNodeChild[]): VNodeChild[] {\n // Fast path: no nested arrays — return as-is without allocating\n for (let i = 0; i < children.length; i++) {\n if (Array.isArray(children[i])) {\n return flattenChildren(children)\n }\n }\n return children\n}\n\nfunction flattenChildren(children: VNodeChild[]): VNodeChild[] {\n const result: VNodeChild[] = []\n for (const child of children) {\n if (Array.isArray(child)) {\n result.push(...flattenChildren(child as VNodeChild[]))\n } else {\n result.push(child)\n }\n }\n return result\n}\n","/**\n * JSX automatic runtime.\n *\n * When tsconfig has `\"jsxImportSource\": \"@pyreon/core\"`, the TS/bundler compiler\n * rewrites JSX to imports from this file automatically:\n * <div class=\"x\" /> → jsx(\"div\", { class: \"x\" })\n */\nimport { Fragment, h } from \"./h\"\nimport type { RefProp } from \"./ref\"\nimport type { ClassValue } from \"./style\"\nimport type { ComponentFn, Props, VNode, VNodeChild } from \"./types\"\n\nexport { Fragment }\n\nexport function jsx(\n type: string | ComponentFn | symbol,\n props: Props & { children?: VNodeChild | VNodeChild[] },\n key?: string | number | null,\n): VNode {\n const { children, ...rest } = props\n const propsWithKey = (key != null ? { ...rest, key } : rest) as Props\n\n if (typeof type === \"function\") {\n // Component: keep children in props.children so the component function can access them.\n // Children must NOT be spread as h() rest args because mountComponent only passes vnode.props.\n const componentProps = children !== undefined ? { ...propsWithKey, children } : propsWithKey\n return h(type, componentProps)\n }\n\n // DOM element or symbol (Fragment, ForSymbol): children go in vnode.children\n const childArray = children === undefined ? [] : Array.isArray(children) ? children : [children]\n return h(type, propsWithKey, ...(childArray as VNodeChild[]))\n}\n\n// jsxs is called when there are multiple static children — same signature\nexport const jsxs = jsx\n\n// ─── JSX types ────────────────────────────────────────────────────────────────\n\ntype Booleanish = boolean | \"true\" | \"false\"\nexport type CSSProperties = { [K in keyof CSSStyleDeclaration]?: string | number }\nexport type StyleValue = string | CSSProperties\n\n/** Event with typed currentTarget — used in element-specific event handlers. */\nexport type TargetedEvent<T extends Element, E extends Event = Event> = E & {\n readonly currentTarget: T\n}\n\n/** Common HTML attributes accepted by all Pyreon elements */\nexport interface PyreonHTMLAttributes<E extends Element = HTMLElement> {\n // Identity\n id?: string | (() => string) | undefined\n class?: ClassValue | (() => ClassValue) | undefined\n className?: ClassValue | (() => ClassValue) | undefined\n style?: StyleValue | (() => StyleValue) | undefined\n // Accessible\n role?: string | (() => string) | undefined\n tabIndex?: number | (() => number) | undefined\n title?: string | (() => string) | undefined\n lang?: string | undefined\n dir?: \"ltr\" | \"rtl\" | \"auto\" | undefined\n hidden?: boolean | (() => boolean) | undefined\n draggable?: Booleanish | undefined\n contentEditable?: Booleanish | \"inherit\" | \"plaintext-only\" | undefined\n spellCheck?: Booleanish | undefined\n autoCapitalize?: \"off\" | \"on\" | \"sentences\" | \"words\" | \"characters\" | undefined\n translate?: \"yes\" | \"no\" | undefined\n enterKeyHint?: \"enter\" | \"done\" | \"go\" | \"next\" | \"previous\" | \"search\" | \"send\" | undefined\n inputMode?:\n | \"none\"\n | \"text\"\n | \"decimal\"\n | \"numeric\"\n | \"tel\"\n | \"search\"\n | \"email\"\n | \"url\"\n | undefined\n is?: string | undefined\n slot?: string | undefined\n part?: string | undefined\n popover?: \"auto\" | \"manual\" | undefined\n popoverTarget?: string | undefined\n popoverTargetAction?: \"toggle\" | \"show\" | \"hide\" | undefined\n inert?: boolean | undefined\n // ARIA\n \"aria-label\"?: string | (() => string) | undefined\n \"aria-hidden\"?: Booleanish | (() => Booleanish) | undefined\n \"aria-disabled\"?: Booleanish | (() => Booleanish) | undefined\n \"aria-expanded\"?: Booleanish | (() => Booleanish) | undefined\n \"aria-selected\"?: Booleanish | (() => Booleanish) | undefined\n \"aria-checked\"?: Booleanish | \"mixed\" | (() => Booleanish | \"mixed\") | undefined\n \"aria-current\"?: Booleanish | \"page\" | \"step\" | \"location\" | \"date\" | \"time\" | undefined\n \"aria-live\"?: \"off\" | \"assertive\" | \"polite\" | undefined\n \"aria-atomic\"?: Booleanish | undefined\n \"aria-busy\"?: Booleanish | undefined\n \"aria-controls\"?: string | undefined\n \"aria-describedby\"?: string | undefined\n \"aria-labelledby\"?: string | undefined\n \"aria-placeholder\"?: string | undefined\n \"aria-required\"?: Booleanish | (() => Booleanish) | undefined\n \"aria-invalid\"?: Booleanish | \"grammar\" | \"spelling\" | undefined\n \"aria-valuemin\"?: number | undefined\n \"aria-valuemax\"?: number | undefined\n \"aria-valuenow\"?: number | undefined\n \"aria-valuetext\"?: string | undefined\n \"aria-haspopup\"?: Booleanish | \"menu\" | \"listbox\" | \"tree\" | \"grid\" | \"dialog\" | undefined\n \"aria-posinset\"?: number | undefined\n \"aria-setsize\"?: number | undefined\n \"aria-level\"?: number | undefined\n \"aria-multiline\"?: Booleanish | undefined\n \"aria-multiselectable\"?: Booleanish | undefined\n \"aria-orientation\"?: \"horizontal\" | \"vertical\" | undefined\n \"aria-readonly\"?: Booleanish | (() => Booleanish) | undefined\n \"aria-sort\"?: \"none\" | \"ascending\" | \"descending\" | \"other\" | undefined\n \"aria-autocomplete\"?: \"none\" | \"inline\" | \"list\" | \"both\" | undefined\n \"aria-colcount\"?: number | undefined\n \"aria-colindex\"?: number | undefined\n \"aria-colspan\"?: number | undefined\n \"aria-rowcount\"?: number | undefined\n \"aria-rowindex\"?: number | undefined\n \"aria-rowspan\"?: number | undefined\n // DOM lifecycle ref — object ref or callback ref\n ref?: RefProp<E> | undefined\n // Key for list reconciliation\n key?: string | number | undefined\n // Children — allows null, undefined, boolean in JSX children positions\n children?: VNodeChild | VNodeChild[]\n // innerHTML\n innerHTML?: string | undefined\n dangerouslySetInnerHTML?: { __html: string } | undefined\n // Events — typed currentTarget via generic E\n onClick?: ((e: TargetedEvent<E, MouseEvent>) => void) | undefined\n onDblClick?: ((e: TargetedEvent<E, MouseEvent>) => void) | undefined\n onMouseDown?: ((e: TargetedEvent<E, MouseEvent>) => void) | undefined\n onMouseUp?: ((e: TargetedEvent<E, MouseEvent>) => void) | undefined\n onMouseEnter?: ((e: TargetedEvent<E, MouseEvent>) => void) | undefined\n onMouseLeave?: ((e: TargetedEvent<E, MouseEvent>) => void) | undefined\n onMouseMove?: ((e: TargetedEvent<E, MouseEvent>) => void) | undefined\n onMouseOver?: ((e: TargetedEvent<E, MouseEvent>) => void) | undefined\n onMouseOut?: ((e: TargetedEvent<E, MouseEvent>) => void) | undefined\n onContextMenu?: ((e: TargetedEvent<E, MouseEvent>) => void) | undefined\n onKeyDown?: ((e: TargetedEvent<E, KeyboardEvent>) => void) | undefined\n onKeyUp?: ((e: TargetedEvent<E, KeyboardEvent>) => void) | undefined\n onKeyPress?: ((e: TargetedEvent<E, KeyboardEvent>) => void) | undefined\n onFocus?: ((e: TargetedEvent<E, FocusEvent>) => void) | undefined\n onBlur?: ((e: TargetedEvent<E, FocusEvent>) => void) | undefined\n onChange?: ((e: TargetedEvent<E>) => void) | undefined\n onInput?: ((e: TargetedEvent<E, InputEvent>) => void) | undefined\n onBeforeInput?: ((e: TargetedEvent<E, InputEvent>) => void) | undefined\n onSubmit?: ((e: TargetedEvent<E, SubmitEvent>) => void) | undefined\n onReset?: ((e: TargetedEvent<E>) => void) | undefined\n onInvalid?: ((e: TargetedEvent<E>) => void) | undefined\n onScroll?: ((e: TargetedEvent<E>) => void) | undefined\n onWheel?: ((e: TargetedEvent<E, WheelEvent>) => void) | undefined\n onResize?: ((e: TargetedEvent<E>) => void) | undefined\n onDragStart?: ((e: TargetedEvent<E, DragEvent>) => void) | undefined\n onDragEnd?: ((e: TargetedEvent<E, DragEvent>) => void) | undefined\n onDragOver?: ((e: TargetedEvent<E, DragEvent>) => void) | undefined\n onDragEnter?: ((e: TargetedEvent<E, DragEvent>) => void) | undefined\n onDragLeave?: ((e: TargetedEvent<E, DragEvent>) => void) | undefined\n onDrop?: ((e: TargetedEvent<E, DragEvent>) => void) | undefined\n onTouchStart?: ((e: TargetedEvent<E, TouchEvent>) => void) | undefined\n onTouchEnd?: ((e: TargetedEvent<E, TouchEvent>) => void) | undefined\n onTouchMove?: ((e: TargetedEvent<E, TouchEvent>) => void) | undefined\n onPointerDown?: ((e: TargetedEvent<E, PointerEvent>) => void) | undefined\n onPointerUp?: ((e: TargetedEvent<E, PointerEvent>) => void) | undefined\n onPointerMove?: ((e: TargetedEvent<E, PointerEvent>) => void) | undefined\n onPointerEnter?: ((e: TargetedEvent<E, PointerEvent>) => void) | undefined\n onPointerLeave?: ((e: TargetedEvent<E, PointerEvent>) => void) | undefined\n onPointerCancel?: ((e: TargetedEvent<E, PointerEvent>) => void) | undefined\n onPointerOver?: ((e: TargetedEvent<E, PointerEvent>) => void) | undefined\n onPointerOut?: ((e: TargetedEvent<E, PointerEvent>) => void) | undefined\n onTransitionEnd?: ((e: TargetedEvent<E, TransitionEvent>) => void) | undefined\n onAnimationStart?: ((e: TargetedEvent<E, AnimationEvent>) => void) | undefined\n onAnimationEnd?: ((e: TargetedEvent<E, AnimationEvent>) => void) | undefined\n onAnimationIteration?: ((e: TargetedEvent<E, AnimationEvent>) => void) | undefined\n onToggle?: ((e: TargetedEvent<E>) => void) | undefined\n onLoad?: ((e: TargetedEvent<E>) => void) | undefined\n onError?: ((e: TargetedEvent<E> | string) => void) | undefined\n onAbort?: ((e: TargetedEvent<E>) => void) | undefined\n onSelect?: ((e: TargetedEvent<E>) => void) | undefined\n onCopy?: ((e: TargetedEvent<E, ClipboardEvent>) => void) | undefined\n onCut?: ((e: TargetedEvent<E, ClipboardEvent>) => void) | undefined\n onPaste?: ((e: TargetedEvent<E, ClipboardEvent>) => void) | undefined\n // data-* and aria-* catch-all (typed attributes above catch typos)\n [key: `data-${string}`]: unknown\n [key: `aria-${string}`]: unknown\n}\n\n/** Attributes specific to form inputs */\nexport interface InputAttributes extends PyreonHTMLAttributes<HTMLInputElement> {\n type?: string | (() => string) | undefined\n value?: string | number | (() => string | number) | undefined\n defaultValue?: string | number | undefined\n checked?: boolean | (() => boolean) | undefined\n defaultChecked?: boolean | undefined\n placeholder?: string | (() => string) | undefined\n disabled?: boolean | (() => boolean) | undefined\n readOnly?: boolean | undefined\n required?: boolean | (() => boolean) | undefined\n min?: string | number | undefined\n max?: string | number | undefined\n step?: string | number | undefined\n minLength?: number | undefined\n maxLength?: number | undefined\n pattern?: string | undefined\n multiple?: boolean | undefined\n name?: string | undefined\n accept?: string | undefined\n autoComplete?: string | undefined\n autoFocus?: boolean | undefined\n capture?: \"user\" | \"environment\" | string | undefined\n form?: string | undefined\n formNoValidate?: boolean | undefined\n list?: string | undefined\n size?: number | undefined\n src?: string | (() => string) | undefined\n alt?: string | (() => string) | undefined\n width?: number | string | undefined\n height?: number | string | undefined\n}\n\nexport interface AnchorAttributes extends PyreonHTMLAttributes<HTMLAnchorElement> {\n href?: string | (() => string) | undefined\n hreflang?: string | undefined\n ping?: string | undefined\n referrerPolicy?: string | undefined\n target?: \"_blank\" | \"_self\" | \"_parent\" | \"_top\" | string | undefined\n rel?: string | undefined\n download?: string | boolean | undefined\n}\n\nexport interface ButtonAttributes extends PyreonHTMLAttributes<HTMLButtonElement> {\n type?: \"button\" | \"submit\" | \"reset\" | undefined\n disabled?: boolean | (() => boolean) | undefined\n name?: string | undefined\n value?: string | undefined\n form?: string | undefined\n formAction?: string | undefined\n formMethod?: string | undefined\n formEncType?: string | undefined\n formNoValidate?: boolean | undefined\n formTarget?: string | undefined\n}\n\nexport interface TextareaAttributes extends PyreonHTMLAttributes<HTMLTextAreaElement> {\n value?: string | (() => string) | undefined\n defaultValue?: string | undefined\n placeholder?: string | (() => string) | undefined\n disabled?: boolean | (() => boolean) | undefined\n readOnly?: boolean | undefined\n required?: boolean | (() => boolean) | undefined\n rows?: number | undefined\n cols?: number | undefined\n minLength?: number | undefined\n maxLength?: number | undefined\n name?: string | undefined\n autoFocus?: boolean | undefined\n form?: string | undefined\n wrap?: \"hard\" | \"soft\" | undefined\n}\n\nexport interface SelectAttributes extends PyreonHTMLAttributes<HTMLSelectElement> {\n value?: string | string[] | (() => string | string[]) | undefined\n defaultValue?: string | string[] | undefined\n disabled?: boolean | (() => boolean) | undefined\n required?: boolean | (() => boolean) | undefined\n multiple?: boolean | undefined\n name?: string | undefined\n size?: number | undefined\n form?: string | undefined\n autoFocus?: boolean | undefined\n}\n\ninterface OptionAttributes extends PyreonHTMLAttributes<HTMLOptionElement> {\n value?: string | number | (() => string | number) | undefined\n disabled?: boolean | (() => boolean) | undefined\n selected?: boolean | (() => boolean) | undefined\n label?: string | undefined\n}\n\nexport interface FormAttributes extends PyreonHTMLAttributes<HTMLFormElement> {\n action?: string | undefined\n method?: \"get\" | \"post\" | undefined\n encType?: string | undefined\n noValidate?: boolean | undefined\n target?: string | undefined\n name?: string | undefined\n autoComplete?: string | undefined\n acceptCharset?: string | undefined\n rel?: string | undefined\n}\n\nexport interface ImgAttributes extends PyreonHTMLAttributes<HTMLImageElement> {\n src?: string | (() => string) | undefined\n alt?: string | (() => string) | undefined\n width?: number | string | (() => number | string) | undefined\n height?: number | string | (() => number | string) | undefined\n loading?: \"lazy\" | \"eager\" | undefined\n decoding?: \"auto\" | \"async\" | \"sync\" | undefined\n crossOrigin?: \"anonymous\" | \"use-credentials\" | undefined\n referrerPolicy?: string | undefined\n srcSet?: string | (() => string) | undefined\n sizes?: string | (() => string) | undefined\n fetchPriority?: \"high\" | \"low\" | \"auto\" | undefined\n}\n\ninterface VideoAttributes extends PyreonHTMLAttributes<HTMLVideoElement> {\n src?: string | (() => string) | undefined\n width?: number | string | undefined\n height?: number | string | undefined\n controls?: boolean | undefined\n autoPlay?: boolean | undefined\n muted?: boolean | undefined\n loop?: boolean | undefined\n poster?: string | (() => string) | undefined\n preload?: \"none\" | \"metadata\" | \"auto\" | undefined\n playsInline?: boolean | undefined\n crossOrigin?: \"anonymous\" | \"use-credentials\" | undefined\n disablePictureInPicture?: boolean | undefined\n disableRemotePlayback?: boolean | undefined\n}\n\ninterface AudioAttributes extends PyreonHTMLAttributes<HTMLAudioElement> {\n src?: string | (() => string) | undefined\n controls?: boolean | undefined\n autoPlay?: boolean | undefined\n muted?: boolean | undefined\n loop?: boolean | undefined\n preload?: \"none\" | \"metadata\" | \"auto\" | undefined\n crossOrigin?: \"anonymous\" | \"use-credentials\" | undefined\n}\n\ninterface LabelAttributes extends PyreonHTMLAttributes<HTMLLabelElement> {\n htmlFor?: string | undefined\n for?: string | undefined\n form?: string | undefined\n}\n\ninterface ThAttributes extends PyreonHTMLAttributes<HTMLTableCellElement> {\n colSpan?: number | undefined\n rowSpan?: number | undefined\n scope?: \"col\" | \"row\" | \"colgroup\" | \"rowgroup\" | undefined\n abbr?: string | undefined\n headers?: string | undefined\n}\n\ninterface TdAttributes extends PyreonHTMLAttributes<HTMLTableCellElement> {\n colSpan?: number | undefined\n rowSpan?: number | undefined\n headers?: string | undefined\n}\n\ninterface ColAttributes extends PyreonHTMLAttributes<HTMLTableColElement> {\n span?: number | undefined\n}\n\ninterface IframeAttributes extends PyreonHTMLAttributes<HTMLIFrameElement> {\n src?: string | (() => string) | undefined\n width?: number | string | undefined\n height?: number | string | undefined\n allow?: string | undefined\n allowFullScreen?: boolean | undefined\n loading?: \"lazy\" | \"eager\" | undefined\n name?: string | undefined\n sandbox?: string | undefined\n referrerPolicy?: string | undefined\n title?: string | undefined\n}\n\ninterface LinkAttributes extends PyreonHTMLAttributes<HTMLLinkElement> {\n href?: string | (() => string) | undefined\n rel?: string | undefined\n type?: string | undefined\n as?: string | undefined\n media?: string | undefined\n crossOrigin?: \"anonymous\" | \"use-credentials\" | undefined\n integrity?: string | undefined\n referrerPolicy?: string | undefined\n}\n\ninterface MetaAttributes extends PyreonHTMLAttributes<HTMLMetaElement> {\n name?: string | undefined\n content?: string | (() => string) | undefined\n httpEquiv?: string | undefined\n charset?: string | undefined\n property?: string | undefined\n}\n\ninterface ScriptAttributes extends PyreonHTMLAttributes<HTMLScriptElement> {\n src?: string | (() => string) | undefined\n type?: string | undefined\n async?: boolean | undefined\n defer?: boolean | undefined\n crossOrigin?: \"anonymous\" | \"use-credentials\" | undefined\n integrity?: string | undefined\n noModule?: boolean | undefined\n referrerPolicy?: string | undefined\n}\n\ninterface SourceAttributes extends PyreonHTMLAttributes<HTMLSourceElement> {\n src?: string | (() => string) | undefined\n type?: string | undefined\n srcSet?: string | (() => string) | undefined\n sizes?: string | (() => string) | undefined\n media?: string | undefined\n}\n\ninterface ProgressAttributes extends PyreonHTMLAttributes<HTMLProgressElement> {\n value?: number | (() => number) | undefined\n max?: number | undefined\n}\n\ninterface MeterAttributes extends PyreonHTMLAttributes<HTMLMeterElement> {\n value?: number | (() => number) | undefined\n min?: number | undefined\n max?: number | undefined\n low?: number | undefined\n high?: number | undefined\n optimum?: number | undefined\n}\n\ninterface DetailsAttributes extends PyreonHTMLAttributes<HTMLDetailsElement> {\n open?: boolean | (() => boolean) | undefined\n}\n\ninterface DialogAttributes extends PyreonHTMLAttributes<HTMLDialogElement> {\n open?: boolean | (() => boolean) | undefined\n}\n\ninterface OlAttributes extends PyreonHTMLAttributes<HTMLOListElement> {\n start?: number | undefined\n reversed?: boolean | undefined\n type?: \"1\" | \"a\" | \"A\" | \"i\" | \"I\" | undefined\n}\n\ninterface CanvasAttributes extends PyreonHTMLAttributes<HTMLCanvasElement> {\n width?: number | string | undefined\n height?: number | string | undefined\n}\n\nexport interface SvgAttributes extends PyreonHTMLAttributes<SVGElement> {\n viewBox?: string | undefined\n xmlns?: string | undefined\n fill?: string | (() => string) | undefined\n stroke?: string | (() => string) | undefined\n \"stroke-width\"?: string | number | undefined\n \"stroke-linecap\"?: \"butt\" | \"round\" | \"square\" | undefined\n \"stroke-linejoin\"?: \"miter\" | \"round\" | \"bevel\" | undefined\n \"fill-rule\"?: \"nonzero\" | \"evenodd\" | undefined\n \"clip-rule\"?: \"nonzero\" | \"evenodd\" | undefined\n \"clip-path\"?: string | undefined\n d?: string | undefined\n cx?: string | number | undefined\n cy?: string | number | undefined\n r?: string | number | undefined\n rx?: string | number | undefined\n ry?: string | number | undefined\n x?: string | number | undefined\n y?: string | number | undefined\n x1?: string | number | undefined\n y1?: string | number | undefined\n x2?: string | number | undefined\n y2?: string | number | undefined\n width?: string | number | undefined\n height?: string | number | undefined\n transform?: string | (() => string) | undefined\n opacity?: string | number | (() => string | number) | undefined\n points?: string | undefined\n \"font-size\"?: string | number | undefined\n \"text-anchor\"?: \"start\" | \"middle\" | \"end\" | undefined\n \"dominant-baseline\"?: string | undefined\n // Gradient & pattern\n gradientUnits?: \"userSpaceOnUse\" | \"objectBoundingBox\" | undefined\n gradientTransform?: string | undefined\n patternUnits?: \"userSpaceOnUse\" | \"objectBoundingBox\" | undefined\n patternContentUnits?: \"userSpaceOnUse\" | \"objectBoundingBox\" | undefined\n patternTransform?: string | undefined\n spreadMethod?: \"pad\" | \"reflect\" | \"repeat\" | undefined\n // Marker\n markerWidth?: string | number | undefined\n markerHeight?: string | number | undefined\n markerUnits?: \"strokeWidth\" | \"userSpaceOnUse\" | undefined\n orient?: string | number | undefined\n refX?: string | number | undefined\n refY?: string | number | undefined\n // Clipping & masking\n maskUnits?: \"userSpaceOnUse\" | \"objectBoundingBox\" | undefined\n maskContentUnits?: \"userSpaceOnUse\" | \"objectBoundingBox\" | undefined\n clipPathUnits?: \"userSpaceOnUse\" | \"objectBoundingBox\" | undefined\n // Filter\n filterUnits?: \"userSpaceOnUse\" | \"objectBoundingBox\" | undefined\n primitiveUnits?: \"userSpaceOnUse\" | \"objectBoundingBox\" | undefined\n // Presentation\n preserveAspectRatio?: string | undefined\n \"color-interpolation\"?: string | undefined\n \"color-interpolation-filters\"?: string | undefined\n \"shape-rendering\"?: string | undefined\n \"image-rendering\"?: string | undefined\n \"text-rendering\"?: string | undefined\n \"pointer-events\"?: string | undefined\n visibility?: string | undefined\n display?: string | undefined\n overflow?: string | undefined\n cursor?: string | undefined\n // Text\n dx?: string | number | undefined\n dy?: string | number | undefined\n textLength?: string | number | undefined\n lengthAdjust?: \"spacing\" | \"spacingAndGlyphs\" | undefined\n \"writing-mode\"?: string | undefined\n \"letter-spacing\"?: string | number | undefined\n \"word-spacing\"?: string | number | undefined\n // Path\n pathLength?: number | undefined\n // Use/href\n href?: string | undefined\n}\n\ndeclare global {\n namespace JSX {\n /** The type that JSX expressions evaluate to */\n type Element = import(\"./types\").VNode\n\n /**\n * Valid JSX tag types — intrinsic strings + component functions.\n * Components may return VNode, null, strings, functions (reactive getters), etc.\n * (TS 5.1+ feature)\n */\n type ElementType = keyof IntrinsicElements | ((props: any) => import(\"./types\").VNodeChild)\n\n /** Props that can be passed to any JSX element (intrinsic or component) */\n interface IntrinsicAttributes {\n key?: string | number | undefined\n }\n\n /** Tells TS which prop name carries children in component calls */\n interface ElementChildrenAttribute {\n // biome-ignore lint/complexity/noBannedTypes: JSX spec requires {} for ElementChildrenAttribute\n children: {}\n }\n\n interface IntrinsicElements {\n // Document structure\n html: PyreonHTMLAttributes\n head: PyreonHTMLAttributes\n body: PyreonHTMLAttributes\n title: PyreonHTMLAttributes\n base: PyreonHTMLAttributes\n meta: MetaAttributes\n link: LinkAttributes\n script: ScriptAttributes\n style: PyreonHTMLAttributes\n noscript: PyreonHTMLAttributes\n // Sections\n main: PyreonHTMLAttributes\n header: PyreonHTMLAttributes\n footer: PyreonHTMLAttributes\n nav: PyreonHTMLAttributes\n aside: PyreonHTMLAttributes\n section: PyreonHTMLAttributes\n article: PyreonHTMLAttributes\n address: PyreonHTMLAttributes\n h1: PyreonHTMLAttributes\n h2: PyreonHTMLAttributes\n h3: PyreonHTMLAttributes\n h4: PyreonHTMLAttributes\n h5: PyreonHTMLAttributes\n h6: PyreonHTMLAttributes\n hgroup: PyreonHTMLAttributes\n // Block text\n p: PyreonHTMLAttributes\n pre: PyreonHTMLAttributes\n blockquote: PyreonHTMLAttributes\n figure: PyreonHTMLAttributes\n figcaption: PyreonHTMLAttributes\n div: PyreonHTMLAttributes\n hr: PyreonHTMLAttributes\n // Inline text\n span: PyreonHTMLAttributes\n a: AnchorAttributes\n em: PyreonHTMLAttributes\n strong: PyreonHTMLAttributes\n small: PyreonHTMLAttributes\n s: PyreonHTMLAttributes\n cite: PyreonHTMLAttributes\n q: PyreonHTMLAttributes\n abbr: PyreonHTMLAttributes\n time: PyreonHTMLAttributes\n code: PyreonHTMLAttributes\n var: PyreonHTMLAttributes\n samp: PyreonHTMLAttributes\n kbd: PyreonHTMLAttributes\n mark: PyreonHTMLAttributes\n sub: PyreonHTMLAttributes\n sup: PyreonHTMLAttributes\n i: PyreonHTMLAttributes\n b: PyreonHTMLAttributes\n u: PyreonHTMLAttributes\n bdi: PyreonHTMLAttributes\n bdo: PyreonHTMLAttributes\n br: PyreonHTMLAttributes\n wbr: PyreonHTMLAttributes\n ruby: PyreonHTMLAttributes\n rt: PyreonHTMLAttributes\n rp: PyreonHTMLAttributes\n // Lists\n ul: PyreonHTMLAttributes\n ol: OlAttributes\n li: PyreonHTMLAttributes\n dl: PyreonHTMLAttributes\n dt: PyreonHTMLAttributes\n dd: PyreonHTMLAttributes\n // Forms\n form: FormAttributes\n label: LabelAttributes\n input: InputAttributes\n button: ButtonAttributes\n select: SelectAttributes\n datalist: PyreonHTMLAttributes\n optgroup: PyreonHTMLAttributes\n option: OptionAttributes\n textarea: TextareaAttributes\n output: PyreonHTMLAttributes\n progress: ProgressAttributes\n meter: MeterAttributes\n fieldset: PyreonHTMLAttributes\n legend: PyreonHTMLAttributes\n // Tables\n table: PyreonHTMLAttributes\n caption: PyreonHTMLAttributes\n colgroup: PyreonHTMLAttributes\n col: ColAttributes\n thead: PyreonHTMLAttributes\n tbody: PyreonHTMLAttributes\n tfoot: PyreonHTMLAttributes\n tr: PyreonHTMLAttributes\n th: ThAttributes\n td: TdAttributes\n // Media\n img: ImgAttributes\n video: VideoAttributes\n audio: AudioAttributes\n source: SourceAttributes\n track: PyreonHTMLAttributes\n picture: PyreonHTMLAttributes\n canvas: CanvasAttributes\n svg: SvgAttributes\n path: SvgAttributes\n circle: SvgAttributes\n ellipse: SvgAttributes\n line: SvgAttributes\n polyline: SvgAttributes\n polygon: SvgAttributes\n rect: SvgAttributes\n text: SvgAttributes\n tspan: SvgAttributes\n g: SvgAttributes\n defs: SvgAttributes\n use: SvgAttributes & { href?: string }\n symbol: SvgAttributes\n clipPath: SvgAttributes\n mask: SvgAttributes\n marker: SvgAttributes\n pattern: SvgAttributes\n linearGradient: SvgAttributes\n radialGradient: SvgAttributes\n stop: SvgAttributes & {\n offset?: string | number\n \"stop-color\"?: string\n \"stop-opacity\"?: string | number\n }\n // Interactive / embedding\n details: DetailsAttributes\n summary: PyreonHTMLAttributes\n dialog: DialogAttributes\n iframe: IframeAttributes\n embed: PyreonHTMLAttributes\n object: PyreonHTMLAttributes\n param: PyreonHTMLAttributes\n // Semantic / misc\n menu: PyreonHTMLAttributes\n menuitem: PyreonHTMLAttributes\n template: PyreonHTMLAttributes\n slot: PyreonHTMLAttributes\n portal: PyreonHTMLAttributes\n // Catch-all for custom elements and data-* attrs\n [tagName: string]: PyreonHTMLAttributes<any>\n }\n }\n}\n"],"mappings":";;AAGA,MAAa,WAA0B,OAAO,kBAAkB;;;;;;;;;AAUhE,MAAa,cAAqB,EAAE;AAmBpC,SAAgB,EACd,MACA,OACA,GAAG,UACI;AACP,QAAO;EACC;EACN,OAAQ,SAAS;EACjB,UAAU,kBAAkB,SAAS;EACrC,KAAM,OAAO,OAAkC;EAChD;;AAGH,SAAS,kBAAkB,UAAsC;AAE/D,MAAK,IAAI,IAAI,GAAG,IAAI,SAAS,QAAQ,IACnC,KAAI,MAAM,QAAQ,SAAS,GAAG,CAC5B,QAAO,gBAAgB,SAAS;AAGpC,QAAO;;AAGT,SAAS,gBAAgB,UAAsC;CAC7D,MAAM,SAAuB,EAAE;AAC/B,MAAK,MAAM,SAAS,SAClB,KAAI,MAAM,QAAQ,MAAM,CACtB,QAAO,KAAK,GAAG,gBAAgB,MAAsB,CAAC;KAEtD,QAAO,KAAK,MAAM;AAGtB,QAAO;;;;;;;;;;;;AClDT,SAAgB,IACd,MACA,OACA,KACO;CACP,MAAM,EAAE,UAAU,GAAG,SAAS;CAC9B,MAAM,eAAgB,OAAO,OAAO;EAAE,GAAG;EAAM;EAAK,GAAG;AAEvD,KAAI,OAAO,SAAS,WAIlB,QAAO,EAAE,MADc,aAAa,SAAY;EAAE,GAAG;EAAc;EAAU,GAAG,aAClD;AAKhC,QAAO,EAAE,MAAM,cAAc,GADV,aAAa,SAAY,EAAE,GAAG,MAAM,QAAQ,SAAS,GAAG,WAAW,CAAC,SAAS,CACnC;;AAI/D,MAAa,OAAO"}
|
|
1
|
+
{"version":3,"file":"jsx-runtime.js","names":[],"sources":["../src/h.ts","../src/jsx-runtime.ts"],"sourcesContent":["import type { ComponentFn, Props, VNode, VNodeChild } from './types'\n\n/** Marker for fragment nodes — renders children without a wrapper element */\nexport const Fragment: unique symbol = Symbol('Pyreon.Fragment')\n\n/**\n * Hyperscript function — the compiled output of JSX.\n * `<div class=\"x\">hello</div>` → `h(\"div\", { class: \"x\" }, \"hello\")`\n *\n * Generic on P so TypeScript validates props match the component's signature\n * at the call site, then stores the result in the loosely-typed VNode.\n */\n/** Shared empty props sentinel — identity-checked in mountElement to skip applyProps. */\nexport const EMPTY_PROPS: Props = {} as Props\n\n/** Makes `children` optional in P (if present) so it can be passed as rest args to h(). */\ntype PropsWithOptionalChildren<P extends Props> = Omit<P, 'children'> &\n ('children' extends keyof P ? { children?: P['children'] } : unknown)\n\n// Overload: component with typed props — children is optional in the props object\n// because it can be passed as rest args. Extra keys are allowed via `& Props`.\nexport function h<P extends Props>(\n type: ComponentFn<P>,\n props: (PropsWithOptionalChildren<P> & Props) | null,\n ...children: VNodeChild[]\n): VNode\n// Overload: intrinsic element, symbol, generic/dynamic component, or mixed union\nexport function h(\n type: string | ((p: any) => VNodeChild) | symbol,\n props: Props | null,\n ...children: VNodeChild[]\n): VNode\nexport function h<P extends Props>(\n type: string | ComponentFn<P> | symbol,\n props: P | null,\n ...children: VNodeChild[]\n): VNode {\n return {\n type: type as string | ComponentFn | symbol,\n props: (props ?? EMPTY_PROPS) as Props,\n children: normalizeChildren(children),\n key: (props?.key as string | number | null) ?? null,\n }\n}\n\nfunction normalizeChildren(children: VNodeChild[]): VNodeChild[] {\n // Fast path: no nested arrays — return as-is without allocating\n for (let i = 0; i < children.length; i++) {\n if (Array.isArray(children[i])) {\n return flattenChildren(children)\n }\n }\n return children\n}\n\nfunction flattenChildren(children: VNodeChild[]): VNodeChild[] {\n const result: VNodeChild[] = []\n for (const child of children) {\n if (Array.isArray(child)) {\n result.push(...flattenChildren(child as VNodeChild[]))\n } else {\n result.push(child)\n }\n }\n return result\n}\n","/**\n * JSX automatic runtime.\n *\n * When tsconfig has `\"jsxImportSource\": \"@pyreon/core\"`, the TS/bundler compiler\n * rewrites JSX to imports from this file automatically:\n * <div class=\"x\" /> → jsx(\"div\", { class: \"x\" })\n */\nimport { Fragment, h } from './h'\nimport type { RefProp } from './ref'\nimport type { ClassValue } from './style'\nimport type { ComponentFn, Props, VNode, VNodeChild } from './types'\n\nexport { Fragment }\n\nexport function jsx(\n type: string | ComponentFn | symbol,\n props: Props & { children?: VNodeChild | VNodeChild[] },\n key?: string | number | null,\n): VNode {\n const { children, ...rest } = props\n const propsWithKey = (key != null ? { ...rest, key } : rest) as Props\n\n if (typeof type === 'function') {\n // Component: keep children in props.children so the component function can access them.\n // Children must NOT be spread as h() rest args because mountComponent only passes vnode.props.\n const componentProps = children !== undefined ? { ...propsWithKey, children } : propsWithKey\n return h(type, componentProps)\n }\n\n // DOM element or symbol (Fragment, ForSymbol): children go in vnode.children\n const childArray = children === undefined ? [] : Array.isArray(children) ? children : [children]\n return h(type, propsWithKey, ...(childArray as VNodeChild[]))\n}\n\n// jsxs is called when there are multiple static children — same signature\nexport const jsxs = jsx\n\n// ─── JSX types ────────────────────────────────────────────────────────────────\n\ntype Booleanish = boolean | 'true' | 'false'\nexport type CSSProperties = { [K in keyof CSSStyleDeclaration]?: string | number }\nexport type StyleValue = string | CSSProperties\n\n/** Event with typed currentTarget — used in element-specific event handlers. */\nexport type TargetedEvent<T extends Element, E extends Event = Event> = E & {\n readonly currentTarget: T\n}\n\n/** Common HTML attributes accepted by all Pyreon elements */\nexport interface PyreonHTMLAttributes<E extends Element = HTMLElement> {\n // Identity\n id?: string | (() => string) | undefined\n class?: ClassValue | (() => ClassValue) | undefined\n className?: ClassValue | (() => ClassValue) | undefined\n style?: StyleValue | (() => StyleValue) | undefined\n // Accessible\n role?: string | (() => string) | undefined\n tabIndex?: number | (() => number) | undefined\n title?: string | (() => string) | undefined\n lang?: string | undefined\n dir?: 'ltr' | 'rtl' | 'auto' | undefined\n hidden?: boolean | (() => boolean) | undefined\n draggable?: Booleanish | undefined\n contentEditable?: Booleanish | 'inherit' | 'plaintext-only' | undefined\n spellCheck?: Booleanish | undefined\n autoCapitalize?: 'off' | 'on' | 'sentences' | 'words' | 'characters' | undefined\n translate?: 'yes' | 'no' | undefined\n enterKeyHint?: 'enter' | 'done' | 'go' | 'next' | 'previous' | 'search' | 'send' | undefined\n inputMode?:\n | 'none'\n | 'text'\n | 'decimal'\n | 'numeric'\n | 'tel'\n | 'search'\n | 'email'\n | 'url'\n | undefined\n is?: string | undefined\n slot?: string | undefined\n part?: string | undefined\n popover?: 'auto' | 'manual' | undefined\n popoverTarget?: string | undefined\n popoverTargetAction?: 'toggle' | 'show' | 'hide' | undefined\n inert?: boolean | undefined\n // ARIA\n 'aria-label'?: string | (() => string) | undefined\n 'aria-hidden'?: Booleanish | (() => Booleanish) | undefined\n 'aria-disabled'?: Booleanish | (() => Booleanish) | undefined\n 'aria-expanded'?: Booleanish | (() => Booleanish) | undefined\n 'aria-selected'?: Booleanish | (() => Booleanish) | undefined\n 'aria-checked'?: Booleanish | 'mixed' | (() => Booleanish | 'mixed') | undefined\n 'aria-current'?: Booleanish | 'page' | 'step' | 'location' | 'date' | 'time' | undefined\n 'aria-live'?: 'off' | 'assertive' | 'polite' | undefined\n 'aria-atomic'?: Booleanish | undefined\n 'aria-busy'?: Booleanish | undefined\n 'aria-controls'?: string | undefined\n 'aria-describedby'?: string | undefined\n 'aria-labelledby'?: string | undefined\n 'aria-placeholder'?: string | undefined\n 'aria-required'?: Booleanish | (() => Booleanish) | undefined\n 'aria-invalid'?: Booleanish | 'grammar' | 'spelling' | undefined\n 'aria-valuemin'?: number | undefined\n 'aria-valuemax'?: number | undefined\n 'aria-valuenow'?: number | undefined\n 'aria-valuetext'?: string | undefined\n 'aria-haspopup'?: Booleanish | 'menu' | 'listbox' | 'tree' | 'grid' | 'dialog' | undefined\n 'aria-posinset'?: number | undefined\n 'aria-setsize'?: number | undefined\n 'aria-level'?: number | undefined\n 'aria-multiline'?: Booleanish | undefined\n 'aria-multiselectable'?: Booleanish | undefined\n 'aria-orientation'?: 'horizontal' | 'vertical' | undefined\n 'aria-readonly'?: Booleanish | (() => Booleanish) | undefined\n 'aria-sort'?: 'none' | 'ascending' | 'descending' | 'other' | undefined\n 'aria-autocomplete'?: 'none' | 'inline' | 'list' | 'both' | undefined\n 'aria-colcount'?: number | undefined\n 'aria-colindex'?: number | undefined\n 'aria-colspan'?: number | undefined\n 'aria-rowcount'?: number | undefined\n 'aria-rowindex'?: number | undefined\n 'aria-rowspan'?: number | undefined\n // DOM lifecycle ref — object ref or callback ref\n ref?: RefProp<E> | undefined\n // Key for list reconciliation\n key?: string | number | undefined\n // Children — allows null, undefined, boolean in JSX children positions\n children?: VNodeChild | VNodeChild[]\n // innerHTML\n innerHTML?: string | undefined\n dangerouslySetInnerHTML?: { __html: string } | undefined\n // Events — typed currentTarget via generic E\n onClick?: ((e: TargetedEvent<E, MouseEvent>) => void) | undefined\n onDblClick?: ((e: TargetedEvent<E, MouseEvent>) => void) | undefined\n onMouseDown?: ((e: TargetedEvent<E, MouseEvent>) => void) | undefined\n onMouseUp?: ((e: TargetedEvent<E, MouseEvent>) => void) | undefined\n onMouseEnter?: ((e: TargetedEvent<E, MouseEvent>) => void) | undefined\n onMouseLeave?: ((e: TargetedEvent<E, MouseEvent>) => void) | undefined\n onMouseMove?: ((e: TargetedEvent<E, MouseEvent>) => void) | undefined\n onMouseOver?: ((e: TargetedEvent<E, MouseEvent>) => void) | undefined\n onMouseOut?: ((e: TargetedEvent<E, MouseEvent>) => void) | undefined\n onContextMenu?: ((e: TargetedEvent<E, MouseEvent>) => void) | undefined\n onKeyDown?: ((e: TargetedEvent<E, KeyboardEvent>) => void) | undefined\n onKeyUp?: ((e: TargetedEvent<E, KeyboardEvent>) => void) | undefined\n onKeyPress?: ((e: TargetedEvent<E, KeyboardEvent>) => void) | undefined\n onFocus?: ((e: TargetedEvent<E, FocusEvent>) => void) | undefined\n onBlur?: ((e: TargetedEvent<E, FocusEvent>) => void) | undefined\n onChange?: ((e: TargetedEvent<E>) => void) | undefined\n onInput?: ((e: TargetedEvent<E, InputEvent>) => void) | undefined\n onBeforeInput?: ((e: TargetedEvent<E, InputEvent>) => void) | undefined\n onSubmit?: ((e: TargetedEvent<E, SubmitEvent>) => void) | undefined\n onReset?: ((e: TargetedEvent<E>) => void) | undefined\n onInvalid?: ((e: TargetedEvent<E>) => void) | undefined\n onScroll?: ((e: TargetedEvent<E>) => void) | undefined\n onWheel?: ((e: TargetedEvent<E, WheelEvent>) => void) | undefined\n onResize?: ((e: TargetedEvent<E>) => void) | undefined\n onDragStart?: ((e: TargetedEvent<E, DragEvent>) => void) | undefined\n onDragEnd?: ((e: TargetedEvent<E, DragEvent>) => void) | undefined\n onDragOver?: ((e: TargetedEvent<E, DragEvent>) => void) | undefined\n onDragEnter?: ((e: TargetedEvent<E, DragEvent>) => void) | undefined\n onDragLeave?: ((e: TargetedEvent<E, DragEvent>) => void) | undefined\n onDrop?: ((e: TargetedEvent<E, DragEvent>) => void) | undefined\n onTouchStart?: ((e: TargetedEvent<E, TouchEvent>) => void) | undefined\n onTouchEnd?: ((e: TargetedEvent<E, TouchEvent>) => void) | undefined\n onTouchMove?: ((e: TargetedEvent<E, TouchEvent>) => void) | undefined\n onPointerDown?: ((e: TargetedEvent<E, PointerEvent>) => void) | undefined\n onPointerUp?: ((e: TargetedEvent<E, PointerEvent>) => void) | undefined\n onPointerMove?: ((e: TargetedEvent<E, PointerEvent>) => void) | undefined\n onPointerEnter?: ((e: TargetedEvent<E, PointerEvent>) => void) | undefined\n onPointerLeave?: ((e: TargetedEvent<E, PointerEvent>) => void) | undefined\n onPointerCancel?: ((e: TargetedEvent<E, PointerEvent>) => void) | undefined\n onPointerOver?: ((e: TargetedEvent<E, PointerEvent>) => void) | undefined\n onPointerOut?: ((e: TargetedEvent<E, PointerEvent>) => void) | undefined\n onTransitionEnd?: ((e: TargetedEvent<E, TransitionEvent>) => void) | undefined\n onAnimationStart?: ((e: TargetedEvent<E, AnimationEvent>) => void) | undefined\n onAnimationEnd?: ((e: TargetedEvent<E, AnimationEvent>) => void) | undefined\n onAnimationIteration?: ((e: TargetedEvent<E, AnimationEvent>) => void) | undefined\n onToggle?: ((e: TargetedEvent<E>) => void) | undefined\n onLoad?: ((e: TargetedEvent<E>) => void) | undefined\n onError?: ((e: TargetedEvent<E> | string) => void) | undefined\n onAbort?: ((e: TargetedEvent<E>) => void) | undefined\n onSelect?: ((e: TargetedEvent<E>) => void) | undefined\n onCopy?: ((e: TargetedEvent<E, ClipboardEvent>) => void) | undefined\n onCut?: ((e: TargetedEvent<E, ClipboardEvent>) => void) | undefined\n onPaste?: ((e: TargetedEvent<E, ClipboardEvent>) => void) | undefined\n // data-* and aria-* catch-all (typed attributes above catch typos)\n [key: `data-${string}`]: unknown\n [key: `aria-${string}`]: unknown\n}\n\n/** Attributes specific to form inputs */\nexport interface InputAttributes extends PyreonHTMLAttributes<HTMLInputElement> {\n type?: string | (() => string) | undefined\n value?: string | number | (() => string | number) | undefined\n defaultValue?: string | number | undefined\n checked?: boolean | (() => boolean) | undefined\n defaultChecked?: boolean | undefined\n placeholder?: string | (() => string) | undefined\n disabled?: boolean | (() => boolean) | undefined\n readOnly?: boolean | undefined\n required?: boolean | (() => boolean) | undefined\n min?: string | number | undefined\n max?: string | number | undefined\n step?: string | number | undefined\n minLength?: number | undefined\n maxLength?: number | undefined\n pattern?: string | undefined\n multiple?: boolean | undefined\n name?: string | undefined\n accept?: string | undefined\n autoComplete?: string | undefined\n autoFocus?: boolean | undefined\n capture?: 'user' | 'environment' | string | undefined\n form?: string | undefined\n formNoValidate?: boolean | undefined\n list?: string | undefined\n size?: number | undefined\n src?: string | (() => string) | undefined\n alt?: string | (() => string) | undefined\n width?: number | string | undefined\n height?: number | string | undefined\n}\n\nexport interface AnchorAttributes extends PyreonHTMLAttributes<HTMLAnchorElement> {\n href?: string | (() => string) | undefined\n hreflang?: string | undefined\n ping?: string | undefined\n referrerPolicy?: string | undefined\n target?: '_blank' | '_self' | '_parent' | '_top' | string | undefined\n rel?: string | undefined\n download?: string | boolean | undefined\n}\n\nexport interface ButtonAttributes extends PyreonHTMLAttributes<HTMLButtonElement> {\n type?: 'button' | 'submit' | 'reset' | undefined\n disabled?: boolean | (() => boolean) | undefined\n name?: string | undefined\n value?: string | undefined\n form?: string | undefined\n formAction?: string | undefined\n formMethod?: string | undefined\n formEncType?: string | undefined\n formNoValidate?: boolean | undefined\n formTarget?: string | undefined\n}\n\nexport interface TextareaAttributes extends PyreonHTMLAttributes<HTMLTextAreaElement> {\n value?: string | (() => string) | undefined\n defaultValue?: string | undefined\n placeholder?: string | (() => string) | undefined\n disabled?: boolean | (() => boolean) | undefined\n readOnly?: boolean | undefined\n required?: boolean | (() => boolean) | undefined\n rows?: number | undefined\n cols?: number | undefined\n minLength?: number | undefined\n maxLength?: number | undefined\n name?: string | undefined\n autoFocus?: boolean | undefined\n form?: string | undefined\n wrap?: 'hard' | 'soft' | undefined\n}\n\nexport interface SelectAttributes extends PyreonHTMLAttributes<HTMLSelectElement> {\n value?: string | string[] | (() => string | string[]) | undefined\n defaultValue?: string | string[] | undefined\n disabled?: boolean | (() => boolean) | undefined\n required?: boolean | (() => boolean) | undefined\n multiple?: boolean | undefined\n name?: string | undefined\n size?: number | undefined\n form?: string | undefined\n autoFocus?: boolean | undefined\n}\n\ninterface OptionAttributes extends PyreonHTMLAttributes<HTMLOptionElement> {\n value?: string | number | (() => string | number) | undefined\n disabled?: boolean | (() => boolean) | undefined\n selected?: boolean | (() => boolean) | undefined\n label?: string | undefined\n}\n\nexport interface FormAttributes extends PyreonHTMLAttributes<HTMLFormElement> {\n action?: string | undefined\n method?: 'get' | 'post' | undefined\n encType?: string | undefined\n noValidate?: boolean | undefined\n target?: string | undefined\n name?: string | undefined\n autoComplete?: string | undefined\n acceptCharset?: string | undefined\n rel?: string | undefined\n}\n\nexport interface ImgAttributes extends PyreonHTMLAttributes<HTMLImageElement> {\n src?: string | (() => string) | undefined\n alt?: string | (() => string) | undefined\n width?: number | string | (() => number | string) | undefined\n height?: number | string | (() => number | string) | undefined\n loading?: 'lazy' | 'eager' | undefined\n decoding?: 'auto' | 'async' | 'sync' | undefined\n crossOrigin?: 'anonymous' | 'use-credentials' | undefined\n referrerPolicy?: string | undefined\n srcSet?: string | (() => string) | undefined\n sizes?: string | (() => string) | undefined\n fetchPriority?: 'high' | 'low' | 'auto' | undefined\n}\n\ninterface VideoAttributes extends PyreonHTMLAttributes<HTMLVideoElement> {\n src?: string | (() => string) | undefined\n width?: number | string | undefined\n height?: number | string | undefined\n controls?: boolean | undefined\n autoPlay?: boolean | undefined\n muted?: boolean | undefined\n loop?: boolean | undefined\n poster?: string | (() => string) | undefined\n preload?: 'none' | 'metadata' | 'auto' | undefined\n playsInline?: boolean | undefined\n crossOrigin?: 'anonymous' | 'use-credentials' | undefined\n disablePictureInPicture?: boolean | undefined\n disableRemotePlayback?: boolean | undefined\n}\n\ninterface AudioAttributes extends PyreonHTMLAttributes<HTMLAudioElement> {\n src?: string | (() => string) | undefined\n controls?: boolean | undefined\n autoPlay?: boolean | undefined\n muted?: boolean | undefined\n loop?: boolean | undefined\n preload?: 'none' | 'metadata' | 'auto' | undefined\n crossOrigin?: 'anonymous' | 'use-credentials' | undefined\n}\n\ninterface LabelAttributes extends PyreonHTMLAttributes<HTMLLabelElement> {\n htmlFor?: string | undefined\n for?: string | undefined\n form?: string | undefined\n}\n\ninterface ThAttributes extends PyreonHTMLAttributes<HTMLTableCellElement> {\n colSpan?: number | undefined\n rowSpan?: number | undefined\n scope?: 'col' | 'row' | 'colgroup' | 'rowgroup' | undefined\n abbr?: string | undefined\n headers?: string | undefined\n}\n\ninterface TdAttributes extends PyreonHTMLAttributes<HTMLTableCellElement> {\n colSpan?: number | undefined\n rowSpan?: number | undefined\n headers?: string | undefined\n}\n\ninterface ColAttributes extends PyreonHTMLAttributes<HTMLTableColElement> {\n span?: number | undefined\n}\n\ninterface IframeAttributes extends PyreonHTMLAttributes<HTMLIFrameElement> {\n src?: string | (() => string) | undefined\n width?: number | string | undefined\n height?: number | string | undefined\n allow?: string | undefined\n allowFullScreen?: boolean | undefined\n loading?: 'lazy' | 'eager' | undefined\n name?: string | undefined\n sandbox?: string | undefined\n referrerPolicy?: string | undefined\n title?: string | undefined\n}\n\ninterface LinkAttributes extends PyreonHTMLAttributes<HTMLLinkElement> {\n href?: string | (() => string) | undefined\n rel?: string | undefined\n type?: string | undefined\n as?: string | undefined\n media?: string | undefined\n crossOrigin?: 'anonymous' | 'use-credentials' | undefined\n integrity?: string | undefined\n referrerPolicy?: string | undefined\n}\n\ninterface MetaAttributes extends PyreonHTMLAttributes<HTMLMetaElement> {\n name?: string | undefined\n content?: string | (() => string) | undefined\n httpEquiv?: string | undefined\n charset?: string | undefined\n property?: string | undefined\n}\n\ninterface ScriptAttributes extends PyreonHTMLAttributes<HTMLScriptElement> {\n src?: string | (() => string) | undefined\n type?: string | undefined\n async?: boolean | undefined\n defer?: boolean | undefined\n crossOrigin?: 'anonymous' | 'use-credentials' | undefined\n integrity?: string | undefined\n noModule?: boolean | undefined\n referrerPolicy?: string | undefined\n}\n\ninterface SourceAttributes extends PyreonHTMLAttributes<HTMLSourceElement> {\n src?: string | (() => string) | undefined\n type?: string | undefined\n srcSet?: string | (() => string) | undefined\n sizes?: string | (() => string) | undefined\n media?: string | undefined\n}\n\ninterface ProgressAttributes extends PyreonHTMLAttributes<HTMLProgressElement> {\n value?: number | (() => number) | undefined\n max?: number | undefined\n}\n\ninterface MeterAttributes extends PyreonHTMLAttributes<HTMLMeterElement> {\n value?: number | (() => number) | undefined\n min?: number | undefined\n max?: number | undefined\n low?: number | undefined\n high?: number | undefined\n optimum?: number | undefined\n}\n\ninterface DetailsAttributes extends PyreonHTMLAttributes<HTMLDetailsElement> {\n open?: boolean | (() => boolean) | undefined\n}\n\ninterface DialogAttributes extends PyreonHTMLAttributes<HTMLDialogElement> {\n open?: boolean | (() => boolean) | undefined\n}\n\ninterface OlAttributes extends PyreonHTMLAttributes<HTMLOListElement> {\n start?: number | undefined\n reversed?: boolean | undefined\n type?: '1' | 'a' | 'A' | 'i' | 'I' | undefined\n}\n\ninterface CanvasAttributes extends PyreonHTMLAttributes<HTMLCanvasElement> {\n width?: number | string | undefined\n height?: number | string | undefined\n}\n\nexport interface SvgAttributes extends PyreonHTMLAttributes<SVGElement> {\n viewBox?: string | undefined\n xmlns?: string | undefined\n fill?: string | (() => string) | undefined\n stroke?: string | (() => string) | undefined\n 'stroke-width'?: string | number | undefined\n 'stroke-linecap'?: 'butt' | 'round' | 'square' | undefined\n 'stroke-linejoin'?: 'miter' | 'round' | 'bevel' | undefined\n 'fill-rule'?: 'nonzero' | 'evenodd' | undefined\n 'clip-rule'?: 'nonzero' | 'evenodd' | undefined\n 'clip-path'?: string | undefined\n d?: string | undefined\n cx?: string | number | undefined\n cy?: string | number | undefined\n r?: string | number | undefined\n rx?: string | number | undefined\n ry?: string | number | undefined\n x?: string | number | undefined\n y?: string | number | undefined\n x1?: string | number | undefined\n y1?: string | number | undefined\n x2?: string | number | undefined\n y2?: string | number | undefined\n width?: string | number | undefined\n height?: string | number | undefined\n transform?: string | (() => string) | undefined\n opacity?: string | number | (() => string | number) | undefined\n points?: string | undefined\n 'font-size'?: string | number | undefined\n 'text-anchor'?: 'start' | 'middle' | 'end' | undefined\n 'dominant-baseline'?: string | undefined\n // Gradient & pattern\n gradientUnits?: 'userSpaceOnUse' | 'objectBoundingBox' | undefined\n gradientTransform?: string | undefined\n patternUnits?: 'userSpaceOnUse' | 'objectBoundingBox' | undefined\n patternContentUnits?: 'userSpaceOnUse' | 'objectBoundingBox' | undefined\n patternTransform?: string | undefined\n spreadMethod?: 'pad' | 'reflect' | 'repeat' | undefined\n // Marker\n markerWidth?: string | number | undefined\n markerHeight?: string | number | undefined\n markerUnits?: 'strokeWidth' | 'userSpaceOnUse' | undefined\n orient?: string | number | undefined\n refX?: string | number | undefined\n refY?: string | number | undefined\n // Clipping & masking\n maskUnits?: 'userSpaceOnUse' | 'objectBoundingBox' | undefined\n maskContentUnits?: 'userSpaceOnUse' | 'objectBoundingBox' | undefined\n clipPathUnits?: 'userSpaceOnUse' | 'objectBoundingBox' | undefined\n // Filter\n filterUnits?: 'userSpaceOnUse' | 'objectBoundingBox' | undefined\n primitiveUnits?: 'userSpaceOnUse' | 'objectBoundingBox' | undefined\n // Presentation\n preserveAspectRatio?: string | undefined\n 'color-interpolation'?: string | undefined\n 'color-interpolation-filters'?: string | undefined\n 'shape-rendering'?: string | undefined\n 'image-rendering'?: string | undefined\n 'text-rendering'?: string | undefined\n 'pointer-events'?: string | undefined\n visibility?: string | undefined\n display?: string | undefined\n overflow?: string | undefined\n cursor?: string | undefined\n // Text\n dx?: string | number | undefined\n dy?: string | number | undefined\n textLength?: string | number | undefined\n lengthAdjust?: 'spacing' | 'spacingAndGlyphs' | undefined\n 'writing-mode'?: string | undefined\n 'letter-spacing'?: string | number | undefined\n 'word-spacing'?: string | number | undefined\n // Path\n pathLength?: number | undefined\n // Use/href\n href?: string | undefined\n}\n\ndeclare global {\n namespace JSX {\n /** The type that JSX expressions evaluate to */\n type Element = import('./types').VNode\n\n /**\n * Valid JSX tag types — intrinsic strings + component functions.\n * Components may return VNode, null, strings, functions (reactive getters), etc.\n * (TS 5.1+ feature)\n */\n type ElementType = keyof IntrinsicElements | ((props: any) => import('./types').VNodeChild)\n\n /** Props that can be passed to any JSX element (intrinsic or component) */\n interface IntrinsicAttributes {\n key?: string | number | undefined\n }\n\n /** Tells TS which prop name carries children in component calls */\n interface ElementChildrenAttribute {\n // biome-ignore lint/complexity/noBannedTypes: JSX spec requires {} for ElementChildrenAttribute\n children: {}\n }\n\n interface IntrinsicElements {\n // Document structure\n html: PyreonHTMLAttributes\n head: PyreonHTMLAttributes\n body: PyreonHTMLAttributes\n title: PyreonHTMLAttributes\n base: PyreonHTMLAttributes\n meta: MetaAttributes\n link: LinkAttributes\n script: ScriptAttributes\n style: PyreonHTMLAttributes\n noscript: PyreonHTMLAttributes\n // Sections\n main: PyreonHTMLAttributes\n header: PyreonHTMLAttributes\n footer: PyreonHTMLAttributes\n nav: PyreonHTMLAttributes\n aside: PyreonHTMLAttributes\n section: PyreonHTMLAttributes\n article: PyreonHTMLAttributes\n address: PyreonHTMLAttributes\n h1: PyreonHTMLAttributes\n h2: PyreonHTMLAttributes\n h3: PyreonHTMLAttributes\n h4: PyreonHTMLAttributes\n h5: PyreonHTMLAttributes\n h6: PyreonHTMLAttributes\n hgroup: PyreonHTMLAttributes\n // Block text\n p: PyreonHTMLAttributes\n pre: PyreonHTMLAttributes\n blockquote: PyreonHTMLAttributes\n figure: PyreonHTMLAttributes\n figcaption: PyreonHTMLAttributes\n div: PyreonHTMLAttributes\n hr: PyreonHTMLAttributes\n // Inline text\n span: PyreonHTMLAttributes\n a: AnchorAttributes\n em: PyreonHTMLAttributes\n strong: PyreonHTMLAttributes\n small: PyreonHTMLAttributes\n s: PyreonHTMLAttributes\n cite: PyreonHTMLAttributes\n q: PyreonHTMLAttributes\n abbr: PyreonHTMLAttributes\n time: PyreonHTMLAttributes\n code: PyreonHTMLAttributes\n var: PyreonHTMLAttributes\n samp: PyreonHTMLAttributes\n kbd: PyreonHTMLAttributes\n mark: PyreonHTMLAttributes\n sub: PyreonHTMLAttributes\n sup: PyreonHTMLAttributes\n i: PyreonHTMLAttributes\n b: PyreonHTMLAttributes\n u: PyreonHTMLAttributes\n bdi: PyreonHTMLAttributes\n bdo: PyreonHTMLAttributes\n br: PyreonHTMLAttributes\n wbr: PyreonHTMLAttributes\n ruby: PyreonHTMLAttributes\n rt: PyreonHTMLAttributes\n rp: PyreonHTMLAttributes\n // Lists\n ul: PyreonHTMLAttributes\n ol: OlAttributes\n li: PyreonHTMLAttributes\n dl: PyreonHTMLAttributes\n dt: PyreonHTMLAttributes\n dd: PyreonHTMLAttributes\n // Forms\n form: FormAttributes\n label: LabelAttributes\n input: InputAttributes\n button: ButtonAttributes\n select: SelectAttributes\n datalist: PyreonHTMLAttributes\n optgroup: PyreonHTMLAttributes\n option: OptionAttributes\n textarea: TextareaAttributes\n output: PyreonHTMLAttributes\n progress: ProgressAttributes\n meter: MeterAttributes\n fieldset: PyreonHTMLAttributes\n legend: PyreonHTMLAttributes\n // Tables\n table: PyreonHTMLAttributes\n caption: PyreonHTMLAttributes\n colgroup: PyreonHTMLAttributes\n col: ColAttributes\n thead: PyreonHTMLAttributes\n tbody: PyreonHTMLAttributes\n tfoot: PyreonHTMLAttributes\n tr: PyreonHTMLAttributes\n th: ThAttributes\n td: TdAttributes\n // Media\n img: ImgAttributes\n video: VideoAttributes\n audio: AudioAttributes\n source: SourceAttributes\n track: PyreonHTMLAttributes\n picture: PyreonHTMLAttributes\n canvas: CanvasAttributes\n svg: SvgAttributes\n path: SvgAttributes\n circle: SvgAttributes\n ellipse: SvgAttributes\n line: SvgAttributes\n polyline: SvgAttributes\n polygon: SvgAttributes\n rect: SvgAttributes\n text: SvgAttributes\n tspan: SvgAttributes\n g: SvgAttributes\n defs: SvgAttributes\n use: SvgAttributes & { href?: string }\n symbol: SvgAttributes\n clipPath: SvgAttributes\n mask: SvgAttributes\n marker: SvgAttributes\n pattern: SvgAttributes\n linearGradient: SvgAttributes\n radialGradient: SvgAttributes\n stop: SvgAttributes & {\n offset?: string | number\n 'stop-color'?: string\n 'stop-opacity'?: string | number\n }\n // Interactive / embedding\n details: DetailsAttributes\n summary: PyreonHTMLAttributes\n dialog: DialogAttributes\n iframe: IframeAttributes\n embed: PyreonHTMLAttributes\n object: PyreonHTMLAttributes\n param: PyreonHTMLAttributes\n // Semantic / misc\n menu: PyreonHTMLAttributes\n menuitem: PyreonHTMLAttributes\n template: PyreonHTMLAttributes\n slot: PyreonHTMLAttributes\n portal: PyreonHTMLAttributes\n // Catch-all for custom elements and data-* attrs\n [tagName: string]: PyreonHTMLAttributes<any>\n }\n }\n}\n"],"mappings":";;AAGA,MAAa,WAA0B,OAAO,kBAAkB;;;;;;;;;AAUhE,MAAa,cAAqB,EAAE;AAmBpC,SAAgB,EACd,MACA,OACA,GAAG,UACI;AACP,QAAO;EACC;EACN,OAAQ,SAAS;EACjB,UAAU,kBAAkB,SAAS;EACrC,KAAM,OAAO,OAAkC;EAChD;;AAGH,SAAS,kBAAkB,UAAsC;AAE/D,MAAK,IAAI,IAAI,GAAG,IAAI,SAAS,QAAQ,IACnC,KAAI,MAAM,QAAQ,SAAS,GAAG,CAC5B,QAAO,gBAAgB,SAAS;AAGpC,QAAO;;AAGT,SAAS,gBAAgB,UAAsC;CAC7D,MAAM,SAAuB,EAAE;AAC/B,MAAK,MAAM,SAAS,SAClB,KAAI,MAAM,QAAQ,MAAM,CACtB,QAAO,KAAK,GAAG,gBAAgB,MAAsB,CAAC;KAEtD,QAAO,KAAK,MAAM;AAGtB,QAAO;;;;;;;;;;;;AClDT,SAAgB,IACd,MACA,OACA,KACO;CACP,MAAM,EAAE,UAAU,GAAG,SAAS;CAC9B,MAAM,eAAgB,OAAO,OAAO;EAAE,GAAG;EAAM;EAAK,GAAG;AAEvD,KAAI,OAAO,SAAS,WAIlB,QAAO,EAAE,MADc,aAAa,SAAY;EAAE,GAAG;EAAc;EAAU,GAAG,aAClD;AAKhC,QAAO,EAAE,MAAM,cAAc,GADV,aAAa,SAAY,EAAE,GAAG,MAAM,QAAQ,SAAS,GAAG,WAAW,CAAC,SAAS,CACnC;;AAI/D,MAAa,OAAO"}
|
package/lib/types/index.d.ts
CHANGED
|
@@ -84,7 +84,29 @@ interface Context<T> {
|
|
|
84
84
|
readonly id: symbol;
|
|
85
85
|
readonly defaultValue: T;
|
|
86
86
|
}
|
|
87
|
+
/** Branded marker for reactive contexts — distinguishes from regular Context at type level. */
|
|
88
|
+
declare const REACTIVE_BRAND: unique symbol;
|
|
89
|
+
/**
|
|
90
|
+
* A context whose value is a reactive accessor `() => T`.
|
|
91
|
+
*
|
|
92
|
+
* When you `useContext(reactiveCtx)`, TypeScript returns `() => T` —
|
|
93
|
+
* you MUST call the accessor to read the value. This prevents the
|
|
94
|
+
* destructuring trap that breaks reactivity with getter-based objects.
|
|
95
|
+
*
|
|
96
|
+
* @example
|
|
97
|
+
* const ModeCtx = createReactiveContext<'light' | 'dark'>('light')
|
|
98
|
+
* // Provider: provide(ModeCtx, () => modeSignal())
|
|
99
|
+
* // Consumer: const getMode = useContext(ModeCtx); getMode() // 'light'
|
|
100
|
+
*/
|
|
101
|
+
interface ReactiveContext<T> extends Context<() => T> {
|
|
102
|
+
readonly [REACTIVE_BRAND]: T;
|
|
103
|
+
}
|
|
87
104
|
declare function createContext<T>(defaultValue: T): Context<T>;
|
|
105
|
+
/**
|
|
106
|
+
* Create a reactive context. Consumers get `() => T` and must call it.
|
|
107
|
+
* This is the safe pattern for values that change over time (mode, locale, etc.).
|
|
108
|
+
*/
|
|
109
|
+
declare function createReactiveContext<T>(defaultValue: T): ReactiveContext<T>;
|
|
88
110
|
/**
|
|
89
111
|
* Override the context stack provider. Called by @pyreon/runtime-server to
|
|
90
112
|
* inject an AsyncLocalStorage-backed stack that isolates concurrent SSR requests.
|
|
@@ -96,7 +118,11 @@ declare function popContext(): void;
|
|
|
96
118
|
/**
|
|
97
119
|
* Read the nearest provided value for a context.
|
|
98
120
|
* Falls back to `context.defaultValue` if none found.
|
|
121
|
+
*
|
|
122
|
+
* For ReactiveContext<T>, returns `() => T` — you MUST call the accessor.
|
|
123
|
+
* For regular Context<T>, returns `T` directly.
|
|
99
124
|
*/
|
|
125
|
+
declare function useContext<T>(context: ReactiveContext<T>): () => T;
|
|
100
126
|
declare function useContext<T>(context: Context<T>): T;
|
|
101
127
|
/**
|
|
102
128
|
* Provide a context value for the current component's subtree.
|
|
@@ -115,6 +141,21 @@ declare function provide<T>(context: Context<T>, value: T): void;
|
|
|
115
141
|
* Used by the renderer when it encounters a `<Provider>` component.
|
|
116
142
|
*/
|
|
117
143
|
declare function withContext<T>(context: Context<T>, value: T, fn: () => void): void;
|
|
144
|
+
type ContextSnapshot = Map<symbol, unknown>[];
|
|
145
|
+
/**
|
|
146
|
+
* Capture a snapshot of the current context stack.
|
|
147
|
+
*
|
|
148
|
+
* Used by `mountReactive` to preserve the context that was active when a
|
|
149
|
+
* reactive boundary (e.g. `<Show>`, `<For>`) was set up. When the boundary
|
|
150
|
+
* later mounts new children inside an effect, the snapshot is restored so
|
|
151
|
+
* those children can see ancestor providers via `useContext()`.
|
|
152
|
+
*/
|
|
153
|
+
declare function captureContextStack(): ContextSnapshot;
|
|
154
|
+
/**
|
|
155
|
+
* Execute `fn()` with a previously captured context stack active.
|
|
156
|
+
* Restores the original stack after `fn()` completes (even on throw).
|
|
157
|
+
*/
|
|
158
|
+
declare function restoreContextStack<T>(snapshot: ContextSnapshot, fn: () => T): T;
|
|
118
159
|
//#endregion
|
|
119
160
|
//#region src/dynamic.d.ts
|
|
120
161
|
interface DynamicProps extends Props {
|
|
@@ -163,8 +204,14 @@ declare function ErrorBoundary(props: {
|
|
|
163
204
|
declare const ForSymbol: unique symbol;
|
|
164
205
|
interface ForProps<T> {
|
|
165
206
|
each: () => T[];
|
|
207
|
+
/** Keying function — use `by` not `key` (JSX extracts `key` for VNode reconciliation). */
|
|
166
208
|
by: (item: T) => string | number;
|
|
167
209
|
children: (item: T) => VNode | NativeItem;
|
|
210
|
+
/**
|
|
211
|
+
* @deprecated Use `by` instead of `key`. In Pyreon, `<For>` uses `by` for keying.
|
|
212
|
+
* JSX reserves `key` for VNode reconciliation — it won't reach the component.
|
|
213
|
+
*/
|
|
214
|
+
key?: never;
|
|
168
215
|
}
|
|
169
216
|
/**
|
|
170
217
|
* Efficient reactive list rendering.
|
|
@@ -192,8 +239,8 @@ declare const Fragment: unique symbol;
|
|
|
192
239
|
/** Shared empty props sentinel — identity-checked in mountElement to skip applyProps. */
|
|
193
240
|
declare const EMPTY_PROPS: Props;
|
|
194
241
|
/** Makes `children` optional in P (if present) so it can be passed as rest args to h(). */
|
|
195
|
-
type PropsWithOptionalChildren<P extends Props> = Omit<P,
|
|
196
|
-
children?: P[
|
|
242
|
+
type PropsWithOptionalChildren<P extends Props> = Omit<P, 'children'> & ('children' extends keyof P ? {
|
|
243
|
+
children?: P['children'];
|
|
197
244
|
} : unknown);
|
|
198
245
|
declare function h<P extends Props>(type: ComponentFn<P>, props: (PropsWithOptionalChildren<P> & Props) | null, ...children: VNodeChild[]): VNode;
|
|
199
246
|
declare function h(type: string | ((p: any) => VNodeChild) | symbol, props: Props | null, ...children: VNodeChild[]): VNode;
|
|
@@ -231,7 +278,7 @@ declare function toKebabCase(str: string): string;
|
|
|
231
278
|
declare function normalizeStyleValue(key: string, value: unknown): string;
|
|
232
279
|
//#endregion
|
|
233
280
|
//#region src/jsx-runtime.d.ts
|
|
234
|
-
type Booleanish = boolean |
|
|
281
|
+
type Booleanish = boolean | 'true' | 'false';
|
|
235
282
|
type CSSProperties = { [K in keyof CSSStyleDeclaration]?: string | number };
|
|
236
283
|
type StyleValue = string | CSSProperties;
|
|
237
284
|
/** Event with typed currentTarget — used in element-specific event handlers. */
|
|
@@ -248,58 +295,58 @@ interface PyreonHTMLAttributes<E extends Element = HTMLElement> {
|
|
|
248
295
|
tabIndex?: number | (() => number) | undefined;
|
|
249
296
|
title?: string | (() => string) | undefined;
|
|
250
297
|
lang?: string | undefined;
|
|
251
|
-
dir?:
|
|
298
|
+
dir?: 'ltr' | 'rtl' | 'auto' | undefined;
|
|
252
299
|
hidden?: boolean | (() => boolean) | undefined;
|
|
253
300
|
draggable?: Booleanish | undefined;
|
|
254
|
-
contentEditable?: Booleanish |
|
|
301
|
+
contentEditable?: Booleanish | 'inherit' | 'plaintext-only' | undefined;
|
|
255
302
|
spellCheck?: Booleanish | undefined;
|
|
256
|
-
autoCapitalize?:
|
|
257
|
-
translate?:
|
|
258
|
-
enterKeyHint?:
|
|
259
|
-
inputMode?:
|
|
303
|
+
autoCapitalize?: 'off' | 'on' | 'sentences' | 'words' | 'characters' | undefined;
|
|
304
|
+
translate?: 'yes' | 'no' | undefined;
|
|
305
|
+
enterKeyHint?: 'enter' | 'done' | 'go' | 'next' | 'previous' | 'search' | 'send' | undefined;
|
|
306
|
+
inputMode?: 'none' | 'text' | 'decimal' | 'numeric' | 'tel' | 'search' | 'email' | 'url' | undefined;
|
|
260
307
|
is?: string | undefined;
|
|
261
308
|
slot?: string | undefined;
|
|
262
309
|
part?: string | undefined;
|
|
263
|
-
popover?:
|
|
310
|
+
popover?: 'auto' | 'manual' | undefined;
|
|
264
311
|
popoverTarget?: string | undefined;
|
|
265
|
-
popoverTargetAction?:
|
|
312
|
+
popoverTargetAction?: 'toggle' | 'show' | 'hide' | undefined;
|
|
266
313
|
inert?: boolean | undefined;
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
314
|
+
'aria-label'?: string | (() => string) | undefined;
|
|
315
|
+
'aria-hidden'?: Booleanish | (() => Booleanish) | undefined;
|
|
316
|
+
'aria-disabled'?: Booleanish | (() => Booleanish) | undefined;
|
|
317
|
+
'aria-expanded'?: Booleanish | (() => Booleanish) | undefined;
|
|
318
|
+
'aria-selected'?: Booleanish | (() => Booleanish) | undefined;
|
|
319
|
+
'aria-checked'?: Booleanish | 'mixed' | (() => Booleanish | 'mixed') | undefined;
|
|
320
|
+
'aria-current'?: Booleanish | 'page' | 'step' | 'location' | 'date' | 'time' | undefined;
|
|
321
|
+
'aria-live'?: 'off' | 'assertive' | 'polite' | undefined;
|
|
322
|
+
'aria-atomic'?: Booleanish | undefined;
|
|
323
|
+
'aria-busy'?: Booleanish | undefined;
|
|
324
|
+
'aria-controls'?: string | undefined;
|
|
325
|
+
'aria-describedby'?: string | undefined;
|
|
326
|
+
'aria-labelledby'?: string | undefined;
|
|
327
|
+
'aria-placeholder'?: string | undefined;
|
|
328
|
+
'aria-required'?: Booleanish | (() => Booleanish) | undefined;
|
|
329
|
+
'aria-invalid'?: Booleanish | 'grammar' | 'spelling' | undefined;
|
|
330
|
+
'aria-valuemin'?: number | undefined;
|
|
331
|
+
'aria-valuemax'?: number | undefined;
|
|
332
|
+
'aria-valuenow'?: number | undefined;
|
|
333
|
+
'aria-valuetext'?: string | undefined;
|
|
334
|
+
'aria-haspopup'?: Booleanish | 'menu' | 'listbox' | 'tree' | 'grid' | 'dialog' | undefined;
|
|
335
|
+
'aria-posinset'?: number | undefined;
|
|
336
|
+
'aria-setsize'?: number | undefined;
|
|
337
|
+
'aria-level'?: number | undefined;
|
|
338
|
+
'aria-multiline'?: Booleanish | undefined;
|
|
339
|
+
'aria-multiselectable'?: Booleanish | undefined;
|
|
340
|
+
'aria-orientation'?: 'horizontal' | 'vertical' | undefined;
|
|
341
|
+
'aria-readonly'?: Booleanish | (() => Booleanish) | undefined;
|
|
342
|
+
'aria-sort'?: 'none' | 'ascending' | 'descending' | 'other' | undefined;
|
|
343
|
+
'aria-autocomplete'?: 'none' | 'inline' | 'list' | 'both' | undefined;
|
|
344
|
+
'aria-colcount'?: number | undefined;
|
|
345
|
+
'aria-colindex'?: number | undefined;
|
|
346
|
+
'aria-colspan'?: number | undefined;
|
|
347
|
+
'aria-rowcount'?: number | undefined;
|
|
348
|
+
'aria-rowindex'?: number | undefined;
|
|
349
|
+
'aria-rowspan'?: number | undefined;
|
|
303
350
|
ref?: RefProp<E> | undefined;
|
|
304
351
|
key?: string | number | undefined;
|
|
305
352
|
children?: VNodeChild | VNodeChild[];
|
|
@@ -385,7 +432,7 @@ interface InputAttributes extends PyreonHTMLAttributes<HTMLInputElement> {
|
|
|
385
432
|
accept?: string | undefined;
|
|
386
433
|
autoComplete?: string | undefined;
|
|
387
434
|
autoFocus?: boolean | undefined;
|
|
388
|
-
capture?:
|
|
435
|
+
capture?: 'user' | 'environment' | string | undefined;
|
|
389
436
|
form?: string | undefined;
|
|
390
437
|
formNoValidate?: boolean | undefined;
|
|
391
438
|
list?: string | undefined;
|
|
@@ -400,12 +447,12 @@ interface AnchorAttributes extends PyreonHTMLAttributes<HTMLAnchorElement> {
|
|
|
400
447
|
hreflang?: string | undefined;
|
|
401
448
|
ping?: string | undefined;
|
|
402
449
|
referrerPolicy?: string | undefined;
|
|
403
|
-
target?:
|
|
450
|
+
target?: '_blank' | '_self' | '_parent' | '_top' | string | undefined;
|
|
404
451
|
rel?: string | undefined;
|
|
405
452
|
download?: string | boolean | undefined;
|
|
406
453
|
}
|
|
407
454
|
interface ButtonAttributes extends PyreonHTMLAttributes<HTMLButtonElement> {
|
|
408
|
-
type?:
|
|
455
|
+
type?: 'button' | 'submit' | 'reset' | undefined;
|
|
409
456
|
disabled?: boolean | (() => boolean) | undefined;
|
|
410
457
|
name?: string | undefined;
|
|
411
458
|
value?: string | undefined;
|
|
@@ -430,7 +477,7 @@ interface TextareaAttributes extends PyreonHTMLAttributes<HTMLTextAreaElement> {
|
|
|
430
477
|
name?: string | undefined;
|
|
431
478
|
autoFocus?: boolean | undefined;
|
|
432
479
|
form?: string | undefined;
|
|
433
|
-
wrap?:
|
|
480
|
+
wrap?: 'hard' | 'soft' | undefined;
|
|
434
481
|
}
|
|
435
482
|
interface SelectAttributes extends PyreonHTMLAttributes<HTMLSelectElement> {
|
|
436
483
|
value?: string | string[] | (() => string | string[]) | undefined;
|
|
@@ -451,7 +498,7 @@ interface OptionAttributes extends PyreonHTMLAttributes<HTMLOptionElement> {
|
|
|
451
498
|
}
|
|
452
499
|
interface FormAttributes extends PyreonHTMLAttributes<HTMLFormElement> {
|
|
453
500
|
action?: string | undefined;
|
|
454
|
-
method?:
|
|
501
|
+
method?: 'get' | 'post' | undefined;
|
|
455
502
|
encType?: string | undefined;
|
|
456
503
|
noValidate?: boolean | undefined;
|
|
457
504
|
target?: string | undefined;
|
|
@@ -465,13 +512,13 @@ interface ImgAttributes extends PyreonHTMLAttributes<HTMLImageElement> {
|
|
|
465
512
|
alt?: string | (() => string) | undefined;
|
|
466
513
|
width?: number | string | (() => number | string) | undefined;
|
|
467
514
|
height?: number | string | (() => number | string) | undefined;
|
|
468
|
-
loading?:
|
|
469
|
-
decoding?:
|
|
470
|
-
crossOrigin?:
|
|
515
|
+
loading?: 'lazy' | 'eager' | undefined;
|
|
516
|
+
decoding?: 'auto' | 'async' | 'sync' | undefined;
|
|
517
|
+
crossOrigin?: 'anonymous' | 'use-credentials' | undefined;
|
|
471
518
|
referrerPolicy?: string | undefined;
|
|
472
519
|
srcSet?: string | (() => string) | undefined;
|
|
473
520
|
sizes?: string | (() => string) | undefined;
|
|
474
|
-
fetchPriority?:
|
|
521
|
+
fetchPriority?: 'high' | 'low' | 'auto' | undefined;
|
|
475
522
|
}
|
|
476
523
|
interface VideoAttributes extends PyreonHTMLAttributes<HTMLVideoElement> {
|
|
477
524
|
src?: string | (() => string) | undefined;
|
|
@@ -482,9 +529,9 @@ interface VideoAttributes extends PyreonHTMLAttributes<HTMLVideoElement> {
|
|
|
482
529
|
muted?: boolean | undefined;
|
|
483
530
|
loop?: boolean | undefined;
|
|
484
531
|
poster?: string | (() => string) | undefined;
|
|
485
|
-
preload?:
|
|
532
|
+
preload?: 'none' | 'metadata' | 'auto' | undefined;
|
|
486
533
|
playsInline?: boolean | undefined;
|
|
487
|
-
crossOrigin?:
|
|
534
|
+
crossOrigin?: 'anonymous' | 'use-credentials' | undefined;
|
|
488
535
|
disablePictureInPicture?: boolean | undefined;
|
|
489
536
|
disableRemotePlayback?: boolean | undefined;
|
|
490
537
|
}
|
|
@@ -494,8 +541,8 @@ interface AudioAttributes extends PyreonHTMLAttributes<HTMLAudioElement> {
|
|
|
494
541
|
autoPlay?: boolean | undefined;
|
|
495
542
|
muted?: boolean | undefined;
|
|
496
543
|
loop?: boolean | undefined;
|
|
497
|
-
preload?:
|
|
498
|
-
crossOrigin?:
|
|
544
|
+
preload?: 'none' | 'metadata' | 'auto' | undefined;
|
|
545
|
+
crossOrigin?: 'anonymous' | 'use-credentials' | undefined;
|
|
499
546
|
}
|
|
500
547
|
interface LabelAttributes extends PyreonHTMLAttributes<HTMLLabelElement> {
|
|
501
548
|
htmlFor?: string | undefined;
|
|
@@ -505,7 +552,7 @@ interface LabelAttributes extends PyreonHTMLAttributes<HTMLLabelElement> {
|
|
|
505
552
|
interface ThAttributes extends PyreonHTMLAttributes<HTMLTableCellElement> {
|
|
506
553
|
colSpan?: number | undefined;
|
|
507
554
|
rowSpan?: number | undefined;
|
|
508
|
-
scope?:
|
|
555
|
+
scope?: 'col' | 'row' | 'colgroup' | 'rowgroup' | undefined;
|
|
509
556
|
abbr?: string | undefined;
|
|
510
557
|
headers?: string | undefined;
|
|
511
558
|
}
|
|
@@ -523,7 +570,7 @@ interface IframeAttributes extends PyreonHTMLAttributes<HTMLIFrameElement> {
|
|
|
523
570
|
height?: number | string | undefined;
|
|
524
571
|
allow?: string | undefined;
|
|
525
572
|
allowFullScreen?: boolean | undefined;
|
|
526
|
-
loading?:
|
|
573
|
+
loading?: 'lazy' | 'eager' | undefined;
|
|
527
574
|
name?: string | undefined;
|
|
528
575
|
sandbox?: string | undefined;
|
|
529
576
|
referrerPolicy?: string | undefined;
|
|
@@ -535,7 +582,7 @@ interface LinkAttributes extends PyreonHTMLAttributes<HTMLLinkElement> {
|
|
|
535
582
|
type?: string | undefined;
|
|
536
583
|
as?: string | undefined;
|
|
537
584
|
media?: string | undefined;
|
|
538
|
-
crossOrigin?:
|
|
585
|
+
crossOrigin?: 'anonymous' | 'use-credentials' | undefined;
|
|
539
586
|
integrity?: string | undefined;
|
|
540
587
|
referrerPolicy?: string | undefined;
|
|
541
588
|
}
|
|
@@ -551,7 +598,7 @@ interface ScriptAttributes extends PyreonHTMLAttributes<HTMLScriptElement> {
|
|
|
551
598
|
type?: string | undefined;
|
|
552
599
|
async?: boolean | undefined;
|
|
553
600
|
defer?: boolean | undefined;
|
|
554
|
-
crossOrigin?:
|
|
601
|
+
crossOrigin?: 'anonymous' | 'use-credentials' | undefined;
|
|
555
602
|
integrity?: string | undefined;
|
|
556
603
|
noModule?: boolean | undefined;
|
|
557
604
|
referrerPolicy?: string | undefined;
|
|
@@ -584,7 +631,7 @@ interface DialogAttributes extends PyreonHTMLAttributes<HTMLDialogElement> {
|
|
|
584
631
|
interface OlAttributes extends PyreonHTMLAttributes<HTMLOListElement> {
|
|
585
632
|
start?: number | undefined;
|
|
586
633
|
reversed?: boolean | undefined;
|
|
587
|
-
type?:
|
|
634
|
+
type?: '1' | 'a' | 'A' | 'i' | 'I' | undefined;
|
|
588
635
|
}
|
|
589
636
|
interface CanvasAttributes extends PyreonHTMLAttributes<HTMLCanvasElement> {
|
|
590
637
|
width?: number | string | undefined;
|
|
@@ -595,12 +642,12 @@ interface SvgAttributes extends PyreonHTMLAttributes<SVGElement> {
|
|
|
595
642
|
xmlns?: string | undefined;
|
|
596
643
|
fill?: string | (() => string) | undefined;
|
|
597
644
|
stroke?: string | (() => string) | undefined;
|
|
598
|
-
|
|
599
|
-
|
|
600
|
-
|
|
601
|
-
|
|
602
|
-
|
|
603
|
-
|
|
645
|
+
'stroke-width'?: string | number | undefined;
|
|
646
|
+
'stroke-linecap'?: 'butt' | 'round' | 'square' | undefined;
|
|
647
|
+
'stroke-linejoin'?: 'miter' | 'round' | 'bevel' | undefined;
|
|
648
|
+
'fill-rule'?: 'nonzero' | 'evenodd' | undefined;
|
|
649
|
+
'clip-rule'?: 'nonzero' | 'evenodd' | undefined;
|
|
650
|
+
'clip-path'?: string | undefined;
|
|
604
651
|
d?: string | undefined;
|
|
605
652
|
cx?: string | number | undefined;
|
|
606
653
|
cy?: string | number | undefined;
|
|
@@ -618,33 +665,33 @@ interface SvgAttributes extends PyreonHTMLAttributes<SVGElement> {
|
|
|
618
665
|
transform?: string | (() => string) | undefined;
|
|
619
666
|
opacity?: string | number | (() => string | number) | undefined;
|
|
620
667
|
points?: string | undefined;
|
|
621
|
-
|
|
622
|
-
|
|
623
|
-
|
|
624
|
-
gradientUnits?:
|
|
668
|
+
'font-size'?: string | number | undefined;
|
|
669
|
+
'text-anchor'?: 'start' | 'middle' | 'end' | undefined;
|
|
670
|
+
'dominant-baseline'?: string | undefined;
|
|
671
|
+
gradientUnits?: 'userSpaceOnUse' | 'objectBoundingBox' | undefined;
|
|
625
672
|
gradientTransform?: string | undefined;
|
|
626
|
-
patternUnits?:
|
|
627
|
-
patternContentUnits?:
|
|
673
|
+
patternUnits?: 'userSpaceOnUse' | 'objectBoundingBox' | undefined;
|
|
674
|
+
patternContentUnits?: 'userSpaceOnUse' | 'objectBoundingBox' | undefined;
|
|
628
675
|
patternTransform?: string | undefined;
|
|
629
|
-
spreadMethod?:
|
|
676
|
+
spreadMethod?: 'pad' | 'reflect' | 'repeat' | undefined;
|
|
630
677
|
markerWidth?: string | number | undefined;
|
|
631
678
|
markerHeight?: string | number | undefined;
|
|
632
|
-
markerUnits?:
|
|
679
|
+
markerUnits?: 'strokeWidth' | 'userSpaceOnUse' | undefined;
|
|
633
680
|
orient?: string | number | undefined;
|
|
634
681
|
refX?: string | number | undefined;
|
|
635
682
|
refY?: string | number | undefined;
|
|
636
|
-
maskUnits?:
|
|
637
|
-
maskContentUnits?:
|
|
638
|
-
clipPathUnits?:
|
|
639
|
-
filterUnits?:
|
|
640
|
-
primitiveUnits?:
|
|
683
|
+
maskUnits?: 'userSpaceOnUse' | 'objectBoundingBox' | undefined;
|
|
684
|
+
maskContentUnits?: 'userSpaceOnUse' | 'objectBoundingBox' | undefined;
|
|
685
|
+
clipPathUnits?: 'userSpaceOnUse' | 'objectBoundingBox' | undefined;
|
|
686
|
+
filterUnits?: 'userSpaceOnUse' | 'objectBoundingBox' | undefined;
|
|
687
|
+
primitiveUnits?: 'userSpaceOnUse' | 'objectBoundingBox' | undefined;
|
|
641
688
|
preserveAspectRatio?: string | undefined;
|
|
642
|
-
|
|
643
|
-
|
|
644
|
-
|
|
645
|
-
|
|
646
|
-
|
|
647
|
-
|
|
689
|
+
'color-interpolation'?: string | undefined;
|
|
690
|
+
'color-interpolation-filters'?: string | undefined;
|
|
691
|
+
'shape-rendering'?: string | undefined;
|
|
692
|
+
'image-rendering'?: string | undefined;
|
|
693
|
+
'text-rendering'?: string | undefined;
|
|
694
|
+
'pointer-events'?: string | undefined;
|
|
648
695
|
visibility?: string | undefined;
|
|
649
696
|
display?: string | undefined;
|
|
650
697
|
overflow?: string | undefined;
|
|
@@ -652,10 +699,10 @@ interface SvgAttributes extends PyreonHTMLAttributes<SVGElement> {
|
|
|
652
699
|
dx?: string | number | undefined;
|
|
653
700
|
dy?: string | number | undefined;
|
|
654
701
|
textLength?: string | number | undefined;
|
|
655
|
-
lengthAdjust?:
|
|
656
|
-
|
|
657
|
-
|
|
658
|
-
|
|
702
|
+
lengthAdjust?: 'spacing' | 'spacingAndGlyphs' | undefined;
|
|
703
|
+
'writing-mode'?: string | undefined;
|
|
704
|
+
'letter-spacing'?: string | number | undefined;
|
|
705
|
+
'word-spacing'?: string | number | undefined;
|
|
659
706
|
pathLength?: number | undefined;
|
|
660
707
|
href?: string | undefined;
|
|
661
708
|
}
|
|
@@ -798,8 +845,8 @@ declare global {
|
|
|
798
845
|
radialGradient: SvgAttributes;
|
|
799
846
|
stop: SvgAttributes & {
|
|
800
847
|
offset?: string | number;
|
|
801
|
-
|
|
802
|
-
|
|
848
|
+
'stop-color'?: string;
|
|
849
|
+
'stop-opacity'?: string | number;
|
|
803
850
|
};
|
|
804
851
|
details: DetailsAttributes;
|
|
805
852
|
summary: PyreonHTMLAttributes;
|
|
@@ -1013,7 +1060,7 @@ interface ErrorContext {
|
|
|
1013
1060
|
/** Component function name, or "Anonymous" */
|
|
1014
1061
|
component: string;
|
|
1015
1062
|
/** Lifecycle phase where the error occurred */
|
|
1016
|
-
phase:
|
|
1063
|
+
phase: 'setup' | 'render' | 'mount' | 'unmount' | 'effect';
|
|
1017
1064
|
/** The thrown value */
|
|
1018
1065
|
error: unknown;
|
|
1019
1066
|
/** Unix timestamp (ms) */
|
|
@@ -1033,5 +1080,5 @@ declare function registerErrorHandler(handler: ErrorHandler): () => void;
|
|
|
1033
1080
|
*/
|
|
1034
1081
|
declare function reportError(ctx: ErrorContext): void;
|
|
1035
1082
|
//#endregion
|
|
1036
|
-
export { type AnchorAttributes, type ButtonAttributes, type CSSProperties, CSS_UNITLESS, type ClassValue, type CleanupFn, type ComponentFn, type ComponentInstance, type Context, Dynamic, type DynamicProps, EMPTY_PROPS, ErrorBoundary, type ErrorContext, type ErrorHandler, type ExtractProps, For, type ForProps, ForSymbol, type FormAttributes, Fragment, type HigherOrderComponent, type ImgAttributes, type InputAttributes, type LazyComponent, type LifecycleHooks, Match, type MatchProps, MatchSymbol, type NativeItem, Portal, type PortalProps, PortalSymbol, type Props, type PyreonHTMLAttributes, type Ref, type RefCallback, type RefProp, type SelectAttributes, Show, type ShowProps, type StyleValue, Suspense, type SvgAttributes, Switch, type SwitchProps, type TargetedEvent, type TextareaAttributes, type VNode, type VNodeChild, type VNodeChildAtom, createContext, createRef, createUniqueId, cx, defineComponent, dispatchToErrorBoundary, h, lazy, mapArray, mergeProps, normalizeStyleValue, onErrorCaptured, onMount, onUnmount, onUpdate, popContext, propagateError, provide, pushContext, registerErrorHandler, reportError, runWithHooks, setContextStackProvider, splitProps, toKebabCase, useContext, withContext };
|
|
1083
|
+
export { type AnchorAttributes, type ButtonAttributes, type CSSProperties, CSS_UNITLESS, type ClassValue, type CleanupFn, type ComponentFn, type ComponentInstance, type Context, type ContextSnapshot, Dynamic, type DynamicProps, EMPTY_PROPS, ErrorBoundary, type ErrorContext, type ErrorHandler, type ExtractProps, For, type ForProps, ForSymbol, type FormAttributes, Fragment, type HigherOrderComponent, type ImgAttributes, type InputAttributes, type LazyComponent, type LifecycleHooks, Match, type MatchProps, MatchSymbol, type NativeItem, Portal, type PortalProps, PortalSymbol, type Props, type PyreonHTMLAttributes, type ReactiveContext, type Ref, type RefCallback, type RefProp, type SelectAttributes, Show, type ShowProps, type StyleValue, Suspense, type SvgAttributes, Switch, type SwitchProps, type TargetedEvent, type TextareaAttributes, type VNode, type VNodeChild, type VNodeChildAtom, captureContextStack, createContext, createReactiveContext, createRef, createUniqueId, cx, defineComponent, dispatchToErrorBoundary, h, lazy, mapArray, mergeProps, normalizeStyleValue, onErrorCaptured, onMount, onUnmount, onUpdate, popContext, propagateError, provide, pushContext, registerErrorHandler, reportError, restoreContextStack, runWithHooks, setContextStackProvider, splitProps, toKebabCase, useContext, withContext };
|
|
1037
1084
|
//# sourceMappingURL=index2.d.ts.map
|