iconly 1.2.0 → 1.2.1

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
@@ -27,7 +27,7 @@ import Iconly from 'iconly'
27
27
 
28
28
  ```javascript
29
29
  new Iconly({
30
- file: './sprite.svg'
30
+ file: './icons.svg'
31
31
  })
32
32
  ```
33
33
  <br>
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;QAC5B,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 = { ...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"}
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"}
@@ -1,6 +1,7 @@
1
1
  class $cf838c15c8b009ba$export$2e2bcd8739ae039 {
2
2
  constructor(options){
3
3
  this.options = {
4
+ file: "./icons.svg",
4
5
  ...options
5
6
  };
6
7
  this.isLocalStorage = typeof window.localStorage !== "undefined";
@@ -1 +1 @@
1
- {"mappings":"AAAe;IACd,YAAY,OAAO,CAAE;QACpB,IAAI,CAAC,UAAU;YAAE,GAAG,OAAO;QAAC;QAC5B,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 = { ...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"}
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
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "iconly",
3
- "version": "1.2.0",
3
+ "version": "1.2.1",
4
4
  "description": "SVG Sprite",
5
5
  "author": "ux-ui.pro",
6
6
  "license": "MIT",
package/src/index.js CHANGED
@@ -1,6 +1,6 @@
1
1
  export default class Iconly {
2
2
  constructor(options) {
3
- this.options = { ...options }
3
+ this.options = { file: './icons.svg', ...options }
4
4
  this.isLocalStorage = typeof window.localStorage !== 'undefined'
5
5
  this.body = document.body
6
6