rn-iconify 1.0.0 → 2.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +47 -235
- package/babel.js +14 -0
- package/lib/commonjs/IconRenderer.js +91 -4
- package/lib/commonjs/IconRenderer.js.map +1 -1
- package/lib/commonjs/accessibility/AccessibilityProvider.js +189 -0
- package/lib/commonjs/accessibility/AccessibilityProvider.js.map +1 -0
- package/lib/commonjs/accessibility/index.js +87 -0
- package/lib/commonjs/accessibility/index.js.map +1 -0
- package/lib/commonjs/accessibility/types.js +6 -0
- package/lib/commonjs/accessibility/types.js.map +1 -0
- package/lib/commonjs/accessibility/useAccessibleIcon.js +119 -0
- package/lib/commonjs/accessibility/useAccessibleIcon.js.map +1 -0
- package/lib/commonjs/accessibility/utils.js +231 -0
- package/lib/commonjs/accessibility/utils.js.map +1 -0
- package/lib/commonjs/alias/Icon.js +113 -0
- package/lib/commonjs/alias/Icon.js.map +1 -0
- package/lib/commonjs/alias/IconAliasContext.js +177 -0
- package/lib/commonjs/alias/IconAliasContext.js.map +1 -0
- package/lib/commonjs/alias/createIconAliases.js +222 -0
- package/lib/commonjs/alias/createIconAliases.js.map +1 -0
- package/lib/commonjs/alias/index.js +57 -0
- package/lib/commonjs/alias/index.js.map +1 -0
- package/lib/commonjs/alias/types.js +6 -0
- package/lib/commonjs/alias/types.js.map +1 -0
- package/lib/commonjs/animated/AnimatedIcon.js +116 -0
- package/lib/commonjs/animated/AnimatedIcon.js.map +1 -0
- package/lib/commonjs/animated/index.js +76 -0
- package/lib/commonjs/animated/index.js.map +1 -0
- package/lib/commonjs/animated/presets.js +220 -0
- package/lib/commonjs/animated/presets.js.map +1 -0
- package/lib/commonjs/animated/types.js +71 -0
- package/lib/commonjs/animated/types.js.map +1 -0
- package/lib/commonjs/animated/useIconAnimation.js +313 -0
- package/lib/commonjs/animated/useIconAnimation.js.map +1 -0
- package/lib/commonjs/babel/ast-utils.js +214 -0
- package/lib/commonjs/babel/ast-utils.js.map +1 -0
- package/lib/commonjs/babel/cache-writer.js +281 -0
- package/lib/commonjs/babel/cache-writer.js.map +1 -0
- package/lib/commonjs/babel/collector.js +219 -0
- package/lib/commonjs/babel/collector.js.map +1 -0
- package/lib/commonjs/babel/index.js +104 -0
- package/lib/commonjs/babel/index.js.map +1 -0
- package/lib/commonjs/babel/plugin.js +226 -0
- package/lib/commonjs/babel/plugin.js.map +1 -0
- package/lib/commonjs/babel/types.js +485 -0
- package/lib/commonjs/babel/types.js.map +1 -0
- package/lib/commonjs/bundle/index.js +213 -0
- package/lib/commonjs/bundle/index.js.map +1 -0
- package/lib/commonjs/cache/CacheManager.js +105 -6
- package/lib/commonjs/cache/CacheManager.js.map +1 -1
- package/lib/commonjs/cli/commands/analyze.js +171 -0
- package/lib/commonjs/cli/commands/analyze.js.map +1 -0
- package/lib/commonjs/cli/commands/bundle.js +214 -0
- package/lib/commonjs/cli/commands/bundle.js.map +1 -0
- package/lib/commonjs/cli/index.js +142 -0
- package/lib/commonjs/cli/index.js.map +1 -0
- package/lib/commonjs/cli/parser.js +260 -0
- package/lib/commonjs/cli/parser.js.map +1 -0
- package/lib/commonjs/cli/types.js +42 -0
- package/lib/commonjs/cli/types.js.map +1 -0
- package/lib/commonjs/config/ConfigManager.js +182 -0
- package/lib/commonjs/config/ConfigManager.js.map +1 -0
- package/lib/commonjs/config/index.js +44 -0
- package/lib/commonjs/config/index.js.map +1 -0
- package/lib/commonjs/config/types.js +55 -0
- package/lib/commonjs/config/types.js.map +1 -0
- package/lib/commonjs/createIconSet.js +49 -11
- package/lib/commonjs/createIconSet.js.map +1 -1
- package/lib/commonjs/explorer/IconExplorer.js +827 -0
- package/lib/commonjs/explorer/IconExplorer.js.map +1 -0
- package/lib/commonjs/explorer/iconSets.js +303 -0
- package/lib/commonjs/explorer/iconSets.js.map +1 -0
- package/lib/commonjs/explorer/index.js +93 -0
- package/lib/commonjs/explorer/index.js.map +1 -0
- package/lib/commonjs/explorer/types.js +6 -0
- package/lib/commonjs/explorer/types.js.map +1 -0
- package/lib/commonjs/explorer/useExplorer.js +359 -0
- package/lib/commonjs/explorer/useExplorer.js.map +1 -0
- package/lib/commonjs/index.js +618 -12
- package/lib/commonjs/index.js.map +1 -1
- package/lib/commonjs/navigation/createDrawerIcon.js +129 -0
- package/lib/commonjs/navigation/createDrawerIcon.js.map +1 -0
- package/lib/commonjs/navigation/createHeaderIcon.js +185 -0
- package/lib/commonjs/navigation/createHeaderIcon.js.map +1 -0
- package/lib/commonjs/navigation/createTabBarIcon.js +178 -0
- package/lib/commonjs/navigation/createTabBarIcon.js.map +1 -0
- package/lib/commonjs/navigation/index.js +83 -0
- package/lib/commonjs/navigation/index.js.map +1 -0
- package/lib/commonjs/navigation/types.js +94 -0
- package/lib/commonjs/navigation/types.js.map +1 -0
- package/lib/commonjs/navigation/useNavigationIcon.js +128 -0
- package/lib/commonjs/navigation/useNavigationIcon.js.map +1 -0
- package/lib/commonjs/network/IconifyAPI.js +154 -14
- package/lib/commonjs/network/IconifyAPI.js.map +1 -1
- package/lib/commonjs/network/index.js +18 -0
- package/lib/commonjs/network/index.js.map +1 -1
- package/lib/commonjs/performance/PerformanceMonitor.js +327 -0
- package/lib/commonjs/performance/PerformanceMonitor.js.map +1 -0
- package/lib/commonjs/performance/index.js +43 -0
- package/lib/commonjs/performance/index.js.map +1 -0
- package/lib/commonjs/performance/types.js +2 -0
- package/lib/commonjs/performance/types.js.map +1 -0
- package/lib/commonjs/placeholder/PlaceholderFactory.js +111 -0
- package/lib/commonjs/placeholder/PlaceholderFactory.js.map +1 -0
- package/lib/commonjs/placeholder/Pulse.js +77 -0
- package/lib/commonjs/placeholder/Pulse.js.map +1 -0
- package/lib/commonjs/placeholder/Shimmer.js +95 -0
- package/lib/commonjs/placeholder/Shimmer.js.map +1 -0
- package/lib/commonjs/placeholder/Skeleton.js +52 -0
- package/lib/commonjs/placeholder/Skeleton.js.map +1 -0
- package/lib/commonjs/placeholder/index.js +41 -0
- package/lib/commonjs/placeholder/index.js.map +1 -0
- package/lib/commonjs/placeholder/types.js +40 -0
- package/lib/commonjs/placeholder/types.js.map +1 -0
- package/lib/commonjs/theme/IconThemeProvider.js +96 -0
- package/lib/commonjs/theme/IconThemeProvider.js.map +1 -0
- package/lib/commonjs/theme/context.js +53 -0
- package/lib/commonjs/theme/context.js.map +1 -0
- package/lib/commonjs/theme/index.js +52 -0
- package/lib/commonjs/theme/index.js.map +1 -0
- package/lib/commonjs/theme/types.js +39 -0
- package/lib/commonjs/theme/types.js.map +1 -0
- package/lib/commonjs/theme/useIconTheme.js +121 -0
- package/lib/commonjs/theme/useIconTheme.js.map +1 -0
- package/lib/module/IconRenderer.js +92 -5
- package/lib/module/IconRenderer.js.map +1 -1
- package/lib/module/accessibility/AccessibilityProvider.js +179 -0
- package/lib/module/accessibility/AccessibilityProvider.js.map +1 -0
- package/lib/module/accessibility/index.js +42 -0
- package/lib/module/accessibility/index.js.map +1 -0
- package/lib/module/accessibility/types.js +2 -0
- package/lib/module/accessibility/types.js.map +1 -0
- package/lib/module/accessibility/useAccessibleIcon.js +112 -0
- package/lib/module/accessibility/useAccessibleIcon.js.map +1 -0
- package/lib/module/accessibility/utils.js +221 -0
- package/lib/module/accessibility/utils.js.map +1 -0
- package/lib/module/alias/Icon.js +105 -0
- package/lib/module/alias/Icon.js.map +1 -0
- package/lib/module/alias/IconAliasContext.js +166 -0
- package/lib/module/alias/IconAliasContext.js.map +1 -0
- package/lib/module/alias/createIconAliases.js +213 -0
- package/lib/module/alias/createIconAliases.js.map +1 -0
- package/lib/module/alias/index.js +45 -0
- package/lib/module/alias/index.js.map +1 -0
- package/lib/module/alias/types.js +2 -0
- package/lib/module/alias/types.js.map +1 -0
- package/lib/module/animated/AnimatedIcon.js +109 -0
- package/lib/module/animated/AnimatedIcon.js.map +1 -0
- package/lib/module/animated/index.js +80 -0
- package/lib/module/animated/index.js.map +1 -0
- package/lib/module/animated/presets.js +209 -0
- package/lib/module/animated/presets.js.map +1 -0
- package/lib/module/animated/types.js +65 -0
- package/lib/module/animated/types.js.map +1 -0
- package/lib/module/animated/useIconAnimation.js +306 -0
- package/lib/module/animated/useIconAnimation.js.map +1 -0
- package/lib/module/babel/ast-utils.js +201 -0
- package/lib/module/babel/ast-utils.js.map +1 -0
- package/lib/module/babel/cache-writer.js +269 -0
- package/lib/module/babel/cache-writer.js.map +1 -0
- package/lib/module/babel/collector.js +214 -0
- package/lib/module/babel/collector.js.map +1 -0
- package/lib/module/babel/index.js +51 -0
- package/lib/module/babel/index.js.map +1 -0
- package/lib/module/babel/plugin.js +220 -0
- package/lib/module/babel/plugin.js.map +1 -0
- package/lib/module/babel/types.js +476 -0
- package/lib/module/babel/types.js.map +1 -0
- package/lib/module/bundle/index.js +205 -0
- package/lib/module/bundle/index.js.map +1 -0
- package/lib/module/cache/CacheManager.js +106 -6
- package/lib/module/cache/CacheManager.js.map +1 -1
- package/lib/module/cli/commands/analyze.js +166 -0
- package/lib/module/cli/commands/analyze.js.map +1 -0
- package/lib/module/cli/commands/bundle.js +208 -0
- package/lib/module/cli/commands/bundle.js.map +1 -0
- package/lib/module/cli/index.js +140 -0
- package/lib/module/cli/index.js.map +1 -0
- package/lib/module/cli/parser.js +251 -0
- package/lib/module/cli/parser.js.map +1 -0
- package/lib/module/cli/types.js +36 -0
- package/lib/module/cli/types.js.map +1 -0
- package/lib/module/components/index.js +27 -1
- package/lib/module/components/index.js.map +1 -1
- package/lib/module/config/ConfigManager.js +173 -0
- package/lib/module/config/ConfigManager.js.map +1 -0
- package/lib/module/config/index.js +28 -0
- package/lib/module/config/index.js.map +1 -0
- package/lib/module/config/types.js +49 -0
- package/lib/module/config/types.js.map +1 -0
- package/lib/module/createIconSet.js +49 -11
- package/lib/module/createIconSet.js.map +1 -1
- package/lib/module/explorer/IconExplorer.js +817 -0
- package/lib/module/explorer/IconExplorer.js.map +1 -0
- package/lib/module/explorer/iconSets.js +291 -0
- package/lib/module/explorer/iconSets.js.map +1 -0
- package/lib/module/explorer/index.js +42 -0
- package/lib/module/explorer/index.js.map +1 -0
- package/lib/module/explorer/types.js +2 -0
- package/lib/module/explorer/types.js.map +1 -0
- package/lib/module/explorer/useExplorer.js +353 -0
- package/lib/module/explorer/useExplorer.js.map +1 -0
- package/lib/module/index.js +26 -11
- package/lib/module/index.js.map +1 -1
- package/lib/module/navigation/createDrawerIcon.js +121 -0
- package/lib/module/navigation/createDrawerIcon.js.map +1 -0
- package/lib/module/navigation/createHeaderIcon.js +175 -0
- package/lib/module/navigation/createHeaderIcon.js.map +1 -0
- package/lib/module/navigation/createTabBarIcon.js +168 -0
- package/lib/module/navigation/createTabBarIcon.js.map +1 -0
- package/lib/module/navigation/index.js +59 -0
- package/lib/module/navigation/index.js.map +1 -0
- package/lib/module/navigation/types.js +88 -0
- package/lib/module/navigation/types.js.map +1 -0
- package/lib/module/navigation/useNavigationIcon.js +121 -0
- package/lib/module/navigation/useNavigationIcon.js.map +1 -0
- package/lib/module/network/IconifyAPI.js +152 -14
- package/lib/module/network/IconifyAPI.js.map +1 -1
- package/lib/module/network/index.js +1 -1
- package/lib/module/network/index.js.map +1 -1
- package/lib/module/performance/PerformanceMonitor.js +317 -0
- package/lib/module/performance/PerformanceMonitor.js.map +1 -0
- package/lib/module/performance/index.js +26 -0
- package/lib/module/performance/index.js.map +1 -0
- package/lib/module/performance/types.js +2 -0
- package/lib/module/performance/types.js.map +1 -0
- package/lib/module/placeholder/PlaceholderFactory.js +105 -0
- package/lib/module/placeholder/PlaceholderFactory.js.map +1 -0
- package/lib/module/placeholder/Pulse.js +70 -0
- package/lib/module/placeholder/Pulse.js.map +1 -0
- package/lib/module/placeholder/Shimmer.js +88 -0
- package/lib/module/placeholder/Shimmer.js.map +1 -0
- package/lib/module/placeholder/Skeleton.js +45 -0
- package/lib/module/placeholder/Skeleton.js.map +1 -0
- package/lib/module/placeholder/index.js +15 -0
- package/lib/module/placeholder/index.js.map +1 -0
- package/lib/module/placeholder/types.js +34 -0
- package/lib/module/placeholder/types.js.map +1 -0
- package/lib/module/theme/IconThemeProvider.js +89 -0
- package/lib/module/theme/IconThemeProvider.js.map +1 -0
- package/lib/module/theme/context.js +47 -0
- package/lib/module/theme/context.js.map +1 -0
- package/lib/module/theme/index.js +19 -0
- package/lib/module/theme/index.js.map +1 -0
- package/lib/module/theme/types.js +33 -0
- package/lib/module/theme/types.js.map +1 -0
- package/lib/module/theme/useIconTheme.js +114 -0
- package/lib/module/theme/useIconTheme.js.map +1 -0
- package/lib/typescript/IconRenderer.d.ts +1 -1
- package/lib/typescript/IconRenderer.d.ts.map +1 -1
- package/lib/typescript/accessibility/AccessibilityProvider.d.ts +57 -0
- package/lib/typescript/accessibility/AccessibilityProvider.d.ts.map +1 -0
- package/lib/typescript/accessibility/index.d.ts +37 -0
- package/lib/typescript/accessibility/index.d.ts.map +1 -0
- package/lib/typescript/accessibility/types.d.ts +130 -0
- package/lib/typescript/accessibility/types.d.ts.map +1 -0
- package/lib/typescript/accessibility/useAccessibleIcon.d.ts +111 -0
- package/lib/typescript/accessibility/useAccessibleIcon.d.ts.map +1 -0
- package/lib/typescript/accessibility/utils.d.ts +29 -0
- package/lib/typescript/accessibility/utils.d.ts.map +1 -0
- package/lib/typescript/alias/Icon.d.ts +38 -0
- package/lib/typescript/alias/Icon.d.ts.map +1 -0
- package/lib/typescript/alias/IconAliasContext.d.ts +52 -0
- package/lib/typescript/alias/IconAliasContext.d.ts.map +1 -0
- package/lib/typescript/alias/createIconAliases.d.ts +77 -0
- package/lib/typescript/alias/createIconAliases.d.ts.map +1 -0
- package/lib/typescript/alias/index.d.ts +36 -0
- package/lib/typescript/alias/index.d.ts.map +1 -0
- package/lib/typescript/alias/types.d.ts +115 -0
- package/lib/typescript/alias/types.d.ts.map +1 -0
- package/lib/typescript/animated/AnimatedIcon.d.ts +45 -0
- package/lib/typescript/animated/AnimatedIcon.d.ts.map +1 -0
- package/lib/typescript/animated/index.d.ts +70 -0
- package/lib/typescript/animated/index.d.ts.map +1 -0
- package/lib/typescript/animated/presets.d.ts +35 -0
- package/lib/typescript/animated/presets.d.ts.map +1 -0
- package/lib/typescript/animated/types.d.ts +196 -0
- package/lib/typescript/animated/types.d.ts.map +1 -0
- package/lib/typescript/animated/useIconAnimation.d.ts +64 -0
- package/lib/typescript/animated/useIconAnimation.d.ts.map +1 -0
- package/lib/typescript/babel/ast-utils.d.ts +52 -0
- package/lib/typescript/babel/ast-utils.d.ts.map +1 -0
- package/lib/typescript/babel/cache-writer.d.ts +56 -0
- package/lib/typescript/babel/cache-writer.d.ts.map +1 -0
- package/lib/typescript/babel/collector.d.ts +107 -0
- package/lib/typescript/babel/collector.d.ts.map +1 -0
- package/lib/typescript/babel/index.d.ts +47 -0
- package/lib/typescript/babel/index.d.ts.map +1 -0
- package/lib/typescript/babel/plugin.d.ts +17 -0
- package/lib/typescript/babel/plugin.d.ts.map +1 -0
- package/lib/typescript/babel/types.d.ts +129 -0
- package/lib/typescript/babel/types.d.ts.map +1 -0
- package/lib/typescript/bundle/index.d.ts +161 -0
- package/lib/typescript/bundle/index.d.ts.map +1 -0
- package/lib/typescript/cache/CacheManager.d.ts +52 -4
- package/lib/typescript/cache/CacheManager.d.ts.map +1 -1
- package/lib/typescript/cli/commands/analyze.d.ts +10 -0
- package/lib/typescript/cli/commands/analyze.d.ts.map +1 -0
- package/lib/typescript/cli/commands/bundle.d.ts +10 -0
- package/lib/typescript/cli/commands/bundle.d.ts.map +1 -0
- package/lib/typescript/cli/index.d.ts +7 -0
- package/lib/typescript/cli/index.d.ts.map +1 -0
- package/lib/typescript/cli/parser.d.ts +18 -0
- package/lib/typescript/cli/parser.d.ts.map +1 -0
- package/lib/typescript/cli/types.d.ts +157 -0
- package/lib/typescript/cli/types.d.ts.map +1 -0
- package/lib/typescript/components/Academicons.d.ts +1 -1
- package/lib/typescript/components/AkarIcons.d.ts +1 -1
- package/lib/typescript/components/AntDesign.d.ts +1 -1
- package/lib/typescript/components/Arcticons.d.ts +1 -1
- package/lib/typescript/components/Basil.d.ts +1 -1
- package/lib/typescript/components/Bi.d.ts +1 -1
- package/lib/typescript/components/BitcoinIcons.d.ts +1 -1
- package/lib/typescript/components/Bpmn.d.ts +1 -1
- package/lib/typescript/components/Brandico.d.ts +1 -1
- package/lib/typescript/components/Bx.d.ts +1 -1
- package/lib/typescript/components/Bxl.d.ts +1 -1
- package/lib/typescript/components/Bxs.d.ts +1 -1
- package/lib/typescript/components/Bytesize.d.ts +1 -1
- package/lib/typescript/components/Carbon.d.ts +1 -1
- package/lib/typescript/components/Catppuccin.d.ts +1 -1
- package/lib/typescript/components/Cbi.d.ts +1 -1
- package/lib/typescript/components/Charm.d.ts +1 -1
- package/lib/typescript/components/Ci.d.ts +1 -1
- package/lib/typescript/components/Cib.d.ts +1 -1
- package/lib/typescript/components/Cif.d.ts +1 -1
- package/lib/typescript/components/Cil.d.ts +1 -1
- package/lib/typescript/components/CircleFlags.d.ts +1 -1
- package/lib/typescript/components/Circum.d.ts +1 -1
- package/lib/typescript/components/Clarity.d.ts +1 -1
- package/lib/typescript/components/Codex.d.ts +1 -1
- package/lib/typescript/components/Codicon.d.ts +1 -1
- package/lib/typescript/components/Covid.d.ts +1 -1
- package/lib/typescript/components/Cryptocurrency.d.ts +1 -1
- package/lib/typescript/components/CryptocurrencyColor.d.ts +1 -1
- package/lib/typescript/components/Cuida.d.ts +1 -1
- package/lib/typescript/components/Dashicons.d.ts +1 -1
- package/lib/typescript/components/Devicon.d.ts +1 -1
- package/lib/typescript/components/DeviconPlain.d.ts +1 -1
- package/lib/typescript/components/DinkieIcons.d.ts +1 -1
- package/lib/typescript/components/DuoIcons.d.ts +1 -1
- package/lib/typescript/components/Ei.d.ts +1 -1
- package/lib/typescript/components/El.d.ts +1 -1
- package/lib/typescript/components/EmojioneMonotone.d.ts +1 -1
- package/lib/typescript/components/Entypo.d.ts +1 -1
- package/lib/typescript/components/EntypoSocial.d.ts +1 -1
- package/lib/typescript/components/EosIcons.d.ts +1 -1
- package/lib/typescript/components/Ep.d.ts +1 -1
- package/lib/typescript/components/Et.d.ts +1 -1
- package/lib/typescript/components/Eva.d.ts +1 -1
- package/lib/typescript/components/F7.d.ts +1 -1
- package/lib/typescript/components/Fa.d.ts +1 -1
- package/lib/typescript/components/Fa6Brands.d.ts +1 -1
- package/lib/typescript/components/Fa6Regular.d.ts +1 -1
- package/lib/typescript/components/Fa6Solid.d.ts +1 -1
- package/lib/typescript/components/Fa7Brands.d.ts +1 -1
- package/lib/typescript/components/Fa7Regular.d.ts +1 -1
- package/lib/typescript/components/Fa7Solid.d.ts +1 -1
- package/lib/typescript/components/FaBrands.d.ts +1 -1
- package/lib/typescript/components/FaRegular.d.ts +1 -1
- package/lib/typescript/components/FaSolid.d.ts +1 -1
- package/lib/typescript/components/Fad.d.ts +1 -1
- package/lib/typescript/components/Famicons.d.ts +1 -1
- package/lib/typescript/components/Fe.d.ts +1 -1
- package/lib/typescript/components/Feather.d.ts +1 -1
- package/lib/typescript/components/FileIcons.d.ts +1 -1
- package/lib/typescript/components/Flag.d.ts +1 -1
- package/lib/typescript/components/Flagpack.d.ts +1 -1
- package/lib/typescript/components/FlatUi.d.ts +1 -1
- package/lib/typescript/components/Flowbite.d.ts +1 -1
- package/lib/typescript/components/Fluent.d.ts +1 -1
- package/lib/typescript/components/FluentColor.d.ts +1 -1
- package/lib/typescript/components/FluentEmoji.d.ts +1 -1
- package/lib/typescript/components/FluentEmojiFlat.d.ts +1 -1
- package/lib/typescript/components/FluentEmojiHighContrast.d.ts +1 -1
- package/lib/typescript/components/FluentMdl2.d.ts +1 -1
- package/lib/typescript/components/Fontelico.d.ts +1 -1
- package/lib/typescript/components/Fontisto.d.ts +1 -1
- package/lib/typescript/components/Formkit.d.ts +1 -1
- package/lib/typescript/components/Foundation.d.ts +1 -1
- package/lib/typescript/components/Gala.d.ts +1 -1
- package/lib/typescript/components/GameIcons.d.ts +1 -1
- package/lib/typescript/components/Garden.d.ts +1 -1
- package/lib/typescript/components/Geo.d.ts +1 -1
- package/lib/typescript/components/Gg.d.ts +1 -1
- package/lib/typescript/components/Gis.d.ts +1 -1
- package/lib/typescript/components/GravityUi.d.ts +1 -1
- package/lib/typescript/components/Gridicons.d.ts +1 -1
- package/lib/typescript/components/GrommetIcons.d.ts +1 -1
- package/lib/typescript/components/Guidance.d.ts +1 -1
- package/lib/typescript/components/Healthicons.d.ts +1 -1
- package/lib/typescript/components/Heroicons.d.ts +1 -1
- package/lib/typescript/components/HeroiconsOutline.d.ts +1 -1
- package/lib/typescript/components/HeroiconsSolid.d.ts +1 -1
- package/lib/typescript/components/Hugeicons.d.ts +1 -1
- package/lib/typescript/components/Humbleicons.d.ts +1 -1
- package/lib/typescript/components/Ic.d.ts +1 -1
- package/lib/typescript/components/IcomoonFree.d.ts +1 -1
- package/lib/typescript/components/IconPark.d.ts +1 -1
- package/lib/typescript/components/IconParkOutline.d.ts +1 -1
- package/lib/typescript/components/IconParkSolid.d.ts +1 -1
- package/lib/typescript/components/IconParkTwotone.d.ts +1 -1
- package/lib/typescript/components/Iconamoon.d.ts +1 -1
- package/lib/typescript/components/Iconoir.d.ts +1 -1
- package/lib/typescript/components/Icons8.d.ts +1 -1
- package/lib/typescript/components/Il.d.ts +1 -1
- package/lib/typescript/components/Ion.d.ts +1 -1
- package/lib/typescript/components/Iwwa.d.ts +1 -1
- package/lib/typescript/components/Ix.d.ts +1 -1
- package/lib/typescript/components/Jam.d.ts +1 -1
- package/lib/typescript/components/La.d.ts +1 -1
- package/lib/typescript/components/LetsIcons.d.ts +1 -1
- package/lib/typescript/components/LineMd.d.ts +1 -1
- package/lib/typescript/components/Lineicons.d.ts +1 -1
- package/lib/typescript/components/Logos.d.ts +1 -1
- package/lib/typescript/components/Ls.d.ts +1 -1
- package/lib/typescript/components/Lsicon.d.ts +1 -1
- package/lib/typescript/components/Lucide.d.ts +1 -1
- package/lib/typescript/components/LucideLab.d.ts +1 -1
- package/lib/typescript/components/Mage.d.ts +1 -1
- package/lib/typescript/components/Majesticons.d.ts +1 -1
- package/lib/typescript/components/Maki.d.ts +1 -1
- package/lib/typescript/components/Map.d.ts +1 -1
- package/lib/typescript/components/Marketeq.d.ts +1 -1
- package/lib/typescript/components/MaterialIconTheme.d.ts +1 -1
- package/lib/typescript/components/MaterialSymbols.d.ts +1 -1
- package/lib/typescript/components/MaterialSymbolsLight.d.ts +1 -1
- package/lib/typescript/components/Mdi.d.ts +1 -1
- package/lib/typescript/components/MdiLight.d.ts +1 -1
- package/lib/typescript/components/MedicalIcon.d.ts +1 -1
- package/lib/typescript/components/Memory.d.ts +1 -1
- package/lib/typescript/components/Meteocons.d.ts +1 -1
- package/lib/typescript/components/MeteorIcons.d.ts +1 -1
- package/lib/typescript/components/Mi.d.ts +1 -1
- package/lib/typescript/components/Mingcute.d.ts +1 -1
- package/lib/typescript/components/MonoIcons.d.ts +1 -1
- package/lib/typescript/components/Mynaui.d.ts +1 -1
- package/lib/typescript/components/Nimbus.d.ts +1 -1
- package/lib/typescript/components/Nonicons.d.ts +1 -1
- package/lib/typescript/components/Nrk.d.ts +1 -1
- package/lib/typescript/components/Octicon.d.ts +1 -1
- package/lib/typescript/components/Oi.d.ts +1 -1
- package/lib/typescript/components/Ooui.d.ts +1 -1
- package/lib/typescript/components/Oui.d.ts +1 -1
- package/lib/typescript/components/Pajamas.d.ts +1 -1
- package/lib/typescript/components/Pepicons.d.ts +1 -1
- package/lib/typescript/components/PepiconsPencil.d.ts +1 -1
- package/lib/typescript/components/PepiconsPop.d.ts +1 -1
- package/lib/typescript/components/PepiconsPrint.d.ts +1 -1
- package/lib/typescript/components/Ph.d.ts +1 -1
- package/lib/typescript/components/Picon.d.ts +1 -1
- package/lib/typescript/components/Pixel.d.ts +1 -1
- package/lib/typescript/components/Pixelarticons.d.ts +1 -1
- package/lib/typescript/components/Prime.d.ts +1 -1
- package/lib/typescript/components/Proicons.d.ts +1 -1
- package/lib/typescript/components/Ps.d.ts +1 -1
- package/lib/typescript/components/QlementineIcons.d.ts +1 -1
- package/lib/typescript/components/Quill.d.ts +1 -1
- package/lib/typescript/components/RadixIcons.d.ts +1 -1
- package/lib/typescript/components/Raphael.d.ts +1 -1
- package/lib/typescript/components/Ri.d.ts +1 -1
- package/lib/typescript/components/RivetIcons.d.ts +1 -1
- package/lib/typescript/components/Roentgen.d.ts +1 -1
- package/lib/typescript/components/Si.d.ts +1 -1
- package/lib/typescript/components/SiGlyph.d.ts +1 -1
- package/lib/typescript/components/Sidekickicons.d.ts +1 -1
- package/lib/typescript/components/SimpleIcons.d.ts +1 -1
- package/lib/typescript/components/SimpleLineIcons.d.ts +1 -1
- package/lib/typescript/components/SkillIcons.d.ts +1 -1
- package/lib/typescript/components/Solar.d.ts +1 -1
- package/lib/typescript/components/Stash.d.ts +1 -1
- package/lib/typescript/components/Streamline.d.ts +1 -1
- package/lib/typescript/components/StreamlineBlock.d.ts +1 -1
- package/lib/typescript/components/StreamlineColor.d.ts +1 -1
- package/lib/typescript/components/StreamlineCyber.d.ts +1 -1
- package/lib/typescript/components/StreamlineCyberColor.d.ts +1 -1
- package/lib/typescript/components/StreamlineEmojis.d.ts +1 -1
- package/lib/typescript/components/StreamlineFlex.d.ts +1 -1
- package/lib/typescript/components/StreamlineFlexColor.d.ts +1 -1
- package/lib/typescript/components/StreamlineFreehand.d.ts +1 -1
- package/lib/typescript/components/StreamlineFreehandColor.d.ts +1 -1
- package/lib/typescript/components/StreamlineKameleonColor.d.ts +1 -1
- package/lib/typescript/components/StreamlineLogos.d.ts +1 -1
- package/lib/typescript/components/StreamlinePixel.d.ts +1 -1
- package/lib/typescript/components/StreamlinePlump.d.ts +1 -1
- package/lib/typescript/components/StreamlinePlumpColor.d.ts +1 -1
- package/lib/typescript/components/StreamlineSharp.d.ts +1 -1
- package/lib/typescript/components/StreamlineSharpColor.d.ts +1 -1
- package/lib/typescript/components/StreamlineStickiesColor.d.ts +1 -1
- package/lib/typescript/components/StreamlineUltimate.d.ts +1 -1
- package/lib/typescript/components/StreamlineUltimateColor.d.ts +1 -1
- package/lib/typescript/components/Subway.d.ts +1 -1
- package/lib/typescript/components/SvgSpinners.d.ts +1 -1
- package/lib/typescript/components/SystemUicons.d.ts +1 -1
- package/lib/typescript/components/Tabler.d.ts +1 -1
- package/lib/typescript/components/Tdesign.d.ts +1 -1
- package/lib/typescript/components/Teenyicons.d.ts +1 -1
- package/lib/typescript/components/Temaki.d.ts +1 -1
- package/lib/typescript/components/Token.d.ts +1 -1
- package/lib/typescript/components/TokenBranded.d.ts +1 -1
- package/lib/typescript/components/Topcoat.d.ts +1 -1
- package/lib/typescript/components/Typcn.d.ts +1 -1
- package/lib/typescript/components/Uil.d.ts +1 -1
- package/lib/typescript/components/Uim.d.ts +1 -1
- package/lib/typescript/components/Uis.d.ts +1 -1
- package/lib/typescript/components/Uit.d.ts +1 -1
- package/lib/typescript/components/Uiw.d.ts +1 -1
- package/lib/typescript/components/Unjs.d.ts +1 -1
- package/lib/typescript/components/Vaadin.d.ts +1 -1
- package/lib/typescript/components/Vs.d.ts +1 -1
- package/lib/typescript/components/VscodeIcons.d.ts +1 -1
- package/lib/typescript/components/Websymbol.d.ts +1 -1
- package/lib/typescript/components/Weui.d.ts +1 -1
- package/lib/typescript/components/Whh.d.ts +1 -1
- package/lib/typescript/components/Wi.d.ts +1 -1
- package/lib/typescript/components/Wpf.d.ts +1 -1
- package/lib/typescript/components/Zmdi.d.ts +1 -1
- package/lib/typescript/components/Zondicons.d.ts +1 -1
- package/lib/typescript/components/index.d.ts +38 -1
- package/lib/typescript/components/index.d.ts.map +1 -1
- package/lib/typescript/config/ConfigManager.d.ts +102 -0
- package/lib/typescript/config/ConfigManager.d.ts.map +1 -0
- package/lib/typescript/config/index.d.ts +22 -0
- package/lib/typescript/config/index.d.ts.map +1 -0
- package/lib/typescript/config/types.d.ts +112 -0
- package/lib/typescript/config/types.d.ts.map +1 -0
- package/lib/typescript/createIconSet.d.ts +1 -1
- package/lib/typescript/createIconSet.d.ts.map +1 -1
- package/lib/typescript/explorer/IconExplorer.d.ts +54 -0
- package/lib/typescript/explorer/IconExplorer.d.ts.map +1 -0
- package/lib/typescript/explorer/iconSets.d.ts +35 -0
- package/lib/typescript/explorer/iconSets.d.ts.map +1 -0
- package/lib/typescript/explorer/index.d.ts +33 -0
- package/lib/typescript/explorer/index.d.ts.map +1 -0
- package/lib/typescript/explorer/types.d.ts +329 -0
- package/lib/typescript/explorer/types.d.ts.map +1 -0
- package/lib/typescript/explorer/useExplorer.d.ts +18 -0
- package/lib/typescript/explorer/useExplorer.d.ts.map +1 -0
- package/lib/typescript/index.d.ts +25 -4
- package/lib/typescript/index.d.ts.map +1 -1
- package/lib/typescript/navigation/createDrawerIcon.d.ts +74 -0
- package/lib/typescript/navigation/createDrawerIcon.d.ts.map +1 -0
- package/lib/typescript/navigation/createHeaderIcon.d.ts +145 -0
- package/lib/typescript/navigation/createHeaderIcon.d.ts.map +1 -0
- package/lib/typescript/navigation/createTabBarIcon.d.ts +99 -0
- package/lib/typescript/navigation/createTabBarIcon.d.ts.map +1 -0
- package/lib/typescript/navigation/index.d.ts +51 -0
- package/lib/typescript/navigation/index.d.ts.map +1 -0
- package/lib/typescript/navigation/types.d.ts +149 -0
- package/lib/typescript/navigation/types.d.ts.map +1 -0
- package/lib/typescript/navigation/useNavigationIcon.d.ts +91 -0
- package/lib/typescript/navigation/useNavigationIcon.d.ts.map +1 -0
- package/lib/typescript/network/IconifyAPI.d.ts +32 -0
- package/lib/typescript/network/IconifyAPI.d.ts.map +1 -1
- package/lib/typescript/network/index.d.ts +2 -1
- package/lib/typescript/network/index.d.ts.map +1 -1
- package/lib/typescript/performance/PerformanceMonitor.d.ts +76 -0
- package/lib/typescript/performance/PerformanceMonitor.d.ts.map +1 -0
- package/lib/typescript/performance/index.d.ts +21 -0
- package/lib/typescript/performance/index.d.ts.map +1 -0
- package/lib/typescript/performance/types.d.ts +156 -0
- package/lib/typescript/performance/types.d.ts.map +1 -0
- package/lib/typescript/placeholder/PlaceholderFactory.d.ts +44 -0
- package/lib/typescript/placeholder/PlaceholderFactory.d.ts.map +1 -0
- package/lib/typescript/placeholder/Pulse.d.ts +18 -0
- package/lib/typescript/placeholder/Pulse.d.ts.map +1 -0
- package/lib/typescript/placeholder/Shimmer.d.ts +19 -0
- package/lib/typescript/placeholder/Shimmer.d.ts.map +1 -0
- package/lib/typescript/placeholder/Skeleton.d.ts +18 -0
- package/lib/typescript/placeholder/Skeleton.d.ts.map +1 -0
- package/lib/typescript/placeholder/index.d.ts +12 -0
- package/lib/typescript/placeholder/index.d.ts.map +1 -0
- package/lib/typescript/placeholder/types.d.ts +63 -0
- package/lib/typescript/placeholder/types.d.ts.map +1 -0
- package/lib/typescript/theme/IconThemeProvider.d.ts +64 -0
- package/lib/typescript/theme/IconThemeProvider.d.ts.map +1 -0
- package/lib/typescript/theme/context.d.ts +24 -0
- package/lib/typescript/theme/context.d.ts.map +1 -0
- package/lib/typescript/theme/index.d.ts +10 -0
- package/lib/typescript/theme/index.d.ts.map +1 -0
- package/lib/typescript/theme/types.d.ts +85 -0
- package/lib/typescript/theme/types.d.ts.map +1 -0
- package/lib/typescript/theme/useIconTheme.d.ts +78 -0
- package/lib/typescript/theme/useIconTheme.d.ts.map +1 -0
- package/lib/typescript/types/index.d.ts +58 -1
- package/lib/typescript/types/index.d.ts.map +1 -1
- package/package.json +41 -3
- package/src/IconRenderer.tsx +91 -4
- package/src/accessibility/AccessibilityProvider.tsx +220 -0
- package/src/accessibility/index.ts +63 -0
- package/src/accessibility/types.ts +152 -0
- package/src/accessibility/useAccessibleIcon.ts +220 -0
- package/src/accessibility/utils.ts +180 -0
- package/src/alias/Icon.tsx +113 -0
- package/src/alias/IconAliasContext.tsx +180 -0
- package/src/alias/createIconAliases.tsx +233 -0
- package/src/alias/index.ts +59 -0
- package/src/alias/types.ts +132 -0
- package/src/animated/AnimatedIcon.tsx +116 -0
- package/src/animated/index.ts +97 -0
- package/src/animated/presets.ts +211 -0
- package/src/animated/types.ts +239 -0
- package/src/animated/useIconAnimation.ts +383 -0
- package/src/babel/ast-utils.ts +219 -0
- package/src/babel/cache-writer.ts +323 -0
- package/src/babel/collector.ts +224 -0
- package/src/babel/index.ts +60 -0
- package/src/babel/plugin.ts +254 -0
- package/src/babel/types.ts +717 -0
- package/src/bundle/index.ts +313 -0
- package/src/cache/CacheManager.ts +123 -6
- package/src/cli/commands/analyze.ts +195 -0
- package/src/cli/commands/bundle.ts +231 -0
- package/src/cli/index.ts +153 -0
- package/src/cli/parser.ts +275 -0
- package/src/cli/types.ts +187 -0
- package/src/components/index.ts +52 -1
- package/src/config/ConfigManager.ts +196 -0
- package/src/config/index.ts +34 -0
- package/src/config/types.ts +149 -0
- package/src/createIconSet.tsx +48 -9
- package/src/explorer/IconExplorer.tsx +844 -0
- package/src/explorer/iconSets.ts +334 -0
- package/src/explorer/index.ts +64 -0
- package/src/explorer/types.ts +392 -0
- package/src/explorer/useExplorer.ts +390 -0
- package/src/index.ts +218 -9
- package/src/navigation/createDrawerIcon.tsx +113 -0
- package/src/navigation/createHeaderIcon.tsx +213 -0
- package/src/navigation/createTabBarIcon.tsx +180 -0
- package/src/navigation/index.ts +80 -0
- package/src/navigation/types.ts +155 -0
- package/src/navigation/useNavigationIcon.tsx +156 -0
- package/src/network/IconifyAPI.ts +182 -14
- package/src/network/index.ts +11 -1
- package/src/performance/PerformanceMonitor.ts +367 -0
- package/src/performance/index.ts +39 -0
- package/src/performance/types.ts +185 -0
- package/src/placeholder/PlaceholderFactory.tsx +133 -0
- package/src/placeholder/Pulse.tsx +86 -0
- package/src/placeholder/Shimmer.tsx +104 -0
- package/src/placeholder/Skeleton.tsx +52 -0
- package/src/placeholder/index.ts +21 -0
- package/src/placeholder/types.ts +78 -0
- package/src/theme/IconThemeProvider.tsx +94 -0
- package/src/theme/context.ts +51 -0
- package/src/theme/index.ts +19 -0
- package/src/theme/types.ts +108 -0
- package/src/theme/useIconTheme.ts +119 -0
- package/src/types/index.ts +78 -1
- package/lib/commonjs/components/Phosphor.js +0 -493
- package/lib/commonjs/components/Phosphor.js.map +0 -1
- package/lib/module/components/Phosphor.js +0 -488
- package/lib/module/components/Phosphor.js.map +0 -1
- package/lib/typescript/components/Phosphor.d.ts +0 -472
- package/lib/typescript/components/Phosphor.d.ts.map +0 -1
- package/src/components/Phosphor.tsx +0 -506
|
@@ -0,0 +1,231 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Bundle Command
|
|
3
|
+
* Fetches icons and creates an offline bundle file
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
import * as fs from 'fs';
|
|
7
|
+
import * as path from 'path';
|
|
8
|
+
import type { BundleOptions, IconBundle } from '../types';
|
|
9
|
+
import { EXIT_CODES } from '../types';
|
|
10
|
+
import { analyzeDirectory, getUniqueIcons, parseIconList } from '../parser';
|
|
11
|
+
|
|
12
|
+
/**
|
|
13
|
+
* Iconify API base URL
|
|
14
|
+
*/
|
|
15
|
+
const ICONIFY_API = 'https://api.iconify.design';
|
|
16
|
+
|
|
17
|
+
/**
|
|
18
|
+
* Fetch timeout in milliseconds
|
|
19
|
+
*/
|
|
20
|
+
const FETCH_TIMEOUT = 30000;
|
|
21
|
+
|
|
22
|
+
/**
|
|
23
|
+
* Fetch multiple icons with batching
|
|
24
|
+
*/
|
|
25
|
+
async function fetchIcons(
|
|
26
|
+
icons: string[],
|
|
27
|
+
verbose: boolean,
|
|
28
|
+
onProgress?: (current: number, total: number) => void
|
|
29
|
+
): Promise<Record<string, { svg: string; width: number; height: number }>> {
|
|
30
|
+
const results: Record<string, { svg: string; width: number; height: number }> = {};
|
|
31
|
+
|
|
32
|
+
// Group by prefix for batch fetching
|
|
33
|
+
const byPrefix = new Map<string, string[]>();
|
|
34
|
+
|
|
35
|
+
for (const icon of icons) {
|
|
36
|
+
const [prefix, name] = icon.split(':');
|
|
37
|
+
if (!byPrefix.has(prefix)) {
|
|
38
|
+
byPrefix.set(prefix, []);
|
|
39
|
+
}
|
|
40
|
+
byPrefix.get(prefix)!.push(name);
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
let processed = 0;
|
|
44
|
+
const total = icons.length;
|
|
45
|
+
|
|
46
|
+
// Fetch each prefix batch
|
|
47
|
+
for (const [prefix, names] of byPrefix) {
|
|
48
|
+
try {
|
|
49
|
+
const controller = new AbortController();
|
|
50
|
+
const timeout = setTimeout(() => controller.abort(), FETCH_TIMEOUT);
|
|
51
|
+
|
|
52
|
+
// Sort names alphabetically (Iconify best practice)
|
|
53
|
+
const sortedNames = [...names].sort();
|
|
54
|
+
const url = `${ICONIFY_API}/${prefix}.json?icons=${sortedNames.join(',')}`;
|
|
55
|
+
|
|
56
|
+
if (verbose) {
|
|
57
|
+
console.log(` Fetching ${sortedNames.length} icons from ${prefix}...`);
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
const response = await fetch(url, { signal: controller.signal });
|
|
61
|
+
clearTimeout(timeout);
|
|
62
|
+
|
|
63
|
+
if (!response.ok) {
|
|
64
|
+
console.error(` Failed to fetch ${prefix}: ${response.status}`);
|
|
65
|
+
processed += names.length;
|
|
66
|
+
continue;
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
const data = await response.json();
|
|
70
|
+
const defaultWidth = data.width ?? 24;
|
|
71
|
+
const defaultHeight = data.height ?? 24;
|
|
72
|
+
|
|
73
|
+
for (const name of names) {
|
|
74
|
+
const iconData = data.icons?.[name];
|
|
75
|
+
|
|
76
|
+
if (iconData) {
|
|
77
|
+
const width = iconData.width ?? defaultWidth;
|
|
78
|
+
const height = iconData.height ?? defaultHeight;
|
|
79
|
+
const body = iconData.body;
|
|
80
|
+
const svg = `<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 ${width} ${height}">${body}</svg>`;
|
|
81
|
+
|
|
82
|
+
results[`${prefix}:${name}`] = { svg, width, height };
|
|
83
|
+
} else if (verbose) {
|
|
84
|
+
console.error(` Icon not found: ${prefix}:${name}`);
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
processed++;
|
|
88
|
+
onProgress?.(processed, total);
|
|
89
|
+
}
|
|
90
|
+
} catch (error) {
|
|
91
|
+
if (verbose) {
|
|
92
|
+
console.error(` Error fetching ${prefix}:`, error);
|
|
93
|
+
}
|
|
94
|
+
processed += names.length;
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
return results;
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
/**
|
|
102
|
+
* Bundle command implementation
|
|
103
|
+
*/
|
|
104
|
+
export async function bundleCommand(options: BundleOptions): Promise<number> {
|
|
105
|
+
const {
|
|
106
|
+
src = './src',
|
|
107
|
+
output = './assets/icons.bundle.json',
|
|
108
|
+
auto = true,
|
|
109
|
+
icons: manualIcons,
|
|
110
|
+
exclude = [],
|
|
111
|
+
verbose = false,
|
|
112
|
+
pretty = false,
|
|
113
|
+
} = options;
|
|
114
|
+
|
|
115
|
+
console.log('\n📦 rn-iconify Bundle Generator\n');
|
|
116
|
+
|
|
117
|
+
let iconsToBundle: string[] = [];
|
|
118
|
+
|
|
119
|
+
// Auto-detect icons from source
|
|
120
|
+
if (auto) {
|
|
121
|
+
console.log(`🔍 Analyzing source code in ${src}...`);
|
|
122
|
+
|
|
123
|
+
const analysis = analyzeDirectory(src, verbose);
|
|
124
|
+
|
|
125
|
+
if (analysis.totalIcons === 0) {
|
|
126
|
+
console.log('⚠️ No icons found in source code.');
|
|
127
|
+
} else {
|
|
128
|
+
console.log(` Found ${analysis.totalIcons} unique icons\n`);
|
|
129
|
+
iconsToBundle = getUniqueIcons(analysis);
|
|
130
|
+
}
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
// Add manual icons
|
|
134
|
+
if (manualIcons) {
|
|
135
|
+
const parsed = parseIconList(manualIcons);
|
|
136
|
+
console.log(`📋 Adding ${parsed.length} manual icons...`);
|
|
137
|
+
|
|
138
|
+
for (const icon of parsed) {
|
|
139
|
+
if (!iconsToBundle.includes(icon)) {
|
|
140
|
+
iconsToBundle.push(icon);
|
|
141
|
+
}
|
|
142
|
+
}
|
|
143
|
+
}
|
|
144
|
+
|
|
145
|
+
// Apply exclusions
|
|
146
|
+
if (exclude.length > 0) {
|
|
147
|
+
const beforeCount = iconsToBundle.length;
|
|
148
|
+
iconsToBundle = iconsToBundle.filter((icon) => {
|
|
149
|
+
return !exclude.some((pattern) => {
|
|
150
|
+
if (pattern.includes('*')) {
|
|
151
|
+
const regex = new RegExp('^' + pattern.replace(/\*/g, '.*') + '$');
|
|
152
|
+
return regex.test(icon);
|
|
153
|
+
}
|
|
154
|
+
return icon === pattern;
|
|
155
|
+
});
|
|
156
|
+
});
|
|
157
|
+
|
|
158
|
+
if (verbose) {
|
|
159
|
+
console.log(` Excluded ${beforeCount - iconsToBundle.length} icons`);
|
|
160
|
+
}
|
|
161
|
+
}
|
|
162
|
+
|
|
163
|
+
if (iconsToBundle.length === 0) {
|
|
164
|
+
console.error('\n❌ No icons to bundle.');
|
|
165
|
+
console.log(' Use --icons to specify icons manually or check your source code.\n');
|
|
166
|
+
return EXIT_CODES.ERROR;
|
|
167
|
+
}
|
|
168
|
+
|
|
169
|
+
console.log(`\n📥 Fetching ${iconsToBundle.length} icons from Iconify API...`);
|
|
170
|
+
|
|
171
|
+
// Progress indicator
|
|
172
|
+
let lastPercent = 0;
|
|
173
|
+
const onProgress = (current: number, total: number) => {
|
|
174
|
+
const percent = Math.floor((current / total) * 100);
|
|
175
|
+
if (percent >= lastPercent + 10) {
|
|
176
|
+
lastPercent = percent;
|
|
177
|
+
process.stdout.write(` ${percent}%`);
|
|
178
|
+
if (percent < 100) process.stdout.write(' ');
|
|
179
|
+
}
|
|
180
|
+
};
|
|
181
|
+
|
|
182
|
+
const fetchedIcons = await fetchIcons(iconsToBundle, verbose, onProgress);
|
|
183
|
+
console.log('\n');
|
|
184
|
+
|
|
185
|
+
const fetchedCount = Object.keys(fetchedIcons).length;
|
|
186
|
+
const failedCount = iconsToBundle.length - fetchedCount;
|
|
187
|
+
|
|
188
|
+
if (failedCount > 0) {
|
|
189
|
+
console.log(`⚠️ Failed to fetch ${failedCount} icons`);
|
|
190
|
+
}
|
|
191
|
+
|
|
192
|
+
if (fetchedCount === 0) {
|
|
193
|
+
console.error('❌ No icons were fetched. Check your network connection.\n');
|
|
194
|
+
return EXIT_CODES.NETWORK_ERROR;
|
|
195
|
+
}
|
|
196
|
+
|
|
197
|
+
// Create bundle
|
|
198
|
+
const bundle: IconBundle = {
|
|
199
|
+
version: '1.0.0',
|
|
200
|
+
generatedAt: new Date().toISOString(),
|
|
201
|
+
icons: fetchedIcons,
|
|
202
|
+
count: fetchedCount,
|
|
203
|
+
};
|
|
204
|
+
|
|
205
|
+
// Ensure output directory exists
|
|
206
|
+
const outputDir = path.dirname(output);
|
|
207
|
+
if (!fs.existsSync(outputDir)) {
|
|
208
|
+
fs.mkdirSync(outputDir, { recursive: true });
|
|
209
|
+
}
|
|
210
|
+
|
|
211
|
+
// Write bundle file
|
|
212
|
+
const jsonContent = pretty ? JSON.stringify(bundle, null, 2) : JSON.stringify(bundle);
|
|
213
|
+
|
|
214
|
+
fs.writeFileSync(output, jsonContent, 'utf-8');
|
|
215
|
+
|
|
216
|
+
// Calculate file size
|
|
217
|
+
const stats = fs.statSync(output);
|
|
218
|
+
const sizeKB = (stats.size / 1024).toFixed(2);
|
|
219
|
+
|
|
220
|
+
console.log(`✅ Bundle created successfully!`);
|
|
221
|
+
console.log(` Output: ${output}`);
|
|
222
|
+
console.log(` Icons: ${fetchedCount}`);
|
|
223
|
+
console.log(` Size: ${sizeKB} KB\n`);
|
|
224
|
+
|
|
225
|
+
console.log('💡 Usage:');
|
|
226
|
+
console.log(" import { loadOfflineBundle } from 'rn-iconify';");
|
|
227
|
+
console.log(` import bundle from '${output.replace(/^\.\//, './')}';`);
|
|
228
|
+
console.log(' loadOfflineBundle(bundle);\n');
|
|
229
|
+
|
|
230
|
+
return EXIT_CODES.SUCCESS;
|
|
231
|
+
}
|
package/src/cli/index.ts
ADDED
|
@@ -0,0 +1,153 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
/**
|
|
3
|
+
* rn-iconify CLI
|
|
4
|
+
* Command-line tools for icon bundling and analysis
|
|
5
|
+
*/
|
|
6
|
+
|
|
7
|
+
import { bundleCommand } from './commands/bundle';
|
|
8
|
+
import { analyzeCommand } from './commands/analyze';
|
|
9
|
+
import { EXIT_CODES } from './types';
|
|
10
|
+
import type { BundleOptions, AnalyzeOptions } from './types';
|
|
11
|
+
|
|
12
|
+
/**
|
|
13
|
+
* Package version
|
|
14
|
+
*/
|
|
15
|
+
const VERSION = '1.0.0';
|
|
16
|
+
|
|
17
|
+
/**
|
|
18
|
+
* Help text
|
|
19
|
+
*/
|
|
20
|
+
const HELP = `
|
|
21
|
+
📦 rn-iconify CLI v${VERSION}
|
|
22
|
+
|
|
23
|
+
Usage: npx rn-iconify <command> [options]
|
|
24
|
+
|
|
25
|
+
Commands:
|
|
26
|
+
bundle Generate offline icon bundle
|
|
27
|
+
analyze Analyze icon usage in source code
|
|
28
|
+
help Show this help message
|
|
29
|
+
version Show version
|
|
30
|
+
|
|
31
|
+
Examples:
|
|
32
|
+
npx rn-iconify bundle --auto --output ./assets/icons.json
|
|
33
|
+
npx rn-iconify bundle --icons "mdi:home,mdi:settings"
|
|
34
|
+
npx rn-iconify analyze --src ./src --format table
|
|
35
|
+
npx rn-iconify analyze --detailed
|
|
36
|
+
|
|
37
|
+
Bundle Options:
|
|
38
|
+
--src <path> Source directory to analyze (default: ./src)
|
|
39
|
+
--output <path> Output file path (default: ./assets/icons.bundle.json)
|
|
40
|
+
--auto Auto-detect icons from source code (default: true)
|
|
41
|
+
--icons <list> Comma-separated list of icons to include
|
|
42
|
+
--exclude <list> Comma-separated patterns to exclude
|
|
43
|
+
--verbose Show detailed output
|
|
44
|
+
--pretty Pretty-print JSON output
|
|
45
|
+
|
|
46
|
+
Analyze Options:
|
|
47
|
+
--src <path> Source directory to analyze (default: ./src)
|
|
48
|
+
--format <type> Output format: table, json, markdown (default: table)
|
|
49
|
+
--detailed Show file locations for each icon
|
|
50
|
+
--verbose Show detailed output
|
|
51
|
+
|
|
52
|
+
More info: https://github.com/mogretici/rn-iconify
|
|
53
|
+
`;
|
|
54
|
+
|
|
55
|
+
/**
|
|
56
|
+
* Parse command line arguments
|
|
57
|
+
*/
|
|
58
|
+
function parseArgs(args: string[]): {
|
|
59
|
+
command: string;
|
|
60
|
+
options: Record<string, string | boolean | string[]>;
|
|
61
|
+
} {
|
|
62
|
+
const command = args[0] || 'help';
|
|
63
|
+
const options: Record<string, string | boolean | string[]> = {};
|
|
64
|
+
|
|
65
|
+
for (let i = 1; i < args.length; i++) {
|
|
66
|
+
const arg = args[i];
|
|
67
|
+
|
|
68
|
+
if (arg.startsWith('--')) {
|
|
69
|
+
const key = arg.slice(2);
|
|
70
|
+
const nextArg = args[i + 1];
|
|
71
|
+
|
|
72
|
+
// Boolean flags
|
|
73
|
+
if (
|
|
74
|
+
!nextArg ||
|
|
75
|
+
nextArg.startsWith('--') ||
|
|
76
|
+
key === 'auto' ||
|
|
77
|
+
key === 'verbose' ||
|
|
78
|
+
key === 'pretty' ||
|
|
79
|
+
key === 'detailed'
|
|
80
|
+
) {
|
|
81
|
+
options[key] = true;
|
|
82
|
+
} else {
|
|
83
|
+
options[key] = nextArg;
|
|
84
|
+
i++;
|
|
85
|
+
}
|
|
86
|
+
} else if (arg.startsWith('-')) {
|
|
87
|
+
// Short flags
|
|
88
|
+
const key = arg.slice(1);
|
|
89
|
+
options[key] = true;
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
return { command, options };
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
/**
|
|
97
|
+
* Main CLI entry point
|
|
98
|
+
*/
|
|
99
|
+
async function main(): Promise<void> {
|
|
100
|
+
const args = process.argv.slice(2);
|
|
101
|
+
const { command, options } = parseArgs(args);
|
|
102
|
+
|
|
103
|
+
switch (command) {
|
|
104
|
+
case 'bundle': {
|
|
105
|
+
const bundleOptions: BundleOptions = {
|
|
106
|
+
src: options.src as string,
|
|
107
|
+
output: options.output as string,
|
|
108
|
+
auto: options.auto !== false,
|
|
109
|
+
icons: options.icons as string,
|
|
110
|
+
exclude: options.exclude ? (options.exclude as string).split(',') : undefined,
|
|
111
|
+
verbose: options.verbose as boolean,
|
|
112
|
+
pretty: options.pretty as boolean,
|
|
113
|
+
};
|
|
114
|
+
|
|
115
|
+
const exitCode = await bundleCommand(bundleOptions);
|
|
116
|
+
process.exit(exitCode);
|
|
117
|
+
break;
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
case 'analyze': {
|
|
121
|
+
const analyzeOptions: AnalyzeOptions = {
|
|
122
|
+
src: options.src as string,
|
|
123
|
+
format: options.format as 'table' | 'json' | 'markdown',
|
|
124
|
+
detailed: options.detailed as boolean,
|
|
125
|
+
verbose: options.verbose as boolean,
|
|
126
|
+
};
|
|
127
|
+
|
|
128
|
+
const exitCode = analyzeCommand(analyzeOptions);
|
|
129
|
+
process.exit(exitCode);
|
|
130
|
+
break;
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
case 'version':
|
|
134
|
+
case '-v':
|
|
135
|
+
case '--version':
|
|
136
|
+
console.log(`rn-iconify v${VERSION}`);
|
|
137
|
+
process.exit(EXIT_CODES.SUCCESS);
|
|
138
|
+
break;
|
|
139
|
+
|
|
140
|
+
case 'help':
|
|
141
|
+
case '-h':
|
|
142
|
+
case '--help':
|
|
143
|
+
default:
|
|
144
|
+
console.log(HELP);
|
|
145
|
+
process.exit(command === 'help' ? EXIT_CODES.SUCCESS : EXIT_CODES.INVALID_ARGS);
|
|
146
|
+
}
|
|
147
|
+
}
|
|
148
|
+
|
|
149
|
+
// Run CLI
|
|
150
|
+
main().catch((error) => {
|
|
151
|
+
console.error('Error:', error.message);
|
|
152
|
+
process.exit(EXIT_CODES.ERROR);
|
|
153
|
+
});
|
|
@@ -0,0 +1,275 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Icon Usage Parser
|
|
3
|
+
* Analyzes source code to find icon usage patterns
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
import * as fs from 'fs';
|
|
7
|
+
import * as path from 'path';
|
|
8
|
+
import type { IconUsage, AnalysisResult } from './types';
|
|
9
|
+
|
|
10
|
+
/**
|
|
11
|
+
* File extensions to analyze
|
|
12
|
+
*/
|
|
13
|
+
const ANALYZABLE_EXTENSIONS = ['.tsx', '.jsx', '.ts', '.js'];
|
|
14
|
+
|
|
15
|
+
/**
|
|
16
|
+
* Regex patterns for finding icon usage
|
|
17
|
+
*/
|
|
18
|
+
const PATTERNS = {
|
|
19
|
+
// JSX component usage: <Mdi name="home" /> or <Mdi name='home' />
|
|
20
|
+
jsxComponent: /<(\w+)\s+[^>]*name\s*=\s*["']([^"']+)["'][^>]*\/?>/g,
|
|
21
|
+
|
|
22
|
+
// Import statement to find component names
|
|
23
|
+
iconImport: /import\s*{([^}]+)}\s*from\s*['"]rn-iconify['"]/g,
|
|
24
|
+
|
|
25
|
+
// prefetchIcons usage: prefetchIcons(['mdi:home', 'mdi:settings'])
|
|
26
|
+
prefetchIcons: /prefetchIcons\s*\(\s*\[([^\]]+)\]/g,
|
|
27
|
+
|
|
28
|
+
// String icon names in arrays or objects: 'mdi:home' or "mdi:home"
|
|
29
|
+
iconString: /['"](\w+:[^'"]+)['"]/g,
|
|
30
|
+
};
|
|
31
|
+
|
|
32
|
+
/**
|
|
33
|
+
* Map of component names to icon prefixes
|
|
34
|
+
*/
|
|
35
|
+
const COMPONENT_PREFIX_MAP: Record<string, string> = {
|
|
36
|
+
Mdi: 'mdi',
|
|
37
|
+
MdiLight: 'mdi-light',
|
|
38
|
+
Heroicons: 'heroicons',
|
|
39
|
+
Lucide: 'lucide',
|
|
40
|
+
Ph: 'ph',
|
|
41
|
+
Feather: 'feather',
|
|
42
|
+
Tabler: 'tabler',
|
|
43
|
+
Bi: 'bi',
|
|
44
|
+
Fa6Solid: 'fa6-solid',
|
|
45
|
+
Fa6Regular: 'fa6-regular',
|
|
46
|
+
Fa6Brands: 'fa6-brands',
|
|
47
|
+
Fa7Solid: 'fa7-solid',
|
|
48
|
+
Ri: 'ri',
|
|
49
|
+
Carbon: 'carbon',
|
|
50
|
+
Fluent: 'fluent',
|
|
51
|
+
MaterialSymbols: 'material-symbols',
|
|
52
|
+
Solar: 'solar',
|
|
53
|
+
Ion: 'ion',
|
|
54
|
+
AntDesign: 'ant-design',
|
|
55
|
+
// Add more mappings as needed
|
|
56
|
+
};
|
|
57
|
+
|
|
58
|
+
/**
|
|
59
|
+
* Get all files recursively from a directory
|
|
60
|
+
*/
|
|
61
|
+
function getFilesRecursively(dir: string, files: string[] = []): string[] {
|
|
62
|
+
if (!fs.existsSync(dir)) {
|
|
63
|
+
return files;
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
const entries = fs.readdirSync(dir, { withFileTypes: true });
|
|
67
|
+
|
|
68
|
+
for (const entry of entries) {
|
|
69
|
+
const fullPath = path.join(dir, entry.name);
|
|
70
|
+
|
|
71
|
+
// Skip node_modules and hidden directories
|
|
72
|
+
if (entry.name.startsWith('.') || entry.name === 'node_modules') {
|
|
73
|
+
continue;
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
if (entry.isDirectory()) {
|
|
77
|
+
getFilesRecursively(fullPath, files);
|
|
78
|
+
} else if (ANALYZABLE_EXTENSIONS.includes(path.extname(entry.name))) {
|
|
79
|
+
files.push(fullPath);
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
return files;
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
/**
|
|
87
|
+
* Parse a single file for icon usage
|
|
88
|
+
*/
|
|
89
|
+
function parseFile(filePath: string, verbose: boolean = false): Map<string, IconUsage> {
|
|
90
|
+
const usageMap = new Map<string, IconUsage>();
|
|
91
|
+
|
|
92
|
+
try {
|
|
93
|
+
const content = fs.readFileSync(filePath, 'utf-8');
|
|
94
|
+
const lines = content.split('\n');
|
|
95
|
+
|
|
96
|
+
// Track which icon components are imported
|
|
97
|
+
const importedComponents = new Set<string>();
|
|
98
|
+
|
|
99
|
+
// Find imports from rn-iconify
|
|
100
|
+
let importMatch;
|
|
101
|
+
PATTERNS.iconImport.lastIndex = 0;
|
|
102
|
+
while ((importMatch = PATTERNS.iconImport.exec(content)) !== null) {
|
|
103
|
+
const imports = importMatch[1].split(',').map((s) => s.trim());
|
|
104
|
+
imports.forEach((imp) => {
|
|
105
|
+
// Handle renamed imports: Mdi as Icon
|
|
106
|
+
const name = imp.split(/\s+as\s+/)[0].trim();
|
|
107
|
+
if (COMPONENT_PREFIX_MAP[name]) {
|
|
108
|
+
importedComponents.add(name);
|
|
109
|
+
}
|
|
110
|
+
});
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
// Find JSX component usage
|
|
114
|
+
for (let lineIndex = 0; lineIndex < lines.length; lineIndex++) {
|
|
115
|
+
const line = lines[lineIndex];
|
|
116
|
+
const lineNum = lineIndex + 1;
|
|
117
|
+
|
|
118
|
+
// Match <ComponentName name="iconName" />
|
|
119
|
+
for (const componentName of importedComponents) {
|
|
120
|
+
const componentRegex = new RegExp(
|
|
121
|
+
`<${componentName}\\s+[^>]*name\\s*=\\s*["']([^"']+)["']`,
|
|
122
|
+
'g'
|
|
123
|
+
);
|
|
124
|
+
|
|
125
|
+
let match;
|
|
126
|
+
while ((match = componentRegex.exec(line)) !== null) {
|
|
127
|
+
const iconName = match[1];
|
|
128
|
+
const prefix = COMPONENT_PREFIX_MAP[componentName];
|
|
129
|
+
const fullIconName = `${prefix}:${iconName}`;
|
|
130
|
+
const column = match.index + 1;
|
|
131
|
+
|
|
132
|
+
if (!usageMap.has(fullIconName)) {
|
|
133
|
+
usageMap.set(fullIconName, {
|
|
134
|
+
icon: fullIconName,
|
|
135
|
+
count: 0,
|
|
136
|
+
locations: [],
|
|
137
|
+
});
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
const usage = usageMap.get(fullIconName)!;
|
|
141
|
+
usage.count++;
|
|
142
|
+
usage.locations.push({
|
|
143
|
+
file: filePath,
|
|
144
|
+
line: lineNum,
|
|
145
|
+
column,
|
|
146
|
+
});
|
|
147
|
+
}
|
|
148
|
+
}
|
|
149
|
+
|
|
150
|
+
// Match prefetchIcons and direct string patterns
|
|
151
|
+
PATTERNS.iconString.lastIndex = 0;
|
|
152
|
+
let stringMatch;
|
|
153
|
+
while ((stringMatch = PATTERNS.iconString.exec(line)) !== null) {
|
|
154
|
+
const iconName = stringMatch[1];
|
|
155
|
+
|
|
156
|
+
// Validate icon name format (prefix:name)
|
|
157
|
+
if (iconName.includes(':') && !iconName.includes('/')) {
|
|
158
|
+
if (!usageMap.has(iconName)) {
|
|
159
|
+
usageMap.set(iconName, {
|
|
160
|
+
icon: iconName,
|
|
161
|
+
count: 0,
|
|
162
|
+
locations: [],
|
|
163
|
+
});
|
|
164
|
+
}
|
|
165
|
+
|
|
166
|
+
const usage = usageMap.get(iconName)!;
|
|
167
|
+
usage.count++;
|
|
168
|
+
usage.locations.push({
|
|
169
|
+
file: filePath,
|
|
170
|
+
line: lineNum,
|
|
171
|
+
column: stringMatch.index + 1,
|
|
172
|
+
});
|
|
173
|
+
}
|
|
174
|
+
}
|
|
175
|
+
}
|
|
176
|
+
|
|
177
|
+
if (verbose && usageMap.size > 0) {
|
|
178
|
+
console.log(` Found ${usageMap.size} icons in ${filePath}`);
|
|
179
|
+
}
|
|
180
|
+
} catch (error) {
|
|
181
|
+
if (verbose) {
|
|
182
|
+
console.error(` Error parsing ${filePath}:`, error);
|
|
183
|
+
}
|
|
184
|
+
}
|
|
185
|
+
|
|
186
|
+
return usageMap;
|
|
187
|
+
}
|
|
188
|
+
|
|
189
|
+
/**
|
|
190
|
+
* Merge icon usage maps
|
|
191
|
+
*/
|
|
192
|
+
function mergeUsageMaps(target: Map<string, IconUsage>, source: Map<string, IconUsage>): void {
|
|
193
|
+
for (const [icon, usage] of source) {
|
|
194
|
+
if (target.has(icon)) {
|
|
195
|
+
const existing = target.get(icon)!;
|
|
196
|
+
existing.count += usage.count;
|
|
197
|
+
existing.locations.push(...usage.locations);
|
|
198
|
+
} else {
|
|
199
|
+
target.set(icon, { ...usage });
|
|
200
|
+
}
|
|
201
|
+
}
|
|
202
|
+
}
|
|
203
|
+
|
|
204
|
+
/**
|
|
205
|
+
* Analyze a directory for icon usage
|
|
206
|
+
*/
|
|
207
|
+
export function analyzeDirectory(srcDir: string, verbose: boolean = false): AnalysisResult {
|
|
208
|
+
const absolutePath = path.resolve(srcDir);
|
|
209
|
+
|
|
210
|
+
if (verbose) {
|
|
211
|
+
console.log(`Analyzing directory: ${absolutePath}`);
|
|
212
|
+
}
|
|
213
|
+
|
|
214
|
+
const files = getFilesRecursively(absolutePath);
|
|
215
|
+
|
|
216
|
+
if (verbose) {
|
|
217
|
+
console.log(`Found ${files.length} files to analyze`);
|
|
218
|
+
}
|
|
219
|
+
|
|
220
|
+
const allUsage = new Map<string, IconUsage>();
|
|
221
|
+
|
|
222
|
+
for (const file of files) {
|
|
223
|
+
const fileUsage = parseFile(file, verbose);
|
|
224
|
+
mergeUsageMaps(allUsage, fileUsage);
|
|
225
|
+
}
|
|
226
|
+
|
|
227
|
+
// Group by prefix
|
|
228
|
+
const byPrefix: Record<string, { count: number; icons: string[] }> = {};
|
|
229
|
+
const icons: IconUsage[] = [];
|
|
230
|
+
|
|
231
|
+
for (const [iconName, usage] of allUsage) {
|
|
232
|
+
const [prefix] = iconName.split(':');
|
|
233
|
+
|
|
234
|
+
if (!byPrefix[prefix]) {
|
|
235
|
+
byPrefix[prefix] = { count: 0, icons: [] };
|
|
236
|
+
}
|
|
237
|
+
|
|
238
|
+
byPrefix[prefix].count += usage.count;
|
|
239
|
+
byPrefix[prefix].icons.push(iconName);
|
|
240
|
+
icons.push(usage);
|
|
241
|
+
}
|
|
242
|
+
|
|
243
|
+
// Sort icons by count (descending)
|
|
244
|
+
icons.sort((a, b) => b.count - a.count);
|
|
245
|
+
|
|
246
|
+
return {
|
|
247
|
+
totalIcons: allUsage.size,
|
|
248
|
+
totalUsage: icons.reduce((sum, i) => sum + i.count, 0),
|
|
249
|
+
byPrefix,
|
|
250
|
+
icons,
|
|
251
|
+
filesAnalyzed: files.length,
|
|
252
|
+
timestamp: new Date().toISOString(),
|
|
253
|
+
};
|
|
254
|
+
}
|
|
255
|
+
|
|
256
|
+
/**
|
|
257
|
+
* Get unique icon names from analysis result
|
|
258
|
+
*/
|
|
259
|
+
export function getUniqueIcons(result: AnalysisResult): string[] {
|
|
260
|
+
return result.icons.map((i) => i.icon);
|
|
261
|
+
}
|
|
262
|
+
|
|
263
|
+
/**
|
|
264
|
+
* Parse icon list from string
|
|
265
|
+
*/
|
|
266
|
+
export function parseIconList(input: string | string[]): string[] {
|
|
267
|
+
if (Array.isArray(input)) {
|
|
268
|
+
return input;
|
|
269
|
+
}
|
|
270
|
+
|
|
271
|
+
return input
|
|
272
|
+
.split(',')
|
|
273
|
+
.map((s) => s.trim())
|
|
274
|
+
.filter(Boolean);
|
|
275
|
+
}
|