react-native-nano-icons 0.2.1 → 1.0.0-beta.2

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 (404) hide show
  1. package/LICENSES.md +40 -0
  2. package/README.md +165 -12
  3. package/android/build.gradle +8 -1
  4. package/android/src/main/java/com/nanoicons/NanoIconFonts.kt +31 -0
  5. package/android/src/main/java/com/nanoicons/NanoIconView.kt +103 -19
  6. package/android/src/main/java/com/nanoicons/NanoIconViewManager.kt +42 -18
  7. package/android/src/main/java/com/nanoicons/NanoIconsFontLoaderModule.kt +72 -11
  8. package/android/src/main/jni/CMakeLists.txt +38 -0
  9. package/android/src/main/jni/RNNanoIconsSpec.h +19 -0
  10. package/common/cpp/react/renderer/components/RNNanoIconsSpec/NanoIconViewComponentDescriptor.h +11 -0
  11. package/common/cpp/react/renderer/components/RNNanoIconsSpec/NanoIconViewShadowNode.cpp +46 -0
  12. package/common/cpp/react/renderer/components/RNNanoIconsSpec/NanoIconViewShadowNode.h +41 -0
  13. package/ios/NanoIconFontResolver.h +5 -0
  14. package/ios/NanoIconFontResolver.mm +32 -0
  15. package/ios/NanoIconInlineBaseline.h +4 -0
  16. package/ios/NanoIconInlineBaseline.mm +190 -0
  17. package/ios/NanoIconView.h +1 -4
  18. package/ios/NanoIconView.mm +178 -162
  19. package/ios/NanoIconsFontLoader.mm +10 -32
  20. package/lib/commonjs/cli/build.d.ts +16 -3
  21. package/lib/commonjs/cli/build.js +108 -25
  22. package/lib/commonjs/cli/buildSymbols.d.ts +26 -0
  23. package/lib/commonjs/cli/buildSymbols.js +134 -0
  24. package/lib/commonjs/cli/config.d.ts +4 -2
  25. package/lib/commonjs/cli/config.js +4 -4
  26. package/lib/commonjs/cli/expoConfig.d.ts +6 -2
  27. package/lib/commonjs/cli/expoConfig.js +37 -13
  28. package/lib/commonjs/cli/index.d.ts +7 -5
  29. package/lib/commonjs/cli/index.js +27 -14
  30. package/lib/commonjs/cli/link.d.ts +19 -3
  31. package/lib/commonjs/cli/link.js +311 -45
  32. package/lib/commonjs/cli/logger.js +9 -7
  33. package/lib/commonjs/metro/fontRebuildWatcher.d.ts +62 -0
  34. package/lib/commonjs/metro/fontRebuildWatcher.js +174 -0
  35. package/lib/commonjs/metro/index.d.ts +35 -0
  36. package/lib/commonjs/metro/index.js +92 -0
  37. package/lib/commonjs/metro/symbolRebuildWatcher.d.ts +19 -0
  38. package/lib/commonjs/metro/symbolRebuildWatcher.js +76 -0
  39. package/lib/commonjs/plugin/src/buildFonts.d.ts +3 -3
  40. package/lib/commonjs/plugin/src/buildFonts.js +5 -15
  41. package/lib/commonjs/plugin/src/buildSymbols.d.ts +3 -0
  42. package/lib/commonjs/plugin/src/buildSymbols.js +18 -0
  43. package/lib/commonjs/plugin/src/index.d.ts +2 -2
  44. package/lib/commonjs/plugin/src/index.js +10 -4
  45. package/lib/commonjs/plugin/src/types.d.ts +44 -3
  46. package/lib/commonjs/plugin/src/withNanoIconsDrawableLinking.d.ts +8 -0
  47. package/lib/commonjs/plugin/src/withNanoIconsDrawableLinking.js +29 -0
  48. package/lib/commonjs/plugin/src/withNanoIconsFontLinking.d.ts +1 -1
  49. package/lib/commonjs/plugin/src/withNanoIconsFontLinking.js +6 -13
  50. package/lib/commonjs/plugin/src/withNanoIconsSymbolLinking.d.ts +8 -0
  51. package/lib/commonjs/plugin/src/withNanoIconsSymbolLinking.js +37 -0
  52. package/lib/commonjs/scripts/cli.js +64 -23
  53. package/lib/commonjs/src/core/flatten/arcs.d.ts +2 -0
  54. package/lib/commonjs/src/core/flatten/arcs.js +136 -0
  55. package/lib/commonjs/src/core/flatten/document.d.ts +35 -0
  56. package/lib/commonjs/src/core/flatten/document.js +164 -0
  57. package/lib/commonjs/src/core/flatten/dom.d.ts +24 -0
  58. package/lib/commonjs/src/core/flatten/dom.js +221 -0
  59. package/lib/commonjs/src/core/flatten/element.d.ts +12 -0
  60. package/lib/commonjs/src/core/flatten/element.js +97 -0
  61. package/lib/commonjs/src/core/flatten/geometry.d.ts +21 -0
  62. package/lib/commonjs/src/core/flatten/geometry.js +85 -0
  63. package/lib/commonjs/src/core/flatten/index.d.ts +2 -0
  64. package/lib/commonjs/src/core/flatten/index.js +11 -0
  65. package/lib/commonjs/src/core/flatten/inherit.d.ts +13 -0
  66. package/lib/commonjs/src/core/flatten/inherit.js +249 -0
  67. package/lib/commonjs/src/core/flatten/path.d.ts +19 -0
  68. package/lib/commonjs/src/core/flatten/path.js +439 -0
  69. package/lib/commonjs/src/core/flatten/pathops.d.ts +14 -0
  70. package/lib/commonjs/src/core/flatten/pathops.js +236 -0
  71. package/lib/commonjs/src/core/flatten/shape.d.ts +29 -0
  72. package/lib/commonjs/src/core/flatten/shape.js +415 -0
  73. package/lib/commonjs/src/core/flatten/stages/clip-path.d.ts +4 -0
  74. package/lib/commonjs/src/core/flatten/stages/clip-path.js +20 -0
  75. package/lib/commonjs/src/core/flatten/stages/collapse.d.ts +2 -0
  76. package/lib/commonjs/src/core/flatten/stages/collapse.js +86 -0
  77. package/lib/commonjs/src/core/flatten/stages/defs.d.ts +4 -0
  78. package/lib/commonjs/src/core/flatten/stages/defs.js +49 -0
  79. package/lib/commonjs/src/core/flatten/stages/discard.d.ts +4 -0
  80. package/lib/commonjs/src/core/flatten/stages/discard.js +50 -0
  81. package/lib/commonjs/src/core/flatten/stages/fill-rule.d.ts +2 -0
  82. package/lib/commonjs/src/core/flatten/stages/fill-rule.js +7 -0
  83. package/lib/commonjs/src/core/flatten/stages/nested-svg.d.ts +2 -0
  84. package/lib/commonjs/src/core/flatten/stages/nested-svg.js +131 -0
  85. package/lib/commonjs/src/core/flatten/stages/opacity.d.ts +2 -0
  86. package/lib/commonjs/src/core/flatten/stages/opacity.js +7 -0
  87. package/lib/commonjs/src/core/flatten/stages/shapes.d.ts +7 -0
  88. package/lib/commonjs/src/core/flatten/stages/shapes.js +37 -0
  89. package/lib/commonjs/src/core/flatten/stages/stroke.d.ts +3 -0
  90. package/lib/commonjs/src/core/flatten/stages/stroke.js +34 -0
  91. package/lib/commonjs/src/core/flatten/stages/styles.d.ts +2 -0
  92. package/lib/commonjs/src/core/flatten/stages/styles.js +29 -0
  93. package/lib/commonjs/src/core/flatten/stages/use.d.ts +4 -0
  94. package/lib/commonjs/src/core/flatten/stages/use.js +80 -0
  95. package/lib/commonjs/src/core/flatten/stages/validate.d.ts +2 -0
  96. package/lib/commonjs/src/core/flatten/stages/validate.js +39 -0
  97. package/lib/commonjs/src/core/flatten/stages.d.ts +2 -0
  98. package/lib/commonjs/src/core/flatten/stages.js +40 -0
  99. package/lib/commonjs/src/core/flatten/transform.d.ts +35 -0
  100. package/lib/commonjs/src/core/flatten/transform.js +221 -0
  101. package/lib/commonjs/src/core/font/compile.d.ts +2 -1
  102. package/lib/commonjs/src/core/font/compile.js +19 -7
  103. package/lib/commonjs/src/core/font/metrics.js +7 -0
  104. package/lib/commonjs/src/core/font/quadratic.d.ts +2 -0
  105. package/lib/commonjs/src/core/font/quadratic.js +33 -0
  106. package/lib/commonjs/src/core/glyph/merge.d.ts +7 -0
  107. package/lib/commonjs/src/core/glyph/merge.js +59 -0
  108. package/lib/commonjs/src/core/glyph/parse.d.ts +27 -0
  109. package/lib/commonjs/src/core/{svg/svg_dom.js → glyph/parse.js} +21 -77
  110. package/lib/commonjs/src/core/{svg/layers.d.ts → glyph/placement.d.ts} +1 -13
  111. package/lib/commonjs/src/core/{svg/layers.js → glyph/placement.js} +0 -17
  112. package/lib/commonjs/src/core/glyph/validate.d.ts +8 -0
  113. package/lib/commonjs/src/core/glyph/validate.js +33 -0
  114. package/lib/commonjs/src/core/pathkit/contours.d.ts +75 -0
  115. package/lib/commonjs/src/core/{svg/svg_pathops.js → pathkit/contours.js} +79 -301
  116. package/lib/commonjs/src/core/pathkit/evenodd.d.ts +12 -0
  117. package/lib/commonjs/src/core/pathkit/evenodd.js +37 -0
  118. package/lib/commonjs/src/core/pathkit/load.d.ts +2 -0
  119. package/lib/commonjs/src/core/pathkit/load.js +26 -0
  120. package/lib/commonjs/src/core/pathkit/types.d.ts +69 -0
  121. package/lib/commonjs/src/core/pathkit/types.js +2 -0
  122. package/lib/commonjs/src/core/pathkit/winding.d.ts +4 -0
  123. package/lib/commonjs/src/core/pathkit/winding.js +59 -0
  124. package/lib/commonjs/src/core/pipeline/config.d.ts +2 -0
  125. package/lib/commonjs/src/core/pipeline/config.js +6 -0
  126. package/lib/commonjs/src/core/pipeline/iconPool.d.ts +14 -0
  127. package/lib/commonjs/src/core/pipeline/iconPool.js +109 -0
  128. package/lib/commonjs/src/core/pipeline/index.d.ts +5 -3
  129. package/lib/commonjs/src/core/pipeline/index.js +8 -5
  130. package/lib/commonjs/src/core/pipeline/prepare.d.ts +20 -0
  131. package/lib/commonjs/src/core/pipeline/prepare.js +74 -0
  132. package/lib/commonjs/src/core/pipeline/prepareIcon.d.ts +25 -0
  133. package/lib/commonjs/src/core/pipeline/prepareIcon.js +81 -0
  134. package/lib/commonjs/src/core/pipeline/prepareSvg.d.ts +6 -0
  135. package/lib/commonjs/src/core/pipeline/prepareSvg.js +11 -0
  136. package/lib/commonjs/src/core/pipeline/prepareSymbol.d.ts +26 -0
  137. package/lib/commonjs/src/core/pipeline/prepareSymbol.js +79 -0
  138. package/lib/commonjs/src/core/pipeline/prepareWorker.d.ts +1 -0
  139. package/lib/commonjs/src/core/pipeline/prepareWorker.js +12 -0
  140. package/lib/commonjs/src/core/pipeline/preparedSvgCache.d.ts +6 -0
  141. package/lib/commonjs/src/core/pipeline/preparedSvgCache.js +44 -0
  142. package/lib/commonjs/src/core/pipeline/runFontPipeline.d.ts +22 -0
  143. package/lib/commonjs/src/core/pipeline/runFontPipeline.js +111 -0
  144. package/lib/commonjs/src/core/pipeline/runSymbolPipeline.d.ts +54 -0
  145. package/lib/commonjs/src/core/pipeline/runSymbolPipeline.js +161 -0
  146. package/lib/commonjs/src/core/symbols/contents.d.ts +2 -0
  147. package/lib/commonjs/src/core/symbols/contents.js +15 -0
  148. package/lib/commonjs/src/core/symbols/knockout.d.ts +3 -0
  149. package/lib/commonjs/src/core/symbols/knockout.js +51 -0
  150. package/lib/commonjs/src/core/symbols/layers.d.ts +36 -0
  151. package/lib/commonjs/src/core/symbols/layers.js +182 -0
  152. package/lib/commonjs/src/core/symbols/template.d.ts +22 -0
  153. package/lib/commonjs/src/core/symbols/template.js +140 -0
  154. package/lib/commonjs/src/core/symbols/vectorDrawable.d.ts +11 -0
  155. package/lib/commonjs/src/core/symbols/vectorDrawable.js +66 -0
  156. package/lib/commonjs/src/core/types.d.ts +3 -92
  157. package/lib/commonjs/src/utils/fingerPrint.d.ts +19 -1
  158. package/lib/commonjs/src/utils/fingerPrint.js +29 -3
  159. package/lib/commonjs/src/utils/fontIdentity.d.ts +4 -0
  160. package/lib/commonjs/src/utils/fontIdentity.js +24 -0
  161. package/lib/commonjs/src/utils/naming.d.ts +10 -0
  162. package/lib/commonjs/src/utils/naming.js +49 -0
  163. package/lib/commonjs/src/utils/packageVersion.d.ts +2 -0
  164. package/lib/commonjs/src/utils/packageVersion.js +37 -0
  165. package/lib/commonjs/src/utils/parse.d.ts +0 -1
  166. package/lib/commonjs/src/utils/parse.js +0 -8
  167. package/lib/commonjs/src/utils/svgPatterns.d.ts +38 -0
  168. package/lib/commonjs/src/utils/svgPatterns.js +46 -0
  169. package/lib/module/const/codegenPrimitives.js +1 -2
  170. package/lib/module/const/colors.js +1 -2
  171. package/lib/module/createNanoIconsSet.js +1 -2
  172. package/lib/module/createNanoIconsSet.native.js +38 -28
  173. package/lib/module/createNanoIconsSet.shared.js +15 -9
  174. package/lib/module/createNanoIconsSet.web.js +22 -8
  175. package/lib/module/devServerFont.js +30 -0
  176. package/lib/module/devServerFont.web.js +25 -0
  177. package/lib/module/fontIntegrity.js +99 -0
  178. package/lib/module/index.js +1 -1
  179. package/lib/module/index.node.js +1 -2
  180. package/lib/module/loadDynamicFont.js +20 -10
  181. package/lib/module/nativeFontLoader.js +3 -0
  182. package/lib/module/nativeFontLoader.web.js +3 -0
  183. package/lib/module/specs/NanoIconViewNativeComponent.ts +9 -6
  184. package/lib/module/specs/NativeNanoIconsFontLoader.js +1 -2
  185. package/lib/module/symbols/index.android.js +42 -0
  186. package/lib/module/symbols/index.ios.js +35 -0
  187. package/lib/module/symbols/index.js +35 -0
  188. package/lib/module/symbols/index.native.js +12 -0
  189. package/lib/module/symbols/types.js +1 -0
  190. package/lib/module/types.js +1 -2
  191. package/lib/module/utils/fingerPrint.js +20 -5
  192. package/lib/module/utils/fontIdentity.js +20 -0
  193. package/lib/module/utils/glyphRuntime.js +36 -3
  194. package/lib/module/utils/naming.js +46 -0
  195. package/lib/module/utils/packageVersion.js +29 -0
  196. package/lib/module/utils/parse.js +1 -9
  197. package/lib/module/utils/runtimeLog.js +12 -0
  198. package/lib/module/utils/shallowEqualColor.js +1 -2
  199. package/lib/module/utils/svgPatterns.js +49 -0
  200. package/lib/module/utils/validateLayerColor.js +24 -0
  201. package/lib/typescript/src/core/flatten/arcs.d.ts +3 -0
  202. package/lib/typescript/src/core/flatten/document.d.ts +36 -0
  203. package/lib/typescript/src/core/flatten/dom.d.ts +25 -0
  204. package/lib/typescript/src/core/flatten/element.d.ts +13 -0
  205. package/lib/typescript/src/core/flatten/geometry.d.ts +22 -0
  206. package/lib/typescript/src/core/flatten/index.d.ts +3 -0
  207. package/lib/typescript/src/core/flatten/inherit.d.ts +14 -0
  208. package/lib/typescript/src/core/flatten/path.d.ts +20 -0
  209. package/lib/typescript/src/core/flatten/pathops.d.ts +15 -0
  210. package/lib/typescript/src/core/flatten/shape.d.ts +30 -0
  211. package/lib/typescript/src/core/flatten/stages/clip-path.d.ts +5 -0
  212. package/lib/typescript/src/core/flatten/stages/collapse.d.ts +3 -0
  213. package/lib/typescript/src/core/flatten/stages/defs.d.ts +5 -0
  214. package/lib/typescript/src/core/flatten/stages/discard.d.ts +5 -0
  215. package/lib/typescript/src/core/flatten/stages/fill-rule.d.ts +3 -0
  216. package/lib/typescript/src/core/flatten/stages/nested-svg.d.ts +3 -0
  217. package/lib/typescript/src/core/flatten/stages/opacity.d.ts +3 -0
  218. package/lib/typescript/src/core/flatten/stages/shapes.d.ts +8 -0
  219. package/lib/typescript/src/core/flatten/stages/stroke.d.ts +4 -0
  220. package/lib/typescript/src/core/flatten/stages/styles.d.ts +3 -0
  221. package/lib/typescript/src/core/flatten/stages/use.d.ts +5 -0
  222. package/lib/typescript/src/core/flatten/stages/validate.d.ts +3 -0
  223. package/lib/typescript/src/core/flatten/stages.d.ts +3 -0
  224. package/lib/typescript/src/core/flatten/transform.d.ts +36 -0
  225. package/lib/typescript/src/core/glyph/merge.d.ts +8 -0
  226. package/lib/typescript/src/core/glyph/parse.d.ts +28 -0
  227. package/lib/typescript/src/core/{svg/layers.d.ts → glyph/placement.d.ts} +2 -14
  228. package/lib/typescript/src/core/glyph/validate.d.ts +9 -0
  229. package/lib/typescript/src/core/pathkit/contours.d.ts +76 -0
  230. package/lib/typescript/src/core/pathkit/evenodd.d.ts +13 -0
  231. package/lib/typescript/src/core/pathkit/load.d.ts +3 -0
  232. package/lib/typescript/src/core/pathkit/types.d.ts +70 -0
  233. package/lib/typescript/src/core/pathkit/winding.d.ts +5 -0
  234. package/lib/typescript/src/core/symbols/contents.d.ts +3 -0
  235. package/lib/typescript/src/core/symbols/knockout.d.ts +4 -0
  236. package/lib/typescript/src/core/symbols/layers.d.ts +37 -0
  237. package/lib/typescript/src/core/symbols/template.d.ts +23 -0
  238. package/lib/typescript/src/core/symbols/vectorDrawable.d.ts +12 -0
  239. package/lib/typescript/src/core/types.d.ts +3 -92
  240. package/lib/typescript/src/devServerFont.d.ts +4 -0
  241. package/lib/typescript/src/devServerFont.web.d.ts +4 -0
  242. package/lib/typescript/src/fontIntegrity.d.ts +24 -0
  243. package/lib/typescript/src/index.d.ts +1 -0
  244. package/lib/typescript/src/loadDynamicFont.d.ts +1 -0
  245. package/lib/typescript/src/nativeFontLoader.d.ts +2 -0
  246. package/lib/typescript/src/nativeFontLoader.web.d.ts +3 -0
  247. package/lib/typescript/src/specs/NanoIconViewNativeComponent.d.ts +6 -5
  248. package/lib/typescript/src/specs/NativeNanoIconsFontLoader.d.ts +1 -0
  249. package/lib/typescript/src/symbols/index.android.d.ts +33 -0
  250. package/lib/typescript/src/symbols/index.d.ts +31 -0
  251. package/lib/typescript/src/symbols/index.ios.d.ts +31 -0
  252. package/lib/typescript/src/symbols/index.native.d.ts +8 -0
  253. package/lib/typescript/src/symbols/types.d.ts +24 -0
  254. package/lib/typescript/src/types.d.ts +7 -0
  255. package/lib/typescript/src/utils/fingerPrint.d.ts +19 -1
  256. package/lib/typescript/src/utils/fontIdentity.d.ts +5 -0
  257. package/lib/typescript/src/utils/glyphRuntime.d.ts +3 -1
  258. package/lib/typescript/src/utils/naming.d.ts +11 -0
  259. package/lib/typescript/src/utils/packageVersion.d.ts +3 -0
  260. package/lib/typescript/src/utils/parse.d.ts +0 -1
  261. package/lib/typescript/src/utils/runtimeLog.d.ts +5 -0
  262. package/lib/typescript/src/utils/svgPatterns.d.ts +39 -0
  263. package/lib/typescript/src/utils/validateLayerColor.d.ts +3 -0
  264. package/metro.js +1 -0
  265. package/package.json +37 -11
  266. package/react-native-nano-icons.podspec +4 -1
  267. package/react-native.config.js +10 -0
  268. package/src/specs/NanoIconViewNativeComponent.ts +9 -6
  269. package/src/specs/NativeNanoIconsFontLoader.ts +1 -0
  270. package/lib/commonjs/src/core/pipeline/managers.d.ts +0 -11
  271. package/lib/commonjs/src/core/pipeline/managers.js +0 -104
  272. package/lib/commonjs/src/core/pipeline/run.d.ts +0 -14
  273. package/lib/commonjs/src/core/pipeline/run.js +0 -189
  274. package/lib/commonjs/src/core/svg/svg_dom.d.ts +0 -51
  275. package/lib/commonjs/src/core/svg/svg_pathops.d.ts +0 -32
  276. package/lib/module/const/codegenPrimitives.js.map +0 -1
  277. package/lib/module/const/colors.js.map +0 -1
  278. package/lib/module/core/font/compile.js +0 -81
  279. package/lib/module/core/font/compile.js.map +0 -1
  280. package/lib/module/core/font/metrics.js +0 -37
  281. package/lib/module/core/font/metrics.js.map +0 -1
  282. package/lib/module/core/pipeline/config.js +0 -20
  283. package/lib/module/core/pipeline/config.js.map +0 -1
  284. package/lib/module/core/pipeline/index.js +0 -5
  285. package/lib/module/core/pipeline/index.js.map +0 -1
  286. package/lib/module/core/pipeline/managers.js +0 -94
  287. package/lib/module/core/pipeline/managers.js.map +0 -1
  288. package/lib/module/core/pipeline/run.js +0 -204
  289. package/lib/module/core/pipeline/run.js.map +0 -1
  290. package/lib/module/core/shims/pathops.py +0 -181
  291. package/lib/module/core/shims/picosvg-0.22.3-py3-none-any.whl +0 -0
  292. package/lib/module/core/svg/layers.js +0 -85
  293. package/lib/module/core/svg/layers.js.map +0 -1
  294. package/lib/module/core/svg/svg_dom.js +0 -170
  295. package/lib/module/core/svg/svg_dom.js.map +0 -1
  296. package/lib/module/core/svg/svg_pathops.js +0 -750
  297. package/lib/module/core/svg/svg_pathops.js.map +0 -1
  298. package/lib/module/core/tsconfig.json +0 -32
  299. package/lib/module/core/types.js +0 -2
  300. package/lib/module/core/types.js.map +0 -1
  301. package/lib/module/createNanoIconsSet.js.map +0 -1
  302. package/lib/module/createNanoIconsSet.native.js.map +0 -1
  303. package/lib/module/createNanoIconsSet.shared.js.map +0 -1
  304. package/lib/module/createNanoIconsSet.web.js.map +0 -1
  305. package/lib/module/index.js.map +0 -1
  306. package/lib/module/index.node.js.map +0 -1
  307. package/lib/module/loadDynamicFont.js.map +0 -1
  308. package/lib/module/specs/NativeNanoIconsFontLoader.js.map +0 -1
  309. package/lib/module/types.js.map +0 -1
  310. package/lib/module/utils/fingerPrint.js.map +0 -1
  311. package/lib/module/utils/glyphRuntime.js.map +0 -1
  312. package/lib/module/utils/parse.js.map +0 -1
  313. package/lib/module/utils/shallowEqualColor.js.map +0 -1
  314. package/lib/typescript/__tests__/build.unit.test.d.ts +0 -3
  315. package/lib/typescript/__tests__/build.unit.test.d.ts.map +0 -1
  316. package/lib/typescript/__tests__/clippath.e2e.test.d.ts +0 -3
  317. package/lib/typescript/__tests__/clippath.e2e.test.d.ts.map +0 -1
  318. package/lib/typescript/__tests__/fingerprint.unit.test.d.ts +0 -3
  319. package/lib/typescript/__tests__/fingerprint.unit.test.d.ts.map +0 -1
  320. package/lib/typescript/__tests__/glyphRuntime.unit.test.d.ts +0 -2
  321. package/lib/typescript/__tests__/glyphRuntime.unit.test.d.ts.map +0 -1
  322. package/lib/typescript/__tests__/link.unit.test.d.ts +0 -3
  323. package/lib/typescript/__tests__/link.unit.test.d.ts.map +0 -1
  324. package/lib/typescript/__tests__/loadDynamicFont.unit.test.d.ts +0 -2
  325. package/lib/typescript/__tests__/loadDynamicFont.unit.test.d.ts.map +0 -1
  326. package/lib/typescript/__tests__/pipeline.e2e.test.d.ts +0 -3
  327. package/lib/typescript/__tests__/pipeline.e2e.test.d.ts.map +0 -1
  328. package/lib/typescript/__tests__/placement.unit.test.d.ts +0 -3
  329. package/lib/typescript/__tests__/placement.unit.test.d.ts.map +0 -1
  330. package/lib/typescript/__tests__/svg_dom.unit.test.d.ts +0 -3
  331. package/lib/typescript/__tests__/svg_dom.unit.test.d.ts.map +0 -1
  332. package/lib/typescript/cli/build.d.ts +0 -32
  333. package/lib/typescript/cli/build.d.ts.map +0 -1
  334. package/lib/typescript/cli/link.d.ts +0 -12
  335. package/lib/typescript/cli/link.d.ts.map +0 -1
  336. package/lib/typescript/cli/logger.d.ts +0 -28
  337. package/lib/typescript/cli/logger.d.ts.map +0 -1
  338. package/lib/typescript/src/const/codegenPrimitives.d.ts.map +0 -1
  339. package/lib/typescript/src/const/colors.d.ts.map +0 -1
  340. package/lib/typescript/src/core/font/compile.d.ts +0 -21
  341. package/lib/typescript/src/core/font/compile.d.ts.map +0 -1
  342. package/lib/typescript/src/core/font/metrics.d.ts +0 -2
  343. package/lib/typescript/src/core/font/metrics.d.ts.map +0 -1
  344. package/lib/typescript/src/core/pipeline/config.d.ts +0 -16
  345. package/lib/typescript/src/core/pipeline/config.d.ts.map +0 -1
  346. package/lib/typescript/src/core/pipeline/index.d.ts +0 -4
  347. package/lib/typescript/src/core/pipeline/index.d.ts.map +0 -1
  348. package/lib/typescript/src/core/pipeline/managers.d.ts +0 -12
  349. package/lib/typescript/src/core/pipeline/managers.d.ts.map +0 -1
  350. package/lib/typescript/src/core/pipeline/run.d.ts +0 -15
  351. package/lib/typescript/src/core/pipeline/run.d.ts.map +0 -1
  352. package/lib/typescript/src/core/svg/layers.d.ts.map +0 -1
  353. package/lib/typescript/src/core/svg/svg_dom.d.ts +0 -52
  354. package/lib/typescript/src/core/svg/svg_dom.d.ts.map +0 -1
  355. package/lib/typescript/src/core/svg/svg_pathops.d.ts +0 -33
  356. package/lib/typescript/src/core/svg/svg_pathops.d.ts.map +0 -1
  357. package/lib/typescript/src/core/types.d.ts.map +0 -1
  358. package/lib/typescript/src/createNanoIconsSet.d.ts.map +0 -1
  359. package/lib/typescript/src/createNanoIconsSet.native.d.ts.map +0 -1
  360. package/lib/typescript/src/createNanoIconsSet.shared.d.ts.map +0 -1
  361. package/lib/typescript/src/createNanoIconsSet.web.d.ts.map +0 -1
  362. package/lib/typescript/src/index.d.ts.map +0 -1
  363. package/lib/typescript/src/index.node.d.ts.map +0 -1
  364. package/lib/typescript/src/loadDynamicFont.d.ts.map +0 -1
  365. package/lib/typescript/src/specs/NanoIconViewNativeComponent.d.ts.map +0 -1
  366. package/lib/typescript/src/specs/NativeNanoIconsFontLoader.d.ts.map +0 -1
  367. package/lib/typescript/src/types.d.ts.map +0 -1
  368. package/lib/typescript/src/utils/fingerPrint.d.ts.map +0 -1
  369. package/lib/typescript/src/utils/glyphRuntime.d.ts.map +0 -1
  370. package/lib/typescript/src/utils/parse.d.ts.map +0 -1
  371. package/lib/typescript/src/utils/shallowEqualColor.d.ts.map +0 -1
  372. package/plugin/src/buildFonts.ts +0 -42
  373. package/plugin/src/index.ts +0 -21
  374. package/plugin/src/types.ts +0 -42
  375. package/plugin/src/withNanoIconsFontLinking.ts +0 -136
  376. package/plugin/tsconfig.json +0 -9
  377. package/scripts/cli.ts +0 -63
  378. package/scripts/tsconfig.json +0 -25
  379. package/src/const/colors.ts +0 -150
  380. package/src/core/font/compile.ts +0 -99
  381. package/src/core/font/metrics.ts +0 -44
  382. package/src/core/pipeline/config.ts +0 -25
  383. package/src/core/pipeline/index.ts +0 -3
  384. package/src/core/pipeline/managers.ts +0 -132
  385. package/src/core/pipeline/run.ts +0 -274
  386. package/src/core/shims/pathops.py +0 -181
  387. package/src/core/shims/picosvg-0.22.3-py3-none-any.whl +0 -0
  388. package/src/core/svg/layers.ts +0 -110
  389. package/src/core/svg/svg_dom.ts +0 -194
  390. package/src/core/svg/svg_pathops.ts +0 -1040
  391. package/src/core/tsconfig.json +0 -32
  392. package/src/core/types.ts +0 -157
  393. package/src/createNanoIconsSet.native.tsx +0 -192
  394. package/src/createNanoIconsSet.shared.tsx +0 -174
  395. package/src/createNanoIconsSet.tsx +0 -20
  396. package/src/createNanoIconsSet.web.tsx +0 -109
  397. package/src/index.node.ts +0 -14
  398. package/src/index.ts +0 -6
  399. package/src/loadDynamicFont.ts +0 -162
  400. package/src/types.ts +0 -31
  401. package/src/utils/fingerPrint.ts +0 -20
  402. package/src/utils/glyphRuntime.ts +0 -46
  403. package/src/utils/parse.ts +0 -67
  404. package/src/utils/shallowEqualColor.ts +0 -17
