@ankhorage/expo-runtime 4.0.49 → 6.0.1

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 (177) hide show
  1. package/CHANGELOG.md +25 -0
  2. package/README.md +2 -3
  3. package/dist/capabilities/index.d.ts +25 -0
  4. package/dist/capabilities/index.d.ts.map +1 -0
  5. package/dist/capabilities/index.js +25 -0
  6. package/dist/capabilities/index.js.map +1 -0
  7. package/dist/capabilityBridge.d.ts +5 -0
  8. package/dist/capabilityBridge.d.ts.map +1 -0
  9. package/dist/capabilityBridge.js +3 -0
  10. package/dist/capabilityBridge.js.map +1 -0
  11. package/dist/createExpoRuntimeRegistry.d.ts.map +1 -1
  12. package/dist/createExpoRuntimeRegistry.js +0 -5
  13. package/dist/createExpoRuntimeRegistry.js.map +1 -1
  14. package/dist/expoRuntimePlanningMetadata.d.ts +3 -7
  15. package/dist/expoRuntimePlanningMetadata.d.ts.map +1 -1
  16. package/dist/expoRuntimePlanningMetadata.js +2 -6
  17. package/dist/expoRuntimePlanningMetadata.js.map +1 -1
  18. package/dist/features/capabilities/executeExpoRuntimeCapabilityAsync.d.ts +4 -0
  19. package/dist/features/capabilities/executeExpoRuntimeCapabilityAsync.d.ts.map +1 -0
  20. package/dist/features/capabilities/executeExpoRuntimeCapabilityAsync.js +30 -0
  21. package/dist/features/capabilities/executeExpoRuntimeCapabilityAsync.js.map +1 -0
  22. package/dist/features/navigation/resolveExpoRuntimeRoutePath.d.ts +4 -0
  23. package/dist/features/navigation/resolveExpoRuntimeRoutePath.d.ts.map +1 -0
  24. package/dist/features/navigation/resolveExpoRuntimeRoutePath.js +17 -0
  25. package/dist/features/navigation/resolveExpoRuntimeRoutePath.js.map +1 -0
  26. package/dist/generatedSources.d.ts +0 -1
  27. package/dist/generatedSources.d.ts.map +1 -1
  28. package/dist/generatedSources.js +0 -8
  29. package/dist/generatedSources.js.map +1 -1
  30. package/dist/index.d.ts +2 -3
  31. package/dist/index.d.ts.map +1 -1
  32. package/dist/index.js +2 -3
  33. package/dist/index.js.map +1 -1
  34. package/dist/planning.d.ts +1 -1
  35. package/dist/planning.d.ts.map +1 -1
  36. package/dist/planning.js +1 -1
  37. package/dist/planning.js.map +1 -1
  38. package/dist/platform.js +8 -8
  39. package/dist/platform.js.map +1 -1
  40. package/dist/types/expoRuntimeCapability.d.ts +16 -0
  41. package/dist/types/expoRuntimeCapability.d.ts.map +1 -0
  42. package/dist/types/expoRuntimeCapability.js +2 -0
  43. package/dist/types/expoRuntimeCapability.js.map +1 -0
  44. package/dist/types/expoRuntimeRoute.d.ts +5 -0
  45. package/dist/types/expoRuntimeRoute.d.ts.map +1 -0
  46. package/dist/types/expoRuntimeRoute.js +2 -0
  47. package/dist/types/expoRuntimeRoute.js.map +1 -0
  48. package/package.json +59 -46
  49. package/src/adapterEntrypoints.test.ts +23 -14
  50. package/src/capabilities/index.test.ts +18 -0
  51. package/src/capabilities/index.ts +26 -0
  52. package/src/capabilityBridge.ts +8 -0
  53. package/src/createExpoRuntimeRegistry.test.tsx +3 -8
  54. package/src/createExpoRuntimeRegistry.tsx +1 -7
  55. package/src/expoCapabilityBridge.test.ts +60 -0
  56. package/src/expoRuntimePlanningMetadata.ts +3 -7
  57. package/src/features/capabilities/executeExpoRuntimeCapabilityAsync.ts +50 -0
  58. package/src/features/navigation/resolveExpoRuntimeRoutePath.ts +31 -0
  59. package/src/generatedSources.test.ts +1 -10
  60. package/src/generatedSources.ts +0 -10
  61. package/src/iconFonts.test.ts +0 -2
  62. package/src/index.ts +9 -15
  63. package/src/planning.ts +1 -4
  64. package/src/platform.test.ts +8 -8
  65. package/src/platform.ts +8 -8
  66. package/src/resolveExpoRuntimePlan.test.ts +5 -20
  67. package/src/types/expoRuntimeCapability.ts +18 -0
  68. package/src/types/expoRuntimeRoute.ts +4 -0
  69. package/dist/actionBridge.d.ts +0 -2
  70. package/dist/actionBridge.d.ts.map +0 -1
  71. package/dist/actionBridge.js +0 -2
  72. package/dist/actionBridge.js.map +0 -1
  73. package/dist/expoActionBridge.d.ts +0 -29
  74. package/dist/expoActionBridge.d.ts.map +0 -1
  75. package/dist/expoActionBridge.js +0 -78
  76. package/dist/expoActionBridge.js.map +0 -1
  77. package/dist/reader/ExpoReaderSurfaceAdapter.d.ts +0 -4
  78. package/dist/reader/ExpoReaderSurfaceAdapter.d.ts.map +0 -1
  79. package/dist/reader/ExpoReaderSurfaceAdapter.js +0 -102
  80. package/dist/reader/ExpoReaderSurfaceAdapter.js.map +0 -1
  81. package/dist/reader/ReaderViewport.d.ts +0 -4
  82. package/dist/reader/ReaderViewport.d.ts.map +0 -1
  83. package/dist/reader/ReaderViewport.js +0 -212
  84. package/dist/reader/ReaderViewport.js.map +0 -1
  85. package/dist/reader/drivers/EpubReaderDriver.d.ts +0 -20
  86. package/dist/reader/drivers/EpubReaderDriver.d.ts.map +0 -1
  87. package/dist/reader/drivers/EpubReaderDriver.js +0 -259
  88. package/dist/reader/drivers/EpubReaderDriver.js.map +0 -1
  89. package/dist/reader/drivers/PdfReaderDriver.d.ts +0 -18
  90. package/dist/reader/drivers/PdfReaderDriver.d.ts.map +0 -1
  91. package/dist/reader/drivers/PdfReaderDriver.js +0 -198
  92. package/dist/reader/drivers/PdfReaderDriver.js.map +0 -1
  93. package/dist/reader/epub/EpubArchive.d.ts +0 -11
  94. package/dist/reader/epub/EpubArchive.d.ts.map +0 -1
  95. package/dist/reader/epub/EpubArchive.js +0 -65
  96. package/dist/reader/epub/EpubArchive.js.map +0 -1
  97. package/dist/reader/epub/EpubArchiveFetcher.d.ts +0 -11
  98. package/dist/reader/epub/EpubArchiveFetcher.d.ts.map +0 -1
  99. package/dist/reader/epub/EpubArchiveFetcher.js +0 -44
  100. package/dist/reader/epub/EpubArchiveFetcher.js.map +0 -1
  101. package/dist/reader/epub/mediaTypes.d.ts +0 -3
  102. package/dist/reader/epub/mediaTypes.d.ts.map +0 -1
  103. package/dist/reader/epub/mediaTypes.js +0 -26
  104. package/dist/reader/epub/mediaTypes.js.map +0 -1
  105. package/dist/reader/epub/parseEpubPackage.d.ts +0 -22
  106. package/dist/reader/epub/parseEpubPackage.d.ts.map +0 -1
  107. package/dist/reader/epub/parseEpubPackage.js +0 -98
  108. package/dist/reader/epub/parseEpubPackage.js.map +0 -1
  109. package/dist/reader/epub/path.d.ts +0 -4
  110. package/dist/reader/epub/path.d.ts.map +0 -1
  111. package/dist/reader/epub/path.js +0 -28
  112. package/dist/reader/epub/path.js.map +0 -1
  113. package/dist/reader/epub/sanitizeEpubDocument.d.ts +0 -3
  114. package/dist/reader/epub/sanitizeEpubDocument.d.ts.map +0 -1
  115. package/dist/reader/epub/sanitizeEpubDocument.js +0 -90
  116. package/dist/reader/epub/sanitizeEpubDocument.js.map +0 -1
  117. package/dist/reader/epub/validateEpubArchiveEntriesAsync.d.ts +0 -4
  118. package/dist/reader/epub/validateEpubArchiveEntriesAsync.d.ts.map +0 -1
  119. package/dist/reader/epub/validateEpubArchiveEntriesAsync.js +0 -50
  120. package/dist/reader/epub/validateEpubArchiveEntriesAsync.js.map +0 -1
  121. package/dist/reader/errors/ReaderDocumentError.d.ts +0 -6
  122. package/dist/reader/errors/ReaderDocumentError.d.ts.map +0 -1
  123. package/dist/reader/errors/ReaderDocumentError.js +0 -9
  124. package/dist/reader/errors/ReaderDocumentError.js.map +0 -1
  125. package/dist/reader/index.d.ts +0 -2
  126. package/dist/reader/index.d.ts.map +0 -1
  127. package/dist/reader/index.js +0 -2
  128. package/dist/reader/index.js.map +0 -1
  129. package/dist/reader/loadReaderSourceAsync.d.ts +0 -2
  130. package/dist/reader/loadReaderSourceAsync.d.ts.map +0 -1
  131. package/dist/reader/loadReaderSourceAsync.js +0 -49
  132. package/dist/reader/loadReaderSourceAsync.js.map +0 -1
  133. package/dist/reader/navigation/resolveReaderKeyboardIntent.d.ts +0 -9
  134. package/dist/reader/navigation/resolveReaderKeyboardIntent.d.ts.map +0 -1
  135. package/dist/reader/navigation/resolveReaderKeyboardIntent.js +0 -19
  136. package/dist/reader/navigation/resolveReaderKeyboardIntent.js.map +0 -1
  137. package/dist/reader/navigation/resolveReaderNavigationIntent.d.ts +0 -11
  138. package/dist/reader/navigation/resolveReaderNavigationIntent.d.ts.map +0 -1
  139. package/dist/reader/navigation/resolveReaderNavigationIntent.js +0 -16
  140. package/dist/reader/navigation/resolveReaderNavigationIntent.js.map +0 -1
  141. package/dist/reader/readerViewportPresentation.d.ts +0 -4
  142. package/dist/reader/readerViewportPresentation.d.ts.map +0 -1
  143. package/dist/reader/readerViewportPresentation.js +0 -26
  144. package/dist/reader/readerViewportPresentation.js.map +0 -1
  145. package/dist/types/reader.d.ts +0 -57
  146. package/dist/types/reader.d.ts.map +0 -1
  147. package/dist/types/reader.js +0 -2
  148. package/dist/types/reader.js.map +0 -1
  149. package/src/actionBridge.test.ts +0 -10
  150. package/src/actionBridge.ts +0 -10
  151. package/src/expoActionBridge.test.ts +0 -54
  152. package/src/expoActionBridge.ts +0 -140
  153. package/src/reader/ExpoReaderSurfaceAdapter.tsx +0 -170
  154. package/src/reader/ReaderViewport.tsx +0 -319
  155. package/src/reader/drivers/EpubReaderDriver.ts +0 -309
  156. package/src/reader/drivers/PdfReaderDriver.ts +0 -253
  157. package/src/reader/epub/EpubArchive.ts +0 -83
  158. package/src/reader/epub/EpubArchiveFetcher.ts +0 -58
  159. package/src/reader/epub/mediaTypes.ts +0 -16
  160. package/src/reader/epub/parseEpubPackage.test.ts +0 -116
  161. package/src/reader/epub/parseEpubPackage.ts +0 -152
  162. package/src/reader/epub/path.test.ts +0 -22
  163. package/src/reader/epub/path.ts +0 -26
  164. package/src/reader/epub/sanitizeEpubDocument.ts +0 -121
  165. package/src/reader/epub/validateEpubArchiveEntriesAsync.ts +0 -75
  166. package/src/reader/errors/ReaderDocumentError.ts +0 -11
  167. package/src/reader/index.ts +0 -1
  168. package/src/reader/loadReaderSourceAsync.test.ts +0 -52
  169. package/src/reader/loadReaderSourceAsync.ts +0 -59
  170. package/src/reader/navigation/resolveReaderKeyboardIntent.test.ts +0 -38
  171. package/src/reader/navigation/resolveReaderKeyboardIntent.ts +0 -20
  172. package/src/reader/navigation/resolveReaderNavigationIntent.test.ts +0 -48
  173. package/src/reader/navigation/resolveReaderNavigationIntent.ts +0 -23
  174. package/src/reader/readerViewportPresentation.ts +0 -28
  175. package/src/reader/rendererPackages.test.ts +0 -24
  176. package/src/reader/validateEpubArchiveEntriesAsync.test.ts +0 -142
  177. package/src/types/reader.ts +0 -61
