@ankhorage/surface 0.1.2 → 0.1.4
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
CHANGED
|
@@ -1,5 +1,17 @@
|
|
|
1
1
|
# @ankhorage/surface
|
|
2
2
|
|
|
3
|
+
## 0.1.4
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- Fix Expo Web icon rendering by importing `@expo/vector-icons` through a bundler-safe static module path instead of runtime `require` resolution.
|
|
8
|
+
|
|
9
|
+
## 0.1.3
|
|
10
|
+
|
|
11
|
+
### Patch Changes
|
|
12
|
+
|
|
13
|
+
- Fix Expo Web icon loading by resolving the runtime module loader from the local Metro `require` function before falling back to `globalThis.require`.
|
|
14
|
+
|
|
3
15
|
## 0.1.2
|
|
4
16
|
|
|
5
17
|
### Patch Changes
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"resolveExpoIconComponent.d.ts","sourceRoot":"","sources":["../../../src/primitives/icon/resolveExpoIconComponent.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAAE,KAAK,SAAS,EAAE,KAAK,SAAS,EAAE,MAAM,cAAc,CAAC;
|
|
1
|
+
{"version":3,"file":"resolveExpoIconComponent.d.ts","sourceRoot":"","sources":["../../../src/primitives/icon/resolveExpoIconComponent.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAAE,KAAK,SAAS,EAAE,KAAK,SAAS,EAAE,MAAM,cAAc,CAAC;AAE9D,MAAM,MAAM,iBAAiB,GAAG,KAAK,CAAC,WAAW,CAAC;IAChD,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,KAAK,CAAC,EAAE,SAAS,CAAC,SAAS,CAAC,CAAC;IAC7B,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB,CAAC,CAAC;AAEH,wBAAgB,wBAAwB,CAAC,QAAQ,EAAE,MAAM,GAAG,iBAAiB,CAO5E"}
|
|
@@ -1,35 +1,10 @@
|
|
|
1
|
+
import * as ExpoIcons from '@expo/vector-icons';
|
|
1
2
|
import {} from 'react-native';
|
|
2
|
-
let cachedIcons = null;
|
|
3
|
-
function resolveRuntimeRequire() {
|
|
4
|
-
const globalCandidate = globalThis.require;
|
|
5
|
-
if (typeof globalCandidate === 'function') {
|
|
6
|
-
return globalCandidate;
|
|
7
|
-
}
|
|
8
|
-
return null;
|
|
9
|
-
}
|
|
10
|
-
function loadExpoIcons() {
|
|
11
|
-
if (cachedIcons) {
|
|
12
|
-
return cachedIcons;
|
|
13
|
-
}
|
|
14
|
-
const runtimeRequire = resolveRuntimeRequire();
|
|
15
|
-
try {
|
|
16
|
-
if (!runtimeRequire) {
|
|
17
|
-
throw new Error('runtime require is unavailable');
|
|
18
|
-
}
|
|
19
|
-
// Keep icon loading lazy so non-Expo consumers do not need the package until Icon is used.
|
|
20
|
-
cachedIcons = runtimeRequire('@expo/vector-icons');
|
|
21
|
-
return cachedIcons;
|
|
22
|
-
}
|
|
23
|
-
catch {
|
|
24
|
-
throw new Error('Surface Icon requires `@expo/vector-icons` and `expo-font` in the host app. Install them to use the Icon primitive.');
|
|
25
|
-
}
|
|
26
|
-
}
|
|
27
3
|
export function resolveExpoIconComponent(provider) {
|
|
28
|
-
const
|
|
29
|
-
const candidate = Icons[provider];
|
|
4
|
+
const candidate = ExpoIcons[provider];
|
|
30
5
|
if (typeof candidate === 'function') {
|
|
31
6
|
return candidate;
|
|
32
7
|
}
|
|
33
|
-
return
|
|
8
|
+
return ExpoIcons.Ionicons;
|
|
34
9
|
}
|
|
35
10
|
//# sourceMappingURL=resolveExpoIconComponent.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"resolveExpoIconComponent.js","sourceRoot":"","sources":["../../../src/primitives/icon/resolveExpoIconComponent.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"resolveExpoIconComponent.js","sourceRoot":"","sources":["../../../src/primitives/icon/resolveExpoIconComponent.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,SAAS,MAAM,oBAAoB,CAAC;AAEhD,OAAO,EAAkC,MAAM,cAAc,CAAC;AAU9D,MAAM,UAAU,wBAAwB,CAAC,QAAgB;IACvD,MAAM,SAAS,GAAI,SAAqC,CAAC,QAAQ,CAAC,CAAC;IACnE,IAAI,OAAO,SAAS,KAAK,UAAU,EAAE,CAAC;QACpC,OAAO,SAA8B,CAAC;IACxC,CAAC;IAED,OAAO,SAAS,CAAC,QAA6B,CAAC;AACjD,CAAC"}
|
package/package.json
CHANGED