@tamagui/dom 0.0.0-bootstrap.0 → 3.0.0-beta.643.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/dist/cjs/events.cjs +17 -0
- package/dist/cjs/events.native.cjs +19 -0
- package/dist/cjs/events.native.js +21 -0
- package/dist/cjs/events.native.js.map +1 -0
- package/dist/cjs/index.cjs +26 -0
- package/dist/cjs/index.native.cjs +28 -0
- package/dist/cjs/index.native.js +30 -0
- package/dist/cjs/index.native.js.map +1 -0
- package/dist/cjs/props.cjs +17 -0
- package/dist/cjs/props.native.cjs +19 -0
- package/dist/cjs/props.native.js +21 -0
- package/dist/cjs/props.native.js.map +1 -0
- package/dist/cjs/tables/attributes.cjs +850 -0
- package/dist/cjs/tables/attributes.native.cjs +862 -0
- package/dist/cjs/tables/attributes.native.js +864 -0
- package/dist/cjs/tables/attributes.native.js.map +1 -0
- package/dist/cjs/tables/compatibility.cjs +338 -0
- package/dist/cjs/tables/compatibility.native.cjs +340 -0
- package/dist/cjs/tables/compatibility.native.js +342 -0
- package/dist/cjs/tables/compatibility.native.js.map +1 -0
- package/dist/cjs/tables/events.cjs +169 -0
- package/dist/cjs/tables/events.native.cjs +175 -0
- package/dist/cjs/tables/events.native.js +177 -0
- package/dist/cjs/tables/events.native.js.map +1 -0
- package/dist/cjs/tables/nativeBacking.cjs +133 -0
- package/dist/cjs/tables/nativeBacking.native.cjs +135 -0
- package/dist/cjs/tables/nativeBacking.native.js +137 -0
- package/dist/cjs/tables/nativeBacking.native.js.map +1 -0
- package/dist/cjs/tables/tags.cjs +576 -0
- package/dist/cjs/tables/tags.native.cjs +578 -0
- package/dist/cjs/tables/tags.native.js +580 -0
- package/dist/cjs/tables/tags.native.js.map +1 -0
- package/dist/cjs/tables/types.cjs +17 -0
- package/dist/cjs/tables/types.native.cjs +19 -0
- package/dist/cjs/tables/types.native.js +21 -0
- package/dist/cjs/tables/types.native.js.map +1 -0
- package/dist/esm/events.mjs +0 -0
- package/dist/esm/events.native.js +0 -0
- package/dist/esm/index.mjs +15 -0
- package/dist/esm/index.native.js +15 -0
- package/dist/esm/props.mjs +0 -0
- package/dist/esm/props.native.js +0 -0
- package/dist/esm/tables/attributes.mjs +821 -0
- package/dist/esm/tables/attributes.mjs.map +1 -0
- package/dist/esm/tables/attributes.native.js +831 -0
- package/dist/esm/tables/attributes.native.js.map +1 -0
- package/dist/esm/tables/compatibility.mjs +314 -0
- package/dist/esm/tables/compatibility.mjs.map +1 -0
- package/dist/esm/tables/compatibility.native.js +314 -0
- package/dist/esm/tables/compatibility.native.js.map +1 -0
- package/dist/esm/tables/events.mjs +145 -0
- package/dist/esm/tables/events.mjs.map +1 -0
- package/dist/esm/tables/events.native.js +149 -0
- package/dist/esm/tables/events.native.js.map +1 -0
- package/dist/esm/tables/nativeBacking.mjs +106 -0
- package/dist/esm/tables/nativeBacking.mjs.map +1 -0
- package/dist/esm/tables/nativeBacking.native.js +106 -0
- package/dist/esm/tables/nativeBacking.native.js.map +1 -0
- package/dist/esm/tables/tags.mjs +550 -0
- package/dist/esm/tables/tags.mjs.map +1 -0
- package/dist/esm/tables/tags.native.js +550 -0
- package/dist/esm/tables/tags.native.js.map +1 -0
- package/dist/esm/tables/types.mjs +0 -0
- package/dist/esm/tables/types.native.js +0 -0
- package/package.json +57 -7
- package/src/events.ts +58 -0
- package/src/index.ts +19 -0
- package/src/props.ts +699 -0
- package/src/tables/attributes.ts +863 -0
- package/src/tables/compatibility.ts +360 -0
- package/src/tables/events.ts +176 -0
- package/src/tables/nativeBacking.ts +132 -0
- package/src/tables/tags.ts +557 -0
- package/src/tables/types.ts +202 -0
- package/types/events.d.ts +58 -0
- package/types/events.d.ts.map +11 -0
- package/types/index.d.ts +20 -0
- package/types/index.d.ts.map +11 -0
- package/types/props.d.ts +499 -0
- package/types/props.d.ts.map +11 -0
- package/types/tables/attributes.d.ts +21 -0
- package/types/tables/attributes.d.ts.map +11 -0
- package/types/tables/compatibility.d.ts +28 -0
- package/types/tables/compatibility.d.ts.map +11 -0
- package/types/tables/events.d.ts +5 -0
- package/types/tables/events.d.ts.map +11 -0
- package/types/tables/nativeBacking.d.ts +28 -0
- package/types/tables/nativeBacking.d.ts.map +11 -0
- package/types/tables/tags.d.ts +36 -0
- package/types/tables/tags.d.ts.map +11 -0
- package/types/tables/types.d.ts +135 -0
- package/types/tables/types.d.ts.map +11 -0
- package/README.md +0 -1
package/src/events.ts
ADDED
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Event payloads for the Tamagui DOM contract.
|
|
3
|
+
*
|
|
4
|
+
* Only the cross-platform subset is typed. Where an event's shape genuinely
|
|
5
|
+
* differs between a browser event and a react native synthetic event, the
|
|
6
|
+
* handler takes `unknown` rather than promising a shape one platform cannot
|
|
7
|
+
* deliver — `payload: 'unknown'` in the event table. These are the payloads a
|
|
8
|
+
* native primitive can construct in full, so a handler written against them
|
|
9
|
+
* behaves the same on both platforms.
|
|
10
|
+
*
|
|
11
|
+
* Extra platform fields are not excluded: a handler receives a value, and
|
|
12
|
+
* TypeScript only seals object literals, so reading a web-only field off the
|
|
13
|
+
* event still needs a cast and still says so at the call site.
|
|
14
|
+
*/
|
|
15
|
+
|
|
16
|
+
export type DOMClickEvent = {
|
|
17
|
+
readonly altKey: boolean
|
|
18
|
+
readonly button: number
|
|
19
|
+
readonly ctrlKey: boolean
|
|
20
|
+
readonly defaultPrevented: boolean
|
|
21
|
+
readonly getModifierState: (key: string) => boolean
|
|
22
|
+
readonly metaKey: boolean
|
|
23
|
+
readonly pageX: number
|
|
24
|
+
readonly pageY: number
|
|
25
|
+
/** @platform web — native has nothing to cancel, so this is a no-op there */
|
|
26
|
+
readonly preventDefault: () => void
|
|
27
|
+
readonly shiftKey: boolean
|
|
28
|
+
/** @platform web — native has nothing to cancel, so this is a no-op there */
|
|
29
|
+
readonly stopPropagation: () => void
|
|
30
|
+
readonly type: 'click'
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
export type DOMKeyEvent = {
|
|
34
|
+
readonly key: string
|
|
35
|
+
readonly type?: string
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
export type DOMChangeEvent = {
|
|
39
|
+
readonly target: { readonly value: string }
|
|
40
|
+
readonly type: 'change'
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
export type DOMInputEvent = {
|
|
44
|
+
readonly target: { readonly value: string }
|
|
45
|
+
readonly type: 'input'
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
export type DOMImageLoadEvent = {
|
|
49
|
+
readonly target: {
|
|
50
|
+
readonly naturalHeight?: number
|
|
51
|
+
readonly naturalWidth?: number
|
|
52
|
+
}
|
|
53
|
+
readonly type: 'load'
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
export type DOMImageErrorEvent = {
|
|
57
|
+
readonly type: 'error'
|
|
58
|
+
}
|
package/src/index.ts
ADDED
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `@tamagui/dom` — the Tamagui DOM contract.
|
|
3
|
+
*
|
|
4
|
+
* The tables here are the single source of truth for DOM mode: the compiler
|
|
5
|
+
* reads them to classify tags, validate props and nesting and inject native
|
|
6
|
+
* primitives, the runtime reads them for element defaults and native prop
|
|
7
|
+
* mapping, and the prop-interface generator reads them to emit the strict
|
|
8
|
+
* types. React Strict DOM is the semantic reference and conformance oracle
|
|
9
|
+
* (see `compatibility.ts`), never a dependency.
|
|
10
|
+
*/
|
|
11
|
+
|
|
12
|
+
export * from './events'
|
|
13
|
+
export * from './props'
|
|
14
|
+
export * from './tables/attributes'
|
|
15
|
+
export * from './tables/compatibility'
|
|
16
|
+
export * from './tables/events'
|
|
17
|
+
export * from './tables/nativeBacking'
|
|
18
|
+
export * from './tables/tags'
|
|
19
|
+
export * from './tables/types'
|