Compare commits

...
5 Commits
Author SHA1 Message Date
ionitron fccc260627 v7.2.2 2023-12-13 14:40:04 +00:00
Liam DeBeasi d582e6208e fix(icon): add better warning when loading icons (#1297) 2023-11-06 16:28:38 -05:00
Sean Perkins 625d54fdad merge release-7.2.1
v7.2.1
2023-10-10 13:37:32 -04:00
Liam DeBeasi 841fb96543 remove duplicate entry 2023-10-10 13:21:53 -04:00
ionitron 9dab13aef7 chore(): update package lock files 2023-10-10 17:10:51 +00:00
5 changed files with 31 additions and 9 deletions
+13 -2
View File
@@ -3,12 +3,23 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
## [7.2.1](https://github.com/ionic-team/ionicons/compare/v7.2.0...v7.2.1) (2023-10-10)
## [7.2.2](https://github.com/ionic-team/ionicons/compare/v7.2.1...v7.2.2) (2023-12-13)
### Bug Fixes
* **icon:** font scales without host style ([#1289](https://github.com/ionic-team/ionicons/issues/1289)) ([875bfd8](https://github.com/ionic-team/ionicons/commit/875bfd8300144c62e55a5a76dc2cff8cf1f01bfe))
* **icon:** add better warning when loading icons ([#1297](https://github.com/ionic-team/ionicons/issues/1297)) ([d582e62](https://github.com/ionic-team/ionicons/commit/d582e6208e626722e4350426a509a6870e90a0bc))
## [7.2.2](https://github.com/ionic-team/ionicons/compare/v7.2.1...v7.2.2) (2023-12-13)
### Bug Fixes
* **icon:** add better warning when loading icons ([#1297](https://github.com/ionic-team/ionicons/issues/1297)) ([d582e62](https://github.com/ionic-team/ionicons/commit/d582e6208e626722e4350426a509a6870e90a0bc))
+1 -1
View File
@@ -2,5 +2,5 @@
"packages": [
"./"
],
"version": "7.2.1"
"version": "7.2.2"
}
+2 -2
View File
@@ -1,12 +1,12 @@
{
"name": "ionicons",
"version": "7.2.1",
"version": "7.2.2",
"lockfileVersion": 2,
"requires": true,
"packages": {
"": {
"name": "ionicons",
"version": "7.2.1",
"version": "7.2.2",
"license": "MIT",
"dependencies": {
"@stencil/core": "^4.0.3"
+1 -1
View File
@@ -1,6 +1,6 @@
{
"name": "ionicons",
"version": "7.2.1",
"version": "7.2.2",
"description": "Premium icons for Ionic.",
"files": [
"components/",
+14 -3
View File
@@ -64,7 +64,7 @@ export const getUrl = (i: Icon) => {
url = getName(i.name, i.icon, i.mode, i.ios, i.md);
if (url) {
return getNamedUrl(url);
return getNamedUrl(url, i);
}
if (i.icon) {
@@ -83,12 +83,23 @@ export const getUrl = (i: Icon) => {
};
const getNamedUrl = (iconName: string) => {
const getNamedUrl = (iconName: string, iconEl: Icon) => {
const url = getIconMap().get(iconName);
if (url) {
return url;
}
return getAssetPath(`svg/${iconName}.svg`);
try {
return getAssetPath(`svg/${iconName}.svg`);
} catch(e) {
/**
* In the custom elements build version of ionicons, referencing an icon
* by name will throw an invalid URL error because the asset path is not defined.
* This catches that error and logs something that is more developer-friendly.
* We also include a reference to the ion-icon element so developers can
* figure out which instance of ion-icon needs to be updated.
*/
console.warn(`[Ionicons Warning]: Could not load icon with name "${iconName}". Ensure that the icon is registered using addIcons or that the icon SVG data is passed directly to the icon component.`, iconEl);
}
};