@hanzogui/constants 8.3.1 → 8.3.3

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.
Files changed (50) hide show
  1. package/dist/cjs/constants.js +47 -0
  2. package/dist/cjs/constants.js.map +1 -0
  3. package/dist/cjs/index.js +6 -0
  4. package/dist/cjs/index.js.map +1 -0
  5. package/dist/cjs/package.json +1 -0
  6. package/dist/cjs/platformDriver.js +23 -0
  7. package/dist/cjs/platformDriver.js.map +1 -0
  8. package/dist/esm/constants.js +44 -0
  9. package/dist/esm/constants.js.map +1 -0
  10. package/dist/esm/index.js +3 -3
  11. package/dist/esm/index.js.map +1 -1
  12. package/dist/esm/platformDriver.js +19 -0
  13. package/dist/esm/platformDriver.js.map +1 -0
  14. package/dist/native/constants.js +47 -0
  15. package/dist/native/constants.js.map +1 -0
  16. package/dist/native/index.js +3 -0
  17. package/dist/native/index.js.map +1 -0
  18. package/dist/native/platformDriver.js +19 -0
  19. package/dist/native/platformDriver.js.map +1 -0
  20. package/package.json +18 -13
  21. package/src/index.ts +2 -2
  22. package/types/constants.d.ts +7 -8
  23. package/types/constants.d.ts.map +1 -11
  24. package/types/constants.native.d.ts +7 -8
  25. package/types/constants.native.d.ts.map +1 -11
  26. package/types/index.d.ts +2 -3
  27. package/types/index.d.ts.map +1 -11
  28. package/types/platformDriver.d.ts +11 -12
  29. package/types/platformDriver.d.ts.map +1 -11
  30. package/dist/cjs/constants.cjs +0 -57
  31. package/dist/cjs/constants.native.js +0 -66
  32. package/dist/cjs/constants.native.js.map +0 -1
  33. package/dist/cjs/index.cjs +0 -21
  34. package/dist/cjs/index.native.js +0 -24
  35. package/dist/cjs/index.native.js.map +0 -1
  36. package/dist/cjs/platformDriver.cjs +0 -35
  37. package/dist/cjs/platformDriver.native.js +0 -38
  38. package/dist/cjs/platformDriver.native.js.map +0 -1
  39. package/dist/esm/constants.mjs +0 -18
  40. package/dist/esm/constants.mjs.map +0 -1
  41. package/dist/esm/constants.native.js +0 -24
  42. package/dist/esm/constants.native.js.map +0 -1
  43. package/dist/esm/index.mjs +0 -3
  44. package/dist/esm/index.mjs.map +0 -1
  45. package/dist/esm/index.native.js +0 -3
  46. package/dist/esm/index.native.js.map +0 -1
  47. package/dist/esm/platformDriver.mjs +0 -9
  48. package/dist/esm/platformDriver.mjs.map +0 -1
  49. package/dist/esm/platformDriver.native.js +0 -9
  50. package/dist/esm/platformDriver.native.js.map +0 -1