@@ -1 +1 @@
1
- {"version":3,"file":"platform.js","sourceRoot":"","sources":["../src/platform.ts"],"names":[],"mappings":"AAKA,SAAS,aAAa,CAAC,IAAY,EAAE,OAAe;IAClD,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,CAAC;AAC3B,CAAC;AAED;;;;;;GAMG;AACH,MAAM,CAAC,MAAM,aAAa,GAAG;IAC3B,GAAG,EAAE,EAAE;IACP,YAAY,EAAE,uBAAuB;IACrC,OAAO,EAAE;QACP,IAAI,EAAE,aAAa,CAAC,MAAM,EAAE,SAAS,CAAC;QACtC,KAAK,EAAE,aAAa,CAAC,OAAO,EAAE,QAAQ,CAAC;QACvC,QAAQ,EAAE,aAAa,CAAC,WAAW,EAAE,QAAQ,CAAC;QAC9C,WAAW,EAAE,aAAa,CAAC,cAAc,EAAE,QAAQ,CAAC;QACpD,cAAc,EAAE,aAAa,CAAC,kBAAkB,EAAE,SAAS,CAAC;KAC7D;IACD,OAAO,EAAE;QACP,IAAI,EAAE;YACJ,GAAG,EAAE,EAAE;YACP,OAAO,EAAE,MAAM;SAChB;QACD,SAAS,EAAE,aAAa,CAAC,aAAa,EAAE,UAAU,CAAC;QACnD,UAAU,EAAE,aAAa,CAAC,cAAc,EAAE,SAAS,CAAC;QACpD,UAAU,EAAE,aAAa,CAAC,YAAY,EAAE,QAAQ,CAAC;QACjD,UAAU,EAAE,aAAa,CAAC,aAAa,EAAE,QAAQ,CAAC;KACnD;IACD,UAAU,EAAE;QACV,UAAU,EA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,CAAC,sBAAsB,EAAE,SAAS,CAAC;QAChE,UAAU,EAAE,aAAa,CAAC,kBAAkB,EAAE,SAAS,CAAC;QACxD,IAAI,EAAE,aAAa,CAAC,WAAW,EAAE,SAAS,CAAC;QAC3C,WAAW,EAAE,aAAa,CAAC,mBAAmB,EAAE,UAAU,CAAC;QAC3D,cAAc,EAAE,aAAa,CAAC,sBAAsB,EAAE,SAAS,CAAC;QAChE,OAAO,EAAE,aAAa,CAAC,cAAc,EAAE,UAAU,CAAC;QAClD,YAAY,EAAE,aAAa,CAAC,mBAAmB,EAAE,SAAS,CAAC;QAC3D,QAAQ,EAAE,aAAa,CAAC,eAAe,EAAE,UAAU,CAAC;QACpD,YAAY,EAAE,aAAa,CAAC,oBAAoB,EAAE,SAAS,CAAC;QAC5D,aAAa,EAAE,aAAa,CAAC,oBAAoB,EAAE,UAAU,CAAC;QAC9D,WAAW,EAAE,aAAa,CAAC,mBAAmB,EAAE,SAAS,CAAC;QAC1D,YAAY,EAAE,aAAa,CAAC,oBAAoB,EAAE,SAAS,CAAC;QAC5D,SAAS,EAAE,aAAa,CAAC,iBAAiB,EAAE,SAAS,CAAC;QACtD,OAAO,EAAE,aAAa,CAAC,cAAc,EAAE,UAAU,CAAC;QAClD,UAAU,EAAE,aAAa,CAAC,kBAAkB,EAAE,SAAS,CAAC;KACzD;IACD,SAAS,EAAE;QACT,OAAO,EAAE;YACP,cAAc,EAAE,CAAC;YACjB,eAAe,EAAE,EAAE;YACnB,UAAU,EAAE,EAAE;YACd,SAAS,EAAE,EAAE;YACb,UAAU,EAAE,IAAI;SACjB;QACD,GAAG,EAAE;YACH,cAAc,EAAE,MAAM;YACtB,mBAAmB,EAAE,MAAM;SAC5B;KACF;CACO,CAAC","sourcesContent":["export interface ExpoPlatformPackage {\n readonly name: string;\n readonly version: string;\n}\n\nfunction definePackage(name: string, version: string): ExpoPlatformPackage {\n return { name, version };\n}\n\n/**\n * The canonical Ankhorage projection of the supported Expo platform.\n *\n * Package versions come from Expo SDK 57's bundled native module map. Keep this\n * structure as the only hand-maintained Expo compatibility authority in this\n * repository; generated manifests and runtime planning derive from it.\n */\nexport const EXPO_PLATFORM = {\n sdk: 57,\n architecture: 'new-architecture-only',\n runtime: {\n expo: definePackage('expo', '57.0.26'),\n react: definePackage('react', '19.2.3'),\n reactDom: definePackage('react-dom', '19.2.3'),\n reactNative: definePackage('react-native', '0.86.3'),\n reactNativeWeb: definePackage('react-native-web', '~0.21.3'),\n },\n tooling: {\n node: {\n lts: 24,\n version: '24.x',\n },\n nodeTypes: definePackage('@types/node', '^24.13.3'),\n reactTypes: definePackage('@types/react', '~19.2.4'),\n typescript: definePackage('typescript', '~6.0.3'),\n expoDoctor: definePackage('expo-doctor', '1.20.4'),\n },\n navigation: {\n expoRouter: definePackage('expo-router', '~57.0.24'),\n screens: definePackage('react-native-screens', '~4.26.0'),\n safeArea: definePackage('react-native-safe-area-context', '~5.7.0'),\n },\n animation: {\n reanimated: definePackage('react-native-reanimated', '4.5.1'),\n worklets: definePackage('react-native-worklets', '0.10.1'),\n gestureHandler: definePackage('react-native-gesture-handler', '~2.32.0'),\n },\n ui: {\n svg: definePackage('react-native-svg', '15.15.4'),\n iconProviders: {\n Ionicons: definePackage('@react-native-vector-icons/ionicons', '^13.1.4'),\n FontAwesome: definePackage('@react-native-vector-icons/fontawesome', '^13.1.4'),\n FontAwesome5: definePackage('@react-native-vector-icons/fontawesome5', '^13.1.4'),\n FontAwesome6: definePackage('@react-native-vector-icons/fontawesome6', '^13.1.4'),\n MaterialDesignIcons: definePackage(\n '@react-native-vector-icons/material-design-icons',\n '^13.1.4',\n ),\n },\n },\n packages: {\n metroRuntime: definePackage('@expo/metro-runtime', '~57.0.16'),\n asset: definePackage('expo-asset', '~57.0.18'),\n audio: definePackage('expo-audio', '~57.0.5'),\n authSession: definePackage('expo-auth-session', '~57.0.13'),\n camera: definePackage('expo-camera', '~57.0.6'),\n constants: definePackage('expo-constants', '~57.0.20'),\n crypto: definePackage('expo-crypto', '~57.0.3'),\n devClient: definePackage('expo-dev-client', '~57.0.19'),\n documentPicker: definePackage('expo-document-picker', '~57.0.3'),\n fileSystem: definePackage('expo-file-system', '~57.0.7'),\n font: definePackage('expo-font', '~57.0.4'),\n imagePicker: definePackage('expo-image-picker', '~57.0.20'),\n linearGradient: definePackage('expo-linear-gradient', '~57.0.2'),\n linking: definePackage('expo-linking', '~57.0.11'),\n localization: definePackage('expo-localization', '~57.0.2'),\n location: definePackage('expo-location', '~57.0.20'),\n mediaLibrary: definePackage('expo-media-library', '~57.0.5'),\n notifications: definePackage('expo-notifications', '~57.0.21'),\n secureStore: definePackage('expo-secure-store', '~57.0.4'),\n splashScreen: definePackage('expo-splash-screen', '~57.0.9'),\n statusBar: definePackage('expo-status-bar', '~57.0.1'),\n updates: definePackage('expo-updates', '~57.0.24'),\n webBrowser: definePackage('expo-web-browser', '~57.0.3'),\n },\n platforms: {\n android: {\n minimumVersion: 7,\n minimumApiLevel: 24,\n compileSdk: 36,\n targetSdk: 36,\n edgeToEdge: true,\n },\n ios: {\n minimumVersion: '16.4',\n minimumXcodeVersion: '26.4',\n },\n },\n} as const;\n\nexport type ExpoPlatform = typeof EXPO_PLATFORM;\n"]}
1
+ {"version":3,"file":"platform.js","sourceRoot":"","sources":["../src/platform.ts"],"names":[],"mappings":"AAKA,SAAS,aAAa,CAAC,IAAY,EAAE,OAAe;IAClD,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,CAAC;AAC3B,CAAC;AAED;;;;;;GAMG;AACH,MAAM,CAAC,MAAM,aAAa,GAAG;IAC3B,GAAG,EAAE,EAAE;IACP,YAAY,EAAE,uBAAuB;IACrC,OAAO,EAAE;QACP,IAAI,EAAE,aAAa,CAAC,MAAM,EAAE,SAAS,CAAC;QACtC,KAAK,EAAE,aAAa,CAAC,OAAO,EAAE,QAAQ,CAAC;QACvC,QAAQ,EAAE,aAAa,CAAC,WAAW,EAAE,QAAQ,CAAC;QAC9C,WAAW,EAAE,aAAa,CA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kBAAkB,EAAE,SAAS,CAAC;KACzD;IACD,SAAS,EAAE;QACT,OAAO,EAAE;YACP,cAAc,EAAE,CAAC;YACjB,eAAe,EAAE,EAAE;YACnB,UAAU,EAAE,EAAE;YACd,SAAS,EAAE,EAAE;YACb,UAAU,EAAE,IAAI;SACjB;QACD,GAAG,EAAE;YACH,cAAc,EAAE,MAAM;YACtB,mBAAmB,EAAE,MAAM;SAC5B;KACF;CACO,CAAC","sourcesContent":["export interface ExpoPlatformPackage {\n readonly name: string;\n readonly version: string;\n}\n\nfunction definePackage(name: string, version: string): ExpoPlatformPackage {\n return { name, version };\n}\n\n/**\n * The canonical Ankhorage projection of the supported Expo platform.\n *\n * Package versions come from Expo SDK 57's bundled native module map. Keep this\n * structure as the only hand-maintained Expo compatibility authority in this\n * repository; generated manifests and runtime planning derive from it.\n */\nexport const EXPO_PLATFORM = {\n sdk: 57,\n architecture: 'new-architecture-only',\n runtime: {\n expo: definePackage('expo', '57.0.27'),\n react: definePackage('react', '19.2.3'),\n reactDom: definePackage('react-dom', '19.2.3'),\n reactNative: definePackage('react-native', '0.86.3'),\n reactNativeWeb: definePackage('react-native-web', '~0.21.3'),\n },\n tooling: {\n node: {\n lts: 24,\n version: '24.x',\n },\n nodeTypes: definePackage('@types/node', '^24.13.3'),\n reactTypes: definePackage('@types/react', '~19.2.4'),\n typescript: definePackage('typescript', '~6.0.3'),\n expoDoctor: definePackage('expo-doctor', '1.20.4'),\n },\n navigation: {\n expoRouter: definePackage('expo-router', '~57.0.25'),\n screens: definePackage('react-native-screens', '~4.26.0'),\n safeArea: definePackage('react-native-safe-area-context', '~5.7.0'),\n },\n animation: {\n reanimated: definePackage('react-native-reanimated', '4.5.1'),\n worklets: definePackage('react-native-worklets', '0.10.1'),\n gestureHandler: definePackage('react-native-gesture-handler', '~2.32.0'),\n },\n ui: {\n svg: definePackage('react-native-svg', '15.15.4'),\n iconProviders: {\n Ionicons: definePackage('@react-native-vector-icons/ionicons', '^13.1.4'),\n FontAwesome: definePackage('@react-native-vector-icons/fontawesome', '^13.1.4'),\n FontAwesome5: definePackage('@react-native-vector-icons/fontawesome5', '^13.1.4'),\n FontAwesome6: definePackage('@react-native-vector-icons/fontawesome6', '^13.1.4'),\n MaterialDesignIcons: definePackage(\n '@react-native-vector-icons/material-design-icons',\n '^13.1.4',\n ),\n },\n },\n packages: {\n metroRuntime: definePackage('@expo/metro-runtime', '~57.0.16'),\n asset: definePackage('expo-asset', '~57.0.19'),\n audio: definePackage('expo-audio', '~57.0.5'),\n authSession: definePackage('expo-auth-session', '~57.0.14'),\n camera: definePackage('expo-camera', '~57.0.6'),\n constants: definePackage('expo-constants', '~57.0.21'),\n crypto: definePackage('expo-crypto', '~57.0.3'),\n devClient: definePackage('expo-dev-client', '~57.0.19'),\n documentPicker: definePackage('expo-document-picker', '~57.0.3'),\n fileSystem: definePackage('expo-file-system', '~57.0.7'),\n font: definePackage('expo-font', '~57.0.4'),\n imagePicker: definePackage('expo-image-picker', '~57.0.20'),\n linearGradient: definePackage('expo-linear-gradient', '~57.0.2'),\n linking: definePackage('expo-linking', '~57.0.12'),\n localization: definePackage('expo-localization', '~57.0.2'),\n location: definePackage('expo-location', '~57.0.20'),\n mediaLibrary: definePackage('expo-media-library', '~57.0.5'),\n notifications: definePackage('expo-notifications', '~57.0.22'),\n secureStore: definePackage('expo-secure-store', '~57.0.4'),\n splashScreen: definePackage('expo-splash-screen', '~57.0.9'),\n statusBar: definePackage('expo-status-bar', '~57.0.1'),\n updates: definePackage('expo-updates', '~57.0.25'),\n webBrowser: definePackage('expo-web-browser', '~57.0.3'),\n },\n platforms: {\n android: {\n minimumVersion: 7,\n minimumApiLevel: 24,\n compileSdk: 36,\n targetSdk: 36,\n edgeToEdge: true,\n },\n ios: {\n minimumVersion: '16.4',\n minimumXcodeVersion: '26.4',\n },\n },\n} as const;\n\nexport type ExpoPlatform = typeof EXPO_PLATFORM;\n"]}
@@ -0,0 +1,16 @@
1
+ import type { Capability } from '@ankhorage/contracts/capability';
2
+ export interface ExpoRuntimeCapabilityHandlerArgs {
3
+ readonly capability: Capability;
4
+ readonly input: unknown;
5
+ }
6
+ export interface ExpoRuntimeCapabilityHandler {
7
+ readonly capabilityId: Capability['id'];
8
+ readonly execute: (args: ExpoRuntimeCapabilityHandlerArgs) => Promise<void> | void;
9
+ }
10
+ export interface ExecuteExpoRuntimeCapabilityArgs {
11
+ readonly capability: unknown;
12
+ readonly input?: unknown;
13
+ readonly capabilityHandlers?: readonly ExpoRuntimeCapabilityHandler[];
14
+ readonly alertImpl?: (message: string) => void;
15
+ }
16
+ //# sourceMappingURL=expoRuntimeCapability.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"expoRuntimeCapability.d.ts","sourceRoot":"","sources":["../../src/types/expoRuntimeCapability.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,iCAAiC,CAAC;AAElE,MAAM,WAAW,gCAAgC;IAC/C,QAAQ,CAAC,UAAU,EAAE,UAAU,CAAC;IAChC,QAAQ,CAAC,KAAK,EAAE,OAAO,CAAC;CACzB;AAED,MAAM,WAAW,4BAA4B;IAC3C,QAAQ,CAAC,YAAY,EAAE,UAAU,CAAC,IAAI,CAAC,CAAC;IACxC,QAAQ,CAAC,OAAO,EAAE,CAAC,IAAI,EAAE,gCAAgC,KAAK,OAAO,CAAC,IAAI,CAAC,GAAG,IAAI,CAAC;CACpF;AAED,MAAM,WAAW,gCAAgC;IAC/C,QAAQ,CAAC,UAAU,EAAE,OAAO,CAAC;IAC7B,QAAQ,CAAC,KAAK,CAAC,EAAE,OAAO,CAAC;IACzB,QAAQ,CAAC,kBAAkB,CAAC,EAAE,SAAS,4BAA4B,EAAE,CAAC;IACtE,QAAQ,CAAC,SAAS,CAAC,EAAE,CAAC,OAAO,EAAE,MAAM,KAAK,IAAI,CAAC;CAChD"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=expoRuntimeCapability.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"expoRuntimeCapability.js","sourceRoot":"","sources":["../../src/types/expoRuntimeCapability.ts"],"names":[],"mappings":"","sourcesContent":["import type { Capability } from '@ankhorage/contracts/capability';\n\nexport interface ExpoRuntimeCapabilityHandlerArgs {\n readonly capability: Capability;\n readonly input: unknown;\n}\n\nexport interface ExpoRuntimeCapabilityHandler {\n readonly capabilityId: Capability['id'];\n readonly execute: (args: ExpoRuntimeCapabilityHandlerArgs) => Promise<void> | void;\n}\n\nexport interface ExecuteExpoRuntimeCapabilityArgs {\n readonly capability: unknown;\n readonly input?: unknown;\n readonly capabilityHandlers?: readonly ExpoRuntimeCapabilityHandler[];\n readonly alertImpl?: (message: string) => void;\n}\n"]}
@@ -0,0 +1,5 @@
1
+ export interface ExpoRuntimeRouteResolution {
2
+ readonly resolvedPath: string;
3
+ readonly unusedParams: Record<string, number | string>;
4
+ }
5
+ //# sourceMappingURL=expoRuntimeRoute.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"expoRuntimeRoute.d.ts","sourceRoot":"","sources":["../../src/types/expoRuntimeRoute.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,0BAA0B;IACzC,QAAQ,CAAC,YAAY,EAAE,MAAM,CAAC;IAC9B,QAAQ,CAAC,YAAY,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,CAAC,CAAC;CACxD"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=expoRuntimeRoute.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"expoRuntimeRoute.js","sourceRoot":"","sources":["../../src/types/expoRuntimeRoute.ts"],"names":[],"mappings":"","sourcesContent":["export interface ExpoRuntimeRouteResolution {\n readonly resolvedPath: string;\n readonly unusedParams: Record<string, number | string>;\n}\n"]}
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@ankhorage/expo-runtime",
3
3
  "type": "module",
