@ankhorage/expo-runtime 3.0.6 → 3.0.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +12 -0
- package/README.md +2 -1
- package/dist/ExpoZoraIconFontProvider.d.ts +6 -0
- package/dist/ExpoZoraIconFontProvider.d.ts.map +1 -0
- package/dist/ExpoZoraIconFontProvider.js +5 -0
- package/dist/ExpoZoraIconFontProvider.js.map +1 -0
- package/dist/ExpoZoraIconFontProvider.web.d.ts +6 -0
- package/dist/ExpoZoraIconFontProvider.web.d.ts.map +1 -0
- package/dist/ExpoZoraIconFontProvider.web.js +31 -0
- package/dist/ExpoZoraIconFontProvider.web.js.map +1 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -0
- package/dist/index.js.map +1 -1
- package/package.json +30 -1
- package/src/ExpoZoraIconFontProvider.tsx +9 -0
- package/src/ExpoZoraIconFontProvider.web.test.tsx +56 -0
- package/src/ExpoZoraIconFontProvider.web.tsx +39 -0
- package/src/assets.d.ts +4 -0
- package/src/iconFonts.test.ts +18 -0
- package/src/index.ts +4 -0
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,17 @@
|
|
|
1
1
|
# @ankhorage/expo-runtime
|
|
2
2
|
|
|
3
|
+
## 3.0.8
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- cb70c0f: Expose the ZORA icon font boundary through a focused subpath so camera-free Expo apps do not load unrelated root runtime types.
|
|
8
|
+
|
|
9
|
+
## 3.0.7
|
|
10
|
+
|
|
11
|
+
### Patch Changes
|
|
12
|
+
|
|
13
|
+
- b115422: Add the shared Expo provider that loads every ZORA icon font face on Web before presenting an interactive app.
|
|
14
|
+
|
|
3
15
|
## 3.0.6
|
|
4
16
|
|
|
5
17
|
### Patch Changes
|
package/README.md
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
|
|
4
4
|
# EXPO-RUNTIME
|
|
5
5
|
|
|
6
|
-
         