@@ -0,0 +1,47 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.currentPlatform = exports.isTV = exports.supportsDynamicColorIOS = exports.isIos = exports.isAndroid = exports.isTouchable = exports.isNativeDesktop = exports.isWebTouchable = exports.isChrome = exports.useIsomorphicLayoutEffect = exports.isWindowDefined = exports.isClient = exports.isServer = exports.isBrowser = exports.isWeb = void 0;
4
+ const react_1 = require("react");
5
+ exports.isWeb = true;
6
+ // RN adds fake window and document so its not simple to get this right
7
+ // check both navigator and location
8
+ exports.isBrowser = typeof navigator !== 'undefined' && typeof location !== 'undefined';
9
+ exports.isServer = exports.isWeb && !exports.isBrowser;
10
+ exports.isClient = exports.isWeb && exports.isBrowser;
11
+ /** @deprecated use isBrowser instead */
12
+ exports.isWindowDefined = exports.isBrowser;
13
+ exports.useIsomorphicLayoutEffect = exports.isServer
14
+ ? react_1.useEffect
15
+ : react_1.useLayoutEffect;
16
+ exports.isChrome = typeof navigator !== 'undefined' && /Chrome/.test(navigator.userAgent || '');
17
+ exports.isWebTouchable = exports.isClient && ('ontouchstart' in window || navigator.maxTouchPoints > 0);
18
+ exports.isNativeDesktop = false;
19
+ exports.isTouchable = !exports.isWeb || exports.isWebTouchable;
20
+ // set :boolean to avoid inferring type to false
21
+ // On web, isAndroid/isIos are always false in production.
22
+ // TEST_NATIVE_PLATFORM is only set by the test runner (vitest) to simulate native
23
+ // environments (e.g. androidtv, tvos) from a web/jsdom test context.
24
+ exports.isAndroid = process.env.TEST_NATIVE_PLATFORM === 'android' ||
25
+ // Android TV has Platform.OS === 'android' per react-native-tvos
26
+ process.env.TEST_NATIVE_PLATFORM === 'androidtv';
27
+ exports.isIos = process.env.TEST_NATIVE_PLATFORM === 'ios' ||
28
+ // tvOS has Platform.OS === 'ios' per react-native-tvos
29
+ process.env.TEST_NATIVE_PLATFORM === 'tvos';
30
+ exports.supportsDynamicColorIOS = exports.isIos || process.env.GUI_DYNAMIC_COLOR_IOS === '1';
31
+ exports.isTV = process.env.TEST_NATIVE_PLATFORM === 'androidtv' ||
32
+ process.env.TEST_NATIVE_PLATFORM === 'tvos';
33
+ /**
34
+ * Reflects Platform.OS. TV platforms are intentionally NOT separate values:
35
+ * - Android TV has Platform.OS === 'android' (react-native-tvos behavior)
36
+ * - tvOS has Platform.OS === 'ios' (react-native-tvos behavior)
37
+ * Use `isTV` combined with `isAndroid`/`isIos` to detect specific TV platforms.
38
+ */
39
+ exports.currentPlatform = 'web';
40
+ // In web source mode (Vite/webpack without pre-built dist), GUI_TARGET may not be set.
41
+ // Set it here so all process.env.GUI_TARGET runtime checks work correctly.
42
+ // In pre-built dist, the build tool inlines GUI_TARGET as a literal string,
43
+ // making this block dead code (if (!'web') → never executes).
44
+ if (!"web") {
45
+ process.env.GUI_TARGET = 'web';
46
+ }
47
+ //# sourceMappingURL=constants.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"constants.js","sourceRoot":"","sources":["../../src/constants.ts"],"names":[],"mappings":";;;AAAA,iCAAkD;AAErC,QAAA,KAAK,GAAY,IAAI,CAAA;AAElC,uEAAuE;AACvE,oCAAoC;AACvB,QAAA,SAAS,GACpB,OAAO,SAAS,KAAK,WAAW,IAAI,OAAO,QAAQ,KAAK,WAAW,CAAA;AAExD,QAAA,QAAQ,GAAY,QAAA,KAAK,IAAI,CAAC,QAAA,SAAS,CAAA;AACvC,QAAA,QAAQ,GAAY,QAAA,KAAK,IAAI,QAAA,SAAS,CAAA;AACnD,wCAAwC;AAC3B,QAAA,eAAe,GAAY,QAAA,SAAS,CAAA;AAEpC,QAAA,yBAAyB,GAAqB,QAAA,QAAQ;IACjE,CAAC,CAAC,iBAAS;IACX,CAAC,CAAC,uBAAe,CAAA;AAEN,QAAA,QAAQ,GACnB,OAAO,SAAS,KAAK,WAAW,IAAI,QAAQ,CAAC,IAAI,CAAC,SAAS,CAAC,SAAS,IAAI,EAAE,CAAC,CAAA;AAEjE,QAAA,cAAc,GACzB,QAAA,QAAQ,IAAI,CAAC,cAAc,IAAI,MAAM,IAAI,SAAS,CAAC,cAAc,GAAG,CAAC,CAAC,CAAA;AAE3D,QAAA,eAAe,GAAY,KAAK,CAAA;AAChC,QAAA,WAAW,GAAY,CAAC,QAAA,KAAK,IAAI,QAAA,cAAc,CAAA;AAC5D,gDAAgD;AAChD,0DAA0D;AAC1D,kFAAkF;AAClF,qEAAqE;AACxD,QAAA,SAAS,GACpB,OAAO,CAAC,GAAG,CAAC,oBAAoB,KAAK,SAAS;IAC9C,iEAAiE;IACjE,OAAO,CAAC,GAAG,CAAC,oBAAoB,KAAK,WAAW,CAAA;AACrC,QAAA,KAAK,GAChB,OAAO,CAAC,GAAG,CAAC,oBAAoB,KAAK,KAAK;IAC1C,uDAAuD;IACvD,OAAO,CAAC,GAAG,CAAC,oBAAoB,KAAK,MAAM,CAAA;AAChC,QAAA,uBAAuB,GAClC,QAAA,KAAK,IAAI,OAAO,CAAC,GAAG,CAAC,qBAAqB,KAAK,GAAG,CAAA;AACvC,QAAA,IAAI,GACf,OAAO,CAAC,GAAG,CAAC,oBAAoB,KAAK,WAAW;IAChD,OAAO,CAAC,GAAG,CAAC,oBAAoB,KAAK,MAAM,CAAA;AAC7C;;;;;GAKG;AACU,QAAA,eAAe,GAAyC,KAAK,CAAA;AAE1E,uFAAuF;AACvF,2EAA2E;AAC3E,4EAA4E;AAC5E,8DAA8D;AAC9D,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,UAAU,EAAE,CAAC;IAC5B,OAAO,CAAC,GAAG,CAAC,UAAU,GAAG,KAAK,CAAA;AAChC,CAAC"}
@@ -0,0 +1,6 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const tslib_1 = require("tslib");
4
+ tslib_1.__exportStar(require("./constants.js"), exports);
5
+ tslib_1.__exportStar(require("./platformDriver.js"), exports);
6
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":";;;AAAA,yDAA8B;AAC9B,8DAAmC"}
@@ -0,0 +1 @@
1
+ { "type": "commonjs" }
@@ -0,0 +1,23 @@
1
+ "use strict";
2
+ // the renderer-platform extension point: a custom renderer (e.g. react-native-gpui,
3
+ // which reconciles React into GPUI/Metal) registers ONE driver object at app setup
4
+ // and hanzogui consults it for capabilities the renderer owns better than JS can.
5
+ //
6
+ // first capability: `pseudo` — the renderer resolves hover natively per hitbox
7
+ // (zero latency, no event round-trip) and pushes pseudo-state flips INTO hanzogui,
8
+ // which runs its normal animation-driver/emitter path off them (spring if styled,
9
+ // instant otherwise, zero React commits). this replaces both the per-site
10
+ // `transition="0ms"` requirement and the mouseEnter/mouseLeave hover lane on such
11
+ // renderers. more capabilities (measure, focus, scroll) can slot in over time.
12
+ Object.defineProperty(exports, "__esModule", { value: true });
13
+ exports.setupPlatformDriver = setupPlatformDriver;
14
+ exports.getPlatformDriver = getPlatformDriver;
15
+ let platformDriver = null;
16
+ /** register the renderer platform driver — call once at app setup, before render. */
17
+ function setupPlatformDriver(driver) {
18
+ platformDriver = driver;
19
+ }
20
+ function getPlatformDriver() {
21
+ return platformDriver;
22
+ }
23
+ //# sourceMappingURL=platformDriver.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"platformDriver.js","sourceRoot":"","sources":["../../src/platformDriver.ts"],"names":[],"mappings":";AAAA,oFAAoF;AACpF,mFAAmF;AACnF,kFAAkF;AAClF,EAAE;AACF,+EAA+E;AAC/E,mFAAmF;AACnF,kFAAkF;AAClF,0EAA0E;AAC1E,kFAAkF;AAClF,+EAA+E;;;;AAsB/E,IAAI,cAAc,GAA0B,IAAI,CAAA;AAEhD,qFAAqF;AACrF,6BAAoC,MAAsB;IACxD,cAAc,GAAG,MAAM,CAAA;AACzB,CAAC;AAED;IACE,OAAO,cAAc,CAAA;AACvB,CAAC"}
@@ -0,0 +1,44 @@
1
+ import { useEffect, useLayoutEffect } from 'react';
2
+ export const isWeb = true;
3
+ // RN adds fake window and document so its not simple to get this right
4
+ // check both navigator and location
5
+ export const isBrowser = typeof navigator !== 'undefined' && typeof location !== 'undefined';
6
+ export const isServer = isWeb && !isBrowser;
7
+ export const isClient = isWeb && isBrowser;
8
+ /** @deprecated use isBrowser instead */
9
+ export const isWindowDefined = isBrowser;
10
+ export const useIsomorphicLayoutEffect = isServer
11
+ ? useEffect
12
+ : useLayoutEffect;
13
+ export const isChrome = typeof navigator !== 'undefined' && /Chrome/.test(navigator.userAgent || '');
14
+ export const isWebTouchable = isClient && ('ontouchstart' in window || navigator.maxTouchPoints > 0);
15
+ export const isNativeDesktop = false;
16
+ export const isTouchable = !isWeb || isWebTouchable;
17
+ // set :boolean to avoid inferring type to false
18
+ // On web, isAndroid/isIos are always false in production.
19
+ // TEST_NATIVE_PLATFORM is only set by the test runner (vitest) to simulate native
20
+ // environments (e.g. androidtv, tvos) from a web/jsdom test context.
21
+ export const isAndroid = process.env.TEST_NATIVE_PLATFORM === 'android' ||
22
+ // Android TV has Platform.OS === 'android' per react-native-tvos
23
+ process.env.TEST_NATIVE_PLATFORM === 'androidtv';
24
+ export const isIos = process.env.TEST_NATIVE_PLATFORM === 'ios' ||
25
+ // tvOS has Platform.OS === 'ios' per react-native-tvos
26
+ process.env.TEST_NATIVE_PLATFORM === 'tvos';
27
+ export const supportsDynamicColorIOS = isIos || process.env.GUI_DYNAMIC_COLOR_IOS === '1';
28
+ export const isTV = process.env.TEST_NATIVE_PLATFORM === 'androidtv' ||
29
+ process.env.TEST_NATIVE_PLATFORM === 'tvos';
30
+ /**
31
+ * Reflects Platform.OS. TV platforms are intentionally NOT separate values:
32
+ * - Android TV has Platform.OS === 'android' (react-native-tvos behavior)
33
+ * - tvOS has Platform.OS === 'ios' (react-native-tvos behavior)
34
+ * Use `isTV` combined with `isAndroid`/`isIos` to detect specific TV platforms.
35
+ */
36
+ export const currentPlatform = 'web';
37
+ // In web source mode (Vite/webpack without pre-built dist), GUI_TARGET may not be set.
38
+ // Set it here so all process.env.GUI_TARGET runtime checks work correctly.
39
+ // In pre-built dist, the build tool inlines GUI_TARGET as a literal string,
40
+ // making this block dead code (if (!'web') → never executes).
41
+ if (!"web") {
42
+ process.env.GUI_TARGET = 'web';
43
+ }
44
+ //# sourceMappingURL=constants.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"constants.js","sourceRoot":"","sources":["../../src/constants.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,eAAe,EAAE,MAAM,OAAO,CAAA;AAElD,MAAM,CAAC,MAAM,KAAK,GAAY,IAAI,CAAA;AAElC,uEAAuE;AACvE,oCAAoC;AACpC,MAAM,CAAC,MAAM,SAAS,GACpB,OAAO,SAAS,KAAK,WAAW,IAAI,OAAO,QAAQ,KAAK,WAAW,CAAA;AAErE,MAAM,CAAC,MAAM,QAAQ,GAAY,KAAK,IAAI,CAAC,SAAS,CAAA;AACpD,MAAM,CAAC,MAAM,QAAQ,GAAY,KAAK,IAAI,SAAS,CAAA;AACnD,wCAAwC;AACxC,MAAM,CAAC,MAAM,eAAe,GAAY,SAAS,CAAA;AAEjD,MAAM,CAAC,MAAM,yBAAyB,GAAqB,QAAQ;IACjE,CAAC,CAAC,SAAS;IACX,CAAC,CAAC,eAAe,CAAA;AAEnB,MAAM,CAAC,MAAM,QAAQ,GACnB,OAAO,SAAS,KAAK,WAAW,IAAI,QAAQ,CAAC,IAAI,CAAC,SAAS,CAAC,SAAS,IAAI,EAAE,CAAC,CAAA;AAE9E,MAAM,CAAC,MAAM,cAAc,GACzB,QAAQ,IAAI,CAAC,cAAc,IAAI,MAAM,IAAI,SAAS,CAAC,cAAc,GAAG,CAAC,CAAC,CAAA;AAExE,MAAM,CAAC,MAAM,eAAe,GAAY,KAAK,CAAA;AAC7C,MAAM,CAAC,MAAM,WAAW,GAAY,CAAC,KAAK,IAAI,cAAc,CAAA;AAC5D,gDAAgD;AAChD,0DAA0D;AAC1D,kFAAkF;AAClF,qEAAqE;AACrE,MAAM,CAAC,MAAM,SAAS,GACpB,OAAO,CAAC,GAAG,CAAC,oBAAoB,KAAK,SAAS;IAC9C,iEAAiE;IACjE,OAAO,CAAC,GAAG,CAAC,oBAAoB,KAAK,WAAW,CAAA;AAClD,MAAM,CAAC,MAAM,KAAK,GAChB,OAAO,CAAC,GAAG,CAAC,oBAAoB,KAAK,KAAK;IAC1C,uDAAuD;IACvD,OAAO,CAAC,GAAG,CAAC,oBAAoB,KAAK,MAAM,CAAA;AAC7C,MAAM,CAAC,MAAM,uBAAuB,GAClC,KAAK,IAAI,OAAO,CAAC,GAAG,CAAC,qBAAqB,KAAK,GAAG,CAAA;AACpD,MAAM,CAAC,MAAM,IAAI,GACf,OAAO,CAAC,GAAG,CAAC,oBAAoB,KAAK,WAAW;IAChD,OAAO,CAAC,GAAG,CAAC,oBAAoB,KAAK,MAAM,CAAA;AAC7C;;;;;GAKG;AACH,MAAM,CAAC,MAAM,eAAe,GAAyC,KAAK,CAAA;AAE1E,uFAAuF;AACvF,2EAA2E;AAC3E,4EAA4E;AAC5E,8DAA8D;AAC9D,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,UAAU,EAAE,CAAC;IAC5B,OAAO,CAAC,GAAG,CAAC,UAAU,GAAG,KAAK,CAAA;AAChC,CAAC"}
package/dist/esm/index.js CHANGED
@@ -1,3 +1,3 @@
1
- export * from "./constants.mjs";
2
- export * from "./platformDriver.mjs";
3
- //# sourceMappingURL=index.js.map
1
+ export * from './constants.js';
2
+ export * from './platformDriver.js';
3
+ //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"names":[],"sources":["../../src/index.ts"],"sourcesContent":[null],"mappings":"AAAA,cAAc;AACd,cAAc","ignoreList":[]}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,gBAAgB,CAAA;AAC9B,cAAc,qBAAqB,CAAA"}
@@ -0,0 +1,19 @@
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 hanzogui 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 hanzogui,
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
+ let platformDriver = null;
12
+ /** register the renderer platform driver — call once at app setup, before render. */
13
+ export function setupPlatformDriver(driver) {
14
+ platformDriver = driver;
15
+ }
16
+ export function getPlatformDriver() {
17
+ return platformDriver;
18
+ }
19
+ //# sourceMappingURL=platformDriver.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"platformDriver.js","sourceRoot":"","sources":["../../src/platformDriver.ts"],"names":[],"mappings":"AAAA,oFAAoF;AACpF,mFAAmF;AACnF,kFAAkF;AAClF,EAAE;AACF,+EAA+E;AAC/E,mFAAmF;AACnF,kFAAkF;AAClF,0EAA0E;AAC1E,kFAAkF;AAClF,+EAA+E;AAsB/E,IAAI,cAAc,GAA0B,IAAI,CAAA;AAEhD,qFAAqF;AACrF,MAAM,UAAU,mBAAmB,CAAC,MAAsB;IACxD,cAAc,GAAG,MAAM,CAAA;AACzB,CAAC;AAED,MAAM,UAAU,iBAAiB;IAC/B,OAAO,cAAc,CAAA;AACvB,CAAC"}
@@ -0,0 +1,47 @@
1
+ import { useLayoutEffect } from 'react';
2
+ import { Platform } from 'react-native';
3
+ export const isWeb = false;
4
+ export const isBrowser = false;
5
+ export const isServer = false;
6
+ export const isClient = true;
7
+ /** @deprecated use isBrowser instead */
8
+ export const isWindowDefined = false;
9
+ export const useIsomorphicLayoutEffect = useLayoutEffect;
10
+ export const isChrome = false;
11
+ export const isWebTouchable = false;
12
+ export const isNativeDesktop = Platform?.OS === 'macos' || Platform?.OS === 'windows';
13
+ export const isTouchable = !isNativeDesktop;
14
+ // optional chain required: babel extractor loads native.cjs in node where Platform is undefined
15
+ // On Android TV: Platform.OS === 'android' per react-native-tvos
16
+ export const isAndroid = Platform?.OS === 'android' ||
17
+ process.env.TEST_NATIVE_PLATFORM === 'android' ||
18
+ process.env.TEST_NATIVE_PLATFORM === 'androidtv';
19
+ // On tvOS: Platform.OS === 'ios' per react-native-tvos
20
+ export const isIos = Platform?.OS === 'ios' ||
21
+ process.env.TEST_NATIVE_PLATFORM === 'ios' ||
22
+ process.env.TEST_NATIVE_PLATFORM === 'tvos';
23
+ export const supportsDynamicColorIOS = isIos || process.env.GUI_DYNAMIC_COLOR_IOS === '1';
24
+ export const isTV = Platform?.isTV ||
25
+ process.env.TEST_NATIVE_PLATFORM === 'androidtv' ||
26
+ process.env.TEST_NATIVE_PLATFORM === 'tvos';
27
+ const platforms = {
28
+ ios: 'ios',
29
+ android: 'android',
30
+ macos: 'macos',
31
+ windows: 'windows',
32
+ };
33
+ /**
34
+ * Reflects Platform.OS. TV platforms are intentionally NOT separate values:
35
+ * - Android TV has Platform.OS === 'android' (react-native-tvos behavior)
36
+ * - tvOS has Platform.OS === 'ios' (react-native-tvos behavior)
37
+ * Use `isTV` combined with `isAndroid`/`isIos` to detect specific TV platforms.
38
+ */
39
+ export const currentPlatform = (Platform?.OS ? platforms[Platform.OS] : undefined) || 'native';
40
+ // In Metro source mode, GUI_TARGET may not be set by the build tool.
41
+ // Set it here so all process.env.GUI_TARGET runtime checks work correctly.
42
+ // In pre-built dist, the build tool inlines GUI_TARGET as a literal string,
43
+ // making this block dead code (if (!'native') → never executes).
44
+ if (!"native") {
45
+ process.env.GUI_TARGET = 'native';
46
+ }
47
+ //# sourceMappingURL=constants.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"constants.native.js","sourceRoot":"","sources":["../../src/constants.native.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAkB,MAAM,OAAO,CAAA;AACvD,OAAO,EAAE,QAAQ,EAAE,MAAM,cAAc,CAAA;AAEvC,MAAM,CAAC,MAAM,KAAK,GAAY,KAAK,CAAA;AACnC,MAAM,CAAC,MAAM,SAAS,GAAY,KAAK,CAAA;AACvC,MAAM,CAAC,MAAM,QAAQ,GAAY,KAAK,CAAA;AACtC,MAAM,CAAC,MAAM,QAAQ,GAAY,IAAI,CAAA;AACrC,wCAAwC;AACxC,MAAM,CAAC,MAAM,eAAe,GAAY,KAAK,CAAA;AAC7C,MAAM,CAAC,MAAM,yBAAyB,GAAqB,eAAe,CAAA;AAC1E,MAAM,CAAC,MAAM,QAAQ,GAAY,KAAK,CAAA;AACtC,MAAM,CAAC,MAAM,cAAc,GAAY,KAAK,CAAA;AAC5C,MAAM,CAAC,MAAM,eAAe,GAC1B,QAAQ,EAAE,EAAE,KAAK,OAAO,IAAI,QAAQ,EAAE,EAAE,KAAK,SAAS,CAAA;AACxD,MAAM,CAAC,MAAM,WAAW,GAAY,CAAC,eAAe,CAAA;AACpD,gGAAgG;AAChG,iEAAiE;AACjE,MAAM,CAAC,MAAM,SAAS,GACpB,QAAQ,EAAE,EAAE,KAAK,SAAS;IAC1B,OAAO,CAAC,GAAG,CAAC,oBAAoB,KAAK,SAAS;IAC9C,OAAO,CAAC,GAAG,CAAC,oBAAoB,KAAK,WAAW,CAAA;AAClD,uDAAuD;AACvD,MAAM,CAAC,MAAM,KAAK,GAChB,QAAQ,EAAE,EAAE,KAAK,KAAK;IACtB,OAAO,CAAC,GAAG,CAAC,oBAAoB,KAAK,KAAK;IAC1C,OAAO,CAAC,GAAG,CAAC,oBAAoB,KAAK,MAAM,CAAA;AAC7C,MAAM,CAAC,MAAM,uBAAuB,GAClC,KAAK,IAAI,OAAO,CAAC,GAAG,CAAC,qBAAqB,KAAK,GAAG,CAAA;AACpD,MAAM,CAAC,MAAM,IAAI,GACf,QAAQ,EAAE,IAAI;IACd,OAAO,CAAC,GAAG,CAAC,oBAAoB,KAAK,WAAW;IAChD,OAAO,CAAC,GAAG,CAAC,oBAAoB,KAAK,MAAM,CAAA;AAE7C,MAAM,SAAS,GAAG;IAChB,GAAG,EAAE,KAAK;IACV,OAAO,EAAE,SAAS;IAClB,KAAK,EAAE,OAAO;IACd,OAAO,EAAE,SAAS;CACV,CAAA;AACV;;;;;GAKG;AACH,MAAM,CAAC,MAAM,eAAe,GAC1B,CAAC,QAAQ,EAAE,EAAE,CAAC,CAAC,CAAC,SAAS,CAAC,QAAQ,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC,IAAI,QAAQ,CAAA;AAEjE,qEAAqE;AACrE,2EAA2E;AAC3E,4EAA4E;AAC5E,iEAAiE;AACjE,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,UAAU,EAAE,CAAC;IAC5B,OAAO,CAAC,GAAG,CAAC,UAAU,GAAG,QAAQ,CAAA;AACnC,CAAC"}
@@ -0,0 +1,3 @@
1
+ export * from './constants.js';
2
+ export * from './platformDriver.js';
3
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,gBAAgB,CAAA;AAC9B,cAAc,qBAAqB,CAAA"}
@@ -0,0 +1,19 @@
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 hanzogui 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 hanzogui,
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
+ let platformDriver = null;
12
+ /** register the renderer platform driver — call once at app setup, before render. */
13
+ export function setupPlatformDriver(driver) {
14
+ platformDriver = driver;
15
+ }
16
+ export function getPlatformDriver() {
17
+ return platformDriver;
18
+ }
19
+ //# sourceMappingURL=platformDriver.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"platformDriver.js","sourceRoot":"","sources":["../../src/platformDriver.ts"],"names":[],"mappings":"AAAA,oFAAoF;AACpF,mFAAmF;AACnF,kFAAkF;AAClF,EAAE;AACF,+EAA+E;AAC/E,mFAAmF;AACnF,kFAAkF;AAClF,0EAA0E;AAC1E,kFAAkF;AAClF,+EAA+E;AAsB/E,IAAI,cAAc,GAA0B,IAAI,CAAA;AAEhD,qFAAqF;AACrF,MAAM,UAAU,mBAAmB,CAAC,MAAsB;IACxD,cAAc,GAAG,MAAM,CAAA;AACzB,CAAC;AAED,MAAM,UAAU,iBAAiB;IAC/B,OAAO,cAAc,CAAA;AACvB,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hanzogui/constants",
3
- "version": "8.3.1",
3
+ "version": "8.3.3",
4
4
  "gitHead": "a49cc7ea6b93ba384e77a4880ae48ac4a5635c14",
