ziko 0.0.27 → 0.0.29

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/dist/ziko.mjs CHANGED
@@ -2,7 +2,7 @@
2
2
  /*
3
3
  Project: ziko.js
4
4
  Author: Zakaria Elalaoui
5
- Date : Thu Jul 10 2025 11:49:56 GMT+0100 (UTC+01:00)
5
+ Date : Fri Jul 25 2025 11:35:58 GMT+0100 (UTC+01:00)
6
6
  Git-Repo : https://github.com/zakarialaoui10/ziko.js
7
7
  Git-Wiki : https://github.com/zakarialaoui10/ziko.js/wiki
8
8
  Released under MIT License
@@ -6020,15 +6020,19 @@ class ZikoUIXMLWrapper extends ZikoUIElement{
6020
6020
  }
6021
6021
  }
6022
6022
  function html2dom(htmlString) {
6023
- const parser = new DOMParser();
6024
- const doc = parser.parseFromString(`<div>${htmlString}</div>`, 'text/html');
6025
- doc.body.firstChild.style.display = "contents";
6026
- return doc.body.firstChild;
6023
+ if(globalThis?.DOMParser){
6024
+ const parser = new DOMParser();
6025
+ const doc = parser.parseFromString(`<div>${htmlString}</div>`, 'text/html');
6026
+ doc.body.firstChild.style.display = "contents";
6027
+ return doc.body.firstChild;
6028
+ }
6027
6029
  }
6028
6030
  function svg2dom(svgString) {
6029
- const parser = new DOMParser();
6030
- const doc = parser.parseFromString(svgString.replace(/\s+/g, ' ').trim(), 'image/svg+xml');
6031
- return doc.documentElement; // SVG elements are usually at the root
6031
+ if(globalThis?.DOMParser){
6032
+ const parser = new DOMParser();
6033
+ const doc = parser.parseFromString(svgString.replace(/\s+/g, ' ').trim(), 'image/svg+xml');
6034
+ return doc.documentElement; // SVG elements are usually at the root
6035
+ }
6032
6036
  }
6033
6037
  class ZikoUIHTMLWrapper extends ZikoUIXMLWrapper{
6034
6038
  constructor(HTMLContent){
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ziko",
3
- "version": "0.0.27",
3
+ "version": "0.0.29",
4
4
  "description": "a versatile javaScript framework offering a rich set of UI components, advanced mathematical utilities, reactivity, animations, client side routing and graphics capabilities",
5
5
  "keywords": [
6
6
  "front-end",
@@ -6,15 +6,19 @@ class ZikoUIXMLWrapper extends ZikoUIElement{
6
6
  }
7
7
  }
8
8
  function html2dom(htmlString) {
9
- const parser = new DOMParser();
10
- const doc = parser.parseFromString(`<div>${htmlString}</div>`, 'text/html');
11
- doc.body.firstChild.style.display = "contents"
12
- return doc.body.firstChild;
9
+ if(globalThis?.DOMParser){
10
+ const parser = new DOMParser();
11
+ const doc = parser.parseFromString(`<div>${htmlString}</div>`, 'text/html');
12
+ doc.body.firstChild.style.display = "contents"
13
+ return doc.body.firstChild;
14
+ }
13
15
  }
14
16
  function svg2dom(svgString) {
15
- const parser = new DOMParser();
16
- const doc = parser.parseFromString(svgString.replace(/\s+/g, ' ').trim(), 'image/svg+xml');
17
- return doc.documentElement; // SVG elements are usually at the root
17
+ if(globalThis?.DOMParser){
18
+ const parser = new DOMParser();
19
+ const doc = parser.parseFromString(svgString.replace(/\s+/g, ' ').trim(), 'image/svg+xml');
20
+ return doc.documentElement; // SVG elements are usually at the root
21
+ }
18
22
  }
19
23
  class ZikoUIHTMLWrapper extends ZikoUIXMLWrapper{
20
24
  constructor(HTMLContent){