ezi 0.0.2 → 1.0.0

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/index.js ADDED
@@ -0,0 +1 @@
1
+ document.addEventListener("DOMContentLoaded",(()=>{const t=document.getElementById("root"),e={};function n(t){const e=t.startsWith("/")?t.slice(1):t;window.location.hash=e,o(e)}function o(n){t.innerHTML="";const o=n.startsWith("/")?n.slice(1):n,c=e[o]||e[`/${o}`];if(c){const e=c.cloneNode(!0);t.appendChild(e)}else if(e[""]||e["/"]){const n=(e[""]||e["/"]).cloneNode(!0);t.appendChild(n)}}document.querySelectorAll("template[route]").forEach((t=>{const n=t.getAttribute("route");e[n]=t.content.cloneNode(!0),t.remove()})),document.addEventListener("click",(t=>{let e=t.target;for(;e&&e!==document;){if("A"===e.tagName&&e.hasAttribute("href")){const o=e.getAttribute("href");o.includes("://")||o.startsWith("mailto:")||o.startsWith("tel:")||(t.preventDefault(),n(o));break}e=e.parentNode}})),window.addEventListener("hashchange",(()=>{o(window.location.hash.replace("#",""))}));o(window.location.hash.replace("#",""))}));
package/package.json CHANGED
@@ -1,6 +1,16 @@
1
1
  {
2
2
  "name": "ezi",
3
- "main": "app.js",
4
- "version": "0.0.2",
5
- "author": "Nazmul Hossain"
3
+ "version": "1.0.0",
4
+ "description": "A JavaScript library for router",
5
+ "main": "dist/index.js",
6
+ "scripts": {
7
+ "test": "echo \"Error: no test specified\" && exit 1"
8
+ },
9
+ "keywords": [
10
+ "ezi",
11
+ "html",
12
+ "router"
13
+ ],
14
+ "author": "Nazmul Hossain",
15
+ "license": "MIT"
6
16
  }
package/README.md DELETED
@@ -1,48 +0,0 @@
1
- <div align="center">
2
- <h1>ezi</h1>
3
- <p>A smooth, minimal framework for infusing JavaScript with dynamic behavior.</p>
4
- </div>
5
-
6
- ## Hi there 👋
7
-
8
- ### Welcome to the sleek and minimal framework that brings dynamic behavior to JavaScript! ✨
9
-
10
- ---
11
-
12
- # Features
13
-
14
- - Smooth Integration: Easy-to-use framework for adding dynamic functionality to
15
- your JavaScript projects.
16
- - Minimalistic Design: Focus on what matters with a clean and simple setup.
17
- - Dynamic State Management: Manage and update your state with ease.
18
- - Explore more and start building with DeshiJS today! 🚀
19
-
20
- ---
21
-
22
- ```html
23
- <div id="root"></div>
24
-
25
- <template>
26
- <button @click="incrementCounter()">
27
- { count } {count <= 1 ? 'time' : 'times' }
28
- </button>
29
- </template>
30
-
31
- <script type="module">
32
- import ezi from "//unpkg.com/ezi";
33
- ezi.init();
34
-
35
- useSignal({
36
- count: 0,
37
- incrementCounter: function () {
38
- this.count++;
39
- },
40
- });
41
-
42
- useEffect(() => {
43
- console.log("component mounted!");
44
- });
45
- </script>
46
- ```
47
-
48
- author: [Nazmul Hossain](https://www.facebook.com/codervai)
package/app.js DELETED
@@ -1 +0,0 @@
1
- console.log("Hello world");