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,52 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* AST Utilities
|
|
3
|
+
* Helper functions for working with Babel AST nodes
|
|
4
|
+
*/
|
|
5
|
+
import type * as BabelTypes from '@babel/types';
|
|
6
|
+
import type { NodePath } from '@babel/core';
|
|
7
|
+
/**
|
|
8
|
+
* Get the component name from a JSX opening element
|
|
9
|
+
* Handles: <Mdi />, <Heroicons />, etc.
|
|
10
|
+
*/
|
|
11
|
+
export declare function getComponentName(node: BabelTypes.JSXOpeningElement, t: typeof BabelTypes): string | null;
|
|
12
|
+
/**
|
|
13
|
+
* Get the value of the 'name' attribute from a JSX element
|
|
14
|
+
* Handles: name="home", name='home'
|
|
15
|
+
* Returns null for dynamic values: name={iconName}
|
|
16
|
+
*/
|
|
17
|
+
export declare function getNameAttribute(node: BabelTypes.JSXOpeningElement, t: typeof BabelTypes): string | null;
|
|
18
|
+
/**
|
|
19
|
+
* Check if a call expression is calling a specific function by name
|
|
20
|
+
* Handles: prefetchIcons([...])
|
|
21
|
+
*/
|
|
22
|
+
export declare function isCallTo(path: NodePath<BabelTypes.CallExpression>, functionName: string, t: typeof BabelTypes): boolean;
|
|
23
|
+
/**
|
|
24
|
+
* Extract string values from an array expression
|
|
25
|
+
* Handles: ['mdi:home', 'mdi:settings']
|
|
26
|
+
* Skips dynamic values
|
|
27
|
+
*/
|
|
28
|
+
export declare function extractArrayStrings(node: BabelTypes.Node | null | undefined, t: typeof BabelTypes): string[];
|
|
29
|
+
/**
|
|
30
|
+
* Get location info from a node
|
|
31
|
+
*/
|
|
32
|
+
export declare function getNodeLocation(node: BabelTypes.Node): {
|
|
33
|
+
line: number;
|
|
34
|
+
column: number;
|
|
35
|
+
};
|
|
36
|
+
/**
|
|
37
|
+
* Check if an icon name matches a pattern (supports wildcards)
|
|
38
|
+
* @example matchesPattern('mdi:home', 'mdi:*') => true
|
|
39
|
+
* @example matchesPattern('mdi:home', 'mdi:home') => true
|
|
40
|
+
* @example matchesPattern('mdi:home', 'heroicons:*') => false
|
|
41
|
+
*/
|
|
42
|
+
export declare function matchesPattern(iconName: string, pattern: string): boolean;
|
|
43
|
+
/**
|
|
44
|
+
* Check if an icon should be included based on include/exclude patterns
|
|
45
|
+
*/
|
|
46
|
+
export declare function shouldIncludeIcon(iconName: string, include?: string[], exclude?: string[]): boolean;
|
|
47
|
+
/**
|
|
48
|
+
* Validate icon name format
|
|
49
|
+
* Valid format: prefix:name (e.g., mdi:home)
|
|
50
|
+
*/
|
|
51
|
+
export declare function isValidIconName(name: string): boolean;
|
|
52
|
+
//# sourceMappingURL=ast-utils.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ast-utils.d.ts","sourceRoot":"","sources":["../../../src/babel/ast-utils.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,KAAK,UAAU,MAAM,cAAc,CAAC;AAChD,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AAE5C;;;GAGG;AACH,wBAAgB,gBAAgB,CAC9B,IAAI,EAAE,UAAU,CAAC,iBAAiB,EAClC,CAAC,EAAE,OAAO,UAAU,GACnB,MAAM,GAAG,IAAI,CAcf;AAED;;;;GAIG;AACH,wBAAgB,gBAAgB,CAC9B,IAAI,EAAE,UAAU,CAAC,iBAAiB,EAClC,CAAC,EAAE,OAAO,UAAU,GACnB,MAAM,GAAG,IAAI,CAuCf;AAED;;;GAGG;AACH,wBAAgB,QAAQ,CACtB,IAAI,EAAE,QAAQ,CAAC,UAAU,CAAC,cAAc,CAAC,EACzC,YAAY,EAAE,MAAM,EACpB,CAAC,EAAE,OAAO,UAAU,GACnB,OAAO,CAUT;AAED;;;;GAIG;AACH,wBAAgB,mBAAmB,CACjC,IAAI,EAAE,UAAU,CAAC,IAAI,GAAG,IAAI,GAAG,SAAS,EACxC,CAAC,EAAE,OAAO,UAAU,GACnB,MAAM,EAAE,CAyBV;AAED;;GAEG;AACH,wBAAgB,eAAe,CAAC,IAAI,EAAE,UAAU,CAAC,IAAI,GAAG;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,MAAM,EAAE,MAAM,CAAA;CAAE,CAKvF;AAED;;;;;GAKG;AACH,wBAAgB,cAAc,CAAC,QAAQ,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,GAAG,OAAO,CAmBzE;AAED;;GAEG;AACH,wBAAgB,iBAAiB,CAC/B,QAAQ,EAAE,MAAM,EAChB,OAAO,CAAC,EAAE,MAAM,EAAE,EAClB,OAAO,CAAC,EAAE,MAAM,EAAE,GACjB,OAAO,CAaT;AAED;;;GAGG;AACH,wBAAgB,eAAe,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAoBrD"}
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Cache Writer
|
|
3
|
+
* Fetches collected icons from Iconify API and writes them to a cache file
|
|
4
|
+
* Runs in Node.js environment during build time
|
|
5
|
+
*/
|
|
6
|
+
import type { IconBundle, BabelPluginOptions } from './types';
|
|
7
|
+
/**
|
|
8
|
+
* Iconify API response structure
|
|
9
|
+
*/
|
|
10
|
+
interface IconifyAPIResponse {
|
|
11
|
+
prefix: string;
|
|
12
|
+
icons: Record<string, {
|
|
13
|
+
body: string;
|
|
14
|
+
width?: number;
|
|
15
|
+
height?: number;
|
|
16
|
+
left?: number;
|
|
17
|
+
top?: number;
|
|
18
|
+
hFlip?: boolean;
|
|
19
|
+
vFlip?: boolean;
|
|
20
|
+
rotate?: number;
|
|
21
|
+
}>;
|
|
22
|
+
width?: number;
|
|
23
|
+
height?: number;
|
|
24
|
+
}
|
|
25
|
+
/**
|
|
26
|
+
* Build SVG string from Iconify icon data
|
|
27
|
+
* @internal Exported for testing
|
|
28
|
+
*/
|
|
29
|
+
export declare function buildSvg(data: IconifyAPIResponse['icons'][string], defaultWidth?: number, defaultHeight?: number): {
|
|
30
|
+
svg: string;
|
|
31
|
+
width: number;
|
|
32
|
+
height: number;
|
|
33
|
+
};
|
|
34
|
+
/**
|
|
35
|
+
* Group icons by prefix
|
|
36
|
+
* @internal Exported for testing
|
|
37
|
+
*/
|
|
38
|
+
export declare function groupIconsByPrefix(iconNames: string[]): Map<string, string[]>;
|
|
39
|
+
/**
|
|
40
|
+
* Fetch all icons and create bundle
|
|
41
|
+
*/
|
|
42
|
+
export declare function fetchAndCreateBundle(iconNames: string[], options: BabelPluginOptions): Promise<IconBundle>;
|
|
43
|
+
/**
|
|
44
|
+
* Write bundle to file
|
|
45
|
+
*/
|
|
46
|
+
export declare function writeBundleToFile(bundle: IconBundle, outputPath: string, verbose: boolean): void;
|
|
47
|
+
/**
|
|
48
|
+
* Generate icon bundle from collected icons
|
|
49
|
+
*/
|
|
50
|
+
export declare function generateBundle(iconNames: string[], options: BabelPluginOptions, projectRoot: string): Promise<void>;
|
|
51
|
+
/**
|
|
52
|
+
* Check if bundle file exists and is valid
|
|
53
|
+
*/
|
|
54
|
+
export declare function isBundleValid(outputPath: string, projectRoot: string): boolean;
|
|
55
|
+
export {};
|
|
56
|
+
//# sourceMappingURL=cache-writer.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cache-writer.d.ts","sourceRoot":"","sources":["../../../src/babel/cache-writer.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAIH,OAAO,KAAK,EAAE,UAAU,EAAE,kBAAkB,EAAE,MAAM,SAAS,CAAC;AAW9D;;GAEG;AACH,UAAU,kBAAkB;IAC1B,MAAM,EAAE,MAAM,CAAC;IACf,KAAK,EAAE,MAAM,CACX,MAAM,EACN;QACE,IAAI,EAAE,MAAM,CAAC;QACb,KAAK,CAAC,EAAE,MAAM,CAAC;QACf,MAAM,CAAC,EAAE,MAAM,CAAC;QAChB,IAAI,CAAC,EAAE,MAAM,CAAC;QACd,GAAG,CAAC,EAAE,MAAM,CAAC;QACb,KAAK,CAAC,EAAE,OAAO,CAAC;QAChB,KAAK,CAAC,EAAE,OAAO,CAAC;QAChB,MAAM,CAAC,EAAE,MAAM,CAAC;KACjB,CACF,CAAC;IACF,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB;AAoBD;;;GAGG;AACH,wBAAgB,QAAQ,CACtB,IAAI,EAAE,kBAAkB,CAAC,OAAO,CAAC,CAAC,MAAM,CAAC,EACzC,YAAY,SAAK,EACjB,aAAa,SAAK,GACjB;IAAE,GAAG,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,MAAM,CAAC;IAAC,MAAM,EAAE,MAAM,CAAA;CAAE,CAgChD;AAmED;;;GAGG;AACH,wBAAgB,kBAAkB,CAAC,SAAS,EAAE,MAAM,EAAE,GAAG,GAAG,CAAC,MAAM,EAAE,MAAM,EAAE,CAAC,CAc7E;AAED;;GAEG;AACH,wBAAsB,oBAAoB,CACxC,SAAS,EAAE,MAAM,EAAE,EACnB,OAAO,EAAE,kBAAkB,GAC1B,OAAO,CAAC,UAAU,CAAC,CAwCrB;AAED;;GAEG;AACH,wBAAgB,iBAAiB,CAAC,MAAM,EAAE,UAAU,EAAE,UAAU,EAAE,MAAM,EAAE,OAAO,EAAE,OAAO,GAAG,IAAI,CAehG;AAED;;GAEG;AACH,wBAAsB,cAAc,CAClC,SAAS,EAAE,MAAM,EAAE,EACnB,OAAO,EAAE,kBAAkB,EAC3B,WAAW,EAAE,MAAM,GAClB,OAAO,CAAC,IAAI,CAAC,CAwCf;AAED;;GAEG;AACH,wBAAgB,aAAa,CAAC,UAAU,EAAE,MAAM,EAAE,WAAW,EAAE,MAAM,GAAG,OAAO,CAgB9E"}
|
|
@@ -0,0 +1,107 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Icon Collector
|
|
3
|
+
* Singleton that collects icons across all files during the build process
|
|
4
|
+
*/
|
|
5
|
+
import type { CollectedIcon, BabelPluginOptions } from './types';
|
|
6
|
+
/**
|
|
7
|
+
* Icon collection state
|
|
8
|
+
* Uses a singleton pattern since Babel plugin runs in a single process
|
|
9
|
+
*/
|
|
10
|
+
declare class IconCollector {
|
|
11
|
+
/**
|
|
12
|
+
* Map of icon name -> collection info
|
|
13
|
+
* Using Map to track first occurrence location
|
|
14
|
+
*/
|
|
15
|
+
private icons;
|
|
16
|
+
/**
|
|
17
|
+
* Set of processed files to track progress
|
|
18
|
+
*/
|
|
19
|
+
private processedFiles;
|
|
20
|
+
/**
|
|
21
|
+
* Options from plugin configuration
|
|
22
|
+
*/
|
|
23
|
+
private options;
|
|
24
|
+
/**
|
|
25
|
+
* Whether bundle generation has been triggered
|
|
26
|
+
*/
|
|
27
|
+
private bundleGenerated;
|
|
28
|
+
/**
|
|
29
|
+
* Start time for performance tracking
|
|
30
|
+
*/
|
|
31
|
+
private startTime;
|
|
32
|
+
/**
|
|
33
|
+
* Initialize the collector with options
|
|
34
|
+
* Called at the start of each build
|
|
35
|
+
*/
|
|
36
|
+
initialize(options: BabelPluginOptions): void;
|
|
37
|
+
/**
|
|
38
|
+
* Reset collector state
|
|
39
|
+
* Should be called at the start of each build
|
|
40
|
+
*/
|
|
41
|
+
reset(): void;
|
|
42
|
+
/**
|
|
43
|
+
* Add an icon to the collection
|
|
44
|
+
*/
|
|
45
|
+
add(iconName: string, file: string, line: number, column: number): boolean;
|
|
46
|
+
/**
|
|
47
|
+
* Mark a file as processed
|
|
48
|
+
*/
|
|
49
|
+
markFileProcessed(filename: string): void;
|
|
50
|
+
/**
|
|
51
|
+
* Check if a file has been processed
|
|
52
|
+
*/
|
|
53
|
+
isFileProcessed(filename: string): boolean;
|
|
54
|
+
/**
|
|
55
|
+
* Check if there are any collected icons
|
|
56
|
+
*/
|
|
57
|
+
hasIcons(): boolean;
|
|
58
|
+
/**
|
|
59
|
+
* Get all collected icon names
|
|
60
|
+
*/
|
|
61
|
+
getIconNames(): string[];
|
|
62
|
+
/**
|
|
63
|
+
* Get all collected icons with their metadata
|
|
64
|
+
*/
|
|
65
|
+
getAllIcons(): CollectedIcon[];
|
|
66
|
+
/**
|
|
67
|
+
* Get icon count
|
|
68
|
+
*/
|
|
69
|
+
getCount(): number;
|
|
70
|
+
/**
|
|
71
|
+
* Get processed file count
|
|
72
|
+
*/
|
|
73
|
+
getProcessedFileCount(): number;
|
|
74
|
+
/**
|
|
75
|
+
* Get icons grouped by prefix
|
|
76
|
+
*/
|
|
77
|
+
getIconsByPrefix(): Map<string, string[]>;
|
|
78
|
+
/**
|
|
79
|
+
* Mark bundle as generated
|
|
80
|
+
*/
|
|
81
|
+
markBundleGenerated(): void;
|
|
82
|
+
/**
|
|
83
|
+
* Check if bundle has been generated
|
|
84
|
+
*/
|
|
85
|
+
isBundleGenerated(): boolean;
|
|
86
|
+
/**
|
|
87
|
+
* Get elapsed time since initialization
|
|
88
|
+
*/
|
|
89
|
+
getElapsedTime(): number;
|
|
90
|
+
/**
|
|
91
|
+
* Get current options
|
|
92
|
+
*/
|
|
93
|
+
getOptions(): BabelPluginOptions;
|
|
94
|
+
/**
|
|
95
|
+
* Print summary (for verbose mode)
|
|
96
|
+
*/
|
|
97
|
+
printSummary(): void;
|
|
98
|
+
}
|
|
99
|
+
/**
|
|
100
|
+
* Singleton instance
|
|
101
|
+
*/
|
|
102
|
+
export declare const collector: IconCollector;
|
|
103
|
+
/**
|
|
104
|
+
* Export class for testing
|
|
105
|
+
*/
|
|
106
|
+
export { IconCollector };
|
|
107
|
+
//# sourceMappingURL=collector.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"collector.d.ts","sourceRoot":"","sources":["../../../src/babel/collector.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,EAAE,aAAa,EAAE,kBAAkB,EAAE,MAAM,SAAS,CAAC;AAGjE;;;GAGG;AACH,cAAM,aAAa;IACjB;;;OAGG;IACH,OAAO,CAAC,KAAK,CAAyC;IAEtD;;OAEG;IACH,OAAO,CAAC,cAAc,CAA0B;IAEhD;;OAEG;IACH,OAAO,CAAC,OAAO,CAA0B;IAEzC;;OAEG;IACH,OAAO,CAAC,eAAe,CAAkB;IAEzC;;OAEG;IACH,OAAO,CAAC,SAAS,CAAa;IAE9B;;;OAGG;IACH,UAAU,CAAC,OAAO,EAAE,kBAAkB,GAAG,IAAI;IAS7C;;;OAGG;IACH,KAAK,IAAI,IAAI;IAOb;;OAEG;IACH,GAAG,CAAC,QAAQ,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,GAAG,OAAO;IAoC1E;;OAEG;IACH,iBAAiB,CAAC,QAAQ,EAAE,MAAM,GAAG,IAAI;IAIzC;;OAEG;IACH,eAAe,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO;IAI1C;;OAEG;IACH,QAAQ,IAAI,OAAO;IAInB;;OAEG;IACH,YAAY,IAAI,MAAM,EAAE;IAIxB;;OAEG;IACH,WAAW,IAAI,aAAa,EAAE;IAI9B;;OAEG;IACH,QAAQ,IAAI,MAAM;IAIlB;;OAEG;IACH,qBAAqB,IAAI,MAAM;IAI/B;;OAEG;IACH,gBAAgB,IAAI,GAAG,CAAC,MAAM,EAAE,MAAM,EAAE,CAAC;IAczC;;OAEG;IACH,mBAAmB,IAAI,IAAI;IAI3B;;OAEG;IACH,iBAAiB,IAAI,OAAO;IAI5B;;OAEG;IACH,cAAc,IAAI,MAAM;IAIxB;;OAEG;IACH,UAAU,IAAI,kBAAkB;IAIhC;;OAEG;IACH,YAAY,IAAI,IAAI;CAcrB;AAED;;GAEG;AACH,eAAO,MAAM,SAAS,eAAsB,CAAC;AAE7C;;GAEG;AACH,OAAO,EAAE,aAAa,EAAE,CAAC"}
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* rn-iconify Babel Plugin
|
|
3
|
+
*
|
|
4
|
+
* Build-time icon bundling for 0ms first render.
|
|
5
|
+
*
|
|
6
|
+
* @example
|
|
7
|
+
* ```js
|
|
8
|
+
* // babel.config.js
|
|
9
|
+
* module.exports = {
|
|
10
|
+
* presets: ['module:@react-native/babel-preset'],
|
|
11
|
+
* plugins: ['rn-iconify/babel'],
|
|
12
|
+
* };
|
|
13
|
+
* ```
|
|
14
|
+
*
|
|
15
|
+
* @example With options
|
|
16
|
+
* ```js
|
|
17
|
+
* // babel.config.js
|
|
18
|
+
* module.exports = {
|
|
19
|
+
* presets: ['module:@react-native/babel-preset'],
|
|
20
|
+
* plugins: [
|
|
21
|
+
* ['rn-iconify/babel', {
|
|
22
|
+
* include: ['mdi:*', 'heroicons:*'],
|
|
23
|
+
* exclude: ['mdi:test-*'],
|
|
24
|
+
* outputPath: '.rn-iconify-cache',
|
|
25
|
+
* verbose: true,
|
|
26
|
+
* }]
|
|
27
|
+
* ],
|
|
28
|
+
* };
|
|
29
|
+
* ```
|
|
30
|
+
*/
|
|
31
|
+
import { createRnIconifyPlugin, resetPluginState } from './plugin';
|
|
32
|
+
import type { BabelPluginOptions } from './types';
|
|
33
|
+
export type { BabelPluginOptions };
|
|
34
|
+
export type { CollectedIcon, IconBundle, BabelPluginState } from './types';
|
|
35
|
+
export { collector } from './collector';
|
|
36
|
+
export { resetPluginState };
|
|
37
|
+
export { COMPONENT_PREFIX_MAP, PREFIX_COMPONENT_MAP, VALID_COMPONENTS, VALID_PREFIXES, getFilenameFromState, getFilenameFromFile, } from './types';
|
|
38
|
+
/**
|
|
39
|
+
* Default export for Babel plugin
|
|
40
|
+
* This is what Babel will import when you add 'rn-iconify/babel' to your config
|
|
41
|
+
*/
|
|
42
|
+
export default createRnIconifyPlugin;
|
|
43
|
+
/**
|
|
44
|
+
* Named export for explicit importing
|
|
45
|
+
*/
|
|
46
|
+
export { createRnIconifyPlugin };
|
|
47
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/babel/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6BG;AAEH,OAAO,EAAE,qBAAqB,EAAE,gBAAgB,EAAE,MAAM,UAAU,CAAC;AACnE,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,SAAS,CAAC;AAGlD,YAAY,EAAE,kBAAkB,EAAE,CAAC;AACnC,YAAY,EAAE,aAAa,EAAE,UAAU,EAAE,gBAAgB,EAAE,MAAM,SAAS,CAAC;AAG3E,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AACxC,OAAO,EAAE,gBAAgB,EAAE,CAAC;AAC5B,OAAO,EACL,oBAAoB,EACpB,oBAAoB,EACpB,gBAAgB,EAChB,cAAc,EACd,oBAAoB,EACpB,mBAAmB,GACpB,MAAM,SAAS,CAAC;AAEjB;;;GAGG;AACH,eAAe,qBAAqB,CAAC;AAErC;;GAEG;AACH,OAAO,EAAE,qBAAqB,EAAE,CAAC"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Babel Plugin Visitor
|
|
3
|
+
* Main visitor logic for the rn-iconify Babel plugin
|
|
4
|
+
*/
|
|
5
|
+
import type { PluginObj, types as BabelTypes } from '@babel/core';
|
|
6
|
+
import type { BabelPluginState } from './types';
|
|
7
|
+
/**
|
|
8
|
+
* Create the rn-iconify Babel plugin
|
|
9
|
+
*/
|
|
10
|
+
export declare function createRnIconifyPlugin(babel: {
|
|
11
|
+
types: typeof BabelTypes;
|
|
12
|
+
}): PluginObj<BabelPluginState>;
|
|
13
|
+
/**
|
|
14
|
+
* Reset plugin state (for testing)
|
|
15
|
+
*/
|
|
16
|
+
export declare function resetPluginState(): void;
|
|
17
|
+
//# sourceMappingURL=plugin.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"plugin.d.ts","sourceRoot":"","sources":["../../../src/babel/plugin.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,EAAE,SAAS,EAAE,KAAK,IAAI,UAAU,EAAE,MAAM,aAAa,CAAC;AAClE,OAAO,KAAK,EAAE,gBAAgB,EAAsB,MAAM,SAAS,CAAC;AA2DpE;;GAEG;AACH,wBAAgB,qBAAqB,CAAC,KAAK,EAAE;IAC3C,KAAK,EAAE,OAAO,UAAU,CAAC;CAC1B,GAAG,SAAS,CAAC,gBAAgB,CAAC,CA0K9B;AAED;;GAEG;AACH,wBAAgB,gBAAgB,IAAI,IAAI,CAQvC"}
|
|
@@ -0,0 +1,129 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Babel Plugin Types
|
|
3
|
+
* Type definitions for the rn-iconify Babel plugin
|
|
4
|
+
*/
|
|
5
|
+
import type { NodePath } from '@babel/core';
|
|
6
|
+
import type { JSXOpeningElement, CallExpression } from '@babel/types';
|
|
7
|
+
/**
|
|
8
|
+
* Plugin options that can be passed in babel.config.js
|
|
9
|
+
*/
|
|
10
|
+
export interface BabelPluginOptions {
|
|
11
|
+
/**
|
|
12
|
+
* Patterns for icons to include (supports wildcards)
|
|
13
|
+
* @example ['mdi:*', 'heroicons:user']
|
|
14
|
+
*/
|
|
15
|
+
include?: string[];
|
|
16
|
+
/**
|
|
17
|
+
* Patterns for icons to exclude
|
|
18
|
+
* @example ['mdi:test-*']
|
|
19
|
+
*/
|
|
20
|
+
exclude?: string[];
|
|
21
|
+
/**
|
|
22
|
+
* Output directory for the generated cache
|
|
23
|
+
* @default '.rn-iconify-cache'
|
|
24
|
+
*/
|
|
25
|
+
outputPath?: string;
|
|
26
|
+
/**
|
|
27
|
+
* Enable verbose logging during build
|
|
28
|
+
* @default false
|
|
29
|
+
*/
|
|
30
|
+
verbose?: boolean;
|
|
31
|
+
/**
|
|
32
|
+
* Disable the plugin (useful for debugging)
|
|
33
|
+
* @default false
|
|
34
|
+
*/
|
|
35
|
+
disabled?: boolean;
|
|
36
|
+
}
|
|
37
|
+
/**
|
|
38
|
+
* Babel file object structure (for pre/post hooks)
|
|
39
|
+
*/
|
|
40
|
+
export interface BabelFile {
|
|
41
|
+
opts: {
|
|
42
|
+
filename?: string;
|
|
43
|
+
root?: string;
|
|
44
|
+
};
|
|
45
|
+
}
|
|
46
|
+
/**
|
|
47
|
+
* Plugin state passed between visitors
|
|
48
|
+
* Matches Babel's internal state structure
|
|
49
|
+
* Note: filename and file may not always be present depending on Babel version/config
|
|
50
|
+
*/
|
|
51
|
+
export interface BabelPluginState {
|
|
52
|
+
opts: BabelPluginOptions;
|
|
53
|
+
filename?: string;
|
|
54
|
+
file?: BabelFile;
|
|
55
|
+
}
|
|
56
|
+
/**
|
|
57
|
+
* Helper to safely extract filename from visitor state
|
|
58
|
+
*/
|
|
59
|
+
export declare function getFilenameFromState(state: BabelPluginState): string;
|
|
60
|
+
/**
|
|
61
|
+
* Helper to safely extract filename from any object (pre/post hooks or visitor state)
|
|
62
|
+
* Uses type guards to safely access nested properties
|
|
63
|
+
*/
|
|
64
|
+
export declare function getFilename(obj: unknown): string;
|
|
65
|
+
/**
|
|
66
|
+
* Alias for getFilename - used in pre/post hooks where file object is passed
|
|
67
|
+
* This is a more descriptive name for when working with BabelFile objects
|
|
68
|
+
*/
|
|
69
|
+
export declare function getFilenameFromFile(file: unknown): string;
|
|
70
|
+
/**
|
|
71
|
+
* Collected icon information
|
|
72
|
+
*/
|
|
73
|
+
export interface CollectedIcon {
|
|
74
|
+
/**
|
|
75
|
+
* Full icon name (prefix:name)
|
|
76
|
+
*/
|
|
77
|
+
name: string;
|
|
78
|
+
/**
|
|
79
|
+
* Source file where the icon was found
|
|
80
|
+
*/
|
|
81
|
+
file: string;
|
|
82
|
+
/**
|
|
83
|
+
* Line number in source
|
|
84
|
+
*/
|
|
85
|
+
line: number;
|
|
86
|
+
/**
|
|
87
|
+
* Column number in source
|
|
88
|
+
*/
|
|
89
|
+
column: number;
|
|
90
|
+
}
|
|
91
|
+
/**
|
|
92
|
+
* Icon bundle structure (matches CLI output)
|
|
93
|
+
*/
|
|
94
|
+
export interface IconBundle {
|
|
95
|
+
version: string;
|
|
96
|
+
generatedAt: string;
|
|
97
|
+
icons: Record<string, {
|
|
98
|
+
svg: string;
|
|
99
|
+
width: number;
|
|
100
|
+
height: number;
|
|
101
|
+
}>;
|
|
102
|
+
count: number;
|
|
103
|
+
}
|
|
104
|
+
/**
|
|
105
|
+
* JSX visitor function type
|
|
106
|
+
*/
|
|
107
|
+
export type JSXVisitor = (path: NodePath<JSXOpeningElement>, state: BabelPluginState) => void;
|
|
108
|
+
/**
|
|
109
|
+
* Call expression visitor function type
|
|
110
|
+
*/
|
|
111
|
+
export type CallVisitor = (path: NodePath<CallExpression>, state: BabelPluginState) => void;
|
|
112
|
+
/**
|
|
113
|
+
* Complete mapping of React component names to Iconify prefixes
|
|
114
|
+
* This covers all 200+ icon sets available in rn-iconify
|
|
115
|
+
*/
|
|
116
|
+
export declare const COMPONENT_PREFIX_MAP: Record<string, string>;
|
|
117
|
+
/**
|
|
118
|
+
* Reverse map: prefix -> component name
|
|
119
|
+
*/
|
|
120
|
+
export declare const PREFIX_COMPONENT_MAP: Record<string, string>;
|
|
121
|
+
/**
|
|
122
|
+
* Set of all valid component names for fast lookup
|
|
123
|
+
*/
|
|
124
|
+
export declare const VALID_COMPONENTS: Set<string>;
|
|
125
|
+
/**
|
|
126
|
+
* Set of all valid prefixes for fast lookup
|
|
127
|
+
*/
|
|
128
|
+
export declare const VALID_PREFIXES: Set<string>;
|
|
129
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/babel/types.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AAC5C,OAAO,KAAK,EAAE,iBAAiB,EAAE,cAAc,EAAE,MAAM,cAAc,CAAC;AAEtE;;GAEG;AACH,MAAM,WAAW,kBAAkB;IACjC;;;OAGG;IACH,OAAO,CAAC,EAAE,MAAM,EAAE,CAAC;IAEnB;;;OAGG;IACH,OAAO,CAAC,EAAE,MAAM,EAAE,CAAC;IAEnB;;;OAGG;IACH,UAAU,CAAC,EAAE,MAAM,CAAC;IAEpB;;;OAGG;IACH,OAAO,CAAC,EAAE,OAAO,CAAC;IAElB;;;OAGG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB;AAED;;GAEG;AACH,MAAM,WAAW,SAAS;IACxB,IAAI,EAAE;QACJ,QAAQ,CAAC,EAAE,MAAM,CAAC;QAClB,IAAI,CAAC,EAAE,MAAM,CAAC;KACf,CAAC;CACH;AAED;;;;GAIG;AACH,MAAM,WAAW,gBAAgB;IAC/B,IAAI,EAAE,kBAAkB,CAAC;IACzB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,IAAI,CAAC,EAAE,SAAS,CAAC;CAClB;AAyCD;;GAEG;AACH,wBAAgB,oBAAoB,CAAC,KAAK,EAAE,gBAAgB,GAAG,MAAM,CAYpE;AAED;;;GAGG;AACH,wBAAgB,WAAW,CAAC,GAAG,EAAE,OAAO,GAAG,MAAM,CAiBhD;AAED;;;GAGG;AACH,wBAAgB,mBAAmB,CAAC,IAAI,EAAE,OAAO,GAAG,MAAM,CAEzD;AAED;;GAEG;AACH,MAAM,WAAW,aAAa;IAC5B;;OAEG;IACH,IAAI,EAAE,MAAM,CAAC;IAEb;;OAEG;IACH,IAAI,EAAE,MAAM,CAAC;IAEb;;OAEG;IACH,IAAI,EAAE,MAAM,CAAC;IAEb;;OAEG;IACH,MAAM,EAAE,MAAM,CAAC;CAChB;AAED;;GAEG;AACH,MAAM,WAAW,UAAU;IACzB,OAAO,EAAE,MAAM,CAAC;IAChB,WAAW,EAAE,MAAM,CAAC;IACpB,KAAK,EAAE,MAAM,CACX,MAAM,EACN;QACE,GAAG,EAAE,MAAM,CAAC;QACZ,KAAK,EAAE,MAAM,CAAC;QACd,MAAM,EAAE,MAAM,CAAC;KAChB,CACF,CAAC;IACF,KAAK,EAAE,MAAM,CAAC;CACf;AAED;;GAEG;AACH,MAAM,MAAM,UAAU,GAAG,CAAC,IAAI,EAAE,QAAQ,CAAC,iBAAiB,CAAC,EAAE,KAAK,EAAE,gBAAgB,KAAK,IAAI,CAAC;AAE9F;;GAEG;AACH,MAAM,MAAM,WAAW,GAAG,CAAC,IAAI,EAAE,QAAQ,CAAC,cAAc,CAAC,EAAE,KAAK,EAAE,gBAAgB,KAAK,IAAI,CAAC;AAE5F;;;GAGG;AACH,eAAO,MAAM,oBAAoB,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAsevD,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,oBAAoB,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAQvD,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,gBAAgB,aAA6C,CAAC;AAE3E;;GAEG;AACH,eAAO,MAAM,cAAc,aAA+C,CAAC"}
|
|
@@ -0,0 +1,161 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Offline Bundle Module
|
|
3
|
+
* Provides functionality to load pre-bundled icons at runtime
|
|
4
|
+
*/
|
|
5
|
+
/**
|
|
6
|
+
* Icon bundle structure (matches CLI output)
|
|
7
|
+
*/
|
|
8
|
+
export interface IconBundle {
|
|
9
|
+
/**
|
|
10
|
+
* Bundle version
|
|
11
|
+
*/
|
|
12
|
+
version: string;
|
|
13
|
+
/**
|
|
14
|
+
* Generation timestamp
|
|
15
|
+
*/
|
|
16
|
+
generatedAt: string;
|
|
17
|
+
/**
|
|
18
|
+
* Icons in the bundle
|
|
19
|
+
*/
|
|
20
|
+
icons: Record<string, {
|
|
21
|
+
svg: string;
|
|
22
|
+
width: number;
|
|
23
|
+
height: number;
|
|
24
|
+
}>;
|
|
25
|
+
/**
|
|
26
|
+
* Total icon count
|
|
27
|
+
*/
|
|
28
|
+
count: number;
|
|
29
|
+
}
|
|
30
|
+
/**
|
|
31
|
+
* Bundle loading result
|
|
32
|
+
*/
|
|
33
|
+
export interface BundleLoadResult {
|
|
34
|
+
/**
|
|
35
|
+
* Number of icons loaded
|
|
36
|
+
*/
|
|
37
|
+
loaded: number;
|
|
38
|
+
/**
|
|
39
|
+
* Number of icons skipped (already cached)
|
|
40
|
+
*/
|
|
41
|
+
skipped: number;
|
|
42
|
+
/**
|
|
43
|
+
* Total icons in bundle
|
|
44
|
+
*/
|
|
45
|
+
total: number;
|
|
46
|
+
/**
|
|
47
|
+
* Bundle version
|
|
48
|
+
*/
|
|
49
|
+
version: string;
|
|
50
|
+
/**
|
|
51
|
+
* Load time in milliseconds
|
|
52
|
+
*/
|
|
53
|
+
loadTimeMs: number;
|
|
54
|
+
}
|
|
55
|
+
/**
|
|
56
|
+
* Load an offline icon bundle into the cache
|
|
57
|
+
*
|
|
58
|
+
* This function should be called early in your app initialization
|
|
59
|
+
* to pre-populate the icon cache with bundled icons.
|
|
60
|
+
*
|
|
61
|
+
* Icons loaded from the bundle are immediately available without
|
|
62
|
+
* network requests, providing instant rendering.
|
|
63
|
+
*
|
|
64
|
+
* @param bundle - The icon bundle object (from JSON import)
|
|
65
|
+
* @param options - Loading options
|
|
66
|
+
* @returns Result with load statistics
|
|
67
|
+
*
|
|
68
|
+
* @example
|
|
69
|
+
* ```tsx
|
|
70
|
+
* // In your app entry point (App.tsx or index.js)
|
|
71
|
+
* import { loadOfflineBundle } from 'rn-iconify';
|
|
72
|
+
* import iconBundle from './assets/icons.bundle.json';
|
|
73
|
+
*
|
|
74
|
+
* // Load bundle on app start
|
|
75
|
+
* const result = loadOfflineBundle(iconBundle);
|
|
76
|
+
* console.log(`Loaded ${result.loaded} icons in ${result.loadTimeMs}ms`);
|
|
77
|
+
*
|
|
78
|
+
* // Or with options
|
|
79
|
+
* loadOfflineBundle(iconBundle, {
|
|
80
|
+
* skipExisting: true, // Don't overwrite existing cache entries
|
|
81
|
+
* verbose: true, // Log loading progress
|
|
82
|
+
* });
|
|
83
|
+
* ```
|
|
84
|
+
*/
|
|
85
|
+
export declare function loadOfflineBundle(bundle: IconBundle, options?: {
|
|
86
|
+
/**
|
|
87
|
+
* Skip icons that are already in cache
|
|
88
|
+
* @default true
|
|
89
|
+
*/
|
|
90
|
+
skipExisting?: boolean;
|
|
91
|
+
/**
|
|
92
|
+
* Log loading progress
|
|
93
|
+
* @default false
|
|
94
|
+
*/
|
|
95
|
+
verbose?: boolean;
|
|
96
|
+
}): BundleLoadResult;
|
|
97
|
+
/**
|
|
98
|
+
* Async version of loadOfflineBundle
|
|
99
|
+
*
|
|
100
|
+
* Useful for loading large bundles without blocking the main thread.
|
|
101
|
+
* Uses setTimeout to yield to the event loop periodically.
|
|
102
|
+
*
|
|
103
|
+
* @param bundle - The icon bundle object
|
|
104
|
+
* @param options - Loading options
|
|
105
|
+
* @returns Promise resolving to load result
|
|
106
|
+
*
|
|
107
|
+
* @example
|
|
108
|
+
* ```tsx
|
|
109
|
+
* import { loadOfflineBundleAsync } from 'rn-iconify';
|
|
110
|
+
* import iconBundle from './assets/icons.bundle.json';
|
|
111
|
+
*
|
|
112
|
+
* async function initApp() {
|
|
113
|
+
* const result = await loadOfflineBundleAsync(iconBundle, {
|
|
114
|
+
* batchSize: 100, // Process 100 icons per batch
|
|
115
|
+
* verbose: true,
|
|
116
|
+
* });
|
|
117
|
+
* console.log(`Loaded ${result.loaded} icons`);
|
|
118
|
+
* }
|
|
119
|
+
* ```
|
|
120
|
+
*/
|
|
121
|
+
export declare function loadOfflineBundleAsync(bundle: IconBundle, options?: {
|
|
122
|
+
/**
|
|
123
|
+
* Skip icons that are already in cache
|
|
124
|
+
* @default true
|
|
125
|
+
*/
|
|
126
|
+
skipExisting?: boolean;
|
|
127
|
+
/**
|
|
128
|
+
* Log loading progress
|
|
129
|
+
* @default false
|
|
130
|
+
*/
|
|
131
|
+
verbose?: boolean;
|
|
132
|
+
/**
|
|
133
|
+
* Number of icons to process per batch
|
|
134
|
+
* @default 50
|
|
135
|
+
*/
|
|
136
|
+
batchSize?: number;
|
|
137
|
+
/**
|
|
138
|
+
* Progress callback
|
|
139
|
+
*/
|
|
140
|
+
onProgress?: (loaded: number, total: number) => void;
|
|
141
|
+
}): Promise<BundleLoadResult>;
|
|
142
|
+
/**
|
|
143
|
+
* Check if a bundle is compatible with this version of rn-iconify
|
|
144
|
+
*
|
|
145
|
+
* @param bundle - The icon bundle object
|
|
146
|
+
* @returns true if compatible
|
|
147
|
+
*/
|
|
148
|
+
export declare function isBundleCompatible(bundle: IconBundle): boolean;
|
|
149
|
+
/**
|
|
150
|
+
* Get bundle statistics
|
|
151
|
+
*
|
|
152
|
+
* @param bundle - The icon bundle object
|
|
153
|
+
* @returns Statistics about the bundle
|
|
154
|
+
*/
|
|
155
|
+
export declare function getBundleStats(bundle: IconBundle): {
|
|
156
|
+
iconCount: number;
|
|
157
|
+
prefixes: string[];
|
|
158
|
+
estimatedSizeBytes: number;
|
|
159
|
+
generatedAt: Date;
|
|
160
|
+
};
|
|
161
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/bundle/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAIH;;GAEG;AACH,MAAM,WAAW,UAAU;IACzB;;OAEG;IACH,OAAO,EAAE,MAAM,CAAC;IAEhB;;OAEG;IACH,WAAW,EAAE,MAAM,CAAC;IAEpB;;OAEG;IACH,KAAK,EAAE,MAAM,CACX,MAAM,EACN;QACE,GAAG,EAAE,MAAM,CAAC;QACZ,KAAK,EAAE,MAAM,CAAC;QACd,MAAM,EAAE,MAAM,CAAC;KAChB,CACF,CAAC;IAEF;;OAEG;IACH,KAAK,EAAE,MAAM,CAAC;CACf;AAED;;GAEG;AACH,MAAM,WAAW,gBAAgB;IAC/B;;OAEG;IACH,MAAM,EAAE,MAAM,CAAC;IAEf;;OAEG;IACH,OAAO,EAAE,MAAM,CAAC;IAEhB;;OAEG;IACH,KAAK,EAAE,MAAM,CAAC;IAEd;;OAEG;IACH,OAAO,EAAE,MAAM,CAAC;IAEhB;;OAEG;IACH,UAAU,EAAE,MAAM,CAAC;CACpB;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6BG;AACH,wBAAgB,iBAAiB,CAC/B,MAAM,EAAE,UAAU,EAClB,OAAO,GAAE;IACP;;;OAGG;IACH,YAAY,CAAC,EAAE,OAAO,CAAC;IAEvB;;;OAGG;IACH,OAAO,CAAC,EAAE,OAAO,CAAC;CACd,GACL,gBAAgB,CA2ClB;AAED;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AACH,wBAAsB,sBAAsB,CAC1C,MAAM,EAAE,UAAU,EAClB,OAAO,GAAE;IACP;;;OAGG;IACH,YAAY,CAAC,EAAE,OAAO,CAAC;IAEvB;;;OAGG;IACH,OAAO,CAAC,EAAE,OAAO,CAAC;IAElB;;;OAGG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;IAEnB;;OAEG;IACH,UAAU,CAAC,EAAE,CAAC,MAAM,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;CACjD,GACL,OAAO,CAAC,gBAAgB,CAAC,CAqD3B;AAED;;;;;GAKG;AACH,wBAAgB,kBAAkB,CAAC,MAAM,EAAE,UAAU,GAAG,OAAO,CAa9D;AAED;;;;;GAKG;AACH,wBAAgB,cAAc,CAAC,MAAM,EAAE,UAAU,GAAG;IAClD,SAAS,EAAE,MAAM,CAAC;IAClB,QAAQ,EAAE,MAAM,EAAE,CAAC;IACnB,kBAAkB,EAAE,MAAM,CAAC;IAC3B,WAAW,EAAE,IAAI,CAAC;CACnB,CAgBA"}
|
|
@@ -1,16 +1,63 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Cache Manager - Orchestrates memory and disk cache
|
|
3
|
-
* Priority: Memory Cache → Disk Cache → Native Cache → Network
|
|
2
|
+
* Cache Manager - Orchestrates memory, bundled, and disk cache
|
|
3
|
+
* Priority: Memory Cache → Bundled Icons → Disk Cache → Native Cache → Network
|
|
4
4
|
*
|
|
5
5
|
* Integrates with native module for background prefetching when available
|
|
6
6
|
*/
|
|
7
|
+
/**
|
|
8
|
+
* Bundled icon data structure
|
|
9
|
+
*/
|
|
10
|
+
interface BundledIconData {
|
|
11
|
+
svg: string;
|
|
12
|
+
width: number;
|
|
13
|
+
height: number;
|
|
14
|
+
}
|
|
15
|
+
/**
|
|
16
|
+
* Bundle structure from Babel plugin
|
|
17
|
+
*/
|
|
18
|
+
interface IconBundle {
|
|
19
|
+
version: string;
|
|
20
|
+
generatedAt: string;
|
|
21
|
+
icons: Record<string, BundledIconData>;
|
|
22
|
+
count: number;
|
|
23
|
+
}
|
|
7
24
|
declare class CacheManagerImpl {
|
|
8
25
|
/**
|
|
9
26
|
* Track in-flight prefetch operations to prevent race conditions
|
|
10
27
|
*/
|
|
11
28
|
private prefetchingIcons;
|
|
12
29
|
/**
|
|
13
|
-
*
|
|
30
|
+
* Bundled icons from Babel plugin (loaded at app start)
|
|
31
|
+
* These are icons that were detected during build time
|
|
32
|
+
*/
|
|
33
|
+
private bundledIcons;
|
|
34
|
+
/**
|
|
35
|
+
* Whether bundled icons have been initialized
|
|
36
|
+
*/
|
|
37
|
+
private bundledIconsInitialized;
|
|
38
|
+
/**
|
|
39
|
+
* Initialize bundled icons from the Babel plugin cache
|
|
40
|
+
* This should be called automatically on first access
|
|
41
|
+
*/
|
|
42
|
+
initBundledIcons(): void;
|
|
43
|
+
/**
|
|
44
|
+
* Load bundled icons from a custom bundle object
|
|
45
|
+
* Useful for manual bundle loading or testing
|
|
46
|
+
*
|
|
47
|
+
* @param bundle The icon bundle to load
|
|
48
|
+
* @returns Number of icons loaded
|
|
49
|
+
*/
|
|
50
|
+
loadBundle(bundle: IconBundle): number;
|
|
51
|
+
/**
|
|
52
|
+
* Check if an icon is in the bundled cache
|
|
53
|
+
*/
|
|
54
|
+
hasBundled(iconName: string): boolean;
|
|
55
|
+
/**
|
|
56
|
+
* Get bundled icons count
|
|
57
|
+
*/
|
|
58
|
+
getBundledCount(): number;
|
|
59
|
+
/**
|
|
60
|
+
* Get icon SVG from cache (memory first, then bundled, then disk)
|
|
14
61
|
* @returns SVG string or null if not cached
|
|
15
62
|
*/
|
|
16
63
|
get(iconName: string): string | null;
|
|
@@ -19,7 +66,7 @@ declare class CacheManagerImpl {
|
|
|
19
66
|
*/
|
|
20
67
|
set(iconName: string, svg: string): void;
|
|
21
68
|
/**
|
|
22
|
-
* Check if icon exists in any cache
|
|
69
|
+
* Check if icon exists in any cache (memory, bundled, or disk)
|
|
23
70
|
*/
|
|
24
71
|
has(iconName: string): boolean;
|
|
25
72
|
/**
|
|
@@ -39,6 +86,7 @@ declare class CacheManagerImpl {
|
|
|
39
86
|
*/
|
|
40
87
|
getStats(): {
|
|
41
88
|
memoryCount: number;
|
|
89
|
+
bundledCount: number;
|
|
42
90
|
diskCount: number;
|
|
43
91
|
diskSizeBytes: number;
|
|
44
92
|
};
|