expo-router 7.0.0-canary-20251216-3f01dbf → 7.0.0-canary-20251230-fc48ddc

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 (124) hide show
  1. package/android/build.gradle +2 -2
  2. package/build/color/index.d.ts +44 -0
  3. package/build/color/index.d.ts.map +1 -1
  4. package/build/color/index.js +69 -5
  5. package/build/color/index.js.map +1 -1
  6. package/build/exports.d.ts +1 -0
  7. package/build/exports.d.ts.map +1 -1
  8. package/build/exports.js +3 -1
  9. package/build/exports.js.map +1 -1
  10. package/build/layouts/StackClient.d.ts +1 -1
  11. package/build/layouts/stack-utils/StackHeaderButton.d.ts +77 -2
  12. package/build/layouts/stack-utils/StackHeaderButton.d.ts.map +1 -1
  13. package/build/layouts/stack-utils/StackHeaderButton.js +3 -0
  14. package/build/layouts/stack-utils/StackHeaderButton.js.map +1 -1
  15. package/build/layouts/stack-utils/StackHeaderLeftRight.d.ts.map +1 -1
  16. package/build/layouts/stack-utils/StackHeaderLeftRight.js +7 -5
  17. package/build/layouts/stack-utils/StackHeaderLeftRight.js.map +1 -1
  18. package/build/layouts/stack-utils/StackHeaderMenu.d.ts +83 -7
  19. package/build/layouts/stack-utils/StackHeaderMenu.d.ts.map +1 -1
  20. package/build/layouts/stack-utils/StackHeaderMenu.js +14 -4
  21. package/build/layouts/stack-utils/StackHeaderMenu.js.map +1 -1
  22. package/build/layouts/stack-utils/StackHeaderSpacer.d.ts +7 -1
  23. package/build/layouts/stack-utils/StackHeaderSpacer.d.ts.map +1 -1
  24. package/build/layouts/stack-utils/StackHeaderSpacer.js +5 -2
  25. package/build/layouts/stack-utils/StackHeaderSpacer.js.map +1 -1
  26. package/build/layouts/stack-utils/{StackHeaderItem.d.ts → StackHeaderView.d.ts} +18 -5
  27. package/build/layouts/stack-utils/StackHeaderView.d.ts.map +1 -0
  28. package/build/layouts/stack-utils/{StackHeaderItem.js → StackHeaderView.js} +14 -10
  29. package/build/layouts/stack-utils/StackHeaderView.js.map +1 -0
  30. package/build/layouts/stack-utils/index.d.ts +3 -3
  31. package/build/layouts/stack-utils/index.d.ts.map +1 -1
  32. package/build/layouts/stack-utils/index.js +4 -4
  33. package/build/layouts/stack-utils/index.js.map +1 -1
  34. package/build/layouts/stack-utils/shared.d.ts +4 -42
  35. package/build/layouts/stack-utils/shared.d.ts.map +1 -1
  36. package/build/layouts/stack-utils/shared.js +3 -22
  37. package/build/layouts/stack-utils/shared.js.map +1 -1
  38. package/build/link/ExpoLink.d.ts.map +1 -1
  39. package/build/link/ExpoLink.js +1 -8
  40. package/build/link/ExpoLink.js.map +1 -1
  41. package/build/link/elements.d.ts +42 -13
  42. package/build/link/elements.d.ts.map +1 -1
  43. package/build/link/elements.js +14 -5
  44. package/build/link/elements.js.map +1 -1
  45. package/build/link/preview/native.d.ts +12 -1
  46. package/build/link/preview/native.d.ts.map +1 -1
  47. package/build/link/preview/native.js.map +1 -1
  48. package/build/navigationEvents/index.d.ts +36 -0
  49. package/build/navigationEvents/index.d.ts.map +1 -0
  50. package/build/navigationEvents/index.js +53 -0
  51. package/build/navigationEvents/index.js.map +1 -0
  52. package/build/toolbar/elements.d.ts +331 -16
  53. package/build/toolbar/elements.d.ts.map +1 -1
  54. package/build/toolbar/elements.js +130 -12
  55. package/build/toolbar/elements.js.map +1 -1
  56. package/build/toolbar/index.d.ts +38 -6
  57. package/build/toolbar/index.d.ts.map +1 -1
  58. package/build/toolbar/index.js +36 -1
  59. package/build/toolbar/index.js.map +1 -1
  60. package/build/toolbar/native.ios.d.ts.map +1 -1
  61. package/build/toolbar/native.ios.js.map +1 -1
  62. package/build/toolbar/native.types.d.ts +6 -5
  63. package/build/toolbar/native.types.d.ts.map +1 -1
  64. package/build/toolbar/native.types.js.map +1 -1
  65. package/build/useScreens.d.ts.map +1 -1
  66. package/build/useScreens.js +50 -0
  67. package/build/useScreens.js.map +1 -1
  68. package/build/utils/font.d.ts +9 -0
  69. package/build/utils/font.d.ts.map +1 -0
  70. package/build/utils/font.js +20 -0
  71. package/build/utils/font.js.map +1 -0
  72. package/expo-module.config.json +1 -1
  73. package/ios/LinkPreview/LinkPreviewNativeActionView.swift +103 -86
  74. package/ios/LinkPreview/LinkPreviewNativeModule.swift +35 -8
  75. package/ios/LinkPreview/LinkPreviewNativeNavigation.swift +16 -20
  76. package/ios/LinkPreview/LinkPreviewNativePreviewView.swift +1 -8
  77. package/ios/LinkPreview/LinkPreviewNativeView.swift +48 -50
  78. package/ios/LinkPreview/LinkZoomTransition.swift +8 -10
  79. package/ios/RouterViewWithLogger.swift +5 -0
  80. package/ios/Toolbar/RouterFontUtils.swift +50 -0
  81. package/ios/Toolbar/RouterToolbarHostView.swift +41 -17
  82. package/ios/Toolbar/RouterToolbarItemView.swift +30 -13
  83. package/ios/Toolbar/RouterToolbarModule.swift +28 -0
  84. package/local-maven-repo/expo/modules/router/expo.modules.router/7.0.0-canary-20251230-fc48ddc/expo.modules.router-7.0.0-canary-20251230-fc48ddc.aar +0 -0
  85. package/local-maven-repo/expo/modules/router/expo.modules.router/7.0.0-canary-20251230-fc48ddc/expo.modules.router-7.0.0-canary-20251230-fc48ddc.aar.md5 +1 -0
  86. package/local-maven-repo/expo/modules/router/expo.modules.router/7.0.0-canary-20251230-fc48ddc/expo.modules.router-7.0.0-canary-20251230-fc48ddc.aar.sha1 +1 -0
  87. package/local-maven-repo/expo/modules/router/expo.modules.router/7.0.0-canary-20251230-fc48ddc/expo.modules.router-7.0.0-canary-20251230-fc48ddc.aar.sha256 +1 -0
  88. package/local-maven-repo/expo/modules/router/expo.modules.router/7.0.0-canary-20251230-fc48ddc/expo.modules.router-7.0.0-canary-20251230-fc48ddc.aar.sha512 +1 -0
  89. package/local-maven-repo/expo/modules/router/expo.modules.router/{7.0.0-canary-20251216-3f01dbf/expo.modules.router-7.0.0-canary-20251216-3f01dbf.module → 7.0.0-canary-20251230-fc48ddc/expo.modules.router-7.0.0-canary-20251230-fc48ddc.module} +17 -17
  90. package/local-maven-repo/expo/modules/router/expo.modules.router/7.0.0-canary-20251230-fc48ddc/expo.modules.router-7.0.0-canary-20251230-fc48ddc.module.md5 +1 -0
  91. package/local-maven-repo/expo/modules/router/expo.modules.router/7.0.0-canary-20251230-fc48ddc/expo.modules.router-7.0.0-canary-20251230-fc48ddc.module.sha1 +1 -0
  92. package/local-maven-repo/expo/modules/router/expo.modules.router/7.0.0-canary-20251230-fc48ddc/expo.modules.router-7.0.0-canary-20251230-fc48ddc.module.sha256 +1 -0
  93. package/local-maven-repo/expo/modules/router/expo.modules.router/7.0.0-canary-20251230-fc48ddc/expo.modules.router-7.0.0-canary-20251230-fc48ddc.module.sha512 +1 -0
  94. package/local-maven-repo/expo/modules/router/expo.modules.router/{7.0.0-canary-20251216-3f01dbf/expo.modules.router-7.0.0-canary-20251216-3f01dbf.pom → 7.0.0-canary-20251230-fc48ddc/expo.modules.router-7.0.0-canary-20251230-fc48ddc.pom} +1 -1
  95. package/local-maven-repo/expo/modules/router/expo.modules.router/7.0.0-canary-20251230-fc48ddc/expo.modules.router-7.0.0-canary-20251230-fc48ddc.pom.md5 +1 -0
  96. package/local-maven-repo/expo/modules/router/expo.modules.router/7.0.0-canary-20251230-fc48ddc/expo.modules.router-7.0.0-canary-20251230-fc48ddc.pom.sha1 +1 -0
  97. package/local-maven-repo/expo/modules/router/expo.modules.router/7.0.0-canary-20251230-fc48ddc/expo.modules.router-7.0.0-canary-20251230-fc48ddc.pom.sha256 +1 -0
  98. package/local-maven-repo/expo/modules/router/expo.modules.router/7.0.0-canary-20251230-fc48ddc/expo.modules.router-7.0.0-canary-20251230-fc48ddc.pom.sha512 +1 -0
  99. package/local-maven-repo/expo/modules/router/expo.modules.router/maven-metadata.xml +4 -4
  100. package/local-maven-repo/expo/modules/router/expo.modules.router/maven-metadata.xml.md5 +1 -1
  101. package/local-maven-repo/expo/modules/router/expo.modules.router/maven-metadata.xml.sha1 +1 -1
  102. package/local-maven-repo/expo/modules/router/expo.modules.router/maven-metadata.xml.sha256 +1 -1
  103. package/local-maven-repo/expo/modules/router/expo.modules.router/maven-metadata.xml.sha512 +1 -1
  104. package/package.json +10 -10
  105. package/build/layouts/stack-utils/StackHeaderItem.d.ts.map +0 -1
  106. package/build/layouts/stack-utils/StackHeaderItem.js.map +0 -1
  107. package/local-maven-repo/expo/modules/router/expo.modules.router/7.0.0-canary-20251216-3f01dbf/expo.modules.router-7.0.0-canary-20251216-3f01dbf.aar +0 -0
  108. package/local-maven-repo/expo/modules/router/expo.modules.router/7.0.0-canary-20251216-3f01dbf/expo.modules.router-7.0.0-canary-20251216-3f01dbf.aar.md5 +0 -1
  109. package/local-maven-repo/expo/modules/router/expo.modules.router/7.0.0-canary-20251216-3f01dbf/expo.modules.router-7.0.0-canary-20251216-3f01dbf.aar.sha1 +0 -1
  110. package/local-maven-repo/expo/modules/router/expo.modules.router/7.0.0-canary-20251216-3f01dbf/expo.modules.router-7.0.0-canary-20251216-3f01dbf.aar.sha256 +0 -1
  111. package/local-maven-repo/expo/modules/router/expo.modules.router/7.0.0-canary-20251216-3f01dbf/expo.modules.router-7.0.0-canary-20251216-3f01dbf.aar.sha512 +0 -1
  112. package/local-maven-repo/expo/modules/router/expo.modules.router/7.0.0-canary-20251216-3f01dbf/expo.modules.router-7.0.0-canary-20251216-3f01dbf.module.md5 +0 -1
  113. package/local-maven-repo/expo/modules/router/expo.modules.router/7.0.0-canary-20251216-3f01dbf/expo.modules.router-7.0.0-canary-20251216-3f01dbf.module.sha1 +0 -1
  114. package/local-maven-repo/expo/modules/router/expo.modules.router/7.0.0-canary-20251216-3f01dbf/expo.modules.router-7.0.0-canary-20251216-3f01dbf.module.sha256 +0 -1
  115. package/local-maven-repo/expo/modules/router/expo.modules.router/7.0.0-canary-20251216-3f01dbf/expo.modules.router-7.0.0-canary-20251216-3f01dbf.module.sha512 +0 -1
  116. package/local-maven-repo/expo/modules/router/expo.modules.router/7.0.0-canary-20251216-3f01dbf/expo.modules.router-7.0.0-canary-20251216-3f01dbf.pom.md5 +0 -1
  117. package/local-maven-repo/expo/modules/router/expo.modules.router/7.0.0-canary-20251216-3f01dbf/expo.modules.router-7.0.0-canary-20251216-3f01dbf.pom.sha1 +0 -1
  118. package/local-maven-repo/expo/modules/router/expo.modules.router/7.0.0-canary-20251216-3f01dbf/expo.modules.router-7.0.0-canary-20251216-3f01dbf.pom.sha256 +0 -1
  119. package/local-maven-repo/expo/modules/router/expo.modules.router/7.0.0-canary-20251216-3f01dbf/expo.modules.router-7.0.0-canary-20251216-3f01dbf.pom.sha512 +0 -1
  120. /package/local-maven-repo/expo/modules/router/expo.modules.router/{7.0.0-canary-20251216-3f01dbf/expo.modules.router-7.0.0-canary-20251216-3f01dbf-sources.jar → 7.0.0-canary-20251230-fc48ddc/expo.modules.router-7.0.0-canary-20251230-fc48ddc-sources.jar} +0 -0
  121. /package/local-maven-repo/expo/modules/router/expo.modules.router/{7.0.0-canary-20251216-3f01dbf/expo.modules.router-7.0.0-canary-20251216-3f01dbf-sources.jar.md5 → 7.0.0-canary-20251230-fc48ddc/expo.modules.router-7.0.0-canary-20251230-fc48ddc-sources.jar.md5} +0 -0
  122. /package/local-maven-repo/expo/modules/router/expo.modules.router/{7.0.0-canary-20251216-3f01dbf/expo.modules.router-7.0.0-canary-20251216-3f01dbf-sources.jar.sha1 → 7.0.0-canary-20251230-fc48ddc/expo.modules.router-7.0.0-canary-20251230-fc48ddc-sources.jar.sha1} +0 -0
  123. /package/local-maven-repo/expo/modules/router/expo.modules.router/{7.0.0-canary-20251216-3f01dbf/expo.modules.router-7.0.0-canary-20251216-3f01dbf-sources.jar.sha256 → 7.0.0-canary-20251230-fc48ddc/expo.modules.router-7.0.0-canary-20251230-fc48ddc-sources.jar.sha256} +0 -0
  124. /package/local-maven-repo/expo/modules/router/expo.modules.router/{7.0.0-canary-20251216-3f01dbf/expo.modules.router-7.0.0-canary-20251216-3f01dbf-sources.jar.sha512 → 7.0.0-canary-20251230-fc48ddc/expo.modules.router-7.0.0-canary-20251230-fc48ddc-sources.jar.sha512} +0 -0
