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,24 @@
1
+ "use strict";
2
+
3
+ import { processColor } from 'react-native';
4
+ import { errorRuntime } from "./runtimeLog.js";
5
+ const validityByString = new Map();
6
+ const reportedInvalid = new Set();
7
+ export function validateLayerColor(value, iconName, layerIndex) {
8
+ if (value === undefined || value === 'currentColor') return 'black';
9
+ if (typeof value !== 'string') return value;
10
+ let valid = validityByString.get(value);
11
+ if (valid === undefined) {
12
+ valid = processColor(value) != null;
13
+ validityByString.set(value, valid);
14
+ }
15
+ if (valid) return value;
16
+ if (__DEV__) {
17
+ const key = `${iconName}\u0000${value}`;
18
+ if (!reportedInvalid.has(key)) {
19
+ reportedInvalid.add(key);
20
+ errorRuntime(`Invalid color "${value}" for icon "${iconName}" (layer ${layerIndex}). Falling back to black.`);
21
+ }
22
+ }
23
+ return 'black';
24
+ }
@@ -0,0 +1,3 @@
1
+ import type { Pt } from './geometry';
2
+ export declare function arcToCubic(startPoint: Pt, rx: number, ry: number, rotation: number, large: number, sweep: number, endPoint: Pt): Generator<[Pt | null, Pt | null, Pt], void, void>;
3
+ //# sourceMappingURL=arcs.d.ts.map
@@ -0,0 +1,36 @@
1
+ import type { Rect } from './geometry';
2
+ import { XEl } from './dom';
3
+ import type { PathOps } from './pathops';
4
+ import type { Shape } from './shape';
5
+ import { Affine2D } from './transform';
6
+ export type TraverseContext = {
7
+ nthOfType: number;
8
+ element: XEl;
9
+ path: string;
10
+ transform: Affine2D;
11
+ clips: Shape[];
12
+ attrib: Record<string, string>;
13
+ };
14
+ export type ShapeEntry = [XEl, Shape[]];
15
+ export declare class SvgDocument {
16
+ readonly root: XEl;
17
+ readonly ops: PathOps;
18
+ private shapeCache;
19
+ constructor(root: XEl, ops: PathOps);
20
+ static parse(content: string, ops: PathOps): SvgDocument;
21
+ hasShapes(): boolean;
22
+ shapeEntries(): ShapeEntry[];
23
+ invalidateShapes(): void;
24
+ mapShapes(fn: (shape: Shape) => Shape): void;
25
+ forEachShape(fn: (shape: Shape) => void): void;
26
+ private inheritedAttrib;
27
+ syncTree(): void;
28
+ viewBox(): Rect | null;
29
+ get tolerance(): number;
30
+ resolveUrl(url: string, elTag: string): XEl;
31
+ private traverse;
32
+ depthFirst(resolveClipPaths?: boolean): Generator<TraverseContext, void, void>;
33
+ breadthFirst(resolveClipPaths?: boolean): Generator<TraverseContext, void, void>;
34
+ serialize(): string;
35
+ }
36
+ //# sourceMappingURL=document.d.ts.map
@@ -0,0 +1,25 @@
1
+ export declare const SVG_NS = "http://www.w3.org/2000/svg";
2
+ export declare const XLINK_NS = "http://www.w3.org/1999/xlink";
3
+ export declare function svgTag(local: string): string;
4
+ export declare function xlinkHrefAttr(): string;
5
+ export declare function splitNs(name: string): [string | null, string];
6
+ export declare function stripNs(name: string): string;
7
+ export declare class XEl {
8
+ tag: string;
9
+ attrib: Map<string, string>;
10
+ children: XEl[];
11
+ parent: XEl | null;
12
+ constructor(tag: string, attrib?: Iterable<[string, string]>);
13
+ append(child: XEl): void;
14
+ insert(index: number, child: XEl): void;
15
+ detach(): void;
16
+ index(child: XEl): number;
17
+ deepClone(): XEl;
18
+ iter(): Generator<XEl, void, void>;
19
+ }
20
+ export declare function findAll(root: XEl, pred: (el: XEl) => boolean): XEl[];
21
+ export declare function replaceEl(el: XEl, replacements: XEl[]): void;
22
+ export declare function delAttrs(el: XEl, ...attrNames: string[]): void;
23
+ export declare function parseSvgDocument(content: string): XEl;
24
+ export declare function serializeSvg(root: XEl): string;
25
+ //# sourceMappingURL=dom.d.ts.map
@@ -0,0 +1,13 @@
1
+ import type { Rect } from './geometry';
2
+ import { XEl } from './dom';
3
+ import { Affine2D } from './transform';
4
+ export declare function numberAttrib(el: XEl, name: string, fallback: number): number;
5
+ export declare function isTag(el: XEl, local: string): boolean;
6
+ export declare function isDefs(tag: string): boolean;
7
+ export declare function isGradient(tag: string): boolean;
8
+ export declare function isGroup(tag: string): boolean;
9
+ export declare function tryRemoveGroup(groupEl: XEl, pushOpacity?: boolean): boolean;
10
+ export declare function elementTransform(el: XEl, currentTransform?: Affine2D): Affine2D;
11
+ export declare function idOfTarget(url: string): string;
12
+ export declare function parseViewBox(s: string): Rect;
13
+ //# sourceMappingURL=element.d.ts.map
@@ -0,0 +1,22 @@
1
+ export declare const DEFAULT_ALMOST_EQUAL_TOLERANCE = 1e-9;
2
+ export type Pt = {
3
+ x: number;
4
+ y: number;
5
+ };
6
+ export declare function pt(x?: number, y?: number): Pt;
7
+ export declare function almostEqual(c1: number, c2: number, tolerance?: number): boolean;
8
+ export declare function ptEquals(a: Pt, b: Pt): boolean;
9
+ export declare function ptAlmostEquals(a: Pt, b: Pt, tolerance?: number): boolean;
10
+ export declare function ptSub(a: Pt, b: Pt): Pt;
11
+ export declare function ptAdd(a: Pt, b: Pt): Pt;
12
+ export declare function ptMul(a: Pt, scalar: number): Pt;
13
+ export declare function pythonRound(x: number, ndigits: number): number;
14
+ export declare function ntos(n: number): string;
15
+ export type Rect = {
16
+ x: number;
17
+ y: number;
18
+ w: number;
19
+ h: number;
20
+ };
21
+ export declare function rectEmpty(r: Rect): boolean;
22
+ //# sourceMappingURL=geometry.d.ts.map
@@ -0,0 +1,3 @@
1
+ import type { PathKitModule } from '../pathkit/types';
2
+ export declare function flattenSvg(svgContent: string, pathkit: PathKitModule): string;
3
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1,14 @@
1
+ import { XEl } from './dom';
2
+ export declare const ATTRIB_DEFAULTS: Record<string, string | number>;
3
+ export declare function attribDefault(name: string): string | number;
4
+ export declare function attrName(fieldName: string): string;
5
+ export declare function fieldName(attr: string): string;
6
+ type Attrib = Record<string, string>;
7
+ export declare const INHERITABLE_ATTRIB: ReadonlySet<string>;
8
+ export declare const ATTRIB_W_CUSTOM_INHERITANCE: ReadonlySet<string>;
9
+ export declare const INHERITABLE_ATTRIB_DEFAULTS: Readonly<Attrib>;
10
+ export declare function inheritAttrib(attrib: Attrib | Map<string, string>, child: XEl, skipUnhandled?: boolean, skips?: ReadonlySet<string>): void;
11
+ export declare function attribToPassOn(currentAttrib: Attrib, el: XEl, skips?: ReadonlySet<string>): Attrib;
12
+ export declare function dropDefaultAttrib(attrib: Map<string, string>): void;
13
+ export {};
14
+ //# sourceMappingURL=inherit.d.ts.map
@@ -0,0 +1,20 @@
1
+ import type { Pt } from './geometry';
2
+ export type SvgCommand = [cmd: string, args: number[]];
3
+ export declare function numArgs(cmd: string): number;
4
+ export declare function checkCmd(cmd: string, args: readonly number[]): number;
5
+ export declare function cmdCoords(cmd: string): [number[], number[]];
6
+ export declare function pathSegment(cmd: string, ...args: number[]): string;
7
+ export declare function parseSvgPath(svgPath: string, exploded?: boolean): SvgCommand[];
8
+ export declare function addCmdToD(d: string, cmd: string, args: number[]): string;
9
+ export declare function buildD(cmds: Iterable<SvgCommand>): string;
10
+ export type WalkCallback = (subpathStart: Pt, currPos: Pt, cmd: string, args: number[], prevPos: Pt | null, prevCmd: string | null, prevArgs: number[] | null) => Iterable<SvgCommand>;
11
+ export declare function walkPath(d: string, callback: WalkCallback): string;
12
+ export declare function absolutePath(d: string): string;
13
+ export declare function absoluteMoveto(d: string): string;
14
+ export declare function explicitLines(d: string): string;
15
+ export declare function expandShorthand(d: string): string;
16
+ export declare function arcsToCubics(d: string): string;
17
+ export declare function subpaths(d: string): string[];
18
+ export declare function roundFloatsD(d: string, ndigits: number): string;
19
+ export declare function asCmdSeq(d: string): SvgCommand[];
20
+ //# sourceMappingURL=path.d.ts.map
@@ -0,0 +1,15 @@
1
+ import type { PathKitModule } from '../pathkit/types';
2
+ import type { SvgCommand } from './path';
3
+ import type { Affine2D } from './transform';
4
+ export declare class PathOpsError extends Error {
5
+ }
6
+ export declare function createPathOps(PathKit: PathKitModule): {
7
+ union(cmdSeqs: readonly SvgCommand[][], fillRules: readonly string[]): SvgCommand[];
8
+ intersection(cmdSeqs: readonly SvgCommand[][], fillRules: readonly string[]): SvgCommand[];
9
+ removeOverlaps(cmds: Iterable<SvgCommand>, fillRule: string): SvgCommand[];
10
+ transformCmds(cmds: Iterable<SvgCommand>, affine: Affine2D): SvgCommand[];
11
+ strokeCmds(cmds: Iterable<SvgCommand>, svgLinecap: string, svgLinejoin: string, strokeWidth: number, strokeMiterlimit: number, _tolerance: number, dashArray?: readonly number[], dashOffset?: number): SvgCommand[];
12
+ pathArea(cmds: Iterable<SvgCommand>, fillRule: string): number;
13
+ };
14
+ export type PathOps = ReturnType<typeof createPathOps>;
15
+ //# sourceMappingURL=pathops.d.ts.map
@@ -0,0 +1,30 @@
1
+ import { XEl } from './dom';
2
+ import type { PathOps } from './pathops';
3
+ import type { SvgCommand } from './path';
4
+ import { Affine2D } from './transform';
5
+ export declare function isShapeTag(tag: string): boolean;
6
+ export type Shape = {
7
+ tag: string;
8
+ fields: Record<string, string | number>;
9
+ };
10
+ export declare function shapeStr(shape: Shape, name: string): string;
11
+ export declare function cloneShape(shape: Shape): Shape;
12
+ export declare function shapesEqual(a: Shape, b: Shape): boolean;
13
+ export declare function fromElement(el: XEl, inheritedAttrib?: Record<string, string>): Shape;
14
+ export declare function toElement(shape: Shape, inheritedAttrib?: Record<string, string>): XEl;
15
+ export declare function resetFields(shape: Shape, pred: (fieldName: string) => boolean): void;
16
+ export declare function pathFromCommands(cmds: Iterable<SvgCommand>): Shape;
17
+ export declare function asPath(shape: Shape): Shape;
18
+ export declare function shapeCmdSeq(shape: Shape): SvgCommand[];
19
+ export declare function absoluteShape(shape: Shape): Shape;
20
+ export declare function explicitLinesExpandShorthand(shape: Shape): Shape;
21
+ export declare function applyTransform(shape: Shape, transform: Affine2D, ops: PathOps): Shape;
22
+ export declare function removeOverlaps(shape: Shape, ops: PathOps): Shape;
23
+ export declare function strokeCommands(shape: Shape, tolerance: number, ops: PathOps): SvgCommand[];
24
+ export declare function parseCssDeclarations(style: string, output: Record<string, string>, propertyNames?: ReadonlySet<string>): string;
25
+ export declare function applyStyleAttribute(shape: Shape): Shape;
26
+ export declare function mightPaint(shape: Shape, ops: PathOps): boolean;
27
+ export declare function normalizeOpacity(shape: Shape): void;
28
+ export declare function roundShapeFloats(shape: Shape, ndigits: number): void;
29
+ export declare function removeEmptySubpaths(shape: Shape, ops: PathOps): void;
30
+ //# sourceMappingURL=shape.d.ts.map
@@ -0,0 +1,5 @@
1
+ import type { SvgDocument } from '../document';
2
+ import type { Shape } from '../shape';
3
+ import { Affine2D } from '../transform';
4
+ export declare function resolveClipPath(doc: SvgDocument, clipPathUrl: string, transform?: Affine2D): Shape;
5
+ //# sourceMappingURL=clip-path.d.ts.map
@@ -0,0 +1,3 @@
1
+ import type { SvgDocument } from '../document';
2
+ export declare function collapse(doc: SvgDocument): void;
3
+ //# sourceMappingURL=collapse.d.ts.map
@@ -0,0 +1,5 @@
1
+ import { XEl } from '../dom';
2
+ import type { SvgDocument } from '../document';
3
+ export declare function addToDefs(defs: XEl, newEl: XEl): void;
4
+ export declare function removeOrphanedGradients(doc: SvgDocument): void;
5
+ //# sourceMappingURL=defs.d.ts.map
@@ -0,0 +1,5 @@
1
+ import type { SvgDocument } from '../document';
2
+ export declare function removeNonSvgContent(doc: SvgDocument): void;
3
+ export declare function removeAnonymousSymbols(doc: SvgDocument): void;
4
+ export declare function removeTitleMetaDesc(doc: SvgDocument): void;
5
+ //# sourceMappingURL=discard.d.ts.map
@@ -0,0 +1,3 @@
1
+ import type { SvgDocument } from '../document';
2
+ export declare function evenoddToNonzeroWinding(doc: SvgDocument): void;
3
+ //# sourceMappingURL=fill-rule.d.ts.map
@@ -0,0 +1,3 @@
1
+ import type { SvgDocument } from '../document';
2
+ export declare function resolveNestedSvgs(doc: SvgDocument): void;
3
+ //# sourceMappingURL=nested-svg.d.ts.map
@@ -0,0 +1,3 @@
1
+ import type { SvgDocument } from '../document';
2
+ export declare function normalizeOpacities(doc: SvgDocument): void;
3
+ //# sourceMappingURL=opacity.d.ts.map
@@ -0,0 +1,8 @@
1
+ import type { SvgDocument } from '../document';
2
+ export declare function shapesToPaths(doc: SvgDocument): void;
3
+ export declare function expandShorthandCommands(doc: SvgDocument): void;
4
+ export declare function absoluteCoordinates(doc: SvgDocument): void;
5
+ export declare function roundFloats(doc: SvgDocument, ndigits: number): void;
6
+ export declare function dropEmptySubpaths(doc: SvgDocument): void;
7
+ export declare function removeUnpaintedShapes(doc: SvgDocument): void;
8
+ //# sourceMappingURL=shapes.d.ts.map
@@ -0,0 +1,4 @@
1
+ import type { SvgDocument } from '../document';
2
+ import type { Shape } from '../shape';
3
+ export declare function strokeToPaths(doc: SvgDocument, shape: Shape): Shape[];
4
+ //# sourceMappingURL=stroke.d.ts.map
@@ -0,0 +1,3 @@
1
+ import type { SvgDocument } from '../document';
2
+ export declare function applyStyleAttributes(doc: SvgDocument): void;
3
+ //# sourceMappingURL=styles.d.ts.map
@@ -0,0 +1,5 @@
1
+ import { XEl } from '../dom';
2
+ import type { SvgDocument } from '../document';
3
+ export declare function expandUses(doc: SvgDocument, scopeEl: XEl): void;
4
+ export declare function resolveUse(doc: SvgDocument): void;
5
+ //# sourceMappingURL=use.d.ts.map
@@ -0,0 +1,3 @@
1
+ import type { SvgDocument } from '../document';
2
+ export declare function validateFlattened(doc: SvgDocument): string[];
3
+ //# sourceMappingURL=validate.d.ts.map
@@ -0,0 +1,3 @@
1
+ import type { SvgDocument } from './document';
2
+ export declare function flattenDocument(doc: SvgDocument, ndigits?: number): void;
3
+ //# sourceMappingURL=stages.d.ts.map
@@ -0,0 +1,36 @@
1
+ import type { Pt, Rect } from './geometry';
2
+ export declare class Affine2D {
3
+ readonly a: number;
4
+ readonly b: number;
5
+ readonly c: number;
6
+ readonly d: number;
7
+ readonly e: number;
8
+ readonly f: number;
9
+ constructor(a: number, b: number, c: number, d: number, e: number, f: number);
10
+ private static readonly _identity;
11
+ private static readonly _degenerate;
12
+ static identity(): Affine2D;
13
+ static degenerate(): Affine2D;
14
+ static fromString(rawTransform: string): Affine2D;
15
+ values(): [number, number, number, number, number, number];
16
+ equals(other: Affine2D): boolean;
17
+ toString(): string;
18
+ matMul(other: Affine2D): Affine2D;
19
+ matrix(a: number, b: number, c: number, d: number, e: number, f: number): Affine2D;
20
+ translate(tx: number, ty?: number): Affine2D;
21
+ getTranslate(): [number, number];
22
+ scale(sx: number, sy?: number): Affine2D;
23
+ rotate(a: number, cx?: number, cy?: number): Affine2D;
24
+ skewx(a: number): Affine2D;
25
+ skewy(a: number): Affine2D;
26
+ determinant(): number;
27
+ isDegenerate(): boolean;
28
+ inverse(): Affine2D;
29
+ mapPoint(p: Pt): Pt;
30
+ mapVector(v: Pt): Pt;
31
+ static composeLtr(affines: readonly Affine2D[]): Affine2D;
32
+ private static readonly _ALIGN_VALUES;
33
+ private static readonly _MEET_OR_SLICE;
34
+ static rectToRect(src: Rect, dst: Rect, preserveAspectRatio?: string): Affine2D;
35
+ }
36
+ //# sourceMappingURL=transform.d.ts.map
@@ -0,0 +1,8 @@
1
+ import type { NanoLogger } from '../types';
2
+ import type { ParsedPath } from './parse';
3
+ /**
4
+ * Merge consecutive same-color paths into single compound paths.
5
+ * Preserves z-order: only merges runs of adjacent paths with identical fill color.
6
+ */
7
+ export declare function mergeSameColorPaths(paths: ParsedPath[], logger?: NanoLogger): ParsedPath[];
8
+ //# sourceMappingURL=merge.d.ts.map
@@ -0,0 +1,28 @@
1
+ import { type Element } from '@xmldom/xmldom';
2
+ export type ParsedPath = {
3
+ d: string;
4
+ fill: string | null;
5
+ fillRule?: 'evenodd';
6
+ noMerge?: boolean;
7
+ knockout?: boolean;
8
+ };
9
+ export type ParsedFlatSvg = {
10
+ viewBox: [number, number, number, number];
11
+ paths: ParsedPath[];
12
+ };
13
+ export declare function calculateOpColor(fill: string | null, opacity: number, el: Element): `rgba(${number},${number},${number},${number})`;
14
+ /**
15
+ * If a flattened path lost its initial moveto (e.g. an empty `Mx y z`
16
+ * subpath was dropped), prepend `M` using the path's last coordinate pair.
17
+ * For closed icon shapes the endpoint equals the start point.
18
+ */
19
+ export declare function sanitizePathData(d: string): {
20
+ d: string;
21
+ sanitized: boolean;
22
+ };
23
+ export declare function parseFlattenedSvg(flattenedSvg: string, options?: {
24
+ onSanitize?: (original: string) => void;
25
+ onMissingViewBox?: (assumed: [number, number, number, number]) => void;
26
+ }): ParsedFlatSvg;
27
+ export declare function shouldSkipPath(d: string, fill: string | null): boolean;
28
+ //# sourceMappingURL=parse.d.ts.map
@@ -1,4 +1,4 @@
1
- import type { PathKitModule } from '../types.js';
1
+ import type { PathKitModule } from '../pathkit/types';
2
2
  export declare function computePlacement(opts: {
3
3
  upm: number;
4
4
  safeZone: number;
@@ -11,18 +11,6 @@ export declare function computePlacement(opts: {
11
11
  yOff: number;
12
12
  adv: number;
13
13
  };
14
- export declare function writeLayerSvg(opts: {
15
- tempDir: string;
16
- upm: number;
17
- adv: number;
18
- vx: number;
19
- vy: number;
20
- scale: number;
21
- xOff: number;
22
- yOff: number;
23
- d: string;
24
- codepoint: number;
25
- }): Promise<void>;
26
14
  /**
27
15
  * Transform an SVG path `d` string from source SVG coordinates into font
28
16
  * glyph coordinates (Y-up, with placement scaling and centering applied).
@@ -38,4 +26,4 @@ export declare function transformPathForFont(PathKit: PathKitModule, d: string,
38
26
  yOff: number;
39
27
  upm: number;
40
28
  }): string;
41
- //# sourceMappingURL=layers.d.ts.map
29
+ //# sourceMappingURL=placement.d.ts.map
@@ -0,0 +1,9 @@
1
+ export type SvgValidation = {
2
+ valid: true;
3
+ } | {
4
+ valid: false;
5
+ reason: string;
6
+ };
7
+ export declare function validateSvg(content: string): SvgValidation;
8
+ export declare function preprocessSvg(content: string): string;
9
+ //# sourceMappingURL=validate.d.ts.map
@@ -0,0 +1,76 @@
1
+ import type { Cmd, PathKitModule, Point, VerbMap } from './types';
2
+ export declare function verbMap(PathKit: PathKitModule): VerbMap;
3
+ export declare function fillTypes(PathKit: PathKitModule): {
4
+ EVENODD: number;
5
+ WINDING: number;
6
+ };
7
+ export declare function roundN(x: number, ndigits?: number): number;
8
+ export declare function normPt(p: Point): [number, number];
9
+ export declare function eqPt(a: Point, b: Point): boolean;
10
+ export declare function approxSignedAreaFromContourCmds(contourCmds: readonly Cmd[], VERB: VerbMap, steps?: number): number;
11
+ export declare function splitContours(cmds: readonly Cmd[], VERB: VerbMap): Cmd[][];
12
+ export declare function ensureClosed(contourCmds: readonly Cmd[], VERB: VerbMap): Cmd[];
13
+ export declare function explicitCloseWantedFromCmds(contourCmds: readonly Cmd[] | undefined, VERB: VerbMap): boolean;
14
+ type SegmentL = {
15
+ type: 'L';
16
+ start: Point;
17
+ end: Point;
18
+ synthetic: boolean;
19
+ };
20
+ type SegmentQ = {
21
+ type: 'Q';
22
+ start: Point;
23
+ ctrl: Point;
24
+ end: Point;
25
+ synthetic: boolean;
26
+ };
27
+ type SegmentC = {
28
+ type: 'C';
29
+ start: Point;
30
+ c1: Point;
31
+ c2: Point;
32
+ end: Point;
33
+ synthetic: boolean;
34
+ };
35
+ type Segment = SegmentL | SegmentQ | SegmentC;
36
+ export declare function contourToSegments(contourCmds: readonly Cmd[], VERB: VerbMap): {
37
+ start: Point;
38
+ segs: Segment[];
39
+ };
40
+ export declare function reverseClosedContourKeepStart(contourCmds: readonly Cmd[], explicitCloseWanted: boolean, VERB: VerbMap): Cmd[];
41
+ export declare function rotateClosedContourToStart(contourCmds: readonly Cmd[], desiredStart: Point, explicitCloseWanted: boolean, VERB: VerbMap): Cmd[];
42
+ export declare function mergeMoves(aMoves: readonly Point[] | undefined, bMoves: readonly Point[] | undefined): Point[];
43
+ export declare function bestStartMinYMinX(contourCmds: readonly Cmd[], VERB: VerbMap): Point | null;
44
+ /**
45
+ * Convert contour commands to a polyline by sampling curves.
46
+ * Used for ray-casting containment tests.
47
+ */
48
+ export declare function contourToPolyline(contourCmds: readonly Cmd[], V: VerbMap, steps?: number): Point[];
49
+ /**
50
+ * Ray-casting point-in-polygon test.
51
+ */
52
+ export declare function pointInPolygon(px: number, py: number, poly: Point[]): boolean;
53
+ /**
54
+ * Get a representative point on the contour boundary (midpoint of first segment).
55
+ */
56
+ export declare function getContourSamplePoint(contourCmds: readonly Cmd[], V: VerbMap): Point | null;
57
+ /**
58
+ * Apply containment-based winding fix to contour objects.
59
+ * Even nesting depth = CCW (outer), odd = CW (hole).
60
+ */
61
+ export declare function applyContainmentWinding(contourObjs: Array<{
62
+ cmds: Cmd[];
63
+ explicitCloseWanted: boolean;
64
+ absA: number;
65
+ }>, V: VerbMap): void;
66
+ export type Contour = {
67
+ cmds: Cmd[];
68
+ explicitCloseWanted: boolean;
69
+ absA: number;
70
+ };
71
+ export declare function orientedContours(cmds: readonly Cmd[], V: VerbMap): Contour[];
72
+ export declare function canonicalContourCmds(cmds: readonly Cmd[], recordedMoves: readonly Point[], preferMinYMinXStart: boolean, V: VerbMap): Cmd[];
73
+ export declare function cmdsToPathData(cmds: readonly Cmd[], V: VerbMap): string;
74
+ export declare function contoursArea(cmds: readonly Cmd[], V: VerbMap): number;
75
+ export {};
76
+ //# sourceMappingURL=contours.d.ts.map
@@ -0,0 +1,13 @@
1
+ import type { PathKitModule } from './types';
2
+ /**
3
+ * Convert a path `d` string with evenodd fill semantics to an equivalent
4
+ * path that renders identically under nonzero winding.
5
+ *
6
+ * Steps:
7
+ * 1. Parse via PathKit, set fill type to EVENODD, simplify (resolve topology)
8
+ * 2. Split into contours, compute containment depths
9
+ * 3. Fix winding: even depth = CCW (outer), odd depth = CW (hole)
10
+ * 4. Reconstruct d string
11
+ */
12
+ export declare function convertEvenoddToWinding(PathKit: PathKitModule, d: string): string;
13
+ //# sourceMappingURL=evenodd.d.ts.map
@@ -0,0 +1,3 @@
1
+ import type { PathKitModule } from './types';
2
+ export declare function loadPathKit(): Promise<PathKitModule>;
3
+ //# sourceMappingURL=load.d.ts.map
@@ -0,0 +1,70 @@
1
+ export type Point = readonly [number, number];
2
+ export type Cmd = readonly number[];
3
+ export type VerbMap = {
4
+ MOVE: number;
5
+ LINE: number;
6
+ QUAD: number;
7
+ CONIC: number;
8
+ CUBIC: number;
9
+ CLOSE: number;
10
+ };
11
+ export interface PathKitPath {
12
+ delete?: () => void;
13
+ moveTo: (x: number, y: number) => void;
14
+ lineTo: (x: number, y: number) => void;
15
+ quadTo: (x1: number, y1: number, x2: number, y2: number) => void;
16
+ cubicTo: (x1: number, y1: number, x2: number, y2: number, x3: number, y3: number) => void;
17
+ close: () => void;
18
+ simplify: () => void;
19
+ toSVGString: () => string;
20
+ toCmds: () => Cmd[];
21
+ getBounds: () => {
22
+ fLeft: number;
23
+ fTop: number;
24
+ fRight: number;
25
+ fBottom: number;
26
+ };
27
+ getFillType?: () => number;
28
+ setFillType: (t: number) => void;
29
+ dash?: (on: number, off: number, phase: number) => void;
30
+ stroke: (opts: {
31
+ width: number;
32
+ cap: number;
33
+ join: number;
34
+ miter_limit: number;
35
+ }) => PathKitPath | null;
36
+ transform: (a: number, c: number, e: number, b: number, d: number, f: number, g: number, h: number, i: number) => void;
37
+ }
38
+ export interface PathKitModule {
39
+ MOVE_VERB?: number;
40
+ LINE_VERB?: number;
41
+ QUAD_VERB?: number;
42
+ CONIC_VERB?: number;
43
+ CUBIC_VERB?: number;
44
+ CLOSE_VERB?: number;
45
+ FillType?: {
46
+ EVENODD?: number;
47
+ EVEN_ODD?: number;
48
+ WINDING?: number;
49
+ NONZERO?: number;
50
+ };
51
+ StrokeCap?: {
52
+ BUTT?: number;
53
+ ROUND?: number;
54
+ SQUARE?: number;
55
+ };
56
+ StrokeJoin?: {
57
+ MITER?: number;
58
+ ROUND?: number;
59
+ BEVEL?: number;
60
+ };
61
+ PathOp?: {
62
+ UNION?: number;
63
+ INTERSECT?: number;
64
+ DIFFERENCE?: number;
65
+ };
66
+ NewPath: (src?: PathKitPath) => PathKitPath;
67
+ FromSVGString: (svg: string) => PathKitPath | null;
68
+ MakeFromOp: (a: PathKitPath, b: PathKitPath, op: number) => PathKitPath | null;
69
+ }
70
+ //# sourceMappingURL=types.d.ts.map
@@ -0,0 +1,5 @@
1
+ import type { PathKitModule, PathKitPath } from './types';
2
+ export declare function orientedPathData(PathKit: PathKitModule, path: PathKitPath): string;
3
+ export declare function canonicalWinding(PathKit: PathKitModule, d: string): string;
4
+ export declare function reversedWinding(PathKit: PathKitModule, d: string): string;
5
+ //# sourceMappingURL=winding.d.ts.map
@@ -0,0 +1,3 @@
1
+ export declare function symbolsetContentsJson(svgFilename: string): string;
2
+ export declare function catalogRootContentsJson(): string;
3
+ //# sourceMappingURL=contents.d.ts.map
@@ -0,0 +1,4 @@
1
+ export declare const KNOCKOUT_ATTRIBUTE = "data-nano-knockout";
2
+ export declare const KNOCKOUT_MARKER_FILL = "#fe01fe";
3
+ export declare function markKnockoutFills(svg: string): string | null;
4
+ //# sourceMappingURL=knockout.d.ts.map
@@ -0,0 +1,37 @@
1
+ import type { PathKitModule } from '../pathkit/types';
2
+ /**
3
+ * Resolve stacked layers into SF Symbol template layers. Monochrome joins every
4
+ * layer into one nonzero-filled path, multicolor paints each layer on its own:
5
+ * 1. Knockouts: layers annotated with `data-nano-knockout`, or (when nothing is
6
+ * annotated) near-white layers over ink. Their part over ink is emitted with
7
+ * reversed winding, so it cancels the ink beneath it in monochrome while
8
+ * multicolor still paints it in its own fill. Their part over nothing is
9
+ * drawn in both modes.
10
+ * 2. Occlusion: subtract layers above from each layer; ink is never cut by a
11
+ * knockout, so the winding under every knockout is exactly one.
12
+ * In: back→front layers with fills. Out: visible layers in z-order plus the
13
+ * monochrome silhouette.
14
+ */
15
+ export type SymbolLayerInput = {
16
+ d: string;
17
+ fill: string | null;
18
+ knockout?: boolean;
19
+ };
20
+ export type SymbolLayer = {
21
+ d: string;
22
+ fill: string | null;
23
+ };
24
+ export type ResolvedSymbolLayers = {
25
+ layers: SymbolLayer[];
26
+ monochrome: string;
27
+ };
28
+ export declare function isKnockoutFill(fill: string | null): boolean;
29
+ export declare function resolveSymbolLayers(PathKit: PathKitModule, layers: SymbolLayerInput[], options?: {
30
+ onKnockoutLayer?: (index: number) => void;
31
+ }): ResolvedSymbolLayers;
32
+ /**
33
+ * Tight bounding box [x, y, w, h] of path `d` strings in source coords, or null.
34
+ * Used to fit icon content (not the padded viewBox) to the cap band.
35
+ */
36
+ export declare function contentBounds(PathKit: PathKitModule, ds: string[]): [number, number, number, number] | null;
37
+ //# sourceMappingURL=layers.d.ts.map