@oxyhq/bloom 0.35.5 → 0.35.7

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 (87) hide show
  1. package/LICENSE +661 -0
  2. package/README.md +1 -1
  3. package/lib/commonjs/content-panel/index.js +22 -6
  4. package/lib/commonjs/content-panel/index.js.map +1 -1
  5. package/lib/commonjs/content-panel/index.web.js +37 -12
  6. package/lib/commonjs/content-panel/index.web.js.map +1 -1
  7. package/lib/commonjs/fonts/FontLoader.native.js +2 -2
  8. package/lib/commonjs/fonts/FontLoader.native.js.map +1 -1
  9. package/lib/commonjs/fonts/assets/GeistMono-OFL.txt +93 -0
  10. package/lib/commonjs/fonts/assets/Inter-OFL.txt +92 -0
  11. package/lib/commonjs/fonts/font-assets.js +16 -14
  12. package/lib/commonjs/fonts/font-assets.js.map +1 -1
  13. package/lib/commonjs/fonts/font-assets.native.js +31 -0
  14. package/lib/commonjs/fonts/font-assets.native.js.map +1 -0
  15. package/lib/commonjs/fonts/font-assets.web.js +24 -0
  16. package/lib/commonjs/fonts/font-assets.web.js.map +1 -0
  17. package/lib/commonjs/fonts/index.js +1 -1
  18. package/lib/commonjs/fonts/index.web.js +2 -2
  19. package/lib/commonjs/fonts/index.web.js.map +1 -1
  20. package/lib/commonjs/fonts/tokens.js +12 -0
  21. package/lib/commonjs/fonts/tokens.js.map +1 -1
  22. package/lib/commonjs/theme/init-css-interop.js +13 -1
  23. package/lib/commonjs/theme/init-css-interop.js.map +1 -1
  24. package/lib/module/content-panel/index.js +22 -6
  25. package/lib/module/content-panel/index.js.map +1 -1
  26. package/lib/module/content-panel/index.web.js +37 -12
  27. package/lib/module/content-panel/index.web.js.map +1 -1
  28. package/lib/module/fonts/FontLoader.native.js +1 -1
  29. package/lib/module/fonts/FontLoader.native.js.map +1 -1
  30. package/lib/module/fonts/assets/GeistMono-OFL.txt +93 -0
  31. package/lib/module/fonts/assets/Inter-OFL.txt +92 -0
  32. package/lib/module/fonts/font-assets.js +16 -14
  33. package/lib/module/fonts/font-assets.js.map +1 -1
  34. package/lib/module/fonts/font-assets.native.js +27 -0
  35. package/lib/module/fonts/font-assets.native.js.map +1 -0
  36. package/lib/module/fonts/font-assets.web.js +20 -0
  37. package/lib/module/fonts/font-assets.web.js.map +1 -0
  38. package/lib/module/fonts/index.js +1 -1
  39. package/lib/module/fonts/index.js.map +1 -1
  40. package/lib/module/fonts/index.web.js +15 -6
  41. package/lib/module/fonts/index.web.js.map +1 -1
  42. package/lib/module/fonts/tokens.js +12 -0
  43. package/lib/module/fonts/tokens.js.map +1 -1
  44. package/lib/module/theme/init-css-interop.js +13 -1
  45. package/lib/module/theme/init-css-interop.js.map +1 -1
  46. package/lib/typescript/commonjs/content-panel/index.d.ts +21 -8
  47. package/lib/typescript/commonjs/content-panel/index.d.ts.map +1 -1
  48. package/lib/typescript/commonjs/content-panel/index.web.d.ts +26 -6
  49. package/lib/typescript/commonjs/content-panel/index.web.d.ts.map +1 -1
  50. package/lib/typescript/commonjs/fonts/font-assets.d.ts +2 -6
  51. package/lib/typescript/commonjs/fonts/font-assets.d.ts.map +1 -1
  52. package/lib/typescript/commonjs/fonts/font-assets.native.d.ts +3 -0
  53. package/lib/typescript/commonjs/fonts/font-assets.native.d.ts.map +1 -0
  54. package/lib/typescript/commonjs/fonts/font-assets.web.d.ts +3 -0
  55. package/lib/typescript/commonjs/fonts/font-assets.web.d.ts.map +1 -0
  56. package/lib/typescript/commonjs/fonts/index.web.d.ts +1 -1
  57. package/lib/typescript/commonjs/fonts/index.web.d.ts.map +1 -1
  58. package/lib/typescript/commonjs/fonts/tokens.d.ts +12 -0
  59. package/lib/typescript/commonjs/fonts/tokens.d.ts.map +1 -1
  60. package/lib/typescript/commonjs/theme/init-css-interop.d.ts.map +1 -1
  61. package/lib/typescript/module/content-panel/index.d.ts +21 -8
  62. package/lib/typescript/module/content-panel/index.d.ts.map +1 -1
  63. package/lib/typescript/module/content-panel/index.web.d.ts +26 -6
  64. package/lib/typescript/module/content-panel/index.web.d.ts.map +1 -1
  65. package/lib/typescript/module/fonts/font-assets.d.ts +2 -6
  66. package/lib/typescript/module/fonts/font-assets.d.ts.map +1 -1
  67. package/lib/typescript/module/fonts/font-assets.native.d.ts +3 -0
  68. package/lib/typescript/module/fonts/font-assets.native.d.ts.map +1 -0
  69. package/lib/typescript/module/fonts/font-assets.web.d.ts +3 -0
  70. package/lib/typescript/module/fonts/font-assets.web.d.ts.map +1 -0
  71. package/lib/typescript/module/fonts/index.web.d.ts +1 -1
  72. package/lib/typescript/module/fonts/index.web.d.ts.map +1 -1
  73. package/lib/typescript/module/fonts/tokens.d.ts +12 -0
  74. package/lib/typescript/module/fonts/tokens.d.ts.map +1 -1
  75. package/lib/typescript/module/theme/init-css-interop.d.ts.map +1 -1
  76. package/package.json +2 -2
  77. package/src/content-panel/index.tsx +33 -14
  78. package/src/content-panel/index.web.tsx +62 -22
  79. package/src/fonts/FontLoader.native.tsx +1 -1
  80. package/src/fonts/assets/GeistMono-OFL.txt +93 -0
  81. package/src/fonts/assets/Inter-OFL.txt +92 -0
  82. package/src/fonts/font-assets.native.ts +25 -0
  83. package/src/fonts/font-assets.ts +17 -14
  84. package/src/fonts/font-assets.web.ts +18 -0
  85. package/src/fonts/index.web.ts +15 -6
  86. package/src/fonts/tokens.ts +13 -0
  87. package/src/theme/init-css-interop.ts +13 -1