@@ -0,0 +1,35 @@
1
+ import type { IncomingMessage, ServerResponse } from 'node:http';
2
+ import { type IconSetConfig, type SymbolSetConfig } from '../cli/index';
3
+ import { type FileWatcher, type Next } from './fontRebuildWatcher';
4
+ export type { IconSetConfig, SymbolSetConfig };
5
+ export type Middleware = (req: IncomingMessage, res: ServerResponse, next: Next) => void;
6
+ export type MetroServerLike = {
7
+ getBundler(): {
8
+ getBundler(): {
9
+ getWatcher(): FileWatcher;
10
+ };
11
+ };
12
+ };
13
+ export type MetroConfigLike = {
14
+ projectRoot?: string;
15
+ watchFolders?: readonly string[];
16
+ server?: {
17
+ enhanceMiddleware?: (middleware: Middleware, server: MetroServerLike) => Middleware;
18
+ };
19
+ };
20
+ export type WithNanoIconsOptions = {
21
+ iconSets?: IconSetConfig[];
22
+ symbolSets?: SymbolSetConfig[];
23
+ projectRoot?: string;
24
+ };
25
+ export type WithNanoIcons<T extends MetroConfigLike> = T & {
26
+ server: NonNullable<T['server']> & {
27
+ enhanceMiddleware: (middleware: Middleware, server: MetroServerLike) => Middleware;
28
+ };
29
+ };
30
+ export declare function resolveIconSets(projectRoot: string): IconSetConfig[];
31
+ export declare function resolveSymbolSets(projectRoot: string): SymbolSetConfig[];
32
+ export declare function unwatchedIconSets<T extends {
33
+ inputDir: string;
34
+ }>(iconSets: T[], projectRoot: string, watchFolders: readonly string[]): T[];
35
+ export declare function withNanoIcons<T extends MetroConfigLike>(config: T, options?: WithNanoIconsOptions): WithNanoIcons<T>;
@@ -0,0 +1,92 @@
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ exports.resolveIconSets = resolveIconSets;
7
+ exports.resolveSymbolSets = resolveSymbolSets;
8
+ exports.unwatchedIconSets = unwatchedIconSets;
9
+ exports.withNanoIcons = withNanoIcons;
10
+ const node_fs_1 = __importDefault(require("node:fs"));
11
+ const node_path_1 = __importDefault(require("node:path"));
12
+ const index_1 = require("../cli/index");
13
+ const fontRebuildWatcher_1 = require("./fontRebuildWatcher");
14
+ const symbolRebuildWatcher_1 = require("./symbolRebuildWatcher");
15
+ function resolveIconSets(projectRoot) {
16
+ if (node_fs_1.default.existsSync(node_path_1.default.join(projectRoot, '.nanoicons.json'))) {
17
+ return (0, index_1.loadNanoIconsConfig)(projectRoot).iconSets ?? [];
18
+ }
19
+ return (0, index_1.loadIconSetsFromAppConfig)(projectRoot);
20
+ }
21
+ function resolveSymbolSets(projectRoot) {
22
+ if (node_fs_1.default.existsSync(node_path_1.default.join(projectRoot, '.nanoicons.json'))) {
23
+ return (0, index_1.loadNanoIconsConfig)(projectRoot).symbolSets ?? [];
24
+ }
25
+ return (0, index_1.loadSymbolSetsFromAppConfig)(projectRoot);
26
+ }
27
+ function bufferedLogger() {
28
+ const ready = (0, index_1.createQuietLogger)((0, index_1.detectExpoLogLevel)());
29
+ const verbose = (0, index_1.createQuietLogger)('verbose');
30
+ const call = (method) => (msg) => {
31
+ void ready.then((logger) => logger[method](msg));
32
+ };
33
+ return {
34
+ start: call('start'),
35
+ update: call('update'),
36
+ succeed: call('succeed'),
37
+ fail: call('fail'),
38
+ info: call('info'),
39
+ warn: call('warn'),
40
+ notify: (msg) => void verbose.then((logger) => logger.info(msg)),
41
+ };
42
+ }
43
+ function isInside(dir, root) {
44
+ const relative = node_path_1.default.relative(root, dir);
45
+ return !relative.startsWith('..') && !node_path_1.default.isAbsolute(relative);
46
+ }
47
+ function unwatchedIconSets(iconSets, projectRoot, watchFolders) {
48
+ const roots = [projectRoot, ...watchFolders];
49
+ return iconSets.filter((set) => {
50
+ const inputDir = node_path_1.default.resolve(projectRoot, set.inputDir);
51
+ return !roots.some((root) => isInside(inputDir, root));
52
+ });
53
+ }
54
+ function withNanoIcons(config, options) {
55
+ const projectRoot = options?.projectRoot ?? config.projectRoot ?? process.cwd();
56
+ const previous = config.server?.enhanceMiddleware;
57
+ const enhanceMiddleware = (middleware, server) => {
58
+ const enhanced = previous ? previous(middleware, server) : middleware;
59
+ if (process.env['NODE_ENV'] === 'production')
60
+ return enhanced;
61
+ const logger = bufferedLogger();
62
+ let iconSets;
63
+ let symbolSets;
64
+ try {
65
+ iconSets = options?.iconSets ?? resolveIconSets(projectRoot);
66
+ symbolSets =
67
+ options?.symbolSets ??
68
+ (options?.iconSets ? [] : resolveSymbolSets(projectRoot));
69
+ }
70
+ catch (err) {
71
+ logger.warn(`Icon hot reload is off: ${err instanceof Error ? err.message : String(err)}`);
72
+ return enhanced;
73
+ }
74
+ for (const set of unwatchedIconSets(iconSets, projectRoot, config.watchFolders ?? [])) {
75
+ logger.warn(`Icon set "${set.fontFamily ?? node_path_1.default.basename(set.inputDir)}": ${set.inputDir} is outside Metro's watch folders, so its svg changes will not trigger a rebuild. Add the folder to watchFolders in metro.config.js.`);
76
+ }
77
+ for (const set of unwatchedIconSets(symbolSets, projectRoot, config.watchFolders ?? [])) {
78
+ logger.warn(`Symbol set "${set.name ?? node_path_1.default.basename(set.inputDir)}": ${set.inputDir} is outside Metro's watch folders, so its svg changes will not trigger a rebuild. Add the folder to watchFolders in metro.config.js.`);
79
+ }
80
+ const watcher = server.getBundler().getBundler().getWatcher();
81
+ const svgWorkerPool = new index_1.SvgWorkerPool();
82
+ const fonts = new fontRebuildWatcher_1.FontRebuildWatcher(projectRoot, iconSets, watcher, logger, svgWorkerPool);
83
+ if (symbolSets.length) {
84
+ new symbolRebuildWatcher_1.SymbolRebuildWatcher(projectRoot, symbolSets, watcher, logger, svgWorkerPool);
85
+ }
86
+ return (req, res, next) => fonts.middleware(req, res, () => enhanced(req, res, next));
87
+ };
88
+ return {
89
+ ...config,
90
+ server: { ...config.server, enhanceMiddleware },
91
+ };
92
+ }
@@ -0,0 +1,19 @@
1
+ import { type SvgWorkerPool, type SymbolSetConfig } from '../cli/index';
2
+ import { type DevLogger, type FileWatcher } from './fontRebuildWatcher';
3
+ export declare class SymbolRebuildWatcher {
4
+ private readonly projectRoot;
5
+ private readonly symbolSets;
6
+ private readonly logger;
7
+ private readonly svgWorkerPool;
8
+ private readonly inputDirs;
9
+ private readonly preparedSvgCache;
10
+ private changes;
11
+ private pending;
12
+ private timer;
13
+ private settleMs;
14
+ constructor(projectRoot: string, symbolSets: SymbolSetConfig[], watcher: FileWatcher, logger: DevLogger, svgWorkerPool: SvgWorkerPool);
15
+ get build(): Promise<void>;
16
+ private onChange;
17
+ private flush;
18
+ private rebuild;
19
+ }
@@ -0,0 +1,76 @@
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ exports.SymbolRebuildWatcher = void 0;
7
+ const node_path_1 = __importDefault(require("node:path"));
8
+ const index_1 = require("../cli/index");
9
+ const fontRebuildWatcher_1 = require("./fontRebuildWatcher");
10
+ class SymbolRebuildWatcher {
11
+ projectRoot;
12
+ symbolSets;
13
+ logger;
14
+ svgWorkerPool;
15
+ inputDirs;
16
+ preparedSvgCache = new Map();
17
+ changes = [];
18
+ pending = Promise.resolve();
19
+ timer;
20
+ settleMs = fontRebuildWatcher_1.REBUILD_DEBOUNCE_MS;
21
+ constructor(projectRoot, symbolSets, watcher, logger, svgWorkerPool) {
22
+ this.projectRoot = projectRoot;
23
+ this.symbolSets = symbolSets;
24
+ this.logger = logger;
25
+ this.svgWorkerPool = svgWorkerPool;
26
+ this.inputDirs = new Set(symbolSets.map((set) => node_path_1.default.resolve(projectRoot, set.inputDir)));
27
+ watcher.on('change', (change) => this.onChange((0, fontRebuildWatcher_1.toWatchEvents)(change)));
28
+ }
29
+ get build() {
30
+ return this.pending;
31
+ }
32
+ onChange(events) {
33
+ for (const event of events) {
34
+ if (!event.filePath.toLowerCase().endsWith('.svg'))
35
+ continue;
36
+ if (!this.inputDirs.has(node_path_1.default.dirname(event.filePath)))
37
+ continue;
38
+ if (event.type === 'add')
39
+ this.settleMs = fontRebuildWatcher_1.ADDED_FILES_SETTLE_MS;
40
+ this.changes.push(`${node_path_1.default.basename(event.filePath)} ${fontRebuildWatcher_1.CHANGE_LABEL[event.type]}`);
41
+ if (this.timer)
42
+ clearTimeout(this.timer);
43
+ this.timer = setTimeout(() => this.flush(), this.settleMs);
44
+ }
45
+ }
46
+ flush() {
47
+ this.timer = undefined;
48
+ this.settleMs = fontRebuildWatcher_1.REBUILD_DEBOUNCE_MS;
49
+ const changes = this.changes.splice(0);
50
+ this.pending = this.pending.then(() => this.rebuild(changes));
51
+ }
52
+ async rebuild(changes) {
53
+ this.logger.notify(`Symbols: ${(0, fontRebuildWatcher_1.summarize)(changes)}, rebuilding…`);
54
+ try {
55
+ const built = await (0, index_1.buildAllSymbols)(this.symbolSets, this.projectRoot, {
56
+ logger: this.logger,
57
+ keepOutputsOnFailure: true,
58
+ preparedSvgCache: this.preparedSvgCache,
59
+ svgWorkerPool: this.svgWorkerPool,
60
+ });
61
+ await (0, index_1.linkBareSymbols)(this.projectRoot, built, this.logger);
62
+ await (0, index_1.linkBareAndroidDrawables)(this.projectRoot, built, this.logger);
63
+ this.logger.warn('Native symbols changed. Rebuild the native app to see them.');
64
+ }
65
+ catch (err) {
66
+ const message = err instanceof Error ? err.message : String(err);
67
+ if (err instanceof index_1.SymbolSetBuildError) {
68
+ this.logger.warn(`${message}. Native symbols were not relinked.`);
69
+ }
70
+ else {
71
+ this.logger.fail(message);
72
+ }
73
+ }
74
+ }
75
+ }
76
+ exports.SymbolRebuildWatcher = SymbolRebuildWatcher;
@@ -1,8 +1,8 @@
1
- import type { IconSetConfig, BuiltFont } from './types.js';
1
+ import type { IconSetConfig, BuiltFont } from './types';
2
2
  /**
3
3
  * Build TTF + glyphmap for all icon sets.
4
- * Shows an ora spinner per font set; catches errors and displays a friendly message
5
- * unless EXPO_DEBUG is set, in which case the full error is re-thrown.
4
+ * Reports every broken icon, then fails the prebuild so no set is silently left unlinked.
5
+ * EXPO_DEBUG adds the per-file processing details.
6
6
  */