4
- "version": "4.0.49",
4
+ "version": "6.0.1",
5
5
  "description": "Declarative runtime integration for Expo apps: maps app capabilities to permissions, packages, config plugins, providers, and adapters",
6
6
  "homepage": "https://github.com/ankhorage/expo-runtime#readme",
7
7
  "bugs": {
@@ -26,7 +26,8 @@
26
26
  "runtime"
27
27
  ],
28
28
  "dependencies": {
29
- "@ankhorage/contracts": "^22.8.96"
29
+ "@ankhorage/capability": "^0.2.1",
30
+ "@ankhorage/contracts": "^25.0.0"
30
31
  },
31
32
  "files": [
32
33
  "dist",
@@ -44,12 +45,19 @@
44
45
  "import": "./dist/index.js",
45
46
  "default": "./dist/index.js"
46
47
  },
47
- "./action-bridge": {
48
- "react-native": "./src/actionBridge.ts",
49
- "browser": "./src/actionBridge.ts",
50
- "types": "./src/actionBridge.ts",
51
- "import": "./dist/actionBridge.js",
52
- "default": "./dist/actionBridge.js"
48
+ "./capabilities": {
49
+ "react-native": "./src/capabilities/index.ts",
50
+ "browser": "./src/capabilities/index.ts",
51
+ "types": "./src/capabilities/index.ts",
52
+ "import": "./dist/capabilities/index.js",
53
+ "default": "./dist/capabilities/index.js"
54
+ },
55
+ "./capability-bridge": {
56
+ "react-native": "./src/capabilityBridge.ts",
57
+ "browser": "./src/capabilityBridge.ts",
58
+ "types": "./src/capabilityBridge.ts",
59
+ "import": "./dist/capabilityBridge.js",
60
+ "default": "./dist/capabilityBridge.js"
53
61
  },
54
62
  "./planning": {
55
63
  "react-native": "./src/planning.ts",
@@ -69,7 +77,6 @@
69
77
  "browser": "./src/ExpoZoraIconFontProvider.web.tsx",
70
78
  "react-native": "./src/ExpoZoraIconFontProvider.tsx",
71
79
  "types": "./src/ExpoZoraIconFontProvider.tsx",
72
- "node": "./src/ExpoZoraIconFontProvider.web.tsx",
73
80
  "import": "./dist/ExpoZoraIconFontProvider.js",
74
81
  "default": "./dist/ExpoZoraIconFontProvider.js"
75
82
  },
@@ -114,18 +121,46 @@
114
121
  "types": "./src/barcodeScanner.ts",
115
122
  "import": "./dist/barcodeScanner.js",
116
123
  "default": "./dist/barcodeScanner.js"
117
- },
118
- "./reader": {
119
- "react-native": "./src/reader/index.ts",
120
- "browser": "./src/reader/index.ts",
121
- "types": "./src/reader/index.ts",
122
- "import": "./dist/reader/index.js",
123
- "default": "./dist/reader/index.js"
124
124
  }