5
5
  "files": [
6
6
  "src",
@@ -9,19 +9,19 @@
9
9
  ],
10
10
  "type": "module",
11
11
  "sideEffects": false,
12
- "main": "dist/cjs",
13
- "module": "dist/esm",
12
+ "main": "./dist/cjs/index.js",
13
+ "module": "./dist/esm/index.js",
14
14
  "types": "./types/index.d.ts",
15
15
  "exports": {
16
16
  "./package.json": "./package.json",
17
17
  ".": {
18
18
  "types": "./types/index.d.ts",
19
- "react-native": "./dist/esm/index.native.js",
20
- "browser": "./dist/esm/index.mjs",
21
- "module": "./dist/esm/index.mjs",
22
- "import": "./dist/esm/index.mjs",
23
- "require": "./dist/cjs/index.cjs",
24
- "default": "./dist/esm/index.mjs"
19
+ "react-native": "./dist/native/index.js",
20
+ "browser": "./dist/esm/index.js",
21
+ "module": "./dist/esm/index.js",
22
+ "import": "./dist/esm/index.js",
23
+ "require": "./dist/cjs/index.js",
24
+ "default": "./dist/esm/index.js"
25
25
  }
26
26
  },
27
27
  "publishConfig": {
@@ -34,11 +34,16 @@
34
34
  "clean:build": "hanzogui-build clean:build"
35
35
  },
