@unocss/preset-icons 0.45.28 → 0.45.30

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 CHANGED
@@ -80,7 +80,7 @@ By default, this preset will choose the rendering modes automatically for each i
80
80
  - `?bg` for `background-img` - renders the icon as a background image
81
81
  - `?mask` for `mask` - renders the icon as a mask image
82
82
 
83
- For example, `vscode-icons:file-type-light-db`, an icon with colors that will be rendered as a background image. Use `vscode-icons:file-type-light-db?bg` to render it as a mask image and bypass it's colors.
83
+ For example, `vscode-icons:file-type-light-pnpm`, an icon with colors (the `svg` doesn't contain `currentColor`) that will be rendered as a background image. Use `vscode-icons:file-type-light-pnpm?mask` to render it as a mask image and bypass it's colors.
84
84
 
85
85
  ## Configuring collections and icons resolvers
86
86
 
package/dist/browser.cjs CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
- const cdn = require('./shared/preset-icons.b3a2fafc.cjs');
5
+ const cdn = require('./shared/preset-icons.5c258cf1.cjs');
6
6
  const core = require('./core.cjs');
7
7
  require('ohmyfetch');
8
8
  require('@unocss/core');
package/dist/browser.mjs CHANGED
@@ -1,4 +1,4 @@
1
- import { c as createCDNLoader, l as loadIcon } from './shared/preset-icons.0f5b1443.mjs';
1
+ import { c as createCDNLoader, l as loadIcon } from './shared/preset-icons.b465130e.mjs';
2
2
  import { createPresetIcons } from './core.mjs';
3
3
  export { combineLoaders, createPresetIcons } from './core.mjs';
4
4
  import 'ohmyfetch';
package/dist/index.cjs CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
- const cdn = require('./shared/preset-icons.b3a2fafc.cjs');
5
+ const cdn = require('./shared/preset-icons.5c258cf1.cjs');
6
6
  const core = require('./core.cjs');
7
7
  require('ohmyfetch');
8
8
  require('@unocss/core');
package/dist/index.mjs CHANGED
@@ -1,4 +1,4 @@
1
- import { c as createCDNLoader, l as loadIcon } from './shared/preset-icons.0f5b1443.mjs';
1
+ import { c as createCDNLoader, l as loadIcon } from './shared/preset-icons.b465130e.mjs';
2
2
  import { createPresetIcons, combineLoaders } from './core.mjs';
3
3
  export { combineLoaders, createPresetIcons } from './core.mjs';
4
4
  import 'ohmyfetch';
@@ -264,7 +264,7 @@ function iconToSVG(icon, customisations) {
264
264
  "IconifyId" + Date.now().toString(16) + (Math.random() * 16777216 | 0).toString(16);
265
265
 
266
266
  function trimSVG(str) {
267
- return str.replace(/(["';{}><])\s*\n\s*/g, "$1").replace(/\s*\n\s*/g, " ").replace(/\s+"/g, '"').replace(/="\s+/g, '="').trim();
267
+ return str.replace(/(['"])\s*\n\s*([^>\\/\s])/g, "$1 $2").replace(/(["';{}><])\s*\n\s*/g, "$1").replace(/\s*\n\s*/g, " ").replace(/\s+"/g, '"').replace(/="\s+/g, '="').trim();
268
268
  }
269
269
 
270
270
  function add(keyword, colors) {
@@ -627,11 +627,151 @@ const loadIcon = async (collection, icon, options) => {
627
627
  return void 0;
628
628
  };
629
629
 
630
- const supportedCollection = ["material-symbols", "ic", "mdi", "ph", "ri", "carbon", "bi", "tabler", "ion", "uil", "teenyicons", "clarity", "iconoir", "majesticons", "zondicons", "ant-design", "bx", "bxs", "gg", "cil", "lucide", "pixelarticons", "system-uicons", "ci", "akar-icons", "typcn", "radix-icons", "ep", "mdi-light", "fe", "eos-icons", "line-md", "charm", "prime", "heroicons-outline", "heroicons-solid", "uiw", "uim", "uit", "uis", "maki", "gridicons", "mi", "quill", "gala", "fluent", "icon-park-outline", "icon-park", "vscode-icons", "jam", "codicon", "pepicons", "bytesize", "ei", "fa6-solid", "fa6-regular", "octicon", "ooui", "nimbus", "openmoji", "twemoji", "noto", "noto-v1", "emojione", "emojione-monotone", "emojione-v1", "fxemoji", "bxl", "logos", "simple-icons", "cib", "fa6-brands", "arcticons", "file-icons", "brandico", "entypo-social", "cryptocurrency", "flag", "circle-flags", "flagpack", "cif", "gis", "map", "geo", "fad", "academicons", "wi", "healthicons", "medical-icon", "la", "eva", "dashicons", "flat-color-icons", "entypo", "foundation", "raphael", "icons8", "iwwa", "fa-solid", "fa-regular", "fa-brands", "fa", "fontisto", "icomoon-free", "ps", "subway", "oi", "wpf", "simple-line-icons", "et", "el", "vaadin", "grommet-icons", "whh", "si-glyph", "zmdi", "ls", "bpmn", "flat-ui", "vs", "topcoat", "il", "websymbol", "fontelico", "feather", "mono-icons"];
630
+ var collections = [
631
+ "academicons",
632
+ "akar-icons",
633
+ "ant-design",
634
+ "arcticons",
635
+ "bi",
636
+ "bpmn",
637
+ "brandico",
638
+ "bx",
639
+ "bxl",
640
+ "bxs",
641
+ "bytesize",
642
+ "carbon",
643
+ "charm",
644
+ "ci",
645
+ "cib",
646
+ "cif",
647
+ "cil",
648
+ "circle-flags",
649
+ "clarity",
650
+ "codicon",
651
+ "cryptocurrency",
652
+ "dashicons",
653
+ "ei",
654
+ "el",
655
+ "emblemicons",
656
+ "emojione-monotone",
657
+ "emojione-v1",
658
+ "emojione",
659
+ "entypo-social",
660
+ "entypo",
661
+ "eos-icons",
662
+ "ep",
663
+ "et",
664
+ "eva",
665
+ "fa-brands",
666
+ "fa-regular",
667
+ "fa-solid",
668
+ "fa",
669
+ "fa6-brands",
670
+ "fa6-regular",
671
+ "fa6-solid",
672
+ "fad",
673
+ "fe",
674
+ "feather",
675
+ "file-icons",
676
+ "flag",
677
+ "flagpack",
678
+ "flat-color-icons",
679
+ "flat-ui",
680
+ "fluent-emoji-flat",
681
+ "fluent-emoji-high-contrast",
682
+ "fluent-emoji",
683
+ "fluent-mdl2",
684
+ "fluent",
685
+ "fontelico",
686
+ "fontisto",
687
+ "foundation",
688
+ "fxemoji",
689
+ "gala",
690
+ "game-icons",
691
+ "geo",
692
+ "gg",
693
+ "gis",
694
+ "gridicons",
695
+ "grommet-icons",
696
+ "healthicons",
697
+ "heroicons-outline",
698
+ "heroicons-solid",
699
+ "heroicons",
700
+ "humbleicons",
701
+ "ic",
702
+ "icomoon-free",
703
+ "icon-park-outline",
704
+ "icon-park-solid",
705
+ "icon-park-twotone",
706
+ "icon-park",
707
+ "iconoir",
708
+ "icons8",
709
+ "il",
710
+ "ion",
711
+ "iwwa",
712
+ "jam",
713
+ "la",
714
+ "line-md",
715
+ "logos",
716
+ "ls",
717
+ "lucide",
718
+ "majesticons",
719
+ "maki",
720
+ "map",
721
+ "material-symbols",
722
+ "mdi-light",
723
+ "mdi",
724
+ "medical-icon",
725
+ "mi",
726
+ "mingcute",
727
+ "mono-icons",
728
+ "nimbus",
729
+ "noto-v1",
730
+ "noto",
731
+ "octicon",
732
+ "oi",
733
+ "ooui",
734
+ "openmoji",
735
+ "pajamas",
736
+ "pepicons",
737
+ "ph",
738
+ "pixelarticons",
739
+ "prime",
740
+ "ps",
741
+ "quill",
742
+ "radix-icons",
743
+ "raphael",
744
+ "ri",
745
+ "si-glyph",
746
+ "simple-icons",
747
+ "simple-line-icons",
748
+ "subway",
749
+ "system-uicons",
750
+ "tabler",
751
+ "teenyicons",
752
+ "topcoat",
753
+ "twemoji",
754
+ "typcn",
755
+ "uil",
756
+ "uim",
757
+ "uis",
758
+ "uit",
759
+ "uiw",
760
+ "vaadin",
761
+ "vs",
762
+ "vscode-icons",
763
+ "websymbol",
764
+ "whh",
765
+ "wi",
766
+ "wpf",
767
+ "zmdi",
768
+ "zondicons"
769
+ ];
770
+
631
771
  function createCDNLoader(cdnBase) {
632
772
  const cache = /* @__PURE__ */ new Map();
633
773
  function fetchCollection(name) {
634
- if (!supportedCollection.includes(name))
774
+ if (!collections.includes(name))
635
775
  return void 0;
636
776
  if (!cache.has(name))
637
777
  cache.set(name, ohmyfetch.$fetch(`${cdnBase}@iconify-json/${name}/icons.json`));
@@ -262,7 +262,7 @@ function iconToSVG(icon, customisations) {
262
262
  "IconifyId" + Date.now().toString(16) + (Math.random() * 16777216 | 0).toString(16);
263
263
 
264
264
  function trimSVG(str) {
265
- return str.replace(/(["';{}><])\s*\n\s*/g, "$1").replace(/\s*\n\s*/g, " ").replace(/\s+"/g, '"').replace(/="\s+/g, '="').trim();
265
+ return str.replace(/(['"])\s*\n\s*([^>\\/\s])/g, "$1 $2").replace(/(["';{}><])\s*\n\s*/g, "$1").replace(/\s*\n\s*/g, " ").replace(/\s+"/g, '"').replace(/="\s+/g, '="').trim();
266
266
  }
267
267
 
268
268
  function add(keyword, colors) {
@@ -625,11 +625,151 @@ const loadIcon = async (collection, icon, options) => {
625
625
  return void 0;
626
626
  };
627
627
 
628
- const supportedCollection = ["material-symbols", "ic", "mdi", "ph", "ri", "carbon", "bi", "tabler", "ion", "uil", "teenyicons", "clarity", "iconoir", "majesticons", "zondicons", "ant-design", "bx", "bxs", "gg", "cil", "lucide", "pixelarticons", "system-uicons", "ci", "akar-icons", "typcn", "radix-icons", "ep", "mdi-light", "fe", "eos-icons", "line-md", "charm", "prime", "heroicons-outline", "heroicons-solid", "uiw", "uim", "uit", "uis", "maki", "gridicons", "mi", "quill", "gala", "fluent", "icon-park-outline", "icon-park", "vscode-icons", "jam", "codicon", "pepicons", "bytesize", "ei", "fa6-solid", "fa6-regular", "octicon", "ooui", "nimbus", "openmoji", "twemoji", "noto", "noto-v1", "emojione", "emojione-monotone", "emojione-v1", "fxemoji", "bxl", "logos", "simple-icons", "cib", "fa6-brands", "arcticons", "file-icons", "brandico", "entypo-social", "cryptocurrency", "flag", "circle-flags", "flagpack", "cif", "gis", "map", "geo", "fad", "academicons", "wi", "healthicons", "medical-icon", "la", "eva", "dashicons", "flat-color-icons", "entypo", "foundation", "raphael", "icons8", "iwwa", "fa-solid", "fa-regular", "fa-brands", "fa", "fontisto", "icomoon-free", "ps", "subway", "oi", "wpf", "simple-line-icons", "et", "el", "vaadin", "grommet-icons", "whh", "si-glyph", "zmdi", "ls", "bpmn", "flat-ui", "vs", "topcoat", "il", "websymbol", "fontelico", "feather", "mono-icons"];
628
+ var collections = [
629
+ "academicons",
630
+ "akar-icons",
631
+ "ant-design",
632
+ "arcticons",
633
+ "bi",
634
+ "bpmn",
635
+ "brandico",
636
+ "bx",
637
+ "bxl",
638
+ "bxs",
639
+ "bytesize",
640
+ "carbon",
641
+ "charm",
642
+ "ci",
643
+ "cib",
644
+ "cif",
645
+ "cil",
646
+ "circle-flags",
647
+ "clarity",
648
+ "codicon",
649
+ "cryptocurrency",
650
+ "dashicons",
651
+ "ei",
652
+ "el",
653
+ "emblemicons",
654
+ "emojione-monotone",
655
+ "emojione-v1",
656
+ "emojione",
657
+ "entypo-social",
658
+ "entypo",
659
+ "eos-icons",
660
+ "ep",
661
+ "et",
662
+ "eva",
663
+ "fa-brands",
664
+ "fa-regular",
665
+ "fa-solid",
666
+ "fa",
667
+ "fa6-brands",
668
+ "fa6-regular",
669
+ "fa6-solid",
670
+ "fad",
671
+ "fe",
672
+ "feather",
673
+ "file-icons",
674
+ "flag",
675
+ "flagpack",
676
+ "flat-color-icons",
677
+ "flat-ui",
678
+ "fluent-emoji-flat",
679
+ "fluent-emoji-high-contrast",
680
+ "fluent-emoji",
681
+ "fluent-mdl2",
682
+ "fluent",
683
+ "fontelico",
684
+ "fontisto",
685
+ "foundation",
686
+ "fxemoji",
687
+ "gala",
688
+ "game-icons",
689
+ "geo",
690
+ "gg",
691
+ "gis",
692
+ "gridicons",
693
+ "grommet-icons",
694
+ "healthicons",
695
+ "heroicons-outline",
696
+ "heroicons-solid",
697
+ "heroicons",
698
+ "humbleicons",
699
+ "ic",
700
+ "icomoon-free",
701
+ "icon-park-outline",
702
+ "icon-park-solid",
703
+ "icon-park-twotone",
704
+ "icon-park",
705
+ "iconoir",
706
+ "icons8",
707
+ "il",
708
+ "ion",
709
+ "iwwa",
710
+ "jam",
711
+ "la",
712
+ "line-md",
713
+ "logos",
714
+ "ls",
715
+ "lucide",
716
+ "majesticons",
717
+ "maki",
718
+ "map",
719
+ "material-symbols",
720
+ "mdi-light",
721
+ "mdi",
722
+ "medical-icon",
723
+ "mi",
724
+ "mingcute",
725
+ "mono-icons",
726
+ "nimbus",
727
+ "noto-v1",
728
+ "noto",
729
+ "octicon",
730
+ "oi",
731
+ "ooui",
732
+ "openmoji",
733
+ "pajamas",
734
+ "pepicons",
735
+ "ph",
736
+ "pixelarticons",
737
+ "prime",
738
+ "ps",
739
+ "quill",
740
+ "radix-icons",
741
+ "raphael",
742
+ "ri",
743
+ "si-glyph",
744
+ "simple-icons",
745
+ "simple-line-icons",
746
+ "subway",
747
+ "system-uicons",
748
+ "tabler",
749
+ "teenyicons",
750
+ "topcoat",
751
+ "twemoji",
752
+ "typcn",
753
+ "uil",
754
+ "uim",
755
+ "uis",
756
+ "uit",
757
+ "uiw",
758
+ "vaadin",
759
+ "vs",
760
+ "vscode-icons",
761
+ "websymbol",
762
+ "whh",
763
+ "wi",
764
+ "wpf",
765
+ "zmdi",
766
+ "zondicons"
767
+ ];
768
+
629
769
  function createCDNLoader(cdnBase) {
630
770
  const cache = /* @__PURE__ */ new Map();
631
771
  function fetchCollection(name) {
632
- if (!supportedCollection.includes(name))
772
+ if (!collections.includes(name))
633
773
  return void 0;
634
774
  if (!cache.has(name))
635
775
  cache.set(name, $fetch(`${cdnBase}@iconify-json/${name}/icons.json`));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@unocss/preset-icons",
3
- "version": "0.45.28",
3
+ "version": "0.45.30",
4
4
  "description": "Pure CSS Icons for UnoCSS",
5
5
  "author": "Anthony Fu <anthonyfu117@hotmail.com>",
6
6
  "license": "MIT",
@@ -47,9 +47,9 @@
47
47
  "*.css"
48
48
  ],
49
49
  "dependencies": {
50
- "@iconify/utils": "^2.0.0",
51
- "@unocss/core": "0.45.28",
52
- "ohmyfetch": "^0.4.19"
50
+ "@iconify/utils": "^2.0.1",
51
+ "@unocss/core": "0.45.30",
52
+ "ohmyfetch": "^0.4.20"
53
53
  },
54
54
  "devDependencies": {
55
55
  "@iconify/types": "^2.0.0"