125
125
  },
126
126
  "publishConfig": {
127
127
  "access": "public"
128
128
  },
129
+ "ankh": {
130
+ "category": "runtime",
131
+ "provider": null,
132
+ "capabilities": [
133
+ {
134
+ "id": "expo.alert",
135
+ "owner": "@ankhorage/expo-runtime",
136
+ "access": [
137
+ "invoke"
138
+ ],
139
+ "binding": {
140
+ "kind": "action",
141
+ "bindableAs": [
142
+ "target"
143
+ ]
144
+ },
145
+ "label": "Show an Expo alert",
146
+ "description": "Display a platform alert through the Expo runtime.",
147
+ "input": {
148
+ "schema": {
149
+ "type": "object",
150
+ "required": [
151
+ "message"
152
+ ],
153
+ "properties": {
154
+ "message": {
155
+ "type": "string"
156
+ }
157
+ },
158
+ "additionalProperties": false
159
+ }
160
+ }
161
+ }
162
+ ]
163
+ },
129
164
  "scripts": {
130
165
  "build": "rm -rf dist tsconfig.tsbuildinfo && bun x tsc -p tsconfig.json",
131
166
  "changeset": "ankhorage-changeset",
@@ -143,29 +178,24 @@
143
178
  "validate:expo-platform": "bun scripts/validateExpoPlatform.ts",
144
179
  "validate:headless-platform": "bun scripts/headlessPlatformAcceptance.ts",
145
180
  "validate:packed-runtime": "bun scripts/packedRuntimeAcceptance.ts",
146
- "validate:reader-dom": "bun scripts/readerDomAcceptance.ts",
147
181
  "validate:web-barcode": "bun scripts/webBarcodeAcceptance.ts",
148
182
  "version-packages": "ankhorage-changeset version"
149
183
  },
