resuxjs 0.4.0-beta.6 → 0.4.0-beta.8
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 +55 -13
- package/dist/_virtual/_rolldown/runtime.js +4 -0
- package/dist/bin.d.ts +1 -1
- package/dist/bin.js +2 -4
- package/dist/bin.js.map +1 -1
- package/dist/build/index.d.ts +8 -12
- package/dist/build/index.js +3 -4
- package/dist/build/index.js.map +1 -1
- package/dist/cli.d.ts +8 -9
- package/dist/cli.js +292 -163
- package/dist/cli.js.map +1 -1
- package/dist/compiler/adapter.d.ts +6 -10
- package/dist/compiler/adapter.js +3 -5
- package/dist/compiler/adapter.js.map +1 -1
- package/dist/compiler/dev-warnings.d.ts +5 -9
- package/dist/compiler/dev-warnings.js +7 -9
- package/dist/compiler/dev-warnings.js.map +1 -1
- package/dist/compiler/directives.d.ts +3 -7
- package/dist/compiler/directives.js +2 -4
- package/dist/compiler/directives.js.map +1 -1
- package/dist/compiler/implementation.d.ts +25 -25
- package/dist/compiler/implementation.js +206 -157
- package/dist/compiler/index.d.ts +6 -10
- package/dist/compiler/index.js +3 -5
- package/dist/compiler/index.js.map +1 -1
- package/dist/core/config.d.ts +5 -10
- package/dist/core/config.js +2 -3
- package/dist/core/config.js.map +1 -1
- package/dist/core/hooks.d.ts +15 -10
- package/dist/core/hooks.js +2 -3
- package/dist/core/hooks.js.map +1 -1
- package/dist/core/index.d.ts +2 -2
- package/dist/core/index.js +1 -2
- package/dist/core/module-container.d.ts +21 -26
- package/dist/core/module-container.js +6 -6
- package/dist/core/module-container.js.map +1 -1
- package/dist/core/resux.d.ts +4 -9
- package/dist/core/resux.js +2 -4
- package/dist/core/resux.js.map +1 -1
- package/dist/create-bin.d.ts +1 -1
- package/dist/create-bin.js +2 -4
- package/dist/create-bin.js.map +1 -1
- package/dist/create.d.ts +2 -6
- package/dist/create.js +119 -43
- package/dist/create.js.map +1 -1
- package/dist/deploy/cloudflare.d.ts +1 -6
- package/dist/deploy/cloudflare.js +2 -4
- package/dist/deploy/cloudflare.js.map +1 -1
- package/dist/deploy/common.d.ts +12 -16
- package/dist/deploy/common.js +2 -4
- package/dist/deploy/common.js.map +1 -1
- package/dist/deploy/framework-runtime.d.ts +1 -5
- package/dist/deploy/framework-runtime.js +2 -4
- package/dist/deploy/framework-runtime.js.map +1 -1
- package/dist/deploy/index.d.ts +2 -7
- package/dist/deploy/index.js +7 -6
- package/dist/deploy/index.js.map +1 -1
- package/dist/deploy/netlify.d.ts +1 -6
- package/dist/deploy/netlify.js +3 -5
- package/dist/deploy/netlify.js.map +1 -1
- package/dist/deploy/node.d.ts +1 -6
- package/dist/deploy/node.js +4 -5
- package/dist/deploy/node.js.map +1 -1
- package/dist/deploy/production-report.d.ts +1 -5
- package/dist/deploy/production-report.js +2 -4
- package/dist/deploy/production-report.js.map +1 -1
- package/dist/deploy/runtime-dependencies.d.ts +4 -8
- package/dist/deploy/runtime-dependencies.js +4 -5
- package/dist/deploy/runtime-dependencies.js.map +1 -1
- package/dist/deploy/static.d.ts +1 -6
- package/dist/deploy/static.js +2 -4
- package/dist/deploy/static.js.map +1 -1
- package/dist/deploy/types.d.ts +8 -12
- package/dist/deploy/types.js +1 -1
- package/dist/deploy/vercel.d.ts +2 -7
- package/dist/deploy/vercel.js +6 -8
- package/dist/deploy/vercel.js.map +1 -1
- package/dist/fonts/index.d.ts +60 -12
- package/dist/fonts/index.js +422 -46
- package/dist/fonts/index.js.map +1 -1
- package/dist/globals.d.ts +2 -5
- package/dist/globals.js +1 -1
- package/dist/halal-core/ai/classifyProject.d.ts +3 -8
- package/dist/halal-core/ai/classifyProject.js +2 -4
- package/dist/halal-core/ai/classifyProject.js.map +1 -1
- package/dist/halal-core/ai/classifyRuntimeContent.d.ts +1 -6
- package/dist/halal-core/ai/classifyRuntimeContent.js +3 -5
- package/dist/halal-core/ai/classifyRuntimeContent.js.map +1 -1
- package/dist/halal-core/ai/createProjectSummary.d.ts +2 -6
- package/dist/halal-core/ai/createProjectSummary.js +2 -4
- package/dist/halal-core/ai/createProjectSummary.js.map +1 -1
- package/dist/halal-core/ai/halalClassifierPrompt.d.ts +1 -5
- package/dist/halal-core/ai/halalClassifierPrompt.js +2 -3
- package/dist/halal-core/ai/redactSensitiveData.d.ts +1 -5
- package/dist/halal-core/ai/redactSensitiveData.js +2 -3
- package/dist/halal-core/ai/redactSensitiveData.js.map +1 -1
- package/dist/halal-core/ai/validateAiResponse.d.ts +1 -6
- package/dist/halal-core/ai/validateAiResponse.js +4 -5
- package/dist/halal-core/ai/validateAiResponse.js.map +1 -1
- package/dist/halal-core/cli/check.d.ts +1 -5
- package/dist/halal-core/cli/check.js +5 -6
- package/dist/halal-core/cli/check.js.map +1 -1
- package/dist/halal-core/cli/explain.d.ts +1 -5
- package/dist/halal-core/cli/explain.js +5 -6
- package/dist/halal-core/cli/explain.js.map +1 -1
- package/dist/halal-core/cli/report.d.ts +1 -5
- package/dist/halal-core/cli/report.js +5 -6
- package/dist/halal-core/cli/report.js.map +1 -1
- package/dist/halal-core/cli/submitReview.d.ts +1 -5
- package/dist/halal-core/cli/submitReview.js +5 -6
- package/dist/halal-core/cli/submitReview.js.map +1 -1
- package/dist/halal-core/cli/verifyReview.d.ts +1 -5
- package/dist/halal-core/cli/verifyReview.js +7 -7
- package/dist/halal-core/cli/verifyReview.js.map +1 -1
- package/dist/halal-core/config.d.ts +10 -12
- package/dist/halal-core/config.js +46 -11
- package/dist/halal-core/config.js.map +1 -1
- package/dist/halal-core/crypto/integrity.d.ts +5 -9
- package/dist/halal-core/crypto/integrity.js +3 -5
- package/dist/halal-core/crypto/integrity.js.map +1 -1
- package/dist/halal-core/enforce.d.ts +7 -9
- package/dist/halal-core/enforce.js +47 -19
- package/dist/halal-core/enforce.js.map +1 -1
- package/dist/halal-core/index.d.ts +6 -6
- package/dist/halal-core/index.js +8 -9
- package/dist/halal-core/lifecycle.d.ts +1 -5
- package/dist/halal-core/lifecycle.js +2 -4
- package/dist/halal-core/lifecycle.js.map +1 -1
- package/dist/halal-core/policy.d.ts +1 -6
- package/dist/halal-core/policy.js +2 -4
- package/dist/halal-core/policy.js.map +1 -1
- package/dist/halal-core/report/formatBrowserOverlay.d.ts +1 -6
- package/dist/halal-core/report/formatBrowserOverlay.js +2 -3
- package/dist/halal-core/report/formatBrowserOverlay.js.map +1 -1
- package/dist/halal-core/report/formatTerminalReport.d.ts +1 -6
- package/dist/halal-core/report/formatTerminalReport.js +2 -3
- package/dist/halal-core/report/formatTerminalReport.js.map +1 -1
- package/dist/halal-core/report/generateHalalReport.d.ts +2 -7
- package/dist/halal-core/report/generateHalalReport.js +8 -7
- package/dist/halal-core/report/generateHalalReport.js.map +1 -1
- package/dist/halal-core/report/signReport.d.ts +2 -7
- package/dist/halal-core/report/signReport.js +2 -4
- package/dist/halal-core/report/signReport.js.map +1 -1
- package/dist/halal-core/report/verifyReport.d.ts +4 -9
- package/dist/halal-core/report/verifyReport.js +4 -6
- package/dist/halal-core/report/verifyReport.js.map +1 -1
- package/dist/halal-core/review/createReviewRequest.d.ts +1 -6
- package/dist/halal-core/review/createReviewRequest.js +4 -5
- package/dist/halal-core/review/createReviewRequest.js.map +1 -1
- package/dist/halal-core/review/reviewPolicy.d.ts +3 -7
- package/dist/halal-core/review/reviewPolicy.js +2 -3
- package/dist/halal-core/review/reviewPolicy.js.map +1 -1
- package/dist/halal-core/review/signedReviewFile.d.ts +4 -9
- package/dist/halal-core/review/signedReviewFile.js +2 -4
- package/dist/halal-core/review/signedReviewFile.js.map +1 -1
- package/dist/halal-core/review/verifyReviewApproval.d.ts +3 -7
- package/dist/halal-core/review/verifyReviewApproval.js +2 -4
- package/dist/halal-core/review/verifyReviewApproval.js.map +1 -1
- package/dist/halal-core/rules/adultContentRules.d.ts +2 -6
- package/dist/halal-core/rules/adultContentRules.js +2 -3
- package/dist/halal-core/rules/adultContentRules.js.map +1 -1
- package/dist/halal-core/rules/alcoholDrugVapeRules.d.ts +2 -6
- package/dist/halal-core/rules/alcoholDrugVapeRules.js +2 -3
- package/dist/halal-core/rules/alcoholDrugVapeRules.js.map +1 -1
- package/dist/halal-core/rules/childSafetyRules.d.ts +2 -6
- package/dist/halal-core/rules/childSafetyRules.js +2 -3
- package/dist/halal-core/rules/childSafetyRules.js.map +1 -1
- package/dist/halal-core/rules/coreCategories.d.ts +2 -6
- package/dist/halal-core/rules/coreCategories.js +2 -3
- package/dist/halal-core/rules/coreCategories.js.map +1 -1
- package/dist/halal-core/rules/cyberAbuseRules.d.ts +2 -6
- package/dist/halal-core/rules/cyberAbuseRules.js +2 -3
- package/dist/halal-core/rules/cyberAbuseRules.js.map +1 -1
- package/dist/halal-core/rules/defaultBlockedRules.d.ts +2 -7
- package/dist/halal-core/rules/defaultBlockedRules.js +12 -11
- package/dist/halal-core/rules/defaultBlockedRules.js.map +1 -1
- package/dist/halal-core/rules/dependencyRules.d.ts +3 -7
- package/dist/halal-core/rules/dependencyRules.js +2 -3
- package/dist/halal-core/rules/dependencyRules.js.map +1 -1
- package/dist/halal-core/rules/endpointRules.d.ts +3 -7
- package/dist/halal-core/rules/endpointRules.js +2 -3
- package/dist/halal-core/rules/endpointRules.js.map +1 -1
- package/dist/halal-core/rules/environmentalHarmRules.d.ts +2 -6
- package/dist/halal-core/rules/environmentalHarmRules.js +2 -3
- package/dist/halal-core/rules/environmentalHarmRules.js.map +1 -1
- package/dist/halal-core/rules/financeRibaRules.d.ts +2 -6
- package/dist/halal-core/rules/financeRibaRules.js +2 -3
- package/dist/halal-core/rules/financeRibaRules.js.map +1 -1
- package/dist/halal-core/rules/gamblingRules.d.ts +2 -6
- package/dist/halal-core/rules/gamblingRules.js +2 -3
- package/dist/halal-core/rules/gamblingRules.js.map +1 -1
- package/dist/halal-core/rules/generalHarmRules.d.ts +2 -6
- package/dist/halal-core/rules/generalHarmRules.js +2 -3
- package/dist/halal-core/rules/generalHarmRules.js.map +1 -1
- package/dist/halal-core/rules/healthHarmRules.d.ts +2 -6
- package/dist/halal-core/rules/healthHarmRules.js +2 -3
- package/dist/halal-core/rules/healthHarmRules.js.map +1 -1
- package/dist/halal-core/rules/keywordRules.d.ts +2 -6
- package/dist/halal-core/rules/keywordRules.js +2 -3
- package/dist/halal-core/rules/keywordRules.js.map +1 -1
- package/dist/halal-core/rules/privacyAbuseRules.d.ts +2 -6
- package/dist/halal-core/rules/privacyAbuseRules.js +2 -3
- package/dist/halal-core/rules/privacyAbuseRules.js.map +1 -1
- package/dist/halal-core/rules/scamFraudRules.d.ts +2 -6
- package/dist/halal-core/rules/scamFraudRules.js +2 -3
- package/dist/halal-core/rules/scamFraudRules.js.map +1 -1
- package/dist/halal-core/rules/selfHarmRules.d.ts +2 -6
- package/dist/halal-core/rules/selfHarmRules.js +2 -3
- package/dist/halal-core/rules/selfHarmRules.js.map +1 -1
- package/dist/halal-core/rules/violenceExtremismRules.d.ts +2 -6
- package/dist/halal-core/rules/violenceExtremismRules.js +2 -3
- package/dist/halal-core/rules/violenceExtremismRules.js.map +1 -1
- package/dist/halal-core/runtime/guard.d.ts +3 -8
- package/dist/halal-core/runtime/guard.js +5 -7
- package/dist/halal-core/runtime/guard.js.map +1 -1
- package/dist/halal-core/runtime/index.js +1 -2
- package/dist/halal-core/runtime/reviewedMemory.d.ts +4 -9
- package/dist/halal-core/runtime/reviewedMemory.js +3 -5
- package/dist/halal-core/runtime/reviewedMemory.js.map +1 -1
- package/dist/halal-core/runtime/serializeRuntimeContent.d.ts +5 -10
- package/dist/halal-core/runtime/serializeRuntimeContent.js +4 -6
- package/dist/halal-core/runtime/serializeRuntimeContent.js.map +1 -1
- package/dist/halal-core/runtime/types.d.ts +10 -15
- package/dist/halal-core/runtime/types.js +1 -1
- package/dist/halal-core/scanner/scanApiRoutes.d.ts +1 -5
- package/dist/halal-core/scanner/scanApiRoutes.js +2 -4
- package/dist/halal-core/scanner/scanApiRoutes.js.map +1 -1
- package/dist/halal-core/scanner/scanComponents.d.ts +1 -5
- package/dist/halal-core/scanner/scanComponents.js +2 -4
- package/dist/halal-core/scanner/scanComponents.js.map +1 -1
- package/dist/halal-core/scanner/scanContent.d.ts +2 -6
- package/dist/halal-core/scanner/scanContent.js +4 -6
- package/dist/halal-core/scanner/scanContent.js.map +1 -1
- package/dist/halal-core/scanner/scanDependencies.d.ts +1 -5
- package/dist/halal-core/scanner/scanDependencies.js +2 -4
- package/dist/halal-core/scanner/scanDependencies.js.map +1 -1
- package/dist/halal-core/scanner/scanDomains.d.ts +2 -6
- package/dist/halal-core/scanner/scanDomains.js +2 -3
- package/dist/halal-core/scanner/scanDomains.js.map +1 -1
- package/dist/halal-core/scanner/scanEnvNames.d.ts +1 -5
- package/dist/halal-core/scanner/scanEnvNames.js +2 -4
- package/dist/halal-core/scanner/scanEnvNames.js.map +1 -1
- package/dist/halal-core/scanner/scanMetadata.d.ts +2 -6
- package/dist/halal-core/scanner/scanMetadata.js +2 -4
- package/dist/halal-core/scanner/scanMetadata.js.map +1 -1
- package/dist/halal-core/scanner/scanPages.d.ts +1 -5
- package/dist/halal-core/scanner/scanPages.js +2 -4
- package/dist/halal-core/scanner/scanPages.js.map +1 -1
- package/dist/halal-core/scanner/scanProject.d.ts +3 -8
- package/dist/halal-core/scanner/scanProject.js +2 -4
- package/dist/halal-core/scanner/scanProject.js.map +1 -1
- package/dist/halal-core/scanner/scanRoutes.d.ts +1 -5
- package/dist/halal-core/scanner/scanRoutes.js +2 -4
- package/dist/halal-core/scanner/scanRoutes.js.map +1 -1
- package/dist/halal-core/scanner/scanTranslations.d.ts +1 -5
- package/dist/halal-core/scanner/scanTranslations.js +2 -4
- package/dist/halal-core/scanner/scanTranslations.js.map +1 -1
- package/dist/halal-core/status.d.ts +3 -7
- package/dist/halal-core/status.js +1 -1
- package/dist/halal-core/tamper/verifyCoreIntegrity.d.ts +1 -5
- package/dist/halal-core/tamper/verifyCoreIntegrity.js +2 -4
- package/dist/halal-core/tamper/verifyCoreIntegrity.js.map +1 -1
- package/dist/halal-core/tamper/verifyLifecycleHooks.d.ts +1 -5
- package/dist/halal-core/tamper/verifyLifecycleHooks.js +2 -3
- package/dist/halal-core/tamper/verifyLifecycleHooks.js.map +1 -1
- package/dist/halal-core/tamper/verifyReportSignature.d.ts +2 -7
- package/dist/halal-core/tamper/verifyReportSignature.js +4 -5
- package/dist/halal-core/tamper/verifyReportSignature.js.map +1 -1
- package/dist/halal.d.ts +2 -2
- package/dist/halal.js +2 -3
- package/dist/head/utils.d.ts +15 -0
- package/dist/head/utils.js +52 -0
- package/dist/head/utils.js.map +1 -0
- package/dist/i18n/index.d.ts +11 -15
- package/dist/i18n/index.js +9 -9
- package/dist/i18n/index.js.map +1 -1
- package/dist/i18n/shared.d.ts +15 -19
- package/dist/i18n/shared.js +5 -6
- package/dist/i18n/shared.js.map +1 -1
- package/dist/icons/api-fetcher.d.ts +3 -0
- package/dist/icons/api-fetcher.js +77 -0
- package/dist/icons/api-fetcher.js.map +1 -0
- package/dist/icons/cache.d.ts +21 -0
- package/dist/icons/cache.js +74 -0
- package/dist/icons/cache.js.map +1 -0
- package/dist/icons/component.d.ts +156 -0
- package/dist/icons/component.js +139 -0
- package/dist/icons/component.js.map +1 -0
- package/dist/icons/constants.d.ts +13 -0
- package/dist/icons/constants.js +16 -0
- package/dist/icons/constants.js.map +1 -0
- package/dist/icons/css-mode.d.ts +6 -0
- package/dist/icons/css-mode.js +51 -0
- package/dist/icons/css-mode.js.map +1 -0
- package/dist/icons/index.d.ts +14 -153
- package/dist/icons/index.js +30 -286
- package/dist/icons/index.js.map +1 -1
- package/dist/icons/local-svg.d.ts +4 -0
- package/dist/icons/local-svg.js +53 -0
- package/dist/icons/local-svg.js.map +1 -0
- package/dist/icons/normalize.d.ts +4 -0
- package/dist/icons/normalize.js +63 -0
- package/dist/icons/normalize.js.map +1 -0
- package/dist/icons/offline-loader.d.ts +20 -0
- package/dist/icons/offline-loader.js +94 -0
- package/dist/icons/offline-loader.js.map +1 -0
- package/dist/icons/parser.d.ts +4 -0
- package/dist/icons/parser.js +89 -0
- package/dist/icons/parser.js.map +1 -0
- package/dist/icons/registry.d.ts +6 -22
- package/dist/icons/registry.js +82 -75
- package/dist/icons/registry.js.map +1 -1
- package/dist/icons/resolver.d.ts +3 -0
- package/dist/icons/resolver.js +45 -0
- package/dist/icons/resolver.js.map +1 -0
- package/dist/icons/svg-mode.d.ts +3 -0
- package/dist/icons/svg-mode.js +54 -0
- package/dist/icons/svg-mode.js.map +1 -0
- package/dist/icons/transform.d.ts +10 -0
- package/dist/icons/transform.js +68 -0
- package/dist/icons/transform.js.map +1 -0
- package/dist/icons/types.d.ts +48 -0
- package/dist/icons/types.js +1 -0
- package/dist/index.d.ts +4 -2
- package/dist/index.js +3 -3
- package/dist/kit/index.d.ts +21 -26
- package/dist/kit/index.js +2 -4
- package/dist/kit/index.js.map +1 -1
- package/dist/nitro-server/index.d.ts +2 -6
- package/dist/nitro-server/index.js +2 -3
- package/dist/nitro-server/index.js.map +1 -1
- package/dist/node.d.ts +2 -7
- package/dist/node.js +7 -9
- package/dist/node.js.map +1 -1
- package/dist/reactivity/computed.d.ts +3 -8
- package/dist/reactivity/computed.js +4 -5
- package/dist/reactivity/computed.js.map +1 -1
- package/dist/reactivity/effect.d.ts +14 -18
- package/dist/reactivity/effect.js +18 -13
- package/dist/reactivity/effect.js.map +1 -1
- package/dist/reactivity/index.d.ts +1 -1
- package/dist/reactivity/index.js +3 -4
- package/dist/reactivity/reactive.d.ts +5 -9
- package/dist/reactivity/reactive.js +225 -17
- package/dist/reactivity/reactive.js.map +1 -1
- package/dist/reactivity/readonly.js +1 -3
- package/dist/reactivity/ref.d.ts +9 -13
- package/dist/reactivity/ref.js +6 -5
- package/dist/reactivity/ref.js.map +1 -1
- package/dist/reactivity/scheduler.d.ts +5 -8
- package/dist/reactivity/scheduler.js +4 -3
- package/dist/reactivity/scheduler.js.map +1 -1
- package/dist/reactivity/types.d.ts +12 -16
- package/dist/reactivity/types.js +1 -1
- package/dist/reactivity/utils.d.ts +9 -13
- package/dist/reactivity/utils.js +2 -3
- package/dist/reactivity/utils.js.map +1 -1
- package/dist/reactivity/watch.d.ts +3 -7
- package/dist/reactivity/watch.js +7 -7
- package/dist/reactivity/watch.js.map +1 -1
- package/dist/runtime/core.d.ts +4 -21
- package/dist/runtime/core.js +11 -24
- package/dist/runtime/core.js.map +1 -1
- package/dist/runtime/index.d.ts +180 -159
- package/dist/runtime/index.js +3205 -1080
- package/dist/runtime/index.js.map +1 -1
- package/dist/runtime/reactivity.d.ts +4 -4
- package/dist/runtime/reactivity.js +2 -3
- package/dist/runtime/resume.d.ts +14 -52
- package/dist/runtime/resume.js +4 -34
- package/dist/runtime/resume.js.map +1 -1
- package/dist/runtime/router.d.ts +5 -18
- package/dist/runtime/router.js +7 -17
- package/dist/runtime/router.js.map +1 -1
- package/dist/runtime/streaming.d.ts +6 -14
- package/dist/runtime/streaming.js +4 -9
- package/dist/runtime/streaming.js.map +1 -1
- package/dist/runtime/view-transitions/detect.d.ts +10 -0
- package/dist/runtime/view-transitions/detect.js +16 -0
- package/dist/runtime/view-transitions/detect.js.map +1 -0
- package/dist/runtime/view-transitions/index.d.ts +4 -0
- package/dist/runtime/view-transitions/index.js +3 -0
- package/dist/runtime/view-transitions/transition.d.ts +3 -0
- package/dist/runtime/view-transitions/transition.js +41 -0
- package/dist/runtime/view-transitions/transition.js.map +1 -0
- package/dist/runtime/view-transitions/types.d.ts +7 -0
- package/dist/runtime/view-transitions/types.js +1 -0
- package/dist/security/media-fetch.d.ts +11 -15
- package/dist/security/media-fetch.js +5 -7
- package/dist/security/media-fetch.js.map +1 -1
- package/dist/security/path-boundary.d.ts +4 -8
- package/dist/security/path-boundary.js +12 -8
- package/dist/security/path-boundary.js.map +1 -1
- package/dist/ui/index.d.ts +378 -229
- package/dist/ui/index.js +199 -152
- package/dist/ui/index.js.map +1 -1
- package/dist/ui/verification-code.d.ts +133 -0
- package/dist/ui/verification-code.js +472 -0
- package/dist/ui/verification-code.js.map +1 -0
- package/dist/vite-builder/index.d.ts +2 -6
- package/dist/vite-builder/index.js +2 -3
- package/dist/vite-builder/index.js.map +1 -1
- package/package.json +5 -2
- package/templates/default/.env.example +3 -0
- package/templates/default/nitro.config.ts +16 -4
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import { DEFAULT_CUSTOM_COLLECTIONS_DIR } from "./constants.js";
|
|
2
|
+
import { parseSvgText } from "./parser.js";
|
|
3
|
+
import { existsSync, readFileSync } from "node:fs";
|
|
4
|
+
import { readFile } from "node:fs/promises";
|
|
5
|
+
import path from "node:path";
|
|
6
|
+
// src/icons/local-svg.ts
|
|
7
|
+
const localSvgCache = /* @__PURE__ */ new Map();
|
|
8
|
+
function resolveSafeIconPath(name, dir, rootDir = process.cwd()) {
|
|
9
|
+
if (!name || typeof name !== "string") return null;
|
|
10
|
+
if (path.isAbsolute(name) || /^(?:[a-zA-Z]:|[\\/]{2})/.test(name) || name.includes("\0")) return null;
|
|
11
|
+
const cleanName = path.normalize(name).replace(/^[\\/]+/, "");
|
|
12
|
+
if (cleanName.startsWith("..") || cleanName.split(/[\\/]/).includes("..")) return null;
|
|
13
|
+
const baseDirectory = path.resolve(rootDir, dir);
|
|
14
|
+
const targetPath = path.resolve(baseDirectory, cleanName.endsWith(".svg") ? cleanName : `${cleanName}.svg`);
|
|
15
|
+
const rel = path.relative(baseDirectory, targetPath);
|
|
16
|
+
if (rel.startsWith("..") || path.isAbsolute(rel) || rel.split(/[\\/]/).includes("..")) return null;
|
|
17
|
+
return targetPath;
|
|
18
|
+
}
|
|
19
|
+
function cacheAndReturnParsedSvg(cacheKey, content) {
|
|
20
|
+
const data = parseSvgText(content);
|
|
21
|
+
if (data) localSvgCache.set(cacheKey, data);
|
|
22
|
+
return data;
|
|
23
|
+
}
|
|
24
|
+
function loadLocalSvgIconSync(name, dir = DEFAULT_CUSTOM_COLLECTIONS_DIR, rootDir = process.cwd()) {
|
|
25
|
+
const cacheKey = `${dir}:${name}`;
|
|
26
|
+
const cached = localSvgCache.get(cacheKey);
|
|
27
|
+
if (cached) return cached;
|
|
28
|
+
const targetPath = resolveSafeIconPath(name, dir, rootDir);
|
|
29
|
+
if (!targetPath || !existsSync(targetPath)) return null;
|
|
30
|
+
try {
|
|
31
|
+
return cacheAndReturnParsedSvg(cacheKey, readFileSync(targetPath, "utf-8"));
|
|
32
|
+
} catch {
|
|
33
|
+
return null;
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
async function loadLocalSvgIcon(name, dir = DEFAULT_CUSTOM_COLLECTIONS_DIR, rootDir = process.cwd()) {
|
|
37
|
+
const cacheKey = `${dir}:${name}`;
|
|
38
|
+
const cached = localSvgCache.get(cacheKey);
|
|
39
|
+
if (cached) return cached;
|
|
40
|
+
const targetPath = resolveSafeIconPath(name, dir, rootDir);
|
|
41
|
+
if (!targetPath) return null;
|
|
42
|
+
try {
|
|
43
|
+
return cacheAndReturnParsedSvg(cacheKey, await readFile(targetPath, "utf-8"));
|
|
44
|
+
} catch {
|
|
45
|
+
return null;
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
function clearLocalSvgCache() {
|
|
49
|
+
localSvgCache.clear();
|
|
50
|
+
}
|
|
51
|
+
export { clearLocalSvgCache, loadLocalSvgIcon, loadLocalSvgIconSync };
|
|
52
|
+
|
|
53
|
+
//# sourceMappingURL=local-svg.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"local-svg.js","names":[],"sources":["../../src/icons/local-svg.ts"],"sourcesContent":["import { existsSync, readFileSync } from \"node:fs\";\nimport { readFile } from \"node:fs/promises\";\nimport path from \"node:path\";\nimport { DEFAULT_CUSTOM_COLLECTIONS_DIR } from \"./constants.js\";\nimport { parseSvgText } from \"./parser.js\";\nimport type { IconData } from \"./types.js\";\n\nconst localSvgCache = new Map<string, IconData>();\n\nfunction resolveSafeIconPath(name: string, dir: string, rootDir: string = process.cwd()): string | null {\n if (!name || typeof name !== \"string\") return null;\n // Reject absolute paths, Windows drive letters, null bytes, or URL schemes\n if (path.isAbsolute(name) || /^(?:[a-zA-Z]:|[\\\\/]{2})/.test(name) || name.includes(\"\\0\")) {\n return null;\n }\n const cleanName = path.normalize(name).replace(/^[\\\\/]+/, \"\");\n if (cleanName.startsWith(\"..\") || cleanName.split(/[\\\\/]/).includes(\"..\")) {\n return null;\n }\n const baseDirectory = path.resolve(rootDir, dir);\n const targetPath = path.resolve(baseDirectory, cleanName.endsWith(\".svg\") ? cleanName : `${cleanName}.svg`);\n\n const rel = path.relative(baseDirectory, targetPath);\n if (rel.startsWith(\"..\") || path.isAbsolute(rel) || rel.split(/[\\\\/]/).includes(\"..\")) {\n return null;\n }\n return targetPath;\n}\n\nfunction cacheAndReturnParsedSvg(cacheKey: string, content: string): IconData | null {\n const data = parseSvgText(content);\n if (data) {\n localSvgCache.set(cacheKey, data);\n }\n return data;\n}\n\nexport function loadLocalSvgIconSync(\n name: string,\n dir: string = DEFAULT_CUSTOM_COLLECTIONS_DIR,\n rootDir: string = process.cwd()\n): IconData | null {\n const cacheKey = `${dir}:${name}`;\n const cached = localSvgCache.get(cacheKey);\n if (cached) return cached;\n\n const targetPath = resolveSafeIconPath(name, dir, rootDir);\n if (!targetPath || !existsSync(targetPath)) return null;\n\n try {\n const content = readFileSync(targetPath, \"utf-8\");\n return cacheAndReturnParsedSvg(cacheKey, content);\n } catch {\n return null;\n }\n}\n\nexport async function loadLocalSvgIcon(\n name: string,\n dir: string = DEFAULT_CUSTOM_COLLECTIONS_DIR,\n rootDir: string = process.cwd()\n): Promise<IconData | null> {\n const cacheKey = `${dir}:${name}`;\n const cached = localSvgCache.get(cacheKey);\n if (cached) return cached;\n\n const targetPath = resolveSafeIconPath(name, dir, rootDir);\n if (!targetPath) return null;\n\n try {\n const content = await readFile(targetPath, \"utf-8\");\n return cacheAndReturnParsedSvg(cacheKey, content);\n } catch {\n return null;\n }\n}\n\nexport function clearLocalSvgCache(): void {\n localSvgCache.clear();\n}\n"],"mappings":";;;;;;AAOA,MAAM,gCAAgB,IAAI,IAAsB;AAEhD,SAAS,oBAAoB,MAAc,KAAa,UAAkB,QAAQ,IAAI,GAAkB;CACtG,IAAI,CAAC,QAAQ,OAAO,SAAS,UAAU,OAAO;CAE9C,IAAI,KAAK,WAAW,IAAI,KAAK,0BAA0B,KAAK,IAAI,KAAK,KAAK,SAAS,IAAI,GACrF,OAAO;CAET,MAAM,YAAY,KAAK,UAAU,IAAI,CAAC,CAAC,QAAQ,WAAW,EAAE;CAC5D,IAAI,UAAU,WAAW,IAAI,KAAK,UAAU,MAAM,OAAO,CAAC,CAAC,SAAS,IAAI,GACtE,OAAO;CAET,MAAM,gBAAgB,KAAK,QAAQ,SAAS,GAAG;CAC/C,MAAM,aAAa,KAAK,QAAQ,eAAe,UAAU,SAAS,MAAM,IAAI,YAAY,GAAG,UAAU,KAAK;CAE1G,MAAM,MAAM,KAAK,SAAS,eAAe,UAAU;CACnD,IAAI,IAAI,WAAW,IAAI,KAAK,KAAK,WAAW,GAAG,KAAK,IAAI,MAAM,OAAO,CAAC,CAAC,SAAS,IAAI,GAClF,OAAO;CAET,OAAO;AACT;AAEA,SAAS,wBAAwB,UAAkB,SAAkC;CACnF,MAAM,OAAO,aAAa,OAAO;CACjC,IAAI,MACF,cAAc,IAAI,UAAU,IAAI;CAElC,OAAO;AACT;AAEA,SAAgB,qBACd,MACA,MAAc,gCACd,UAAkB,QAAQ,IAAI,GACb;CACjB,MAAM,WAAW,GAAG,IAAI,GAAG;CAC3B,MAAM,SAAS,cAAc,IAAI,QAAQ;CACzC,IAAI,QAAQ,OAAO;CAEnB,MAAM,aAAa,oBAAoB,MAAM,KAAK,OAAO;CACzD,IAAI,CAAC,cAAc,CAAC,WAAW,UAAU,GAAG,OAAO;CAEnD,IAAI;EAEF,OAAO,wBAAwB,UADf,aAAa,YAAY,OACM,CAAC;CAClD,QAAQ;EACN,OAAO;CACT;AACF;AAEA,eAAsB,iBACpB,MACA,MAAc,gCACd,UAAkB,QAAQ,IAAI,GACJ;CAC1B,MAAM,WAAW,GAAG,IAAI,GAAG;CAC3B,MAAM,SAAS,cAAc,IAAI,QAAQ;CACzC,IAAI,QAAQ,OAAO;CAEnB,MAAM,aAAa,oBAAoB,MAAM,KAAK,OAAO;CACzD,IAAI,CAAC,YAAY,OAAO;CAExB,IAAI;EAEF,OAAO,wBAAwB,UAAU,MADnB,SAAS,YAAY,OAAO,CACF;CAClD,QAAQ;EACN,OAAO;CACT;AACF;AAEA,SAAgB,qBAA2B;CACzC,cAAc,MAAM;AACtB"}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { ParsedIconName } from "./types.js";
|
|
2
|
+
export declare function stripTrailingSlashes(value: string): string;
|
|
3
|
+
export declare function normalizeIconApiProvider(value: unknown): string;
|
|
4
|
+
export declare function parseIconName(rawName: string, aliases?: Record<string, string>, knownCollections?: string[], depth?: number, visited?: Set<string>): ParsedIconName | null;
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
import { DEFAULT_ICON_API_PROVIDER } from "./constants.js";
|
|
2
|
+
// src/icons/normalize.ts
|
|
3
|
+
function stripTrailingSlashes(value) {
|
|
4
|
+
let end = value.length;
|
|
5
|
+
while (end > 0 && value.codePointAt(end - 1) === 47) end -= 1;
|
|
6
|
+
return value.slice(0, end);
|
|
7
|
+
}
|
|
8
|
+
function normalizeIconApiProvider(value) {
|
|
9
|
+
const raw = typeof value === "string" ? stripTrailingSlashes(value.trim()) : "";
|
|
10
|
+
if (!raw || raw.startsWith("//")) return DEFAULT_ICON_API_PROVIDER;
|
|
11
|
+
if (raw.startsWith("/")) return raw;
|
|
12
|
+
try {
|
|
13
|
+
const url = new URL(raw);
|
|
14
|
+
if (url.protocol === "https:" || url.protocol === "http:") return stripTrailingSlashes(url.toString());
|
|
15
|
+
} catch {}
|
|
16
|
+
return DEFAULT_ICON_API_PROVIDER;
|
|
17
|
+
}
|
|
18
|
+
function splitIconDelimiter(candidate, delimiter) {
|
|
19
|
+
if (!candidate.includes(delimiter)) return null;
|
|
20
|
+
const [prefix, ...rest] = candidate.split(delimiter);
|
|
21
|
+
const name = rest.join(delimiter);
|
|
22
|
+
return prefix && name ? {
|
|
23
|
+
prefix,
|
|
24
|
+
name
|
|
25
|
+
} : null;
|
|
26
|
+
}
|
|
27
|
+
function matchKnownCollectionPrefix(candidate, knownCollections) {
|
|
28
|
+
for (const collection of knownCollections) {
|
|
29
|
+
const normalizedColl = collection.toLowerCase();
|
|
30
|
+
if (candidate.startsWith(`${normalizedColl}-`)) {
|
|
31
|
+
const name = candidate.slice(normalizedColl.length + 1);
|
|
32
|
+
if (name) return {
|
|
33
|
+
prefix: normalizedColl,
|
|
34
|
+
name
|
|
35
|
+
};
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
return null;
|
|
39
|
+
}
|
|
40
|
+
function splitHyphenatedIconName(candidate) {
|
|
41
|
+
const firstHyphen = candidate.indexOf("-");
|
|
42
|
+
if (firstHyphen > 0 && firstHyphen < candidate.length - 1) return {
|
|
43
|
+
prefix: candidate.slice(0, firstHyphen),
|
|
44
|
+
name: candidate.slice(firstHyphen + 1)
|
|
45
|
+
};
|
|
46
|
+
return null;
|
|
47
|
+
}
|
|
48
|
+
function parseIconName(rawName, aliases, knownCollections = [], depth = 0, visited = /* @__PURE__ */ new Set()) {
|
|
49
|
+
if (depth > 10) return null;
|
|
50
|
+
const input = String(rawName || "").trim().toLowerCase();
|
|
51
|
+
if (!input || input.length > 256 || visited.has(input)) return null;
|
|
52
|
+
const resolved = aliases?.[input] ?? input;
|
|
53
|
+
if (resolved !== input) {
|
|
54
|
+
const nextVisited = new Set(visited).add(input);
|
|
55
|
+
return parseIconName(resolved, aliases, knownCollections, depth + 1, nextVisited);
|
|
56
|
+
}
|
|
57
|
+
const hasIPrefix = input.startsWith("i-") || input.startsWith("i:");
|
|
58
|
+
const candidate = hasIPrefix ? input.slice(2) : input;
|
|
59
|
+
return splitIconDelimiter(candidate, ":") ?? splitIconDelimiter(candidate, "/") ?? matchKnownCollectionPrefix(candidate, knownCollections) ?? (hasIPrefix ? splitHyphenatedIconName(candidate) : null);
|
|
60
|
+
}
|
|
61
|
+
export { normalizeIconApiProvider, parseIconName, stripTrailingSlashes };
|
|
62
|
+
|
|
63
|
+
//# sourceMappingURL=normalize.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"normalize.js","names":[],"sources":["../../src/icons/normalize.ts"],"sourcesContent":["import { DEFAULT_ICON_API_PROVIDER } from \"./constants.js\";\nimport type { ParsedIconName } from \"./types.js\";\n\nexport function stripTrailingSlashes(value: string): string {\n let end = value.length;\n while (end > 0 && value.codePointAt(end - 1) === 47) {\n end -= 1;\n }\n return value.slice(0, end);\n}\n\nexport function normalizeIconApiProvider(value: unknown): string {\n const raw = typeof value === \"string\" ? stripTrailingSlashes(value.trim()) : \"\";\n if (!raw || raw.startsWith(\"//\")) {\n return DEFAULT_ICON_API_PROVIDER;\n }\n if (raw.startsWith(\"/\")) {\n return raw;\n }\n try {\n const url = new URL(raw);\n if (url.protocol === \"https:\" || url.protocol === \"http:\") {\n return stripTrailingSlashes(url.toString());\n }\n } catch {\n // Return default for malformed URLs\n }\n return DEFAULT_ICON_API_PROVIDER;\n}\n\nfunction splitIconDelimiter(candidate: string, delimiter: \":\" | \"/\"): ParsedIconName | null {\n if (!candidate.includes(delimiter)) return null;\n const [prefix, ...rest] = candidate.split(delimiter);\n const name = rest.join(delimiter);\n return prefix && name ? { prefix, name } : null;\n}\n\nfunction matchKnownCollectionPrefix(candidate: string, knownCollections: string[]): ParsedIconName | null {\n for (const collection of knownCollections) {\n const normalizedColl = collection.toLowerCase();\n if (candidate.startsWith(`${normalizedColl}-`)) {\n const name = candidate.slice(normalizedColl.length + 1);\n if (name) return { prefix: normalizedColl, name };\n }\n }\n return null;\n}\n\nfunction splitHyphenatedIconName(candidate: string): ParsedIconName | null {\n const firstHyphen = candidate.indexOf(\"-\");\n if (firstHyphen > 0 && firstHyphen < candidate.length - 1) {\n return {\n prefix: candidate.slice(0, firstHyphen),\n name: candidate.slice(firstHyphen + 1),\n };\n }\n return null;\n}\n\nexport function parseIconName(\n rawName: string,\n aliases?: Record<string, string>,\n knownCollections: string[] = [],\n depth: number = 0,\n visited: Set<string> = new Set()\n): ParsedIconName | null {\n if (depth > 10) return null;\n const input = String(rawName || \"\").trim().toLowerCase();\n if (!input || input.length > 256 || visited.has(input)) return null;\n\n // Resolve alias if mapped\n const resolved = aliases?.[input] ?? input;\n if (resolved !== input) {\n const nextVisited = new Set(visited).add(input);\n return parseIconName(resolved, aliases, knownCollections, depth + 1, nextVisited);\n }\n\n // Nuxt Icon i- prefix format\n const hasIPrefix = input.startsWith(\"i-\") || input.startsWith(\"i:\");\n const candidate = hasIPrefix ? input.slice(2) : input;\n\n return (\n splitIconDelimiter(candidate, \":\") ??\n splitIconDelimiter(candidate, \"/\") ??\n matchKnownCollectionPrefix(candidate, knownCollections) ??\n (hasIPrefix ? splitHyphenatedIconName(candidate) : null)\n );\n}\n"],"mappings":";;AAGA,SAAgB,qBAAqB,OAAuB;CAC1D,IAAI,MAAM,MAAM;CAChB,OAAO,MAAM,KAAK,MAAM,YAAY,MAAM,CAAC,MAAM,IAC/C,OAAO;CAET,OAAO,MAAM,MAAM,GAAG,GAAG;AAC3B;AAEA,SAAgB,yBAAyB,OAAwB;CAC/D,MAAM,MAAM,OAAO,UAAU,WAAW,qBAAqB,MAAM,KAAK,CAAC,IAAI;CAC7E,IAAI,CAAC,OAAO,IAAI,WAAW,IAAI,GAC7B,OAAO;CAET,IAAI,IAAI,WAAW,GAAG,GACpB,OAAO;CAET,IAAI;EACF,MAAM,MAAM,IAAI,IAAI,GAAG;EACvB,IAAI,IAAI,aAAa,YAAY,IAAI,aAAa,SAChD,OAAO,qBAAqB,IAAI,SAAS,CAAC;CAE9C,QAAQ,CAER;CACA,OAAO;AACT;AAEA,SAAS,mBAAmB,WAAmB,WAA6C;CAC1F,IAAI,CAAC,UAAU,SAAS,SAAS,GAAG,OAAO;CAC3C,MAAM,CAAC,QAAQ,GAAG,QAAQ,UAAU,MAAM,SAAS;CACnD,MAAM,OAAO,KAAK,KAAK,SAAS;CAChC,OAAO,UAAU,OAAO;EAAE;EAAQ;CAAK,IAAI;AAC7C;AAEA,SAAS,2BAA2B,WAAmB,kBAAmD;CACxG,KAAK,MAAM,cAAc,kBAAkB;EACzC,MAAM,iBAAiB,WAAW,YAAY;EAC9C,IAAI,UAAU,WAAW,GAAG,eAAe,EAAE,GAAG;GAC9C,MAAM,OAAO,UAAU,MAAM,eAAe,SAAS,CAAC;GACtD,IAAI,MAAM,OAAO;IAAE,QAAQ;IAAgB;GAAK;EAClD;CACF;CACA,OAAO;AACT;AAEA,SAAS,wBAAwB,WAA0C;CACzE,MAAM,cAAc,UAAU,QAAQ,GAAG;CACzC,IAAI,cAAc,KAAK,cAAc,UAAU,SAAS,GACtD,OAAO;EACL,QAAQ,UAAU,MAAM,GAAG,WAAW;EACtC,MAAM,UAAU,MAAM,cAAc,CAAC;CACvC;CAEF,OAAO;AACT;AAEA,SAAgB,cACd,SACA,SACA,mBAA6B,CAAC,GAC9B,QAAgB,GAChB,0BAAuB,IAAI,IAAI,GACR;CACvB,IAAI,QAAQ,IAAI,OAAO;CACvB,MAAM,QAAQ,OAAO,WAAW,EAAE,CAAC,CAAC,KAAK,CAAC,CAAC,YAAY;CACvD,IAAI,CAAC,SAAS,MAAM,SAAS,OAAO,QAAQ,IAAI,KAAK,GAAG,OAAO;CAG/D,MAAM,WAAW,UAAU,UAAU;CACrC,IAAI,aAAa,OAAO;EACtB,MAAM,cAAc,IAAI,IAAI,OAAO,CAAC,CAAC,IAAI,KAAK;EAC9C,OAAO,cAAc,UAAU,SAAS,kBAAkB,QAAQ,GAAG,WAAW;CAClF;CAGA,MAAM,aAAa,MAAM,WAAW,IAAI,KAAK,MAAM,WAAW,IAAI;CAClE,MAAM,YAAY,aAAa,MAAM,MAAM,CAAC,IAAI;CAEhD,OACE,mBAAmB,WAAW,GAAG,KACjC,mBAAmB,WAAW,GAAG,KACjC,2BAA2B,WAAW,gBAAgB,MACrD,aAAa,wBAAwB,SAAS,IAAI;AAEvD"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { IconData } from "./types.js";
|
|
2
|
+
export interface IconifyJsonIcon {
|
|
3
|
+
body: string;
|
|
4
|
+
width?: number;
|
|
5
|
+
height?: number;
|
|
6
|
+
left?: number;
|
|
7
|
+
top?: number;
|
|
8
|
+
}
|
|
9
|
+
export interface IconifyJsonCollection {
|
|
10
|
+
prefix: string;
|
|
11
|
+
icons: Record<string, IconifyJsonIcon>;
|
|
12
|
+
aliases?: Record<string, {
|
|
13
|
+
parent: string;
|
|
14
|
+
}>;
|
|
15
|
+
width?: number;
|
|
16
|
+
height?: number;
|
|
17
|
+
}
|
|
18
|
+
export declare function registerOfflineCollection(prefix: string, data: IconifyJsonCollection): void;
|
|
19
|
+
export declare function clearOfflineCollectionCache(): void;
|
|
20
|
+
export declare function loadOfflineIcon(prefix: string, name: string): IconData | null;
|
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
import { parseSvgText } from "./parser.js";
|
|
2
|
+
import { createRequire } from "node:module";
|
|
3
|
+
// src/icons/offline-loader.ts
|
|
4
|
+
const offlineCollectionCache = /* @__PURE__ */ new Map();
|
|
5
|
+
const offlineIconCache = /* @__PURE__ */ new Map();
|
|
6
|
+
const MAX_OFFLINE_ICON_CACHE = 1e3;
|
|
7
|
+
function setBoundedIconCache(key, value) {
|
|
8
|
+
if (offlineIconCache.size >= MAX_OFFLINE_ICON_CACHE) {
|
|
9
|
+
const first = offlineIconCache.keys().next().value;
|
|
10
|
+
if (first) offlineIconCache.delete(first);
|
|
11
|
+
}
|
|
12
|
+
offlineIconCache.set(key, value);
|
|
13
|
+
}
|
|
14
|
+
function registerOfflineCollection(prefix, data) {
|
|
15
|
+
const normPrefix = prefix.toLowerCase();
|
|
16
|
+
offlineCollectionCache.set(normPrefix, data);
|
|
17
|
+
const prefixMatch = `${normPrefix}:`;
|
|
18
|
+
for (const key of offlineIconCache.keys()) if (key.startsWith(prefixMatch)) offlineIconCache.delete(key);
|
|
19
|
+
}
|
|
20
|
+
function clearOfflineCollectionCache() {
|
|
21
|
+
offlineCollectionCache.clear();
|
|
22
|
+
offlineIconCache.clear();
|
|
23
|
+
}
|
|
24
|
+
function resolveCollectionFromPackage(prefix) {
|
|
25
|
+
const normalizedPrefix = prefix.toLowerCase();
|
|
26
|
+
if (offlineCollectionCache.has(normalizedPrefix)) return offlineCollectionCache.get(normalizedPrefix) ?? null;
|
|
27
|
+
if (typeof process === "undefined" || !process.versions?.node) {
|
|
28
|
+
offlineCollectionCache.set(normalizedPrefix, null);
|
|
29
|
+
return null;
|
|
30
|
+
}
|
|
31
|
+
try {
|
|
32
|
+
const req = createRequire(process.cwd() + "/package.json");
|
|
33
|
+
let jsonPath = null;
|
|
34
|
+
try {
|
|
35
|
+
jsonPath = req.resolve(`@iconify-json/${normalizedPrefix}/icons.json`);
|
|
36
|
+
} catch {
|
|
37
|
+
try {
|
|
38
|
+
jsonPath = req.resolve(`@iconify/json/json/${normalizedPrefix}.json`);
|
|
39
|
+
} catch {
|
|
40
|
+
jsonPath = null;
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
if (jsonPath) {
|
|
44
|
+
const collection = req(jsonPath);
|
|
45
|
+
offlineCollectionCache.set(normalizedPrefix, collection);
|
|
46
|
+
return collection;
|
|
47
|
+
}
|
|
48
|
+
} catch {}
|
|
49
|
+
offlineCollectionCache.set(normalizedPrefix, null);
|
|
50
|
+
return null;
|
|
51
|
+
}
|
|
52
|
+
function loadOfflineIcon(prefix, name) {
|
|
53
|
+
const normalizedPrefix = prefix.toLowerCase();
|
|
54
|
+
const normalizedName = name.toLowerCase();
|
|
55
|
+
const cacheKey = `${normalizedPrefix}:${normalizedName}`;
|
|
56
|
+
if (offlineIconCache.has(cacheKey)) return offlineIconCache.get(cacheKey) ?? null;
|
|
57
|
+
const collection = resolveCollectionFromPackage(normalizedPrefix);
|
|
58
|
+
if (!collection) {
|
|
59
|
+
setBoundedIconCache(cacheKey, null);
|
|
60
|
+
return null;
|
|
61
|
+
}
|
|
62
|
+
let iconEntry = collection.icons?.[normalizedName];
|
|
63
|
+
if (!iconEntry && collection.aliases?.[normalizedName]) {
|
|
64
|
+
const parentName = collection.aliases[normalizedName].parent;
|
|
65
|
+
iconEntry = collection.icons?.[parentName];
|
|
66
|
+
}
|
|
67
|
+
if (!iconEntry?.body) {
|
|
68
|
+
offlineIconCache.set(cacheKey, null);
|
|
69
|
+
return null;
|
|
70
|
+
}
|
|
71
|
+
const left = iconEntry.left ?? 0;
|
|
72
|
+
const top = iconEntry.top ?? 0;
|
|
73
|
+
const width = iconEntry.width ?? collection.width ?? 24;
|
|
74
|
+
const height = iconEntry.height ?? collection.height ?? 24;
|
|
75
|
+
const viewBox = `${left} ${top} ${width} ${height}`;
|
|
76
|
+
const wrappedSvg = `<svg xmlns="http://www.w3.org/2000/svg" viewBox="${viewBox}">${iconEntry.body}</svg>`;
|
|
77
|
+
const parsed = parseSvgText(wrappedSvg);
|
|
78
|
+
const iconData = {
|
|
79
|
+
viewBox,
|
|
80
|
+
width,
|
|
81
|
+
height,
|
|
82
|
+
body: iconEntry.body,
|
|
83
|
+
path: parsed?.path,
|
|
84
|
+
paths: parsed?.paths,
|
|
85
|
+
fill: parsed?.fill,
|
|
86
|
+
stroke: parsed?.stroke,
|
|
87
|
+
strokeWidth: parsed?.strokeWidth
|
|
88
|
+
};
|
|
89
|
+
setBoundedIconCache(cacheKey, iconData);
|
|
90
|
+
return iconData;
|
|
91
|
+
}
|
|
92
|
+
export { clearOfflineCollectionCache, loadOfflineIcon, registerOfflineCollection };
|
|
93
|
+
|
|
94
|
+
//# sourceMappingURL=offline-loader.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"offline-loader.js","names":[],"sources":["../../src/icons/offline-loader.ts"],"sourcesContent":["import { createRequire } from \"node:module\";\nimport { parseSvgText } from \"./parser.js\";\nimport type { IconData } from \"./types.js\";\n\nexport interface IconifyJsonIcon {\n body: string;\n width?: number;\n height?: number;\n left?: number;\n top?: number;\n}\n\nexport interface IconifyJsonCollection {\n prefix: string;\n icons: Record<string, IconifyJsonIcon>;\n aliases?: Record<string, { parent: string }>;\n width?: number;\n height?: number;\n}\n\nconst offlineCollectionCache = new Map<string, IconifyJsonCollection | null>();\nconst offlineIconCache = new Map<string, IconData | null>();\nconst MAX_OFFLINE_ICON_CACHE = 1000;\nfunction setBoundedIconCache(key: string, value: IconData | null) {\n if (offlineIconCache.size >= MAX_OFFLINE_ICON_CACHE) {\n const first = offlineIconCache.keys().next().value;\n if (first) offlineIconCache.delete(first);\n }\n offlineIconCache.set(key, value);\n}\n\nexport function registerOfflineCollection(prefix: string, data: IconifyJsonCollection): void {\n const normPrefix = prefix.toLowerCase();\n offlineCollectionCache.set(normPrefix, data);\n const prefixMatch = `${normPrefix}:`;\n for (const key of offlineIconCache.keys()) {\n if (key.startsWith(prefixMatch)) {\n offlineIconCache.delete(key);\n }\n }\n}\n\nexport function clearOfflineCollectionCache(): void {\n offlineCollectionCache.clear();\n offlineIconCache.clear();\n}\n\nfunction resolveCollectionFromPackage(prefix: string): IconifyJsonCollection | null {\n const normalizedPrefix = prefix.toLowerCase();\n if (offlineCollectionCache.has(normalizedPrefix)) {\n return offlineCollectionCache.get(normalizedPrefix) ?? null;\n }\n\n // Only attempt dynamic require in Node environment\n if (typeof process === \"undefined\" || !process.versions?.node) {\n offlineCollectionCache.set(normalizedPrefix, null);\n return null;\n }\n\n try {\n const req = createRequire(process.cwd() + \"/package.json\");\n let jsonPath: string | null = null;\n try {\n jsonPath = req.resolve(`@iconify-json/${normalizedPrefix}/icons.json`);\n } catch {\n try {\n jsonPath = req.resolve(`@iconify/json/json/${normalizedPrefix}.json`);\n } catch {\n jsonPath = null;\n }\n }\n\n if (jsonPath) {\n const collection = req(jsonPath) as IconifyJsonCollection;\n offlineCollectionCache.set(normalizedPrefix, collection);\n return collection;\n }\n } catch {\n // Package not found or failed to load\n }\n\n offlineCollectionCache.set(normalizedPrefix, null);\n return null;\n}\n\nexport function loadOfflineIcon(prefix: string, name: string): IconData | null {\n const normalizedPrefix = prefix.toLowerCase();\n const normalizedName = name.toLowerCase();\n const cacheKey = `${normalizedPrefix}:${normalizedName}`;\n\n if (offlineIconCache.has(cacheKey)) {\n return offlineIconCache.get(cacheKey) ?? null;\n }\n\n const collection = resolveCollectionFromPackage(normalizedPrefix);\n if (!collection) {\n setBoundedIconCache(cacheKey, null);\n return null;\n }\n\n let iconEntry = collection.icons?.[normalizedName];\n if (!iconEntry && collection.aliases?.[normalizedName]) {\n const parentName = collection.aliases[normalizedName].parent;\n iconEntry = collection.icons?.[parentName];\n }\n\n if (!iconEntry?.body) {\n offlineIconCache.set(cacheKey, null);\n return null;\n }\n\n const left = iconEntry.left ?? 0;\n const top = iconEntry.top ?? 0;\n const width = iconEntry.width ?? collection.width ?? 24;\n const height = iconEntry.height ?? collection.height ?? 24;\n const viewBox = `${left} ${top} ${width} ${height}`;\n\n const wrappedSvg = `<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"${viewBox}\">${iconEntry.body}</svg>`;\n const parsed = parseSvgText(wrappedSvg);\n\n const iconData: IconData = {\n viewBox,\n width,\n height,\n body: iconEntry.body,\n path: parsed?.path,\n paths: parsed?.paths,\n fill: parsed?.fill,\n stroke: parsed?.stroke,\n strokeWidth: parsed?.strokeWidth,\n };\n\n setBoundedIconCache(cacheKey, iconData);\n return iconData;\n}\n"],"mappings":";;;AAoBA,MAAM,yCAAyB,IAAI,IAA0C;AAC7E,MAAM,mCAAmB,IAAI,IAA6B;AAC1D,MAAM,yBAAyB;AAC/B,SAAS,oBAAoB,KAAa,OAAwB;CAChE,IAAI,iBAAiB,QAAQ,wBAAwB;EACnD,MAAM,QAAQ,iBAAiB,KAAK,CAAC,CAAC,KAAK,CAAC,CAAC;EAC7C,IAAI,OAAO,iBAAiB,OAAO,KAAK;CAC1C;CACA,iBAAiB,IAAI,KAAK,KAAK;AACjC;AAEA,SAAgB,0BAA0B,QAAgB,MAAmC;CAC3F,MAAM,aAAa,OAAO,YAAY;CACtC,uBAAuB,IAAI,YAAY,IAAI;CAC3C,MAAM,cAAc,GAAG,WAAW;CAClC,KAAK,MAAM,OAAO,iBAAiB,KAAK,GACtC,IAAI,IAAI,WAAW,WAAW,GAC5B,iBAAiB,OAAO,GAAG;AAGjC;AAEA,SAAgB,8BAAoC;CAClD,uBAAuB,MAAM;CAC7B,iBAAiB,MAAM;AACzB;AAEA,SAAS,6BAA6B,QAA8C;CAClF,MAAM,mBAAmB,OAAO,YAAY;CAC5C,IAAI,uBAAuB,IAAI,gBAAgB,GAC7C,OAAO,uBAAuB,IAAI,gBAAgB,KAAK;CAIzD,IAAI,OAAO,YAAY,eAAe,CAAC,QAAQ,UAAU,MAAM;EAC7D,uBAAuB,IAAI,kBAAkB,IAAI;EACjD,OAAO;CACT;CAEA,IAAI;EACF,MAAM,MAAM,cAAc,QAAQ,IAAI,IAAI,eAAe;EACzD,IAAI,WAA0B;EAC9B,IAAI;GACF,WAAW,IAAI,QAAQ,iBAAiB,iBAAiB,YAAY;EACvE,QAAQ;GACN,IAAI;IACF,WAAW,IAAI,QAAQ,sBAAsB,iBAAiB,MAAM;GACtE,QAAQ;IACN,WAAW;GACb;EACF;EAEA,IAAI,UAAU;GACZ,MAAM,aAAa,IAAI,QAAQ;GAC/B,uBAAuB,IAAI,kBAAkB,UAAU;GACvD,OAAO;EACT;CACF,QAAQ,CAER;CAEA,uBAAuB,IAAI,kBAAkB,IAAI;CACjD,OAAO;AACT;AAEA,SAAgB,gBAAgB,QAAgB,MAA+B;CAC7E,MAAM,mBAAmB,OAAO,YAAY;CAC5C,MAAM,iBAAiB,KAAK,YAAY;CACxC,MAAM,WAAW,GAAG,iBAAiB,GAAG;CAExC,IAAI,iBAAiB,IAAI,QAAQ,GAC/B,OAAO,iBAAiB,IAAI,QAAQ,KAAK;CAG3C,MAAM,aAAa,6BAA6B,gBAAgB;CAChE,IAAI,CAAC,YAAY;EACf,oBAAoB,UAAU,IAAI;EAClC,OAAO;CACT;CAEA,IAAI,YAAY,WAAW,QAAQ;CACnC,IAAI,CAAC,aAAa,WAAW,UAAU,iBAAiB;EACtD,MAAM,aAAa,WAAW,QAAQ,eAAe,CAAC;EACtD,YAAY,WAAW,QAAQ;CACjC;CAEA,IAAI,CAAC,WAAW,MAAM;EACpB,iBAAiB,IAAI,UAAU,IAAI;EACnC,OAAO;CACT;CAEA,MAAM,OAAO,UAAU,QAAQ;CAC/B,MAAM,MAAM,UAAU,OAAO;CAC7B,MAAM,QAAQ,UAAU,SAAS,WAAW,SAAS;CACrD,MAAM,SAAS,UAAU,UAAU,WAAW,UAAU;CACxD,MAAM,UAAU,GAAG,KAAK,GAAG,IAAI,GAAG,MAAM,GAAG;CAE3C,MAAM,aAAa,oDAAoD,QAAQ,IAAI,UAAU,KAAK;CAClG,MAAM,SAAS,aAAa,UAAU;CAEtC,MAAM,WAAqB;EACzB;EACA;EACA;EACA,MAAM,UAAU;EAChB,MAAM,QAAQ;EACd,OAAO,QAAQ;EACf,MAAM,QAAQ;EACd,QAAQ,QAAQ;EAChB,aAAa,QAAQ;CACvB;CAEA,oBAAoB,UAAU,QAAQ;CACtC,OAAO;AACT"}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { IconData } from "./types.js";
|
|
2
|
+
export declare function readSvgAttribute(source: string, name: string): string;
|
|
3
|
+
export declare function readSvgPresentationAttributes(source: string): Partial<IconData>;
|
|
4
|
+
export declare function parseSvgText(svgText: string): IconData | null;
|
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
// src/icons/parser.ts
|
|
2
|
+
function readSvgAttribute(source, name) {
|
|
3
|
+
const escapedName = name.replaceAll(/[.*+?^${}()|[\]\\]/g, String.raw`\$&`);
|
|
4
|
+
const pattern = String.raw`(?:^|\s)${escapedName}\s*=\s*(?:"([^"]*)"|'([^']*)')`;
|
|
5
|
+
const match = new RegExp(pattern, "i").exec(source);
|
|
6
|
+
return (match?.[1] ?? match?.[2] ?? "").trim();
|
|
7
|
+
}
|
|
8
|
+
function readSvgPresentationAttributes(source) {
|
|
9
|
+
const output = {};
|
|
10
|
+
for (const [attributeName, propertyName] of [
|
|
11
|
+
["opacity", "opacity"],
|
|
12
|
+
["fill", "fill"],
|
|
13
|
+
["stroke", "stroke"],
|
|
14
|
+
["stroke-width", "strokeWidth"],
|
|
15
|
+
["stroke-linecap", "strokeLinecap"],
|
|
16
|
+
["stroke-linejoin", "strokeLinejoin"],
|
|
17
|
+
["fill-rule", "fillRule"],
|
|
18
|
+
["clip-rule", "clipRule"]
|
|
19
|
+
]) {
|
|
20
|
+
const value = readSvgAttribute(source, attributeName);
|
|
21
|
+
if (value) output[propertyName] = value;
|
|
22
|
+
}
|
|
23
|
+
return output;
|
|
24
|
+
}
|
|
25
|
+
function inheritedSvgPresentation(source) {
|
|
26
|
+
const { opacity: _opacity, ...inherited } = readSvgPresentationAttributes(source);
|
|
27
|
+
return inherited;
|
|
28
|
+
}
|
|
29
|
+
function updateInheritedStackForGroup(source, closing, inheritedStack) {
|
|
30
|
+
if (closing) {
|
|
31
|
+
if (inheritedStack.length > 1) inheritedStack.pop();
|
|
32
|
+
return;
|
|
33
|
+
}
|
|
34
|
+
inheritedStack.push({
|
|
35
|
+
...inheritedStack.at(-1),
|
|
36
|
+
...inheritedSvgPresentation(source)
|
|
37
|
+
});
|
|
38
|
+
if (/\/\s*>$/.test(source) && inheritedStack.length > 1) inheritedStack.pop();
|
|
39
|
+
}
|
|
40
|
+
function parsePathElement(source, inherited) {
|
|
41
|
+
const d = readSvgAttribute(source, "d").slice(0, 65536);
|
|
42
|
+
if (!d) return null;
|
|
43
|
+
return {
|
|
44
|
+
d,
|
|
45
|
+
...inherited,
|
|
46
|
+
...readSvgPresentationAttributes(source)
|
|
47
|
+
};
|
|
48
|
+
}
|
|
49
|
+
function parseSvgText(svgText) {
|
|
50
|
+
if (!svgText || typeof svgText !== "string") return null;
|
|
51
|
+
const svgRoot = /<svg\b[^>]*>/i.exec(svgText)?.[0];
|
|
52
|
+
if (!svgRoot) return null;
|
|
53
|
+
const rootPresentation = readSvgPresentationAttributes(svgRoot);
|
|
54
|
+
const inheritedStack = [inheritedSvgPresentation(svgRoot)];
|
|
55
|
+
const paths = [];
|
|
56
|
+
for (const match of svgText.matchAll(/<\/?(?:svg|g|path)\b[^>]*>/gi)) {
|
|
57
|
+
const source = match[0];
|
|
58
|
+
const closing = source.startsWith("</");
|
|
59
|
+
const tag = /^<\/?([A-Za-z]+)/.exec(source)?.[1]?.toLowerCase();
|
|
60
|
+
if (!tag || tag === "svg") continue;
|
|
61
|
+
if (tag === "g") {
|
|
62
|
+
updateInheritedStackForGroup(source, closing, inheritedStack);
|
|
63
|
+
continue;
|
|
64
|
+
}
|
|
65
|
+
if (closing || paths.length >= 128) continue;
|
|
66
|
+
const pathEntry = parsePathElement(source, inheritedStack.at(-1));
|
|
67
|
+
if (pathEntry) paths.push(pathEntry);
|
|
68
|
+
}
|
|
69
|
+
const innerMatch = /<svg\b[^>]*>([\s\S]*?)<\/svg>/i.exec(svgText);
|
|
70
|
+
const innerBody = innerMatch ? innerMatch[1].trim() : "";
|
|
71
|
+
if (!paths.length) {
|
|
72
|
+
if (!innerBody) return null;
|
|
73
|
+
return {
|
|
74
|
+
body: innerBody,
|
|
75
|
+
viewBox: readSvgAttribute(svgRoot, "viewBox") || "0 0 24 24",
|
|
76
|
+
...rootPresentation
|
|
77
|
+
};
|
|
78
|
+
}
|
|
79
|
+
return {
|
|
80
|
+
path: paths[0].d,
|
|
81
|
+
paths,
|
|
82
|
+
body: innerBody || void 0,
|
|
83
|
+
viewBox: readSvgAttribute(svgRoot, "viewBox") || "0 0 24 24",
|
|
84
|
+
...rootPresentation
|
|
85
|
+
};
|
|
86
|
+
}
|
|
87
|
+
export { parseSvgText, readSvgAttribute, readSvgPresentationAttributes };
|
|
88
|
+
|
|
89
|
+
//# sourceMappingURL=parser.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"parser.js","names":[],"sources":["../../src/icons/parser.ts"],"sourcesContent":["import type { IconData, IconPathData } from \"./types.js\";\n\nexport function readSvgAttribute(source: string, name: string): string {\n const escapedName = name.replaceAll(/[.*+?^${}()|[\\]\\\\]/g, String.raw`\\$&`);\n const pattern = String.raw`(?:^|\\s)${escapedName}\\s*=\\s*(?:\"([^\"]*)\"|'([^']*)')`;\n const match = new RegExp(pattern, \"i\").exec(source);\n return (match?.[1] ?? match?.[2] ?? \"\").trim();\n}\n\nexport function readSvgPresentationAttributes(source: string): Partial<IconData> {\n const output: Partial<IconData> = {};\n const attributes = [\n [\"opacity\", \"opacity\"],\n [\"fill\", \"fill\"],\n [\"stroke\", \"stroke\"],\n [\"stroke-width\", \"strokeWidth\"],\n [\"stroke-linecap\", \"strokeLinecap\"],\n [\"stroke-linejoin\", \"strokeLinejoin\"],\n [\"fill-rule\", \"fillRule\"],\n [\"clip-rule\", \"clipRule\"],\n ] as const;\n for (const [attributeName, propertyName] of attributes) {\n const value = readSvgAttribute(source, attributeName);\n if (value) output[propertyName] = value;\n }\n return output;\n}\n\nfunction inheritedSvgPresentation(source: string): Partial<IconData> {\n const { opacity: _opacity, ...inherited } = readSvgPresentationAttributes(source);\n return inherited;\n}\n\nfunction updateInheritedStackForGroup(\n source: string,\n closing: boolean,\n inheritedStack: Array<Partial<IconData>>\n): void {\n if (closing) {\n if (inheritedStack.length > 1) inheritedStack.pop();\n return;\n }\n inheritedStack.push({\n ...inheritedStack.at(-1),\n ...inheritedSvgPresentation(source),\n });\n if (/\\/\\s*>$/.test(source) && inheritedStack.length > 1) {\n inheritedStack.pop();\n }\n}\n\nfunction parsePathElement(\n source: string,\n inherited: Partial<IconData> | undefined\n): IconPathData | null {\n const d = readSvgAttribute(source, \"d\").slice(0, 65_536);\n if (!d) return null;\n return {\n d,\n ...inherited,\n ...readSvgPresentationAttributes(source),\n };\n}\n\nexport function parseSvgText(svgText: string): IconData | null {\n if (!svgText || typeof svgText !== \"string\") return null;\n\n const svgRoot = /<svg\\b[^>]*>/i.exec(svgText)?.[0];\n if (!svgRoot) return null;\n\n const rootPresentation = readSvgPresentationAttributes(svgRoot);\n const inheritedStack: Array<Partial<IconData>> = [inheritedSvgPresentation(svgRoot)];\n const paths: IconPathData[] = [];\n\n for (const match of svgText.matchAll(/<\\/?(?:svg|g|path)\\b[^>]*>/gi)) {\n const source = match[0];\n const closing = source.startsWith(\"</\");\n const tag = /^<\\/?([A-Za-z]+)/.exec(source)?.[1]?.toLowerCase();\n if (!tag || tag === \"svg\") continue;\n\n if (tag === \"g\") {\n updateInheritedStackForGroup(source, closing, inheritedStack);\n continue;\n }\n\n if (closing || paths.length >= 128) continue;\n const pathEntry = parsePathElement(source, inheritedStack.at(-1));\n if (pathEntry) paths.push(pathEntry);\n }\n\n const innerMatch = /<svg\\b[^>]*>([\\s\\S]*?)<\\/svg>/i.exec(svgText);\n const innerBody = innerMatch ? innerMatch[1].trim() : \"\";\n\n if (!paths.length) {\n if (!innerBody) return null;\n return {\n body: innerBody,\n viewBox: readSvgAttribute(svgRoot, \"viewBox\") || \"0 0 24 24\",\n ...rootPresentation,\n };\n }\n\n return {\n path: paths[0].d,\n paths,\n body: innerBody || undefined,\n viewBox: readSvgAttribute(svgRoot, \"viewBox\") || \"0 0 24 24\",\n ...rootPresentation,\n };\n}\n"],"mappings":";AAEA,SAAgB,iBAAiB,QAAgB,MAAsB;CACrE,MAAM,cAAc,KAAK,WAAW,uBAAuB,OAAO,GAAG,KAAK;CAC1E,MAAM,UAAU,OAAO,GAAG,WAAW,YAAY;CACjD,MAAM,QAAQ,IAAI,OAAO,SAAS,GAAG,CAAC,CAAC,KAAK,MAAM;CAClD,QAAQ,QAAQ,MAAM,QAAQ,MAAM,GAAA,CAAI,KAAK;AAC/C;AAEA,SAAgB,8BAA8B,QAAmC;CAC/E,MAAM,SAA4B,CAAC;CAWnC,KAAK,MAAM,CAAC,eAAe,iBAAiB;EAT1C,CAAC,WAAW,SAAS;EACrB,CAAC,QAAQ,MAAM;EACf,CAAC,UAAU,QAAQ;EACnB,CAAC,gBAAgB,aAAa;EAC9B,CAAC,kBAAkB,eAAe;EAClC,CAAC,mBAAmB,gBAAgB;EACpC,CAAC,aAAa,UAAU;EACxB,CAAC,aAAa,UAAU;CAE2B,GAAG;EACtD,MAAM,QAAQ,iBAAiB,QAAQ,aAAa;EACpD,IAAI,OAAO,OAAO,gBAAgB;CACpC;CACA,OAAO;AACT;AAEA,SAAS,yBAAyB,QAAmC;CACnE,MAAM,EAAE,SAAS,UAAU,GAAG,cAAc,8BAA8B,MAAM;CAChF,OAAO;AACT;AAEA,SAAS,6BACP,QACA,SACA,gBACM;CACN,IAAI,SAAS;EACX,IAAI,eAAe,SAAS,GAAG,eAAe,IAAI;EAClD;CACF;CACA,eAAe,KAAK;EAClB,GAAG,eAAe,GAAG,EAAE;EACvB,GAAG,yBAAyB,MAAM;CACpC,CAAC;CACD,IAAI,UAAU,KAAK,MAAM,KAAK,eAAe,SAAS,GACpD,eAAe,IAAI;AAEvB;AAEA,SAAS,iBACP,QACA,WACqB;CACrB,MAAM,IAAI,iBAAiB,QAAQ,GAAG,CAAC,CAAC,MAAM,GAAG,KAAM;CACvD,IAAI,CAAC,GAAG,OAAO;CACf,OAAO;EACL;EACA,GAAG;EACH,GAAG,8BAA8B,MAAM;CACzC;AACF;AAEA,SAAgB,aAAa,SAAkC;CAC7D,IAAI,CAAC,WAAW,OAAO,YAAY,UAAU,OAAO;CAEpD,MAAM,UAAU,gBAAgB,KAAK,OAAO,CAAC,GAAG;CAChD,IAAI,CAAC,SAAS,OAAO;CAErB,MAAM,mBAAmB,8BAA8B,OAAO;CAC9D,MAAM,iBAA2C,CAAC,yBAAyB,OAAO,CAAC;CACnF,MAAM,QAAwB,CAAC;CAE/B,KAAK,MAAM,SAAS,QAAQ,SAAS,8BAA8B,GAAG;EACpE,MAAM,SAAS,MAAM;EACrB,MAAM,UAAU,OAAO,WAAW,IAAI;EACtC,MAAM,MAAM,mBAAmB,KAAK,MAAM,CAAC,GAAG,EAAE,EAAE,YAAY;EAC9D,IAAI,CAAC,OAAO,QAAQ,OAAO;EAE3B,IAAI,QAAQ,KAAK;GACf,6BAA6B,QAAQ,SAAS,cAAc;GAC5D;EACF;EAEA,IAAI,WAAW,MAAM,UAAU,KAAK;EACpC,MAAM,YAAY,iBAAiB,QAAQ,eAAe,GAAG,EAAE,CAAC;EAChE,IAAI,WAAW,MAAM,KAAK,SAAS;CACrC;CAEA,MAAM,aAAa,iCAAiC,KAAK,OAAO;CAChE,MAAM,YAAY,aAAa,WAAW,EAAE,CAAC,KAAK,IAAI;CAEtD,IAAI,CAAC,MAAM,QAAQ;EACjB,IAAI,CAAC,WAAW,OAAO;EACvB,OAAO;GACL,MAAM;GACN,SAAS,iBAAiB,SAAS,SAAS,KAAK;GACjD,GAAG;EACL;CACF;CAEA,OAAO;EACL,MAAM,MAAM,EAAE,CAAC;EACf;EACA,MAAM,aAAa,KAAA;EACnB,SAAS,iBAAiB,SAAS,SAAS,KAAK;EACjD,GAAG;CACL;AACF"}
|
package/dist/icons/registry.d.ts
CHANGED
|
@@ -1,22 +1,6 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
strokeWidth?: string;
|
|
8
|
-
strokeLinecap?: string;
|
|
9
|
-
strokeLinejoin?: string;
|
|
10
|
-
fillRule?: string;
|
|
11
|
-
clipRule?: string;
|
|
12
|
-
}
|
|
13
|
-
interface IconData {
|
|
14
|
-
path?: string;
|
|
15
|
-
paths?: IconPathData[];
|
|
16
|
-
opacity?: string;
|
|
17
|
-
viewBox?: string;
|
|
18
|
-
}
|
|
19
|
-
declare const iconRegistry: Record<string, IconData>;
|
|
20
|
-
//#endregion
|
|
21
|
-
export { IconData, IconPathData, iconRegistry };
|
|
22
|
-
//# sourceMappingURL=registry.d.ts.map
|
|
1
|
+
import { IconData, IconPathData } from "./types.js";
|
|
2
|
+
export declare const iconRegistry: Record<string, IconData>;
|
|
3
|
+
export declare const iconAliases: Record<string, string>;
|
|
4
|
+
export declare function registerStaticIcon(name: string, data: IconData): void;
|
|
5
|
+
export declare function getStaticIcon(name: string): IconData | undefined;
|
|
6
|
+
export type { IconData, IconPathData };
|
package/dist/icons/registry.js
CHANGED
|
@@ -1,84 +1,91 @@
|
|
|
1
|
-
|
|
2
|
-
const
|
|
3
|
-
"material-symbols:call
|
|
4
|
-
"material-symbols:mail
|
|
5
|
-
"material-symbols:location-on-outline-rounded
|
|
6
|
-
"material-symbols:warning
|
|
7
|
-
"material-symbols:error
|
|
8
|
-
"material-symbols:close
|
|
9
|
-
"material-symbols:add
|
|
10
|
-
"material-symbols:keyboard-arrow-down
|
|
11
|
-
"mdi:facebook
|
|
12
|
-
"mdi:facebook-box
|
|
13
|
-
"mingcute:instagram-fill
|
|
14
|
-
"cib:linkedin"
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
"
|
|
19
|
-
"
|
|
20
|
-
"
|
|
21
|
-
"
|
|
22
|
-
"
|
|
23
|
-
"
|
|
24
|
-
"
|
|
25
|
-
"
|
|
26
|
-
"
|
|
27
|
-
"
|
|
28
|
-
"
|
|
29
|
-
"
|
|
30
|
-
"
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
for (const [alias, target] of Object.entries({
|
|
56
|
-
"call": "material-symbols:call",
|
|
1
|
+
// src/icons/registry.ts
|
|
2
|
+
const BUILTIN_ICON_ROWS = [
|
|
3
|
+
"material-symbols:call|M6.62 10.79a15.15 15.15 0 0 0 6.59 6.59l2.2-2.2a1 1 0 0 1 1.11-.27c1.12.37 2.33.57 3.57.57a1 1 0 0 1 1 1V20a1 1 0 0 1-1 1A17 17 0 0 1 3 4a1 1 0 0 1 1-1h3.5a1 1 0 0 1 1 1c0 1.25.2 2.45.57 3.57a1 1 0 0 1-.26 1.02l-2.2 2.2z",
|
|
4
|
+
"material-symbols:mail|M20 4H4c-1.1 0-1.99.9-1.99 2L2 18c0 1.1.9 2 2 2h16c1.1 0 2-.9 2-2V6c0-1.1-.9-2-2-2zm0 4l-8 5l-8-5V6l8 5l8-5v2z",
|
|
5
|
+
"material-symbols:location-on-outline-rounded|M12 2C8.13 2 5 5.13 5 9c0 5.25 7 13 7 13s7-7.75 7-13c0-3.87-3.13-7-7-7zm0 9.5c-1.38 0-2.5-1.12-2.5-2.5s1.12-2.5 2.5-2.5s2.5 1.12 2.5 2.5s-1.12 2.5-2.5 2.5z",
|
|
6
|
+
"material-symbols:warning|M1 21h22L12 2L1 21zm12-3h-2v-2h2v2zm0-4h-2v-4h2v4z",
|
|
7
|
+
"material-symbols:error|M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10s10-4.48 10-10S17.52 2 12 2zm1 15h-2v-2h2v2zm0-4h-2V7h2v6z",
|
|
8
|
+
"material-symbols:close|M19 6.41L17.59 5L12 10.59L6.41 5L5 6.41L10.59 12L5 17.59L6.41 19L12 13.41L17.59 19L19 17.59L13.41 12z",
|
|
9
|
+
"material-symbols:add|M19 13h-6v6h-2v-6H5v-2h6V5h2v6h6v2z",
|
|
10
|
+
"material-symbols:keyboard-arrow-down|m12 15.4l-6-6L7.4 8l4.6 4.6L16.6 8L18 9.4z",
|
|
11
|
+
"mdi:facebook|M12 2.04C6.5 2.04 2 6.53 2 12.06C2 17.06 5.66 21.21 10.44 21.96V14.96H7.9V12.06H10.44V9.85C10.44 7.34 11.93 5.96 14.22 5.96C15.31 5.96 16.45 6.15 16.45 6.15V8.62H15.19C13.95 8.62 13.56 9.39 13.56 10.18V12.06H16.34L15.89 14.96H13.56V21.96A10 10 0 0 0 22 12.06C22 6.53 17.5 2.04 12 2.04Z",
|
|
12
|
+
"mdi:facebook-box|M19 3a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h14m-.5 15.5v-5.3h-1.8v-2.2h1.8V9.3c0-1.8 1.1-2.8 2.7-2.8c.8 0 1.5.1 1.7.1v2h-1.2c-.9 0-1 .4-1 1v1.3h2.2l-.3 2.2h-1.9v5.3h-2.2z",
|
|
13
|
+
"mingcute:instagram-fill|M16 3a5 5 0 0 1 5 5v8a5 5 0 0 1-5 5H8a5 5 0 0 1-5-5V8a5 5 0 0 1 5-5zm-4 5a4 4 0 1 0 0 8a4 4 0 0 0 0-8m0 2a2 2 0 1 1 0 4a2 2 0 0 1 0-4m4.5-3.5a1 1 0 1 0 0 2a1 1 0 0 0 0-2",
|
|
14
|
+
"cib:linkedin|M27.26 27.271h-4.733v-7.427c0-1.771-.037-4.047-2.475-4.047c-2.468 0-2.844 1.921-2.844 3.916v7.557h-4.739V11.999h4.552v2.083h.061c.636-1.203 2.183-2.468 4.491-2.468c4.801 0 5.692 3.161 5.692 7.271v8.385zM7.115 9.912a2.75 2.75 0 0 1-2.751-2.756a2.753 2.753 0 1 1 2.751 2.756m2.374 17.359H4.74V12h4.749zM29.636 0H2.36C1.057 0 0 1.031 0 2.307v27.387c0 1.276 1.057 2.307 2.36 2.307h27.271c1.301 0 2.369-1.031 2.369-2.307V2.307C32 1.031 30.932 0 29.636 0z|0 0 32 32",
|
|
15
|
+
"uil:youtube|M23 9.71a8.5 8.5 0 0 0-.91-4.13a2.92 2.92 0 0 0-1.72-1A78 78 0 0 0 12 4.27a79 79 0 0 0-8.34.3a2.87 2.87 0 0 0-1.46.74c-.9.83-1 2.25-1.1 3.45a48 48 0 0 0 0 6.48a9.6 9.6 0 0 0 .3 2a3.14 3.14 0 0 0 .71 1.36a2.86 2.86 0 0 0 1.49.78a45 45 0 0 0 6.5.33c3.5.05 6.57 0 10.2-.28a2.9 2.9 0 0 0 1.53-.78a2.5 2.5 0 0 0 .61-1a10.6 10.6 0 0 0 .52-3.4c.04-.56.04-3.94.04-4.54M9.74 14.85V8.66l5.92 3.11c-1.66.92-3.85 1.96-5.92 3.08",
|
|
16
|
+
"line-md:twitter-x|M18.244 2.25h3.308l-7.227 8.26l8.502 11.24H16.17l-5.214-6.817L4.99 21.75H1.68l7.73-8.835L1.254 2.25H8.08l4.713 6.231zm-1.161 17.52h1.833L7.084 4.126H5.117z",
|
|
17
|
+
"ic:baseline-whatsapp|M12.04 2c-5.46 0-9.91 4.45-9.91 9.91c0 1.75.46 3.45 1.32 4.95L2.05 22l5.25-1.38c1.45.79 3.08 1.21 4.74 1.21c5.46 0 9.91-4.45 9.91-9.91c0-2.65-1.03-5.14-2.9-7.01A9.816 9.816 0 0 0 12.04 2zm.01 1.67c4.55 0 8.25 3.7 8.25 8.25c0 4.55-3.7 8.25-8.25 8.25c-1.47 0-2.88-.39-4.12-1.12l-.3-.18l-3.07.81l.82-2.99l-.19-.31A8.204 8.204 0 0 1 3.8 11.92c0-4.55 3.7-8.25 8.25-8.25z",
|
|
18
|
+
"streamline:interface-validation-check-circle-checkmark-addition-circle-success-check-validation-add-form|M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10s10-4.48 10-10S17.52 2 12 2zm-2 15l-5-5l1.41-1.41L10 14.17l7.59-7.59L19 8l-9 9z",
|
|
19
|
+
"ph:check-circle-thin|M12 2a10 10 0 1 0 10 10A10.011 10.011 0 0 0 12 2zm0 19a9 9 0 1 1 9-9a9.01 9.01 0 0 1-9 9zm4.53-11.47a.5.5 0 0 1 0 .71l-5 5a.5.5 0 0 1-.71 0l-2.5-2.5a.5.5 0 1 1 .71-.71L11.17 14.4l4.65-4.65a.5.5 0 0 1 .71 0z",
|
|
20
|
+
"lucide-lab:flower-lotus|M12 21c-4.418 0-8-3.582-8-8c0-3.5 3.5-7 8-11c4.5 4 8 7.5 8 11c0 4.418-3.582 8-8 8z",
|
|
21
|
+
"solar:command-linear|M8.5 5A3.5 3.5 0 0 0 5 8.5v.5A3.5 3.5 0 0 0 8.5 12.5H9v-1h-.5A2.5 2.5 0 0 1 6 9v-.5A2.5 2.5 0 0 1 8.5 6H9V5h-.5zm7 0H15v1h.5a2.5 2.5 0 0 1 2.5 2.5v.5a2.5 2.5 0 0 1-2.5 2.5H15v1h.5a3.5 3.5 0 0 0 3.5-3.5v-.5A3.5 3.5 0 0 0 15.5 5z",
|
|
22
|
+
"gg:mouse|M12 5a1 1 0 0 0-1 1v4a1 1 0 1 0 2 0V6a1 1 0 0 0-1-1M4 8a8 8 0 1 1 16 0v8a8 8 0 1 1-16 0zm14 0v8a6 6 0 0 1-12 0V8a6 6 0 1 1 12 0",
|
|
23
|
+
"iconoir:flash|M13 10V3L5 14h6v7l8-11z",
|
|
24
|
+
"hugeicons:search-01|M15.5 14h-.79l-.28-.27A6.471 6.471 0 0 0 16 9.5A6.5 6.5 0 1 0 9.5 16a6.471 6.471 0 0 0 4.23-1.57l.27.28v.79l5 4.99L20.49 19l-4.99-5zm-6 0C7.01 14 5 11.99 5 9.5S7.01 5 9.5 5S14 7.01 14 9.5S11.99 14 9.5 14z",
|
|
25
|
+
"solar:info-circle-outline|M12 17.75a.75.75 0 0 0 .75-.75v-6a.75.75 0 0 0-1.5 0v6c0 .414.336.75.75.75M12 7a1 1 0 1 1 0 2a1 1 0 0 1 0-2M1.25 12C1.25 6.063 6.063 1.25 12 1.25S22.75 6.063 22.75 12S17.937 22.75 12 22.75S1.25 17.937 1.25 12M12 2.75a9.25 9.25 0 1 0 0 18.5a9.25 9.25 0 0 0 0-18.5",
|
|
26
|
+
"ic:sharp-tag-faces|M12.01 2C6.49 2 2.02 6.48 2.02 12s4.47 10 9.99 10c5.53 0 10.01-4.48 10.01-10S17.54 2 12.01 2m.01 18c-4.42 0-8-3.58-8-8s3.58-8 8-8s8 3.58 8 8s-3.58 8-8 8m3.5-9c.83 0 1.5-.67 1.5-1.5S16.35 8 15.52 8s-1.5.67-1.5 1.5s.67 1.5 1.5 1.5m-7 0c.83 0 1.5-.67 1.5-1.5S9.35 8 8.52 8s-1.5.67-1.5 1.5s.67 1.5 1.5 1.5m3.5 6.5c2.33 0 4.31-1.46 5.11-3.5H6.91c.8 2.04 2.78 3.5 5.11 3.5",
|
|
27
|
+
"hamburger|M3 6h18v2H3zm0 5h18v2H3zm0 5h18v2H3z",
|
|
28
|
+
"svg-spinners:ring-resize|M12 2a10 10 0 1 0 10 10A10 10 0 0 0 12 2zm0 18a8 8 0 1 1 8-8 8 8 0 0 1-8 8z",
|
|
29
|
+
"material-symbols:groups|M0-240v-63q0-43 44-70t116-27q13 0 25 .5t23 2.5q-14 21-21 44t-7 48v65H0Zm240 0v-65q0-32 17.5-58.5T307-410q32-20 76.5-30t96.5-10q53 0 97.5 10t76.5 30q32 20 49 46.5t17 58.5v65H240Zm540 0v-65q0-26-6.5-49T754-397q11-2 22.5-2.5t23.5-.5q72 0 116 26.5t44 70.5v63H780Zm-455-80h311q-10-20-55.5-35T480-370q-55 0-100.5 15T325-320ZM160-440q-33 0-56.5-23.5T80-520q0-34 23.5-57t56.5-23q34 0 57 23t23 57q0 33-23 56.5T160-440Zm640 0q-33 0-56.5-23.5T720-520q0-34 23.5-57t56.5-23q34 0 57 23t23 57q0 33-23 56.5T800-440Zm-320-40q-50 0-85-35t-35-85q0-51 35-85.5t85-34.5q51 0 85.5 34.5T600-600q0 50-34.5 85T480-480Zm0-80q17 0 28.5-11.5T520-600q0-17-11.5-28.5T480-640q-17 0-28.5 11.5T440-600q0 17 11.5 28.5T480-560Zm1 240Zm-1-280Z|0 -960 960 960",
|
|
30
|
+
"material-symbols:handshake|M475-160q4 0 8-2t6-4l328-328q12-12 17.5-27t5.5-30q0-16-5.5-30.5T817-607L647-777q-11-12-25.5-17.5T591-800q-15 0-30 5.5T534-777l-11 11 74 75q15 14 22 32t7 38q0 42-28.5 70.5T527-522q-20 0-38.5-7T456-550l-75-74-175 175q-3 3-4.5 6.5T200-435q0 8 6 14.5t14 6.5q4 0 8-2t6-4l136-136 56 56-135 136q-3 3-4.5 6.5T285-350q0 8 6 14t14 6q4 0 8-2t6-4l136-135 56 56-135 136q-3 2-4.5 6t-1.5 8q0 8 6 14t14 6q4 0 7.5-1.5t6.5-4.5l136-135 56 56-136 136q-3 3-4.5 6.5T454-180q0 8 6.5 14t14.5 6Zm-1 80q-37 0-65.5-24.5T375-166q-34-5-57-28t-28-57q-34-5-56.5-28.5T206-336q-38-5-62-33t-24-66q0-20 7.5-38.5T149-506l232-231 131 131q2 3 6 4.5t8 1.5q9 0 15-5.5t6-14.5q0-4-1.5-8t-4.5-6L398-777q-11-12-25.5-17.5T342-800q-15 0-30 5.5T285-777L144-635q-9 9-15 21t-8 24q-2 12 0 24.5t8 23.5l-58 58q-17-23-25-50.5T40-590q2-28 14-54.5T87-692l141-141q24-23 53.5-35t60.5-12q31 0 60.5 12t52.5 35l11 11 11-11q24-23 53.5-35t60.5-12q31 0 60.5 12t52.5 35l169 169q23 23 35 53t12 61q0 31-12 60.5T873-437L545-110q-14 14-32.5 22T474-80Zm-99-560Z|0 -960 960 960"
|
|
31
|
+
];
|
|
32
|
+
const iconRegistry = { "line-md:email-filled": {
|
|
33
|
+
paths: [{
|
|
34
|
+
d: "M12 11l-8 -5h16l-8 5Z",
|
|
35
|
+
fill: "currentColor"
|
|
36
|
+
}, {
|
|
37
|
+
d: "M4 5h16c0.55 0 1 0.45 1 1v12c0 0.55 -0.45 1 -1 1h-16c-0.55 0 -1 -0.45 -1 -1v-12c0 -0.55 0.45 -1 1 -1ZM3 6.5l9 5.5l9 -5.5",
|
|
38
|
+
fill: "none",
|
|
39
|
+
stroke: "currentColor",
|
|
40
|
+
strokeWidth: "2",
|
|
41
|
+
strokeLinecap: "round",
|
|
42
|
+
strokeLinejoin: "round"
|
|
43
|
+
}],
|
|
44
|
+
viewBox: "0 0 24 24"
|
|
45
|
+
} };
|
|
46
|
+
for (const row of BUILTIN_ICON_ROWS) {
|
|
47
|
+
const [name, path, viewBox] = row.split("|");
|
|
48
|
+
iconRegistry[name] = viewBox ? {
|
|
49
|
+
path,
|
|
50
|
+
viewBox
|
|
51
|
+
} : { path };
|
|
52
|
+
}
|
|
53
|
+
const iconAliases = {
|
|
54
|
+
call: "material-symbols:call",
|
|
57
55
|
"material-symbols-light:mail-outline-sharp": "material-symbols:mail",
|
|
58
56
|
"material-symbols:mail-outline": "material-symbols:mail",
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
57
|
+
mail: "material-symbols:mail",
|
|
58
|
+
location: "material-symbols:location-on-outline-rounded",
|
|
59
|
+
warning: "material-symbols:warning",
|
|
60
|
+
error: "material-symbols:error",
|
|
61
|
+
close: "material-symbols:close",
|
|
62
|
+
add: "material-symbols:add",
|
|
65
63
|
"arrow-down": "material-symbols:keyboard-arrow-down",
|
|
66
|
-
|
|
67
|
-
|
|
64
|
+
facebook: "mdi:facebook-box",
|
|
65
|
+
instagram: "mingcute:instagram-fill",
|
|
68
66
|
"lineicons:linkedin": "cib:linkedin",
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
67
|
+
linkedin: "cib:linkedin",
|
|
68
|
+
youtube: "uil:youtube",
|
|
69
|
+
twitter: "line-md:twitter-x",
|
|
72
70
|
"solar:check-circle-linear": "ph:check-circle-thin",
|
|
73
71
|
"solar:leaf-outline": "lucide-lab:flower-lotus",
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
}
|
|
78
|
-
|
|
79
|
-
|
|
72
|
+
mouse: "gg:mouse",
|
|
73
|
+
flash: "iconoir:flash",
|
|
74
|
+
search: "hugeicons:search-01"
|
|
75
|
+
};
|
|
76
|
+
for (const [alias, targetKey] of Object.entries(iconAliases)) {
|
|
77
|
+
const normAlias = alias.toLowerCase();
|
|
78
|
+
const normTarget = targetKey.toLowerCase();
|
|
79
|
+
if (iconRegistry[normTarget] && !iconRegistry[normAlias]) iconRegistry[normAlias] = iconRegistry[normTarget];
|
|
80
|
+
}
|
|
81
|
+
function registerStaticIcon(name, data) {
|
|
82
|
+
const normalized = String(name || "").trim().toLowerCase();
|
|
83
|
+
if (normalized) iconRegistry[normalized] = data;
|
|
84
|
+
}
|
|
85
|
+
function getStaticIcon(name) {
|
|
86
|
+
const normalized = String(name || "").trim().toLowerCase();
|
|
87
|
+
return iconRegistry[normalized];
|
|
80
88
|
}
|
|
89
|
+
export { getStaticIcon, iconAliases, iconRegistry, registerStaticIcon };
|
|
81
90
|
|
|
82
|
-
//#endregion
|
|
83
|
-
export { iconRegistry };
|
|
84
91
|
//# sourceMappingURL=registry.js.map
|