@tamagui/core 1.74.8 → 1.74.10
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/getBaseViews.native.js +2 -1
- package/dist/cjs/getBaseViews.native.js.map +1 -1
- package/dist/cjs/index.js +16 -1
- package/dist/cjs/index.js.map +2 -2
- package/dist/cjs/index.native.js +30 -7
- package/dist/cjs/index.native.js.map +2 -2
- package/dist/esm/getBaseViews.native.js +2 -1
- package/dist/esm/getBaseViews.native.js.map +1 -1
- package/dist/esm/index.js +16 -1
- package/dist/esm/index.js.map +2 -2
- package/dist/esm/index.native.js +30 -7
- package/dist/esm/index.native.js.map +2 -2
- package/dist/native.js +12 -11
- package/dist/native.js.map +1 -1
- package/dist/test.native.js +12 -11
- package/dist/test.native.js.map +1 -1
- package/package.json +6 -6
- package/src/getBaseViews.native.ts +1 -0
- package/src/{index.ts → index.tsx} +49 -18
- package/types/getBaseViews.native.d.ts +1 -0
- package/types/getBaseViews.native.d.ts.map +1 -1
- package/types/index.d.ts.map +1 -1
- package/dist/cjs/native.js +0 -20
- package/dist/cjs/native.js.map +0 -6
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tamagui/core",
|
|
3
|
-
"version": "1.74.
|
|
3
|
+
"version": "1.74.10",
|
|
4
4
|
"source": "src/index.ts",
|
|
5
5
|
"main": "dist/cjs",
|
|
6
6
|
"module": "dist/esm",
|
|
@@ -36,16 +36,16 @@
|
|
|
36
36
|
"native-test.d.ts"
|
|
37
37
|
],
|
|
38
38
|
"dependencies": {
|
|
39
|
-
"@tamagui/react-native-use-pressable": "1.74.
|
|
40
|
-
"@tamagui/react-native-use-responder-events": "1.74.
|
|
41
|
-
"@tamagui/use-event": "1.74.
|
|
42
|
-
"@tamagui/web": "1.74.
|
|
39
|
+
"@tamagui/react-native-use-pressable": "1.74.10",
|
|
40
|
+
"@tamagui/react-native-use-responder-events": "1.74.10",
|
|
41
|
+
"@tamagui/use-event": "1.74.10",
|
|
42
|
+
"@tamagui/web": "1.74.10"
|
|
43
43
|
},
|
|
44
44
|
"peerDependencies": {
|
|
45
45
|
"react": "*"
|
|
46
46
|
},
|
|
47
47
|
"devDependencies": {
|
|
48
|
-
"@tamagui/build": "1.74.
|
|
48
|
+
"@tamagui/build": "1.74.10",
|
|
49
49
|
"@testing-library/react": "^14.0.0",
|
|
50
50
|
"csstype": "^3.0.10",
|
|
51
51
|
"react": "^18.2.0",
|
|
@@ -20,7 +20,7 @@ import { getBaseViews } from './getBaseViews'
|
|
|
20
20
|
import { useElementLayout } from './hooks/useElementLayout'
|
|
21
21
|
import { usePlatformMethods } from './hooks/usePlatformMethods'
|
|
22
22
|
import { RNViewProps } from './reactNativeTypes'
|
|
23
|
-
import { usePressability } from './vendor/Pressability'
|
|
23
|
+
import { Pressability, usePressability } from './vendor/Pressability'
|
|
24
24
|
|
|
25
25
|
// re-exports all of @tamagui/web just adds hooks
|
|
26
26
|
export * from '@tamagui/web'
|
|
@@ -121,7 +121,7 @@ setupHooks({
|
|
|
121
121
|
return viewProps
|
|
122
122
|
},
|
|
123
123
|
|
|
124
|
-
useEvents(viewProps, events, { pseudos }, setStateShallow) {
|
|
124
|
+
useEvents(viewProps, events, { pseudos }, setStateShallow, staticConfig) {
|
|
125
125
|
if (process.env.TAMAGUI_TARGET === 'native') {
|
|
126
126
|
const attachFocus = !!pseudos?.focusStyle
|
|
127
127
|
if (attachFocus) {
|
|
@@ -133,28 +133,59 @@ setupHooks({
|
|
|
133
133
|
})
|
|
134
134
|
}
|
|
135
135
|
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
136
|
+
if (staticConfig.isInput) {
|
|
137
|
+
if (events) {
|
|
138
|
+
const { onPressIn, onPressOut, onPress } = events
|
|
139
|
+
const inputEvents = {
|
|
140
|
+
onPressIn,
|
|
141
|
+
onPressOut: onPressOut || onPress,
|
|
142
|
+
}
|
|
143
|
+
if (onPressOut && onPress) {
|
|
144
|
+
// only supports onPressIn and onPressOut so combine them
|
|
145
|
+
inputEvents.onPressOut = composeEventHandlers(onPress, onPressOut)
|
|
146
|
+
}
|
|
147
|
+
Object.assign(viewProps, inputEvents)
|
|
148
|
+
}
|
|
149
|
+
} else {
|
|
150
|
+
// use Pressability to get smooth unPress when you press + hold + move out
|
|
151
|
+
// only ever create once, use .configure() to update later
|
|
152
|
+
if (events && viewProps.hitSlop) {
|
|
153
|
+
events.hitSlop = viewProps.hitSlop
|
|
154
|
+
}
|
|
141
155
|
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
156
|
+
const pressability = usePressability(events || null)
|
|
157
|
+
|
|
158
|
+
if (events) {
|
|
159
|
+
if (events.onPress) {
|
|
160
|
+
for (const key in pressability) {
|
|
161
|
+
const og = viewProps[key]
|
|
162
|
+
const val = pressability[key]
|
|
163
|
+
viewProps[key] =
|
|
164
|
+
og && !dontComposePressabilityKeys[key]
|
|
165
|
+
? composeEventHandlers(og, val)
|
|
166
|
+
: val
|
|
167
|
+
}
|
|
153
168
|
}
|
|
154
169
|
}
|
|
155
170
|
}
|
|
156
171
|
}
|
|
157
172
|
},
|
|
173
|
+
|
|
174
|
+
// attempt at properly fixing RN input, but <Pressable><TextInput /> just doesnt work on RN
|
|
175
|
+
// useChildren(children, viewProps, events, staticConfig) {
|
|
176
|
+
// if (process.env.TAMAGUI_TARGET === 'native') {
|
|
177
|
+
// if (staticConfig.isInput && !staticConfig.isHOC) {
|
|
178
|
+
// const Pressable = getBaseViews().Pressable
|
|
179
|
+
// console.log(
|
|
180
|
+
// 'wrapping in pressable',
|
|
181
|
+
// events?.['onPressIn']?.toString(),
|
|
182
|
+
// viewProps['onPressIn']
|
|
183
|
+
// )
|
|
184
|
+
// // we need to wrap it in a view?
|
|
185
|
+
// return <Pressable {...events}>{children}</Pressable>
|
|
186
|
+
// }
|
|
187
|
+
// }
|
|
188
|
+
// },
|
|
158
189
|
})
|
|
159
190
|
|
|
160
191
|
const dontComposePressabilityKeys = {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getBaseViews.native.d.ts","sourceRoot":"","sources":["../src/getBaseViews.native.ts"],"names":[],"mappings":"AAAA,wBAAgB,YAAY
|
|
1
|
+
{"version":3,"file":"getBaseViews.native.d.ts","sourceRoot":"","sources":["../src/getBaseViews.native.ts"],"names":[],"mappings":"AAAA,wBAAgB,YAAY;;;;EAQ3B"}
|
package/types/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.tsx"],"names":[],"mappings":";AACA,OAAO,KAAK,EAGV,gBAAgB,EAChB,cAAc,EACd,kBAAkB,EAGnB,MAAM,cAAc,CAAA;AAYrB,OAAO,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAA;AAIhD,cAAc,cAAc,CAAA;AAG5B,cAAc,oBAAoB,CAAA;AAIlC,eAAO,MAAM,KAAK;;;;iOAIjB,CAAA;AAED,eAAO,MAAM,IAAI;;;;y6BAIhB,CAAA"}
|
package/dist/cjs/native.js
DELETED
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __defProp = Object.defineProperty;
|
|
3
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
-
var __copyProps = (to, from, except, desc) => {
|
|
7
|
-
if (from && typeof from == "object" || typeof from == "function")
|
|
8
|
-
for (let key of __getOwnPropNames(from))
|
|
9
|
-
!__hasOwnProp.call(to, key) && key !== except && __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
10
|
-
return to;
|
|
11
|
-
}, __reExport = (target, mod, secondTarget) => (__copyProps(target, mod, "default"), secondTarget && __copyProps(secondTarget, mod, "default"));
|
|
12
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: !0 }), mod);
|
|
13
|
-
var native_exports = {};
|
|
14
|
-
module.exports = __toCommonJS(native_exports);
|
|
15
|
-
__reExport(native_exports, require("./index"), module.exports);
|
|
16
|
-
// Annotate the CommonJS export names for ESM import in node:
|
|
17
|
-
0 && (module.exports = {
|
|
18
|
-
...require("./index")
|
|
19
|
-
});
|
|
20
|
-
//# sourceMappingURL=native.js.map
|