150
184
  "peerDependencies": {
151
185
  "@ankhorage/permissions": "^0.2.63",
152
- "@ankhorage/zora": "^22.0.74",
153
- "@readium/navigator": "2.11.1",
154
- "@readium/shared": "2.6.0",
186
+ "@ankhorage/zora": "^24.0.0",
155
187
  "@react-native-vector-icons/fontawesome": "^13.1.4",
156
188
  "@react-native-vector-icons/fontawesome5": "^13.1.4",
157
189
  "@react-native-vector-icons/fontawesome6": "^13.1.4",
158
190
  "@react-native-vector-icons/ionicons": "^13.1.4",
159
191
  "@react-native-vector-icons/material-design-icons": "^13.1.4",
160
- "@zip.js/zip.js": "2.23.0",
161
- "expo": "57.0.26",
192
+ "expo": "57.0.27",
162
193
  "expo-camera": "~57.0.6",
163
- "expo-constants": "~57.0.20",
194
+ "expo-constants": "~57.0.21",
164
195
  "expo-document-picker": "~57.0.3",
165
196
  "expo-file-system": "~57.0.7",
166
197
  "expo-font": "~57.0.4",
167
198
  "expo-image-picker": "~57.0.20",
168
- "pdfjs-dist": "6.3.289",
169
199
  "react": "19.2.3",
170
200
  "react-native": "0.86.3"
171
201
  },