7
7
  export declare function buildAllFonts(iconSets: IconSetConfig[], projectRoot: string): Promise<BuiltFont[]>;
8
8
  export declare function getOrBuildFonts(projectRoot: string, iconSets: IconSetConfig[]): Promise<BuiltFont[]>;
@@ -2,25 +2,15 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.buildAllFonts = buildAllFonts;
4
4
  exports.getOrBuildFonts = getOrBuildFonts;
5
- const index_js_1 = require("../../cli/index.js");
5
+ const index_1 = require("../../cli/index");
6
6
  /**
7
7
  * Build TTF + glyphmap for all icon sets.
8
- * Shows an ora spinner per font set; catches errors and displays a friendly message
9
- * unless EXPO_DEBUG is set, in which case the full error is re-thrown.
8
+ * Reports every broken icon, then fails the prebuild so no set is silently left unlinked.
9
+ * EXPO_DEBUG adds the per-file processing details.
10
10
  */
11
11
  async function buildAllFonts(iconSets, projectRoot) {
12
- const level = (0, index_js_1.detectExpoLogLevel)();
13
- const logger = await (0, index_js_1.createQuietLogger)(level);
14
- try {
15
- return await (0, index_js_1.buildAllFonts)(iconSets, projectRoot, { logger });
16
- }
17
- catch (err) {
18
- if (level === 'verbose') {
19
- throw err;
20
- }
21
- logger.fail('Error optimizing icons. Run with EXPO_DEBUG=1 for more logs.');
22
- return [];
23
- }
12
+ const logger = await (0, index_1.createQuietLogger)((0, index_1.detectExpoLogLevel)());
13
+ return (0, index_1.buildAllFonts)(iconSets, projectRoot, { logger });
24
14
  }
