sibujs 1.2.0 → 1.3.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/README.md +29 -25
- package/dist/browser.cjs +804 -2
- package/dist/browser.d.cts +591 -1
- package/dist/browser.d.ts +591 -1
- package/dist/browser.js +50 -8
- package/dist/build.cjs +654 -144
- package/dist/build.js +14 -12
- package/dist/cdn.global.js +188 -7
- package/dist/chunk-2BYQDGN3.js +742 -0
- package/dist/chunk-32DY64NT.js +282 -0
- package/dist/chunk-3AIRKM3B.js +1263 -0
- package/dist/chunk-3X2YG6YM.js +505 -0
- package/dist/chunk-5X6PP2UK.js +28 -0
- package/dist/chunk-77L6NL3X.js +1097 -0
- package/dist/chunk-BGN5ZMP4.js +26 -0
- package/dist/chunk-BTU3TJDS.js +365 -0
- package/dist/chunk-CHF5OHIA.js +61 -0
- package/dist/chunk-CMBFNA7L.js +27 -0
- package/dist/chunk-DAHRH4ON.js +331 -0
- package/dist/chunk-EBGIRKQY.js +616 -0
- package/dist/chunk-EUZND3CB.js +27 -0
- package/dist/chunk-F3FA4F32.js +292 -0
- package/dist/chunk-JAKHTMQU.js +1000 -0
- package/dist/chunk-JCI5M6U6.js +956 -0
- package/dist/chunk-KQPDEVVS.js +398 -0
- package/dist/chunk-NEKUBFPT.js +60 -0
- package/dist/chunk-NYVAC6P5.js +37 -0
- package/dist/chunk-PTQJDMRT.js +146 -0
- package/dist/chunk-QWZG56ET.js +2744 -0
- package/dist/chunk-TSOKIX5Z.js +654 -0
- package/dist/chunk-VRW3FULF.js +725 -0
- package/dist/chunk-WZSPOOER.js +84 -0
- package/dist/chunk-YT6HQ6AM.js +14 -0
- package/dist/chunk-ZD6OAMTH.js +277 -0
- package/dist/contracts-DDrwxvJ-.d.cts +245 -0
- package/dist/contracts-DDrwxvJ-.d.ts +245 -0
- package/dist/data.cjs +35 -2
- package/dist/data.d.cts +7 -0
- package/dist/data.d.ts +7 -0
- package/dist/data.js +9 -8
- package/dist/devtools.cjs +122 -0
- package/dist/devtools.d.cts +69 -461
- package/dist/devtools.d.ts +69 -461
- package/dist/devtools.js +127 -6
- package/dist/ecosystem.cjs +23 -6
- package/dist/ecosystem.d.cts +1 -1
- package/dist/ecosystem.d.ts +1 -1
- package/dist/ecosystem.js +10 -9
- package/dist/extras.cjs +1207 -65
- package/dist/extras.d.cts +5 -5
- package/dist/extras.d.ts +5 -5
- package/dist/extras.js +69 -24
- package/dist/index.cjs +663 -144
- package/dist/index.d.cts +397 -17
- package/dist/index.d.ts +397 -17
- package/dist/index.js +39 -17
- package/dist/introspect-BumjnBKr.d.cts +477 -0
- package/dist/introspect-CZrlcaYy.d.ts +477 -0
- package/dist/introspect-Cb0zgpi2.d.cts +477 -0
- package/dist/introspect-Y2xNXGSf.d.ts +477 -0
- package/dist/motion.js +4 -4
- package/dist/patterns.cjs +51 -2
- package/dist/patterns.d.cts +18 -8
- package/dist/patterns.d.ts +18 -8
- package/dist/patterns.js +7 -7
- package/dist/performance.js +4 -4
- package/dist/plugins.cjs +428 -81
- package/dist/plugins.d.cts +27 -4
- package/dist/plugins.d.ts +27 -4
- package/dist/plugins.js +156 -37
- package/dist/ssr-4PBXAOO3.js +40 -0
- package/dist/ssr-Do_SiVoL.d.cts +201 -0
- package/dist/ssr-Do_SiVoL.d.ts +201 -0
- package/dist/ssr.cjs +312 -60
- package/dist/ssr.d.cts +10 -1
- package/dist/ssr.d.ts +10 -1
- package/dist/ssr.js +13 -10
- package/dist/tagFactory-DaJ0YWX6.d.cts +47 -0
- package/dist/tagFactory-DaJ0YWX6.d.ts +47 -0
- package/dist/testing.cjs +233 -2
- package/dist/testing.d.cts +42 -1
- package/dist/testing.d.ts +42 -1
- package/dist/testing.js +129 -2
- package/dist/ui.cjs +374 -3
- package/dist/ui.d.cts +252 -2
- package/dist/ui.d.ts +252 -2
- package/dist/ui.js +328 -8
- package/dist/widgets.js +7 -7
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -25,15 +25,10 @@ import { div, h1, button, signal, mount } from "sibujs";
|
|
|
25
25
|
function Counter() {
|
|
26
26
|
const [count, setCount] = signal(0);
|
|
27
27
|
|
|
28
|
-
return div({
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
nodes: "Increment",
|
|
33
|
-
on: { click: () => setCount(c => c + 1) }
|
|
34
|
-
})
|
|
35
|
-
]
|
|
36
|
-
});
|
|
28
|
+
return div({ class: "counter" }, [
|
|
29
|
+
h1(() => `Count: ${count()}`),
|
|
30
|
+
button({ on: { click: () => setCount(c => c + 1) } }, "Increment"),
|
|
31
|
+
]);
|
|
37
32
|
}
|
|
38
33
|
|
|
39
34
|
mount(Counter, document.getElementById("app"));
|
|
@@ -43,32 +38,41 @@ mount(Counter, document.getElementById("app"));
|
|
|
43
38
|
|
|
44
39
|
SibuJS gives you maximum flexibility with three interoperable styles:
|
|
45
40
|
|
|
46
|
-
#### 1. Tag Factory
|
|
47
|
-
|
|
41
|
+
#### 1. Tag Factory
|
|
42
|
+
The canonical form: a props object followed by children as a second
|
|
43
|
+
positional argument. No `nodes:` key required at any level of the tree —
|
|
44
|
+
children can be a string, a number, a single node, an array, or a
|
|
45
|
+
reactive getter.
|
|
48
46
|
|
|
49
47
|
```javascript
|
|
50
|
-
import { div, h1, button } from "sibujs";
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
48
|
+
import { div, h1, label, input, button } from "sibujs";
|
|
49
|
+
|
|
50
|
+
return div({ class: "counter" }, [
|
|
51
|
+
h1({ class: "title" }, () => `Count: ${count()}`),
|
|
52
|
+
label({ for: "amount" }, "Step"),
|
|
53
|
+
input({ id: "amount", type: "number", value: 1 }),
|
|
54
|
+
button(
|
|
55
|
+
{ class: "primary", on: { click: () => setCount(c => c + 1) } },
|
|
56
|
+
"Increment",
|
|
57
|
+
),
|
|
58
|
+
]);
|
|
61
59
|
```
|
|
62
60
|
|
|
63
|
-
|
|
64
|
-
|
|
61
|
+
All legacy forms — `tag({ class, nodes })`, `tag("className", children)`,
|
|
62
|
+
`tag("text")`, `tag([children])`, `tag(node)`, `tag(() => reactive)` —
|
|
63
|
+
continue to work unchanged. When both `props.nodes` and the positional
|
|
64
|
+
second argument are present, the positional wins.
|
|
65
|
+
|
|
66
|
+
#### 2. Positional Shorthand
|
|
67
|
+
The tersest form. Class and children as positional arguments, for
|
|
68
|
+
layouts with no event handlers or custom props.
|
|
65
69
|
|
|
66
70
|
```javascript
|
|
67
71
|
import { div, h1, button } from "sibujs";
|
|
68
72
|
|
|
69
73
|
return div("counter", [
|
|
70
74
|
h1(() => `Count: ${count()}`),
|
|
71
|
-
button({
|
|
75
|
+
button({ on: { click: () => setCount(c => c + 1) } }, "Increment"),
|
|
72
76
|
]);
|
|
73
77
|
```
|
|
74
78
|
|