@@ -176,12 +206,6 @@
176
206
  "@ankhorage/zora": {
177
207
  "optional": true
178
208
  },
179
- "@readium/navigator": {
180
- "optional": true
181
- },
182
- "@readium/shared": {
183
- "optional": true
184
- },
185
209
  "@react-native-vector-icons/fontawesome": {
186
210
  "optional": true
187
211
  },
@@ -197,9 +221,6 @@
197
221
  "@react-native-vector-icons/material-design-icons": {
198
222
  "optional": true
199
223
  },
200
- "@zip.js/zip.js": {
201
- "optional": true
202
- },
203
224
  "expo": {
204
225
  "optional": true
205
226
  },
@@ -221,9 +242,6 @@
221
242
  "expo-image-picker": {
222
243
  "optional": true
223
244
  },
224
- "pdfjs-dist": {
225
- "optional": true
226
- },
227
245
  "react": {
228
246
  "optional": true
229
247
  },
@@ -232,33 +250,28 @@
232
250
  }
233
251
  },
234
252
  "devDependencies": {
235
- "@ankhorage/devtools": "^2.1.2",
253
+ "@ankhorage/devtools": "^2.3.13",
236
254
  "@ankhorage/paradox": "^0.2.27",
237
255
  "@ankhorage/permissions": "^0.2.63",
238
- "@ankhorage/zora": "^22.0.74",
256
+ "@ankhorage/zora": "^24.0.0",
239
257
  "@react-native-vector-icons/fontawesome": "^13.1.4",
240
258
  "@react-native-vector-icons/fontawesome5": "^13.1.4",
241
259
  "@react-native-vector-icons/fontawesome6": "^13.1.4",
242
260
  "@react-native-vector-icons/ionicons": "^13.1.4",
243
261
  "@react-native-vector-icons/material-design-icons": "^13.1.4",
244
- "@readium/navigator": "2.11.1",
245
- "@readium/shared": "2.6.0",
246
262
  "@types/bun": "^1.4.2",
247
263
  "@types/node": "^24.19.1",
248
264
  "@types/pngjs": "^6.0.5",
249
265
  "@types/react": "~19.2.18",
250
- "@xmldom/xmldom": "0.9.12",
251
- "@zip.js/zip.js": "2.23.0",
252
266
  "bwip-js": "^4.11.4",
253
- "expo": "57.0.26",
267
+ "expo": "57.0.27",
254
268
  "expo-camera": "~57.0.6",
255
- "expo-constants": "~57.0.20",
269
+ "expo-constants": "~57.0.21",
256
270
  "expo-document-picker": "~57.0.3",
257
271
  "expo-file-system": "~57.0.7",
258
272
  "expo-font": "~57.0.4",
259
273
  "expo-image-picker": "~57.0.20",
260
- "pdfjs-dist": "6.3.289",
261
- "playwright-core": "^1.63.0",
274
+ "playwright-core": "^1.64.0",
262
275
  "pngjs": "^7.0.0",
263
276
  "react": "19.2.3",
264
277
  "react-dom": "19.2.3",
@@ -1,11 +1,13 @@
1
1
  import { describe, expect, it } from 'bun:test';
2
2
 
3
+ import { resolveExpoRuntimePlan } from './resolveExpoRuntimePlan';
4
+
3
5
  interface PackageJson {
4
6
  readonly exports: Readonly<Record<string, Readonly<Record<string, string>>>>;
5
7
  }
6
8
 
7
9
  describe('capability-scoped adapter entrypoints', () => {
8
- it('publishes focused provider, barcode scanner, and reader exports', async () => {
10
+ it('publishes focused provider and barcode scanner exports without a legacy reader alias', async () => {
9
11
  const packageJson = (await Bun.file(
10
12
  new URL('../package.json', import.meta.url),
11
13
  ).json()) as PackageJson;
@@ -20,11 +22,7 @@ describe('capability-scoped adapter entrypoints', () => {
20
22
  'react-native': './src/barcodeScanner.ts',
21
23
  types: './src/barcodeScanner.ts',
22
24
  });
23
- expect(packageJson.exports['./reader']).toMatchObject({
24
- import: './dist/reader/index.js',
25
- 'react-native': './src/reader/index.ts',
26
- types: './src/reader/index.ts',
27
- });
25
+ expect(packageJson.exports).not.toHaveProperty('./reader');
28
26
  });
29
27
 
30
28
  it('keeps document renderer ownership out of the providers entrypoint', async () => {
@@ -36,16 +34,27 @@ describe('capability-scoped adapter entrypoints', () => {
36
34
  expect(entrypoint).not.toContain('@zip.js/zip.js');
37
35
  expect(entrypoint).not.toContain('pdfjs-dist');
38
36
  });
37
+ });
39
38
 
40
- it('keeps camera ownership out of the reader entrypoint', async () => {
41
- const entrypoint = await Bun.file(new URL('./reader/index.ts', import.meta.url)).text();
42
- const adapter = await Bun.file(
43
- new URL('./reader/ExpoReaderSurfaceAdapter.tsx', import.meta.url),
44
- ).text();
39
+ describe('standalone reader capability isolation', () => {
40
+ it('plans standalone Reader without camera, permissions or a custom Expo adapter', () => {
41
+ const plan = resolveExpoRuntimePlan({
42
+ screens: {
43
+ library: {
44
+ requires: {
45
+ capabilities: { ebookReader: true },
46
+ },
47
+ },
48
+ },
49
+ });
45
50
 
46
- expect(entrypoint).toContain("from './ExpoReaderSurfaceAdapter'");
47
- expect(`${entrypoint}\n${adapter}`).not.toContain('expo-camera');
48
- expect(`${entrypoint}\n${adapter}`).not.toContain('@ankhorage/permissions');
51
+ expect(plan.dependencies.map(({ name }) => name)).toEqual(['@ankhorage/reader']);
52
+ expect(plan.permissions).toEqual([]);
53
+ expect(plan.impliedPermissions).toEqual([]);
54
+ expect(plan.providers).toEqual([]);
55
+ expect(plan.runtimeAdapters).toEqual([]);
56
+ expect(plan.usesExpoRuntimeRegistry).toBe(false);
57
+ expect(plan.nativeConfig.plugins).toEqual([]);
49
58
  });
50
59
 
51
60
  it('keeps document renderer ownership out of the scanner entrypoint', async () => {
@@ -0,0 +1,18 @@
1
+ import { isCapabilityCatalog } from '@ankhorage/capability';
2
+ import { describe, expect, test } from 'bun:test';
3
+
4
+ import packageJson from '../../package.json';
5
+ import { CAPABILITIES } from './index';
6
+
7
+ describe('Expo Runtime capability catalog', () => {
8
+ test('contains unique valid canonical descriptors', () => {
9
+ expect(isCapabilityCatalog(CAPABILITIES)).toBe(true);
10
+ expect(new Set(CAPABILITIES.map(({ id }) => id)).size).toBe(CAPABILITIES.length);
11
+ expect(CAPABILITIES.map(({ id }) => id)).toEqual(['expo.alert']);
12
+ });
13
+
14
+ test('matches the published package metadata catalog', () => {
15
+ expect(packageJson.ankh.provider).toBeNull();
16
+ expect(packageJson.ankh.capabilities).toEqual(CAPABILITIES);
17
+ });
18
+ });
@@ -0,0 +1,26 @@
1
+ import type { Capability } from '@ankhorage/contracts/capability';
2
+
3
+ /*** Publish the portable capabilities that Expo Runtime owns and executes. */
4
+ export const CAPABILITIES = [
5
+ {
6
+ id: 'expo.alert',
7
+ owner: '@ankhorage/expo-runtime',
8
+ access: ['invoke'],
9
+ binding: {
10
+ kind: 'action',
11
+ bindableAs: ['target'],
12
+ },
13
+ label: 'Show an Expo alert',
14
+ description: 'Display a platform alert through the Expo runtime.',
15
+ input: {
16
+ schema: {
17
+ type: 'object',
18
+ required: ['message'],
19
+ properties: {
20
+ message: { type: 'string' },
21
+ },
22
+ additionalProperties: false,
23
+ },
24
+ },
25
+ },
26
+ ] as const satisfies readonly Capability[];
@@ -0,0 +1,8 @@
1
+ export { executeExpoRuntimeCapabilityAsync } from './features/capabilities/executeExpoRuntimeCapabilityAsync';
2
+ export { resolveExpoRuntimeRoutePath } from './features/navigation/resolveExpoRuntimeRoutePath';
3
+ export type {
4
+ ExecuteExpoRuntimeCapabilityArgs,
5
+ ExpoRuntimeCapabilityHandler,
6
+ ExpoRuntimeCapabilityHandlerArgs,
7
+ } from './types/expoRuntimeCapability';
8
+ export type { ExpoRuntimeRouteResolution } from './types/expoRuntimeRoute';
@@ -4,8 +4,7 @@ import React from 'react';
4
4
  const BaseBarcodeScannerView = (): React.ReactElement => React.createElement(React.Fragment);
5
5
  const BaseText = (): React.ReactElement => React.createElement(React.Fragment);
6
6
  const MockExpoBarcodeScannerAdapter = (): React.ReactElement => React.createElement(React.Fragment);
7
- const BaseReaderSurface = (): React.ReactElement => React.createElement(React.Fragment);
8
- const MockExpoReaderSurfaceAdapter = (): React.ReactElement => React.createElement(React.Fragment);
7
+ const BaseReader = (): React.ReactElement => React.createElement(React.Fragment);
9
8
 
10
9
  describe('createExpoRuntimeRegistry', () => {
11
10
  afterEach(() => {
@@ -16,14 +15,11 @@ describe('createExpoRuntimeRegistry', () => {
16
15
  void mock.module('./ExpoBarcodeScannerAdapter', () => ({
17
16
  ExpoBarcodeScannerAdapter: MockExpoBarcodeScannerAdapter,
18
17
  }));
19
- void mock.module('./reader/ExpoReaderSurfaceAdapter', () => ({
20
- ExpoReaderSurfaceAdapter: MockExpoReaderSurfaceAdapter,
21
- }));
22
18
 
23
19
  const { createExpoRuntimeRegistry } = await import('./createExpoRuntimeRegistry');
24
20
  const baseRegistry = {
25
21
  BarcodeScannerView: BaseBarcodeScannerView,
26
- ReaderSurface: BaseReaderSurface,
22
+ Reader: BaseReader,
27
23
  Text: BaseText,
28
24
  };
29
25
 
@@ -33,7 +29,6 @@ describe('createExpoRuntimeRegistry', () => {
33
29
  expect(registry.Text).toBe(BaseText);
34
30
  expect(registry.BarcodeScannerView).not.toBe(BaseBarcodeScannerView);
35
31
  expect(typeof registry.BarcodeScannerView).toBe('function');
36
- expect(registry.ReaderSurface).not.toBe(BaseReaderSurface);
37
- expect(typeof registry.ReaderSurface).toBe('function');
32
+ expect(registry.Reader).toBe(BaseReader);
38
33
  });
39
34
  });
@@ -1,13 +1,11 @@
1
- import { type BarcodeScannerViewProps, type ReaderSurfaceProps } from '@ankhorage/zora';
1
+ import { type BarcodeScannerViewProps } from '@ankhorage/zora';
2
2
  import React from 'react';
3
3
 
4
4
  import { type ComponentRegistry, createComponentRegistry } from './componentRegistry';
5
5
  import { ExpoBarcodeScannerAdapter } from './ExpoBarcodeScannerAdapter';
6
- import { ExpoReaderSurfaceAdapter } from './reader/ExpoReaderSurfaceAdapter';
7
6
 
8
7
  const EXPO_RUNTIME_OVERRIDES: ComponentRegistry = {
9
8
  BarcodeScannerView: ExpoBarcodeScannerView,
10
- ReaderSurface: ExpoReaderSurface,
11
9
  };
12
10
 
13
11
  export function createExpoRuntimeRegistry(baseRegistry: ComponentRegistry): ComponentRegistry {
@@ -17,7 +15,3 @@ export function createExpoRuntimeRegistry(baseRegistry: ComponentRegistry): Comp
17
15
  function ExpoBarcodeScannerView(props: BarcodeScannerViewProps) {
18
16
  return <ExpoBarcodeScannerAdapter {...props} />;
19
17
  }
20
-
21
- function ExpoReaderSurface(props: ReaderSurfaceProps) {
22
- return <ExpoReaderSurfaceAdapter {...props} />;
23
- }
@@ -0,0 +1,60 @@
1
+ import type { Capability } from '@ankhorage/contracts/capability';
2
+ import { describe, expect, test } from 'bun:test';
3
+
4
+ import { CAPABILITIES } from './capabilities';
5
+ import { executeExpoRuntimeCapabilityAsync, resolveExpoRuntimeRoutePath } from './capabilityBridge';
6
+
7
+ describe('expoCapabilityBridge', () => {
8
+ test('resolves dynamic route params and keeps unused params', () => {
9
+ expect(resolveExpoRuntimeRoutePath('/users/[id]', { id: 42, tab: 'profile' })).toEqual({
10
+ resolvedPath: '/users/42',
11
+ unusedParams: { tab: 'profile' },
12
+ });
13
+ });
14
+
15
+ test('executes the canonical Expo alert capability', async () => {
16
+ const messages: string[] = [];
17
+
18
+ const expoAlertCapability = findCapabilityById('expo.alert');
19
+
20
+ await executeExpoRuntimeCapabilityAsync({
21
+ capability: expoAlertCapability,
22
+ input: { message: 'Saved' },
23
+ alertImpl: (message) => messages.push(message),
24
+ });
25
+
26
+ expect(messages).toEqual(['Saved']);
27
+ });
28
+
29
+ test('delegates foreign canonical capabilities to their configured runtime handler', async () => {
30
+ const calls: string[] = [];
31
+ const capability = {
32
+ id: 'navigator.navigate',
33
+ owner: '@ankhorage/navigator',
34
+ access: ['invoke'],
35
+ binding: { kind: 'action', bindableAs: ['target'] },
36
+ } as const;
37
+
38
+ await executeExpoRuntimeCapabilityAsync({
39
+ capability,
40
+ input: { route: 'users/[id]', params: { id: 42 } },
41
+ capabilityHandlers: [
42
+ {
43
+ capabilityId: 'navigator.navigate',
44
+ execute: ({ capability: handled }) => calls.push(handled.id),
45
+ },
46
+ ],
47
+ });
48
+
49
+ expect(calls).toEqual(['navigator.navigate']);
50
+ });
51
+ });
52
+
53
+ function findCapabilityById(capabilityId: string): Capability {
54
+ const capabilityCatalog: readonly Capability[] = CAPABILITIES;
55
+ const capability = capabilityCatalog.find((candidate) => candidate.id === capabilityId);
56
+ if (!capability) {
57
+ throw new Error(`Missing capability '${capabilityId}'.`);
58
+ }
59
+ return capability;
60
+ }
@@ -13,7 +13,7 @@ export interface ExpoRuntimeConfigPlugin {
13
13
  }
14
14
 
15
15
  export type ExpoRuntimeProviderId = 'permissions';
16
- export type ExpoRuntimeAdapterId = 'ExpoBarcodeScannerAdapter' | 'ExpoReaderSurfaceAdapter';
16
+ export type ExpoRuntimeAdapterId = 'ExpoBarcodeScannerAdapter';
17
17
 
18
18
  export interface ExpoRuntimeDiagnostic {
19
19
  readonly severity: 'error' | 'warning';
@@ -40,10 +40,7 @@ export interface ExpoRuntimeHintMetadata {
40
40
  const GENERATED_ANKHORAGE_DEPENDENCY_VERSIONS = {
41
41
  '@ankhorage/permissions': '^0.2.5',
42
42
  '@ankhorage/expo-runtime': '^3.0.0',
43
- '@readium/navigator': '2.8.2',
44
- '@readium/shared': '2.4.0',
45
- '@zip.js/zip.js': '2.9.0',
46
- 'pdfjs-dist': '6.3.289',
43
+ '@ankhorage/reader': '^0.1.0',
47
44
  } as const satisfies Record<string, string>;
48
45
 
49
46
  const GENERATED_EXPO_DEPENDENCY_VERSIONS = Object.fromEntries(
@@ -153,8 +150,7 @@ export const EXPO_CAPABILITY_RUNTIME_REGISTRY = {
153
150
  ],
154
151
  },
155
152
  ebookReader: {
156
- requiredPackages: ['@readium/navigator', '@readium/shared', '@zip.js/zip.js', 'pdfjs-dist'],
157
- runtimeAdapters: ['ExpoReaderSurfaceAdapter'],
153
+ requiredPackages: ['@ankhorage/reader'],
158
154
  },
159
155
  } as const satisfies Readonly<
160
156
  Partial<Record<AnkhorageCapabilityName, ExpoRuntimeCapabilityMetadata>>
@@ -0,0 +1,50 @@
1
+ import { isCapability } from '@ankhorage/capability';
2
+ import type { Capability } from '@ankhorage/contracts/capability';
3
+
4
+ import type {
5
+ ExecuteExpoRuntimeCapabilityArgs,
6
+ ExpoRuntimeCapabilityHandler,
7
+ ExpoRuntimeCapabilityHandlerArgs,
8
+ } from '../../types/expoRuntimeCapability';
9
+
10
+ /*** Execute an Expo-owned capability or delegate another canonical capability to its runtime handler. */
11
+ export async function executeExpoRuntimeCapabilityAsync(
12
+ args: ExecuteExpoRuntimeCapabilityArgs,
13
+ ): Promise<void> {
14
+ const { capability, input, capabilityHandlers, alertImpl } = args;
15
+ if (!isCapability(capability)) return;
16
+
17
+ if (capability.id === 'expo.alert') {
18
+ executeExpoAlert(input, alertImpl);
19
+ return;
20
+ }
21
+
22
+ await findCapabilityHandler(capabilityHandlers, capability.id)?.({ capability, input });
23
+ }
24
+
25
+ /*** Find the configured executor for one canonical capability without dynamic record access. */
26
+ function findCapabilityHandler(
27
+ capabilityHandlers: readonly ExpoRuntimeCapabilityHandler[] | undefined,
28
+ capabilityId: Capability['id'],
29
+ ): ((args: ExpoRuntimeCapabilityHandlerArgs) => Promise<void> | void) | undefined {
30
+ return capabilityHandlers?.find((handler) => handler.capabilityId === capabilityId)?.execute;
31
+ }
32
+
33
+ /*** Display a valid Expo-owned alert invocation without exposing alert as a generic action. */
34
+ function executeExpoAlert(
35
+ input: unknown,
36
+ alertImpl: ((message: string) => void) | undefined,
37
+ ): void {
38
+ if (!isExpoAlertInput(input)) return;
39
+ alertImpl?.(input.message);
40
+ }
41
+
42
+ /*** Validate the serializable input accepted by the Expo alert capability. */
43
+ function isExpoAlertInput(input: unknown): input is { readonly message: string } {
44
+ return (
45
+ typeof input === 'object' &&
46
+ input !== null &&
47
+ 'message' in input &&
48
+ typeof input.message === 'string'
49
+ );
50
+ }
@@ -0,0 +1,31 @@
1
+ import type { ExpoRuntimeRouteResolution } from '../../types/expoRuntimeRoute';
2
+
3
+ /*** Resolve Expo Router path parameters before passing the remaining values to the router. */
4
+ export function resolveExpoRuntimeRoutePath(
5
+ pathname: string,
6
+ params?: Record<string, number | string>,
7
+ ): ExpoRuntimeRouteResolution {
8
+ if (!params) return { resolvedPath: pathname, unusedParams: {} };
9
+
10
+ return Object.entries(params).reduce(
11
+ (current, [key, value]) => resolveRouteParameter(current, key, value),
12
+ { resolvedPath: pathname, unusedParams: { ...params } },
13
+ );
14
+ }
15
+
16
+ /*** Replace one dynamic route placeholder and retain values that belong in the navigation query. */
17
+ function resolveRouteParameter(
18
+ state: ExpoRuntimeRouteResolution,
19
+ key: string,
20
+ value: number | string,
21
+ ): ExpoRuntimeRouteResolution {
22
+ const placeholder = `[${key}]`;
23
+ if (!state.resolvedPath.includes(placeholder)) return state;
24
+
25
+ return {
26
+ resolvedPath: state.resolvedPath.replace(placeholder, String(value)),
27
+ unusedParams: Object.fromEntries(
28
+ Object.entries(state.unusedParams).filter(([parameter]) => parameter !== key),
29
+ ),
30
+ };
31
+ }