@faiwer/react 0.8.4 → 19.0.1
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 +43 -21
- package/dist/core/actions/applyAction.d.ts.map +1 -1
- package/dist/core/actions/applyAction.js +6 -0
- package/dist/core/actions/applyAction.js.map +1 -1
- package/dist/core/actions/catchError.action.d.ts +10 -0
- package/dist/core/actions/catchError.action.d.ts.map +1 -0
- package/dist/core/actions/catchError.action.js +51 -0
- package/dist/core/actions/catchError.action.js.map +1 -0
- package/dist/core/actions/createComment.action.d.ts +2 -2
- package/dist/core/actions/createComment.action.d.ts.map +1 -1
- package/dist/core/actions/createComment.action.js +1 -8
- package/dist/core/actions/createComment.action.js.map +1 -1
- package/dist/core/actions/createContainer.action.d.ts +7 -0
- package/dist/core/actions/createContainer.action.d.ts.map +1 -0
- package/dist/core/actions/createContainer.action.js +28 -0
- package/dist/core/actions/createContainer.action.js.map +1 -0
- package/dist/core/actions/createTag.action.d.ts +2 -1
- package/dist/core/actions/createTag.action.d.ts.map +1 -1
- package/dist/core/actions/createTag.action.js +22 -4
- package/dist/core/actions/createTag.action.js.map +1 -1
- package/dist/core/actions/createText.action.d.ts.map +1 -1
- package/dist/core/actions/createText.action.js +2 -5
- package/dist/core/actions/createText.action.js.map +1 -1
- package/dist/core/actions/dom/attributes.d.ts.map +1 -1
- package/dist/core/actions/dom/attributes.js +4 -1
- package/dist/core/actions/dom/attributes.js.map +1 -1
- package/dist/core/actions/dom/css.d.ts.map +1 -1
- package/dist/core/actions/dom/css.js +2 -1
- package/dist/core/actions/dom/css.js.map +1 -1
- package/dist/core/actions/dom/events.d.ts.map +1 -1
- package/dist/core/actions/dom/events.js +15 -3
- package/dist/core/actions/dom/events.js.map +1 -1
- package/dist/core/actions/dom/value.d.ts +18 -0
- package/dist/core/actions/dom/value.d.ts.map +1 -0
- package/dist/core/actions/dom/value.js +211 -0
- package/dist/core/actions/dom/value.js.map +1 -0
- package/dist/core/actions/helpers.d.ts +17 -10
- package/dist/core/actions/helpers.d.ts.map +1 -1
- package/dist/core/actions/helpers.js +64 -70
- package/dist/core/actions/helpers.js.map +1 -1
- package/dist/core/actions/relayout.action.d.ts +2 -1
- package/dist/core/actions/relayout.action.d.ts.map +1 -1
- package/dist/core/actions/relayout.action.js +119 -30
- package/dist/core/actions/relayout.action.js.map +1 -1
- package/dist/core/actions/remove.action.d.ts +2 -2
- package/dist/core/actions/remove.action.d.ts.map +1 -1
- package/dist/core/actions/remove.action.js +20 -17
- package/dist/core/actions/remove.action.js.map +1 -1
- package/dist/core/actions/replace.action.d.ts +1 -1
- package/dist/core/actions/replace.action.d.ts.map +1 -1
- package/dist/core/actions/replace.action.js +34 -23
- package/dist/core/actions/replace.action.js.map +1 -1
- package/dist/core/actions/scheduleEffect.action.d.ts +7 -0
- package/dist/core/actions/scheduleEffect.action.d.ts.map +1 -0
- package/dist/core/actions/scheduleEffect.action.js +8 -0
- package/dist/core/actions/scheduleEffect.action.js.map +1 -0
- package/dist/core/actions/setAttr.action.d.ts +1 -1
- package/dist/core/actions/setAttr.action.d.ts.map +1 -1
- package/dist/core/actions/setAttr.action.js +47 -6
- package/dist/core/actions/setAttr.action.js.map +1 -1
- package/dist/core/actions/setProps.action.d.ts.map +1 -1
- package/dist/core/actions/setProps.action.js +2 -1
- package/dist/core/actions/setProps.action.js.map +1 -1
- package/dist/core/actions/setRef.action.d.ts +1 -1
- package/dist/core/actions/setRef.action.d.ts.map +1 -1
- package/dist/core/actions/setRef.action.js +5 -6
- package/dist/core/actions/setRef.action.js.map +1 -1
- package/dist/core/actions/setText.action.d.ts.map +1 -1
- package/dist/core/actions/setText.action.js +3 -3
- package/dist/core/actions/setText.action.js.map +1 -1
- package/dist/core/classComponent.d.ts +2 -1
- package/dist/core/classComponent.d.ts.map +1 -1
- package/dist/core/classComponent.js +20 -12
- package/dist/core/classComponent.js.map +1 -1
- package/dist/core/compact.d.ts +10 -29
- package/dist/core/compact.d.ts.map +1 -1
- package/dist/core/compact.js +12 -100
- package/dist/core/compact.js.map +1 -1
- package/dist/core/components.d.ts +6 -4
- package/dist/core/components.d.ts.map +1 -1
- package/dist/core/components.js +26 -8
- package/dist/core/components.js.map +1 -1
- package/dist/core/createElement.d.ts +2 -8
- package/dist/core/createElement.d.ts.map +1 -1
- package/dist/core/createElement.js +3 -1
- package/dist/core/createElement.js.map +1 -1
- package/dist/core/reactNodeToFiberNode.d.ts +3 -1
- package/dist/core/reactNodeToFiberNode.d.ts.map +1 -1
- package/dist/core/reactNodeToFiberNode.js +80 -17
- package/dist/core/reactNodeToFiberNode.js.map +1 -1
- package/dist/core/reconciliation/app.js +3 -3
- package/dist/core/reconciliation/app.js.map +1 -1
- package/dist/core/reconciliation/collect/fromApp.d.ts +2 -1
- package/dist/core/reconciliation/collect/fromApp.d.ts.map +1 -1
- package/dist/core/reconciliation/collect/fromApp.js +7 -26
- package/dist/core/reconciliation/collect/fromApp.js.map +1 -1
- package/dist/core/reconciliation/collect/fromChildrenPair.d.ts +2 -1
- package/dist/core/reconciliation/collect/fromChildrenPair.d.ts.map +1 -1
- package/dist/core/reconciliation/collect/fromChildrenPair.js +37 -10
- package/dist/core/reconciliation/collect/fromChildrenPair.js.map +1 -1
- package/dist/core/reconciliation/collect/fromComponent.d.ts +3 -2
- package/dist/core/reconciliation/collect/fromComponent.d.ts.map +1 -1
- package/dist/core/reconciliation/collect/fromComponent.js +27 -9
- package/dist/core/reconciliation/collect/fromComponent.js.map +1 -1
- package/dist/core/reconciliation/collect/fromFiberPair.d.ts +2 -1
- package/dist/core/reconciliation/collect/fromFiberPair.d.ts.map +1 -1
- package/dist/core/reconciliation/collect/fromFiberPair.js +8 -5
- package/dist/core/reconciliation/collect/fromFiberPair.js.map +1 -1
- package/dist/core/reconciliation/collect/fromNewFiber.d.ts.map +1 -1
- package/dist/core/reconciliation/collect/fromNewFiber.js +7 -15
- package/dist/core/reconciliation/collect/fromNewFiber.js.map +1 -1
- package/dist/core/reconciliation/effects.d.ts +2 -2
- package/dist/core/reconciliation/effects.d.ts.map +1 -1
- package/dist/core/reconciliation/effects.js +52 -4
- package/dist/core/reconciliation/effects.js.map +1 -1
- package/dist/core/reconciliation/errors/ReactError.d.ts +15 -0
- package/dist/core/reconciliation/errors/ReactError.d.ts.map +1 -0
- package/dist/core/reconciliation/errors/ReactError.js +56 -0
- package/dist/core/reconciliation/errors/ReactError.js.map +1 -0
- package/dist/core/reconciliation/errors/stack.d.ts +8 -2
- package/dist/core/reconciliation/errors/stack.d.ts.map +1 -1
- package/dist/core/reconciliation/errors/stack.js +65 -8
- package/dist/core/reconciliation/errors/stack.js.map +1 -1
- package/dist/core/reconciliation/fibers.d.ts +1 -0
- package/dist/core/reconciliation/fibers.d.ts.map +1 -1
- package/dist/core/reconciliation/fibers.js +3 -2
- package/dist/core/reconciliation/fibers.js.map +1 -1
- package/dist/core/reconciliation/heap.d.ts +18 -0
- package/dist/core/reconciliation/heap.d.ts.map +1 -0
- package/dist/core/reconciliation/heap.js +81 -0
- package/dist/core/reconciliation/heap.js.map +1 -0
- package/dist/core/reconciliation/invalidateFiber.d.ts.map +1 -1
- package/dist/core/reconciliation/invalidateFiber.js +6 -5
- package/dist/core/reconciliation/invalidateFiber.js.map +1 -1
- package/dist/core/reconciliation/mount.d.ts.map +1 -1
- package/dist/core/reconciliation/mount.js +24 -6
- package/dist/core/reconciliation/mount.js.map +1 -1
- package/dist/core/reconciliation/postCommit.d.ts +1 -1
- package/dist/core/reconciliation/postCommit.d.ts.map +1 -1
- package/dist/core/reconciliation/postCommit.js +17 -4
- package/dist/core/reconciliation/postCommit.js.map +1 -1
- package/dist/core/reconciliation/queue.d.ts +21 -0
- package/dist/core/reconciliation/queue.d.ts.map +1 -0
- package/dist/core/reconciliation/queue.js +55 -0
- package/dist/core/reconciliation/queue.js.map +1 -0
- package/dist/core/reconciliation/render.d.ts.map +1 -1
- package/dist/core/reconciliation/render.js +9 -3
- package/dist/core/reconciliation/render.js.map +1 -1
- package/dist/core/reconciliation/runFiberComponents.d.ts +3 -1
- package/dist/core/reconciliation/runFiberComponents.d.ts.map +1 -1
- package/dist/core/reconciliation/runFiberComponents.js +33 -5
- package/dist/core/reconciliation/runFiberComponents.js.map +1 -1
- package/dist/core/reconciliation/typeGuards.d.ts +3 -0
- package/dist/core/reconciliation/typeGuards.d.ts.map +1 -1
- package/dist/core/reconciliation/typeGuards.js +13 -0
- package/dist/core/reconciliation/typeGuards.js.map +1 -1
- package/dist/core/reconciliation/validateApp.d.ts +1 -1
- package/dist/core/reconciliation/validateApp.d.ts.map +1 -1
- package/dist/core/reconciliation/validateApp.js +28 -21
- package/dist/core/reconciliation/validateApp.js.map +1 -1
- package/dist/hooks/helpers.d.ts +3 -3
- package/dist/hooks/helpers.d.ts.map +1 -1
- package/dist/hooks/helpers.js +3 -2
- package/dist/hooks/helpers.js.map +1 -1
- package/dist/hooks/index.d.ts +2 -1
- package/dist/hooks/index.d.ts.map +1 -1
- package/dist/hooks/index.js +2 -1
- package/dist/hooks/index.js.map +1 -1
- package/dist/hooks/useContext.d.ts.map +1 -1
- package/dist/hooks/useContext.js +6 -6
- package/dist/hooks/useContext.js.map +1 -1
- package/dist/hooks/useEffect.d.ts +2 -1
- package/dist/hooks/useEffect.d.ts.map +1 -1
- package/dist/hooks/useEffect.js +21 -7
- package/dist/hooks/useEffect.js.map +1 -1
- package/dist/hooks/useError.d.ts +5 -0
- package/dist/hooks/useError.d.ts.map +1 -0
- package/dist/hooks/useError.js +19 -0
- package/dist/hooks/useError.js.map +1 -0
- package/dist/hooks/useReducer.d.ts +7 -0
- package/dist/hooks/useReducer.d.ts.map +1 -0
- package/dist/hooks/useReducer.js +10 -0
- package/dist/hooks/useReducer.js.map +1 -0
- package/dist/hooks/useRef.d.ts +8 -3
- package/dist/hooks/useRef.d.ts.map +1 -1
- package/dist/hooks/useRef.js +27 -0
- package/dist/hooks/useRef.js.map +1 -1
- package/dist/hooks/useState.d.ts +1 -1
- package/dist/hooks/useState.d.ts.map +1 -1
- package/dist/hooks/useState.js +3 -6
- package/dist/hooks/useState.js.map +1 -1
- package/dist/index.d.ts +3 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -0
- package/dist/index.js.map +1 -1
- package/dist/jsx.d.ts +159 -44
- package/dist/mocks.d.ts +0 -7
- package/dist/mocks.d.ts.map +1 -1
- package/dist/mocks.js +0 -6
- package/dist/mocks.js.map +1 -1
- package/dist/react.d.ts +46 -0
- package/dist/types/actions.d.ts +23 -5
- package/dist/types/actions.d.ts.map +1 -1
- package/dist/types/app.d.ts +17 -3
- package/dist/types/app.d.ts.map +1 -1
- package/dist/types/attributes.d.ts +42 -0
- package/dist/types/attributes.d.ts.map +1 -0
- package/dist/types/attributes.js +2 -0
- package/dist/types/attributes.js.map +1 -0
- package/dist/types/common.d.ts +10 -1
- package/dist/types/common.d.ts.map +1 -1
- package/dist/types/component.d.ts +11 -2
- package/dist/types/component.d.ts.map +1 -1
- package/dist/types/context.d.ts +3 -2
- package/dist/types/context.d.ts.map +1 -1
- package/dist/types/core.d.ts +17 -13
- package/dist/types/core.d.ts.map +1 -1
- package/dist/types/dom.d.ts +23 -22
- package/dist/types/dom.d.ts.map +1 -1
- package/dist/types/events.d.ts +18 -11
- package/dist/types/events.d.ts.map +1 -1
- package/dist/types/fiber.d.ts +30 -12
- package/dist/types/fiber.d.ts.map +1 -1
- package/dist/types/fiber.js +5 -1
- package/dist/types/fiber.js.map +1 -1
- package/dist/types/hooks.d.ts +16 -6
- package/dist/types/hooks.d.ts.map +1 -1
- package/dist/types/react.d.ts +31 -0
- package/dist/types/react.d.ts.map +1 -0
- package/dist/types/react.js +2 -0
- package/dist/types/react.js.map +1 -0
- package/dist/types/refs.d.ts +5 -8
- package/dist/types/refs.d.ts.map +1 -1
- package/package.json +11 -3
package/dist/jsx.d.ts
CHANGED
|
@@ -4,22 +4,27 @@ import {
|
|
|
4
4
|
type TagProps,
|
|
5
5
|
type SvgTagProps,
|
|
6
6
|
type SvgRootProps,
|
|
7
|
-
type ReactComponent,
|
|
8
|
-
type FC,
|
|
9
7
|
type ReactKey,
|
|
8
|
+
type ElementType as ET,
|
|
9
|
+
type FiberNode,
|
|
10
10
|
} from './types';
|
|
11
11
|
|
|
12
12
|
export {};
|
|
13
13
|
|
|
14
14
|
declare global {
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
15
|
+
interface Element {
|
|
16
|
+
__fiber?: FiberNode;
|
|
17
|
+
}
|
|
18
|
+
interface Text {
|
|
19
|
+
__fiber?: FiberNode;
|
|
20
|
+
}
|
|
21
|
+
interface Comment {
|
|
22
|
+
__fiber?: FiberNode;
|
|
19
23
|
}
|
|
20
24
|
|
|
21
25
|
namespace JSX {
|
|
22
26
|
type Element = JsxElement;
|
|
27
|
+
type ElementType = ET;
|
|
23
28
|
|
|
24
29
|
interface ElementClass extends Component<any, any> {
|
|
25
30
|
render: () => JSX.Element;
|
|
@@ -29,15 +34,31 @@ declare global {
|
|
|
29
34
|
key?: ReactKey | null;
|
|
30
35
|
}
|
|
31
36
|
|
|
37
|
+
// Determines the `children` props name.
|
|
38
|
+
// <div>… here …</div> (but not <div children={…}/>).
|
|
39
|
+
interface ElementChildrenAttribute {
|
|
40
|
+
children: {};
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
// To auto-detect props for class-based components via:
|
|
44
|
+
// class User { props: T /* <- this */ }
|
|
45
|
+
interface ElementAttributesProperty {
|
|
46
|
+
props: {};
|
|
47
|
+
}
|
|
48
|
+
|
|
32
49
|
type LibraryManagedAttributes<Component, Props> = Component extends {
|
|
33
50
|
defaultProps: infer Defaults;
|
|
34
51
|
}
|
|
35
|
-
? Partial<
|
|
36
|
-
|
|
52
|
+
? Defaults extends Partial<Props>
|
|
53
|
+
? Partial<Pick<Props, keyof Defaults & keyof Props>> &
|
|
54
|
+
Pick<Props, Exclude<keyof Props, keyof Defaults>>
|
|
55
|
+
: Props
|
|
37
56
|
: Props;
|
|
38
57
|
|
|
39
58
|
interface IntrinsicElements {
|
|
40
|
-
|
|
59
|
+
['x-fragment']: IntrinsicAttributes & { children: JSX.Element };
|
|
60
|
+
|
|
61
|
+
// HTML Elements
|
|
41
62
|
html: TagProps<HTMLHtmlElement>;
|
|
42
63
|
head: TagProps<HTMLHeadElement>;
|
|
43
64
|
body: TagProps<HTMLBodyElement>;
|
|
@@ -46,16 +67,13 @@ declare global {
|
|
|
46
67
|
link: TagProps<HTMLLinkElement>;
|
|
47
68
|
script: TagProps<HTMLScriptElement>;
|
|
48
69
|
style: TagProps<HTMLStyleElement>;
|
|
49
|
-
|
|
50
|
-
// Content sectioning
|
|
70
|
+
article: TagProps<HTMLElement>;
|
|
51
71
|
h1: TagProps<HTMLHeadingElement>;
|
|
52
72
|
h2: TagProps<HTMLHeadingElement>;
|
|
53
73
|
h3: TagProps<HTMLHeadingElement>;
|
|
54
74
|
h4: TagProps<HTMLHeadingElement>;
|
|
55
75
|
h5: TagProps<HTMLHeadingElement>;
|
|
56
76
|
h6: TagProps<HTMLHeadingElement>;
|
|
57
|
-
|
|
58
|
-
// Text content
|
|
59
77
|
div: TagProps<HTMLDivElement>;
|
|
60
78
|
p: TagProps<HTMLParagraphElement>;
|
|
61
79
|
span: TagProps<HTMLSpanElement>;
|
|
@@ -65,29 +83,26 @@ declare global {
|
|
|
65
83
|
ol: TagProps<HTMLOListElement>;
|
|
66
84
|
li: TagProps<HTMLLIElement>;
|
|
67
85
|
dl: TagProps<HTMLDListElement>;
|
|
86
|
+
dt: TagProps<HTMLElement>;
|
|
87
|
+
dd: TagProps<HTMLElement>;
|
|
68
88
|
hr: TagProps<HTMLHRElement>;
|
|
69
89
|
br: TagProps<HTMLBRElement>;
|
|
70
|
-
|
|
71
|
-
|
|
90
|
+
em: TagProps<HTMLElement>;
|
|
91
|
+
i: TagProps<HTMLElement>;
|
|
92
|
+
b: TagProps<HTMLElement>;
|
|
72
93
|
a: TagProps<HTMLAnchorElement>;
|
|
73
94
|
q: TagProps<HTMLQuoteElement>;
|
|
74
95
|
time: TagProps<HTMLTimeElement>;
|
|
75
|
-
|
|
76
|
-
// Image and multimedia
|
|
77
96
|
img: TagProps<HTMLImageElement>;
|
|
78
97
|
video: TagProps<HTMLVideoElement>;
|
|
79
98
|
audio: TagProps<HTMLAudioElement>;
|
|
80
99
|
source: TagProps<HTMLSourceElement>;
|
|
81
100
|
track: TagProps<HTMLTrackElement>;
|
|
82
101
|
canvas: TagProps<HTMLCanvasElement>;
|
|
83
|
-
|
|
84
|
-
// Embedded content
|
|
85
102
|
iframe: TagProps<HTMLIFrameElement>;
|
|
86
103
|
embed: TagProps<HTMLEmbedElement>;
|
|
87
104
|
object: TagProps<HTMLObjectElement>;
|
|
88
105
|
param: TagProps<HTMLParamElement>;
|
|
89
|
-
|
|
90
|
-
// Forms
|
|
91
106
|
form: TagProps<HTMLFormElement>;
|
|
92
107
|
input: TagProps<HTMLInputElement>;
|
|
93
108
|
button: TagProps<HTMLButtonElement>;
|
|
@@ -102,13 +117,9 @@ declare global {
|
|
|
102
117
|
output: TagProps<HTMLOutputElement>;
|
|
103
118
|
progress: TagProps<HTMLProgressElement>;
|
|
104
119
|
meter: TagProps<HTMLMeterElement>;
|
|
105
|
-
|
|
106
|
-
// Interactive elements
|
|
107
120
|
details: TagProps<HTMLDetailsElement>;
|
|
108
121
|
summary: TagProps<HTMLElement>;
|
|
109
122
|
dialog: TagProps<HTMLDialogElement>;
|
|
110
|
-
|
|
111
|
-
// Tables
|
|
112
123
|
table: TagProps<HTMLTableElement>;
|
|
113
124
|
thead: TagProps<HTMLTableSectionElement>;
|
|
114
125
|
tbody: TagProps<HTMLTableSectionElement>;
|
|
@@ -119,28 +130,132 @@ declare global {
|
|
|
119
130
|
caption: TagProps<HTMLTableCaptionElement>;
|
|
120
131
|
colgroup: TagProps<HTMLTableColElement>;
|
|
121
132
|
col: TagProps<HTMLTableColElement>;
|
|
133
|
+
area: TagProps<HTMLAreaElement>;
|
|
134
|
+
base: TagProps<HTMLBaseElement>;
|
|
135
|
+
data: TagProps<HTMLDataElement>;
|
|
136
|
+
menu: TagProps<HTMLMenuElement>;
|
|
137
|
+
picture: TagProps<HTMLPictureElement>;
|
|
138
|
+
slot: TagProps<HTMLSlotElement>;
|
|
139
|
+
template: TagProps<HTMLTemplateElement>;
|
|
140
|
+
font: TagProps<HTMLFontElement>;
|
|
141
|
+
frame: TagProps<HTMLFrameElement>;
|
|
142
|
+
marquee: TagProps<HTMLMarqueeElement>;
|
|
143
|
+
map: TagProps<HTMLMapElement>;
|
|
144
|
+
del: TagProps<HTMLModElement>;
|
|
145
|
+
ins: TagProps<HTMLModElement>;
|
|
146
|
+
dir: TagProps<HTMLDirectoryElement>;
|
|
147
|
+
frameset: TagProps<HTMLFrameSetElement>;
|
|
148
|
+
// No custom DOM constructor:
|
|
149
|
+
abbr: TagProps<HTMLElement>;
|
|
150
|
+
acronym: TagProps<HTMLElement>;
|
|
151
|
+
address: TagProps<HTMLElement>;
|
|
152
|
+
aside: TagProps<HTMLElement>;
|
|
153
|
+
bdi: TagProps<HTMLElement>;
|
|
154
|
+
bdo: TagProps<HTMLElement>;
|
|
155
|
+
big: TagProps<HTMLElement>;
|
|
156
|
+
center: TagProps<HTMLElement>;
|
|
157
|
+
cite: TagProps<HTMLElement>;
|
|
158
|
+
code: TagProps<HTMLElement>;
|
|
159
|
+
dfn: TagProps<HTMLElement>;
|
|
160
|
+
fencedframe: TagProps<HTMLElement>;
|
|
161
|
+
figcaption: TagProps<HTMLElement>;
|
|
162
|
+
figure: TagProps<HTMLElement>;
|
|
163
|
+
footer: TagProps<HTMLElement>;
|
|
164
|
+
header: TagProps<HTMLElement>;
|
|
165
|
+
hgroup: TagProps<HTMLElement>;
|
|
166
|
+
type: TagProps<HTMLElement>;
|
|
167
|
+
kbd: TagProps<HTMLElement>;
|
|
168
|
+
main: TagProps<HTMLElement>;
|
|
169
|
+
mark: TagProps<HTMLElement>;
|
|
170
|
+
nav: TagProps<HTMLElement>;
|
|
171
|
+
nobr: TagProps<HTMLElement>;
|
|
172
|
+
noembed: TagProps<HTMLElement>;
|
|
173
|
+
noframes: TagProps<HTMLElement>;
|
|
174
|
+
noscript: TagProps<HTMLElement>;
|
|
175
|
+
plaintext: TagProps<HTMLElement>;
|
|
176
|
+
portal: TagProps<HTMLElement>;
|
|
177
|
+
rb: TagProps<HTMLElement>;
|
|
178
|
+
rp: TagProps<HTMLElement>;
|
|
179
|
+
rt: TagProps<HTMLElement>;
|
|
180
|
+
rtc: TagProps<HTMLElement>;
|
|
181
|
+
ruby: TagProps<HTMLElement>;
|
|
182
|
+
s: TagProps<HTMLElement>;
|
|
183
|
+
samp: TagProps<HTMLElement>;
|
|
184
|
+
search: TagProps<HTMLElement>;
|
|
185
|
+
section: TagProps<HTMLElement>;
|
|
186
|
+
small: TagProps<HTMLElement>;
|
|
187
|
+
strike: TagProps<HTMLElement>;
|
|
188
|
+
strong: TagProps<HTMLElement>;
|
|
189
|
+
sub: TagProps<HTMLElement>;
|
|
190
|
+
sup: TagProps<HTMLElement>;
|
|
191
|
+
tt: TagProps<HTMLElement>;
|
|
192
|
+
u: TagProps<HTMLElement>;
|
|
193
|
+
var: TagProps<HTMLElement>;
|
|
194
|
+
wbr: TagProps<HTMLElement>;
|
|
195
|
+
xmp: TagProps<HTMLElement>;
|
|
122
196
|
|
|
123
197
|
// SVG elements
|
|
124
198
|
svg: SvgRootProps;
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
text: SvgTagProps
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
199
|
+
polygon: SvgTagProps<SVGPolygonElement>;
|
|
200
|
+
circle: SvgTagProps<SVGCircleElement>;
|
|
201
|
+
clipPath: SvgTagProps<SVGClipPathElement>;
|
|
202
|
+
defs: SvgTagProps<SVGDefsElement>;
|
|
203
|
+
ellipse: SvgTagProps<SVGEllipseElement>;
|
|
204
|
+
g: SvgTagProps<SVGGElement>;
|
|
205
|
+
line: SvgTagProps<SVGLineElement>;
|
|
206
|
+
image: SvgTagProps<SVGImageElement>;
|
|
207
|
+
mask: SvgTagProps<SVGMaskElement>;
|
|
208
|
+
path: SvgTagProps<SVGPathElement>;
|
|
209
|
+
pattern: SvgTagProps<SVGPatternElement>;
|
|
210
|
+
polyline: SvgTagProps<SVGPolylineElement>;
|
|
211
|
+
rect: SvgTagProps<SVGRectElement>;
|
|
212
|
+
text: SvgTagProps<SVGTextElement>;
|
|
213
|
+
use: SvgTagProps<SVGUseElement>;
|
|
214
|
+
animate: SvgTagProps<SVGAnimateElement>;
|
|
215
|
+
animateMotion: SvgTagProps<SVGAnimateMotionElement>;
|
|
216
|
+
animateTransform: SvgTagProps<SVGAnimateTransformElement>;
|
|
217
|
+
set: SvgTagProps<SVGSetElement>;
|
|
218
|
+
desc: SvgTagProps<SVGDescElement>;
|
|
219
|
+
filter: SvgTagProps<SVGFilterElement>;
|
|
220
|
+
marker: SvgTagProps<SVGMarkerElement>;
|
|
221
|
+
foreignObject: SvgTagProps<SVGForeignObjectElement>;
|
|
222
|
+
linearGradient: SvgTagProps<SVGLinearGradientElement>;
|
|
223
|
+
radialGradient: SvgTagProps<SVGRadialGradientElement>;
|
|
224
|
+
gradient: SvgTagProps<SVGGradientElement>;
|
|
225
|
+
metadata: SvgTagProps<SVGMetadataElement>;
|
|
226
|
+
stop: SvgTagProps<SVGStopElement>;
|
|
227
|
+
switch: SvgTagProps<SVGSwitchElement>;
|
|
228
|
+
symbol: SvgTagProps<SVGSymbolElement>;
|
|
229
|
+
textPath: SvgTagProps<SVGTextPathElement>;
|
|
230
|
+
view: SvgTagProps<SVGViewElement>;
|
|
231
|
+
tspan: SvgTagProps<SVGTextContentElement>;
|
|
232
|
+
// No custom element
|
|
233
|
+
feBlend: SvgTagProps;
|
|
234
|
+
feColorMatrix: SvgTagProps;
|
|
235
|
+
feComponentTransfer: SvgTagProps;
|
|
236
|
+
feComposite: SvgTagProps;
|
|
237
|
+
feConvolveMatrix: SvgTagProps;
|
|
238
|
+
feDiffuseLighting: SvgTagProps;
|
|
239
|
+
feDisplacementMap: SvgTagProps;
|
|
240
|
+
feDistantLight: SvgTagProps;
|
|
241
|
+
feDropShadow: SvgTagProps;
|
|
242
|
+
feFlood: SvgTagProps;
|
|
243
|
+
feFuncA: SvgTagProps;
|
|
244
|
+
feFuncB: SvgTagProps;
|
|
245
|
+
feFuncG: SvgTagProps;
|
|
246
|
+
feFuncR: SvgTagProps;
|
|
247
|
+
feGaussianBlur: SvgTagProps;
|
|
248
|
+
feImage: SvgTagProps;
|
|
249
|
+
feMerge: SvgTagProps;
|
|
250
|
+
feMergeNode: SvgTagProps;
|
|
251
|
+
feMorphology: SvgTagProps;
|
|
252
|
+
feOffset: SvgTagProps;
|
|
253
|
+
fePointLight: SvgTagProps;
|
|
254
|
+
feSpecularLighting: SvgTagProps;
|
|
255
|
+
feSpotLight: SvgTagProps;
|
|
256
|
+
feTile: SvgTagProps;
|
|
257
|
+
feTurbulence: SvgTagProps;
|
|
258
|
+
mpath: SvgTagProps;
|
|
144
259
|
}
|
|
145
260
|
}
|
|
146
261
|
}
|
package/dist/mocks.d.ts
CHANGED
|
@@ -1,10 +1,3 @@
|
|
|
1
|
-
import type { ReactComponent, UnknownProps } from './types';
|
|
2
|
-
/**
|
|
3
|
-
* Currently a no-op that returns the component unchanged. In the future,
|
|
4
|
-
* ref forwarding won't be needed since refs will be passed as regular props
|
|
5
|
-
* to components.
|
|
6
|
-
*/
|
|
7
|
-
export declare const forwardRef: <T extends UnknownProps>(Component: ReactComponent<T>) => ReactComponent<T>;
|
|
8
1
|
/**
|
|
9
2
|
* Mock implementation of React's startTransition. This engine doesn't support
|
|
10
3
|
* concurrent features or update prioritization, so transitions are executed
|
package/dist/mocks.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"mocks.d.ts","sourceRoot":"","sources":["../src/mocks.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"mocks.d.ts","sourceRoot":"","sources":["../src/mocks.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,eAAO,MAAM,eAAe,0BAE3B,CAAC;AAEF;;;;;;;GAOG;AACH,eAAO,MAAM,SAAS,0BAErB,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,QAAQ,aAEpB,CAAC"}
|
package/dist/mocks.js
CHANGED
|
@@ -1,9 +1,3 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Currently a no-op that returns the component unchanged. In the future,
|
|
3
|
-
* ref forwarding won't be needed since refs will be passed as regular props
|
|
4
|
-
* to components.
|
|
5
|
-
*/
|
|
6
|
-
export const forwardRef = (Component) => Component;
|
|
7
1
|
/**
|
|
8
2
|
* Mock implementation of React's startTransition. This engine doesn't support
|
|
9
3
|
* concurrent features or update prioritization, so transitions are executed
|
package/dist/mocks.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"mocks.js","sourceRoot":"","sources":["../src/mocks.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"mocks.js","sourceRoot":"","sources":["../src/mocks.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,MAAM,CAAC,MAAM,eAAe,GAAG,CAAC,EAAc,EAAE,EAAE,CAAC;IACjD,EAAE,EAAE,CAAC;AAAA,CACN,CAAC;AAEF;;;;;;;GAOG;AACH,MAAM,CAAC,MAAM,SAAS,GAAG,CAAC,EAAc,EAAE,EAAE,CAAC;IAC3C,EAAE,EAAE,CAAC;AAAA,CACN,CAAC;AAEF;;;GAGG;AACH,MAAM,CAAC,MAAM,QAAQ,GAAG,GAAG,EAAE,CAAC;IAC5B,MAAM,IAAI,KAAK,CAAC,2BAA2B,CAAC,CAAC;AAAA,CAC9C,CAAC"}
|
package/dist/react.d.ts
ADDED
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import * as ns from './types/react';
|
|
2
|
+
import * as local from './types/index';
|
|
3
|
+
import { UnknownProps } from './types/index';
|
|
4
|
+
import type { FRAGMENT_TAG } from './core/reconciliation/fibers';
|
|
5
|
+
import type { Component, ComponentClass } from './core/classComponent';
|
|
6
|
+
|
|
7
|
+
export {};
|
|
8
|
+
|
|
9
|
+
declare global {
|
|
10
|
+
namespace React {
|
|
11
|
+
type FC<Props extends UnknownProps = UnknownProps> = ns.FC<Props>;
|
|
12
|
+
type ComponentType<Props extends UnknownProps = UnknownProps> =
|
|
13
|
+
| local.ReactComponent<Props>
|
|
14
|
+
| ComponentClass<Props, any>;
|
|
15
|
+
type ComponentProps<T> = local.ComponentProps<T>;
|
|
16
|
+
type ForwardRefExoticComponent<Props extends UnknownProps = UnknownProps> =
|
|
17
|
+
ns.ForwardRefExoticComponent<Props>;
|
|
18
|
+
type ErrorInfo = ns.ErrorInfo;
|
|
19
|
+
type ReactNode = ns.ReactNode;
|
|
20
|
+
type Context<T> = ns.Context<T>;
|
|
21
|
+
type CSSProperties = local.TagStyles;
|
|
22
|
+
|
|
23
|
+
// Attributes
|
|
24
|
+
type HTMLAttributes<T extends Element> = ns.HTMLAttributes<T>;
|
|
25
|
+
type TextareaHTMLAttributes<T extends Element> =
|
|
26
|
+
ns.TextareaHTMLAttributes<T>;
|
|
27
|
+
type InputHTMLAttributes<T extends Element> = ns.InputHTMLAttributes<T>;
|
|
28
|
+
type RefAttributes<T extends Element> = ns.RefAttributes<T>;
|
|
29
|
+
|
|
30
|
+
// Events
|
|
31
|
+
type SyntheticEvent<
|
|
32
|
+
T extends Element = Element,
|
|
33
|
+
E extends Event = Event,
|
|
34
|
+
> = ns.SyntheticEvent<T, E>;
|
|
35
|
+
type ClipboardEvent<T = Element> = ns.ClipboardEvent<T>;
|
|
36
|
+
type FormEvent<T extends Element = Element> = ns.FormEvent<T>;
|
|
37
|
+
type ChangeEvent<T extends Element = Element> = ns.ChangeEvent<T>;
|
|
38
|
+
type ChangeEventHandler<T extends Element = Element> =
|
|
39
|
+
ns.ChangeEventHandler<T>;
|
|
40
|
+
type KeyboardEvent<T extends Element = Element> = ns.KeyboardEvent<T>;
|
|
41
|
+
type ReactEventHandler<T extends Element = Element> =
|
|
42
|
+
ns.ReactEventHandler<T>;
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
const React: { Fragment: typeof FRAGMENT_TAG };
|
|
46
|
+
}
|
package/dist/types/actions.d.ts
CHANGED
|
@@ -1,12 +1,16 @@
|
|
|
1
|
+
import type { ReactError } from '../core/reconciliation/errors/ReactError';
|
|
1
2
|
import type { CommentMode, UnknownProps } from './core';
|
|
2
3
|
import type { TagAttrValue } from './dom';
|
|
3
4
|
import type { FiberMap, FiberNode } from './fiber';
|
|
4
|
-
import type {
|
|
5
|
+
import type { EffectMode } from './hooks';
|
|
6
|
+
import type { RefObject, RefSetter } from './refs';
|
|
5
7
|
type CommonAction = {
|
|
6
8
|
fiber: FiberNode;
|
|
7
9
|
};
|
|
8
|
-
type CreateTagAction = CommonAction & {
|
|
10
|
+
export type CreateTagAction = CommonAction & {
|
|
9
11
|
type: 'CreateTag';
|
|
12
|
+
attrs: null | Record<string, TagAttrValue>;
|
|
13
|
+
ref: SetRefAction['ref'];
|
|
10
14
|
};
|
|
11
15
|
type CreateTextAction = CommonAction & {
|
|
12
16
|
type: 'CreateText';
|
|
@@ -15,7 +19,10 @@ export type CreateCommentAction = CommonAction & {
|
|
|
15
19
|
type: 'CreateComment';
|
|
16
20
|
mode: CommentMode;
|
|
17
21
|
};
|
|
18
|
-
type
|
|
22
|
+
export type CreateContainer = CommonAction & {
|
|
23
|
+
type: 'CreateContainer';
|
|
24
|
+
};
|
|
25
|
+
type CreateAction = CreateTagAction | CreateTextAction | CreateCommentAction | CreateContainer;
|
|
19
26
|
export type SetTextAction = CommonAction & {
|
|
20
27
|
type: 'SetText';
|
|
21
28
|
text: string;
|
|
@@ -24,10 +31,11 @@ export type SetAttrAction = CommonAction & {
|
|
|
24
31
|
type: 'SetAttr';
|
|
25
32
|
name: string;
|
|
26
33
|
value: TagAttrValue;
|
|
34
|
+
creation?: boolean;
|
|
27
35
|
};
|
|
28
36
|
export type SetRefAction = CommonAction & {
|
|
29
37
|
type: 'SetRef';
|
|
30
|
-
ref:
|
|
38
|
+
ref: RefObject<unknown> | RefSetter<unknown> | null;
|
|
31
39
|
dontUnsetRef?: boolean;
|
|
32
40
|
};
|
|
33
41
|
export type SetPropsAction = CommonAction & {
|
|
@@ -38,6 +46,7 @@ type UpdateAction = SetTextAction | SetAttrAction | SetPropsAction | SetRefActio
|
|
|
38
46
|
export type RemoveAction = CommonAction & {
|
|
39
47
|
type: 'Remove';
|
|
40
48
|
immediate?: boolean;
|
|
49
|
+
last?: boolean;
|
|
41
50
|
};
|
|
42
51
|
export type RelayoutAction = CommonAction & {
|
|
43
52
|
type: 'Relayout';
|
|
@@ -49,6 +58,15 @@ export type ReplaceAction = CommonAction & {
|
|
|
49
58
|
newFiber: FiberNode;
|
|
50
59
|
};
|
|
51
60
|
type LayoutAction = RemoveAction | RelayoutAction | ReplaceAction;
|
|
52
|
-
export type
|
|
61
|
+
export type ScheduleEffectAction = CommonAction & {
|
|
62
|
+
type: 'ScheduleEffect';
|
|
63
|
+
fn: () => void;
|
|
64
|
+
mode: EffectMode;
|
|
65
|
+
};
|
|
66
|
+
export type CatchErrorAction = CommonAction & {
|
|
67
|
+
type: 'CatchError';
|
|
68
|
+
error: ReactError;
|
|
69
|
+
};
|
|
70
|
+
export type Action = CreateAction | UpdateAction | LayoutAction | ScheduleEffectAction | CatchErrorAction;
|
|
53
71
|
export {};
|
|
54
72
|
//# sourceMappingURL=actions.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"actions.d.ts","sourceRoot":"","sources":["../../src/types/actions.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,YAAY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AG;IAChD,IAAI,EAAE,gBAAgB,CAAC;IACvB,EAAE,EAAE,MAAM,IAAI,CAAC;IACf,IAAI,EAAE,UAAU,CAAC;CAClB,CAAC;AACF,MAAM,MAAM,gBAAgB,GAAG,YAAY,GAAG;IAC5C,IAAI,EAAE,YAAY,CAAC;IACnB,KAAK,EAAE,UAAU,CAAC;CACnB,CAAC;AAEF,MAAM,MAAM,MAAM,GACd,YAAY,GACZ,YAAY,GACZ,YAAY,GACZ,oBAAoB,GACpB,gBAAgB,CAAC"}
|
package/dist/types/app.d.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import type { FiberNode } from './fiber';
|
|
1
|
+
import type { FiberNode, JsxSource } from './fiber';
|
|
2
2
|
import type { EffectMode } from './hooks';
|
|
3
|
+
import type { Queue } from '../core/reconciliation/queue';
|
|
3
4
|
export type AppState =
|
|
4
5
|
/** Waiting for updates */
|
|
5
6
|
'idle'
|
|
@@ -52,11 +53,18 @@ export type App = {
|
|
|
52
53
|
/** The current stage of the app rendering cycle. */
|
|
53
54
|
state: AppState;
|
|
54
55
|
/** The lists of pending effect handlers. */
|
|
55
|
-
effects: Record<EffectMode, Array<
|
|
56
|
+
effects: Record<EffectMode, Array<{
|
|
57
|
+
fn: (fiber: FiberNode) => void;
|
|
58
|
+
fiber: FiberNode;
|
|
59
|
+
cancelled: boolean;
|
|
60
|
+
}>>;
|
|
56
61
|
/** The list of components to rerender. */
|
|
57
|
-
invalidatedComponents:
|
|
62
|
+
invalidatedComponents: Queue;
|
|
58
63
|
/** If `true`, extra validators are applied. */
|
|
59
64
|
testMode: boolean;
|
|
65
|
+
/** If given used to adjust JSX source to something else before adding them to
|
|
66
|
+
* a ReactError instance. */
|
|
67
|
+
transformSource?: (source: JsxSource) => JsxSource;
|
|
60
68
|
/**
|
|
61
69
|
* A special storage that contains invalidated context values. We need it to
|
|
62
70
|
* keep the "render" phase pure (so we don't update the existing fibers) and
|
|
@@ -71,6 +79,12 @@ export type AppOptions = {
|
|
|
71
79
|
* Warning: It slows down the app.
|
|
72
80
|
**/
|
|
73
81
|
testMode?: boolean;
|
|
82
|
+
/**
|
|
83
|
+
* Provide a converter that accounts for nuances of your development
|
|
84
|
+
* build. The purpose of this converter is to convert the file path from
|
|
85
|
+
* JSX into something that browser dev tools can properly handle.
|
|
86
|
+
*/
|
|
87
|
+
transformSource?: (source: JsxSource) => JsxSource;
|
|
74
88
|
};
|
|
75
89
|
export type AppRoot = {
|
|
76
90
|
render: (element: JSX.Element) => void;
|
package/dist/types/app.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"app.d.ts","sourceRoot":"","sources":["../../src/types/app.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,SAAS,CAAC;
|
|
1
|
+
{"version":3,"file":"app.d.ts","sourceRoot":"","sources":["../../src/types/app.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,SAAS,EAAE,MAAM,SAAS,CAAC;AACpD,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AAC1C,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,wCAAwC,CAAC;AAEpE,MAAM,MAAM,QAAQ;AAClB,0BAA0B;AACxB,MAAM;AACR;;;IAGI;GACF,WAAW;AACb;;;;;;;;GAQG;GACD,QAAQ;AACV;;;GAGG;GACD,QAAQ;AACV;;;GAGG;GACD,YAAY;AACd;;;;;GAKG;GACD,eAAe;AACjB;;;GAGG;GACD,SAAS;AACX;;GAEG;GACD,QAAQ,CAAC;AAEb,MAAM,MAAM,GAAG,GAAG;IAChB,yBAAyB;IACzB,EAAE,EAAE,MAAM,CAAC;IACX,iDAAiD;IACjD,IAAI,EAAE,SAAS,CAAC;IAChB,oDAAoD;IACpD,KAAK,EAAE,QAAQ,CAAC;IAChB,4CAA4C;IAC5C,OAAO,EAAE,MAAM,CACb,UAAU,EACV,KAAK,CAAC;QACJ,EAAE,EAAE,CAAC,KAAK,EAAE,SAAS,KAAK,IAAI,CAAC;QAC/B,KAAK,EAAE,SAAS,CAAC;QACjB,SAAS,EAAE,OAAO,CAAC;KACpB,CAAC,CACH,CAAC;IACF,0CAA0C;IAC1C,qBAAqB,EAAE,KAAK,CAAC;IAC7B,+CAA+C;IAC/C,QAAQ,EAAE,OAAO,CAAC;IAClB;gCAC4B;IAC5B,eAAe,CAAC,EAAE,CAAC,MAAM,EAAE,SAAS,KAAK,SAAS,CAAC;IACnD;;;;;OAKG;IACH,WAAW,EAAE,GAAG,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;CACnC,CAAC;AAEF,MAAM,MAAM,UAAU,GAAG;IACvB;;;QAGI;IACJ,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB;;;;OAIG;IACH,eAAe,CAAC,EAAE,CAAC,MAAM,EAAE,SAAS,KAAK,SAAS,CAAC;CACpD,CAAC;AAEF,MAAM,MAAM,OAAO,GAAG;IACpB,MAAM,EAAE,CAAC,OAAO,EAAE,GAAG,CAAC,OAAO,KAAK,IAAI,CAAC;IACvC,OAAO,EAAE,MAAM,IAAI,CAAC;CACrB,CAAC"}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import type { RemapKeys, RemoveIndexSignature } from './common';
|
|
2
|
+
import type { TagEventHandlers } from './events';
|
|
3
|
+
type ToCamel = {
|
|
4
|
+
autofocus: 'autoFocus';
|
|
5
|
+
autoplay: 'autoPlay';
|
|
6
|
+
autocomplete: 'autoComplete';
|
|
7
|
+
readonly: 'readOnly';
|
|
8
|
+
maxlength: 'maxLength';
|
|
9
|
+
minlength: 'minLength';
|
|
10
|
+
contenteditable: 'contentEditable';
|
|
11
|
+
spellcheck: 'spellCheck';
|
|
12
|
+
crossorigin: 'crossOrigin';
|
|
13
|
+
colspan: 'colSpan';
|
|
14
|
+
rowspan: 'rowSpan';
|
|
15
|
+
tabindex: 'tabIndex';
|
|
16
|
+
formaction: 'formAction';
|
|
17
|
+
formenctype: 'formEncType';
|
|
18
|
+
formmethod: 'formMethod';
|
|
19
|
+
formnovalidate: 'formNoValidate';
|
|
20
|
+
formtarget: 'formTarget';
|
|
21
|
+
inputmode: 'inputMode';
|
|
22
|
+
novalidate: 'noValidate';
|
|
23
|
+
fetchpriority: 'fetchPriority';
|
|
24
|
+
};
|
|
25
|
+
/**
|
|
26
|
+
* Each HTMLElement contains a ton of properties. Most of them shouldn't be used
|
|
27
|
+
* in JSX tag nodes. This type matches most inapplicable generic properties.
|
|
28
|
+
*/
|
|
29
|
+
type GeneralRemove = `DOCUMENT_${string}` | `${string}_NODE` | `client${string}` | `offset${string}` | `node${string}` | `inner${string}` | `scroll${string}` | `set${string}` | `outer${string}` | 'children' | 'attributes' | 'childNodes' | 'classList' | 'tagName' | 'style' | `key` | `dataset` | 'textContent' | 'shadowRoot';
|
|
30
|
+
type RemapAttrs<T> = RemapKeys<T, ToCamel>;
|
|
31
|
+
/**
|
|
32
|
+
* Returns a list of tag-based properties that can probably be set via a JSX tag
|
|
33
|
+
* node.
|
|
34
|
+
**/
|
|
35
|
+
type PropertiesOnly<T extends Element> = {
|
|
36
|
+
[K in keyof RemoveIndexSignature<T>]: K extends `on${string}` ? never : ChildNode extends T[K] ? never : Element extends T[K] ? never : HTMLElement extends T[K] ? never : K;
|
|
37
|
+
}[keyof RemoveIndexSignature<T>];
|
|
38
|
+
export type TagNativeProps<T extends Element> = {
|
|
39
|
+
className?: string;
|
|
40
|
+
} & RemapAttrs<Partial<Omit<Pick<T, PropertiesOnly<T>>, GeneralRemove>>> & TagEventHandlers<T>;
|
|
41
|
+
export {};
|
|
42
|
+
//# sourceMappingURL=attributes.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"attributes.d.ts","sourceRoot":"","sources":["../../src/types/attributes.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,oBAAoB,EAAE,MAAM,UAAU,CAAC;AAChE,OAAO,KAAK,E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B,CAAC,CAAC,CAAC,GAAG,CAAC,SAAS,KAAK,MAAM,EAAE,GACzD,KAAK,GACL,SAAS,SAAS,CAAC,CAAC,CAAC,CAAC,GACpB,KAAK,GACL,OAAO,SAAS,CAAC,CAAC,CAAC,CAAC,GAClB,KAAK,GACL,WAAW,SAAS,CAAC,CAAC,CAAC,CAAC,GACtB,KAAK,GACL,CAAC;CACZ,CAAC,MAAM,oBAAoB,CAAC,CAAC,CAAC,CAAC,CAAC;AAGjC,MAAM,MAAM,cAAc,CAAC,CAAC,SAAS,OAAO,IACxC;IAAE,SAAS,CAAC,EAAE,MAAM,CAAA;CAAE,GACtB,UAAU,CAAC,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,EAAE,cAAc,CAAC,CAAC,CAAC,CAAC,EAAE,aAAa,CAAC,CAAC,CAAC,GACpE,gBAAgB,CAAC,CAAC,CAAC,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"attributes.js","sourceRoot":"","sources":["../../src/types/attributes.ts"],"names":[],"mappings":""}
|
package/dist/types/common.d.ts
CHANGED
|
@@ -1,4 +1,13 @@
|
|
|
1
|
-
export type RemoveIndexSignature<T
|
|
1
|
+
export type RemoveIndexSignature<T> = {
|
|
2
2
|
[K in keyof T as string extends K ? never : number extends K ? never : typeof Symbol.iterator extends K ? never : K]: T[K];
|
|
3
3
|
};
|
|
4
|
+
export type RemapKeys<T, KeyMap extends Record<keyof any, keyof any>> = {
|
|
5
|
+
[K in keyof T as K extends keyof KeyMap ? KeyMap[K] : K]?: T[K];
|
|
6
|
+
};
|
|
7
|
+
export type Ensure<T, K extends keyof T> = Exclude<T, K> & {
|
|
8
|
+
[Key in K]: NonNullable<T[K]>;
|
|
9
|
+
};
|
|
10
|
+
export type ReplaceIn<T, M> = {
|
|
11
|
+
[K in keyof T]: K extends keyof M ? M[K] : T[K];
|
|
12
|
+
};
|
|
4
13
|
//# sourceMappingURL=common.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"common.d.ts","sourceRoot":"","sources":["../../src/types/common.ts"],"names":[],"mappings":"AAGA,MAAM,MAAM,oBAAoB,CAAC,CAAC,
|
|
1
|
+
{"version":3,"file":"common.d.ts","sourceRoot":"","sources":["../../src/types/common.ts"],"names":[],"mappings":"AAGA,MAAM,MAAM,oBAAoB,CAAC,CAAC,IAAI;KACnC,CAAC,IAAI,MAAM,CAAC,IAAI,MAAM,SAAS,CAAC,GAC7B,KAAK,GACL,MAAM,SAAS,CAAC,GACd,KAAK,GACL,OAAO,MAAM,CAAC,QAAQ,SAAS,CAAC,GAC9B,KAAK,GACL,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;CACjB,CAAC;AAEF,MAAM,MAAM,SAAS,CAAC,CAAC,EAAE,MAAM,SAAS,MAAM,CAAC,MAAM,GAAG,EAAE,MAAM,GAAG,CAAC,IAAI;KACrE,CAAC,IAAI,MAAM,CAAC,IAAI,CAAC,SAAS,MAAM,MAAM,GAAG,MAAM,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC;CAChE,CAAC;AAEF,MAAM,MAAM,MAAM,CAAC,CAAC,EAAE,CAAC,SAAS,MAAM,CAAC,IACnC,OAAO,CAAC,CAAC,EAAE,CAAC,CAAC,GACb;KAAG,GAAG,IAAI,CAAC,GAAG,WAAW,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;CAAE,CAAC;AAEtC,MAAM,MAAM,SAAS,CAAC,CAAC,EAAE,CAAC,IAAI;KAC3B,CAAC,IAAI,MAAM,CAAC,GAAG,CAAC,SAAS,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;CAChD,CAAC"}
|
|
@@ -1,12 +1,21 @@
|
|
|
1
|
+
import type { Action } from './actions';
|
|
1
2
|
import type { ElementCommonAttrs, UnknownProps } from './core';
|
|
2
3
|
import type { HookStore } from './hooks';
|
|
3
4
|
export type ComponentState = {
|
|
4
5
|
hooks: HookStore | null;
|
|
6
|
+
/** A temporary storage for actions that must be applied after the component's
|
|
7
|
+
* render. */
|
|
8
|
+
actions: Action[];
|
|
9
|
+
/** True when a component contains at least one useError handler. */
|
|
10
|
+
isErrorBoundary: boolean;
|
|
11
|
+
};
|
|
12
|
+
export type ReactComponent<TProps extends UnknownProps = UnknownProps> = {
|
|
13
|
+
(props: TProps & ElementCommonAttrs): JSX.Element;
|
|
14
|
+
displayName?: string;
|
|
5
15
|
};
|
|
6
|
-
export type ReactComponent<TProps extends UnknownProps = UnknownProps> = (props: TProps & ElementCommonAttrs) => JSX.Element;
|
|
7
16
|
export type PropsWithChildren<TProps extends UnknownProps = UnknownProps> = TProps & {
|
|
8
17
|
children?: JSX.Element;
|
|
9
18
|
};
|
|
10
19
|
export type ReactComponentWithChildren<TProps extends UnknownProps = UnknownProps> = ReactComponent<PropsWithChildren<TProps>>;
|
|
11
|
-
export type
|
|
20
|
+
export type ComponentProps<T> = T extends (props: infer Props) => JSX.Element ? Props : never;
|
|
12
21
|
//# sourceMappingURL=component.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"component.d.ts","sourceRoot":"","sources":["../../src/types/component.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,kBAAkB,EAAE,YAAY,EAAE,MAAM,QAAQ,CAAC;AAC/D,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,SAAS,CAAC;AAEzC,MAAM,MAAM,cAAc,GAAG;IAC3B,KAAK,EAAE,SAAS,GAAG,IAAI,CAA4B;
|
|
1
|
+
{"version":3,"file":"component.d.ts","sourceRoot":"","sources":["../../src/types/component.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,WAAW,CAAC;AACxC,OAAO,KAAK,EAAE,kBAAkB,EAAE,YAAY,EAAE,MAAM,QAAQ,CAAC;AAC/D,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,SAAS,CAAC;AAEzC,MAAM,MAAM,cAAc,GAAG;IAC3B,KAAK,EAAE,SAAS,GAAG,IAAI,CAA4B;IACnD;iBACa;IACb,OAAO,EAAE,MAAM,EAAE,CAAC;IAClB,oEAAoE;IACpE,eAAe,EAAE,OAAO,CAAC;CAC1B,CAAC;AAEF,MAAM,MAAM,cAAc,CAAC,MAAM,SAAS,YAAY,GAAG,YAAY,IAAI;IACvE,CAAC,KAAK,EAAE,MAAM,GAAG,kBAAkB,GAAG,GAAG,CAAC,OAAO,CAAC;IAClD,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB,CAAC;AAEF,MAAM,MAAM,iBAAiB,CAAC,MAAM,SAAS,YAAY,GAAG,YAAY,IACtE,MAAM,GAAG;IAAE,QAAQ,CAAC,EAAE,GAAG,CAAC,OAAO,CAAA;CAAE,CAAC;AAEtC,MAAM,MAAM,0BAA0B,CACpC,MAAM,SAAS,YAAY,GAAG,YAAY,IACxC,cAAc,CAAC,iBAAiB,CAAC,MAAM,CAAC,CAAC,CAAC;AAE9C,MAAM,MAAM,cAAc,CAAC,CAAC,IAAI,CAAC,SAAS,CAAC,KAAK,EAAE,MAAM,KAAK,KAAK,GAAG,CAAC,OAAO,GACzE,KAAK,GACL,KAAK,CAAC"}
|
package/dist/types/context.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { ReactComponent } from './component';
|
|
2
|
-
import type {
|
|
2
|
+
import type { ComponentFiberNode } from './fiber';
|
|
3
3
|
export type ReactContextProvider<T = unknown> = ReactComponent<{
|
|
4
4
|
children: JSX.Element;
|
|
5
5
|
value: T;
|
|
@@ -19,10 +19,11 @@ export type ReactContext<T = unknown> = {
|
|
|
19
19
|
*/
|
|
20
20
|
__id: number;
|
|
21
21
|
__default: T;
|
|
22
|
+
displayName?: string;
|
|
22
23
|
};
|
|
23
24
|
/** `.data` of the `ContextFiberNode` */
|
|
24
25
|
export type ContextState<T = unknown> = {
|
|
25
26
|
ctx: ReactContext<T>;
|
|
26
|
-
consumers: Set<
|
|
27
|
+
consumers: Set<ComponentFiberNode>;
|
|
27
28
|
};
|
|
28
29
|
//# sourceMappingURL=context.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"context.d.ts","sourceRoot":"","sources":["../../src/types/context.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAClD,OAAO,KAAK,EAAE,
|
|
1
|
+
{"version":3,"file":"context.d.ts","sourceRoot":"","sources":["../../src/types/context.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAClD,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,SAAS,CAAC;AAElD,MAAM,MAAM,oBAAoB,CAAC,CAAC,GAAG,OAAO,IAIxC,cAAc,CAAC;IAAE,QAAQ,EAAE,GAAG,CAAC,OAAO,CAAC;IAAC,KAAK,EAAE,CAAC,CAAA;CAAE,CAAC,GACnD;IAAE,KAAK,EAAE,YAAY,CAAC,CAAC,CAAC,CAAA;CAAE,CAAC;AAE/B,MAAM,MAAM,oBAAoB,CAAC,CAAC,GAAG,OAAO,IAAI,cAAc,CAAC;IAC7D,QAAQ,EAAE,CAAC,KAAK,EAAE,CAAC,KAAK,GAAG,CAAC,OAAO,CAAC;CACrC,CAAC,CAAC;AAEH,MAAM,MAAM,YAAY,CAAC,CAAC,GAAG,OAAO,IAAI;IACtC,QAAQ,EAAE,oBAAoB,CAAC,CAAC,CAAC,CAAC;IAClC,QAAQ,EAAE,oBAAoB,CAAC,CAAC,CAAC,CAAC;IAClC;;;;OAIG;IACH,IAAI,EAAE,MAAM,CAAC;IACb,SAAS,EAAE,CAAC,CAAC;IACb,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB,CAAC;AAEF,wCAAwC;AACxC,MAAM,MAAM,YAAY,CAAC,CAAC,GAAG,OAAO,IAAI;IACtC,GAAG,EAAE,YAAY,CAAC,CAAC,CAAC,CAAC;IACrB,SAAS,EAAE,GAAG,CAAC,kBAAkB,CAAC,CAAC;CACpC,CAAC"}
|