@tamagui/native 2.6.4 → 2.7.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.
Files changed (69) hide show
  1. package/.turbo/turbo-build.log +1 -1
  2. package/dist/cjs/expoUIMenuAdapter.cjs +265 -0
  3. package/dist/cjs/expoUIMenuAdapter.native.js +321 -0
  4. package/dist/cjs/expoUIMenuAdapter.native.js.map +1 -0
  5. package/dist/cjs/index.cjs +5 -2
  6. package/dist/cjs/index.native.js +5 -2
  7. package/dist/cjs/index.native.js.map +1 -1
  8. package/dist/cjs/{zeegoState.cjs → nativeMenuState.cjs} +19 -19
  9. package/dist/cjs/{zeegoState.native.js → nativeMenuState.native.js} +20 -20
  10. package/dist/cjs/nativeMenuState.native.js.map +1 -0
  11. package/dist/cjs/setup-expo-ui-menu.cjs +17 -0
  12. package/dist/cjs/setup-expo-ui-menu.native.js +20 -0
  13. package/dist/cjs/setup-expo-ui-menu.native.js.map +1 -0
  14. package/dist/cjs/setup-zeego.cjs +11 -13
  15. package/dist/cjs/setup-zeego.native.js +11 -13
  16. package/dist/cjs/setup-zeego.native.js.map +1 -1
  17. package/dist/esm/expoUIMenuAdapter.mjs +229 -0
  18. package/dist/esm/expoUIMenuAdapter.mjs.map +1 -0
  19. package/dist/esm/expoUIMenuAdapter.native.js +282 -0
  20. package/dist/esm/expoUIMenuAdapter.native.js.map +1 -0
  21. package/dist/esm/index.js +3 -2
  22. package/dist/esm/index.js.map +1 -1
  23. package/dist/esm/index.mjs +3 -2
  24. package/dist/esm/index.mjs.map +1 -1
  25. package/dist/esm/index.native.js +3 -2
  26. package/dist/esm/index.native.js.map +1 -1
  27. package/dist/esm/nativeMenuState.mjs +20 -0
  28. package/dist/esm/nativeMenuState.mjs.map +1 -0
  29. package/dist/esm/nativeMenuState.native.js +20 -0
  30. package/dist/esm/nativeMenuState.native.js.map +1 -0
  31. package/dist/esm/setup-expo-ui-menu.mjs +18 -0
  32. package/dist/esm/setup-expo-ui-menu.mjs.map +1 -0
  33. package/dist/esm/setup-expo-ui-menu.native.js +18 -0
  34. package/dist/esm/setup-expo-ui-menu.native.js.map +1 -0
  35. package/dist/esm/setup-zeego.mjs +11 -13
  36. package/dist/esm/setup-zeego.mjs.map +1 -1
  37. package/dist/esm/setup-zeego.native.js +11 -13
  38. package/dist/esm/setup-zeego.native.js.map +1 -1
  39. package/package.json +14 -2
  40. package/setup-expo-ui-menu/index.cjs +1 -0
  41. package/setup-expo-ui-menu/index.js +1 -0
  42. package/setup-expo-ui-menu/index.native.cjs +1 -0
  43. package/setup-expo-ui-menu/index.native.js +1 -0
  44. package/setup-expo-ui-menu.cjs +1 -0
  45. package/src/expoUIMenuAdapter.tsx +320 -0
  46. package/src/index.ts +5 -4
  47. package/src/nativeMenuState.ts +63 -0
  48. package/src/setup-expo-ui-menu.ts +25 -0
  49. package/src/setup-zeego.ts +12 -16
  50. package/src/types.ts +0 -6
  51. package/types/expoUIMenuAdapter.d.ts +8 -0
  52. package/types/expoUIMenuAdapter.d.ts.map +11 -0
  53. package/types/index.d.ts +5 -3
  54. package/types/index.d.ts.map +2 -2
  55. package/types/nativeMenuState.d.ts +38 -0
  56. package/types/nativeMenuState.d.ts.map +11 -0
  57. package/types/setup-expo-ui-menu.d.ts +3 -0
  58. package/types/setup-expo-ui-menu.d.ts.map +11 -0
  59. package/types/setup-zeego.d.ts.map +1 -1
  60. package/types/types.d.ts +0 -5
  61. package/types/types.d.ts.map +2 -2
  62. package/dist/cjs/zeegoState.native.js.map +0 -1
  63. package/dist/esm/zeegoState.mjs +0 -21
  64. package/dist/esm/zeegoState.mjs.map +0 -1
  65. package/dist/esm/zeegoState.native.js +0 -21
  66. package/dist/esm/zeegoState.native.js.map +0 -1
  67. package/src/zeegoState.ts +0 -28
  68. package/types/zeegoState.d.ts +0 -9
  69. package/types/zeegoState.d.ts.map +0 -11
