iconly 1.2.0 → 1.2.2
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 +2 -2
- package/dist/index.js +1 -0
- package/dist/index.js.map +1 -1
- package/dist/index.module.js +1 -0
- package/dist/index.module.js.map +1 -1
- package/package.json +1 -1
- package/src/index.js +1 -1
- package/src/sprite.svg +5 -5
package/README.md
CHANGED
|
@@ -27,13 +27,13 @@ import Iconly from 'iconly'
|
|
|
27
27
|
|
|
28
28
|
```javascript
|
|
29
29
|
new Iconly({
|
|
30
|
-
file: './
|
|
30
|
+
file: './icons.svg'
|
|
31
31
|
})
|
|
32
32
|
```
|
|
33
33
|
<br>
|
|
34
34
|
|
|
35
35
|
### File with icons
|
|
36
|
-
<sub>
|
|
36
|
+
<sub>icons.svg</sub>
|
|
37
37
|
|
|
38
38
|
```HTML
|
|
39
39
|
<svg id="iconset" aria-hidden="true" style="width: 0; height: 0; position: absolute;">
|
package/dist/index.js
CHANGED
|
@@ -11,6 +11,7 @@ $parcel$export(module.exports, "default", () => $4fa36e821943b400$export$2e2bcd8
|
|
|
11
11
|
class $4fa36e821943b400$export$2e2bcd8739ae039 {
|
|
12
12
|
constructor(options){
|
|
13
13
|
this.options = {
|
|
14
|
+
file: "./icons.svg",
|
|
14
15
|
...options
|
|
15
16
|
};
|
|
16
17
|
this.isLocalStorage = typeof window.localStorage !== "undefined";
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"mappings":";;;;;;;;;;AAAe;IACd,YAAY,OAAO,CAAE;QACpB,IAAI,CAAC,UAAU;YAAE,GAAG,OAAO;QAAC;
|
|
1
|
+
{"mappings":";;;;;;;;;;AAAe;IACd,YAAY,OAAO,CAAE;QACpB,IAAI,CAAC,UAAU;YAAE,MAAM;YAAe,GAAG,OAAO;QAAC;QACjD,IAAI,CAAC,iBAAiB,OAAO,OAAO,iBAAiB;QACrD,IAAI,CAAC,OAAO,SAAS;QAErB,IAAI,CAAC,OAAO;IACb;IAEA,MAAM,OAAO;QACZ,MAAM,QAAE,IAAI,EAAE,GAAG,IAAI,CAAC;QAEtB,IAAI,IAAI,CAAC,gBAAgB;YACxB,MAAM,aAAa,aAAa,QAAQ;YACxC,MAAM,aAAa,aAAa,QAAQ;YACxC,MAAM,WAAW,MAAM,MAAM;YAE7B,IAAI,CAAC,SAAS,IAAI,MAAM,IAAI,MAAM;YAElC,MAAM,OAAO,MAAM,SAAS;YAE5B,IAAI,cAAc,eAAe,KAAK,OAAO,YAC5C,IAAI,CAAC,OAAO;iBACN;gBACN,IAAI,CAAC,OAAO;gBAEZ,aAAa,QAAQ,iBAAiB;gBACtC,aAAa,QAAQ,iBAAiB,KAAK,OAAO;YACnD;QACD,OAAO;YACN,MAAM,WAAW,MAAM,MAAM;YAE7B,IAAI,CAAC,SAAS,IAAI,MAAM,IAAI,MAAM;YAElC,MAAM,OAAO,MAAM,SAAS;YAE5B,IAAI,CAAC,OAAO;QACb;IACD;IAEA,OAAO,IAAI,EAAE;QACZ,IAAI,CAAC,SAAS,eAAe;YAC5B,IAAI,IAAI,CAAC,MACR,IAAI,CAAC,KAAK,mBAAmB,aAAa;iBAE1C,SAAS,iBAAiB,oBAAoB;gBAC7C,IAAI,CAAC,KAAK,mBAAmB,aAAa;YAC3C;;IAGH;AACD","sources":["src/index.js"],"sourcesContent":["export default class Iconly {\r\n\tconstructor(options) {\r\n\t\tthis.options = { file: './icons.svg', ...options }\r\n\t\tthis.isLocalStorage = typeof window.localStorage !== 'undefined'\r\n\t\tthis.body = document.body\r\n\r\n\t\tthis.init().then()\r\n\t}\r\n\r\n\tasync init() {\r\n\t\tconst { file } = this.options\r\n\r\n\t\tif (this.isLocalStorage) {\r\n\t\t\tconst storedSize = localStorage.getItem('inlineSVGsize')\r\n\t\t\tconst storedData = localStorage.getItem('inlineSVGdata')\r\n\t\t\tconst response = await fetch(file)\r\n\r\n\t\t\tif (!response.ok) throw new Error('Network response was not ok')\r\n\r\n\t\t\tconst data = await response.text()\r\n\r\n\t\t\tif (storedSize && storedSize === data.length.toString()) {\r\n\t\t\t\tthis.insert(storedData)\r\n\t\t\t} else {\r\n\t\t\t\tthis.insert(data)\r\n\r\n\t\t\t\tlocalStorage.setItem('inlineSVGdata', data)\r\n\t\t\t\tlocalStorage.setItem('inlineSVGsize', data.length.toString())\r\n\t\t\t}\r\n\t\t} else {\r\n\t\t\tconst response = await fetch(file)\r\n\r\n\t\t\tif (!response.ok) throw new Error('Network response was not ok')\r\n\r\n\t\t\tconst data = await response.text()\r\n\r\n\t\t\tthis.insert(data)\r\n\t\t}\r\n\t}\r\n\r\n\tinsert(data) {\r\n\t\tif (!document.getElementById('iconset')) {\r\n\t\t\tif (this.body) {\r\n\t\t\t\tthis.body.insertAdjacentHTML('beforeend', data)\r\n\t\t\t} else {\r\n\t\t\t\tdocument.addEventListener('DOMContentLoaded', () => {\r\n\t\t\t\t\tthis.body.insertAdjacentHTML('beforeend', data)\r\n\t\t\t\t})\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n}"],"names":[],"version":3,"file":"index.js.map"}
|
package/dist/index.module.js
CHANGED
package/dist/index.module.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"mappings":"AAAe;IACd,YAAY,OAAO,CAAE;QACpB,IAAI,CAAC,UAAU;YAAE,GAAG,OAAO;QAAC;
|
|
1
|
+
{"mappings":"AAAe;IACd,YAAY,OAAO,CAAE;QACpB,IAAI,CAAC,UAAU;YAAE,MAAM;YAAe,GAAG,OAAO;QAAC;QACjD,IAAI,CAAC,iBAAiB,OAAO,OAAO,iBAAiB;QACrD,IAAI,CAAC,OAAO,SAAS;QAErB,IAAI,CAAC,OAAO;IACb;IAEA,MAAM,OAAO;QACZ,MAAM,QAAE,IAAI,EAAE,GAAG,IAAI,CAAC;QAEtB,IAAI,IAAI,CAAC,gBAAgB;YACxB,MAAM,aAAa,aAAa,QAAQ;YACxC,MAAM,aAAa,aAAa,QAAQ;YACxC,MAAM,WAAW,MAAM,MAAM;YAE7B,IAAI,CAAC,SAAS,IAAI,MAAM,IAAI,MAAM;YAElC,MAAM,OAAO,MAAM,SAAS;YAE5B,IAAI,cAAc,eAAe,KAAK,OAAO,YAC5C,IAAI,CAAC,OAAO;iBACN;gBACN,IAAI,CAAC,OAAO;gBAEZ,aAAa,QAAQ,iBAAiB;gBACtC,aAAa,QAAQ,iBAAiB,KAAK,OAAO;YACnD;QACD,OAAO;YACN,MAAM,WAAW,MAAM,MAAM;YAE7B,IAAI,CAAC,SAAS,IAAI,MAAM,IAAI,MAAM;YAElC,MAAM,OAAO,MAAM,SAAS;YAE5B,IAAI,CAAC,OAAO;QACb;IACD;IAEA,OAAO,IAAI,EAAE;QACZ,IAAI,CAAC,SAAS,eAAe;YAC5B,IAAI,IAAI,CAAC,MACR,IAAI,CAAC,KAAK,mBAAmB,aAAa;iBAE1C,SAAS,iBAAiB,oBAAoB;gBAC7C,IAAI,CAAC,KAAK,mBAAmB,aAAa;YAC3C;;IAGH;AACD","sources":["src/index.js"],"sourcesContent":["export default class Iconly {\r\n\tconstructor(options) {\r\n\t\tthis.options = { file: './icons.svg', ...options }\r\n\t\tthis.isLocalStorage = typeof window.localStorage !== 'undefined'\r\n\t\tthis.body = document.body\r\n\r\n\t\tthis.init().then()\r\n\t}\r\n\r\n\tasync init() {\r\n\t\tconst { file } = this.options\r\n\r\n\t\tif (this.isLocalStorage) {\r\n\t\t\tconst storedSize = localStorage.getItem('inlineSVGsize')\r\n\t\t\tconst storedData = localStorage.getItem('inlineSVGdata')\r\n\t\t\tconst response = await fetch(file)\r\n\r\n\t\t\tif (!response.ok) throw new Error('Network response was not ok')\r\n\r\n\t\t\tconst data = await response.text()\r\n\r\n\t\t\tif (storedSize && storedSize === data.length.toString()) {\r\n\t\t\t\tthis.insert(storedData)\r\n\t\t\t} else {\r\n\t\t\t\tthis.insert(data)\r\n\r\n\t\t\t\tlocalStorage.setItem('inlineSVGdata', data)\r\n\t\t\t\tlocalStorage.setItem('inlineSVGsize', data.length.toString())\r\n\t\t\t}\r\n\t\t} else {\r\n\t\t\tconst response = await fetch(file)\r\n\r\n\t\t\tif (!response.ok) throw new Error('Network response was not ok')\r\n\r\n\t\t\tconst data = await response.text()\r\n\r\n\t\t\tthis.insert(data)\r\n\t\t}\r\n\t}\r\n\r\n\tinsert(data) {\r\n\t\tif (!document.getElementById('iconset')) {\r\n\t\t\tif (this.body) {\r\n\t\t\t\tthis.body.insertAdjacentHTML('beforeend', data)\r\n\t\t\t} else {\r\n\t\t\t\tdocument.addEventListener('DOMContentLoaded', () => {\r\n\t\t\t\t\tthis.body.insertAdjacentHTML('beforeend', data)\r\n\t\t\t\t})\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n}"],"names":[],"version":3,"file":"index.module.js.map"}
|
package/package.json
CHANGED
package/src/index.js
CHANGED
package/src/sprite.svg
CHANGED
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
<svg id="iconset" aria-hidden="true" focusable="false" style="width: 0; height: 0; position: absolute;">
|
|
2
|
-
<symbol id="i-
|
|
2
|
+
<symbol id="i-dangerous" viewBox="0 0 24 24">
|
|
3
3
|
<path d="M14.9,3H9.1C8.57,3,8.06,3.21,7.68,3.59l-4.1,4.1C3.21,8.06,3,8.57,3,9.1v5.8c0,0.53,0.21,1.04,0.59,1.41l4.1,4.1 C8.06,20.79,8.57,21,9.1,21h5.8c0.53,0,1.04-0.21,1.41-0.59l4.1-4.1C20.79,15.94,21,15.43,21,14.9V9.1c0-0.53-0.21-1.04-0.59-1.41 l-4.1-4.1C15.94,3.21,15.43,3,14.9,3z M15.54,15.54L15.54,15.54c-0.39,0.39-1.02,0.39-1.41,0L12,13.41l-2.12,2.12 c-0.39,0.39-1.02,0.39-1.41,0l0,0c-0.39-0.39-0.39-1.02,0-1.41L10.59,12L8.46,9.88c-0.39-0.39-0.39-1.02,0-1.41l0,0 c0.39-0.39,1.02-0.39,1.41,0L12,10.59l2.12-2.12c0.39-0.39,1.02-0.39,1.41,0l0,0c0.39,0.39,0.39,1.02,0,1.41L13.41,12l2.12,2.12 C15.93,14.51,15.93,15.15,15.54,15.54z"/>
|
|
4
4
|
</symbol>
|
|
5
|
-
<symbol id="i-
|
|
5
|
+
<symbol id="i-shopping" viewBox="0 0 24 24">
|
|
6
6
|
<path d="M7,18c-1.1,0-1.99,0.9-1.99,2S5.9,22,7,22s2-0.9,2-2S8.1,18,7,18z M17,18c-1.1,0-1.99,0.9-1.99,2s0.89,2,1.99,2s2-0.9,2-2 S18.1,18,17,18z M19,16c0-0.55-0.45-1-1-1H7l1.1-2h7.45c0.75,0,1.41-0.41,1.75-1.03l3.24-6.14c0.25-0.48,0.08-1.08-0.4-1.34 c-0.49-0.27-1.1-0.08-1.36,0.41L15.55,11H8.53L4.54,2.57C4.38,2.22,4.02,2,3.64,2H2C1.45,2,1,2.45,1,3s0.45,1,1,1h1l3.6,7.59 l-1.35,2.44C4.52,15.37,5.48,17,7,17h11C18.55,17,19,16.55,19,16z M11.29,2.71c0.39-0.39,1.02-0.39,1.41,0l2.59,2.59 c0.39,0.39,0.39,1.02,0,1.41l-2.59,2.59c-0.39,0.39-1.02,0.39-1.41,0c-0.39-0.39-0.39-1.02,0-1.41L12.17,7L9,7C8.45,7,8,6.55,8,6 c0-0.55,0.45-1,1-1l3.17,0l-0.88-0.88C10.9,3.73,10.9,3.1,11.29,2.71z"/>
|
|
7
7
|
</symbol>
|
|
8
|
-
<symbol id="i-
|
|
8
|
+
<symbol id="i-percent" viewBox="0 0 24 24">
|
|
9
9
|
<path d="M7.5,4C5.57,4,4,5.57,4,7.5S5.57,11,7.5,11S11,9.43,11,7.5S9.43,4,7.5,4z M7.5,9C6.67,9,6,8.33,6,7.5S6.67,6,7.5,6 S9,6.67,9,7.5S8.33,9,7.5,9z M16.5,13c-1.93,0-3.5,1.57-3.5,3.5s1.57,3.5,3.5,3.5s3.5-1.57,3.5-3.5S18.43,13,16.5,13z M16.5,18 c-0.83,0-1.5-0.67-1.5-1.5s0.67-1.5,1.5-1.5s1.5,0.67,1.5,1.5S17.33,18,16.5,18z M19.29,4.71c0.39,0.39,0.39,1.02,0,1.41 L6.12,19.29c-0.39,0.39-1.02,0.39-1.41,0s-0.39-1.02,0-1.41L17.88,4.71C18.27,4.32,18.9,4.32,19.29,4.71z"/>
|
|
10
10
|
</symbol>
|
|
11
|
-
<symbol id="i-
|
|
11
|
+
<symbol id="i-rocket" viewBox="0 0 24 24">
|
|
12
12
|
<path d="M9.19,6.35c-2.04,2.29-3.44,5.58-3.57,5.89l-2.26-0.97c-0.65-0.28-0.81-1.13-0.31-1.63l3.01-3.01 c0.47-0.47,1.15-0.68,1.81-0.55L9.19,6.35L9.19,6.35z M10.68,16.51c0.3,0.3,0.74,0.38,1.12,0.2c1.16-0.54,3.65-1.81,5.26-3.42 c4.59-4.59,4.63-8.33,4.36-9.93c-0.07-0.4-0.39-0.72-0.79-0.79c-1.6-0.27-5.34-0.23-9.93,4.36c-1.61,1.61-2.87,4.1-3.42,5.26 c-0.18,0.38-0.09,0.83,0.2,1.12L10.68,16.51z M17.65,14.81c-2.29,2.04-5.58,3.44-5.89,3.57l0.97,2.26 c0.28,0.65,1.13,0.81,1.63,0.31l3.01-3.01c0.47-0.47,0.68-1.15,0.55-1.81L17.65,14.81L17.65,14.81z M8.94,17.41 c0.2,1.06-0.15,2.04-0.82,2.71c-0.77,0.77-3.16,1.34-4.71,1.64c-0.69,0.13-1.3-0.48-1.17-1.17c0.3-1.55,0.86-3.94,1.64-4.71 c0.67-0.67,1.65-1.02,2.71-0.82C7.76,15.28,8.72,16.24,8.94,17.41z M13,9c0-1.1,0.9-2,2-2s2,0.9,2,2s-0.9,2-2,2S13,10.1,13,9z"/>
|
|
13
13
|
</symbol>
|
|
14
|
-
<symbol id="i-
|
|
14
|
+
<symbol id="i-phone" viewBox="0 0 24 24">
|
|
15
15
|
<path d="M12.88 5.05c3.18.4 5.67 2.89 6.07 6.07.06.51.49.88.99.88.04 0 .08 0 .12-.01.55-.07.94-.57.87-1.12-.51-4.09-3.72-7.3-7.81-7.81-.55-.06-1.05.33-1.11.88-.07.55.32 1.05.87 1.11zm.38 2.11c-.53-.14-1.08.18-1.22.72s.18 1.08.72 1.22c1.05.27 1.87 1.09 2.15 2.15.12.45.52.75.97.75.08 0 .17-.01.25-.03.53-.14.85-.69.72-1.22-.47-1.77-1.84-3.14-3.59-3.59zm5.97 8.1l-2.54-.29c-.61-.07-1.21.14-1.64.57l-1.84 1.84c-2.83-1.44-5.15-3.75-6.59-6.59l1.85-1.85c.43-.43.64-1.03.57-1.64l-.29-2.52c-.12-1.01-.97-1.77-1.99-1.77H5.03c-1.13 0-2.07.94-2 2.07.53 8.54 7.36 15.36 15.89 15.89 1.13.07 2.07-.87 2.07-2v-1.73c.01-1.01-.75-1.86-1.76-1.98z"/>
|
|
16
16
|
</symbol>
|
|
17
17
|
</svg>
|