36
36
  "devDependencies": {
37
- "@hanzogui/build": "8.3.1",
38
- "react": ">=19",
39
- "react-native": "0.83.2"
37
+ "@hanzogui/build": "8.3.3",
38
+ "react": "19.2.8",
39
+ "react-native": "^0.87.1"
40
40
  },
41
41
  "peerDependencies": {
42
- "react": ">=19"
42
+ "react": ">=19.2.8"
43
+ },
44
+ "repository": {
45
+ "type": "git",
46
+ "url": "git+https://github.com/hanzoai/gui.git",
47
+ "directory": "pkgs/core/constants"
43
48
  }
44
49
  }
package/src/index.ts CHANGED
@@ -1,2 +1,2 @@
1
- export * from './constants'
2
- export * from './platformDriver'
1
+ export * from './constants.ts'
2
+ export * from './platformDriver.ts'
@@ -1,4 +1,4 @@
1
- import { useEffect } from "react";
1
+ import { useEffect } from 'react';
2
2
  export declare const isWeb: boolean;
3
3
  export declare const isBrowser: boolean;
4
4
  export declare const isServer: boolean;
@@ -15,11 +15,10 @@ export declare const isIos: boolean;
15
15
  export declare const supportsDynamicColorIOS: boolean;
16
16
  export declare const isTV: boolean;
17
17
  /**
18
- * Reflects Platform.OS. TV platforms are intentionally NOT separate values:
19
- * - Android TV has Platform.OS === 'android' (react-native-tvos behavior)
20
- * - tvOS has Platform.OS === 'ios' (react-native-tvos behavior)
21
- * Use `isTV` combined with `isAndroid`/`isIos` to detect specific TV platforms.
22
- */
23
- export declare const currentPlatform: "web" | "ios" | "native" | "android";
24
-
18
+ * Reflects Platform.OS. TV platforms are intentionally NOT separate values:
19
+ * - Android TV has Platform.OS === 'android' (react-native-tvos behavior)
20
+ * - tvOS has Platform.OS === 'ios' (react-native-tvos behavior)
21
+ * Use `isTV` combined with `isAndroid`/`isIos` to detect specific TV platforms.
22
+ */
23
+ export declare const currentPlatform: 'web' | 'ios' | 'native' | 'android';
25
24
  //# sourceMappingURL=constants.d.ts.map
@@ -1,11 +1 @@
1
- {
2
- "mappings": "AAAA,SAAS,iBAAkC;AAE3C,OAAO,cAAM;AAIb,OAAO,cAAM;AAGb,OAAO,cAAM;AACb,OAAO,cAAM;;AAEb,OAAO,cAAM;AAEb,OAAO,cAAM,kCAAkC;AAI/C,OAAO,cAAM;AAGb,OAAO,cAAM;AAGb,OAAO,cAAM;AACb,OAAO,cAAM;AAKb,OAAO,cAAM;AAIb,OAAO,cAAM;AAIb,OAAO,cAAM;AAEb,OAAO,cAAM;;;;;;;AASb,OAAO,cAAM,iBAAiB,QAAQ,QAAQ,WAAW",
3
- "names": [],
4
- "sources": [
5
- "src/constants.ts"
6
- ],
7
- "version": 3,
8
- "sourcesContent": [
9
- "import { useEffect, useLayoutEffect } from 'react'\n\nexport const isWeb: boolean = true\n\n// RN adds fake window and document so its not simple to get this right\n// check both navigator and location\nexport const isBrowser: boolean =\n typeof navigator !== 'undefined' && typeof location !== 'undefined'\n\nexport const isServer: boolean = isWeb && !isBrowser\nexport const isClient: boolean = isWeb && isBrowser\n/** @deprecated use isBrowser instead */\nexport const isWindowDefined: boolean = isBrowser\n\nexport const useIsomorphicLayoutEffect: typeof useEffect = isServer\n ? useEffect\n : useLayoutEffect\n\nexport const isChrome: boolean =\n typeof navigator !== 'undefined' && /Chrome/.test(navigator.userAgent || '')\n\nexport const isWebTouchable: boolean =\n isClient && ('ontouchstart' in window || navigator.maxTouchPoints > 0)\n\nexport const isNativeDesktop: boolean = false\nexport const isTouchable: boolean = !isWeb || isWebTouchable\n// set :boolean to avoid inferring type to false\n// On web, isAndroid/isIos are always false in production.\n// TEST_NATIVE_PLATFORM is only set by the test runner (vitest) to simulate native\n// environments (e.g. androidtv, tvos) from a web/jsdom test context.\nexport const isAndroid: boolean =\n process.env.TEST_NATIVE_PLATFORM === 'android' ||\n // Android TV has Platform.OS === 'android' per react-native-tvos\n process.env.TEST_NATIVE_PLATFORM === 'androidtv'\nexport const isIos: boolean =\n process.env.TEST_NATIVE_PLATFORM === 'ios' ||\n // tvOS has Platform.OS === 'ios' per react-native-tvos\n process.env.TEST_NATIVE_PLATFORM === 'tvos'\nexport const supportsDynamicColorIOS: boolean =\n isIos || process.env.GUI_DYNAMIC_COLOR_IOS === '1'\nexport const isTV: boolean =\n process.env.TEST_NATIVE_PLATFORM === 'androidtv' ||\n process.env.TEST_NATIVE_PLATFORM === 'tvos'\n/**\n * Reflects Platform.OS. TV platforms are intentionally NOT separate values:\n * - Android TV has Platform.OS === 'android' (react-native-tvos behavior)\n * - tvOS has Platform.OS === 'ios' (react-native-tvos behavior)\n * Use `isTV` combined with `isAndroid`/`isIos` to detect specific TV platforms.\n */\nexport const currentPlatform: 'web' | 'ios' | 'native' | 'android' = 'web'\n\n// In web source mode (Vite/webpack without pre-built dist), GUI_TARGET may not be set.\n// Set it here so all process.env.GUI_TARGET runtime checks work correctly.\n// In pre-built dist, the build tool inlines GUI_TARGET as a literal string,\n// making this block dead code (if (!'web') → never executes).\nif (!process.env.GUI_TARGET) {\n process.env.GUI_TARGET = 'web'\n}\n"
10
- ]
11
- }
1
+ {"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../src/constants.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAmB,MAAM,OAAO,CAAA;AAElD,eAAO,MAAM,KAAK,EAAE,OAAc,CAAA;AAIlC,eAAO,MAAM,SAAS,EAAE,OAC6C,CAAA;AAErE,eAAO,MAAM,QAAQ,EAAE,OAA6B,CAAA;AACpD,eAAO,MAAM,QAAQ,EAAE,OAA4B,CAAA;AACnD,wCAAwC;AACxC,eAAO,MAAM,eAAe,EAAE,OAAmB,CAAA;AAEjD,eAAO,MAAM,yBAAyB,EAAE,OAAO,SAE5B,CAAA;AAEnB,eAAO,MAAM,QAAQ,EAAE,OACuD,CAAA;AAE9E,eAAO,MAAM,cAAc,EAAE,OAC2C,CAAA;AAExE,eAAO,MAAM,eAAe,EAAE,OAAe,CAAA;AAC7C,eAAO,MAAM,WAAW,EAAE,OAAkC,CAAA;AAK5D,eAAO,MAAM,SAAS,EAAE,OAG0B,CAAA;AAClD,eAAO,MAAM,KAAK,EAAE,OAGyB,CAAA;AAC7C,eAAO,MAAM,uBAAuB,EAAE,OACc,CAAA;AACpD,eAAO,MAAM,IAAI,EAAE,OAE0B,CAAA;AAC7C;;;;;GAKG;AACH,eAAO,MAAM,eAAe,EAAE,KAAK,GAAG,KAAK,GAAG,QAAQ,GAAG,SAAiB,CAAA"}
@@ -1,4 +1,4 @@
1
- import { type useEffect } from "react";
1
+ import { type useEffect } from 'react';
2
2
  export declare const isWeb: boolean;
3
3
  export declare const isBrowser: boolean;
4
4
  export declare const isServer: boolean;
@@ -15,11 +15,10 @@ export declare const isIos: boolean;
15
15
  export declare const supportsDynamicColorIOS: boolean;
16
16
  export declare const isTV: boolean;