|
|
7
7
|
|
|
8
8
|
Declarative runtime integration for Expo apps: maps app capabilities to permissions, packages, config plugins, providers, and adapters
|
|
9
9
|
|
|
@@ -18,6 +18,7 @@ Declarative runtime integration for Expo apps: maps app capabilities to permissi
|
|
|
18
18
|
- [createExpoRuntimeRegistry sequence](././paradox/diagrams/sequences/create-expo-runtime-registry.mmd)
|
|
19
19
|
- [executeExpoRuntimeAction sequence](././paradox/diagrams/sequences/execute-expo-runtime-action.mmd)
|
|
20
20
|
- [ExpoBarcodeScannerAdapter sequence](././paradox/diagrams/sequences/expo-barcode-scanner-adapter.mmd)
|
|
21
|
+
- [ExpoZoraIconFontProvider sequence](././paradox/diagrams/sequences/expo-zora-icon-font-provider.mmd)
|
|
21
22
|
- [getExpoBundledMediaRegistrySource sequence](././paradox/diagrams/sequences/get-expo-bundled-media-registry-source.mmd)
|
|
22
23
|
- [resolveExpoRuntimeGeneratedAppOutput sequence](././paradox/diagrams/sequences/resolve-expo-runtime-generated-app-output.mmd)
|
|
23
24
|
- [resolveExpoRuntimeNativeOutput sequence](././paradox/diagrams/sequences/resolve-expo-runtime-native-output.mmd)
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
export interface ExpoZoraIconFontProviderProps {
|
|
3
|
+
readonly children: React.ReactNode;
|
|
4
|
+
}
|
|
5
|
+
export declare function ExpoZoraIconFontProvider(props: ExpoZoraIconFontProviderProps): React.JSX.Element;
|
|
6
|
+
//# sourceMappingURL=ExpoZoraIconFontProvider.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ExpoZoraIconFontProvider.d.ts","sourceRoot":"","sources":["../src/ExpoZoraIconFontProvider.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,MAAM,WAAW,6BAA6B;IAC5C,QAAQ,CAAC,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;CACpC;AAED,wBAAgB,wBAAwB,CAAC,KAAK,EAAE,6BAA6B,qBAE5E"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ExpoZoraIconFontProvider.js","sourceRoot":"","sources":["../src/ExpoZoraIconFontProvider.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAM1B,MAAM,UAAU,wBAAwB,CAAC,KAAoC;IAC3E,OAAO,EAAE,CAAC,KAAK,CAAC,QAAQ,CAAC,GAAG,CAAC;AAC/B,CAAC","sourcesContent":["import React from 'react';\n\nexport interface ExpoZoraIconFontProviderProps {\n readonly children: React.ReactNode;\n}\n\nexport function ExpoZoraIconFontProvider(props: ExpoZoraIconFontProviderProps) {\n return <>{props.children}</>;\n}\n"]}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
export interface ExpoZoraIconFontProviderProps {
|
|
3
|
+
readonly children: React.ReactNode;
|
|
4
|
+
}
|
|
5
|
+
export declare function ExpoZoraIconFontProvider(props: ExpoZoraIconFontProviderProps): React.JSX.Element | null;
|
|
6
|
+
//# sourceMappingURL=ExpoZoraIconFontProvider.web.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ExpoZoraIconFontProvider.web.d.ts","sourceRoot":"","sources":["../src/ExpoZoraIconFontProvider.web.tsx"],"names":[],"mappings":"AASA,OAAO,KAAK,MAAM,OAAO,CAAC;AAa1B,MAAM,WAAW,6BAA6B;IAC5C,QAAQ,CAAC,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;CACpC;AAED,wBAAgB,wBAAwB,CAAC,KAAK,EAAE,6BAA6B,4BAY5E"}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import fontAwesome from '@react-native-vector-icons/fontawesome/fonts/FontAwesome.ttf';
|
|
2
|
+
import fontAwesome5Brands from '@react-native-vector-icons/fontawesome5/fonts/FontAwesome5_Brands.ttf';
|
|
3
|
+
import fontAwesome5Regular from '@react-native-vector-icons/fontawesome5/fonts/FontAwesome5_Regular.ttf';
|
|
4
|
+
import fontAwesome5Solid from '@react-native-vector-icons/fontawesome5/fonts/FontAwesome5_Solid.ttf';
|
|
5
|
+
import fontAwesome6Brands from '@react-native-vector-icons/fontawesome6/fonts/FontAwesome6_Brands.ttf';
|
|
6
|
+
import fontAwesome6Regular from '@react-native-vector-icons/fontawesome6/fonts/FontAwesome6_Regular.ttf';
|
|
7
|
+
import fontAwesome6Solid from '@react-native-vector-icons/fontawesome6/fonts/FontAwesome6_Solid.ttf';
|
|
8
|
+
import ionicons from '@react-native-vector-icons/ionicons/fonts/Ionicons.ttf';
|
|
9
|
+
import { useFonts } from 'expo-font';
|
|
10
|
+
import React from 'react';
|
|
11
|
+
const ZORA_ICON_FONTS = {
|
|
12
|
+
FontAwesome: fontAwesome,
|
|
13
|
+
'FontAwesome5Brands-Regular': fontAwesome5Brands,
|
|
14
|
+
'FontAwesome5Free-Regular': fontAwesome5Regular,
|
|
15
|
+
'FontAwesome5Free-Solid': fontAwesome5Solid,
|
|
16
|
+
'FontAwesome6Brands-Regular': fontAwesome6Brands,
|
|
17
|
+
'FontAwesome6Free-Regular': fontAwesome6Regular,
|
|
18
|
+
'FontAwesome6Free-Solid': fontAwesome6Solid,
|
|
19
|
+
Ionicons: ionicons,
|
|
20
|
+
};
|
|
21
|
+
export function ExpoZoraIconFontProvider(props) {
|
|
22
|
+
const [loaded, error] = useFonts(ZORA_ICON_FONTS);
|
|
23
|
+
if (error) {
|
|
24
|
+
throw error;
|
|
25
|
+
}
|
|
26
|
+
if (!loaded) {
|
|
27
|
+
return null;
|
|
28
|
+
}
|
|
29
|
+
return <>{props.children}</>;
|
|
30
|
+
}
|
|
31
|
+
//# sourceMappingURL=ExpoZoraIconFontProvider.web.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ExpoZoraIconFontProvider.web.js","sourceRoot":"","sources":["../src/ExpoZoraIconFontProvider.web.tsx"],"names":[],"mappings":"AAAA,OAAO,WAAW,MAAM,8DAA8D,CAAC;AACvF,OAAO,kBAAkB,MAAM,uEAAuE,CAAC;AACvG,OAAO,mBAAmB,MAAM,wEAAwE,CAAC;AACzG,OAAO,iBAAiB,MAAM,sEAAsE,CAAC;AACrG,OAAO,kBAAkB,MAAM,uEAAuE,CAAC;AACvG,OAAO,mBAAmB,MAAM,wEAAwE,CAAC;AACzG,OAAO,iBAAiB,MAAM,sEAAsE,CAAC;AACrG,OAAO,QAAQ,MAAM,wDAAwD,CAAC;AAC9E,OAAO,EAAE,QAAQ,EAAE,MAAM,WAAW,CAAC;AACrC,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,MAAM,eAAe,GAAG;IACtB,WAAW,EAAE,WAAW;IACxB,4BAA4B,EAAE,kBAAkB;IAChD,0BAA0B,EAAE,mBAAmB;IAC/C,wBAAwB,EAAE,iBAAiB;IAC3C,4BAA4B,EAAE,kBAAkB;IAChD,0BAA0B,EAAE,mBAAmB;IAC/C,wBAAwB,EAAE,iBAAiB;IAC3C,QAAQ,EAAE,QAAQ;CACV,CAAC;AAMX,MAAM,UAAU,wBAAwB,CAAC,KAAoC;IAC3E,MAAM,CAAC,MAAM,EAAE,KAAK,CAAC,GAAG,QAAQ,CAAC,eAAe,CAAC,CAAC;IAElD,IAAI,KAAK,EAAE,CAAC;QACV,MAAM,KAAK,CAAC;IACd,CAAC;IAED,IAAI,CAAC,MAAM,EAAE,CAAC;QACZ,OAAO,IAAI,CAAC;IACd,CAAC;IAED,OAAO,EAAE,CAAC,KAAK,CAAC,QAAQ,CAAC,GAAG,CAAC;AAC/B,CAAC","sourcesContent":["import fontAwesome from '@react-native-vector-icons/fontawesome/fonts/FontAwesome.ttf';\nimport fontAwesome5Brands from '@react-native-vector-icons/fontawesome5/fonts/FontAwesome5_Brands.ttf';\nimport fontAwesome5Regular from '@react-native-vector-icons/fontawesome5/fonts/FontAwesome5_Regular.ttf';\nimport fontAwesome5Solid from '@react-native-vector-icons/fontawesome5/fonts/FontAwesome5_Solid.ttf';\nimport fontAwesome6Brands from '@react-native-vector-icons/fontawesome6/fonts/FontAwesome6_Brands.ttf';\nimport fontAwesome6Regular from '@react-native-vector-icons/fontawesome6/fonts/FontAwesome6_Regular.ttf';\nimport fontAwesome6Solid from '@react-native-vector-icons/fontawesome6/fonts/FontAwesome6_Solid.ttf';\nimport ionicons from '@react-native-vector-icons/ionicons/fonts/Ionicons.ttf';\nimport { useFonts } from 'expo-font';\nimport React from 'react';\n\nconst ZORA_ICON_FONTS = {\n FontAwesome: fontAwesome,\n 'FontAwesome5Brands-Regular': fontAwesome5Brands,\n 'FontAwesome5Free-Regular': fontAwesome5Regular,\n 'FontAwesome5Free-Solid': fontAwesome5Solid,\n 'FontAwesome6Brands-Regular': fontAwesome6Brands,\n 'FontAwesome6Free-Regular': fontAwesome6Regular,\n 'FontAwesome6Free-Solid': fontAwesome6Solid,\n Ionicons: ionicons,\n} as const;\n\nexport interface ExpoZoraIconFontProviderProps {\n readonly children: React.ReactNode;\n}\n\nexport function ExpoZoraIconFontProvider(props: ExpoZoraIconFontProviderProps) {\n const [loaded, error] = useFonts(ZORA_ICON_FONTS);\n\n if (error) {\n throw error;\n }\n\n if (!loaded) {\n return null;\n }\n\n return <>{props.children}</>;\n}\n"]}
|
package/dist/index.d.ts
CHANGED
|
@@ -7,6 +7,7 @@ export { createExpoRuntimeRegistry } from './createExpoRuntimeRegistry';
|
|
|
7
7
|
export { executeExpoRuntimeAction, type ExecuteExpoRuntimeActionArgs, type ExpoRuntimeActionHandlerArgs, type ExpoRuntimeActionHandlers, type ExpoRuntimeRouteResolution, type ExpoRuntimeRouterLike, type ExpoRuntimeThemeMode, resolveExpoRuntimeRoutePath, } from './expoActionBridge';
|
|
8
8
|
export { ExpoBarcodeScannerAdapter } from './ExpoBarcodeScannerAdapter';
|
|
9
9
|
export { ExpoRuntimeProviders, type ExpoRuntimeProvidersProps } from './ExpoRuntimeProviders';
|
|
10
|
+
export { ExpoZoraIconFontProvider, type ExpoZoraIconFontProviderProps, } from './ExpoZoraIconFontProvider';
|
|
10
11
|
export { type ExpoRuntimeConfigPluginOutput, type ExpoRuntimeDependencyMap, type ExpoRuntimeGeneratedAppOutputPlan, type ExpoRuntimeNativeOutputPlan, resolveExpoRuntimeConfigPluginOutput, resolveExpoRuntimeDependencyMap, resolveExpoRuntimeGeneratedAppOutput, resolveExpoRuntimeNativeOutput, } from './generatedAppOutput';
|
|
11
12
|
export { getExpoBarcodeScannerViewSource } from './generatedSources';
|
|
12
13
|
export { type ExpoRuntimeLayoutIntegrationPlan, resolveExpoRuntimeLayoutIntegration, } from './layoutIntegrationPlanning';
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,6BAA6B,EAC7B,qBAAqB,EACrB,KAAK,iBAAiB,EACtB,KAAK,yBAAyB,EAC9B,2CAA2C,EAC3C,8BAA8B,EAC9B,uBAAuB,GACxB,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EACL,KAAK,mCAAmC,EACxC,iCAAiC,GAClC,MAAM,8BAA8B,CAAC;AACtC,OAAO,EACL,8BAA8B,EAC9B,KAAK,wBAAwB,EAC7B,KAAK,wBAAwB,EAC7B,KAAK,4BAA4B,EACjC,KAAK,qBAAqB,EAC1B,4BAA4B,GAC7B,MAAM,wBAAwB,CAAC;AAChC,YAAY,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AAC7D,OAAO,EAAE,uBAAuB,EAAE,MAAM,qBAAqB,CAAC;AAC9D,OAAO,EAAE,yBAAyB,EAAE,MAAM,6BAA6B,CAAC;AACxE,OAAO,EACL,wBAAwB,EACxB,KAAK,4BAA4B,EACjC,KAAK,4BAA4B,EACjC,KAAK,yBAAyB,EAC9B,KAAK,0BAA0B,EAC/B,KAAK,qBAAqB,EAC1B,KAAK,oBAAoB,EACzB,2BAA2B,GAC5B,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EAAE,yBAAyB,EAAE,MAAM,6BAA6B,CAAC;AACxE,OAAO,EAAE,oBAAoB,EAAE,KAAK,yBAAyB,EAAE,MAAM,wBAAwB,CAAC;AAC9F,OAAO,EACL,KAAK,6BAA6B,EAClC,KAAK,wBAAwB,EAC7B,KAAK,iCAAiC,EACtC,KAAK,2BAA2B,EAChC,oCAAoC,EACpC,+BAA+B,EAC/B,oCAAoC,EACpC,8BAA8B,GAC/B,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EAAE,+BAA+B,EAAE,MAAM,oBAAoB,CAAC;AACrE,OAAO,EACL,KAAK,gCAAgC,EACrC,mCAAmC,GACpC,MAAM,6BAA6B,CAAC;AACrC,YAAY,EACV,oBAAoB,EACpB,eAAe,EACf,qBAAqB,GACtB,MAAM,0BAA0B,CAAC;AAClC,OAAO,EAAE,sBAAsB,EAAE,MAAM,0BAA0B,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,6BAA6B,EAC7B,qBAAqB,EACrB,KAAK,iBAAiB,EACtB,KAAK,yBAAyB,EAC9B,2CAA2C,EAC3C,8BAA8B,EAC9B,uBAAuB,GACxB,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EACL,KAAK,mCAAmC,EACxC,iCAAiC,GAClC,MAAM,8BAA8B,CAAC;AACtC,OAAO,EACL,8BAA8B,EAC9B,KAAK,wBAAwB,EAC7B,KAAK,wBAAwB,EAC7B,KAAK,4BAA4B,EACjC,KAAK,qBAAqB,EAC1B,4BAA4B,GAC7B,MAAM,wBAAwB,CAAC;AAChC,YAAY,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AAC7D,OAAO,EAAE,uBAAuB,EAAE,MAAM,qBAAqB,CAAC;AAC9D,OAAO,EAAE,yBAAyB,EAAE,MAAM,6BAA6B,CAAC;AACxE,OAAO,EACL,wBAAwB,EACxB,KAAK,4BAA4B,EACjC,KAAK,4BAA4B,EACjC,KAAK,yBAAyB,EAC9B,KAAK,0BAA0B,EAC/B,KAAK,qBAAqB,EAC1B,KAAK,oBAAoB,EACzB,2BAA2B,GAC5B,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EAAE,yBAAyB,EAAE,MAAM,6BAA6B,CAAC;AACxE,OAAO,EAAE,oBAAoB,EAAE,KAAK,yBAAyB,EAAE,MAAM,wBAAwB,CAAC;AAC9F,OAAO,EACL,wBAAwB,EACxB,KAAK,6BAA6B,GACnC,MAAM,4BAA4B,CAAC;AACpC,OAAO,EACL,KAAK,6BAA6B,EAClC,KAAK,wBAAwB,EAC7B,KAAK,iCAAiC,EACtC,KAAK,2BAA2B,EAChC,oCAAoC,EACpC,+BAA+B,EAC/B,oCAAoC,EACpC,8BAA8B,GAC/B,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EAAE,+BAA+B,EAAE,MAAM,oBAAoB,CAAC;AACrE,OAAO,EACL,KAAK,gCAAgC,EACrC,mCAAmC,GACpC,MAAM,6BAA6B,CAAC;AACrC,YAAY,EACV,oBAAoB,EACpB,eAAe,EACf,qBAAqB,GACtB,MAAM,0BAA0B,CAAC;AAClC,OAAO,EAAE,sBAAsB,EAAE,MAAM,0BAA0B,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -6,6 +6,7 @@ export { createExpoRuntimeRegistry } from './createExpoRuntimeRegistry';
|
|
|
6
6
|
export { executeExpoRuntimeAction, resolveExpoRuntimeRoutePath, } from './expoActionBridge';
|
|
7
7
|
export { ExpoBarcodeScannerAdapter } from './ExpoBarcodeScannerAdapter';
|
|
8
8
|
export { ExpoRuntimeProviders } from './ExpoRuntimeProviders';
|
|
9
|
+
export { ExpoZoraIconFontProvider, } from './ExpoZoraIconFontProvider';
|
|
9
10
|
export { resolveExpoRuntimeConfigPluginOutput, resolveExpoRuntimeDependencyMap, resolveExpoRuntimeGeneratedAppOutput, resolveExpoRuntimeNativeOutput, } from './generatedAppOutput';
|
|
10
11
|
export { getExpoBarcodeScannerViewSource } from './generatedSources';
|
|
11
12
|
export { resolveExpoRuntimeLayoutIntegration, } from './layoutIntegrationPlanning';
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,6BAA6B,EAC7B,qBAAqB,EAGrB,2CAA2C,EAC3C,8BAA8B,EAC9B,uBAAuB,GACxB,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EAEL,iCAAiC,GAClC,MAAM,8BAA8B,CAAC;AACtC,OAAO,EACL,8BAA8B,EAK9B,4BAA4B,GAC7B,MAAM,wBAAwB,CAAC;AAEhC,OAAO,EAAE,uBAAuB,EAAE,MAAM,qBAAqB,CAAC;AAC9D,OAAO,EAAE,yBAAyB,EAAE,MAAM,6BAA6B,CAAC;AACxE,OAAO,EACL,wBAAwB,EAOxB,2BAA2B,GAC5B,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EAAE,yBAAyB,EAAE,MAAM,6BAA6B,CAAC;AACxE,OAAO,EAAE,oBAAoB,EAAkC,MAAM,wBAAwB,CAAC;AAC9F,OAAO,EAKL,oCAAoC,EACpC,+BAA+B,EAC/B,oCAAoC,EACpC,8BAA8B,GAC/B,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EAAE,+BAA+B,EAAE,MAAM,oBAAoB,CAAC;AACrE,OAAO,EAEL,mCAAmC,GACpC,MAAM,6BAA6B,CAAC;AAMrC,OAAO,EAAE,sBAAsB,EAAE,MAAM,0BAA0B,CAAC","sourcesContent":["export {\n BARCODE_SCAN_DEDUPE_WINDOW_MS,\n BARCODE_SCANNER_TYPES,\n type BarcodeScanRecord,\n type ExpoBarcodeScanResultLike,\n mapPermissionStatusToCameraPermissionStatus,\n normalizeExpoBarcodeScanResult,\n shouldIgnoreBarcodeScan,\n} from './barcodeScanRuntime';\nexport {\n type ExpoBundledMediaRegistrySourceEntry,\n getExpoBundledMediaRegistrySource,\n} from './bundledMediaRegistrySource';\nexport {\n createExpoBundledMediaResolver,\n type ExpoBundledMediaRegistry,\n type ExpoBundledMediaResolver,\n type ExpoBundledMediaResolverArgs,\n type ExpoBundledMediaValue,\n resolveExpoBundledMediaAsset,\n} from './bundledMediaResolver';\nexport type { ComponentRegistry } from './componentRegistry';\nexport { createComponentRegistry } from './componentRegistry';\nexport { createExpoRuntimeRegistry } from './createExpoRuntimeRegistry';\nexport {\n executeExpoRuntimeAction,\n type ExecuteExpoRuntimeActionArgs,\n type ExpoRuntimeActionHandlerArgs,\n type ExpoRuntimeActionHandlers,\n type ExpoRuntimeRouteResolution,\n type ExpoRuntimeRouterLike,\n type ExpoRuntimeThemeMode,\n resolveExpoRuntimeRoutePath,\n} from './expoActionBridge';\nexport { ExpoBarcodeScannerAdapter } from './ExpoBarcodeScannerAdapter';\nexport { ExpoRuntimeProviders, type ExpoRuntimeProvidersProps } from './ExpoRuntimeProviders';\nexport {\n type ExpoRuntimeConfigPluginOutput,\n type ExpoRuntimeDependencyMap,\n type ExpoRuntimeGeneratedAppOutputPlan,\n type ExpoRuntimeNativeOutputPlan,\n resolveExpoRuntimeConfigPluginOutput,\n resolveExpoRuntimeDependencyMap,\n resolveExpoRuntimeGeneratedAppOutput,\n resolveExpoRuntimeNativeOutput,\n} from './generatedAppOutput';\nexport { getExpoBarcodeScannerViewSource } from './generatedSources';\nexport {\n type ExpoRuntimeLayoutIntegrationPlan,\n resolveExpoRuntimeLayoutIntegration,\n} from './layoutIntegrationPlanning';\nexport type {\n ExpoRuntimeAdapterId,\n ExpoRuntimePlan,\n ExpoRuntimeProviderId,\n} from './resolveExpoRuntimePlan';\nexport { resolveExpoRuntimePlan } from './resolveExpoRuntimePlan';\n"]}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,6BAA6B,EAC7B,qBAAqB,EAGrB,2CAA2C,EAC3C,8BAA8B,EAC9B,uBAAuB,GACxB,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EAEL,iCAAiC,GAClC,MAAM,8BAA8B,CAAC;AACtC,OAAO,EACL,8BAA8B,EAK9B,4BAA4B,GAC7B,MAAM,wBAAwB,CAAC;AAEhC,OAAO,EAAE,uBAAuB,EAAE,MAAM,qBAAqB,CAAC;AAC9D,OAAO,EAAE,yBAAyB,EAAE,MAAM,6BAA6B,CAAC;AACxE,OAAO,EACL,wBAAwB,EAOxB,2BAA2B,GAC5B,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EAAE,yBAAyB,EAAE,MAAM,6BAA6B,CAAC;AACxE,OAAO,EAAE,oBAAoB,EAAkC,MAAM,wBAAwB,CAAC;AAC9F,OAAO,EACL,wBAAwB,GAEzB,MAAM,4BAA4B,CAAC;AACpC,OAAO,EAKL,oCAAoC,EACpC,+BAA+B,EAC/B,oCAAoC,EACpC,8BAA8B,GAC/B,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EAAE,+BAA+B,EAAE,MAAM,oBAAoB,CAAC;AACrE,OAAO,EAEL,mCAAmC,GACpC,MAAM,6BAA6B,CAAC;AAMrC,OAAO,EAAE,sBAAsB,EAAE,MAAM,0BAA0B,CAAC","sourcesContent":["export {\n BARCODE_SCAN_DEDUPE_WINDOW_MS,\n BARCODE_SCANNER_TYPES,\n type BarcodeScanRecord,\n type ExpoBarcodeScanResultLike,\n mapPermissionStatusToCameraPermissionStatus,\n normalizeExpoBarcodeScanResult,\n shouldIgnoreBarcodeScan,\n} from './barcodeScanRuntime';\nexport {\n type ExpoBundledMediaRegistrySourceEntry,\n getExpoBundledMediaRegistrySource,\n} from './bundledMediaRegistrySource';\nexport {\n createExpoBundledMediaResolver,\n type ExpoBundledMediaRegistry,\n type ExpoBundledMediaResolver,\n type ExpoBundledMediaResolverArgs,\n type ExpoBundledMediaValue,\n resolveExpoBundledMediaAsset,\n} from './bundledMediaResolver';\nexport type { ComponentRegistry } from './componentRegistry';\nexport { createComponentRegistry } from './componentRegistry';\nexport { createExpoRuntimeRegistry } from './createExpoRuntimeRegistry';\nexport {\n executeExpoRuntimeAction,\n type ExecuteExpoRuntimeActionArgs,\n type ExpoRuntimeActionHandlerArgs,\n type ExpoRuntimeActionHandlers,\n type ExpoRuntimeRouteResolution,\n type ExpoRuntimeRouterLike,\n type ExpoRuntimeThemeMode,\n resolveExpoRuntimeRoutePath,\n} from './expoActionBridge';\nexport { ExpoBarcodeScannerAdapter } from './ExpoBarcodeScannerAdapter';\nexport { ExpoRuntimeProviders, type ExpoRuntimeProvidersProps } from './ExpoRuntimeProviders';\nexport {\n ExpoZoraIconFontProvider,\n type ExpoZoraIconFontProviderProps,\n} from './ExpoZoraIconFontProvider';\nexport {\n type ExpoRuntimeConfigPluginOutput,\n type ExpoRuntimeDependencyMap,\n type ExpoRuntimeGeneratedAppOutputPlan,\n type ExpoRuntimeNativeOutputPlan,\n resolveExpoRuntimeConfigPluginOutput,\n resolveExpoRuntimeDependencyMap,\n resolveExpoRuntimeGeneratedAppOutput,\n resolveExpoRuntimeNativeOutput,\n} from './generatedAppOutput';\nexport { getExpoBarcodeScannerViewSource } from './generatedSources';\nexport {\n type ExpoRuntimeLayoutIntegrationPlan,\n resolveExpoRuntimeLayoutIntegration,\n} from './layoutIntegrationPlanning';\nexport type {\n ExpoRuntimeAdapterId,\n ExpoRuntimePlan,\n ExpoRuntimeProviderId,\n} from './resolveExpoRuntimePlan';\nexport { resolveExpoRuntimePlan } from './resolveExpoRuntimePlan';\n"]}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ankhorage/expo-runtime",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "3.0.
|
|
4
|
+
"version": "3.0.8",
|
|
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": {
|
|
@@ -64,6 +64,13 @@
|
|
|
64
64
|
"import": "./dist/platform.js",
|
|
65
65
|
"default": "./dist/platform.js"
|
|
66
66
|
},
|
|
67
|
+
"./icon-fonts": {
|
|
68
|
+
"react-native": "./src/ExpoZoraIconFontProvider.tsx",
|
|
69
|
+
"browser": "./src/ExpoZoraIconFontProvider.web.tsx",
|
|
70
|
+
"types": "./src/ExpoZoraIconFontProvider.tsx",
|
|
71
|
+
"import": "./dist/ExpoZoraIconFontProvider.js",
|
|
72
|
+
"default": "./dist/ExpoZoraIconFontProvider.js"
|
|
73
|
+
},
|
|
67
74
|
"./oauth-browser": {
|
|
68
75
|
"react-native": "./src/oauthBrowserTransport.ts",
|
|
69
76
|
"browser": "./src/oauthBrowserTransport.ts",
|
|
@@ -102,6 +109,7 @@
|
|
|
102
109
|
"changeset:status": "changeset status --since=origin/main",
|
|
103
110
|
"docs": "paradox",
|
|
104
111
|
"knip": "ankhorage-knip",
|
|
112
|
+
"knip:check": "ankhorage-knip",
|
|
105
113
|
"lint": "ankhorage-eslint . --max-warnings=0",
|
|
106
114
|
"lint:fix": "ankhorage-eslint . --fix --max-warnings=0",
|
|
107
115
|
"format": "ankhorage-prettier --write .",
|
|
@@ -119,11 +127,16 @@
|
|
|
119
127
|
"peerDependencies": {
|
|
120
128
|
"@ankhorage/permissions": "^0.2.3",
|
|
121
129
|
"@ankhorage/zora": "^3.0.0",
|
|
130
|
+
"@react-native-vector-icons/fontawesome": "^13.1.3",
|
|
131
|
+
"@react-native-vector-icons/fontawesome5": "^13.1.3",
|
|
132
|
+
"@react-native-vector-icons/fontawesome6": "^13.1.3",
|
|
133
|
+
"@react-native-vector-icons/ionicons": "^13.1.3",
|
|
122
134
|
"expo": "57.0.17",
|
|
123
135
|
"expo-camera": "~57.0.4",
|
|
124
136
|
"expo-constants": "~57.0.13",
|
|
125
137
|
"expo-document-picker": "~57.0.1",
|
|
126
138
|
"expo-file-system": "~57.0.5",
|
|
139
|
+
"expo-font": "~57.0.1",
|
|
127
140
|
"expo-image-picker": "~57.0.12",
|
|
128
141
|
"react": "19.2.3",
|
|
129
142
|
"react-native": "0.86.3"
|
|
@@ -135,6 +148,18 @@
|
|
|
135
148
|
"@ankhorage/zora": {
|
|
136
149
|
"optional": true
|
|
137
150
|
},
|
|
151
|
+
"@react-native-vector-icons/fontawesome": {
|
|
152
|
+
"optional": true
|
|
153
|
+
},
|
|
154
|
+
"@react-native-vector-icons/fontawesome5": {
|
|
155
|
+
"optional": true
|
|
156
|
+
},
|
|
157
|
+
"@react-native-vector-icons/fontawesome6": {
|
|
158
|
+
"optional": true
|
|
159
|
+
},
|
|
160
|
+
"@react-native-vector-icons/ionicons": {
|
|
161
|
+
"optional": true
|
|
162
|
+
},
|
|
138
163
|
"expo": {
|
|
139
164
|
"optional": true
|
|
140
165
|
},
|
|
@@ -150,6 +175,9 @@
|
|
|
150
175
|
"expo-file-system": {
|
|
151
176
|
"optional": true
|
|
152
177
|
},
|
|
178
|
+
"expo-font": {
|
|
179
|
+
"optional": true
|
|
180
|
+
},
|
|
153
181
|
"expo-image-picker": {
|
|
154
182
|
"optional": true
|
|
155
183
|
},
|
|
@@ -181,6 +209,7 @@
|
|
|
181
209
|
"expo-constants": "~57.0.13",
|
|
182
210
|
"expo-document-picker": "~57.0.1",
|
|
183
211
|
"expo-file-system": "~57.0.5",
|
|
212
|
+
"expo-font": "~57.0.1",
|
|
184
213
|
"expo-image-picker": "~57.0.12",
|
|
185
214
|
"react": "19.2.3",
|
|
186
215
|
"react-dom": "19.2.3",
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
import { afterAll, describe, expect, mock, test } from 'bun:test';
|
|
2
|
+
import React from 'react';
|
|
3
|
+
|
|
4
|
+
const useFonts = mock(
|
|
5
|
+
(_fonts: Readonly<Record<string, number>>): readonly [boolean, Error | null] => [true, null],
|
|
6
|
+
);
|
|
7
|
+
|
|
8
|
+
void mock.module('expo-font', () => ({ useFonts }));
|
|
9
|
+
|
|
10
|
+
const { ExpoZoraIconFontProvider } = await import('./ExpoZoraIconFontProvider.web');
|
|
11
|
+
|
|
12
|
+
describe('ExpoZoraIconFontProvider Web', () => {
|
|
13
|
+
afterAll(() => {
|
|
14
|
+
mock.restore();
|
|
15
|
+
});
|
|
16
|
+
|
|
17
|
+
test('loads every font face used by the ZORA icon providers before rendering', () => {
|
|
18
|
+
const child = React.createElement('child');
|
|
19
|
+
const element = ExpoZoraIconFontProvider({ children: child });
|
|
20
|
+
|
|
21
|
+
expect(useFonts).toHaveBeenCalledTimes(1);
|
|
22
|
+
const fonts = useFonts.mock.calls[0]?.[0] ?? {};
|
|
23
|
+
expect(
|
|
24
|
+
Object.entries(fonts).map(([family, source]) => [family, String(source).split('/').at(-1)]),
|
|
25
|
+
).toEqual([
|
|
26
|
+
['FontAwesome', 'FontAwesome.ttf'],
|
|
27
|
+
['FontAwesome5Brands-Regular', 'FontAwesome5_Brands.ttf'],
|
|
28
|
+
['FontAwesome5Free-Regular', 'FontAwesome5_Regular.ttf'],
|
|
29
|
+
['FontAwesome5Free-Solid', 'FontAwesome5_Solid.ttf'],
|
|
30
|
+
['FontAwesome6Brands-Regular', 'FontAwesome6_Brands.ttf'],
|
|
31
|
+
['FontAwesome6Free-Regular', 'FontAwesome6_Regular.ttf'],
|
|
32
|
+
['FontAwesome6Free-Solid', 'FontAwesome6_Solid.ttf'],
|
|
33
|
+
['Ionicons', 'Ionicons.ttf'],
|
|
34
|
+
]);
|
|
35
|
+
expect(React.isValidElement(element)).toBe(true);
|
|
36
|
+
if (!React.isValidElement(element)) {
|
|
37
|
+
throw new Error('expected a React element');
|
|
38
|
+
}
|
|
39
|
+
expect(element.props.children).toBe(child);
|
|
40
|
+
});
|
|
41
|
+
|
|
42
|
+
test('holds the app boundary while fonts are loading', () => {
|
|
43
|
+
useFonts.mockImplementationOnce(() => [false, null]);
|
|
44
|
+
|
|
45
|
+
expect(ExpoZoraIconFontProvider({ children: React.createElement('child') })).toBeNull();
|
|
46
|
+
});
|
|
47
|
+
|
|
48
|
+
test('surfaces font-loading failures', () => {
|
|
49
|
+
const error = new Error('font load failed');
|
|
50
|
+
useFonts.mockImplementationOnce(() => [false, error]);
|
|
51
|
+
|
|
52
|
+
expect(() => ExpoZoraIconFontProvider({ children: React.createElement('child') })).toThrow(
|
|
53
|
+
error,
|
|
54
|
+
);
|
|
55
|
+
});
|
|
56
|
+
});
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import fontAwesome from '@react-native-vector-icons/fontawesome/fonts/FontAwesome.ttf';
|
|
2
|
+
import fontAwesome5Brands from '@react-native-vector-icons/fontawesome5/fonts/FontAwesome5_Brands.ttf';
|
|
3
|
+
import fontAwesome5Regular from '@react-native-vector-icons/fontawesome5/fonts/FontAwesome5_Regular.ttf';
|
|
4
|
+
import fontAwesome5Solid from '@react-native-vector-icons/fontawesome5/fonts/FontAwesome5_Solid.ttf';
|
|
5
|
+
import fontAwesome6Brands from '@react-native-vector-icons/fontawesome6/fonts/FontAwesome6_Brands.ttf';
|
|
6
|
+
import fontAwesome6Regular from '@react-native-vector-icons/fontawesome6/fonts/FontAwesome6_Regular.ttf';
|
|
7
|
+
import fontAwesome6Solid from '@react-native-vector-icons/fontawesome6/fonts/FontAwesome6_Solid.ttf';
|
|
8
|
+
import ionicons from '@react-native-vector-icons/ionicons/fonts/Ionicons.ttf';
|
|
9
|
+
import { useFonts } from 'expo-font';
|
|
10
|
+
import React from 'react';
|
|
11
|
+
|
|
12
|
+
const ZORA_ICON_FONTS = {
|
|
13
|
+
FontAwesome: fontAwesome,
|
|
14
|
+
'FontAwesome5Brands-Regular': fontAwesome5Brands,
|
|
15
|
+
'FontAwesome5Free-Regular': fontAwesome5Regular,
|
|
16
|
+
'FontAwesome5Free-Solid': fontAwesome5Solid,
|
|
17
|
+
'FontAwesome6Brands-Regular': fontAwesome6Brands,
|
|
18
|
+
'FontAwesome6Free-Regular': fontAwesome6Regular,
|
|
19
|
+
'FontAwesome6Free-Solid': fontAwesome6Solid,
|
|
20
|
+
Ionicons: ionicons,
|
|
21
|
+
} as const;
|
|
22
|
+
|
|
23
|
+
export interface ExpoZoraIconFontProviderProps {
|
|
24
|
+
readonly children: React.ReactNode;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
export function ExpoZoraIconFontProvider(props: ExpoZoraIconFontProviderProps) {
|
|
28
|
+
const [loaded, error] = useFonts(ZORA_ICON_FONTS);
|
|
29
|
+
|
|
30
|
+
if (error) {
|
|
31
|
+
throw error;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
if (!loaded) {
|
|
35
|
+
return null;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
return <>{props.children}</>;
|
|
39
|
+
}
|
package/src/assets.d.ts
ADDED
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { expect, test } from 'bun:test';
|
|
2
|
+
|
|
3
|
+
import { ExpoZoraIconFontProvider } from './ExpoZoraIconFontProvider';
|
|
4
|
+
|
|
5
|
+
test('exports the icon font boundary through its focused subpath', async () => {
|
|
6
|
+
const packageJson = (await Bun.file(new URL('../package.json', import.meta.url)).json()) as {
|
|
7
|
+
readonly exports: Readonly<Record<string, unknown>>;
|
|
8
|
+
};
|
|
9
|
+
|
|
10
|
+
expect(packageJson.exports['./icon-fonts']).toEqual({
|
|
11
|
+
'react-native': './src/ExpoZoraIconFontProvider.tsx',
|
|
12
|
+
browser: './src/ExpoZoraIconFontProvider.web.tsx',
|
|
13
|
+
types: './src/ExpoZoraIconFontProvider.tsx',
|
|
14
|
+
import: './dist/ExpoZoraIconFontProvider.js',
|
|
15
|
+
default: './dist/ExpoZoraIconFontProvider.js',
|
|
16
|
+
});
|
|
17
|
+
expect(ExpoZoraIconFontProvider).toBeFunction();
|
|
18
|
+
});
|
package/src/index.ts
CHANGED
|
@@ -34,6 +34,10 @@ export {
|
|
|
34
34
|
} from './expoActionBridge';
|
|
35
35
|
export { ExpoBarcodeScannerAdapter } from './ExpoBarcodeScannerAdapter';
|
|
36
36
|
export { ExpoRuntimeProviders, type ExpoRuntimeProvidersProps } from './ExpoRuntimeProviders';
|
|
37
|
+
export {
|
|
38
|
+
ExpoZoraIconFontProvider,
|
|
39
|
+
type ExpoZoraIconFontProviderProps,
|
|
40
|
+
} from './ExpoZoraIconFontProvider';
|
|
37
41
|
export {
|
|
38
42
|
type ExpoRuntimeConfigPluginOutput,
|
|
39
43
|
type ExpoRuntimeDependencyMap,
|