revojs 0.0.19 → 0.0.20
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/dist/html/index.d.ts +2 -2
- package/dist/index.js +5 -1
- package/dist/jsx/index.d.ts +123 -122
- package/package.json +1 -1
package/dist/html/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { type HtmlAttributes } from "../jsx";
|
|
1
|
+
import { type EventListener, type HtmlAttributes } from "../jsx";
|
|
2
2
|
import { type Descriptor, Hooks, Scope, type State, type Value } from "../signals";
|
|
3
3
|
export type TypeOf<T> = {
|
|
4
4
|
(): T;
|
|
@@ -11,7 +11,7 @@ export type Template = {
|
|
|
11
11
|
children: Array<Slot>;
|
|
12
12
|
};
|
|
13
13
|
export type EventInput<T extends Events> = {
|
|
14
|
-
[K in keyof T]?:
|
|
14
|
+
[K in keyof T]?: EventListener<Infer<T[K]["type"]> extends Event ? Infer<T[K]["type"]> : CustomEvent<Infer<T[K]["type"]>>>;
|
|
15
15
|
};
|
|
16
16
|
export type AttributeInput<T extends Attributes> = {
|
|
17
17
|
[K in keyof T]?: Value<Infer<T[K]["type"]> | undefined>;
|
package/dist/index.js
CHANGED
|
@@ -324,7 +324,11 @@ const renderToNode = async (scope, slot) => {
|
|
|
324
324
|
if (name.startsWith("on")) {
|
|
325
325
|
const event = name.substring(2).toLowerCase();
|
|
326
326
|
const controller = new AbortController();
|
|
327
|
-
element.addEventListener(event, (event$1) =>
|
|
327
|
+
element.addEventListener(event, (event$1) => {
|
|
328
|
+
const invoke = value;
|
|
329
|
+
if (Array.isArray(invoke)) for (const target of invoke) target?.(event$1);
|
|
330
|
+
else invoke?.(event$1);
|
|
331
|
+
}, { signal: controller.signal });
|
|
328
332
|
scope.dispose.push(() => controller.abort());
|
|
329
333
|
} else createCompute(scope, () => {
|
|
330
334
|
const set = toString(value);
|
package/dist/jsx/index.d.ts
CHANGED
|
@@ -1,127 +1,128 @@
|
|
|
1
1
|
import { type Slot } from "../html";
|
|
2
|
+
export type EventListener<T extends Event> = ((event: T) => void) | Array<(event: T) => void>;
|
|
2
3
|
export type EventAttributes = {
|
|
3
|
-
onScroll?:
|
|
4
|
-
onScrollCapture?:
|
|
5
|
-
onScrollEnd?:
|
|
6
|
-
onScrollEndCapture?:
|
|
7
|
-
onWheel?:
|
|
8
|
-
onWheelCapture?:
|
|
9
|
-
onAnimationCancel?:
|
|
10
|
-
onAnimationCancelCapture?:
|
|
11
|
-
onAnimationEnd?:
|
|
12
|
-
onAnimationEndCapture?:
|
|
13
|
-
onAnimationIteration?:
|
|
14
|
-
onAnimationIterationCapture?:
|
|
15
|
-
onAnimationStart?:
|
|
16
|
-
onAnimationStartCapture?:
|
|
17
|
-
onCopy?:
|
|
18
|
-
onCopyCapture?:
|
|
19
|
-
onCut?:
|
|
20
|
-
onCutCapture?:
|
|
21
|
-
onPaste?:
|
|
22
|
-
onPasteCapture?:
|
|
23
|
-
onCompositionEnd?:
|
|
24
|
-
onCompositionEndCapture?:
|
|
25
|
-
onCompositionStart?:
|
|
26
|
-
onCompositionStartCapture?:
|
|
27
|
-
onCompositionUpdate?:
|
|
28
|
-
onCompositionUpdateCapture?:
|
|
29
|
-
onBlur?:
|
|
30
|
-
onBlurCapture?:
|
|
31
|
-
onFocus?:
|
|
32
|
-
onFocusCapture?:
|
|
33
|
-
onFocusIn?:
|
|
34
|
-
onFocusInCapture?:
|
|
35
|
-
onFocusOut?:
|
|
36
|
-
onFocusOutCapture?:
|
|
37
|
-
onFullscreenChange?:
|
|
38
|
-
onFullscreenChangeCapture?:
|
|
39
|
-
onFullscreenError?:
|
|
40
|
-
onFullscreenErrorCapture?:
|
|
41
|
-
onKeyDown?:
|
|
42
|
-
onKeyDownCapture?:
|
|
43
|
-
onKeyPress?:
|
|
44
|
-
onKeyPressCapture?:
|
|
45
|
-
onKeyUp?:
|
|
46
|
-
onKeyUpCapture?:
|
|
47
|
-
onAuxClick?:
|
|
48
|
-
onAuxClickCapture?:
|
|
49
|
-
onClick?:
|
|
50
|
-
onClickCapture?:
|
|
51
|
-
onContextMenu?:
|
|
52
|
-
onContextMenuCapture?:
|
|
53
|
-
onDoubleClick?:
|
|
54
|
-
onDoubleClickCapture?:
|
|
55
|
-
onMouseDown?:
|
|
56
|
-
onMouseDownCapture?:
|
|
57
|
-
onMouseEnter?:
|
|
58
|
-
onMouseEnterCapture?:
|
|
59
|
-
onMouseLeave?:
|
|
60
|
-
onMouseLeaveCapture?:
|
|
61
|
-
onMouseMove?:
|
|
62
|
-
onMouseMoveCapture?:
|
|
63
|
-
onMouseOut?:
|
|
64
|
-
onMouseOutCapture?:
|
|
65
|
-
onMouseOver?:
|
|
66
|
-
onMouseOverCapture?:
|
|
67
|
-
onMouseUp?:
|
|
68
|
-
onMouseUpCapture?:
|
|
69
|
-
onMouseWheel?:
|
|
70
|
-
onMouseWheelCapture?:
|
|
71
|
-
onGotPointerCapture?:
|
|
72
|
-
onGotPointerCaptureCapture?:
|
|
73
|
-
onLostPointerCapture?:
|
|
74
|
-
onLostPointerCaptureCapture?:
|
|
75
|
-
onPointerCancel?:
|
|
76
|
-
onPointerCancelCapture?:
|
|
77
|
-
onPointerDown?:
|
|
78
|
-
onPointerDownCapture?:
|
|
79
|
-
onPointerEnter?:
|
|
80
|
-
onPointerEnterCapture?:
|
|
81
|
-
onPointerLeave?:
|
|
82
|
-
onPointerLeaveCapture?:
|
|
83
|
-
onPointerMove?:
|
|
84
|
-
onPointerMoveCapture?:
|
|
85
|
-
onPointerOut?:
|
|
86
|
-
onPointerOutCapture?:
|
|
87
|
-
onPointerOver?:
|
|
88
|
-
onPointerOverCapture?:
|
|
89
|
-
onPointerUp?:
|
|
90
|
-
onPointerUpCapture?:
|
|
91
|
-
onTouchCancel?:
|
|
92
|
-
onTouchCancelCapture?:
|
|
93
|
-
onTouchEnd?:
|
|
94
|
-
onTouchEndCapture?:
|
|
95
|
-
onTouchMove?:
|
|
96
|
-
onTouchMoveCapture?:
|
|
97
|
-
onTouchStart?:
|
|
98
|
-
onTouchStartCapture?:
|
|
99
|
-
onTransitionCancel?:
|
|
100
|
-
onTransitionCancelCapture?:
|
|
101
|
-
onTransitionEnd?:
|
|
102
|
-
onTransitionEndCapture?:
|
|
103
|
-
onTransitionRun?:
|
|
104
|
-
onTransitionRunCapture?:
|
|
105
|
-
onTransitionStart?:
|
|
106
|
-
onTransitionStartCapture?:
|
|
107
|
-
onFormData?:
|
|
108
|
-
onFormDataCapture?:
|
|
109
|
-
onReset?:
|
|
110
|
-
onResetCapture?:
|
|
111
|
-
onSubmit?:
|
|
112
|
-
onSubmitCapture?:
|
|
113
|
-
onInvalid?:
|
|
114
|
-
onInvalidCapture?:
|
|
115
|
-
onSelect?:
|
|
116
|
-
onSelectCapture?:
|
|
117
|
-
onSelectChange?:
|
|
118
|
-
onSelectChangeCapture?:
|
|
119
|
-
onInput?:
|
|
120
|
-
onInputCapture?:
|
|
121
|
-
onBeforeInput?:
|
|
122
|
-
onBeforeInputCapture?:
|
|
123
|
-
onChange?:
|
|
124
|
-
onChangeCapture?:
|
|
4
|
+
onScroll?: EventListener<Event>;
|
|
5
|
+
onScrollCapture?: EventListener<Event>;
|
|
6
|
+
onScrollEnd?: EventListener<Event>;
|
|
7
|
+
onScrollEndCapture?: EventListener<Event>;
|
|
8
|
+
onWheel?: EventListener<WheelEvent>;
|
|
9
|
+
onWheelCapture?: EventListener<WheelEvent>;
|
|
10
|
+
onAnimationCancel?: EventListener<AnimationEvent>;
|
|
11
|
+
onAnimationCancelCapture?: EventListener<AnimationEvent>;
|
|
12
|
+
onAnimationEnd?: EventListener<AnimationEvent>;
|
|
13
|
+
onAnimationEndCapture?: EventListener<AnimationEvent>;
|
|
14
|
+
onAnimationIteration?: EventListener<AnimationEvent>;
|
|
15
|
+
onAnimationIterationCapture?: EventListener<AnimationEvent>;
|
|
16
|
+
onAnimationStart?: EventListener<AnimationEvent>;
|
|
17
|
+
onAnimationStartCapture?: EventListener<AnimationEvent>;
|
|
18
|
+
onCopy?: EventListener<ClipboardEvent>;
|
|
19
|
+
onCopyCapture?: EventListener<ClipboardEvent>;
|
|
20
|
+
onCut?: EventListener<ClipboardEvent>;
|
|
21
|
+
onCutCapture?: EventListener<ClipboardEvent>;
|
|
22
|
+
onPaste?: EventListener<ClipboardEvent>;
|
|
23
|
+
onPasteCapture?: EventListener<ClipboardEvent>;
|
|
24
|
+
onCompositionEnd?: EventListener<CompositionEvent>;
|
|
25
|
+
onCompositionEndCapture?: EventListener<CompositionEvent>;
|
|
26
|
+
onCompositionStart?: EventListener<CompositionEvent>;
|
|
27
|
+
onCompositionStartCapture?: EventListener<CompositionEvent>;
|
|
28
|
+
onCompositionUpdate?: EventListener<CompositionEvent>;
|
|
29
|
+
onCompositionUpdateCapture?: EventListener<CompositionEvent>;
|
|
30
|
+
onBlur?: EventListener<FocusEvent>;
|
|
31
|
+
onBlurCapture?: EventListener<FocusEvent>;
|
|
32
|
+
onFocus?: EventListener<FocusEvent>;
|
|
33
|
+
onFocusCapture?: EventListener<FocusEvent>;
|
|
34
|
+
onFocusIn?: EventListener<FocusEvent>;
|
|
35
|
+
onFocusInCapture?: EventListener<FocusEvent>;
|
|
36
|
+
onFocusOut?: EventListener<FocusEvent>;
|
|
37
|
+
onFocusOutCapture?: EventListener<FocusEvent>;
|
|
38
|
+
onFullscreenChange?: EventListener<Event>;
|
|
39
|
+
onFullscreenChangeCapture?: EventListener<Event>;
|
|
40
|
+
onFullscreenError?: EventListener<Event>;
|
|
41
|
+
onFullscreenErrorCapture?: EventListener<Event>;
|
|
42
|
+
onKeyDown?: EventListener<KeyboardEvent>;
|
|
43
|
+
onKeyDownCapture?: EventListener<KeyboardEvent>;
|
|
44
|
+
onKeyPress?: EventListener<KeyboardEvent>;
|
|
45
|
+
onKeyPressCapture?: EventListener<KeyboardEvent>;
|
|
46
|
+
onKeyUp?: EventListener<KeyboardEvent>;
|
|
47
|
+
onKeyUpCapture?: EventListener<KeyboardEvent>;
|
|
48
|
+
onAuxClick?: EventListener<MouseEvent>;
|
|
49
|
+
onAuxClickCapture?: EventListener<MouseEvent>;
|
|
50
|
+
onClick?: EventListener<MouseEvent>;
|
|
51
|
+
onClickCapture?: EventListener<MouseEvent>;
|
|
52
|
+
onContextMenu?: EventListener<MouseEvent>;
|
|
53
|
+
onContextMenuCapture?: EventListener<MouseEvent>;
|
|
54
|
+
onDoubleClick?: EventListener<MouseEvent>;
|
|
55
|
+
onDoubleClickCapture?: EventListener<MouseEvent>;
|
|
56
|
+
onMouseDown?: EventListener<MouseEvent>;
|
|
57
|
+
onMouseDownCapture?: EventListener<MouseEvent>;
|
|
58
|
+
onMouseEnter?: EventListener<MouseEvent>;
|
|
59
|
+
onMouseEnterCapture?: EventListener<MouseEvent>;
|
|
60
|
+
onMouseLeave?: EventListener<MouseEvent>;
|
|
61
|
+
onMouseLeaveCapture?: EventListener<MouseEvent>;
|
|
62
|
+
onMouseMove?: EventListener<MouseEvent>;
|
|
63
|
+
onMouseMoveCapture?: EventListener<MouseEvent>;
|
|
64
|
+
onMouseOut?: EventListener<MouseEvent>;
|
|
65
|
+
onMouseOutCapture?: EventListener<MouseEvent>;
|
|
66
|
+
onMouseOver?: EventListener<MouseEvent>;
|
|
67
|
+
onMouseOverCapture?: EventListener<MouseEvent>;
|
|
68
|
+
onMouseUp?: EventListener<MouseEvent>;
|
|
69
|
+
onMouseUpCapture?: EventListener<MouseEvent>;
|
|
70
|
+
onMouseWheel?: EventListener<WheelEvent>;
|
|
71
|
+
onMouseWheelCapture?: EventListener<WheelEvent>;
|
|
72
|
+
onGotPointerCapture?: EventListener<PointerEvent>;
|
|
73
|
+
onGotPointerCaptureCapture?: EventListener<PointerEvent>;
|
|
74
|
+
onLostPointerCapture?: EventListener<PointerEvent>;
|
|
75
|
+
onLostPointerCaptureCapture?: EventListener<PointerEvent>;
|
|
76
|
+
onPointerCancel?: EventListener<PointerEvent>;
|
|
77
|
+
onPointerCancelCapture?: EventListener<PointerEvent>;
|
|
78
|
+
onPointerDown?: EventListener<PointerEvent>;
|
|
79
|
+
onPointerDownCapture?: EventListener<PointerEvent>;
|
|
80
|
+
onPointerEnter?: EventListener<PointerEvent>;
|
|
81
|
+
onPointerEnterCapture?: EventListener<PointerEvent>;
|
|
82
|
+
onPointerLeave?: EventListener<PointerEvent>;
|
|
83
|
+
onPointerLeaveCapture?: EventListener<PointerEvent>;
|
|
84
|
+
onPointerMove?: EventListener<PointerEvent>;
|
|
85
|
+
onPointerMoveCapture?: EventListener<PointerEvent>;
|
|
86
|
+
onPointerOut?: EventListener<PointerEvent>;
|
|
87
|
+
onPointerOutCapture?: EventListener<PointerEvent>;
|
|
88
|
+
onPointerOver?: EventListener<PointerEvent>;
|
|
89
|
+
onPointerOverCapture?: EventListener<PointerEvent>;
|
|
90
|
+
onPointerUp?: EventListener<PointerEvent>;
|
|
91
|
+
onPointerUpCapture?: EventListener<PointerEvent>;
|
|
92
|
+
onTouchCancel?: EventListener<TouchEvent>;
|
|
93
|
+
onTouchCancelCapture?: EventListener<TouchEvent>;
|
|
94
|
+
onTouchEnd?: EventListener<TouchEvent>;
|
|
95
|
+
onTouchEndCapture?: EventListener<TouchEvent>;
|
|
96
|
+
onTouchMove?: EventListener<TouchEvent>;
|
|
97
|
+
onTouchMoveCapture?: EventListener<TouchEvent>;
|
|
98
|
+
onTouchStart?: EventListener<TouchEvent>;
|
|
99
|
+
onTouchStartCapture?: EventListener<TouchEvent>;
|
|
100
|
+
onTransitionCancel?: EventListener<TransitionEvent>;
|
|
101
|
+
onTransitionCancelCapture?: EventListener<TransitionEvent>;
|
|
102
|
+
onTransitionEnd?: EventListener<TransitionEvent>;
|
|
103
|
+
onTransitionEndCapture?: EventListener<TransitionEvent>;
|
|
104
|
+
onTransitionRun?: EventListener<TransitionEvent>;
|
|
105
|
+
onTransitionRunCapture?: EventListener<TransitionEvent>;
|
|
106
|
+
onTransitionStart?: EventListener<TransitionEvent>;
|
|
107
|
+
onTransitionStartCapture?: EventListener<TransitionEvent>;
|
|
108
|
+
onFormData?: EventListener<FormDataEvent>;
|
|
109
|
+
onFormDataCapture?: EventListener<FormDataEvent>;
|
|
110
|
+
onReset?: EventListener<Event>;
|
|
111
|
+
onResetCapture?: EventListener<Event>;
|
|
112
|
+
onSubmit?: EventListener<Event>;
|
|
113
|
+
onSubmitCapture?: EventListener<Event>;
|
|
114
|
+
onInvalid?: EventListener<Event>;
|
|
115
|
+
onInvalidCapture?: EventListener<Event>;
|
|
116
|
+
onSelect?: EventListener<Event>;
|
|
117
|
+
onSelectCapture?: EventListener<Event>;
|
|
118
|
+
onSelectChange?: EventListener<Event>;
|
|
119
|
+
onSelectChangeCapture?: EventListener<Event>;
|
|
120
|
+
onInput?: EventListener<InputEvent>;
|
|
121
|
+
onInputCapture?: EventListener<InputEvent>;
|
|
122
|
+
onBeforeInput?: EventListener<InputEvent>;
|
|
123
|
+
onBeforeInputCapture?: EventListener<InputEvent>;
|
|
124
|
+
onChange?: EventListener<Event>;
|
|
125
|
+
onChangeCapture?: EventListener<Event>;
|
|
125
126
|
};
|
|
126
127
|
export type HtmlTags = Record<string, HtmlAttributes & EventAttributes>;
|
|
127
128
|
export type HtmlAttributes = Record<string, unknown>;
|