17
17
  /**
18
- * Reflects Platform.OS. TV platforms are intentionally NOT separate values:
19
- * - Android TV has Platform.OS === 'android' (react-native-tvos behavior)
20
- * - tvOS has Platform.OS === 'ios' (react-native-tvos behavior)
21
- * Use `isTV` combined with `isAndroid`/`isIos` to detect specific TV platforms.
22
- */
23
- export declare const currentPlatform: "web" | "ios" | "native" | "android" | "macos" | "windows";
24
-
18
+ * Reflects Platform.OS. TV platforms are intentionally NOT separate values:
19
+ * - Android TV has Platform.OS === 'android' (react-native-tvos behavior)
20
+ * - tvOS has Platform.OS === 'ios' (react-native-tvos behavior)
21
+ * Use `isTV` combined with `isAndroid`/`isIos` to detect specific TV platforms.
22
+ */
23
+ export declare const currentPlatform: 'web' | 'ios' | 'native' | 'android' | 'macos' | 'windows';
25
24
  //# sourceMappingURL=constants.native.d.ts.map
@@ -1,11 +1 @@
1
- {
2
- "mappings": "AAAA,cAA+B,iBAAiB;AAGhD,OAAO,cAAM;AACb,OAAO,cAAM;AACb,OAAO,cAAM;AACb,OAAO,cAAM;;AAEb,OAAO,cAAM;AACb,OAAO,cAAM,kCAAkC;AAC/C,OAAO,cAAM;AACb,OAAO,cAAM;AACb,OAAO,cAAM;AAEb,OAAO,cAAM;AAGb,OAAO,cAAM;AAKb,OAAO,cAAM;AAIb,OAAO,cAAM;AAEb,OAAO,cAAM;;;;;;;AAiBb,OAAO,cAAM,iBAAiB,QAAQ,QAAQ,WAAW,YAAY,UAAU",
3
- "names": [],
4
- "sources": [
5
- "src/constants.native.ts"
6
- ],
7
- "version": 3,
8
- "sourcesContent": [
9
- "import { useLayoutEffect, type useEffect } from 'react'\nimport { Platform } from 'react-native'\n\nexport const isWeb: boolean = false\nexport const isBrowser: boolean = false\nexport const isServer: boolean = false\nexport const isClient: boolean = true\n/** @deprecated use isBrowser instead */\nexport const isWindowDefined: boolean = false\nexport const useIsomorphicLayoutEffect: typeof useEffect = useLayoutEffect\nexport const isChrome: boolean = false\nexport const isWebTouchable: boolean = false\nexport const isNativeDesktop: boolean =\n Platform?.OS === 'macos' || Platform?.OS === 'windows'\nexport const isTouchable: boolean = !isNativeDesktop\n// optional chain required: babel extractor loads native.cjs in node where Platform is undefined\n// On Android TV: Platform.OS === 'android' per react-native-tvos\nexport const isAndroid: boolean =\n Platform?.OS === 'android' ||\n process.env.TEST_NATIVE_PLATFORM === 'android' ||\n process.env.TEST_NATIVE_PLATFORM === 'androidtv'\n// On tvOS: Platform.OS === 'ios' per react-native-tvos\nexport const isIos: boolean =\n Platform?.OS === 'ios' ||\n process.env.TEST_NATIVE_PLATFORM === 'ios' ||\n process.env.TEST_NATIVE_PLATFORM === 'tvos'\nexport const supportsDynamicColorIOS: boolean =\n isIos || process.env.GUI_DYNAMIC_COLOR_IOS === '1'\nexport const isTV: boolean =\n Platform?.isTV ||\n process.env.TEST_NATIVE_PLATFORM === 'androidtv' ||\n process.env.TEST_NATIVE_PLATFORM === 'tvos'\n\nconst platforms = {\n ios: 'ios',\n android: 'android',\n macos: 'macos',\n windows: 'windows',\n} as const\n/**\n * Reflects Platform.OS. TV platforms are intentionally NOT separate values:\n * - Android TV has Platform.OS === 'android' (react-native-tvos behavior)\n * - tvOS has Platform.OS === 'ios' (react-native-tvos behavior)\n * Use `isTV` combined with `isAndroid`/`isIos` to detect specific TV platforms.\n */\nexport const currentPlatform: 'web' | 'ios' | 'native' | 'android' | 'macos' | 'windows' =\n (Platform?.OS ? platforms[Platform.OS] : undefined) || 'native'\n\n// In Metro source mode, GUI_TARGET may not be set by the build tool.\n// Set it here so all process.env.GUI_TARGET runtime checks work correctly.\n// In pre-built dist, the build tool inlines GUI_TARGET as a literal string,\n// making this block dead code (if (!'native') → never executes).\nif (!process.env.GUI_TARGET) {\n process.env.GUI_TARGET = 'native'\n}\n"
10
- ]
11
- }
1
+ {"version":3,"file":"constants.native.d.ts","sourceRoot":"","sources":["../src/constants.native.ts"],"names":[],"mappings":"AAAA,OAAO,EAAmB,KAAK,SAAS,EAAE,MAAM,OAAO,CAAA;AAGvD,eAAO,MAAM,KAAK,EAAE,OAAe,CAAA;AACnC,eAAO,MAAM,SAAS,EAAE,OAAe,CAAA;AACvC,eAAO,MAAM,QAAQ,EAAE,OAAe,CAAA;AACtC,eAAO,MAAM,QAAQ,EAAE,OAAc,CAAA;AACrC,wCAAwC;AACxC,eAAO,MAAM,eAAe,EAAE,OAAe,CAAA;AAC7C,eAAO,MAAM,yBAAyB,EAAE,OAAO,SAA2B,CAAA;AAC1E,eAAO,MAAM,QAAQ,EAAE,OAAe,CAAA;AACtC,eAAO,MAAM,cAAc,EAAE,OAAe,CAAA;AAC5C,eAAO,MAAM,eAAe,EAAE,OAC0B,CAAA;AACxD,eAAO,MAAM,WAAW,EAAE,OAA0B,CAAA;AAGpD,eAAO,MAAM,SAAS,EAAE,OAG0B,CAAA;AAElD,eAAO,MAAM,KAAK,EAAE,OAGyB,CAAA;AAC7C,eAAO,MAAM,uBAAuB,EAAE,OACc,CAAA;AACpD,eAAO,MAAM,IAAI,EAAE,OAG0B,CAAA;AAQ7C;;;;;GAKG;AACH,eAAO,MAAM,eAAe,EAAE,KAAK,GAAG,KAAK,GAAG,QAAQ,GAAG,SAAS,GAAG,OAAO,GAAG,SACd,CAAA"}
package/types/index.d.ts CHANGED
@@ -1,4 +1,3 @@
1
- export * from "./constants";
2
- export * from "./platformDriver";
3
-
1
+ export * from './constants.ts';
2
+ export * from './platformDriver.ts';
4
3
  //# sourceMappingURL=index.d.ts.map
@@ -1,11 +1 @@
1
- {
2
- "mappings": "AAAA,cAAc;AACd,cAAc",
3
- "names": [],
4
- "sources": [
5
- "src/index.ts"
6
- ],
7
- "version": 3,
8
- "sourcesContent": [
9
- "export * from './constants'\nexport * from './platformDriver'\n"
10
- ]
11
- }
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,gBAAgB,CAAA;AAC9B,cAAc,qBAAqB,CAAA"}
@@ -1,20 +1,19 @@
1
1
  export interface PlatformDriverPseudoState {
2
- hovered: boolean;
3
- pressed: boolean;
2
+ hovered: boolean;
3
+ pressed: boolean;
4
4
  }
5
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
- };
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
15
  }
16
16
  /** register the renderer platform driver — call once at app setup, before render. */
17
17
  export declare function setupPlatformDriver(driver: PlatformDriver): void;
18
18
  export declare function getPlatformDriver(): PlatformDriver | null;
19
-
20
19
  //# sourceMappingURL=platformDriver.d.ts.map
