sibujs 1.1.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.
Files changed (94) hide show
  1. package/README.md +29 -25
  2. package/dist/browser.cjs +804 -2
  3. package/dist/browser.d.cts +591 -1
  4. package/dist/browser.d.ts +591 -1
  5. package/dist/browser.js +50 -8
  6. package/dist/build.cjs +706 -161
  7. package/dist/build.js +21 -12
  8. package/dist/cdn.global.js +188 -7
  9. package/dist/chunk-2BYQDGN3.js +742 -0
  10. package/dist/chunk-32DY64NT.js +282 -0
  11. package/dist/chunk-3AIRKM3B.js +1263 -0
  12. package/dist/chunk-3X2YG6YM.js +505 -0
  13. package/dist/chunk-5X6PP2UK.js +28 -0
  14. package/dist/chunk-77L6NL3X.js +1097 -0
  15. package/dist/chunk-B7SWRFUT.js +332 -0
  16. package/dist/chunk-BGN5ZMP4.js +26 -0
  17. package/dist/chunk-BTU3TJDS.js +365 -0
  18. package/dist/chunk-CHF5OHIA.js +61 -0
  19. package/dist/chunk-CMBFNA7L.js +27 -0
  20. package/dist/chunk-DAHRH4ON.js +331 -0
  21. package/dist/chunk-EBGIRKQY.js +616 -0
  22. package/dist/chunk-EUZND3CB.js +27 -0
  23. package/dist/chunk-F3FA4F32.js +292 -0
  24. package/dist/chunk-GCOK2LC3.js +282 -0
  25. package/dist/chunk-JAKHTMQU.js +1000 -0
  26. package/dist/chunk-JCI5M6U6.js +956 -0
  27. package/dist/chunk-KQPDEVVS.js +398 -0
  28. package/dist/chunk-NEKUBFPT.js +60 -0
  29. package/dist/chunk-NYVAC6P5.js +37 -0
  30. package/dist/chunk-OUZZEE4S.js +365 -0
  31. package/dist/chunk-P6W3STU4.js +2249 -0
  32. package/dist/chunk-PTQJDMRT.js +146 -0
  33. package/dist/chunk-QWZG56ET.js +2744 -0
  34. package/dist/chunk-TSOKIX5Z.js +654 -0
  35. package/dist/chunk-VMVDTCXB.js +712 -0
  36. package/dist/chunk-VRW3FULF.js +725 -0
  37. package/dist/chunk-WZSPOOER.js +84 -0
  38. package/dist/chunk-YT6HQ6AM.js +14 -0
  39. package/dist/chunk-ZD6OAMTH.js +277 -0
  40. package/dist/contracts-DDrwxvJ-.d.cts +245 -0
  41. package/dist/contracts-DDrwxvJ-.d.ts +245 -0
  42. package/dist/data.cjs +35 -2
  43. package/dist/data.d.cts +7 -0
  44. package/dist/data.d.ts +7 -0
  45. package/dist/data.js +9 -8
  46. package/dist/devtools.cjs +122 -0
  47. package/dist/devtools.d.cts +69 -461
  48. package/dist/devtools.d.ts +69 -461
  49. package/dist/devtools.js +127 -6
  50. package/dist/ecosystem.cjs +68 -23
  51. package/dist/ecosystem.d.cts +1 -1
  52. package/dist/ecosystem.d.ts +1 -1
  53. package/dist/ecosystem.js +10 -9
  54. package/dist/extras.cjs +1252 -82
  55. package/dist/extras.d.cts +5 -5
  56. package/dist/extras.d.ts +5 -5
  57. package/dist/extras.js +69 -24
  58. package/dist/index.cjs +708 -161
  59. package/dist/index.d.cts +397 -17
  60. package/dist/index.d.ts +397 -17
  61. package/dist/index.js +39 -17
  62. package/dist/introspect-BumjnBKr.d.cts +477 -0
  63. package/dist/introspect-CZrlcaYy.d.ts +477 -0
  64. package/dist/introspect-Cb0zgpi2.d.cts +477 -0
  65. package/dist/introspect-Y2xNXGSf.d.ts +477 -0
  66. package/dist/motion.js +4 -4
  67. package/dist/patterns.cjs +51 -2
  68. package/dist/patterns.d.cts +18 -8
  69. package/dist/patterns.d.ts +18 -8
  70. package/dist/patterns.js +7 -7
  71. package/dist/performance.js +4 -4
  72. package/dist/plugins.cjs +473 -98
  73. package/dist/plugins.d.cts +27 -4
  74. package/dist/plugins.d.ts +27 -4
  75. package/dist/plugins.js +156 -37
  76. package/dist/ssr-4PBXAOO3.js +40 -0
  77. package/dist/ssr-Do_SiVoL.d.cts +201 -0
  78. package/dist/ssr-Do_SiVoL.d.ts +201 -0
  79. package/dist/ssr.cjs +357 -77
  80. package/dist/ssr.d.cts +10 -1
  81. package/dist/ssr.d.ts +10 -1
  82. package/dist/ssr.js +13 -10
  83. package/dist/tagFactory-DaJ0YWX6.d.cts +47 -0
  84. package/dist/tagFactory-DaJ0YWX6.d.ts +47 -0
  85. package/dist/testing.cjs +233 -2
  86. package/dist/testing.d.cts +42 -1
  87. package/dist/testing.d.ts +42 -1
  88. package/dist/testing.js +129 -2
  89. package/dist/ui.cjs +374 -3
  90. package/dist/ui.d.cts +252 -2
  91. package/dist/ui.d.ts +252 -2
  92. package/dist/ui.js +328 -8
  93. package/dist/widgets.js +7 -7
  94. 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
- nodes: [
30
- h1({ nodes: () => `Count: ${count()}` }),
31
- button({
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 (Full Props)
47
- Maximum control with an explicit properties object. Perfect for complex elements.
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
- const [count, setCount] = signal(0);
53
-
54
- return div({
55
- class: "counter",
56
- nodes: [
57
- h1({ nodes: () => `Count: ${count()}` }),
58
- button({ nodes: "Increment", on: { click: () => setCount(c => c + 1) } })
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
- #### 2. Shorthand API
64
- Concise and readable for common layouts. Class and children passed as positional arguments.
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({ nodes: "Increment", on: { click: () => setCount(c => c + 1) } })
75
+ button({ on: { click: () => setCount(c => c + 1) } }, "Increment"),
72
76
  ]);
73
77
  ```
74
78