@@ -6,6 +6,6 @@
6
6
  ],
7
7
  "version": 3,
8
8
  "sourcesContent": [
9
- "/**\n * Setup zeego for Tamagui native menus.\n *\n * Simply import this module at the top of your app entry point:\n *\n * @example\n * ```tsx\n * import '@tamagui/native/setup-zeego'\n * ```\n *\n * This automatically detects and configures zeego for use with\n * Menu and ContextMenu native mode.\n */\n\nimport { getZeego } from './zeegoState'\n\nfunction setup(): void {\n const g = globalThis as any\n if (g.__tamagui_native_zeego_setup) return\n g.__tamagui_native_zeego_setup = true\n\n try {\n const DropdownMenu = require('zeego/dropdown-menu')\n const ContextMenu = require('zeego/context-menu')\n\n if (DropdownMenu && ContextMenu) {\n getZeego().set({\n enabled: true,\n DropdownMenu,\n ContextMenu,\n })\n }\n } catch (err) {\n if (process.env.NODE_ENV === 'development') {\n console.warn(`Error setting up Zeego`, err)\n }\n // zeego not installed\n }\n}\n\n// run setup immediately on import\nsetup()\n"
9
+ "/**\n * Setup zeego for Tamagui native menus.\n *\n * Simply import this module at the top of your app entry point:\n *\n * @example\n * ```tsx\n * import '@tamagui/native/setup-zeego'\n * ```\n *\n * This automatically detects and configures zeego for use with\n * Menu and ContextMenu native mode.\n */\n\nimport { registerNativeMenuAdapter } from './nativeMenuState'\n\nfunction setup(): void {\n let Menu\n let ContextMenu\n try {\n Menu = require('zeego/dropdown-menu')\n ContextMenu = require('zeego/context-menu')\n } catch (err) {\n if (process.env.NODE_ENV === 'development') {\n console.warn(`Error setting up Zeego`, err)\n }\n return\n }\n\n registerNativeMenuAdapter({\n name: 'zeego',\n Menu,\n ContextMenu,\n })\n}\n\n// run setup immediately on import\nsetup()\n"
10
10
  ]
11
11
  }
package/types/types.d.ts CHANGED
@@ -53,11 +53,6 @@ export interface LinearGradientState {
53
53
  enabled: boolean;
54
54
  Component: any;
55
55
  }