@@ -1,7 +1,42 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.Toolbar = void 0;
3
+ exports.ToolbarView = exports.ToolbarSpacer = exports.ToolbarButton = exports.ToolbarMenuAction = exports.ToolbarMenu = exports.Toolbar = void 0;
4
4
  const elements_1 = require("./elements");
5
+ Object.defineProperty(exports, "ToolbarMenu", { enumerable: true, get: function () { return elements_1.ToolbarMenu; } });
6
+ Object.defineProperty(exports, "ToolbarMenuAction", { enumerable: true, get: function () { return elements_1.ToolbarMenuAction; } });
7
+ Object.defineProperty(exports, "ToolbarButton", { enumerable: true, get: function () { return elements_1.ToolbarButton; } });
8
+ Object.defineProperty(exports, "ToolbarSpacer", { enumerable: true, get: function () { return elements_1.ToolbarSpacer; } });
9
+ Object.defineProperty(exports, "ToolbarView", { enumerable: true, get: function () { return elements_1.ToolbarView; } });
10
+ /**
11
+ * A component that provides a [bottom toolbar](https://developer.apple.com/design/human-interface-guidelines/toolbars).
12
+ *
13
+ * @example
14
+ * ```tsx
15
+ * import { Toolbar } from "expo-router";
16
+ *
17
+ * export default function MyScreen() {
18
+ * return (
19
+ * <>
20
+ * <YourScreenContent />
21
+ * <Toolbar>
22
+ * <Toolbar.Spacer />
23
+ * <Toolbar.Button icon="magnifyingglass" tintColor={Color.ios.placeholderText} />
24
+ * <Toolbar.View style={{ width: 200 }}>
25
+ * <TextInput placeholder="Search" />
26
+ * </Toolbar.View>
27
+ * <Toolbar.Menu icon="ellipsis">
28
+ * <Toolbar.MenuAction icon="mail" title="Send email" onPress={() => {}} />
29
+ * <Toolbar.MenuAction icon="trash" title="Delete" destructive onPress={() => {}} />
30
+ * </Toolbar.Menu>
31
+ * <Toolbar.Spacer />
32
+ * </Toolbar>
33
+ * </>
34
+ * );
35
+ * }
36
+ * ```
37
+ *
38
+ * @platform ios
39
+ */
5
40
  exports.Toolbar = Object.assign(elements_1.ToolbarHost, {
6
41
  Menu: elements_1.ToolbarMenu,
7
42
  MenuAction: elements_1.ToolbarMenuAction,
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/toolbar/index.tsx"],"names":[],"mappings":";;;AAAA,yCAOoB;AAEP,QAAA,OAAO,GAAG,MAAM,CAAC,MAAM,CAAC,sBAAW,EAAE;IAChD,IAAI,EAAE,sBAAW;IACjB,UAAU,EAAE,4BAAiB;IAC7B,MAAM,EAAE,wBAAa;IACrB,MAAM,EAAE,wBAAa;IACrB,IAAI,EAAE,sBAAW;CAClB,CAAC,CAAC","sourcesContent":["import {\n ToolbarHost,\n ToolbarMenu,\n ToolbarMenuAction,\n ToolbarButton,\n ToolbarSpacer,\n ToolbarView,\n} from './elements';\n\nexport const Toolbar = Object.assign(ToolbarHost, {\n Menu: ToolbarMenu,\n MenuAction: ToolbarMenuAction,\n Button: ToolbarButton,\n Spacer: ToolbarSpacer,\n View: ToolbarView,\n});\n\nexport type {\n ToolbarHostProps,\n ToolbarMenuProps,\n ToolbarMenuActionProps,\n ToolbarButtonProps,\n ToolbarSpacerProps,\n ToolbarViewProps as ToolbarCustomViewProps,\n} from './elements';\n"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/toolbar/index.ts"],"names":[],"mappings":";;;AAAA,yCAOoB;AAwCX,4FA7CP,sBAAW,OA6CO;AAAE,kGA5CpB,4BAAiB,OA4CoB;AAAE,8FA3CvC,wBAAa,OA2CuC;AAAE,8FA1CtD,wBAAa,OA0CsD;AAAE,4FAzCrE,sBAAW,OAyCqE;AAtClF;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6BG;AACU,QAAA,OAAO,GAAG,MAAM,CAAC,MAAM,CAAC,sBAAW,EAAE;IAChD,IAAI,EAAE,sBAAW;IACjB,UAAU,EAAE,4BAAiB;IAC7B,MAAM,EAAE,wBAAa;IACrB,MAAM,EAAE,wBAAa;IACrB,IAAI,EAAE,sBAAW;CAClB,CAAC,CAAC","sourcesContent":["import {\n ToolbarHost,\n ToolbarMenu,\n ToolbarMenuAction,\n ToolbarButton,\n ToolbarSpacer,\n ToolbarView,\n} from './elements';\n\n/**\n * A component that provides a [bottom toolbar](https://developer.apple.com/design/human-interface-guidelines/toolbars).\n *\n * @example\n * ```tsx\n * import { Toolbar } from \"expo-router\";\n *\n * export default function MyScreen() {\n * return (\n * <>\n * <YourScreenContent />\n * <Toolbar>\n * <Toolbar.Spacer />\n * <Toolbar.Button icon=\"magnifyingglass\" tintColor={Color.ios.placeholderText} />\n * <Toolbar.View style={{ width: 200 }}>\n * <TextInput placeholder=\"Search\" />\n * </Toolbar.View>\n * <Toolbar.Menu icon=\"ellipsis\">\n * <Toolbar.MenuAction icon=\"mail\" title=\"Send email\" onPress={() => {}} />\n * <Toolbar.MenuAction icon=\"trash\" title=\"Delete\" destructive onPress={() => {}} />\n * </Toolbar.Menu>\n * <Toolbar.Spacer />\n * </Toolbar>\n * </>\n * );\n * }\n * ```\n *\n * @platform ios\n */\nexport const Toolbar = Object.assign(ToolbarHost, {\n Menu: ToolbarMenu,\n MenuAction: ToolbarMenuAction,\n Button: ToolbarButton,\n Spacer: ToolbarSpacer,\n View: ToolbarView,\n});\n\nexport { ToolbarMenu, ToolbarMenuAction, ToolbarButton, ToolbarSpacer, ToolbarView };\n\nexport type {\n ToolbarProps,\n ToolbarMenuProps,\n ToolbarMenuActionProps,\n ToolbarButtonProps,\n ToolbarSpacerProps,\n ToolbarViewProps as ToolbarCustomViewProps,\n} from './elements';\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"native.ios.d.ts","sourceRoot":"","sources":["../../src/toolbar/native.ios.tsx"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,sBAAsB,EAAE,sBAAsB,EAAE,MAAM,gBAAgB,CAAC;AAMrF,wBAAgB,iBAAiB,CAAC,KAAK,EAAE,sBAAsB,+BAc9D;AAKD,wBAAgB,iBAAiB,CAAC,KAAK,EAAE,sBAAsB,+BAE9D"}
1
+ {"version":3,"file":"native.ios.d.ts","sourceRoot":"","sources":["../../src/toolbar/native.ios.tsx"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,sBAAsB,EAAE,sBAAsB,EAAE,MAAM,gBAAgB,CAAC;AAMrF,wBAAgB,iBAAiB,CAAC,KAAK,EAAE,sBAAsB,+BAc9D;AAiBD,wBAAgB,iBAAiB,CAAC,KAAK,EAAE,sBAAsB,+BAE9D"}
@@ -1 +1 @@
1
- {"version":3,"file":"native.ios.js","sourceRoot":"","sources":["../../src/toolbar/native.ios.tsx"],"names":[],"mappings":";;AAUA,8CAcC;AAKD,8CAEC;AA/BD,+BAAyC;AAMzC,MAAM,qBAAqB,GAAmC,IAAA,wBAAiB,EAC7E,yBAAyB,EACzB,uBAAuB,CACxB,CAAC;AACF,SAAgB,iBAAiB,CAAC,KAA6B;IAC7D,OAAO,CACL,CAAC,qBAAqB,CACpB,IAAI,KAAK,CAAC,CACV,KAAK,CAAC,CAAC;YACL,QAAQ,EAAE,UAAU;YACpB,GAAG,EAAE,CAAC;YACN,IAAI,EAAE,CAAC;YACP,KAAK,EAAE,CAAC;YACR,MAAM,EAAE,CAAC;YACT,eAAe,EAAE,aAAa;SAC/B,CAAC,EACF,CACH,CAAC;AACJ,CAAC;AAED,MAAM,qBAAqB,GAEvB,IAAA,wBAAiB,EAAC,yBAAyB,EAAE,uBAAuB,CAAC,CAAC;AAC1E,SAAgB,iBAAiB,CAAC,KAA6B;IAC7D,OAAO,CAAC,qBAAqB,CAAC,IAAI,KAAK,CAAC,EAAG,CAAC;AAC9C,CAAC","sourcesContent":["import { requireNativeView } from 'expo';\nimport type { ViewProps } from 'react-native';\nimport type { SFSymbol } from 'sf-symbols-typescript';\n\nimport type { RouterToolbarHostProps, RouterToolbarItemProps } from './native.types';\n\nconst RouterToolbarHostView: React.ComponentType<ViewProps> = requireNativeView(\n 'ExpoRouterToolbarModule',\n 'RouterToolbarHostView'\n);\nexport function RouterToolbarHost(props: RouterToolbarHostProps) {\n return (\n <RouterToolbarHostView\n {...props}\n style={{\n position: 'absolute',\n top: 0,\n left: 0,\n width: 1,\n height: 1,\n backgroundColor: 'transparent',\n }}\n />\n );\n}\n\nconst RouterToolbarItemView: React.ComponentType<\n ViewProps & { identifier: string; title?: string; systemImageName?: SFSymbol; type?: string }\n> = requireNativeView('ExpoRouterToolbarModule', 'RouterToolbarItemView');\nexport function RouterToolbarItem(props: RouterToolbarItemProps) {\n return <RouterToolbarItemView {...props} />;\n}\n"]}
1
+ {"version":3,"file":"native.ios.js","sourceRoot":"","sources":["../../src/toolbar/native.ios.tsx"],"names":[],"mappings":";;AAUA,8CAcC;AAiBD,8CAEC;AA3CD,+BAAyC;AAMzC,MAAM,qBAAqB,GAAmC,IAAA,wBAAiB,EAC7E,yBAAyB,EACzB,uBAAuB,CACxB,CAAC;AACF,SAAgB,iBAAiB,CAAC,KAA6B;IAC7D,OAAO,CACL,CAAC,qBAAqB,CACpB,IAAI,KAAK,CAAC,CACV,KAAK,CAAC,CAAC;YACL,QAAQ,EAAE,UAAU;YACpB,GAAG,EAAE,CAAC;YACN,IAAI,EAAE,CAAC;YACP,KAAK,EAAE,CAAC;YACR,MAAM,EAAE,CAAC;YACT,eAAe,EAAE,aAAa;SAC/B,CAAC,EACF,CACH,CAAC;AACJ,CAAC;AAED,MAAM,qBAAqB,GAcvB,IAAA,wBAAiB,EAAC,yBAAyB,EAAE,uBAAuB,CAAC,CAAC;AAC1E,SAAgB,iBAAiB,CAAC,KAA6B;IAC7D,OAAO,CAAC,qBAAqB,CAAC,IAAI,KAAK,CAAC,EAAG,CAAC;AAC9C,CAAC","sourcesContent":["import { requireNativeView } from 'expo';\nimport { type ColorValue, type TextStyle, type ViewProps } from 'react-native';\nimport type { SFSymbol } from 'sf-symbols-typescript';\n\nimport type { RouterToolbarHostProps, RouterToolbarItemProps } from './native.types';\n\nconst RouterToolbarHostView: React.ComponentType<ViewProps> = requireNativeView(\n 'ExpoRouterToolbarModule',\n 'RouterToolbarHostView'\n);\nexport function RouterToolbarHost(props: RouterToolbarHostProps) {\n return (\n <RouterToolbarHostView\n {...props}\n style={{\n position: 'absolute',\n top: 0,\n left: 0,\n width: 1,\n height: 1,\n backgroundColor: 'transparent',\n }}\n />\n );\n}\n\nconst RouterToolbarItemView: React.ComponentType<\n ViewProps & {\n identifier: string;\n title?: string;\n systemImageName?: SFSymbol;\n type?: string;\n titleStyle?: {\n fontFamily?: string;\n fontSize?: number;\n fontWeight?: TextStyle['fontWeight'];\n color?: ColorValue;\n };\n tintColor?: ColorValue;\n }\n> = requireNativeView('ExpoRouterToolbarModule', 'RouterToolbarItemView');\nexport function RouterToolbarItem(props: RouterToolbarItemProps) {\n return <RouterToolbarItemView {...props} />;\n}\n"]}
@@ -1,5 +1,6 @@
1
1
  import type { ColorValue } from 'react-native';
2
2
  import type { SFSymbol } from 'sf-symbols-typescript';
3
+ import type { BasicTextStyle } from '../utils/font';
3
4
  export interface RouterToolbarHostProps {
4
5
  children?: React.ReactNode;
5
6
  }
@@ -20,11 +21,11 @@ export interface RouterToolbarItemProps {
20
21
  badgeConfiguration?: {
21
22
  value?: string;
22
23
  backgroundColor?: ColorValue;
23
- color?: ColorValue;
24
- fontFamily?: string;
25
- fontSize?: number;
26
- fontWeight?: string;
27
- };
24
+ } & BasicTextStyle;
25
+ titleStyle?: BasicTextStyle;
26
+ accessibilityLabel?: string;
27
+ accessibilityHint?: string;
28
+ disabled?: boolean;
28
29
  onSelected?: () => void;
29
30
  }
30
31
  //# sourceMappingURL=native.types.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"native.types.d.ts","sourceRoot":"","sources":["../../src/toolbar/native.types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAC/C,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AAEtD,MAAM,WAAW,sBAAsB;IACrC,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;CAC5B;AA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AC,EAAE,KAAK,CAAC,SAAS,CAAC;IAC3B,UAAU,EAAE,MAAM,CAAC;IACnB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,eAAe,CAAC,EAAE,QAAQ,CAAC;IAC3B,IAAI,CAAC,EAAE,QAAQ,GAAG,aAAa,GAAG,aAAa,CAAC;IAChD,SAAS,CAAC,EAAE,UAAU,CAAC;IACvB,qBAAqB,CAAC,EAAE,OAAO,CAAC;IAChC,gBAAgB,CAAC,EAAE,OAAO,CAAC;IAC3B,kBAAkB,CAAC,EAAE,OAAO,GAAG,WAAW,CAAC;IAC3C,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,cAAc,CAAC,EAAE,MAAM,EAAE,CAAC;IAE1B,kBAAkB,CAAC,EAAE;QACnB,KAAK,CAAC,EAAE,MAAM,CAAC;QACf,eAAe,CAAC,EAAE,UAAU,CAAC;KAC9B,GAAG,cAAc,CAAC;IACnB,UAAU,CAAC,EAAE,cAAc,CAAC;IAC5B,kBAAkB,CAAC,EAAE,MAAM,CAAC;IAC5B,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAC3B,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,UAAU,CAAC,EAAE,MAAM,IAAI,CAAC;CACzB"}
@@ -1 +1 @@
1
- {"version":3,"file":"native.types.js","sourceRoot":"","sources":["../../src/toolbar/native.types.ts"],"names":[],"mappings":"","sourcesContent":["import type { ColorValue } from 'react-native';\nimport type { SFSymbol } from 'sf-symbols-typescript';\n\nexport interface RouterToolbarHostProps {\n children?: React.ReactNode;\n}\n\nexport interface RouterToolbarItemProps {\n children?: React.ReactNode;\n identifier: string;\n title?: string;\n systemImageName?: SFSymbol;\n type?: 'normal' | 'fixedSpacer' | 'fluidSpacer';\n tintColor?: ColorValue;\n hidesSharedBackground?: boolean;\n sharesBackground?: boolean;\n barButtonItemStyle?: 'plain' | 'prominent';\n width?: number;\n hidden?: boolean;\n selected?: boolean;\n possibleTitles?: string[];\n // Right now this does not seem to work\n badgeConfiguration?: {\n value?: string;\n backgroundColor?: ColorValue;\n color?: ColorValue;\n fontFamily?: string;\n fontSize?: number;\n fontWeight?: string;\n };\n onSelected?: () => void;\n}\n"]}
1
+ {"version":3,"file":"native.types.js","sourceRoot":"","sources":["../../src/toolbar/native.types.ts"],"names":[],"mappings":"","sourcesContent":["import type { ColorValue } from 'react-native';\nimport type { SFSymbol } from 'sf-symbols-typescript';\n\nimport type { BasicTextStyle } from '../utils/font';\n\nexport interface RouterToolbarHostProps {\n children?: React.ReactNode;\n}\n\nexport interface RouterToolbarItemProps {\n children?: React.ReactNode;\n identifier: string;\n title?: string;\n systemImageName?: SFSymbol;\n type?: 'normal' | 'fixedSpacer' | 'fluidSpacer';\n tintColor?: ColorValue;\n hidesSharedBackground?: boolean;\n sharesBackground?: boolean;\n barButtonItemStyle?: 'plain' | 'prominent';\n width?: number;\n hidden?: boolean;\n selected?: boolean;\n possibleTitles?: string[];\n // Right now this does not seem to work\n badgeConfiguration?: {\n value?: string;\n backgroundColor?: ColorValue;\n } & BasicTextStyle;\n titleStyle?: BasicTextStyle;\n accessibilityLabel?: string;\n accessibilityHint?: string;\n disabled?: boolean;\n onSelected?: () => void;\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"useScreens.d.ts","sourceRoot":"","sources":["../src/useScreens.tsx"],"names":[],"mappings":"AAEA,OAAO,EAEL,KAAK,YAAY,EACjB,KAAK,eAAe,EACpB,KAAK,aAAa,EAClB,KAAK,SAAS,EACd,KAAK,eAAe,EACrB,MAAM,0BAA0B,CAAC;AAElC,OAAO,KAAoB,MAAM,OAAO,CAAC;AAEzC,OAAO,EAAsB,SAAS,EAAuC,MAAM,SAAS,CAAC;AAW7F,OAAO,EAAE,mBAAmB,EAAE,MAAM,SAAS,CAAC;AAK9C,MAAM,MAAM,WAAW,CACrB,QAAQ,SAAS,MAAM,CAAC,M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E,OAAO,CAAC,WAAW,CAAM,qBAYxD;AAED,wBAAgB,aAAa,CAAC,IAAI,EAAE,MAAM,EAAE,OAAO,GAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAM,UAa5E"}
@@ -45,10 +45,12 @@ exports.getSingularId = getSingularId;
45
45
  const native_1 = require("@react-navigation/native");
46
46
  const react_1 = __importStar(require("react"));
47
47
  const Route_1 = require("./Route");
48
+ const getPathFromState_1 = require("./fork/getPathFromState");
48
49
  const storeContext_1 = require("./global-state/storeContext");
49
50
  const import_mode_1 = __importDefault(require("./import-mode"));
50
51
  const ZoomTransitionEnabler_1 = require("./link/zoom/ZoomTransitionEnabler");
51
52
  const zoom_transition_context_providers_1 = require("./link/zoom/zoom-transition-context-providers");
53
+ const navigationEvents_1 = require("./navigationEvents");
52
54
  const navigationParams_1 = require("./navigationParams");
53
55
  const primitives_1 = require("./primitives");
54
56
  const EmptyRoute_1 = require("./views/EmptyRoute");
@@ -223,6 +225,7 @@ function getQualifiedRouteComponent(value) {
223
225
  });
224
226
  }, [navigation]);
225
227
  return (<Route_1.Route node={value} route={route}>
228
+ {value.type === 'route' && navigationEvents_1.unstable_navigationEvents.hasAnyListener() && (<AnalyticsListeners navigation={navigation} screenId={route.key}/>)}
226
229
  <ZoomTransitionEnabler_1.ZoomTransitionEnabler route={route}/>
227
230
  <zoom_transition_context_providers_1.ZoomTransitionTargetContextProvider route={route}>
228
231
  <react_1.default.Suspense fallback={<SuspenseFallback_1.SuspenseFallback route={value}/>}>
@@ -240,6 +243,53 @@ function getQualifiedRouteComponent(value) {
240
243
  qualifiedStore.set(value, BaseRoute);
241
244
  return BaseRoute;
242
245
  }
246
+ function AnalyticsListeners({ navigation, screenId, }) {
247
+ const stateForPath = (0, native_1.useStateForPath)();
248
+ const isFirstRenderRef = react_1.default.useRef(true);
249
+ const pathname = (0, react_1.useMemo)(() => (stateForPath ? decodeURIComponent((0, getPathFromState_1.getPathFromState)(stateForPath)) : undefined), [stateForPath]);
250
+ if (isFirstRenderRef.current) {
251
+ isFirstRenderRef.current = false;
252
+ if (pathname) {
253
+ navigationEvents_1.unstable_navigationEvents.emit('pageWillRender', {
254
+ pathname,
255
+ screenId,
256
+ });
257
+ }
258
+ }
259
+ (0, react_1.useEffect)(() => {
260
+ if (pathname) {
261
+ return () => {
262
+ navigationEvents_1.unstable_navigationEvents.emit('pageRemoved', {
263
+ pathname,
264
+ screenId,
265
+ });
266
+ };
267
+ }
268
+ return () => { };
269
+ }, [pathname]);
270
+ (0, react_1.useEffect)(() => {
271
+ if (pathname) {
272
+ const cleanFocus = navigation.addListener('focus', () => {
273
+ navigationEvents_1.unstable_navigationEvents.emit('pageFocused', {
274
+ pathname,
275
+ screenId,
276
+ });
277
+ });
278
+ const cleanBlur = navigation.addListener('blur', () => {
279
+ navigationEvents_1.unstable_navigationEvents.emit('pageBlurred', {
280
+ pathname,
281
+ screenId,
282
+ });
283
+ });
284
+ return () => {
285
+ cleanFocus();
286
+ cleanBlur();
287
+ };
288
+ }
289
+ return () => { };
290
+ }, [navigation, pathname]);
291
+ return null;
292
+ }
243
293
  function screenOptionsFactory(route, options) {
244
294
  return (args) => {
245
295
  // Only eager load generated components
@@ -1 +1 @@
1
- {"version":3,"file":"useScreens.js","sourceRoot":"","sources":["../src/useScreens.tsx"],"names":[],"mappings":";AAAA,YAAY,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA0Jb,4CAwBC;AAmDD,gEAkGC;AAED,oDAwBC;AAED,sCAcC;AAED,sCAaC;AA9XD,qDAOkC;AAElC,+CAAyC;AAEzC,mCAA6F;AAC7F,8DAAiE;AACjE,gEAAoD;AACpD,6EAA0E;AAC1E,qGAAoG;AACpG,yDAI4B;AAC5B,6CAAsC;AAEtC,mDAAgD;AAChD,+DAA4D;AAC5D,qCAAkC;AAmClC,SAAS,iBAAiB,CACxB,QAAqB,EACrB,QAAuB,EAAE,EACzB,gBAAyB;IAEzB,IAAI,CAAC,KAAK,EAAE,M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YAC5D,OAAO,OAAO,CAAC,MAAM,EAAE,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,IAAI,OAAO,CAAC;QAC3D,CAAC;aAAM,CAAC;YACN,OAAO,OAAO,CAAC;QACjB,CAAC;IACH,CAAC,CAAC;SACD,IAAI,CAAC,GAAG,CAAC,CAAC;AACf,CAAC","sourcesContent":["'use client';\n\nimport {\n useStateForPath,\n type EventMapBase,\n type NavigationState,\n type ParamListBase,\n type RouteProp,\n type ScreenListeners,\n} from '@react-navigation/native';\nimport type { NativeStackNavigationEventMap } from '@react-navigation/native-stack';\nimport React, { useEffect } from 'react';\n\nimport { LoadedRoute, Route, RouteNode, sortRoutesWithInitial, useRouteNode } from './Route';\nimport { useExpoRouterStore } from './global-state/storeContext';\nimport EXPO_ROUTER_IMPORT_MODE from './import-mode';\nimport { ZoomTransitionEnabler } from './link/zoom/ZoomTransitionEnabler';\nimport { ZoomTransitionTargetContextProvider } from './link/zoom/zoom-transition-context-providers';\nimport {\n hasParam,\n INTERNAL_EXPO_ROUTER_NO_ANIMATION_PARAM_NAME,\n removeParams,\n} from './navigationParams';\nimport { Screen } from './primitives';\nimport { UnknownOutputParams } from './types';\nimport { EmptyRoute } from './views/EmptyRoute';\nimport { SuspenseFallback } from './views/SuspenseFallback';\nimport { Try } from './views/Try';\n\nexport type ScreenProps<\n TOptions extends Record<string, any> = Record<string, any>,\n TState extends NavigationState = NavigationState,\n TEventMap extends EventMapBase = EventMapBase,\n> = {\n /** Name is required when used inside a Layout component. */\n name?: string;\n /**\n * Redirect to the nearest sibling route.\n * If all children are `redirect={true}`, the layout will render `null` as there are no children to render.\n */\n redirect?: boolean;\n initialParams?: Record<string, any>;\n options?:\n | TOptions\n | ((prop: { route: RouteProp<ParamListBase, string>; navigation: any }) => TOptions);\n\n listeners?:\n | ScreenListeners<TState, TEventMap>\n | ((prop: {\n route: RouteProp<ParamListBase, string>;\n navigation: any;\n }) => ScreenListeners<TState, TEventMap>);\n\n getId?: ({ params }: { params?: Record<string, any> }) => string | undefined;\n\n dangerouslySingular?: SingularOptions;\n};\n\nexport type SingularOptions =\n | boolean\n | ((name: string, params: UnknownOutputParams) => string | undefined);\n\nfunction getSortedChildren(\n children: RouteNode[],\n order: ScreenProps[] = [],\n initialRouteName?: string\n): { route: RouteNode; props: Partial<ScreenProps> }[] {\n if (!order?.length) {\n return children\n .sort(sortRoutesWithInitial(initialRouteName))\n .map((route) => ({ route, props: {} }));\n }\n const entries = [...children];\n\n const ordered = order\n .map(\n ({\n name,\n redirect,\n initialParams,\n listeners,\n options,\n getId,\n dangerouslySingular: singular,\n }) => {\n if (!entries.length) {\n console.warn(\n `[Layout children]: Too many screens defined. Route \"${name}\" is extraneous.`\n );\n return null;\n }\n const matchIndex = entries.findIndex((child) => child.route === name);\n if (matchIndex === -1) {\n console.warn(\n `[Layout children]: No route named \"${name}\" exists in nested children:`,\n children.map(({ route }) => route)\n );\n return null;\n } else {\n // Get match and remove from entries\n const match = entries[matchIndex];\n entries.splice(matchIndex, 1);\n\n // Ensure to return null after removing from entries.\n if (redirect) {\n if (typeof redirect === 'string') {\n throw new Error(`Redirecting to a specific route is not supported yet.`);\n }\n return null;\n }\n\n if (getId) {\n console.warn(\n `Deprecated: prop 'getId' on screen ${name} is deprecated. Please rename the prop to 'dangerouslySingular'`\n );\n if (singular) {\n console.warn(\n `Screen ${name} cannot use both getId and dangerouslySingular together.`\n );\n }\n } else if (singular) {\n // If singular is set, use it as the getId function.\n if (typeof singular === 'string') {\n getId = () => singular;\n } else if (typeof singular === 'function' && name) {\n getId = (options) => singular(name, options.params || {});\n } else if (singular === true && name) {\n getId = (options) => getSingularId(name, options);\n }\n }\n\n return {\n route: match,\n props: { initialParams, listeners, options, getId },\n };\n }\n }\n )\n .filter(Boolean) as {\n route: RouteNode;\n props: Partial<ScreenProps>;\n }[];\n\n // Add any remaining children\n ordered.push(\n ...entries.sort(sortRoutesWithInitial(initialRouteName)).map((route) => ({ route, props: {} }))\n );\n\n return ordered;\n}\n\n/**\n * @returns React Navigation screens sorted by the `route` property.\n */\nexport function useSortedScreens(\n order: ScreenProps[],\n protectedScreens: Set<string>,\n useOnlyUserDefinedScreens: boolean = false\n): React.ReactNode[] {\n const node = useRouteNode();\n\n const nodeChildren = node?.children ?? [];\n const children = useOnlyUserDefinedScreens\n ? nodeChildren.filter((child) =>\n order.some((userDefinedScreen) => userDefinedScreen.name === child.route)\n )\n : nodeChildren;\n\n const sorted = children.length ? getSortedChildren(children, order, node?.initialRouteName) : [];\n return React.useMemo(\n () =>\n sorted\n .filter((item) => !protectedScreens.has(item.route.route))\n .map((value) => {\n return routeToScreen(value.route, value.props);\n }),\n [sorted, protectedScreens]\n );\n}\n\nfunction fromImport(value: RouteNode, { ErrorBoundary, ...component }: LoadedRoute) {\n // If possible, add a more helpful display name for the component stack to improve debugging of React errors such as `Text strings must be rendered within a <Text> component.`.\n if (component?.default && __DEV__) {\n component.default.displayName ??= `${component.default.name ?? 'Route'}(${value.contextKey})`;\n }\n\n if (ErrorBoundary) {\n const Wrapped = React.forwardRef((props: any, ref: any) => {\n const children = React.createElement(component.default || EmptyRoute, {\n ...props,\n ref,\n });\n return <Try catch={ErrorBoundary}>{children}</Try>;\n });\n\n if (__DEV__) {\n Wrapped.displayName = `ErrorBoundary(${value.contextKey})`;\n }\n\n return {\n default: Wrapped,\n };\n }\n if (process.env.NODE_ENV !== 'production') {\n if (\n typeof component.default === 'object' &&\n component.default &&\n Object.keys(component.default).length === 0\n ) {\n return { default: EmptyRoute };\n }\n }\n\n return { default: component.default };\n}\n\nfunction fromLoadedRoute(value: RouteNode, res: LoadedRoute) {\n if (!(res instanceof Promise)) {\n return fromImport(value, res);\n }\n\n return res.then(fromImport.bind(null, value));\n}\n\n// TODO: Maybe there's a more React-y way to do this?\n// Without this store, the process enters a recursive loop.\nconst qualifiedStore = new WeakMap<RouteNode, React.ComponentType<any>>();\n\n/** Wrap the component with various enhancements and add access to child routes. */\nexport function getQualifiedRouteComponent(value: RouteNode) {\n if (qualifiedStore.has(value)) {\n return qualifiedStore.get(value)!;\n }\n\n let ScreenComponent:\n | React.ForwardRefExoticComponent<React.RefAttributes<unknown>>\n | React.ComponentType<any>;\n\n // TODO: This ensures sync doesn't use React.lazy, but it's not ideal.\n if (EXPO_ROUTER_IMPORT_MODE === 'lazy') {\n ScreenComponent = React.lazy(async () => {\n const res = value.loadRoute();\n return fromLoadedRoute(value, res) as Promise<{\n default: React.ComponentType<any>;\n }>;\n });\n\n if (__DEV__) {\n ScreenComponent.displayName = `AsyncRoute(${value.route})`;\n }\n } else {\n const res = value.loadRoute();\n ScreenComponent = fromImport(value, res).default!;\n }\n function BaseRoute({\n // Remove these React Navigation props to\n // enforce usage of expo-router hooks (where the query params are correct).\n route,\n navigation,\n\n // Pass all other props to the component\n ...props\n }: any) {\n const stateForPath = useStateForPath();\n const isFocused = navigation.isFocused();\n const store = useExpoRouterStore();\n\n if (isFocused) {\n const state = navigation.getState();\n const isLeaf = !('state' in state.routes[state.index]);\n if (isLeaf && stateForPath) store.setFocusedState(stateForPath);\n }\n\n useEffect(\n () =>\n navigation.addListener('focus', () => {\n const state = navigation.getState();\n const isLeaf = !('state' in state.routes[state.index]);\n // Because setFocusedState caches the route info, this call will only trigger rerenders\n // if the component itself didn’t rerender and the route info changed.\n // Otherwise, the update from the `if` above will handle it,\n // and this won’t cause a redundant second update.\n if (isLeaf && stateForPath) store.setFocusedState(stateForPath);\n }),\n [navigation]\n );\n\n useEffect(() => {\n return navigation.addListener(\n 'transitionEnd',\n (e?: NativeStackNavigationEventMap['transitionEnd']) => {\n if (!e?.data?.closing) {\n // When navigating to a screen, remove the no animation param to re-enable animations\n // Otherwise the navigation back would also have no animation\n if (hasParam(route?.params, INTERNAL_EXPO_ROUTER_NO_ANIMATION_PARAM_NAME)) {\n navigation.replaceParams(\n removeParams(route?.params, [INTERNAL_EXPO_ROUTER_NO_ANIMATION_PARAM_NAME])\n );\n }\n }\n }\n );\n }, [navigation]);\n\n return (\n <Route node={value} route={route}>\n <ZoomTransitionEnabler route={route} />\n <ZoomTransitionTargetContextProvider route={route}>\n <React.Suspense fallback={<SuspenseFallback route={value} />}>\n <ScreenComponent\n {...props}\n // Expose the template segment path, e.g. `(home)`, `[foo]`, `index`\n // the intention is to make it possible to deduce shared routes.\n segment={value.route}\n />\n </React.Suspense>\n </ZoomTransitionTargetContextProvider>\n </Route>\n );\n }\n\n if (__DEV__) {\n BaseRoute.displayName = `Route(${value.route})`;\n }\n\n qualifiedStore.set(value, BaseRoute);\n return BaseRoute;\n}\n\nexport function screenOptionsFactory(\n route: RouteNode,\n options?: ScreenProps['options']\n): ScreenProps['options'] {\n return (args) => {\n // Only eager load generated components\n const staticOptions = route.generated ? route.loadRoute()?.getNavOptions : null;\n const staticResult = typeof staticOptions === 'function' ? staticOptions(args) : staticOptions;\n const dynamicResult = typeof options === 'function' ? options?.(args) : options;\n const output = {\n ...staticResult,\n ...dynamicResult,\n };\n\n // Prevent generated screens from showing up in the tab bar.\n if (route.internal) {\n output.tabBarItemStyle = { display: 'none' };\n output.tabBarButton = () => null;\n // TODO: React Navigation doesn't provide a way to prevent rendering the drawer item.\n output.drawerItemStyle = { height: 0, display: 'none' };\n }\n\n return output;\n };\n}\n\nexport function routeToScreen(\n route: RouteNode,\n { options, getId, ...props }: Partial<ScreenProps> = {}\n) {\n return (\n <Screen\n {...props}\n name={route.route}\n key={route.route}\n getId={getId}\n options={screenOptionsFactory(route, options)}\n getComponent={() => getQualifiedRouteComponent(route)}\n />\n );\n}\n\nexport function getSingularId(name: string, options: Record<string, any> = {}) {\n return name\n .split('/')\n .map((segment) => {\n if (segment.startsWith('[...')) {\n return options.params?.[segment.slice(4, -1)]?.join('/') || segment;\n } else if (segment.startsWith('[') && segment.endsWith(']')) {\n return options.params?.[segment.slice(1, -1)] || segment;\n } else {\n return segment;\n }\n })\n .join('/');\n}\n"]}
1
+ {"version":3,"file":"useScreens.js","sourceRoot":"","sources":["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AC,CAAC;SACD,IAAI,CAAC,GAAG,CAAC,CAAC;AACf,CAAC","sourcesContent":["'use client';\n\nimport {\n useStateForPath,\n type EventConsumer,\n type EventMapBase,\n type NavigationState,\n type ParamListBase,\n type RouteProp,\n type ScreenListeners,\n} from '@react-navigation/native';\nimport type { NativeStackNavigationEventMap } from '@react-navigation/native-stack';\nimport React, { useEffect, useMemo } from 'react';\n\nimport { LoadedRoute, Route, RouteNode, sortRoutesWithInitial, useRouteNode } from './Route';\nimport { getPathFromState } from './fork/getPathFromState';\nimport { useExpoRouterStore } from './global-state/storeContext';\nimport EXPO_ROUTER_IMPORT_MODE from './import-mode';\nimport { ZoomTransitionEnabler } from './link/zoom/ZoomTransitionEnabler';\nimport { ZoomTransitionTargetContextProvider } from './link/zoom/zoom-transition-context-providers';\nimport { unstable_navigationEvents } from './navigationEvents';\nimport {\n hasParam,\n INTERNAL_EXPO_ROUTER_NO_ANIMATION_PARAM_NAME,\n removeParams,\n} from './navigationParams';\nimport { Screen } from './primitives';\nimport { UnknownOutputParams } from './types';\nimport { EmptyRoute } from './views/EmptyRoute';\nimport { SuspenseFallback } from './views/SuspenseFallback';\nimport { Try } from './views/Try';\n\nexport type ScreenProps<\n TOptions extends Record<string, any> = Record<string, any>,\n TState extends NavigationState = NavigationState,\n TEventMap extends EventMapBase = EventMapBase,\n> = {\n /** Name is required when used inside a Layout component. */\n name?: string;\n /**\n * Redirect to the nearest sibling route.\n * If all children are `redirect={true}`, the layout will render `null` as there are no children to render.\n */\n redirect?: boolean;\n initialParams?: Record<string, any>;\n options?:\n | TOptions\n | ((prop: { route: RouteProp<ParamListBase, string>; navigation: any }) => TOptions);\n\n listeners?:\n | ScreenListeners<TState, TEventMap>\n | ((prop: {\n route: RouteProp<ParamListBase, string>;\n navigation: any;\n }) => ScreenListeners<TState, TEventMap>);\n\n getId?: ({ params }: { params?: Record<string, any> }) => string | undefined;\n\n dangerouslySingular?: SingularOptions;\n};\n\nexport type SingularOptions =\n | boolean\n | ((name: string, params: UnknownOutputParams) => string | undefined);\n\nfunction getSortedChildren(\n children: RouteNode[],\n order: ScreenProps[] = [],\n initialRouteName?: string\n): { route: RouteNode; props: Partial<ScreenProps> }[] {\n if (!order?.length) {\n return children\n .sort(sortRoutesWithInitial(initialRouteName))\n .map((route) => ({ route, props: {} }));\n }\n const entries = [...children];\n\n const ordered = order\n .map(\n ({\n name,\n redirect,\n initialParams,\n listeners,\n options,\n getId,\n dangerouslySingular: singular,\n }) => {\n if (!entries.length) {\n console.warn(\n `[Layout children]: Too many screens defined. Route \"${name}\" is extraneous.`\n );\n return null;\n }\n const matchIndex = entries.findIndex((child) => child.route === name);\n if (matchIndex === -1) {\n console.warn(\n `[Layout children]: No route named \"${name}\" exists in nested children:`,\n children.map(({ route }) => route)\n );\n return null;\n } else {\n // Get match and remove from entries\n const match = entries[matchIndex];\n entries.splice(matchIndex, 1);\n\n // Ensure to return null after removing from entries.\n if (redirect) {\n if (typeof redirect === 'string') {\n throw new Error(`Redirecting to a specific route is not supported yet.`);\n }\n return null;\n }\n\n if (getId) {\n console.warn(\n `Deprecated: prop 'getId' on screen ${name} is deprecated. Please rename the prop to 'dangerouslySingular'`\n );\n if (singular) {\n console.warn(\n `Screen ${name} cannot use both getId and dangerouslySingular together.`\n );\n }\n } else if (singular) {\n // If singular is set, use it as the getId function.\n if (typeof singular === 'string') {\n getId = () => singular;\n } else if (typeof singular === 'function' && name) {\n getId = (options) => singular(name, options.params || {});\n } else if (singular === true && name) {\n getId = (options) => getSingularId(name, options);\n }\n }\n\n return {\n route: match,\n props: { initialParams, listeners, options, getId },\n };\n }\n }\n )\n .filter(Boolean) as {\n route: RouteNode;\n props: Partial<ScreenProps>;\n }[];\n\n // Add any remaining children\n ordered.push(\n ...entries.sort(sortRoutesWithInitial(initialRouteName)).map((route) => ({ route, props: {} }))\n );\n\n return ordered;\n}\n\n/**\n * @returns React Navigation screens sorted by the `route` property.\n */\nexport function useSortedScreens(\n order: ScreenProps[],\n protectedScreens: Set<string>,\n useOnlyUserDefinedScreens: boolean = false\n): React.ReactNode[] {\n const node = useRouteNode();\n\n const nodeChildren = node?.children ?? [];\n const children = useOnlyUserDefinedScreens\n ? nodeChildren.filter((child) =>\n order.some((userDefinedScreen) => userDefinedScreen.name === child.route)\n )\n : nodeChildren;\n\n const sorted = children.length ? getSortedChildren(children, order, node?.initialRouteName) : [];\n return React.useMemo(\n () =>\n sorted\n .filter((item) => !protectedScreens.has(item.route.route))\n .map((value) => {\n return routeToScreen(value.route, value.props);\n }),\n [sorted, protectedScreens]\n );\n}\n\nfunction fromImport(value: RouteNode, { ErrorBoundary, ...component }: LoadedRoute) {\n // If possible, add a more helpful display name for the component stack to improve debugging of React errors such as `Text strings must be rendered within a <Text> component.`.\n if (component?.default && __DEV__) {\n component.default.displayName ??= `${component.default.name ?? 'Route'}(${value.contextKey})`;\n }\n\n if (ErrorBoundary) {\n const Wrapped = React.forwardRef((props: any, ref: any) => {\n const children = React.createElement(component.default || EmptyRoute, {\n ...props,\n ref,\n });\n return <Try catch={ErrorBoundary}>{children}</Try>;\n });\n\n if (__DEV__) {\n Wrapped.displayName = `ErrorBoundary(${value.contextKey})`;\n }\n\n return {\n default: Wrapped,\n };\n }\n if (process.env.NODE_ENV !== 'production') {\n if (\n typeof component.default === 'object' &&\n component.default &&\n Object.keys(component.default).length === 0\n ) {\n return { default: EmptyRoute };\n }\n }\n\n return { default: component.default };\n}\n\nfunction fromLoadedRoute(value: RouteNode, res: LoadedRoute) {\n if (!(res instanceof Promise)) {\n return fromImport(value, res);\n }\n\n return res.then(fromImport.bind(null, value));\n}\n\n// TODO: Maybe there's a more React-y way to do this?\n// Without this store, the process enters a recursive loop.\nconst qualifiedStore = new WeakMap<RouteNode, React.ComponentType<any>>();\n\n/** Wrap the component with various enhancements and add access to child routes. */\nexport function getQualifiedRouteComponent(value: RouteNode) {\n if (qualifiedStore.has(value)) {\n return qualifiedStore.get(value)!;\n }\n\n let ScreenComponent:\n | React.ForwardRefExoticComponent<React.RefAttributes<unknown>>\n | React.ComponentType<any>;\n\n // TODO: This ensures sync doesn't use React.lazy, but it's not ideal.\n if (EXPO_ROUTER_IMPORT_MODE === 'lazy') {\n ScreenComponent = React.lazy(async () => {\n const res = value.loadRoute();\n return fromLoadedRoute(value, res) as Promise<{\n default: React.ComponentType<any>;\n }>;\n });\n\n if (__DEV__) {\n ScreenComponent.displayName = `AsyncRoute(${value.route})`;\n }\n } else {\n const res = value.loadRoute();\n ScreenComponent = fromImport(value, res).default!;\n }\n function BaseRoute({\n // Remove these React Navigation props to\n // enforce usage of expo-router hooks (where the query params are correct).\n route,\n navigation,\n\n // Pass all other props to the component\n ...props\n }: any) {\n const stateForPath = useStateForPath();\n const isFocused = navigation.isFocused();\n const store = useExpoRouterStore();\n\n if (isFocused) {\n const state = navigation.getState();\n const isLeaf = !('state' in state.routes[state.index]);\n if (isLeaf && stateForPath) store.setFocusedState(stateForPath);\n }\n\n useEffect(\n () =>\n navigation.addListener('focus', () => {\n const state = navigation.getState();\n const isLeaf = !('state' in state.routes[state.index]);\n // Because setFocusedState caches the route info, this call will only trigger rerenders\n // if the component itself didn’t rerender and the route info changed.\n // Otherwise, the update from the `if` above will handle it,\n // and this won’t cause a redundant second update.\n if (isLeaf && stateForPath) store.setFocusedState(stateForPath);\n }),\n [navigation]\n );\n\n useEffect(() => {\n return navigation.addListener(\n 'transitionEnd',\n (e?: NativeStackNavigationEventMap['transitionEnd']) => {\n if (!e?.data?.closing) {\n // When navigating to a screen, remove the no animation param to re-enable animations\n // Otherwise the navigation back would also have no animation\n if (hasParam(route?.params, INTERNAL_EXPO_ROUTER_NO_ANIMATION_PARAM_NAME)) {\n navigation.replaceParams(\n removeParams(route?.params, [INTERNAL_EXPO_ROUTER_NO_ANIMATION_PARAM_NAME])\n );\n }\n }\n }\n );\n }, [navigation]);\n\n return (\n <Route node={value} route={route}>\n {value.type === 'route' && unstable_navigationEvents.hasAnyListener() && (\n <AnalyticsListeners navigation={navigation} screenId={route.key} />\n )}\n <ZoomTransitionEnabler route={route} />\n <ZoomTransitionTargetContextProvider route={route}>\n <React.Suspense fallback={<SuspenseFallback route={value} />}>\n <ScreenComponent\n {...props}\n // Expose the template segment path, e.g. `(home)`, `[foo]`, `index`\n // the intention is to make it possible to deduce shared routes.\n segment={value.route}\n />\n </React.Suspense>\n </ZoomTransitionTargetContextProvider>\n </Route>\n );\n }\n\n if (__DEV__) {\n BaseRoute.displayName = `Route(${value.route})`;\n }\n\n qualifiedStore.set(value, BaseRoute);\n return BaseRoute;\n}\n\nfunction AnalyticsListeners({\n navigation,\n screenId,\n}: {\n navigation: EventConsumer<EventMapBase>;\n screenId: string;\n}) {\n const stateForPath = useStateForPath();\n const isFirstRenderRef = React.useRef(true);\n\n const pathname = useMemo(\n () => (stateForPath ? decodeURIComponent(getPathFromState(stateForPath)) : undefined),\n [stateForPath]\n );\n\n if (isFirstRenderRef.current) {\n isFirstRenderRef.current = false;\n if (pathname) {\n unstable_navigationEvents.emit('pageWillRender', {\n pathname,\n screenId,\n });\n }\n }\n\n useEffect(() => {\n if (pathname) {\n return () => {\n unstable_navigationEvents.emit('pageRemoved', {\n pathname,\n screenId,\n });\n };\n }\n return () => {};\n }, [pathname]);\n\n useEffect(() => {\n if (pathname) {\n const cleanFocus = navigation.addListener('focus', () => {\n unstable_navigationEvents.emit('pageFocused', {\n pathname,\n screenId,\n });\n });\n const cleanBlur = navigation.addListener('blur', () => {\n unstable_navigationEvents.emit('pageBlurred', {\n pathname,\n screenId,\n });\n });\n return () => {\n cleanFocus();\n cleanBlur();\n };\n }\n return () => {};\n }, [navigation, pathname]);\n\n return null;\n}\n\nexport function screenOptionsFactory(\n route: RouteNode,\n options?: ScreenProps['options']\n): ScreenProps['options'] {\n return (args) => {\n // Only eager load generated components\n const staticOptions = route.generated ? route.loadRoute()?.getNavOptions : null;\n const staticResult = typeof staticOptions === 'function' ? staticOptions(args) : staticOptions;\n const dynamicResult = typeof options === 'function' ? options?.(args) : options;\n const output = {\n ...staticResult,\n ...dynamicResult,\n };\n\n // Prevent generated screens from showing up in the tab bar.\n if (route.internal) {\n output.tabBarItemStyle = { display: 'none' };\n output.tabBarButton = () => null;\n // TODO: React Navigation doesn't provide a way to prevent rendering the drawer item.\n output.drawerItemStyle = { height: 0, display: 'none' };\n }\n\n return output;\n };\n}\n\nexport function routeToScreen(\n route: RouteNode,\n { options, getId, ...props }: Partial<ScreenProps> = {}\n) {\n return (\n <Screen\n {...props}\n name={route.route}\n key={route.route}\n getId={getId}\n options={screenOptionsFactory(route, options)}\n getComponent={() => getQualifiedRouteComponent(route)}\n />\n );\n}\n\nexport function getSingularId(name: string, options: Record<string, any> = {}) {\n return name\n .split('/')\n .map((segment) => {\n if (segment.startsWith('[...')) {\n return options.params?.[segment.slice(4, -1)]?.join('/') || segment;\n } else if (segment.startsWith('[') && segment.endsWith(']')) {\n return options.params?.[segment.slice(1, -1)] || segment;\n } else {\n return segment;\n }\n })\n .join('/');\n}\n"]}
@@ -0,0 +1,9 @@
1
+ import { type StyleProp, type TextStyle } from 'react-native';
2
+ type NumericFontWeight = 100 | 200 | 300 | 400 | 500 | 600 | 700 | 800 | 900;
3
+ type ConvertedFontWeightType = Exclude<TextStyle['fontWeight'], number> | `${NumericFontWeight}`;
4
+ export declare function convertTextStyleToRNTextStyle<BaseStyleType extends Pick<TextStyle, 'fontWeight'>>(style: StyleProp<BaseStyleType | undefined>): (Omit<BaseStyleType, 'fontWeight'> & {
5
+ fontWeight?: ConvertedFontWeightType;
6
+ }) | undefined;
7
+ export type BasicTextStyle = Pick<TextStyle, 'fontSize' | 'fontWeight' | 'fontFamily' | 'color'>;
8
+ export {};
9
+ //# sourceMappingURL=font.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"font.d.ts","sourceRoot":"","sources":["../../src/utils/font.ts"],"names":[],"mappings":"AAAA,OAAO,EAAc,KAAK,SAAS,EAAE,KAAK,SAAS,EAAE,MAAM,cAAc,CAAC;AAE1E,KAAK,iBAAiB,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,CAAC;AAE7E,KAAK,uBAAuB,GAAG,OAAO,CAAC,SAAS,CAAC,YAAY,CAAC,EAAE,MAAM,CAAC,GAAG,GAAG,iBAAiB,EAAE,CAAC;AAEjG,wBAAgB,6BAA6B,CAAC,aAAa,SAAS,IAAI,CAAC,SAAS,EAAE,YAAY,CAAC,EAC/F,KAAK,EAAE,SAAS,CAAC,aAAa,GAAG,SAAS,CAAC,GAEzC,CAAC,IAAI,CAAC,aAAa,EAAE,YAAY,CAAC,GAAG;IACnC,UAAU,CAAC,EAAE,uBAAuB,CAAC;CACtC,CAAC,GACF,SAAS,CAeZ;AAED,MAAM,MAAM,cAAc,GAAG,IAAI,CAAC,SAAS,EAAE,UAAU,GAAG,YAAY,GAAG,YAAY,GAAG,OAAO,CAAC,CAAC"}
@@ -0,0 +1,20 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.convertTextStyleToRNTextStyle = convertTextStyleToRNTextStyle;
4
+ const react_native_1 = require("react-native");
5
+ function convertTextStyleToRNTextStyle(style) {
6
+ const flattenedStyle = react_native_1.StyleSheet.flatten(style);
7
+ if (!flattenedStyle) {
8
+ return undefined;
9
+ }
10
+ if ('fontWeight' in flattenedStyle) {
11
+ return {
12
+ ...flattenedStyle,
13
+ fontWeight: typeof flattenedStyle.fontWeight === 'number'
14
+ ? String(flattenedStyle.fontWeight)
15
+ : flattenedStyle.fontWeight,
16
+ };
17
+ }
18
+ return flattenedStyle;
19
+ }
20
+ //# sourceMappingURL=font.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"font.js","sourceRoot":"","sources":["../../src/utils/font.ts"],"names":[],"mappings":";;AAMA,sEAqBC;AA3BD,+CAA0E;AAM1E,SAAgB,6BAA6B,CAC3C,KAA2C;IAM3C,MAAM,cAAc,GAAG,yBAAU,CAAC,OAAO,CAAC,KAAK,CAA8B,CAAC;IAC9E,IAAI,CAAC,cAAc,EAAE,CAAC;QACpB,OAAO,SAAS,CAAC;IACnB,CAAC;IACD,IAAI,YAAY,IAAI,cAAc,EAAE,CAAC;QACnC,OAAO;YACL,GAAG,cAAc;YACjB,UAAU,EACR,OAAO,cAAc,CAAC,UAAU,KAAK,QAAQ;gBAC3C,CAAC,CAAE,MAAM,CAAC,cAAc,CAAC,UAAU,CAA4B;gBAC/D,CAAC,CAAC,cAAc,CAAC,UAAU;SAChC,CAAC;IACJ,CAAC;IACD,OAAO,cAAmD,CAAC;AAC7D,CAAC","sourcesContent":["import { StyleSheet, type StyleProp, type TextStyle } from 'react-native';\n\ntype NumericFontWeight = 100 | 200 | 300 | 400 | 500 | 600 | 700 | 800 | 900;\n\ntype ConvertedFontWeightType = Exclude<TextStyle['fontWeight'], number> | `${NumericFontWeight}`;\n\nexport function convertTextStyleToRNTextStyle<BaseStyleType extends Pick<TextStyle, 'fontWeight'>>(\n style: StyleProp<BaseStyleType | undefined>\n):\n | (Omit<BaseStyleType, 'fontWeight'> & {\n fontWeight?: ConvertedFontWeightType;\n })\n | undefined {\n const flattenedStyle = StyleSheet.flatten(style) as BaseStyleType | undefined;\n if (!flattenedStyle) {\n return undefined;\n }\n if ('fontWeight' in flattenedStyle) {\n return {\n ...flattenedStyle,\n fontWeight:\n typeof flattenedStyle.fontWeight === 'number'\n ? (String(flattenedStyle.fontWeight) as `${NumericFontWeight}`)\n : flattenedStyle.fontWeight,\n };\n }\n return flattenedStyle as Omit<BaseStyleType, 'fontWeight'>;\n}\n\nexport type BasicTextStyle = Pick<TextStyle, 'fontSize' | 'fontWeight' | 'fontFamily' | 'color'>;\n"]}
@@ -9,7 +9,7 @@
9
9
  "publication": {
10
10
  "groupId": "expo.modules.router",
11
11
  "artifactId": "expo.modules.router",
12
- "version": "7.0.0-canary-20251216-3f01dbf",
12
+ "version": "7.0.0-canary-20251230-fc48ddc",
13
13
  "repository": "local-maven-repo"
14
14
  }
15
15
  }
@@ -1,78 +1,34 @@
1
1
  import ExpoModulesCore
2
- import WebKit
3
2
 
4
- class LinkPreviewNativeActionView: ExpoView, LinkPreviewMenuUpdatable {
3
+ class LinkPreviewNativeActionView: RouterViewWithLogger, LinkPreviewMenuUpdatable {
5
4
  var identifier: String = ""
6
5
  // MARK: - Shared props
7
- var title: String = "" {
8
- didSet {
9
- updateUiAction()
10
- if isMenuAction {
11
- updateMenu()
12
- }
13
- }
14
- }
15
- var icon: String? {
16
- didSet {
17
- updateUiAction()
18
- if isMenuAction {
19
- updateMenu()
20
- }
21
- }
22
- }
23
- var destructive: Bool? {
24
- didSet {
25
- updateUiAction()
26
- if isMenuAction {
27
- updateMenu()
28
- }
29
- }
30
- }
6
+ @NativeActionProp(updateAction: true, updateMenu: true) var title: String = ""
7
+ @NativeActionProp(updateAction: true, updateMenu: true) var icon: String?
8
+ @NativeActionProp(updateAction: true, updateMenu: true) var destructive: Bool?
9
+ @NativeActionProp(updateAction: true, updateMenu: true) var disabled: Bool = false
31
10
 
32
11
  // MARK: - Action only props
33
- var disabled: Bool? {
34
- didSet {
35
- updateUiAction()
36
- }
37
- }
38
- var isOn: Bool? {
39
- didSet {
40
- updateUiAction()
41
- }
42
- }
43
- var keepPresented: Bool? {
44
- didSet {
45
- updateUiAction()
46
- }
47
- }
12
+ @NativeActionProp(updateAction: true) var isOn: Bool?
13
+ @NativeActionProp(updateAction: true) var keepPresented: Bool?
14
+ @NativeActionProp(updateAction: true) var discoverabilityLabel: String?
15
+ @NativeActionProp(updateAction: true, updateMenu: true) var subtitle: String?
48
16
 
49
17
  // MARK: - Menu only props
50
- var singleSelection: Bool = false {
51
- didSet {
52
- if isMenuAction {
53
- updateMenu()
54
- }
55
- }
56
- }
57
- var displayAsPalette: Bool = false {
58
- didSet {
59
- if isMenuAction {
60
- updateMenu()
61
- }
62
- }
63
- }
64
- var displayInline: Bool = false {
65
- didSet {
66
- if isMenuAction {
67
- updateMenu()
68
- }
69
- }
70
- }
71
- var subActions: [LinkPreviewNativeActionView] = [] {
72
- didSet {
73
- updateMenu()
74
- }
75
- }
18
+ @NativeActionProp(updateMenu: true) var singleSelection: Bool = false
19
+ @NativeActionProp(updateMenu: true) var displayAsPalette: Bool = false
20
+ @NativeActionProp(updateMenu: true) var displayInline: Bool = false
21
+
22
+ // MARK: - UIBarButtonItem props
23
+ @NativeActionProp(updateAction: true, updateMenu: true) var routerHidden: Bool = false
24
+ @NativeActionProp(updateMenu: true) var titleStyle: TitleStyle?
25
+ @NativeActionProp(updateMenu: true) var sharesBackground: Bool?
26
+ @NativeActionProp(updateMenu: true) var hidesSharedBackground: Bool?
27
+ @NativeActionProp(updateAction: true, updateMenu: true) var customTintColor: UIColor?
28
+ @NativeActionProp(updateMenu: true) var barButtonItemStyle: UIBarButtonItem.Style?
29
+ @NativeActionProp(updateMenu: true) var subActions: [LinkPreviewNativeActionView] = []
30
+ @NativeActionProp(updateMenu: true) var accessibilityLabelForMenu: String?
31
+ @NativeActionProp(updateMenu: true) var accessibilityHintForMenu: String?
76
32
 
77
33
  // MARK: - Events
78
34
  let onSelected = EventDispatcher()
@@ -126,13 +82,20 @@ class LinkPreviewNativeActionView: ExpoView, LinkPreviewMenuUpdatable {
126
82
  children: subActions
127
83
  )
128
84
 
85
+ if let subtitle = subtitle {
86
+ menuAction.subtitle = subtitle
87
+ }
88
+
129
89
  parentMenuUpdatable?.updateMenu()
130
90
  }
131
91
 
132
- private func updateUiAction() {
92
+ func updateUiAction() {
133
93
  var attributes: UIMenuElement.Attributes = []
134
94
  if destructive == true { attributes.insert(.destructive) }
135
95
  if disabled == true { attributes.insert(.disabled) }
96
+ if routerHidden {
97
+ attributes.insert(.hidden)
98
+ }
136
99
 
137
100
  if #available(iOS 16.0, *) {
138
101
  if keepPresented == true { attributes.insert(.keepsMenuPresented) }
@@ -143,31 +106,85 @@ class LinkPreviewNativeActionView: ExpoView, LinkPreviewMenuUpdatable {
143
106
  baseUiAction.attributes = attributes
144
107
  baseUiAction.state = isOn == true ? .on : .off
145
108
 
109
+ if let subtitle = subtitle {
110
+ baseUiAction.subtitle = subtitle
111
+ }
112
+ if let label = discoverabilityLabel {
113
+ baseUiAction.discoverabilityTitle = label
114
+ }
115
+
146
116
  parentMenuUpdatable?.updateMenu()
147
117
  }
148
118
 
149
- #if RCT_NEW_ARCH_ENABLED
150
- override func mountChildComponentView(_ childComponentView: UIView, index: Int) {
151
- if let childActionView = childComponentView as? LinkPreviewNativeActionView {
152
- subActions.insert(childActionView, at: index)
153
- childActionView.parentMenuUpdatable = self
154
- } else {
155
- print(
156
- "ExpoRouter: Unknown child component view (\(childComponentView)) mounted to NativeLinkPreviewActionView"
157
- )
158
- }
119
+ override func mountChildComponentView(_ childComponentView: UIView, index: Int) {
120
+ if let childActionView = childComponentView as? LinkPreviewNativeActionView {
121
+ subActions.insert(childActionView, at: index)
122
+ childActionView.parentMenuUpdatable = self
123
+ } else {
124
+ logger?.warn(
125
+ "[expo-router] Unknown child component view (\(childComponentView)) mounted to NativeLinkPreviewActionView. This is most likely a bug in expo-router."
126
+ )
159
127
  }
128
+ }
129
+
130
+ override func unmountChildComponentView(_ child: UIView, index: Int) {
131
+ if let childActionView = child as? LinkPreviewNativeActionView {
132
+ subActions.removeAll(where: { $0 == childActionView })
133
+ } else {
134
+ logger?.warn(
135
+ "ExpoRouter: Unknown child component view (\(child)) unmounted from NativeLinkPreviewActionView. This is most likely a bug in expo-router."
136
+ )
137
+ }
138
+ }
160
139
 
161
- override func unmountChildComponentView(_ child: UIView, index: Int) {
162
- if let childActionView = child as? LinkPreviewNativeActionView {
163
- subActions.removeAll(where: { $0 == childActionView })
164
- } else {
165
- print(
166
- "ExpoRouter: Unknown child component view (\(child)) unmounted from NativeLinkPreviewActionView"
167
- )
140
+ @propertyWrapper
141
+ struct NativeActionProp<Value: Equatable> {
142
+ var value: Value
143
+ let updateAction: Bool
144
+ let updateMenu: Bool
145
+
146
+ init(wrappedValue: Value, updateAction: Bool = false, updateMenu: Bool = false) {
147
+ self.value = wrappedValue
148
+ self.updateAction = updateAction
149
+ self.updateMenu = updateMenu
150
+ }
151
+
152
+ static subscript<EnclosingSelf: LinkPreviewNativeActionView>(
153
+ _enclosingInstance instance: EnclosingSelf,
154
+ wrapped wrappedKeyPath: ReferenceWritableKeyPath<EnclosingSelf, Value>,
155
+ storage storageKeyPath: ReferenceWritableKeyPath<EnclosingSelf, NativeActionProp<Value>>
156
+ ) -> Value {
157
+ get {
158
+ instance[keyPath: storageKeyPath].value
159
+ }
160
+ set {
161
+ let oldValue = instance[keyPath: storageKeyPath].value
162
+ if oldValue != newValue {
163
+ instance[keyPath: storageKeyPath].value = newValue
164
+ if instance[keyPath: storageKeyPath].updateAction {
165
+ instance.updateUiAction()
166
+ }
167
+ if instance[keyPath: storageKeyPath].updateMenu {
168
+ instance.updateMenu()
169
+ }
170
+ }
168
171
  }
169
172
  }
170
- #endif
173
+
174
+ var wrappedValue: Value {
175
+ get { value }
176
+ set { value = newValue }
177
+ }
178
+ }
179
+ }
180
+
181
+ // Needed to allow optional properties without default `= nil` to avoid repetition
182
+ extension LinkPreviewNativeActionView.NativeActionProp where Value: ExpressibleByNilLiteral {
183
+ init(updateAction: Bool = false, updateMenu: Bool = false) {
184
+ self.value = nil
185
+ self.updateAction = updateAction
186
+ self.updateMenu = updateMenu
187
+ }
171
188
  }
172
189
 
173
190
  protocol LinkPreviewMenuUpdatable: AnyObject {