@tamagui/constants 2.2.0 → 2.3.0
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/index.cjs +2 -1
- package/dist/cjs/index.native.js +1 -0
- package/dist/cjs/index.native.js.map +1 -1
- package/dist/cjs/platformDriver.cjs +35 -0
- package/dist/cjs/platformDriver.native.js +38 -0
- package/dist/cjs/platformDriver.native.js.map +1 -0
- package/dist/esm/index.js +1 -0
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/index.mjs +1 -0
- package/dist/esm/index.mjs.map +1 -1
- package/dist/esm/index.native.js +1 -0
- package/dist/esm/index.native.js.map +1 -1
- package/dist/esm/platformDriver.mjs +9 -0
- package/dist/esm/platformDriver.mjs.map +1 -0
- package/dist/esm/platformDriver.native.js +9 -0
- package/dist/esm/platformDriver.native.js.map +1 -0
- package/package.json +2 -2
- package/src/index.ts +1 -0
- package/src/platformDriver.ts +41 -0
- package/types/index.d.ts +1 -0
- package/types/index.d.ts.map +2 -2
- package/types/platformDriver.d.ts +20 -0
- package/types/platformDriver.d.ts.map +11 -0
package/dist/cjs/index.cjs
CHANGED
|
@@ -17,4 +17,5 @@ var __toCommonJS = mod => __copyProps(__defProp({}, "__esModule", {
|
|
|
17
17
|
}), mod);
|
|
18
18
|
var index_exports = {};
|
|
19
19
|
module.exports = __toCommonJS(index_exports);
|
|
20
|
-
__reExport(index_exports, require("./constants.cjs"), module.exports);
|
|
20
|
+
__reExport(index_exports, require("./constants.cjs"), module.exports);
|
|
21
|
+
__reExport(index_exports, require("./platformDriver.cjs"), module.exports);
|
package/dist/cjs/index.native.js
CHANGED
|
@@ -20,4 +20,5 @@ var __toCommonJS = mod => __copyProps(__defProp({}, "__esModule", {
|
|
|
20
20
|
var index_exports = {};
|
|
21
21
|
module.exports = __toCommonJS(index_exports);
|
|
22
22
|
__reExport(index_exports, require("./constants.native.js"), module.exports);
|
|
23
|
+
__reExport(index_exports, require("./platformDriver.native.js"), module.exports);
|
|
23
24
|
//# sourceMappingURL=index.native.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["__toCommonJS","mod","__copyProps","__defProp","value","index_exports","module","exports"],"sources":["../../src/index.ts"],"sourcesContent":[null],"mappings":";;;;;;;;;;;;;;;;AAAA,IAAAA,YAAA,GAAAC,GAAA,IAAAC,WAAA,CAAAC,SAAA;EAAAC,KAAA;AAAA,IAAAH,GAAA;AAAA,IAAAI,aAAA;AAAAC,MAAA,CAAAC,OAAA,GAAAP,YAAc,CAAAK,aAAA","ignoreList":[]}
|
|
1
|
+
{"version":3,"names":["__toCommonJS","mod","__copyProps","__defProp","value","index_exports","module","exports","__reExport","require"],"sources":["../../src/index.ts"],"sourcesContent":[null],"mappings":";;;;;;;;;;;;;;;;AAAA,IAAAA,YAAA,GAAAC,GAAA,IAAAC,WAAA,CAAAC,SAAA;EAAAC,KAAA;AAAA,IAAAH,GAAA;AAAA,IAAAI,aAAA;AAAAC,MAAA,CAAAC,OAAA,GAAAP,YAAc,CAAAK,aAAA;AACdG,UAAA,CAAAH,aAAA,EAAcI,OAAA,2BAAAH,MADd,CAAAC,OAAA","ignoreList":[]}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
var __defProp = Object.defineProperty;
|
|
2
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
3
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
4
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
5
|
+
var __export = (target, all) => {
|
|
6
|
+
for (var name in all) __defProp(target, name, {
|
|
7
|
+
get: all[name],
|
|
8
|
+
enumerable: true
|
|
9
|
+
});
|
|
10
|
+
};
|
|
11
|
+
var __copyProps = (to, from, except, desc) => {
|
|
12
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
13
|
+
for (let key of __getOwnPropNames(from)) if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, {
|
|
14
|
+
get: () => from[key],
|
|
15
|
+
enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
|
|
16
|
+
});
|
|
17
|
+
}
|
|
18
|
+
return to;
|
|
19
|
+
};
|
|
20
|
+
var __toCommonJS = mod => __copyProps(__defProp({}, "__esModule", {
|
|
21
|
+
value: true
|
|
22
|
+
}), mod);
|
|
23
|
+
var platformDriver_exports = {};
|
|
24
|
+
__export(platformDriver_exports, {
|
|
25
|
+
getPlatformDriver: () => getPlatformDriver,
|
|
26
|
+
setupPlatformDriver: () => setupPlatformDriver
|
|
27
|
+
});
|
|
28
|
+
module.exports = __toCommonJS(platformDriver_exports);
|
|
29
|
+
let platformDriver = null;
|
|
30
|
+
function setupPlatformDriver(driver) {
|
|
31
|
+
platformDriver = driver;
|
|
32
|
+
}
|
|
33
|
+
function getPlatformDriver() {
|
|
34
|
+
return platformDriver;
|
|
35
|
+
}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var __defProp = Object.defineProperty;
|
|
4
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
7
|
+
var __export = (target, all) => {
|
|
8
|
+
for (var name in all) __defProp(target, name, {
|
|
9
|
+
get: all[name],
|
|
10
|
+
enumerable: true
|
|
11
|
+
});
|
|
12
|
+
};
|
|
13
|
+
var __copyProps = (to, from, except, desc) => {
|
|
14
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
15
|
+
for (let key of __getOwnPropNames(from)) if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, {
|
|
16
|
+
get: () => from[key],
|
|
17
|
+
enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
|
|
18
|
+
});
|
|
19
|
+
}
|
|
20
|
+
return to;
|
|
21
|
+
};
|
|
22
|
+
var __toCommonJS = mod => __copyProps(__defProp({}, "__esModule", {
|
|
23
|
+
value: true
|
|
24
|
+
}), mod);
|
|
25
|
+
var platformDriver_exports = {};
|
|
26
|
+
__export(platformDriver_exports, {
|
|
27
|
+
getPlatformDriver: () => getPlatformDriver,
|
|
28
|
+
setupPlatformDriver: () => setupPlatformDriver
|
|
29
|
+
});
|
|
30
|
+
module.exports = __toCommonJS(platformDriver_exports);
|
|
31
|
+
var platformDriver = null;
|
|
32
|
+
function setupPlatformDriver(driver) {
|
|
33
|
+
platformDriver = driver;
|
|
34
|
+
}
|
|
35
|
+
function getPlatformDriver() {
|
|
36
|
+
return platformDriver;
|
|
37
|
+
}
|
|
38
|
+
//# sourceMappingURL=platformDriver.native.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["__toCommonJS","mod","__copyProps","__defProp","value","platformDriver_exports","__export","getPlatformDriver","setupPlatformDriver","module","exports","platformDriver","driver"],"sources":["../../src/platformDriver.ts"],"sourcesContent":[null],"mappings":";;;;;;;;;;;;;;;;;;;;;AAAA,IAAAA,YAAA,GAAAC,GAAA,IAAAC,WAAA,CAAAC,SAAA;EAAAC,KAAA;AAAA,IAAAH,GAAA;AAAA,IAAAI,sBAAA;AAAAC,QAAA,CAAAD,sBAAA;EAAAE,iBAAA,EAAAA,CAAA,KAAAA,iBAAA;EAAAC,mBAAA,EAAAA,CAAA,KAAAA;AAAA;AA+BAC,MAAI,CAAAC,OAAA,GAAAV,YAAwC,CAAAK,sBAAA;AAGrC,IAAAM,cAAS;AACd,SAAAH,mBAAiBA,CAAAI,MAAA;EACnBD,cAAA,GAAAC,MAAA;AAEO;AACL,SAAOL,kBAAA;EACT,OAAAI,cAAA","ignoreList":[]}
|
package/dist/esm/index.js
CHANGED
package/dist/esm/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":[],"sources":["../../src/index.ts"],"sourcesContent":[null],"mappings":"AAAA,cAAc","ignoreList":[]}
|
|
1
|
+
{"version":3,"names":[],"sources":["../../src/index.ts"],"sourcesContent":[null],"mappings":"AAAA,cAAc;AACd,cAAc","ignoreList":[]}
|
package/dist/esm/index.mjs
CHANGED
package/dist/esm/index.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":[],"sources":["../../src/index.ts"],"sourcesContent":[null],"mappings":"AAAA,cAAc","ignoreList":[]}
|
|
1
|
+
{"version":3,"names":[],"sources":["../../src/index.ts"],"sourcesContent":[null],"mappings":"AAAA,cAAc;AACd,cAAc","ignoreList":[]}
|
package/dist/esm/index.native.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":[],"sources":["../../src/index.ts"],"sourcesContent":[null],"mappings":"AAAA,cAAc","ignoreList":[]}
|
|
1
|
+
{"version":3,"names":[],"sources":["../../src/index.ts"],"sourcesContent":[null],"mappings":"AAAA,cAAc;AACd,cAAc","ignoreList":[]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["platformDriver","setupPlatformDriver","driver","getPlatformDriver"],"sources":["../../src/platformDriver.ts"],"sourcesContent":[null],"mappings":"AA+BA,IAAIA,cAAA,GAAwC;AAGrC,SAASC,oBAAoBC,MAAA,EAA8B;EAChEF,cAAA,GAAiBE,MAAA;AACnB;AAEO,SAASC,kBAAA,EAA2C;EACzD,OAAOH,cAAA;AACT","ignoreList":[]}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
var platformDriver = null;
|
|
2
|
+
function setupPlatformDriver(driver) {
|
|
3
|
+
platformDriver = driver;
|
|
4
|
+
}
|
|
5
|
+
function getPlatformDriver() {
|
|
6
|
+
return platformDriver;
|
|
7
|
+
}
|
|
8
|
+
export { getPlatformDriver, setupPlatformDriver };
|
|
9
|
+
//# sourceMappingURL=platformDriver.native.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["platformDriver","setupPlatformDriver","driver","getPlatformDriver"],"sources":["../../src/platformDriver.ts"],"sourcesContent":[null],"mappings":"AA+BA,IAAIA,cAAA,GAAwC;AAGrC,SAASC,oBAAoBC,MAAA,EAA8B;EAChEF,cAAA,GAAiBE,MAAA;AACnB;AAEO,SAASC,kBAAA,EAA2C;EACzD,OAAOH,cAAA;AACT","ignoreList":[]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tamagui/constants",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.3.0",
|
|
4
4
|
"gitHead": "a49cc7ea6b93ba384e77a4880ae48ac4a5635c14",
|
|
5
5
|
"files": [
|
|
6
6
|
"src",
|
|
@@ -34,7 +34,7 @@
|
|
|
34
34
|
"clean:build": "tamagui-build clean:build"
|
|
35
35
|
},
|
|
36
36
|
"devDependencies": {
|
|
37
|
-
"@tamagui/build": "2.
|
|
37
|
+
"@tamagui/build": "2.3.0",
|
|
38
38
|
"react": ">=19",
|
|
39
39
|
"react-native": "0.83.2"
|
|
40
40
|
},
|
package/src/index.ts
CHANGED
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
// the renderer-platform extension point: a custom renderer (e.g. react-native-gpui,
|
|
2
|
+
// which reconciles React into GPUI/Metal) registers ONE driver object at app setup
|
|
3
|
+
// and tamagui consults it for capabilities the renderer owns better than JS can.
|
|
4
|
+
//
|
|
5
|
+
// first capability: `pseudo` — the renderer resolves hover natively per hitbox
|
|
6
|
+
// (zero latency, no event round-trip) and pushes pseudo-state flips INTO tamagui,
|
|
7
|
+
// which runs its normal animation-driver/emitter path off them (spring if styled,
|
|
8
|
+
// instant otherwise, zero React commits). this replaces both the per-site
|
|
9
|
+
// `transition="0ms"` requirement and the mouseEnter/mouseLeave hover lane on such
|
|
10
|
+
// renderers. more capabilities (measure, focus, scroll) can slot in over time.
|
|
11
|
+
|
|
12
|
+
export interface PlatformDriverPseudoState {
|
|
13
|
+
hovered: boolean
|
|
14
|
+
pressed: boolean
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
export interface PlatformDriver {
|
|
18
|
+
pseudo?: {
|
|
19
|
+
/**
|
|
20
|
+
* subscribe a mounted component's host instance to native pseudo-state flips.
|
|
21
|
+
* the host instance is whatever the renderer's ref resolves to (on
|
|
22
|
+
* react-native-gpui, the reconciler Instance whose `.id` is the host node id).
|
|
23
|
+
* returns an unsubscribe.
|
|
24
|
+
*/
|
|
25
|
+
subscribe(
|
|
26
|
+
hostInstance: unknown,
|
|
27
|
+
listener: (state: PlatformDriverPseudoState) => void
|
|
28
|
+
): () => void
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
let platformDriver: PlatformDriver | null = null
|
|
33
|
+
|
|
34
|
+
/** register the renderer platform driver — call once at app setup, before render. */
|
|
35
|
+
export function setupPlatformDriver(driver: PlatformDriver): void {
|
|
36
|
+
platformDriver = driver
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
export function getPlatformDriver(): PlatformDriver | null {
|
|
40
|
+
return platformDriver
|
|
41
|
+
}
|
package/types/index.d.ts
CHANGED
package/types/index.d.ts.map
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
{
|
|
2
|
-
"mappings": "AAAA,cAAc",
|
|
2
|
+
"mappings": "AAAA,cAAc;AACd,cAAc",
|
|
3
3
|
"names": [],
|
|
4
4
|
"sources": [
|
|
5
5
|
"src/index.ts"
|
|
6
6
|
],
|
|
7
7
|
"version": 3,
|
|
8
8
|
"sourcesContent": [
|
|
9
|
-
"export * from './constants'\n"
|
|
9
|
+
"export * from './constants'\nexport * from './platformDriver'\n"
|
|
10
10
|
]
|
|
11
11
|
}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
export interface PlatformDriverPseudoState {
|
|
2
|
+
hovered: boolean;
|
|
3
|
+
pressed: boolean;
|
|
4
|
+
}
|
|
5
|
+
export interface PlatformDriver {
|
|
6
|
+
pseudo?: {
|
|
7
|
+
/**
|
|
8
|
+
* subscribe a mounted component's host instance to native pseudo-state flips.
|
|
9
|
+
* the host instance is whatever the renderer's ref resolves to (on
|
|
10
|
+
* react-native-gpui, the reconciler Instance whose `.id` is the host node id).
|
|
11
|
+
* returns an unsubscribe.
|
|
12
|
+
*/
|
|
13
|
+
subscribe(hostInstance: unknown, listener: (state: PlatformDriverPseudoState) => void): () => void;
|
|
14
|
+
};
|
|
15
|
+
}
|
|
16
|
+
/** register the renderer platform driver — call once at app setup, before render. */
|
|
17
|
+
export declare function setupPlatformDriver(driver: PlatformDriver): void;
|
|
18
|
+
export declare function getPlatformDriver(): PlatformDriver | null;
|
|
19
|
+
|
|
20
|
+
//# sourceMappingURL=platformDriver.d.ts.map
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
{
|
|
2
|
+
"mappings": "AAWA,iBAAiB,0BAA0B;CACzC;CACA;;AAGF,iBAAiB,eAAe;CAC9B,SAAS;;;;;;;EAOP,UACE,uBACA,WAAW,OAAO;;;;AAQxB,OAAO,iBAAS,oBAAoB,QAAQ;AAI5C,OAAO,iBAAS,qBAAqB",
|
|
3
|
+
"names": [],
|
|
4
|
+
"sources": [
|
|
5
|
+
"src/platformDriver.ts"
|
|
6
|
+
],
|
|
7
|
+
"version": 3,
|
|
8
|
+
"sourcesContent": [
|
|
9
|
+
"// the renderer-platform extension point: a custom renderer (e.g. react-native-gpui,\n// which reconciles React into GPUI/Metal) registers ONE driver object at app setup\n// and tamagui consults it for capabilities the renderer owns better than JS can.\n//\n// first capability: `pseudo` — the renderer resolves hover natively per hitbox\n// (zero latency, no event round-trip) and pushes pseudo-state flips INTO tamagui,\n// which runs its normal animation-driver/emitter path off them (spring if styled,\n// instant otherwise, zero React commits). this replaces both the per-site\n// `transition=\"0ms\"` requirement and the mouseEnter/mouseLeave hover lane on such\n// renderers. more capabilities (measure, focus, scroll) can slot in over time.\n\nexport interface PlatformDriverPseudoState {\n hovered: boolean\n pressed: boolean\n}\n\nexport interface PlatformDriver {\n pseudo?: {\n /**\n * subscribe a mounted component's host instance to native pseudo-state flips.\n * the host instance is whatever the renderer's ref resolves to (on\n * react-native-gpui, the reconciler Instance whose `.id` is the host node id).\n * returns an unsubscribe.\n */\n subscribe(\n hostInstance: unknown,\n listener: (state: PlatformDriverPseudoState) => void\n ): () => void\n }\n}\n\nlet platformDriver: PlatformDriver | null = null\n\n/** register the renderer platform driver — call once at app setup, before render. */\nexport function setupPlatformDriver(driver: PlatformDriver): void {\n platformDriver = driver\n}\n\nexport function getPlatformDriver(): PlatformDriver | null {\n return platformDriver\n}\n"
|
|
10
|
+
]
|
|
11
|
+
}
|