56
- export interface ZeegoState {
57
- enabled: boolean;
58
- DropdownMenu: any;
59
- ContextMenu: any;
60
- }
61
56
  export interface BurntState {
62
57
  enabled: boolean;
63
58
  toast: ((options: any) => void) | null;
@@ -1,11 +1,11 @@
1
1
  {
2
- "mappings": "AAAA,cAAc,iB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BAAwB;CACvC;CACA;CACA;CACA;CACA;CACA;CACA;CACA",
3
3
  "names": [],
4
4
  "sources": [
5
5
  "src/types.ts"
6
6
  ],
7
7
  "version": 3,
8
8
  "sourcesContent": [
9
- "import type { ReactNode } from 'react'\n\nexport type NativePortalState = {\n enabled: boolean\n type: 'teleport' | 'legacy' | null\n}\n\nexport interface GestureState {\n enabled: boolean\n Gesture: any\n GestureDetector: any\n ScrollView: any\n // rngh's GestureHandlerRootView. native portals can render outside the app's\n // root gesture view, so components that portal rngh gestures need to\n // re-establish one around their content.\n RootView: any\n}\n\nexport interface WorkletsState {\n enabled: boolean\n Worklets: any\n useRunOnJS: any\n useWorklet: any\n createWorkletContextValue: any\n}\n\nexport interface SafeAreaInsets {\n top: number\n right: number\n bottom: number\n left: number\n}\n\nexport interface SafeAreaFrame {\n x: number\n y: number\n width: number\n height: number\n}\n\nexport interface SafeAreaMetrics {\n insets: SafeAreaInsets\n frame: SafeAreaFrame\n}\n\nexport interface SafeAreaState {\n enabled: boolean\n useSafeAreaInsets: (() => SafeAreaInsets) | null\n useSafeAreaFrame: (() => SafeAreaFrame) | null\n initialMetrics: SafeAreaMetrics | null\n}\n\nexport type NativePortalProps = {\n hostName?: string\n children: ReactNode\n}\n\nexport type NativePortalHostProps = {\n name: string\n}\n\nexport type NativePortalProviderProps = {\n children: ReactNode\n}\n\nexport interface LinearGradientState {\n enabled: boolean\n Component: any\n}\n\nexport interface ZeegoState {\n enabled: boolean\n DropdownMenu: any\n ContextMenu: any\n}\n\nexport interface BurntState {\n enabled: boolean\n toast: ((options: any) => void) | null\n dismissAllAlerts: (() => void) | null\n}\n\nexport interface KeyboardControllerState {\n enabled: boolean\n KeyboardProvider: any\n KeyboardAwareScrollView: any\n useKeyboardHandler: any\n useReanimatedKeyboardAnimation: any\n KeyboardController: any\n KeyboardEvents: any\n KeyboardStickyView: any\n}\n"
9
+ "import type { ReactNode } from 'react'\n\nexport type NativePortalState = {\n enabled: boolean\n type: 'teleport' | 'legacy' | null\n}\n\nexport interface GestureState {\n enabled: boolean\n Gesture: any\n GestureDetector: any\n ScrollView: any\n // rngh's GestureHandlerRootView. native portals can render outside the app's\n // root gesture view, so components that portal rngh gestures need to\n // re-establish one around their content.\n RootView: any\n}\n\nexport interface WorkletsState {\n enabled: boolean\n Worklets: any\n useRunOnJS: any\n useWorklet: any\n createWorkletContextValue: any\n}\n\nexport interface SafeAreaInsets {\n top: number\n right: number\n bottom: number\n left: number\n}\n\nexport interface SafeAreaFrame {\n x: number\n y: number\n width: number\n height: number\n}\n\nexport interface SafeAreaMetrics {\n insets: SafeAreaInsets\n frame: SafeAreaFrame\n}\n\nexport interface SafeAreaState {\n enabled: boolean\n useSafeAreaInsets: (() => SafeAreaInsets) | null\n useSafeAreaFrame: (() => SafeAreaFrame) | null\n initialMetrics: SafeAreaMetrics | null\n}\n\nexport type NativePortalProps = {\n hostName?: string\n children: ReactNode\n}\n\nexport type NativePortalHostProps = {\n name: string\n}\n\nexport type NativePortalProviderProps = {\n children: ReactNode\n}\n\nexport interface LinearGradientState {\n enabled: boolean\n Component: any\n}\n\nexport interface BurntState {\n enabled: boolean\n toast: ((options: any) => void) | null\n dismissAllAlerts: (() => void) | null\n}\n\nexport interface KeyboardControllerState {\n enabled: boolean\n KeyboardProvider: any\n KeyboardAwareScrollView: any\n useKeyboardHandler: any\n useReanimatedKeyboardAnimation: any\n KeyboardController: any\n KeyboardEvents: any\n KeyboardStickyView: any\n}\n"
10
10
  ]
11
11
  }
@@ -1 +0,0 @@
1
- {"version":3,"names":["__toCommonJS","mod","__copyProps","__defProp","value","zeegoState_exports","__export","getZeego","module","exports","import_globalState","require","state","createGlobalState","enabled","DropdownMenu","ContextMenu","isEnabled","get","set","newState"],"sources":["../../src/zeegoState.ts"],"sourcesContent":[null],"mappings":";;;;;;;;;;;;;;;;;;;;;AAAA,IAAAA,YAAA,GAAAC,GAAA,IAAAC,WAAA,CAAAC,SAAA;EAAAC,KAAA;AAAA,IAAAH,GAAA;AAAA,IAAAI,kBAAA;AAAAC,QAAA,CAAAD,kBAAA;EAAAE,QAAA,EAAAA,CAAA,KAAAA;AAAA;AAAAC,MAAA,CAAAC,OAAA,GAAAT,YAAkC,CAAAK,kBAAA;AAGlC,IAAAK,kBAAc,GAAAC,OAAA;AAAuC,IACnDC,KAAA,GAAS,IAAAF,kBAAA,CAAAG,iBAAA;EACTC,OAAA,OAAc;EACdC,YAAA,EAAa;EACdC,WAAA;AAQM;AACL,SAAOT,SAAA;EAAA,OACD;IACF,IAAAU,SAAOA,CAAA,EAAM;MACf,OAAAL,KAAA,CAAAM,GAAA,GAAAJ,OAAA;IACA;IACE,IAAAF,KAAOA,CAAA;MACT,OAAAA,KAAA,CAAAM,GAAA;IACA;IACEC,IAAAC,QAAU;MACZR,KAAA,CAAAO,GAAA,CAAAC,QAAA;IACF;EACF","ignoreList":[]}
@@ -1,21 +0,0 @@
1
- import { createGlobalState } from "./globalState.mjs";
2
- const state = createGlobalState(`zeego`, {
3
- enabled: false,
4
- DropdownMenu: null,
5
- ContextMenu: null
6
- });
7
- function getZeego() {
8
- return {
9
- get isEnabled() {
10
- return state.get().enabled;
11
- },
12
- get state() {
13
- return state.get();
14
- },
15
- set(newState) {
16
- state.set(newState);
17
- }
18
- };
19
- }
20
- export { getZeego };
21
- //# sourceMappingURL=zeegoState.mjs.map
@@ -1 +0,0 @@
1
- {"version":3,"names":["createGlobalState","state","enabled","DropdownMenu","ContextMenu","getZeego","isEnabled","get","set","newState"],"sources":["../../src/zeegoState.ts"],"sourcesContent":[null],"mappings":"AAAA,SAASA,iBAAA,QAAyB;AAGlC,MAAMC,KAAA,GAAQD,iBAAA,CAA8B,SAAS;EACnDE,OAAA,EAAS;EACTC,YAAA,EAAc;EACdC,WAAA,EAAa;AACf,CAAC;AAQM,SAASC,SAAA,EAA0B;EACxC,OAAO;IACL,IAAIC,UAAA,EAAqB;MACvB,OAAOL,KAAA,CAAMM,GAAA,CAAI,EAAEL,OAAA;IACrB;IACA,IAAID,MAAA,EAAoB;MACtB,OAAOA,KAAA,CAAMM,GAAA,CAAI;IACnB;IACAC,IAAIC,QAAA,EAA4B;MAC9BR,KAAA,CAAMO,GAAA,CAAIC,QAAQ;IACpB;EACF;AACF","ignoreList":[]}
@@ -1,21 +0,0 @@
1
- import { createGlobalState } from "./globalState.native.js";
2
- var state = createGlobalState(`zeego`, {
3
- enabled: false,
4
- DropdownMenu: null,
5
- ContextMenu: null
6
- });
7
- function getZeego() {
8
- return {
9
- get isEnabled() {
10
- return state.get().enabled;
11
- },
12
- get state() {
13
- return state.get();
14
- },
15
- set(newState) {
16
- state.set(newState);
17
- }
18
- };
19
- }
20
- export { getZeego };
21
- //# sourceMappingURL=zeegoState.native.js.map
@@ -1 +0,0 @@
1
- {"version":3,"names":["createGlobalState","state","enabled","DropdownMenu","ContextMenu","getZeego","isEnabled","get","set","newState"],"sources":["../../src/zeegoState.ts"],"sourcesContent":[null],"mappings":"AAAA,SAASA,iBAAA,QAAyB;AAGlC,IAAAC,KAAM,GAAAD,iBAAQ,QAA8B;EAC1CE,OAAA,EAAS;EACTC,YAAA,EAAc;EACdC,WAAA,EAAa;AACf,CAAC;AAQM,SAASC,SAAA,EAA0B;EACxC,OAAO;IACL,IAAIC,UAAA,EAAqB;MACvB,OAAOL,KAAA,CAAMM,GAAA,CAAI,EAAEL,OAAA;IACrB;IACA,IAAID,MAAA,EAAoB;MACtB,OAAOA,KAAA,CAAMM,GAAA,CAAI;IACnB;IACAC,IAAIC,QAAA,EAA4B;MAC9BR,KAAA,CAAMO,GAAA,CAAIC,QAAQ;IACpB;EACF;AACF","ignoreList":[]}
package/src/zeegoState.ts DELETED
@@ -1,28 +0,0 @@
1
- import { createGlobalState } from './globalState'
2
- import type { ZeegoState } from './types'
3
-
4
- const state = createGlobalState<ZeegoState>(`zeego`, {
5
- enabled: false,
6
- DropdownMenu: null,
7
- ContextMenu: null,
8
- })
9
-
10
- export interface ZeegoAccessor {
11
- readonly isEnabled: boolean
12
- readonly state: ZeegoState
13
- set(newState: ZeegoState): void
14
- }
15
-
16
- export function getZeego(): ZeegoAccessor {
17
- return {
18
- get isEnabled(): boolean {
19
- return state.get().enabled
20
- },
21
- get state(): ZeegoState {
22
- return state.get()
23
- },
24
- set(newState: ZeegoState): void {
25
- state.set(newState)
26
- },
27
- }
28
- }
@@ -1,9 +0,0 @@
1
- import type { ZeegoState } from "./types";
2
- export interface ZeegoAccessor {
3
- readonly isEnabled: boolean;
4
- readonly state: ZeegoState;
5
- set(newState: ZeegoState): void;
6
- }
7
- export declare function getZeego(): ZeegoAccessor;
8
-
9
- //# sourceMappingURL=zeegoState.d.ts.map
@@ -1,11 +0,0 @@
1
- {
2
- "mappings": "AACA,cAAc,kBAAkB;AAQhC,iBAAiB,cAAc;UACpB;UACA,OAAO;CAChB,IAAI,UAAU;;AAGhB,OAAO,iBAAS,YAAY",
3
- "names": [],
4
- "sources": [
5
- "src/zeegoState.ts"
6
- ],
7
- "version": 3,
8
- "sourcesContent": [
9
- "import { createGlobalState } from './globalState'\nimport type { ZeegoState } from './types'\n\nconst state = createGlobalState<ZeegoState>(`zeego`, {\n enabled: false,\n DropdownMenu: null,\n ContextMenu: null,\n})\n\nexport interface ZeegoAccessor {\n readonly isEnabled: boolean\n readonly state: ZeegoState\n set(newState: ZeegoState): void\n}\n\nexport function getZeego(): ZeegoAccessor {\n return {\n get isEnabled(): boolean {\n return state.get().enabled\n },\n get state(): ZeegoState {\n return state.get()\n },\n set(newState: ZeegoState): void {\n state.set(newState)\n },\n }\n}\n"
10
- ]
11
- }