25
15
  // Single build run per process; reused across ios/android mods.
26
16
  let _buildPromise = null;
@@ -0,0 +1,3 @@
1
+ import type { SymbolSetConfig, BuiltSymbolSet } from './types';
2
+ export declare function buildAllSymbols(symbolSets: SymbolSetConfig[], projectRoot: string): Promise<BuiltSymbolSet[]>;
3
+ export declare function getOrBuildSymbols(projectRoot: string, symbolSets: SymbolSetConfig[]): Promise<BuiltSymbolSet[]>;
@@ -0,0 +1,18 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.buildAllSymbols = buildAllSymbols;
4
+ exports.getOrBuildSymbols = getOrBuildSymbols;
5
+ const index_1 = require("../../cli/index");
6
+ // Build all symbol sets.
7
+ async function buildAllSymbols(symbolSets, projectRoot) {
8
+ const logger = await (0, index_1.createQuietLogger)((0, index_1.detectExpoLogLevel)());
9
+ return (0, index_1.buildAllSymbols)(symbolSets, projectRoot, { logger });
10
+ }
11
+ // Single build run per process; reused across mods.
12
+ let _buildPromise = null;
13
+ function getOrBuildSymbols(projectRoot, symbolSets) {
14
+ if (!_buildPromise) {
15
+ _buildPromise = buildAllSymbols(symbolSets, projectRoot);
16
+ }
17
+ return _buildPromise;
18
+ }
@@ -1,5 +1,5 @@
1
1
  import type { ConfigPlugin } from '@expo/config-plugins';
