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,327 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.default = exports.PerformanceMonitor = void 0;
|
|
7
|
+
exports.disablePerformanceMonitoring = disablePerformanceMonitoring;
|
|
8
|
+
exports.enablePerformanceMonitoring = enablePerformanceMonitoring;
|
|
9
|
+
exports.getPerformanceReport = getPerformanceReport;
|
|
10
|
+
exports.printPerformanceReport = printPerformanceReport;
|
|
11
|
+
var _config = require("../config");
|
|
12
|
+
/**
|
|
13
|
+
* PerformanceMonitor - Tracks icon loading performance
|
|
14
|
+
* Provides metrics, statistics, and insights for optimization
|
|
15
|
+
*/
|
|
16
|
+
|
|
17
|
+
/**
|
|
18
|
+
* Performance monitoring state
|
|
19
|
+
*/
|
|
20
|
+
let isEnabled = false;
|
|
21
|
+
let startTime = Date.now();
|
|
22
|
+
const events = [];
|
|
23
|
+
const listeners = [];
|
|
24
|
+
const iconLoadCounts = new Map();
|
|
25
|
+
const iconLoadTimes = new Map();
|
|
26
|
+
|
|
27
|
+
/**
|
|
28
|
+
* Counter statistics
|
|
29
|
+
*/
|
|
30
|
+
let stats = {
|
|
31
|
+
memoryHits: 0,
|
|
32
|
+
bundledHits: 0,
|
|
33
|
+
diskHits: 0,
|
|
34
|
+
networkFetches: 0,
|
|
35
|
+
errors: 0
|
|
36
|
+
};
|
|
37
|
+
|
|
38
|
+
/**
|
|
39
|
+
* Get max history size from config
|
|
40
|
+
*/
|
|
41
|
+
function getMaxHistorySize() {
|
|
42
|
+
return _config.ConfigManager.getPerformanceConfig().maxHistorySize;
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
/**
|
|
46
|
+
* Calculate percentile from sorted array
|
|
47
|
+
*/
|
|
48
|
+
function percentile(sortedArr, p) {
|
|
49
|
+
if (sortedArr.length === 0) return 0;
|
|
50
|
+
const index = Math.ceil(p / 100 * sortedArr.length) - 1;
|
|
51
|
+
return sortedArr[Math.max(0, index)];
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
/**
|
|
55
|
+
* Performance Monitor API
|
|
56
|
+
*/
|
|
57
|
+
const PerformanceMonitor = exports.PerformanceMonitor = {
|
|
58
|
+
/**
|
|
59
|
+
* Enable performance monitoring
|
|
60
|
+
*/
|
|
61
|
+
enable() {
|
|
62
|
+
isEnabled = true;
|
|
63
|
+
startTime = Date.now();
|
|
64
|
+
_config.ConfigManager.setConfig({
|
|
65
|
+
performance: {
|
|
66
|
+
enabled: true
|
|
67
|
+
}
|
|
68
|
+
});
|
|
69
|
+
},
|
|
70
|
+
/**
|
|
71
|
+
* Disable performance monitoring
|
|
72
|
+
*/
|
|
73
|
+
disable() {
|
|
74
|
+
isEnabled = false;
|
|
75
|
+
_config.ConfigManager.setConfig({
|
|
76
|
+
performance: {
|
|
77
|
+
enabled: false
|
|
78
|
+
}
|
|
79
|
+
});
|
|
80
|
+
},
|
|
81
|
+
/**
|
|
82
|
+
* Check if monitoring is enabled
|
|
83
|
+
*/
|
|
84
|
+
isEnabled() {
|
|
85
|
+
return isEnabled || _config.ConfigManager.getPerformanceConfig().enabled;
|
|
86
|
+
},
|
|
87
|
+
/**
|
|
88
|
+
* Record an icon load event
|
|
89
|
+
*/
|
|
90
|
+
recordEvent(iconName, type, duration, error) {
|
|
91
|
+
if (!PerformanceMonitor.isEnabled()) return;
|
|
92
|
+
const event = {
|
|
93
|
+
iconName,
|
|
94
|
+
type,
|
|
95
|
+
duration,
|
|
96
|
+
timestamp: Date.now(),
|
|
97
|
+
error
|
|
98
|
+
};
|
|
99
|
+
|
|
100
|
+
// Update statistics
|
|
101
|
+
switch (type) {
|
|
102
|
+
case 'memory_hit':
|
|
103
|
+
stats.memoryHits++;
|
|
104
|
+
break;
|
|
105
|
+
case 'bundled_hit':
|
|
106
|
+
stats.bundledHits++;
|
|
107
|
+
break;
|
|
108
|
+
case 'disk_hit':
|
|
109
|
+
stats.diskHits++;
|
|
110
|
+
break;
|
|
111
|
+
case 'network_fetch':
|
|
112
|
+
stats.networkFetches++;
|
|
113
|
+
break;
|
|
114
|
+
case 'error':
|
|
115
|
+
stats.errors++;
|
|
116
|
+
break;
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
// Track per-icon stats
|
|
120
|
+
const count = (iconLoadCounts.get(iconName) ?? 0) + 1;
|
|
121
|
+
iconLoadCounts.set(iconName, count);
|
|
122
|
+
const times = iconLoadTimes.get(iconName) ?? [];
|
|
123
|
+
times.push(duration);
|
|
124
|
+
iconLoadTimes.set(iconName, times);
|
|
125
|
+
|
|
126
|
+
// Add to events history
|
|
127
|
+
events.push(event);
|
|
128
|
+
|
|
129
|
+
// Trim history if needed
|
|
130
|
+
const maxSize = getMaxHistorySize();
|
|
131
|
+
while (events.length > maxSize) {
|
|
132
|
+
events.shift();
|
|
133
|
+
}
|
|
134
|
+
|
|
135
|
+
// Notify listeners
|
|
136
|
+
listeners.forEach(listener => {
|
|
137
|
+
try {
|
|
138
|
+
listener(event);
|
|
139
|
+
} catch (e) {
|
|
140
|
+
// Ignore listener errors
|
|
141
|
+
}
|
|
142
|
+
});
|
|
143
|
+
},
|
|
144
|
+
/**
|
|
145
|
+
* Subscribe to performance events
|
|
146
|
+
* Returns unsubscribe function
|
|
147
|
+
*/
|
|
148
|
+
subscribe(listener) {
|
|
149
|
+
listeners.push(listener);
|
|
150
|
+
return () => {
|
|
151
|
+
const index = listeners.indexOf(listener);
|
|
152
|
+
if (index > -1) {
|
|
153
|
+
listeners.splice(index, 1);
|
|
154
|
+
}
|
|
155
|
+
};
|
|
156
|
+
},
|
|
157
|
+
/**
|
|
158
|
+
* Get cache statistics
|
|
159
|
+
*/
|
|
160
|
+
getCacheStats() {
|
|
161
|
+
const totalRequests = stats.memoryHits + stats.bundledHits + stats.diskHits + stats.networkFetches + stats.errors;
|
|
162
|
+
const hits = stats.memoryHits + stats.bundledHits + stats.diskHits;
|
|
163
|
+
return {
|
|
164
|
+
memoryHits: stats.memoryHits,
|
|
165
|
+
bundledHits: stats.bundledHits,
|
|
166
|
+
diskHits: stats.diskHits,
|
|
167
|
+
networkFetches: stats.networkFetches,
|
|
168
|
+
errors: stats.errors,
|
|
169
|
+
totalRequests,
|
|
170
|
+
hitRate: totalRequests > 0 ? hits / totalRequests : 0
|
|
171
|
+
};
|
|
172
|
+
},
|
|
173
|
+
/**
|
|
174
|
+
* Get performance summary
|
|
175
|
+
*/
|
|
176
|
+
getSummary() {
|
|
177
|
+
const durations = events.filter(e => e.type !== 'error').map(e => e.duration).sort((a, b) => a - b);
|
|
178
|
+
const totalLoads = durations.length;
|
|
179
|
+
const totalErrors = events.filter(e => e.type === 'error').length;
|
|
180
|
+
if (totalLoads === 0) {
|
|
181
|
+
return {
|
|
182
|
+
avgLoadTime: 0,
|
|
183
|
+
minLoadTime: 0,
|
|
184
|
+
maxLoadTime: 0,
|
|
185
|
+
p50LoadTime: 0,
|
|
186
|
+
p90LoadTime: 0,
|
|
187
|
+
p99LoadTime: 0,
|
|
188
|
+
totalLoads: 0,
|
|
189
|
+
totalErrors,
|
|
190
|
+
uptime: Date.now() - startTime
|
|
191
|
+
};
|
|
192
|
+
}
|
|
193
|
+
const sum = durations.reduce((a, b) => a + b, 0);
|
|
194
|
+
return {
|
|
195
|
+
avgLoadTime: sum / totalLoads,
|
|
196
|
+
minLoadTime: durations[0],
|
|
197
|
+
maxLoadTime: durations[durations.length - 1],
|
|
198
|
+
p50LoadTime: percentile(durations, 50),
|
|
199
|
+
p90LoadTime: percentile(durations, 90),
|
|
200
|
+
p99LoadTime: percentile(durations, 99),
|
|
201
|
+
totalLoads,
|
|
202
|
+
totalErrors,
|
|
203
|
+
uptime: Date.now() - startTime
|
|
204
|
+
};
|
|
205
|
+
},
|
|
206
|
+
/**
|
|
207
|
+
* Get full performance report
|
|
208
|
+
*/
|
|
209
|
+
getReport() {
|
|
210
|
+
const summary = PerformanceMonitor.getSummary();
|
|
211
|
+
const cacheStats = PerformanceMonitor.getCacheStats();
|
|
212
|
+
|
|
213
|
+
// Calculate avg load times by type
|
|
214
|
+
const byType = {
|
|
215
|
+
memory: [],
|
|
216
|
+
bundled: [],
|
|
217
|
+
disk: [],
|
|
218
|
+
network: []
|
|
219
|
+
};
|
|
220
|
+
events.forEach(e => {
|
|
221
|
+
if (e.type === 'memory_hit') byType.memory.push(e.duration);else if (e.type === 'bundled_hit') byType.bundled.push(e.duration);else if (e.type === 'disk_hit') byType.disk.push(e.duration);else if (e.type === 'network_fetch') byType.network.push(e.duration);
|
|
222
|
+
});
|
|
223
|
+
const avg = arr => arr.length ? arr.reduce((a, b) => a + b, 0) / arr.length : 0;
|
|
224
|
+
|
|
225
|
+
// Get slowest icons
|
|
226
|
+
const slowestIcons = Array.from(iconLoadTimes.entries()).map(([iconName, times]) => ({
|
|
227
|
+
iconName,
|
|
228
|
+
avgDuration: avg(times),
|
|
229
|
+
count: times.length
|
|
230
|
+
})).sort((a, b) => b.avgDuration - a.avgDuration).slice(0, 10);
|
|
231
|
+
|
|
232
|
+
// Get most used icons
|
|
233
|
+
const mostUsedIcons = Array.from(iconLoadCounts.entries()).map(([iconName, count]) => ({
|
|
234
|
+
iconName,
|
|
235
|
+
count
|
|
236
|
+
})).sort((a, b) => b.count - a.count).slice(0, 10);
|
|
237
|
+
return {
|
|
238
|
+
summary,
|
|
239
|
+
cacheStats,
|
|
240
|
+
loadTimesByType: {
|
|
241
|
+
memory: avg(byType.memory),
|
|
242
|
+
bundled: avg(byType.bundled),
|
|
243
|
+
disk: avg(byType.disk),
|
|
244
|
+
network: avg(byType.network)
|
|
245
|
+
},
|
|
246
|
+
slowestIcons,
|
|
247
|
+
mostUsedIcons,
|
|
248
|
+
recentEvents: events.slice(-100),
|
|
249
|
+
generatedAt: Date.now()
|
|
250
|
+
};
|
|
251
|
+
},
|
|
252
|
+
/**
|
|
253
|
+
* Reset all performance data
|
|
254
|
+
*/
|
|
255
|
+
reset() {
|
|
256
|
+
events.length = 0;
|
|
257
|
+
iconLoadCounts.clear();
|
|
258
|
+
iconLoadTimes.clear();
|
|
259
|
+
stats = {
|
|
260
|
+
memoryHits: 0,
|
|
261
|
+
bundledHits: 0,
|
|
262
|
+
diskHits: 0,
|
|
263
|
+
networkFetches: 0,
|
|
264
|
+
errors: 0
|
|
265
|
+
};
|
|
266
|
+
startTime = Date.now();
|
|
267
|
+
},
|
|
268
|
+
/**
|
|
269
|
+
* Get raw events (for debugging)
|
|
270
|
+
*/
|
|
271
|
+
getEvents() {
|
|
272
|
+
return [...events];
|
|
273
|
+
},
|
|
274
|
+
/**
|
|
275
|
+
* Format report as string (for console output)
|
|
276
|
+
*/
|
|
277
|
+
formatReport() {
|
|
278
|
+
const report = PerformanceMonitor.getReport();
|
|
279
|
+
const {
|
|
280
|
+
summary,
|
|
281
|
+
cacheStats,
|
|
282
|
+
loadTimesByType
|
|
283
|
+
} = report;
|
|
284
|
+
const lines = ['┌─────────────────────────────────────────────────────┐', '│ rn-iconify Performance Report │', '├─────────────────────────────────────────────────────┤', `│ Total Loads: ${summary.totalLoads.toString().padEnd(10)} │ Errors: ${summary.totalErrors.toString().padEnd(8)} │`, `│ Cache Hit Rate: ${(cacheStats.hitRate * 100).toFixed(1)}% │`, '├─────────────────────────────────────────────────────┤', '│ Load Times │', `│ Average: ${summary.avgLoadTime.toFixed(2)}ms │`, `│ Min: ${summary.minLoadTime.toFixed(2)}ms │ Max: ${summary.maxLoadTime.toFixed(2)}ms │`, `│ P50: ${summary.p50LoadTime.toFixed(2)}ms │ P90: ${summary.p90LoadTime.toFixed(2)}ms │ P99: ${summary.p99LoadTime.toFixed(2)}ms │`, '├─────────────────────────────────────────────────────┤', '│ By Source │', `│ Memory: ${loadTimesByType.memory.toFixed(2)}ms (${cacheStats.memoryHits} hits) │`, `│ Bundled: ${loadTimesByType.bundled.toFixed(2)}ms (${cacheStats.bundledHits} hits) │`, `│ Disk: ${loadTimesByType.disk.toFixed(2)}ms (${cacheStats.diskHits} hits) │`, `│ Network: ${loadTimesByType.network.toFixed(2)}ms (${cacheStats.networkFetches} fetches) │`, '└─────────────────────────────────────────────────────┘'];
|
|
285
|
+
if (report.slowestIcons.length > 0) {
|
|
286
|
+
lines.push('');
|
|
287
|
+
lines.push('🐌 Slowest Icons:');
|
|
288
|
+
report.slowestIcons.slice(0, 5).forEach((icon, i) => {
|
|
289
|
+
lines.push(` ${i + 1}. ${icon.iconName} (${icon.avgDuration.toFixed(2)}ms avg, ${icon.count}x)`);
|
|
290
|
+
});
|
|
291
|
+
}
|
|
292
|
+
return lines.join('\n');
|
|
293
|
+
}
|
|
294
|
+
};
|
|
295
|
+
|
|
296
|
+
/**
|
|
297
|
+
* Enable performance monitoring
|
|
298
|
+
* Alias for PerformanceMonitor.enable()
|
|
299
|
+
*/
|
|
300
|
+
function enablePerformanceMonitoring() {
|
|
301
|
+
PerformanceMonitor.enable();
|
|
302
|
+
}
|
|
303
|
+
|
|
304
|
+
/**
|
|
305
|
+
* Disable performance monitoring
|
|
306
|
+
* Alias for PerformanceMonitor.disable()
|
|
307
|
+
*/
|
|
308
|
+
function disablePerformanceMonitoring() {
|
|
309
|
+
PerformanceMonitor.disable();
|
|
310
|
+
}
|
|
311
|
+
|
|
312
|
+
/**
|
|
313
|
+
* Get performance report
|
|
314
|
+
* Alias for PerformanceMonitor.getReport()
|
|
315
|
+
*/
|
|
316
|
+
function getPerformanceReport() {
|
|
317
|
+
return PerformanceMonitor.getReport();
|
|
318
|
+
}
|
|
319
|
+
|
|
320
|
+
/**
|
|
321
|
+
* Print formatted performance report to console
|
|
322
|
+
*/
|
|
323
|
+
function printPerformanceReport() {
|
|
324
|
+
console.log(PerformanceMonitor.formatReport());
|
|
325
|
+
}
|
|
326
|
+
var _default = exports.default = PerformanceMonitor;
|
|
327
|
+
//# sourceMappingURL=PerformanceMonitor.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["_config","require","isEnabled","startTime","Date","now","events","listeners","iconLoadCounts","Map","iconLoadTimes","stats","memoryHits","bundledHits","diskHits","networkFetches","errors","getMaxHistorySize","ConfigManager","getPerformanceConfig","maxHistorySize","percentile","sortedArr","p","length","index","Math","ceil","max","PerformanceMonitor","exports","enable","setConfig","performance","enabled","disable","recordEvent","iconName","type","duration","error","event","timestamp","count","get","set","times","push","maxSize","shift","forEach","listener","e","subscribe","indexOf","splice","getCacheStats","totalRequests","hits","hitRate","getSummary","durations","filter","map","sort","a","b","totalLoads","totalErrors","avgLoadTime","minLoadTime","maxLoadTime","p50LoadTime","p90LoadTime","p99LoadTime","uptime","sum","reduce","getReport","summary","cacheStats","byType","memory","bundled","disk","network","avg","arr","slowestIcons","Array","from","entries","avgDuration","slice","mostUsedIcons","loadTimesByType","recentEvents","generatedAt","reset","clear","getEvents","formatReport","report","lines","toString","padEnd","toFixed","icon","i","join","enablePerformanceMonitoring","disablePerformanceMonitoring","getPerformanceReport","printPerformanceReport","console","log","_default","default"],"sourceRoot":"../../../src","sources":["performance/PerformanceMonitor.ts"],"mappings":";;;;;;;;;;AAKA,IAAAA,OAAA,GAAAC,OAAA;AALA;AACA;AACA;AACA;;AAYA;AACA;AACA;AACA,IAAIC,SAAS,GAAG,KAAK;AACrB,IAAIC,SAAS,GAAGC,IAAI,CAACC,GAAG,CAAC,CAAC;AAC1B,MAAMC,MAAuB,GAAG,EAAE;AAClC,MAAMC,SAAgC,GAAG,EAAE;AAC3C,MAAMC,cAAc,GAAG,IAAIC,GAAG,CAAiB,CAAC;AAChD,MAAMC,aAAa,GAAG,IAAID,GAAG,CAAmB,CAAC;;AAEjD;AACA;AACA;AACA,IAAIE,KAAK,GAAG;EACVC,UAAU,EAAE,CAAC;EACbC,WAAW,EAAE,CA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AAAtF,OAAA,CAAAuF,OAAA,GAEcxF,kBAAkB","ignoreList":[]}
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
Object.defineProperty(exports, "PerformanceMonitor", {
|
|
7
|
+
enumerable: true,
|
|
8
|
+
get: function () {
|
|
9
|
+
return _PerformanceMonitor.PerformanceMonitor;
|
|
10
|
+
}
|
|
11
|
+
});
|
|
12
|
+
Object.defineProperty(exports, "default", {
|
|
13
|
+
enumerable: true,
|
|
14
|
+
get: function () {
|
|
15
|
+
return _PerformanceMonitor.PerformanceMonitor;
|
|
16
|
+
}
|
|
17
|
+
});
|
|
18
|
+
Object.defineProperty(exports, "disablePerformanceMonitoring", {
|
|
19
|
+
enumerable: true,
|
|
20
|
+
get: function () {
|
|
21
|
+
return _PerformanceMonitor.disablePerformanceMonitoring;
|
|
22
|
+
}
|
|
23
|
+
});
|
|
24
|
+
Object.defineProperty(exports, "enablePerformanceMonitoring", {
|
|
25
|
+
enumerable: true,
|
|
26
|
+
get: function () {
|
|
27
|
+
return _PerformanceMonitor.enablePerformanceMonitoring;
|
|
28
|
+
}
|
|
29
|
+
});
|
|
30
|
+
Object.defineProperty(exports, "getPerformanceReport", {
|
|
31
|
+
enumerable: true,
|
|
32
|
+
get: function () {
|
|
33
|
+
return _PerformanceMonitor.getPerformanceReport;
|
|
34
|
+
}
|
|
35
|
+
});
|
|
36
|
+
Object.defineProperty(exports, "printPerformanceReport", {
|
|
37
|
+
enumerable: true,
|
|
38
|
+
get: function () {
|
|
39
|
+
return _PerformanceMonitor.printPerformanceReport;
|
|
40
|
+
}
|
|
41
|
+
});
|
|
42
|
+
var _PerformanceMonitor = require("./PerformanceMonitor");
|
|
43
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["_PerformanceMonitor","require"],"sourceRoot":"../../../src","sources":["performance/index.ts"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA6BA,IAAAA,mBAAA,GAAAC,OAAA","ignoreList":[]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":[],"sourceRoot":"../../../src","sources":["performance/types.ts"],"mappings":"","ignoreList":[]}
|
|
@@ -0,0 +1,111 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.PlaceholderFactory = PlaceholderFactory;
|
|
7
|
+
var _react = _interopRequireWildcard(require("react"));
|
|
8
|
+
var _reactNative = require("react-native");
|
|
9
|
+
var _Skeleton = require("./Skeleton");
|
|
10
|
+
var _Pulse = require("./Pulse");
|
|
11
|
+
var _Shimmer = require("./Shimmer");
|
|
12
|
+
function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function (e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != typeof e && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (const t in e) "default" !== t && {}.hasOwnProperty.call(e, t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, t)) && (i.get || i.set) ? o(f, t, i) : f[t] = e[t]); return f; })(e, t); }
|
|
13
|
+
/**
|
|
14
|
+
* PlaceholderFactory
|
|
15
|
+
* Creates the appropriate placeholder component based on type
|
|
16
|
+
*/
|
|
17
|
+
|
|
18
|
+
/**
|
|
19
|
+
* Props for PlaceholderFactory
|
|
20
|
+
*/
|
|
21
|
+
|
|
22
|
+
/**
|
|
23
|
+
* Check if a value is a valid PlaceholderPreset
|
|
24
|
+
*/
|
|
25
|
+
function isPlaceholderPreset(value) {
|
|
26
|
+
return typeof value === 'string' && ['skeleton', 'pulse', 'shimmer'].includes(value);
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
/**
|
|
30
|
+
* PlaceholderFactory - renders the appropriate placeholder component
|
|
31
|
+
*
|
|
32
|
+
* @example
|
|
33
|
+
* ```tsx
|
|
34
|
+
* // Using preset
|
|
35
|
+
* <PlaceholderFactory type="shimmer" width={24} height={24} />
|
|
36
|
+
*
|
|
37
|
+
* // Using custom component
|
|
38
|
+
* <PlaceholderFactory type={<ActivityIndicator />} width={24} height={24} />
|
|
39
|
+
* ```
|
|
40
|
+
*/
|
|
41
|
+
function PlaceholderFactory({
|
|
42
|
+
type,
|
|
43
|
+
width,
|
|
44
|
+
height,
|
|
45
|
+
color,
|
|
46
|
+
highlightColor,
|
|
47
|
+
duration,
|
|
48
|
+
borderRadius,
|
|
49
|
+
testID
|
|
50
|
+
}) {
|
|
51
|
+
// Handle preset strings
|
|
52
|
+
if (isPlaceholderPreset(type)) {
|
|
53
|
+
const props = {
|
|
54
|
+
width,
|
|
55
|
+
height,
|
|
56
|
+
color,
|
|
57
|
+
highlightColor,
|
|
58
|
+
duration,
|
|
59
|
+
borderRadius,
|
|
60
|
+
testID
|
|
61
|
+
};
|
|
62
|
+
switch (type) {
|
|
63
|
+
case 'skeleton':
|
|
64
|
+
return /*#__PURE__*/_react.default.createElement(_Skeleton.Skeleton, props);
|
|
65
|
+
case 'pulse':
|
|
66
|
+
return /*#__PURE__*/_react.default.createElement(_Pulse.Pulse, props);
|
|
67
|
+
case 'shimmer':
|
|
68
|
+
return /*#__PURE__*/_react.default.createElement(_Shimmer.Shimmer, props);
|
|
69
|
+
default:
|
|
70
|
+
// TypeScript exhaustive check
|
|
71
|
+
const _exhaustive = type;
|
|
72
|
+
return _exhaustive;
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
// Handle custom ReactNode
|
|
77
|
+
if (/*#__PURE__*/(0, _react.isValidElement)(type)) {
|
|
78
|
+
return /*#__PURE__*/_react.default.createElement(_reactNative.View, {
|
|
79
|
+
style: [styles.customContainer, {
|
|
80
|
+
width,
|
|
81
|
+
height
|
|
82
|
+
}],
|
|
83
|
+
testID: testID
|
|
84
|
+
}, type);
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
// Handle null/undefined - render nothing
|
|
88
|
+
if (type === null || type === undefined) {
|
|
89
|
+
return null;
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
// Fallback to skeleton for any other value
|
|
93
|
+
if (__DEV__) {
|
|
94
|
+
console.warn(`[rn-iconify] Invalid placeholder type: ${String(type)}. ` + `Expected 'skeleton', 'pulse', 'shimmer', or a ReactNode.`);
|
|
95
|
+
}
|
|
96
|
+
return /*#__PURE__*/_react.default.createElement(_Skeleton.Skeleton, {
|
|
97
|
+
width: width,
|
|
98
|
+
height: height,
|
|
99
|
+
color: color,
|
|
100
|
+
borderRadius: borderRadius,
|
|
101
|
+
testID: testID
|
|
102
|
+
});
|
|
103
|
+
}
|
|
104
|
+
PlaceholderFactory.displayName = 'PlaceholderFactory';
|
|
105
|
+
const styles = _reactNative.StyleSheet.create({
|
|
106
|
+
customContainer: {
|
|
107
|
+
alignItems: 'center',
|
|
108
|
+
justifyContent: 'center'
|
|
109
|
+
}
|
|
110
|
+
});
|
|
111
|
+
//# sourceMappingURL=PlaceholderFactory.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["_react","_interopRequireWildcard","require","_reactNative","_Skeleton","_Pulse","_Shimmer","e","t","WeakMap","r","n","__esModule","o","i","f","__proto__","default","has","get","set","hasOwnProperty","call","Object","defineProperty","getOwnPropertyDescriptor","isPlaceholderPreset","value","includes","PlaceholderFactory","type","width","height","color","highlightColor","duration","borderRadius","testID","props","createElement","Skeleton","Pulse","Shimmer","_exhaustive","isValidElement","View","style","styles","customContainer","undefined","__DEV__","console","warn","String","displayName","StyleSheet","create","alignItems","justifyContent"],"sourceRoot":"../../../src","sources":["placeholder/PlaceholderFactory.tsx"],"mappings":";;;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I,IAAIA,IAAI,KAAKmB,SAAS,EAAE;IACvC,OAAO,IAAI;EACb;;EAEA;EACA,IAAIC,OAAO,EAAE;IACXC,OAAO,CAACC,IAAI,CACV,0CAA0CC,MAAM,CAACvB,IAAI,CAAC,IAAI,GACxD,0DACJ,CAAC;EACH;EAEA,oBACE9B,MAAA,CAAAiB,OAAA,CAAAsB,aAAA,CAACnC,SAAA,CAAAoC,QAAQ;IACPT,KAAK,EAAEA,KAAM;IACbC,MAAM,EAAEA,MAAO;IACfC,KAAK,EAAEA,KAAM;IACbG,YAAY,EAAEA,YAAa;IAC3BC,MAAM,EAAEA;EAAO,CAChB,CAAC;AAEN;AAEAR,kBAAkB,CAACyB,WAAW,GAAG,oBAAoB;AAErD,MAAMP,MAAM,GAAGQ,uBAAU,CAACC,MAAM,CAAC;EAC/BR,eAAe,EAAE;IACfS,UAAU,EAAE,QAAQ;IACpBC,cAAc,EAAE;EAClB;AACF,CAAC,CAAC","ignoreList":[]}
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.Pulse = void 0;
|
|
7
|
+
var _react = _interopRequireWildcard(require("react"));
|
|
8
|
+
var _reactNative = require("react-native");
|
|
9
|
+
var _types = require("./types");
|
|
10
|
+
function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function (e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != typeof e && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (const t in e) "default" !== t && {}.hasOwnProperty.call(e, t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, t)) && (i.get || i.set) ? o(f, t, i) : f[t] = e[t]); return f; })(e, t); }
|
|
11
|
+
/**
|
|
12
|
+
* Pulse Placeholder Component
|
|
13
|
+
* Animated opacity fade effect while icon is loading
|
|
14
|
+
*/
|
|
15
|
+
|
|
16
|
+
/**
|
|
17
|
+
* Pulse placeholder - animated opacity fade effect
|
|
18
|
+
* Provides subtle visual feedback during loading
|
|
19
|
+
*/
|
|
20
|
+
function PulseComponent({
|
|
21
|
+
width,
|
|
22
|
+
height,
|
|
23
|
+
color = _types.DEFAULT_PLACEHOLDER_CONFIG.color,
|
|
24
|
+
duration = _types.DEFAULT_PLACEHOLDER_CONFIG.duration,
|
|
25
|
+
borderRadius = _types.DEFAULT_PLACEHOLDER_CONFIG.borderRadius,
|
|
26
|
+
testID
|
|
27
|
+
}) {
|
|
28
|
+
const opacity = (0, _react.useRef)(new _reactNative.Animated.Value(1)).current;
|
|
29
|
+
const animationRef = (0, _react.useRef)(null);
|
|
30
|
+
(0, _react.useEffect)(() => {
|
|
31
|
+
// Create looping pulse animation
|
|
32
|
+
animationRef.current = _reactNative.Animated.loop(_reactNative.Animated.sequence([_reactNative.Animated.timing(opacity, {
|
|
33
|
+
toValue: 0.4,
|
|
34
|
+
duration: duration / 2,
|
|
35
|
+
easing: _reactNative.Easing.inOut(_reactNative.Easing.ease),
|
|
36
|
+
useNativeDriver: true
|
|
37
|
+
}), _reactNative.Animated.timing(opacity, {
|
|
38
|
+
toValue: 1,
|
|
39
|
+
duration: duration / 2,
|
|
40
|
+
easing: _reactNative.Easing.inOut(_reactNative.Easing.ease),
|
|
41
|
+
useNativeDriver: true
|
|
42
|
+
})]));
|
|
43
|
+
animationRef.current.start();
|
|
44
|
+
return () => {
|
|
45
|
+
// Clean up animation on unmount
|
|
46
|
+
if (animationRef.current) {
|
|
47
|
+
animationRef.current.stop();
|
|
48
|
+
}
|
|
49
|
+
};
|
|
50
|
+
}, [opacity, duration]);
|
|
51
|
+
return /*#__PURE__*/_react.default.createElement(_reactNative.Animated.View, {
|
|
52
|
+
style: [styles.pulse, {
|
|
53
|
+
width,
|
|
54
|
+
height,
|
|
55
|
+
backgroundColor: color,
|
|
56
|
+
borderRadius,
|
|
57
|
+
opacity
|
|
58
|
+
}],
|
|
59
|
+
testID: testID,
|
|
60
|
+
accessibilityRole: "none",
|
|
61
|
+
accessibilityElementsHidden: true,
|
|
62
|
+
importantForAccessibility: "no"
|
|
63
|
+
});
|
|
64
|
+
}
|
|
65
|
+
const styles = _reactNative.StyleSheet.create({
|
|
66
|
+
pulse: {
|
|
67
|
+
overflow: 'hidden'
|
|
68
|
+
}
|
|
69
|
+
});
|
|
70
|
+
|
|
71
|
+
/**
|
|
72
|
+
* Memoized Pulse component
|
|
73
|
+
* Animation runs independently of re-renders
|
|
74
|
+
*/
|
|
75
|
+
const Pulse = exports.Pulse = /*#__PURE__*/(0, _react.memo)(PulseComponent);
|
|
76
|
+
Pulse.displayName = 'Pulse';
|
|
77
|
+
//# sourceMappingURL=Pulse.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["_react","_interopRequireWildcard","require","_reactNative","_types","e","t","WeakMap","r","n","__esModule","o","i","f","__proto__","default","has","get","set","hasOwnProperty","call","Object","defineProperty","getOwnPropertyDescriptor","PulseComponent","width","height","color","DEFAULT_PLACEHOLDER_CONFIG","duration","borderRadius","testID","opacity","useRef","Animated","Value","current","animationRef","useEffect","loop","sequence","timing","toValue","easing","Easing","inOut","ease","useNativeDriver","start","stop","createElement","View","style","styles","pulse","backgroundColor","accessibilityRole","accessibilityElementsHidden","importantForAccessibility","StyleSheet","create","overflow","Pulse","exports","memo","displayName"],"sourceRoot":"../../../src","sources":["placeholder/Pulse.tsx"],"mappings":";;;;;;AAKA,IAAAA,MAAA,GAAAC,uBAAA,CAAAC,OAAA;AACA,IAAAC,YAAA,GAAAD,OAAA;AACA,IAAAE,MAAA,GAAAF,OAAA;AAAqD,SAAAD,wBAAAI,CAAA,EAAAC,CAAA,6BAAAC,OAAA,MAAAC,CAAA,OAAAD,OAAA,IAAAE,CAAA,OAAAF,OAAA,YAAAN,uBAAA,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