@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;AAI9D,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;AAwCH,wBAAgB,wBAAwB,CAAC,QAAQ,EAAE,MAAM,GAAG,iBAAiB,CAQ5E"}
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 Icons = loadExpoIcons();
29
- const candidate = Icons[provider];
4
+ const candidate = ExpoIcons[provider];
30
5
  if (typeof candidate === 'function') {
31
6
  return candidate;
32
7
  }
33
- return Icons.Ionicons;
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":"AAEA,OAAO,EAAkC,MAAM,cAAc,CAAC;AAY9D,IAAI,WAAW,GAA2B,IAAI,CAAC;AAE/C,SAAS,qBAAqB;IAC5B,MAAM,eAAe,GACnB,UAGD,CAAC,OAAO,CAAC;IAEV,IAAI,OAAO,eAAe,KAAK,UAAU,EAAE,CAAC;QAC1C,OAAO,eAA0C,CAAC;IACpD,CAAC;IAED,OAAO,IAAI,CAAC;AACd,CAAC;AAED,SAAS,aAAa;IACpB,IAAI,WAAW,EAAE,CAAC;QAChB,OAAO,WAAW,CAAC;IACrB,CAAC;IAED,MAAM,cAAc,GAAG,qBAAqB,EAAE,CAAC;IAE/C,IAAI,CAAC;QACH,IAAI,CAAC,cAAc,EAAE,CAAC;YACpB,MAAM,IAAI,KAAK,CAAC,gCAAgC,CAAC,CAAC;QACpD,CAAC;QAED,2FAA2F;QAC3F,WAAW,GAAG,cAAc,CAAC,oBAAoB,CAAoB,CAAC;QACtE,OAAO,WAAW,CAAC;IACrB,CAAC;IAAC,MAAM,CAAC;QACP,MAAM,IAAI,KAAK,CACb,qHAAqH,CACtH,CAAC;IACJ,CAAC;AACH,CAAC;AAED,MAAM,UAAU,wBAAwB,CAAC,QAAgB;IACvD,MAAM,KAAK,GAAG,aAAa,EAAE,CAAC;IAC9B,MAAM,SAAS,GAAI,KAAiC,CAAC,QAAQ,CAAC,CAAC;IAC/D,IAAI,OAAO,SAAS,KAAK,UAAU,EAAE,CAAC;QACpC,OAAO,SAA8B,CAAC;IACxC,CAAC;IAED,OAAO,KAAK,CAAC,QAA6B,CAAC;AAC7C,CAAC"}
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
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@ankhorage/surface",
3
3
  "type": "module",
4
- "version": "0.1.2",
4
+ "version": "0.1.4",
5
5
  "description": "Stable UI foundation for React Native and React Native Web.",
6
6
  "homepage": "https://github.com/ankhorage/surface#readme",
7
7
  "bugs": {