2
- import type { NanoIconsPluginOptions } from './types.js';
2
+ import type { NanoIconsPluginOptions } from './types';
3
3
  declare const withNanoIcons: ConfigPlugin<NanoIconsPluginOptions>;
4
4
  export default withNanoIcons;
5
- export type { NanoIconsPluginOptions, IconSetConfig, BuiltFont, } from './types.js';
5
+ export type { NanoIconsPluginOptions, IconSetConfig, SymbolSetConfig, BuiltFont, BuiltSymbolSet, } from './types';
@@ -1,10 +1,16 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- const withNanoIconsFontLinking_js_1 = require("./withNanoIconsFontLinking.js");
3
+ const withNanoIconsFontLinking_1 = require("./withNanoIconsFontLinking");
4
+ const withNanoIconsSymbolLinking_1 = require("./withNanoIconsSymbolLinking");
5
+ const withNanoIconsDrawableLinking_1 = require("./withNanoIconsDrawableLinking");
4
6
  const withNanoIcons = (config, options) => {
5
- if (!options?.iconSets?.length)
6
- return config;
7
- config = (0, withNanoIconsFontLinking_js_1.withNanoIconsFontLinking)(config, options.iconSets);
7
+ if (options?.iconSets?.length) {
8
+ config = (0, withNanoIconsFontLinking_1.withNanoIconsFontLinking)(config, options.iconSets);
9
+ }
10
+ if (options?.symbolSets?.length) {
11
+ config = (0, withNanoIconsSymbolLinking_1.withNanoIconsSymbolLinking)(config, options.symbolSets);
12
+ config = (0, withNanoIconsDrawableLinking_1.withNanoIconsDrawableLinking)(config, options.symbolSets);
13
+ }
8
14
  return config;
9
15
  };