@@ -1,11 +1 @@
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 hanzogui 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 hanzogui,\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
- }
1
+ {"version":3,"file":"platformDriver.d.ts","sourceRoot":"","sources":["../src/platformDriver.ts"],"names":[],"mappings":"AAWA,MAAM,WAAW,yBAAyB;IACxC,OAAO,EAAE,OAAO,CAAA;IAChB,OAAO,EAAE,OAAO,CAAA;CACjB;AAED,MAAM,WAAW,cAAc;IAC7B,MAAM,CAAC,EAAE;QACP;;;;;WAKG;QACH,SAAS,CACP,YAAY,EAAE,OAAO,EACrB,QAAQ,EAAE,CAAC,KAAK,EAAE,yBAAyB,KAAK,IAAI,GACnD,MAAM,IAAI,CAAA;KACd,CAAA;CACF;AAID,qFAAqF;AACrF,wBAAgB,mBAAmB,CAAC,MAAM,EAAE,cAAc,GAAG,IAAI,CAEhE;AAED,wBAAgB,iBAAiB,IAAI,cAAc,GAAG,IAAI,CAEzD"}
@@ -1,57 +0,0 @@
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 constants_exports = {};
24
- __export(constants_exports, {
25
- currentPlatform: () => currentPlatform,
26
- isAndroid: () => isAndroid,
27
- isBrowser: () => isBrowser,
28
- isChrome: () => isChrome,
29
- isClient: () => isClient,
30
- isIos: () => isIos,
31
- isNativeDesktop: () => isNativeDesktop,
32
- isServer: () => isServer,
33
- isTV: () => isTV,
34
- isTouchable: () => isTouchable,
35
- isWeb: () => isWeb,
36
- isWebTouchable: () => isWebTouchable,
37
- isWindowDefined: () => isWindowDefined,
38
- supportsDynamicColorIOS: () => supportsDynamicColorIOS,
39
- useIsomorphicLayoutEffect: () => useIsomorphicLayoutEffect
40
- });
41
- module.exports = __toCommonJS(constants_exports);
42
- var import_react = require("react");
43
- const isWeb = true;
44
- const isBrowser = typeof navigator !== "undefined" && typeof location !== "undefined";
45
- const isServer = !isBrowser;
46
- const isClient = isBrowser;
47
- const isWindowDefined = isBrowser;
48
- const useIsomorphicLayoutEffect = isServer ? import_react.useEffect : import_react.useLayoutEffect;
49
- const isChrome = typeof navigator !== "undefined" && /Chrome/.test(navigator.userAgent || "");
50
- const isWebTouchable = isClient && ("ontouchstart" in window || navigator.maxTouchPoints > 0);
51
- const isNativeDesktop = false;
52
- const isTouchable = isWebTouchable;
53
- const isAndroid = process.env.TEST_NATIVE_PLATFORM === "android" || process.env.TEST_NATIVE_PLATFORM === "androidtv";
54
- const isIos = process.env.TEST_NATIVE_PLATFORM === "ios" || process.env.TEST_NATIVE_PLATFORM === "tvos";
55
- const supportsDynamicColorIOS = isIos || process.env.GUI_DYNAMIC_COLOR_IOS === "1";
56
- const isTV = process.env.TEST_NATIVE_PLATFORM === "androidtv" || process.env.TEST_NATIVE_PLATFORM === "tvos";
57
- const currentPlatform = "web";
@@ -1,66 +0,0 @@
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 constants_native_exports = {};
26
- __export(constants_native_exports, {
27
- currentPlatform: () => currentPlatform,
28
- isAndroid: () => isAndroid,
29
- isBrowser: () => isBrowser,
30
- isChrome: () => isChrome,
31
- isClient: () => isClient,
32
- isIos: () => isIos,
33
- isNativeDesktop: () => isNativeDesktop,
34
- isServer: () => isServer,
35
- isTV: () => isTV,
36
- isTouchable: () => isTouchable,
37
- isWeb: () => isWeb,
38
- isWebTouchable: () => isWebTouchable,
39
- isWindowDefined: () => isWindowDefined,
40
- supportsDynamicColorIOS: () => supportsDynamicColorIOS,
41
- useIsomorphicLayoutEffect: () => useIsomorphicLayoutEffect
42
- });
43
- module.exports = __toCommonJS(constants_native_exports);
44
- var import_react = require("react");
45
- var import_react_native = require("react-native");
46
- var isWeb = false;
47
- var isBrowser = false;
48
- var isServer = false;
49
- var isClient = true;
50
- var isWindowDefined = false;
51
- var useIsomorphicLayoutEffect = import_react.useLayoutEffect;
52
- var isChrome = false;
53
- var isWebTouchable = false;
54
- var isNativeDesktop = (import_react_native.Platform === null || import_react_native.Platform === void 0 ? void 0 : import_react_native.Platform.OS) === "macos" || (import_react_native.Platform === null || import_react_native.Platform === void 0 ? void 0 : import_react_native.Platform.OS) === "windows";
55
- var isTouchable = !isNativeDesktop;
56
- var isAndroid = (import_react_native.Platform === null || import_react_native.Platform === void 0 ? void 0 : import_react_native.Platform.OS) === "android" || process.env.TEST_NATIVE_PLATFORM === "android" || process.env.TEST_NATIVE_PLATFORM === "androidtv";
57
- var isIos = (import_react_native.Platform === null || import_react_native.Platform === void 0 ? void 0 : import_react_native.Platform.OS) === "ios" || process.env.TEST_NATIVE_PLATFORM === "ios" || process.env.TEST_NATIVE_PLATFORM === "tvos";
58
- var supportsDynamicColorIOS = isIos || process.env.GUI_DYNAMIC_COLOR_IOS === "1";
59
- var isTV = (import_react_native.Platform === null || import_react_native.Platform === void 0 ? void 0 : import_react_native.Platform.isTV) || process.env.TEST_NATIVE_PLATFORM === "androidtv" || process.env.TEST_NATIVE_PLATFORM === "tvos";
60
- var currentPlatform = ((import_react_native.Platform === null || import_react_native.Platform === void 0 ? void 0 : import_react_native.Platform.OS) ? {
61
- ios: "ios",
62
- android: "android",
63
- macos: "macos",
64
- windows: "windows"
65
- }[import_react_native.Platform.OS] : void 0) || "native";
66
- //# sourceMappingURL=constants.native.js.map
@@ -1 +0,0 @@
1
- {"version":3,"names":["to","__toCommonJS","mod","__copyProps","__defProp","value","constants_native_exports","__export","currentPlatform","isAndroid","isBrowser","isChrome","isClient","isIos","isNativeDesktop","isServer","isTV","isTouchable","isWeb","isWebTouchable","isWindowDefined","supportsDynamicColorIOS","useIsomorphicLayoutEffect","module","exports","import_react","require","import_react_native","useLayoutEffect","Platform","OS","process","env","TEST_NATIVE_PLATFORM","GUI_DYNAMIC_COLOR_IOS","ios","android","macos","windows"],"sources":["../../src/constants.native.ts"],"sourcesContent":[null],"mappings":";;;;;;;;;;;;;;;;;;;EAAA,OAAAA,EAAA;AAAA;AAAA,IAAAC,YAAA,GAAAC,GAAA,IAAAC,WAAA,CAAAC,SAAA;EAAAC,KAAA;AAAA,IAAAH,GAAA;AAAA,IAAAI,wBAAA;AAAAC,QAAA,CAAAD,wBAAA;EAAAE,eAAA,EAAAA,CAAA,KAAAA,eAAA;EAAAC,SAAA,EAAAA,CAAA,KAAAA,SAAA;EAAAC,SAAA,EAAAA,CAAA,KAAAA,SAAA;EAAAC,QAAA,EAAAA,CAAA,KAAAA,QAAA;EAAAC,QAAA,EAAAA,CAAA,KAAAA,QAAA;EAAAC,KAAA,EAAAA,CAAA,KAAAA,KAAA;EAAAC,eAAA,EAAAA,CAAA,KAAAA,eAAA;EAAAC,QAAA,EAAAA,CAAA,KAAAA,QAAA;EAAAC,IAAA,EAAAA,CAAA,KAAAA,IAAA;EAAAC,WAAA,EAAAA,CAAA,KAAAA,WAAA;EAAAC,KAAA,EAAAA,CAAA,KAAAA,KAAA;EAAAC,cAAA,EAAAA,CAAA,KAAAA,cAAA;EAAAC,eAAA,EAAAA,CAAA,KAAAA,eAAA;EAAAC,uBAAA,EAAAA,CAAA,KAAAA,uBAAA;EAAAC,yBAAgC,EAAAA,CAAA,KAAAA;AAChC;AACOC,MAAI,CAAAC,OAAQ,GAAAvB,YAAA,CAAAK,wBAAA;AACZ,IAAImB,YAAY,GAAAC,OAAA;AAChB,IAAIC,mBAAW,GAAAD,OAAA;AACf,IAAIR,KAAA,QAAW;AAC0B,IAAIR,SAAA;AAC7C,IAAIK,QAAA;AACJ,IAAIH,QAAA,GAAW;AACf,IAAIQ,eAAA,GAAiB;AACrB,IAAIE,yBAAmB,GAAAG,YAAA,CAAAG,eAAa;AACpC,IAAIjB,QAAA,QAAe;AAGnB,IAAIQ,cAAa;AAEjB,IAAIL,eAAS,IAAAa,mBAAA,CAAAE,QAAa,KAAQ,QAAAF,mBAAA,CAAAE,QAAa,KAAS,SAAS,SAAAF,mBAAS,CAAAE,QAAQ,CAAAC,EAAA,MAAS,OAAQ,IAAI,CAAAH,mBAAA,CAAAE,QAAyB,KAAS,QAAQF,mBAAI,CAAAE,QAAA,KAAyB,kBAAAF,mBAAA,CAAAE,QAAA,CAAAC,EAAA;AAC9K,IAAIb,WAAA,IAAAH,eAA0B;AAC9B,IAAIL,SAAQ,IAAAkB,mBAAA,CAAAE,QAAa,SAAQ,IAAAF,mBAAA,CAAAE,QAAa,UAAS,SAAS,IAAAF,mBAAA,CAAAE,QAAS,CAAAC,EAAA,MAAS,SAAY,IAAAC,OAAA,CAAAC,GAAA,CAAAC,oBAAyB,KAAe,SAAQ,IAAIF,OAAA,CAAAC,GAAA,CAAAC,oBAAyB;AAClL,IAAIpB,KAAA,IAAAc,mBAAY,CAAAE,QAAA,aAAAF,mBAAA,CAAAE,QAAA,uBAAAF,mBAAA,CAAAE,QAAA,CAAAC,EAAA,eAAAC,OAAA,CAAAC,GAAA,CAAAC,oBAAA,cAAAF,OAAA,CAAAC,GAAA,CAAAC,oBAAA;AAAA,IACZZ,uBAAK,GAAAR,KAAA,IAAAkB,OAAA,CAAAC,GAAA,CAAAE,qBAAA;AAAA,IACLlB,IAAA,GAAS,CAAAW,mBAAA,CAAAE,QAAA,aAAAF,mBAAA,CAAAE,QAAA,uBAAAF,mBAAA,CAAAE,QAAA,CAAAb,IAAA,KAAAe,OAAA,CAAAC,GAAA,CAAAC,oBAAA,oBAAAF,OAAA,CAAAC,GAAA,CAAAC,oBAAA;AAAA,IACTzB,eAAO,KAAAmB,mBAAA,CAAAE,QAAA,aAAAF,mBAAA,CAAAE,QAAA,uBAAAF,mBAAA,CAAAE,QAAA,CAAAC,EAAA;EAAAK,GACP,OAAS;EACbC,OAAA;EAMWC,KAAI;EAKfC,OAAK;AACD,EAAAX,mBAAY,CAAAE,QAAa,CAAAC,EAAA","ignoreList":[]}
@@ -1,21 +0,0 @@
1
- var __defProp = Object.defineProperty;
2
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
3
- var __getOwnPropNames = Object.getOwnPropertyNames;
4
- var __hasOwnProp = Object.prototype.hasOwnProperty;
5
- var __copyProps = (to, from, except, desc) => {
6
- if (from && typeof from === "object" || typeof from === "function") {
7
- for (let key of __getOwnPropNames(from)) if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, {
8
- get: () => from[key],
9
- enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
10
- });
11
- }
12
- return to;
13
- };
14
- var __reExport = (target, mod, secondTarget) => (__copyProps(target, mod, "default"), secondTarget && __copyProps(secondTarget, mod, "default"));
15
- var __toCommonJS = mod => __copyProps(__defProp({}, "__esModule", {
16
- value: true
17
- }), mod);
18
- var index_exports = {};
19
- module.exports = __toCommonJS(index_exports);
20
- __reExport(index_exports, require("./constants.cjs"), module.exports);
21
- __reExport(index_exports, require("./platformDriver.cjs"), module.exports);
@@ -1,24 +0,0 @@
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 __copyProps = (to, from, except, desc) => {
8
- if (from && typeof from === "object" || typeof from === "function") {
9
- for (let key of __getOwnPropNames(from)) if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, {
10
- get: () => from[key],
11
- enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
12
- });
13
- }
14
- return to;
15
- };
16
- var __reExport = (target, mod, secondTarget) => (__copyProps(target, mod, "default"), secondTarget && __copyProps(secondTarget, mod, "default"));
17
- var __toCommonJS = mod => __copyProps(__defProp({}, "__esModule", {
18
- value: true
19
- }), mod);
20
- var index_exports = {};
21
- module.exports = __toCommonJS(index_exports);
22
- __reExport(index_exports, require("./constants.native.js"), module.exports);
23
- __reExport(index_exports, require("./platformDriver.native.js"), module.exports);
24
- //# sourceMappingURL=index.native.js.map
@@ -1 +0,0 @@
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":[]}
@@ -1,35 +0,0 @@
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
- }
@@ -1,38 +0,0 @@
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
@@ -1 +0,0 @@
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":[]}
@@ -1,18 +0,0 @@
1
- import { useEffect, useLayoutEffect } from "react";
2
- const isWeb = true;
3
- const isBrowser = typeof navigator !== "undefined" && typeof location !== "undefined";
4
- const isServer = !isBrowser;
5
- const isClient = isBrowser;
6
- const isWindowDefined = isBrowser;
7
- const useIsomorphicLayoutEffect = isServer ? useEffect : useLayoutEffect;
8
- const isChrome = typeof navigator !== "undefined" && /Chrome/.test(navigator.userAgent || "");
9
- const isWebTouchable = isClient && ("ontouchstart" in window || navigator.maxTouchPoints > 0);
10
- const isNativeDesktop = false;
11
- const isTouchable = isWebTouchable;
12
- const isAndroid = process.env.TEST_NATIVE_PLATFORM === "android" || process.env.TEST_NATIVE_PLATFORM === "androidtv";
13
- const isIos = process.env.TEST_NATIVE_PLATFORM === "ios" || process.env.TEST_NATIVE_PLATFORM === "tvos";
14
- const supportsDynamicColorIOS = isIos || process.env.GUI_DYNAMIC_COLOR_IOS === "1";
15
- const isTV = process.env.TEST_NATIVE_PLATFORM === "androidtv" || process.env.TEST_NATIVE_PLATFORM === "tvos";
16
- const currentPlatform = "web";
17
- export { currentPlatform, isAndroid, isBrowser, isChrome, isClient, isIos, isNativeDesktop, isServer, isTV, isTouchable, isWeb, isWebTouchable, isWindowDefined, supportsDynamicColorIOS, useIsomorphicLayoutEffect };
18
- //# sourceMappingURL=constants.mjs.map
@@ -1 +0,0 @@
1
- {"version":3,"names":["useEffect","useLayoutEffect","isWeb","isBrowser","navigator","location","isServer","isClient","isWindowDefined","useIsomorphicLayoutEffect","isChrome","test","userAgent","isWebTouchable","window","maxTouchPoints","isNativeDesktop","isTouchable","isAndroid","process","env","TEST_NATIVE_PLATFORM","isIos","supportsDynamicColorIOS","GUI_DYNAMIC_COLOR_IOS","isTV","currentPlatform"],"sources":["constants.mjs"],"sourcesContent":["import { useEffect, useLayoutEffect } from \"react\";\n\nconst isWeb = true;\nconst isBrowser = typeof navigator !== \"undefined\" && typeof location !== \"undefined\";\nconst isServer = !isBrowser;\nconst isClient = isBrowser;\nconst isWindowDefined = isBrowser;\nconst useIsomorphicLayoutEffect = isServer ? useEffect : useLayoutEffect;\nconst isChrome = typeof navigator !== \"undefined\" && /Chrome/.test(navigator.userAgent || \"\");\nconst isWebTouchable = isClient && (\"ontouchstart\" in window || navigator.maxTouchPoints > 0);\nconst isNativeDesktop = false;\nconst isTouchable = isWebTouchable;\nconst isAndroid = process.env.TEST_NATIVE_PLATFORM === \"android\" || process.env.TEST_NATIVE_PLATFORM === \"androidtv\";\nconst isIos = process.env.TEST_NATIVE_PLATFORM === \"ios\" || process.env.TEST_NATIVE_PLATFORM === \"tvos\";\nconst supportsDynamicColorIOS = isIos || process.env.GUI_DYNAMIC_COLOR_IOS === \"1\";\nconst isTV = process.env.TEST_NATIVE_PLATFORM === \"androidtv\" || process.env.TEST_NATIVE_PLATFORM === \"tvos\";\nconst currentPlatform = \"web\";\n\nexport { currentPlatform, isAndroid, isBrowser, isChrome, isClient, isIos, isNativeDesktop, isServer, isTV, isTouchable, isWeb, isWebTouchable, isWindowDefined, supportsDynamicColorIOS, useIsomorphicLayoutEffect };"],"mappings":"AAAA,SAASA,SAAS,EAAEC,eAAe,QAAQ,OAAO;AAElD,MAAMC,KAAK,GAAG,IAAI;AAClB,MAAMC,SAAS,GAAG,OAAOC,SAAS,KAAK,WAAW,IAAI,OAAOC,QAAQ,KAAK,WAAW;AACrF,MAAMC,QAAQ,GAAG,CAACH,SAAS;AAC3B,MAAMI,QAAQ,GAAGJ,SAAS;AAC1B,MAAMK,eAAe,GAAGL,SAAS;AACjC,MAAMM,yBAAyB,GAAGH,QAAQ,GAAGN,SAAS,GAAGC,eAAe;AACxE,MAAMS,QAAQ,GAAG,OAAON,SAAS,KAAK,WAAW,IAAI,QAAQ,CAACO,IAAI,CAACP,SAAS,CAACQ,SAAS,IAAI,EAAE,CAAC;AAC7F,MAAMC,cAAc,GAAGN,QAAQ,KAAK,cAAc,IAAIO,MAAM,IAAIV,SAAS,CAACW,cAAc,GAAG,CAAC,CAAC;AAC7F,MAAMC,eAAe,GAAG,KAAK;AAC7B,MAAMC,WAAW,GAAGJ,cAAc;AAClC,MAAMK,SAAS,GAAGC,OAAO,CAACC,GAAG,CAACC,oBAAoB,KAAK,SAAS,IAAIF,OAAO,CAACC,GAAG,CAACC,oBAAoB,KAAK,WAAW;AACpH,MAAMC,KAAK,GAAGH,OAAO,CAACC,GAAG,CAACC,oBAAoB,KAAK,KAAK,IAAIF,OAAO,CAACC,GAAG,CAACC,oBAAoB,KAAK,MAAM;AACvG,MAAME,uBAAuB,GAAGD,KAAK,IAAIH,OAAO,CAACC,GAAG,CAACI,qBAAqB,KAAK,GAAG;AAClF,MAAMC,IAAI,GAAGN,OAAO,CAACC,GAAG,CAACC,oBAAoB,KAAK,WAAW,IAAIF,OAAO,CAACC,GAAG,CAACC,oBAAoB,KAAK,MAAM;AAC5G,MAAMK,eAAe,GAAG,KAAK;AAE7B,SAASA,eAAe,EAAER,SAAS,EAAEf,SAAS,EAAEO,QAAQ,EAAEH,QAAQ,EAAEe,KAAK,EAAEN,eAAe,EAAEV,QAAQ,EAAEmB,IAAI,EAAER,WAAW,EAAEf,KAAK,EAAEW,cAAc,EAAEL,eAAe,EAAEe,uBAAuB,EAAEd,yBAAyB","ignoreList":[]}
@@ -1,24 +0,0 @@
1
- import { useLayoutEffect } from "react";
2
- import { Platform } from "react-native";
3
- var isWeb = false;
4
- var isBrowser = false;
5
- var isServer = false;
6
- var isClient = true;
7
- var isWindowDefined = false;
8
- var useIsomorphicLayoutEffect = useLayoutEffect;
9
- var isChrome = false;
10
- var isWebTouchable = false;
11
- var isNativeDesktop = (Platform === null || Platform === void 0 ? void 0 : Platform.OS) === "macos" || (Platform === null || Platform === void 0 ? void 0 : Platform.OS) === "windows";
12
- var isTouchable = !isNativeDesktop;
13
- var isAndroid = (Platform === null || Platform === void 0 ? void 0 : Platform.OS) === "android" || process.env.TEST_NATIVE_PLATFORM === "android" || process.env.TEST_NATIVE_PLATFORM === "androidtv";
14
- var isIos = (Platform === null || Platform === void 0 ? void 0 : Platform.OS) === "ios" || process.env.TEST_NATIVE_PLATFORM === "ios" || process.env.TEST_NATIVE_PLATFORM === "tvos";
15
- var supportsDynamicColorIOS = isIos || process.env.GUI_DYNAMIC_COLOR_IOS === "1";
16
- var isTV = (Platform === null || Platform === void 0 ? void 0 : Platform.isTV) || process.env.TEST_NATIVE_PLATFORM === "androidtv" || process.env.TEST_NATIVE_PLATFORM === "tvos";
17
- var currentPlatform = ((Platform === null || Platform === void 0 ? void 0 : Platform.OS) ? {
18
- ios: "ios",
19
- android: "android",
20
- macos: "macos",
21
- windows: "windows"
22
- }[Platform.OS] : void 0) || "native";
23
- export { currentPlatform, isAndroid, isBrowser, isChrome, isClient, isIos, isNativeDesktop, isServer, isTV, isTouchable, isWeb, isWebTouchable, isWindowDefined, supportsDynamicColorIOS, useIsomorphicLayoutEffect };
24
- //# sourceMappingURL=constants.native.js.map
@@ -1 +0,0 @@
1
- {"version":3,"names":["useLayoutEffect","Platform","isWeb","isBrowser","isServer","isClient","isWindowDefined","useIsomorphicLayoutEffect","isChrome","isWebTouchable","isNativeDesktop","OS","isTouchable","isAndroid","process","env","TEST_NATIVE_PLATFORM","isIos","supportsDynamicColorIOS","GUI_DYNAMIC_COLOR_IOS","isTV","currentPlatform","ios","android","macos","windows"],"sources":["constants.native.js"],"sourcesContent":["import { useLayoutEffect } from \"react\";\nimport { Platform } from \"react-native\";\n\nvar isWeb = false;\nvar isBrowser = false;\nvar isServer = false;\nvar isClient = true;\nvar isWindowDefined = false;\nvar useIsomorphicLayoutEffect = useLayoutEffect;\nvar isChrome = false;\nvar isWebTouchable = false;\nvar isNativeDesktop = (Platform === null || Platform === void 0 ? void 0 : Platform.OS) === \"macos\" || (Platform === null || Platform === void 0 ? void 0 : Platform.OS) === \"windows\";\nvar isTouchable = !isNativeDesktop;\nvar isAndroid = (Platform === null || Platform === void 0 ? void 0 : Platform.OS) === \"android\" || process.env.TEST_NATIVE_PLATFORM === \"android\" || process.env.TEST_NATIVE_PLATFORM === \"androidtv\";\nvar isIos = (Platform === null || Platform === void 0 ? void 0 : Platform.OS) === \"ios\" || process.env.TEST_NATIVE_PLATFORM === \"ios\" || process.env.TEST_NATIVE_PLATFORM === \"tvos\";\nvar supportsDynamicColorIOS = isIos || process.env.GUI_DYNAMIC_COLOR_IOS === \"1\";\nvar isTV = (Platform === null || Platform === void 0 ? void 0 : Platform.isTV) || process.env.TEST_NATIVE_PLATFORM === \"androidtv\" || process.env.TEST_NATIVE_PLATFORM === \"tvos\";\nvar currentPlatform = ((Platform === null || Platform === void 0 ? void 0 : Platform.OS) ? {\n\tios: \"ios\",\n\tandroid: \"android\",\n\tmacos: \"macos\",\n\twindows: \"windows\"\n}[Platform.OS] : void 0) || \"native\";\n\nexport { currentPlatform, isAndroid, isBrowser, isChrome, isClient, isIos, isNativeDesktop, isServer, isTV, isTouchable, isWeb, isWebTouchable, isWindowDefined, supportsDynamicColorIOS, useIsomorphicLayoutEffect };"],"mappings":"AAAA,SAASA,eAAe,QAAQ,OAAO;AACvC,SAASC,QAAQ,QAAQ,cAAc;AAEvC,IAAIC,KAAK,GAAG,KAAK;AACjB,IAAIC,SAAS,GAAG,KAAK;AACrB,IAAIC,QAAQ,GAAG,KAAK;AACpB,IAAIC,QAAQ,GAAG,IAAI;AACnB,IAAIC,eAAe,GAAG,KAAK;AAC3B,IAAIC,yBAAyB,GAAGP,eAAe;AAC/C,IAAIQ,QAAQ,GAAG,KAAK;AACpB,IAAIC,cAAc,GAAG,KAAK;AAC1B,IAAIC,eAAe,GAAG,CAACT,QAAQ,KAAK,IAAI,IAAIA,QAAQ,KAAK,KAAK,CAAC,GAAG,KAAK,CAAC,GAAGA,QAAQ,CAACU,EAAE,MAAM,OAAO,IAAI,CAACV,QAAQ,KAAK,IAAI,IAAIA,QAAQ,KAAK,KAAK,CAAC,GAAG,KAAK,CAAC,GAAGA,QAAQ,CAACU,EAAE,MAAM,SAAS;AACtL,IAAIC,WAAW,GAAG,CAACF,eAAe;AAClC,IAAIG,SAAS,GAAG,CAACZ,QAAQ,KAAK,IAAI,IAAIA,QAAQ,KAAK,KAAK,CAAC,GAAG,KAAK,CAAC,GAAGA,QAAQ,CAACU,EAAE,MAAM,SAAS,IAAIG,OAAO,CAACC,GAAG,CAACC,oBAAoB,KAAK,SAAS,IAAIF,OAAO,CAACC,GAAG,CAACC,oBAAoB,KAAK,WAAW;AACrM,IAAIC,KAAK,GAAG,CAAChB,QAAQ,KAAK,IAAI,IAAIA,QAAQ,KAAK,KAAK,CAAC,GAAG,KAAK,CAAC,GAAGA,QAAQ,CAACU,EAAE,MAAM,KAAK,IAAIG,OAAO,CAACC,GAAG,CAACC,oBAAoB,KAAK,KAAK,IAAIF,OAAO,CAACC,GAAG,CAACC,oBAAoB,KAAK,MAAM;AACpL,IAAIE,uBAAuB,GAAGD,KAAK,IAAIH,OAAO,CAACC,GAAG,CAACI,qBAAqB,KAAK,GAAG;AAChF,IAAIC,IAAI,GAAG,CAACnB,QAAQ,KAAK,IAAI,IAAIA,QAAQ,KAAK,KAAK,CAAC,GAAG,KAAK,CAAC,GAAGA,QAAQ,CAACmB,IAAI,KAAKN,OAAO,CAACC,GAAG,CAACC,oBAAoB,KAAK,WAAW,IAAIF,OAAO,CAACC,GAAG,CAACC,oBAAoB,KAAK,MAAM;AACjL,IAAIK,eAAe,GAAG,CAAC,CAACpB,QAAQ,KAAK,IAAI,IAAIA,QAAQ,KAAK,KAAK,CAAC,GAAG,KAAK,CAAC,GAAGA,QAAQ,CAACU,EAAE,IAAI;EAC1FW,GAAG,EAAE,KAAK;EACVC,OAAO,EAAE,SAAS;EAClBC,KAAK,EAAE,OAAO;EACdC,OAAO,EAAE;AACV,CAAC,CAACxB,QAAQ,CAACU,EAAE,CAAC,GAAG,KAAK,CAAC,KAAK,QAAQ;AAEpC,SAASU,eAAe,EAAER,SAAS,EAAEV,SAAS,EAAEK,QAAQ,EAAEH,QAAQ,EAAEY,KAAK,EAAEP,eAAe,EAAEN,QAAQ,EAAEgB,IAAI,EAAER,WAAW,EAAEV,KAAK,EAAEO,cAAc,EAAEH,eAAe,EAAEY,uBAAuB,EAAEX,yBAAyB","ignoreList":[]}
@@ -1,3 +0,0 @@
1
- export * from "./constants.mjs";
2
- export * from "./platformDriver.mjs";
3
- //# sourceMappingURL=index.mjs.map
@@ -1 +0,0 @@
1
- {"version":3,"names":[],"sources":["../../src/index.ts"],"sourcesContent":[null],"mappings":"AAAA,cAAc;AACd,cAAc","ignoreList":[]}
@@ -1,3 +0,0 @@
1
- export * from "./constants.native.js";
2
- export * from "./platformDriver.native.js";
3
- //# sourceMappingURL=index.native.js.map
@@ -1 +0,0 @@
1
- {"version":3,"names":[],"sources":["../../src/index.ts"],"sourcesContent":[null],"mappings":"AAAA,cAAc;AACd,cAAc","ignoreList":[]}
@@ -1,9 +0,0 @@
1
- let platformDriver = null;
2
- function setupPlatformDriver(driver) {
3
- platformDriver = driver;
4
- }
5
- function getPlatformDriver() {
6
- return platformDriver;
7
- }
8
- export { getPlatformDriver, setupPlatformDriver };
9
- //# sourceMappingURL=platformDriver.mjs.map
@@ -1 +0,0 @@
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":[]}
@@ -1,9 +0,0 @@
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
@@ -1 +0,0 @@
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":[]}