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 +1 -1
- 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/README.md
CHANGED
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