10
16
  exports.default = withNanoIcons;
@@ -10,7 +10,7 @@ export interface IconSetConfig {
10
10
  outputDir?: string;
11
11
  /** Units per em (default 1024). */
12
12
  upm?: number;
13
- /** Safe zone inside UPM for glyphs (default 1020). */
13
+ /** Safe zone inside UPM for glyphs (default upm * 1020 / 1024, i.e. 1020 at the default upm). Must not exceed upm. */
14
14
  safeZone?: number;
15
15
  /** First Unicode codepoint for glyphs (default 0xe900). Hex string or number. */
16
16
  startUnicode?: number | string;
@@ -22,19 +22,60 @@ export interface IconSetConfig {
22
22
  * delivering it (e.g. via OTA) and registering it under the same font family name.
23
23
  */
24
24
  linking?: 'static' | 'dynamic';
25
+ /**
26
+ * Also emit `<fontFamily>.woff2` into `outputDir` for web. Defaults to `false`.
27
+ *
28
+ * The file is rebuilt together with the TTF on every change and is never linked
29
+ * natively; the host app links it like any other web font, under `fontFamily`.
30
+ */
31
+ web?: boolean;
25
32
  }
26
33
  /**
27
- * plugins: [ [ "react-native-nano-icons", { iconSets: [...] } ] ]
34
+ * Config for one symbol set: input SVGs → `.symbolset`, linked into the iOS
35
+ * asset catalog for `UIImage(named:)`.
28
36
  */
37
+ export interface SymbolSetConfig {
38
+ /** Folder of SVG files (relative to project root). */
39
+ inputDir: string;
40
+ /** Set name; defaults to the inputDir basename. */
41
+ name?: string;
42
+ /** Symbol name prefix (default "nano"): home.svg → "nano.home". */
43
+ prefix?: string;
44
+ /** Output dir; defaults to a sibling nanoicons folder next to inputDir. */
45
+ outputDir?: string;
46
+ }
47
+ /** Result of building one symbol set. */
48
+ export interface BuiltSymbolSet {
49
+ name: string;
50
+ prefix: string;
51
+ /** Directory containing the generated asset folders. */
52
+ symbolsDir: string;
53
+ /** The generated `.symbolset` folders. */
54
+ assetDirs: string[];
55
+ /** Directory containing the generated Android VectorDrawable `.xml` files. */
56
+ drawablesDir: string;
57
+ /** The generated VectorDrawable `.xml` file paths. */
58
+ drawableFiles: string[];
59
+ /** The generated types-only `.d.ts` (icon-name + iOS-symbol-name unions). */
60
+ dtsPath: string;
61
+ symbolmapPath: string;
62
+ symbols: Record<string, string>;
63
+ /** Icon → Android drawable resource name (e.g. "home" → "nano_home"). */
64
+ drawables: Record<string, string>;
65
+ }
66
+ /** plugins: [ [ "react-native-nano-icons", { iconSets: [...], symbolSets: [...] } ] ] */
29
67
  export interface NanoIconsPluginOptions {
30
- iconSets: IconSetConfig[];
68
+ iconSets?: IconSetConfig[];
69
+ symbolSets?: SymbolSetConfig[];
31
70
  }
32
71
  /**
33
72
  * Result of building one icon set.
34
73
  */
35
74
  export interface BuiltFont {
36
75
  fontFamily: string;
76
+ family: string;
37
77
  ttfPath: string;
38
78
  glyphmapPath: string;
39
79
  linking: 'static' | 'dynamic';
80
+ woff2Path?: string;
40
81
  }
@@ -0,0 +1,8 @@
1
+ import { withDangerousMod } from '@expo/config-plugins';
2
+ import type { SymbolSetConfig } from './types';
3
+ /**
4
+ * Copy generated VectorDrawables into the Android app's res/drawable. AGP
5
+ * compiles them automatically and they resolve by name — the native-tab-bar
6
+ * counterpart to the iOS asset catalog, so no gradle changes are needed.
7
+ */
8
+ export declare function withNanoIconsDrawableLinking(config: Parameters<typeof withDangerousMod>[0], symbolSets: SymbolSetConfig[]): ReturnType<typeof withDangerousMod>;
@@ -0,0 +1,29 @@
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ exports.withNanoIconsDrawableLinking = withNanoIconsDrawableLinking;
7
+ const config_plugins_1 = require("@expo/config-plugins");
8
+ const path_1 = __importDefault(require("path"));
9
+ const index_1 = require("../../cli/index");
10
+ const buildSymbols_1 = require("./buildSymbols");
11
+ const ANDROID_DRAWABLES_DIR = 'app/src/main/res/drawable';
12
+ /**
13
+ * Copy generated VectorDrawables into the Android app's res/drawable. AGP
14
+ * compiles them automatically and they resolve by name — the native-tab-bar
15
+ * counterpart to the iOS asset catalog, so no gradle changes are needed.
16
+ */
17
+ function withNanoIconsDrawableLinking(config, symbolSets) {
18
+ return (0, config_plugins_1.withDangerousMod)(config, [
19
+ 'android',
20
+ async (config) => {
21
+ const built = await (0, buildSymbols_1.getOrBuildSymbols)(config.modRequest.projectRoot, symbolSets);
22
+ if (!built?.length)
23
+ return config;
24
+ const drawableDir = path_1.default.join(config.modRequest.platformProjectRoot, ANDROID_DRAWABLES_DIR);
25
+ (0, index_1.copyDrawablesIntoResDir)(drawableDir, built);
26
+ return config;
27
+ },
28
+ ]);
29
+ }
@@ -1,5 +1,5 @@
1
1
  import { withXcodeProject, withDangerousMod } from '@expo/config-plugins';
2
- import type { IconSetConfig } from './types.js';
2
+ import type { IconSetConfig } from './types';
3
3
  /**
4
4
  * Add TTFs to the iOS project (Resources group + UIAppFonts in Info.plist).
5
5
  *
@@ -9,7 +9,8 @@ exports.withNanoIconsFontLinking = withNanoIconsFontLinking;
9
9
  const config_plugins_1 = require("@expo/config-plugins");
10
10
  const promises_1 = __importDefault(require("fs/promises"));
11
11
  const path_1 = __importDefault(require("path"));
12
- const buildFonts_js_1 = require("./buildFonts.js");
12
+ const buildFonts_1 = require("./buildFonts");
13
+ const index_1 = require("../../cli/index");
13
14
  const ANDROID_ASSETS_FONTS_DIR = 'app/src/main/assets/fonts';
14
15
  const IOS_FONTS_GROUP = 'Resources';
15
16
  /**
@@ -22,7 +23,7 @@ const IOS_FONTS_GROUP = 'Resources';
22
23
  */
23
24
  function withNanoIconsIos(config, iconSets) {
24
25
  config = (0, config_plugins_1.withXcodeProject)(config, async (config) => {
25
- const built = await (0, buildFonts_js_1.getOrBuildFonts)(config.modRequest.projectRoot, iconSets);
26
+ const built = await (0, buildFonts_1.getOrBuildFonts)(config.modRequest.projectRoot, iconSets);
26
27
  const bundled = built?.filter((b) => b.linking !== 'dynamic') ?? [];
27
28
  if (!bundled.length)
28
29
  return config;
@@ -48,7 +49,7 @@ function withNanoIconsIos(config, iconSets) {
48
49
  return config;
49
50
  });
50
51
  config = (0, config_plugins_1.withInfoPlist)(config, async (config) => {
51
- const built = await (0, buildFonts_js_1.getOrBuildFonts)(config.modRequest.projectRoot, iconSets);
52
+ const built = await (0, buildFonts_1.getOrBuildFonts)(config.modRequest.projectRoot, iconSets);
52
53
  const bundled = built?.filter((b) => b.linking !== 'dynamic') ?? [];
53
54
  if (!bundled.length)
54
55
  return config;
@@ -77,17 +78,9 @@ function withNanoIconsAndroid(config, iconSets) {
77
78
  return (0, config_plugins_1.withDangerousMod)(config, [
78
79
  'android',
79
80
  async (config) => {
80
- const built = await (0, buildFonts_js_1.getOrBuildFonts)(config.modRequest.projectRoot, iconSets);
81
+ const built = await (0, buildFonts_1.getOrBuildFonts)(config.modRequest.projectRoot, iconSets);
81
82
  const bundled = built?.filter((b) => b.linking !== 'dynamic') ?? [];
82
- if (!bundled.length)
83
- return config;
84
- const fontsDir = path_1.default.join(config.modRequest.platformProjectRoot, ANDROID_ASSETS_FONTS_DIR);
85
- await promises_1.default.mkdir(fontsDir, { recursive: true });
86
- for (const b of bundled) {
87
- const filename = path_1.default.basename(b.ttfPath);
88
- const dest = path_1.default.join(fontsDir, filename);
89
- await promises_1.default.copyFile(b.ttfPath, dest);
90
- }
83
+ (0, index_1.syncAndroidFontAssets)(path_1.default.join(config.modRequest.platformProjectRoot, ANDROID_ASSETS_FONTS_DIR), bundled, built?.map((b) => b.fontFamily) ?? []);
91
84
  return config;
92
85
  },
93
86
  ]);
@@ -0,0 +1,8 @@
1
+ import { withDangerousMod } from '@expo/config-plugins';
2
+ import type { SymbolSetConfig } from './types';
3
+ /**
4
+ * Write generated assets into the app's existing ios/<projectName>/Images.xcassets.
5
+ * The Expo prebuild template creates and links that catalog, so no pbxproj
6
+ * changes are needed — actool compiles them and they load by name.
7
+ */
8
+ export declare function withNanoIconsSymbolLinking(config: Parameters<typeof withDangerousMod>[0], symbolSets: SymbolSetConfig[]): ReturnType<typeof withDangerousMod>;
@@ -0,0 +1,37 @@
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ exports.withNanoIconsSymbolLinking = withNanoIconsSymbolLinking;
7
+ const config_plugins_1 = require("@expo/config-plugins");
8
+ const fs_1 = __importDefault(require("fs"));
9
+ const path_1 = __importDefault(require("path"));
10
+ const index_1 = require("../../cli/index");
11
+ const buildSymbols_1 = require("./buildSymbols");
12
+ /**
13
+ * Write generated assets into the app's existing ios/<projectName>/Images.xcassets.
14
+ * The Expo prebuild template creates and links that catalog, so no pbxproj
15
+ * changes are needed — actool compiles them and they load by name.
16
+ */
17
+ function withNanoIconsSymbolLinking(config, symbolSets) {
18
+ return (0, config_plugins_1.withDangerousMod)(config, [
19
+ 'ios',
20
+ async (config) => {
21
+ const built = await (0, buildSymbols_1.getOrBuildSymbols)(config.modRequest.projectRoot, symbolSets);
22
+ if (!built?.length)
23
+ return config;
24
+ const projectName = config.modRequest.projectName;
25
+ if (!projectName)
26
+ return config;
27
+ const imagesCatalog = path_1.default.join(config.modRequest.platformProjectRoot, projectName, 'Images.xcassets');
28
+ if (!fs_1.default.existsSync(imagesCatalog)) {
29
+ console.warn(`[react-native-nano-icons] ${projectName}/Images.xcassets not found — skipping symbol linking. ` +
30
+ `Run "expo prebuild" first so the catalog exists.`);
31
+ return config;
32
+ }
33
+ (0, index_1.copySymbolsetsIntoCatalog)(imagesCatalog, built);
34
+ return config;
35
+ },
36
+ ]);
37
+ }