@@ -1,7 +1,7 @@
1
1
  import React, { useRef } from 'react';
2
2
  import { Text, type TextProps, type TextStyle, type StyleProp } from 'react-native';
3
3
  import { useFonts } from 'expo-font';
4
- import { FONT_ASSETS } from './font-assets';
4
+ import { FONT_ASSETS } from './font-assets.native';
5
5
 
6
6
  export interface FontLoaderProps {
7
7
  /**
@@ -0,0 +1,93 @@
1
+ Copyright 2024 The Geist Project Authors (https://github.com/vercel/geist-font)
2
+
3
+ This Font Software is licensed under the SIL Open Font License, Version 1.1.
4
+ This license is copied below, and is also available with a FAQ at:
5
+ https://openfontlicense.org
6
+
7
+
8
+ -----------------------------------------------------------
9
+ SIL OPEN FONT LICENSE Version 1.1 - 26 February 2007
10
+ -----------------------------------------------------------
11
+
12
+ PREAMBLE
13
+ The goals of the Open Font License (OFL) are to stimulate worldwide
14
+ development of collaborative font projects, to support the font creation
15
+ efforts of academic and linguistic communities, and to provide a free and
16
+ open framework in which fonts may be shared and improved in partnership
17
+ with others.
18
+
19
+ The OFL allows the licensed fonts to be used, studied, modified and
20
+ redistributed freely as long as they are not sold by themselves. The
21
+ fonts, including any derivative works, can be bundled, embedded,
22
+ redistributed and/or sold with any software provided that any reserved
23
+ names are not used by derivative works. The fonts and derivatives,
24
+ however, cannot be released under any other type of license. The
25
+ requirement for fonts to remain under this license does not apply
26
+ to any document created using the fonts or their derivatives.
27
+
28
+ DEFINITIONS
29
+ "Font Software" refers to the set of files released by the Copyright
30
+ Holder(s) under this license and clearly marked as such. This may
31
+ include source files, build scripts and documentation.
32
+
33
+ "Reserved Font Name" refers to any names specified as such after the
34
+ copyright statement(s).
35
+
36
+ "Original Version" refers to the collection of Font Software components as
37
+ distributed by the Copyright Holder(s).
38
+
39
+ "Modified Version" refers to any derivative made by adding to, deleting,
40
+ or substituting -- in part or in whole -- any of the components of the
41
+ Original Version, by changing formats or by porting the Font Software to a
42
+ new environment.
43
+
44
+ "Author" refers to any designer, engineer, programmer, technical
45
+ writer or other person who contributed to the Font Software.
46
+
47
+ PERMISSION & CONDITIONS
48
+ Permission is hereby granted, free of charge, to any person obtaining
49
+ a copy of the Font Software, to use, study, copy, merge, embed, modify,
50
+ redistribute, and sell modified and unmodified copies of the Font
51
+ Software, subject to the following conditions:
52
+
53
+ 1) Neither the Font Software nor any of its individual components,
54
+ in Original or Modified Versions, may be sold by itself.
55
+
56
+ 2) Original or Modified Versions of the Font Software may be bundled,
57
+ redistributed and/or sold with any software, provided that each copy
58
+ contains the above copyright notice and this license. These can be
59
+ included either as stand-alone text files, human-readable headers or
60
+ in the appropriate machine-readable metadata fields within text or
61
+ binary files as long as those fields can be easily viewed by the user.
62
+
63
+ 3) No Modified Version of the Font Software may use the Reserved Font
64
+ Name(s) unless explicit written permission is granted by the corresponding
65
+ Copyright Holder. This restriction only applies to the primary font name as
66
+ presented to the users.
67
+
68
+ 4) The name(s) of the Copyright Holder(s) or the Author(s) of the Font
69
+ Software shall not be used to promote, endorse or advertise any
70
+ Modified Version, except to acknowledge the contribution(s) of the
71
+ Copyright Holder(s) and the Author(s) or with their explicit written
72
+ permission.
73
+
74
+ 5) The Font Software, modified or unmodified, in part or in whole,
75
+ must be distributed entirely under this license, and must not be
76
+ distributed under any other license. The requirement for fonts to
77
+ remain under this license does not apply to any document created
78
+ using the Font Software.
79
+
80
+ TERMINATION
81
+ This license becomes null and void if any of the above conditions are
82
+ not met.
83
+
84
+ DISCLAIMER
85
+ THE FONT SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
86
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF
87
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT
88
+ OF COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL THE
89
+ COPYRIGHT HOLDER BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
90
+ INCLUDING ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL
91
+ DAMAGES, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
92
+ FROM, OUT OF THE USE OR INABILITY TO USE THE FONT SOFTWARE OR FROM
93
+ OTHER DEALINGS IN THE FONT SOFTWARE.
@@ -0,0 +1,92 @@
1
+ Copyright (c) 2016 The Inter Project Authors (https://github.com/rsms/inter)
2
+
3
+ This Font Software is licensed under the SIL Open Font License, Version 1.1.
4
+ This license is copied below, and is also available with a FAQ at:
5
+ http://scripts.sil.org/OFL
6
+
7
+ -----------------------------------------------------------
8
+ SIL OPEN FONT LICENSE Version 1.1 - 26 February 2007
9
+ -----------------------------------------------------------
10
+
11
+ PREAMBLE
12
+ The goals of the Open Font License (OFL) are to stimulate worldwide
13
+ development of collaborative font projects, to support the font creation
14
+ efforts of academic and linguistic communities, and to provide a free and
15
+ open framework in which fonts may be shared and improved in partnership
16
+ with others.
17
+
18
+ The OFL allows the licensed fonts to be used, studied, modified and
19
+ redistributed freely as long as they are not sold by themselves. The
20
+ fonts, including any derivative works, can be bundled, embedded,
21
+ redistributed and/or sold with any software provided that any reserved
22
+ names are not used by derivative works. The fonts and derivatives,
23
+ however, cannot be released under any other type of license. The
24
+ requirement for fonts to remain under this license does not apply
25
+ to any document created using the fonts or their derivatives.
26
+
27
+ DEFINITIONS
28
+ "Font Software" refers to the set of files released by the Copyright
29
+ Holder(s) under this license and clearly marked as such. This may
30
+ include source files, build scripts and documentation.
31
+
32
+ "Reserved Font Name" refers to any names specified as such after the
33
+ copyright statement(s).
34
+
35
+ "Original Version" refers to the collection of Font Software components as
36
+ distributed by the Copyright Holder(s).
37
+
38
+ "Modified Version" refers to any derivative made by adding to, deleting,
39
+ or substituting -- in part or in whole -- any of the components of the
40
+ Original Version, by changing formats or by porting the Font Software to a
41
+ new environment.
42
+
43
+ "Author" refers to any designer, engineer, programmer, technical
44
+ writer or other person who contributed to the Font Software.
45
+
46
+ PERMISSION AND CONDITIONS
47
+ Permission is hereby granted, free of charge, to any person obtaining
48
+ a copy of the Font Software, to use, study, copy, merge, embed, modify,
49
+ redistribute, and sell modified and unmodified copies of the Font
50
+ Software, subject to the following conditions:
51
+
52
+ 1) Neither the Font Software nor any of its individual components,
53
+ in Original or Modified Versions, may be sold by itself.
54
+
55
+ 2) Original or Modified Versions of the Font Software may be bundled,
56
+ redistributed and/or sold with any software, provided that each copy
57
+ contains the above copyright notice and this license. These can be
58
+ included either as stand-alone text files, human-readable headers or
59
+ in the appropriate machine-readable metadata fields within text or
60
+ binary files as long as those fields can be easily viewed by the user.
61
+
62
+ 3) No Modified Version of the Font Software may use the Reserved Font
63
+ Name(s) unless explicit written permission is granted by the corresponding
64
+ Copyright Holder. This restriction only applies to the primary font name as
65
+ presented to the users.
66
+
67
+ 4) The name(s) of the Copyright Holder(s) or the Author(s) of the Font
68
+ Software shall not be used to promote, endorse or advertise any
69
+ Modified Version, except to acknowledge the contribution(s) of the
70
+ Copyright Holder(s) and the Author(s) or with their explicit written
71
+ permission.
72
+
73
+ 5) The Font Software, modified or unmodified, in part or in whole,
74
+ must be distributed entirely under this license, and must not be
75
+ distributed under any other license. The requirement for fonts to
76
+ remain under this license does not apply to any document created
77
+ using the Font Software.
78
+
79
+ TERMINATION
80
+ This license becomes null and void if any of the above conditions are
81
+ not met.
82
+
83
+ DISCLAIMER
84
+ THE FONT SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
85
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF
86
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT
87
+ OF COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL THE
88
+ COPYRIGHT HOLDER BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
89
+ INCLUDING ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL
90
+ DAMAGES, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
91
+ FROM, OUT OF THE USE OR INABILITY TO USE THE FONT SOFTWARE OR FROM
92
+ OTHER DEALINGS IN THE FONT SOFTWARE.
@@ -0,0 +1,25 @@
1
+ // Native font asset map for `useFonts(FONT_ASSETS)`.
2
+ //
3
+ // We ship variable .ttf files for Inter and Geist Mono (extracted from the
4
+ // official rsms/inter and vercel/geist-font releases) so the same family name
5
+ // covers all weights at runtime. `@fontsource(-variable)?/*` packages only
6
+ // publish .woff2 for their variable axes — modern react-native font loading
7
+ // requires .ttf, so we use the upstream variable TTFs instead.
8
+ //
9
+ // METRO-ONLY. The calls below are Metro asset requires: they resolve to
10
+ // asset-registry ids and only exist because Metro rewrites them at bundle
11
+ // time. Reaching a web or Node ESM bundler with them is fatal — `require` is
12
+ // not defined in an ES module, so merely importing this file throws
13
+ // `ReferenceError: require is not defined` at module-evaluation time and takes
14
+ // the whole app down before React can mount. That is why this map lives behind
15
+ // a platform split (`font-assets.web.ts` and the default `font-assets.ts` are
16
+ // both empty) and why the web barrel reaches for `./font-assets.web`
17
+ // explicitly rather than relying on bundler extension resolution.
18
+ import type { FontAssetMap } from './tokens';
19
+
20
+ export const FONT_ASSETS: FontAssetMap = {
21
+ BlomusModernus: require('./assets/BlomusModernus-Regular.ttf'),
22
+ 'BlomusModernus-Bold': require('./assets/BlomusModernus-Bold.ttf'),
23
+ Inter: require('./assets/InterVariable.ttf'),
24
+ 'Geist Mono': require('./assets/GeistMono-Variable.ttf'),
25
+ };
@@ -1,16 +1,19 @@
1
- // Native font asset map for `useFonts(FONT_ASSETS)`.
1
+ // Platform-neutral default font asset map deliberately empty.
2
2
  //
3
- // We ship variable .ttf files for Inter and Geist Mono (extracted from the
4
- // official rsms/inter and vercel/geist-font releases) so the same family name
5
- // covers all weights at runtime. `@fontsource(-variable)?/*` packages only
6
- // publish .woff2 for their variable axes modern react-native font loading
7
- // requires .ttf, so we use the upstream variable TTFs instead. On web,
8
- // `apply-font-faces.web.ts` inlines the .woff2 variants as base64 data URLs
9
- // (see `font-data.web.ts`) and this file is never imported.
3
+ // The real map is Metro-only (`font-assets.native.ts`): it is built from
4
+ // `require('./assets/*.ttf')` asset requires, which are meaningless outside
5
+ // Metro and fatal inside an ES module, where `require` is not defined. This
6
+ // default therefore carries no asset requires at all, per the platform-split
7
+ // rule in AGENTS.md anything with platform-specific behaviour ships
8
+ // `.native.ts` + `.web.ts` + a clean default `.ts` that no bundler can choke
9
+ // on.
10
+ //
11
+ // Who lands here: any consumer whose bundler does no platform-extension
12
+ // resolution. In practice that is the `"import"` export condition — Node ESM,
13
+ // SSR, and prerender passes. They get an empty map and load no fonts, which is
14
+ // correct: there is no native font registry to load them into. Metro takes
15
+ // `font-assets.native.ts`, and the web barrel names `./font-assets.web`
16
+ // outright.
17
+ import type { FontAssetMap } from './tokens';
10
18
 
11
- export const FONT_ASSETS = {
12
- BlomusModernus: require('./assets/BlomusModernus-Regular.ttf'),
13
- 'BlomusModernus-Bold': require('./assets/BlomusModernus-Bold.ttf'),
14
- Inter: require('./assets/InterVariable.ttf'),
15
- 'Geist Mono': require('./assets/GeistMono-Variable.ttf'),
16
- } as const;
19
+ export const FONT_ASSETS: FontAssetMap = {};
@@ -0,0 +1,18 @@
1
+ // Web has no bundled font assets.
2
+ //
3
+ // `useFonts()` is native-only — the web `FontLoader` (`FontLoader.tsx`) calls
4
+ // `applyFontFaces()` instead, which injects the same four families as
5
+ // `@font-face` rules from base64 data URLs (`apply-font-faces.web.ts` /
6
+ // `font-data.web.ts`). So the map is empty by design, not by omission.
7
+ //
8
+ // This file exists so `index.web.ts` can name its font-asset source
9
+ // explicitly, exactly as it already does for `./apply-font-faces.web`. The
10
+ // native map (`font-assets.native.ts`) is built from Metro asset `require()`
11
+ // calls, which throw `ReferenceError: require is not defined` the moment an
12
+ // ES module bundler evaluates them — an explicit `./font-assets.web` import
13
+ // keeps that file out of the web graph without depending on the consumer's
14
+ // bundler being configured to resolve `.web` extensions (Vite, for one, does
15
+ // not do so by default).
16
+ import type { FontAssetMap } from './tokens';
17
+
18
+ export const FONT_ASSETS: FontAssetMap = {};
@@ -1,10 +1,19 @@
1
1
  // Web variant of the `./fonts` barrel.
2
2
  //
3
- // The default barrel (`./index.ts`) re-exports `applyFontFaces` from
4
- // `./apply-font-faces`, which on native is a no-op stub. The web fork
5
- // explicitly reaches for `./apply-font-faces.web`, which performs the real
6
- // `@font-face` injection using inlined base64 data URLs (see
7
- // `font-data.web.ts`).
3
+ // Every re-export below that has a platform fork names its `.web` source
4
+ // OUTRIGHT rather than letting the bundler pick. That is deliberate: web
5
+ // bundlers are not required to resolve `.web` extensions (Vite does not, out
6
+ // of the box), so an extensionless specifier here would quietly fall through
7
+ // to the default file.
8
+ //
9
+ // - `./apply-font-faces.web` performs the real `@font-face` injection using
10
+ // inlined base64 data URLs (see `font-data.web.ts`); the default
11
+ // `./apply-font-faces` is a no-op stub for native.
12
+ // - `./font-assets.web` is an empty map. The native map is built from Metro
13
+ // asset `require()` calls, and importing it from an ES module throws
14
+ // `ReferenceError: require is not defined` during module evaluation — which
15
+ // white-screens the consumer before React mounts. Naming the `.web` file
16
+ // here is what keeps it out of the web graph.
8
17
  //
9
18
  // Web bundlers select this file via the `"browser"` condition in
10
19
  // `package.json`'s `exports['./fonts']`; native bundlers fall through to
@@ -12,6 +21,6 @@
12
21
  export { fontFamilies, fontCssVars } from './tokens';
13
22
  export type { FontFamilyName } from './tokens';
14
23
  export { applyFontFaces } from './apply-font-faces.web';
15
- export { FONT_ASSETS } from './font-assets';
24
+ export { FONT_ASSETS } from './font-assets.web';
16
25
  export { FontLoader } from './FontLoader';
17
26
  export type { FontLoaderProps } from './FontLoader';
@@ -21,3 +21,16 @@ export const fontCssVars = {
21
21
  } as const;
22
22
 
23
23
  export type FontFamilyName = keyof typeof fontFamilies;
24
+
25
+ /**
26
+ * Shape of the font asset map handed to `expo-font`'s `useFonts()`.
27
+ *
28
+ * Values are Metro asset-registry ids produced by `require('./assets/*.ttf')`,
29
+ * so the map is only ever populated under Metro (`font-assets.native.ts`).
30
+ * Every other platform resolves an empty map — web installs the same families
31
+ * as `@font-face` rules instead (`apply-font-faces.web.ts`).
32
+ *
33
+ * Declared here, in the platform-neutral tokens module, so all three
34
+ * `font-assets` variants can share it without importing each other.
35
+ */
36
+ export type FontAssetMap = Record<string, number>;
@@ -74,13 +74,25 @@ function setWebCssVariable(): void {
74
74
 
75
75
  function tryCallSetFlag(): void {
76
76
  let mod: CssInteropModule | undefined;
77
+ // `require` does not exist in an ES module, so guard before touching it —
78
+ // an unguarded reference is a ReferenceError, not a resolution failure.
79
+ // Matches the pattern used by every other optional-module load in Bloom
80
+ // (`utils/lazy-require.ts`, `theme/adaptive-colors.ts`,
81
+ // `bottom-sheet/index.tsx`).
82
+ if (typeof require === 'undefined') return;
77
83
  try {
78
84
  // Dynamic require: css-interop is not a Bloom dependency. If the host
79
85
  // app ships it (via NativeWind or directly), this resolves. Otherwise
80
86
  // the require throws and we silently move on — there is nothing to
81
87
  // initialize because css-interop is not in the bundle.
88
+ //
89
+ // The specifier goes through a variable on purpose: a literal
90
+ // `require('react-native-css-interop')` is statically analysable, so
91
+ // bundlers try to resolve (and warn about, or fail on) a module that is
92
+ // intentionally absent. The indirection keeps this a pure runtime lookup.
93
+ const moduleName = 'react-native-css-interop';
82
94
  // eslint-disable-next-line @typescript-eslint/no-require-imports
83
- mod = require('react-native-css-interop') as CssInteropModule;
95
+ mod = require(moduleName) as CssInteropModule;
84
96
  } catch {
85
97
  return;
86
98
  }