sibujs 4.13.1 → 4.14.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.
Files changed (107) hide show
  1. package/README.md +1 -1
  2. package/dist/browser.cjs +15 -2
  3. package/dist/browser.js +9 -7
  4. package/dist/build.cjs +880 -281
  5. package/dist/build.d.cts +68 -3
  6. package/dist/build.d.ts +68 -3
  7. package/dist/build.js +88 -30
  8. package/dist/cdn.dev.global.js +12 -12
  9. package/dist/cdn.full.dev.global.js +13 -13
  10. package/dist/cdn.full.global.js +12 -12
  11. package/dist/cdn.global.js +12 -12
  12. package/dist/{chunk-J6FW5TV6.js → chunk-3HEX6QJQ.js} +5 -3
  13. package/dist/chunk-3HZOSMPX.js +90 -0
  14. package/dist/{chunk-K4LNUT5L.js → chunk-3T7TWMSD.js} +8 -6
  15. package/dist/{chunk-ADZHPN2B.js → chunk-4XCWNGRY.js} +3 -3
  16. package/dist/{chunk-2NC56RGY.js → chunk-55TAOW5M.js} +2 -2
  17. package/dist/{chunk-G3Z2FEBR.js → chunk-B2NLNZ3E.js} +119 -26
  18. package/dist/{chunk-EXXSN3BW.js → chunk-B3HOT4TK.js} +1 -1
  19. package/dist/{chunk-QKFVMIAV.js → chunk-FCWOMATN.js} +11 -3
  20. package/dist/{chunk-QC3NP47A.js → chunk-FFXZ6ELZ.js} +10 -6
  21. package/dist/{chunk-TUCPL2HB.js → chunk-GIJ33UJZ.js} +1 -1
  22. package/dist/chunk-KTJC7QPA.js +195 -0
  23. package/dist/chunk-L2IPKGUJ.js +2596 -0
  24. package/dist/{chunk-4UTGDVSA.js → chunk-LAHX7XFG.js} +7 -14
  25. package/dist/{chunk-PBJYCE2Z.js → chunk-LJ2LR5P4.js} +5 -5
  26. package/dist/{chunk-AM6DZLBM.js → chunk-LJMX4SQ7.js} +2 -2
  27. package/dist/{chunk-5RIBLY2N.js → chunk-LUZXFMKH.js} +6 -6
  28. package/dist/{chunk-VFPLWUT7.js → chunk-LZKKMDQF.js} +151 -86
  29. package/dist/{chunk-J4X7ICH4.js → chunk-NIHGSXOX.js} +8 -6
  30. package/dist/chunk-NT3ZYB5S.js +167 -0
  31. package/dist/{chunk-2O6JJCUR.js → chunk-OLMZF4RU.js} +49 -8
  32. package/dist/{chunk-22OPSWMF.js → chunk-OPRQW4LI.js} +2 -2
  33. package/dist/chunk-R5U7XKVJ.js +16 -0
  34. package/dist/{chunk-KC62VURU.js → chunk-RBRITLFL.js} +10 -8
  35. package/dist/{chunk-F2UWOZ6J.js → chunk-RVWJGWCL.js} +2 -2
  36. package/dist/{chunk-NYNYSPK7.js → chunk-S37PZD6I.js} +30 -45
  37. package/dist/chunk-TOV4PN3P.js +2015 -0
  38. package/dist/{chunk-C73VBPEF.js → chunk-TS6JDK7Y.js} +8 -8
  39. package/dist/{chunk-EU7T7EB3.js → chunk-TZNR6E6D.js} +4 -4
  40. package/dist/chunk-UYTYNCMZ.js +199 -0
  41. package/dist/{chunk-OIKD7YDY.js → chunk-VIAVYBNQ.js} +6 -5
  42. package/dist/{chunk-QZ47OZ25.js → chunk-WFMMSMA5.js} +8 -6
  43. package/dist/chunk-YIXMS546.js +1901 -0
  44. package/dist/{chunk-5XUGJM3J.js → chunk-YPLQQTWS.js} +1 -1
  45. package/dist/{chunk-CPQKWCJ2.js → chunk-ZKI4SDZ2.js} +16 -10
  46. package/dist/{chunk-YFTBCCVH.js → chunk-ZYK4NZZA.js} +5 -3
  47. package/dist/data.cjs +265 -35
  48. package/dist/data.d.cts +31 -1
  49. package/dist/data.d.ts +31 -1
  50. package/dist/data.js +16 -10
  51. package/dist/devtools.cjs +15 -2
  52. package/dist/devtools.js +9 -7
  53. package/dist/{dispose-GEIG2KOF.js → dispose-EIHHHDC7.js} +3 -1
  54. package/dist/ecosystem.cjs +62 -23
  55. package/dist/ecosystem.js +14 -12
  56. package/dist/extras.cjs +3562 -270
  57. package/dist/extras.d.cts +3 -3
  58. package/dist/extras.d.ts +3 -3
  59. package/dist/extras.js +39 -29
  60. package/dist/index.cjs +442 -253
  61. package/dist/index.d.cts +93 -283
  62. package/dist/index.d.ts +93 -283
  63. package/dist/index.js +26 -16
  64. package/dist/motion.cjs +12 -1
  65. package/dist/motion.js +6 -4
  66. package/dist/patterns.cjs +15 -2
  67. package/dist/patterns.js +10 -8
  68. package/dist/performance.cjs +36 -2
  69. package/dist/performance.d.cts +2 -2
  70. package/dist/performance.d.ts +2 -2
  71. package/dist/performance.js +14 -10
  72. package/dist/plugins.cjs +5267 -1807
  73. package/dist/plugins.d.cts +8 -834
  74. package/dist/plugins.d.ts +8 -834
  75. package/dist/plugins.js +64 -2329
  76. package/dist/prerenderServer-MXJEVWA3.js +350 -0
  77. package/dist/renderRoute-DP20XwMS.d.cts +86 -0
  78. package/dist/renderRoute-fxgsm2Ir.d.ts +86 -0
  79. package/dist/routeHead-CE9SV-cH.d.cts +995 -0
  80. package/dist/routeHead-DzVxPviY.d.ts +995 -0
  81. package/dist/{routeMiddleware-B1sp4P7a.d.ts → routeMiddleware-BySbueoE.d.ts} +0 -25
  82. package/dist/{routeMiddleware-CedQTsLK.d.cts → routeMiddleware-CijZD5eW.d.cts} +0 -25
  83. package/dist/{ssr-VBM6J5SJ.js → ssr-HHU3DAD2.js} +15 -6
  84. package/dist/ssr-JpGpHnpC.d.cts +841 -0
  85. package/dist/ssr-JpGpHnpC.d.ts +841 -0
  86. package/dist/ssr-dom.cjs +1904 -0
  87. package/dist/ssr-dom.d.cts +343 -0
  88. package/dist/ssr-dom.d.ts +343 -0
  89. package/dist/ssr-dom.js +19 -0
  90. package/dist/ssr.cjs +7677 -2069
  91. package/dist/ssr.d.cts +63 -5
  92. package/dist/ssr.d.ts +63 -5
  93. package/dist/ssr.js +136 -14
  94. package/dist/testing.cjs +6585 -87
  95. package/dist/testing.d.cts +80 -1
  96. package/dist/testing.d.ts +80 -1
  97. package/dist/testing.js +117 -4
  98. package/dist/ui.cjs +36 -2
  99. package/dist/ui.js +17 -14
  100. package/dist/widgets.cjs +14 -1
  101. package/dist/widgets.js +11 -9
  102. package/package.json +9 -2
  103. package/dist/chunk-2F4PSJ5Z.js +0 -765
  104. package/dist/chunk-7XHATCIH.js +0 -121
  105. package/dist/chunk-B36ADEIR.js +0 -21
  106. package/dist/ssr-Db0Sgdu3.d.cts +0 -245
  107. package/dist/ssr-Db0Sgdu3.d.ts +0 -245
@@ -3,34 +3,34 @@ import {
3
3
  } from "./chunk-N5TBYXHW.js";
4
4
  import {
5
5
  domBinding
6
- } from "./chunk-22OPSWMF.js";
6
+ } from "./chunk-OPRQW4LI.js";
7
7
  import {
8
8
  bindAttribute,
9
9
  setSafeAttribute
10
- } from "./chunk-K4LNUT5L.js";
10
+ } from "./chunk-3T7TWMSD.js";
11
11
  import {
12
12
  isBlockedElement
13
- } from "./chunk-F2UWOZ6J.js";
13
+ } from "./chunk-RVWJGWCL.js";
14
14
  import {
15
15
  derived
16
- } from "./chunk-YFTBCCVH.js";
16
+ } from "./chunk-ZYK4NZZA.js";
17
17
  import {
18
18
  globalSingleton
19
19
  } from "./chunk-7ZHH77QA.js";
20
20
  import {
21
21
  isEventHandlerAttr,
22
22
  sanitizeStylesheetText
23
- } from "./chunk-EXXSN3BW.js";
23
+ } from "./chunk-B3HOT4TK.js";
24
24
  import {
25
25
  adoptThenable
26
26
  } from "./chunk-5HZXGZ6T.js";
27
27
  import {
28
28
  signal
29
- } from "./chunk-QKFVMIAV.js";
29
+ } from "./chunk-FCWOMATN.js";
30
30
  import {
31
31
  reactiveBinding,
32
32
  track
33
- } from "./chunk-4UTGDVSA.js";
33
+ } from "./chunk-LAHX7XFG.js";
34
34
  import {
35
35
  dispose,
36
36
  disposeNodeOwn,
@@ -39,7 +39,7 @@ import {
39
39
  reportError,
40
40
  unregisterDisposer,
41
41
  withDisposerRollback
42
- } from "./chunk-NYNYSPK7.js";
42
+ } from "./chunk-S37PZD6I.js";
43
43
 
44
44
  // src/ui/form.ts
45
45
  function required(message = "This field is required") {
@@ -9,17 +9,17 @@ import {
9
9
  } from "./chunk-7ZHH77QA.js";
10
10
  import {
11
11
  effect
12
- } from "./chunk-QC3NP47A.js";
12
+ } from "./chunk-FFXZ6ELZ.js";
13
13
  import {
14
14
  sanitizeUrl
15
- } from "./chunk-EXXSN3BW.js";
15
+ } from "./chunk-B3HOT4TK.js";
16
16
  import {
17
17
  batch,
18
18
  signal
19
- } from "./chunk-QKFVMIAV.js";
19
+ } from "./chunk-FCWOMATN.js";
20
20
  import {
21
21
  reportError
22
- } from "./chunk-NYNYSPK7.js";
22
+ } from "./chunk-S37PZD6I.js";
23
23
 
24
24
  // src/browser/media.ts
25
25
  function media(query) {
@@ -0,0 +1,199 @@
1
+ import {
2
+ devWarn,
3
+ holdHydration,
4
+ hydrationOwners
5
+ } from "./chunk-NT3ZYB5S.js";
6
+ import {
7
+ __require
8
+ } from "./chunk-R5U7XKVJ.js";
9
+
10
+ // src/core/rendering/streamBoundary.ts
11
+ var _a;
12
+ var slot = globalThis[_a = /* @__PURE__ */ Symbol.for("sibujs.streamBoundary.v1")] ?? (globalThis[_a] = { hook: null, current: null });
13
+ function openBoundary(container) {
14
+ return slot.hook ? slot.hook(container) : null;
15
+ }
16
+ function currentBoundary() {
17
+ return slot.current;
18
+ }
19
+ function runInBoundary(boundary, fn) {
20
+ const prev = slot.current;
21
+ slot.current = boundary;
22
+ try {
23
+ return fn();
24
+ } finally {
25
+ slot.current = prev;
26
+ }
27
+ }
28
+ function setBoundaryHook(hook) {
29
+ slot.hook = hook;
30
+ }
31
+
32
+ // src/core/ssr-context.ts
33
+ var SSR_KEY = /* @__PURE__ */ Symbol.for("sibujs.ssr.v1");
34
+ function detectSSRShared() {
35
+ let detected = null;
36
+ try {
37
+ if (typeof process !== "undefined" && process.versions && process.versions.node) {
38
+ let mod = null;
39
+ const getBuiltin = process.getBuiltinModule;
40
+ if (typeof getBuiltin === "function") {
41
+ mod = getBuiltin("node:async_hooks");
42
+ } else if (typeof __require === "function") {
43
+ mod = __require("async_hooks");
44
+ }
45
+ if (mod) detected = new mod.AsyncLocalStorage();
46
+ }
47
+ const globalAls = globalThis.AsyncLocalStorage;
48
+ if (!detected && typeof globalAls === "function") detected = new globalAls();
49
+ } catch {
50
+ detected = null;
51
+ }
52
+ return {
53
+ als: detected,
54
+ fallbackStore: { ssr: false, suspenseIdCounter: 0, locale: void 0 },
55
+ fallbackDepth: 0
56
+ };
57
+ }
58
+ var _shared = globalThis[SSR_KEY] ?? (globalThis[SSR_KEY] = detectSSRShared());
59
+ var als = _shared.als;
60
+ var fallbackStore = _shared.fallbackStore;
61
+ _shared.fallbackDepth ?? (_shared.fallbackDepth = 0);
62
+ var _alsWarned = false;
63
+ function warnMissingAsyncLocalStorage() {
64
+ if (_alsWarned || als) return;
65
+ const isNode = typeof process !== "undefined" && !!process.versions?.node;
66
+ if (!isNode) return;
67
+ _alsWarned = true;
68
+ const version = process.versions.node;
69
+ devWarn(
70
+ `SSR request isolation is UNAVAILABLE on this runtime (Node ${version}). AsyncLocalStorage could not be loaded, so concurrent requests share one SSR store: request state and the query cache can bleed between them. Node >= 22.3 is required for isolated SSR under ESM; the CommonJS build works on older versions. A fully synchronous render is unaffected.`
71
+ );
72
+ }
73
+ function assertRequestIsolation(api) {
74
+ if (als || typeof window !== "undefined") return;
75
+ throw new Error(
76
+ `[SibuJS SSR] ${api} needs AsyncLocalStorage to keep concurrent requests apart, and this runtime has none. Use Node >= 22.3 (or the CommonJS build on older Node), Deno or Bun, or enable AsyncLocalStorage on your edge runtime (Cloudflare Workers: the nodejs_compat flag).`
77
+ );
78
+ }
79
+ function getSSRStore() {
80
+ if (als) {
81
+ const s = als.getStore();
82
+ if (s) return s;
83
+ }
84
+ return fallbackStore;
85
+ }
86
+ function getRequestStore() {
87
+ if (als) return als.getStore() ?? null;
88
+ return _shared.fallbackDepth > 0 ? fallbackStore : null;
89
+ }
90
+ function isSSR() {
91
+ return getSSRStore().ssr;
92
+ }
93
+ function getRequestScopedCache(name) {
94
+ if (!isSSR()) return null;
95
+ const store = getSSRStore();
96
+ const caches = store.caches ?? (store.caches = /* @__PURE__ */ new Map());
97
+ let c = caches.get(name);
98
+ if (!c) {
99
+ c = /* @__PURE__ */ new Map();
100
+ caches.set(name, c);
101
+ }
102
+ return c;
103
+ }
104
+ function requestSlot(name, create) {
105
+ const store = getRequestStore();
106
+ if (!store) return void 0;
107
+ const slots = store.slots ?? (store.slots = /* @__PURE__ */ new Map());
108
+ if (!slots.has(name) && create) slots.set(name, create());
109
+ return slots.get(name);
110
+ }
111
+ var PRERENDER_HOST = /* @__PURE__ */ Symbol.for("sibujs.prerender.v1");
112
+ function isServer() {
113
+ return getSSRStore().ssr || globalThis[PRERENDER_HOST] !== void 0;
114
+ }
115
+ function isClient() {
116
+ return !isServer();
117
+ }
118
+ function enableSSR() {
119
+ getSSRStore().ssr = true;
120
+ }
121
+ function disableSSR() {
122
+ getSSRStore().ssr = false;
123
+ }
124
+ function runInSSRContext(fn) {
125
+ const store = {
126
+ ssr: true,
127
+ suspenseIdCounter: 0,
128
+ idCounter: 0,
129
+ locale: void 0,
130
+ pending: /* @__PURE__ */ new Set(),
131
+ wake: null
132
+ };
133
+ if (als) {
134
+ return als.run(store, fn);
135
+ }
136
+ warnMissingAsyncLocalStorage();
137
+ const prev = { ...fallbackStore };
138
+ Object.assign(fallbackStore, store);
139
+ _shared.fallbackDepth++;
140
+ try {
141
+ return fn();
142
+ } finally {
143
+ _shared.fallbackDepth--;
144
+ for (const key of Object.keys(fallbackStore)) {
145
+ if (!(key in prev)) delete fallbackStore[key];
146
+ }
147
+ Object.assign(fallbackStore, prev);
148
+ }
149
+ }
150
+ function trackPending(promise, label, hydration = true) {
151
+ const store = getRequestStore();
152
+ const pending = store?.pending;
153
+ const sessions = pending || !hydration ? [] : hydrationOwners();
154
+ if (!pending && sessions.length === 0) return promise;
155
+ const entry = { label, since: Date.now(), boundary: currentBoundary() ?? void 0 };
156
+ pending?.add(entry);
157
+ const release = holdHydration(sessions, entry);
158
+ const done = () => {
159
+ pending?.delete(entry);
160
+ store?.wake?.();
161
+ release();
162
+ };
163
+ try {
164
+ Promise.resolve(promise).then(done, done);
165
+ } catch {
166
+ done();
167
+ }
168
+ return promise;
169
+ }
170
+ function withSSR(fn) {
171
+ const store = getSSRStore();
172
+ const wasSSR = store.ssr;
173
+ store.ssr = true;
174
+ try {
175
+ return fn();
176
+ } finally {
177
+ if (!wasSSR) store.ssr = false;
178
+ }
179
+ }
180
+
181
+ export {
182
+ openBoundary,
183
+ currentBoundary,
184
+ runInBoundary,
185
+ setBoundaryHook,
186
+ assertRequestIsolation,
187
+ getSSRStore,
188
+ getRequestStore,
189
+ isSSR,
190
+ getRequestScopedCache,
191
+ requestSlot,
192
+ isServer,
193
+ isClient,
194
+ enableSSR,
195
+ disableSSR,
196
+ runInSSRContext,
197
+ trackPending,
198
+ withSSR
199
+ };
@@ -1,15 +1,15 @@
1
1
  import {
2
2
  renderToString
3
- } from "./chunk-2F4PSJ5Z.js";
3
+ } from "./chunk-TOV4PN3P.js";
4
4
  import {
5
5
  globalSingleton
6
6
  } from "./chunk-7ZHH77QA.js";
7
7
  import {
8
8
  sanitizeUrl
9
- } from "./chunk-EXXSN3BW.js";
9
+ } from "./chunk-B3HOT4TK.js";
10
10
  import {
11
11
  reportError
12
- } from "./chunk-NYNYSPK7.js";
12
+ } from "./chunk-S37PZD6I.js";
13
13
 
14
14
  // src/plugins/modular.ts
15
15
  function createModuleRegistry() {
@@ -154,6 +154,7 @@ var MODULE_ENTRY_POINTS = {
154
154
  ui: "./ui.ts",
155
155
  widgets: "./widgets.ts",
156
156
  ssr: "./ssr.ts",
157
+ "ssr/dom": "./ssr-dom.ts",
157
158
  devtools: "./devtools.ts",
158
159
  performance: "./performance.ts",
159
160
  ecosystem: "./ecosystem.ts",
@@ -170,7 +171,7 @@ var CDN_ENTRY_POINTS = {
170
171
  };
171
172
  var packageInfo = {
172
173
  name: "sibujs",
173
- version: true ? "4.13.1" : "dev",
174
+ version: true ? "4.14.1" : "dev",
174
175
  entryPoints: MODULE_ENTRY_POINTS,
175
176
  /**
176
177
  * Generate the package.json `exports` map. Module entries resolve to the
@@ -315,7 +316,7 @@ var env = {
315
316
  };
316
317
 
317
318
  // src/plugins/versioning.ts
318
- var VERSION = true ? "4.13.1" : "dev";
319
+ var VERSION = true ? "4.14.1" : "dev";
319
320
  var NUM = "(?:0|[1-9]\\d*)";
320
321
  var PRE_ID = `(?:${NUM}|\\d*[a-zA-Z-][0-9a-zA-Z-]*)`;
321
322
  var BUILD_ID = "[0-9a-zA-Z-]+";
@@ -4,19 +4,21 @@ import {
4
4
  } from "./chunk-62BDYGAG.js";
5
5
  import {
6
6
  derived
7
- } from "./chunk-YFTBCCVH.js";
7
+ } from "./chunk-ZYK4NZZA.js";
8
8
  import {
9
9
  effect
10
- } from "./chunk-QC3NP47A.js";
10
+ } from "./chunk-FFXZ6ELZ.js";
11
11
  import {
12
12
  batch,
13
13
  signal
14
- } from "./chunk-QKFVMIAV.js";
14
+ } from "./chunk-FCWOMATN.js";
15
15
  import {
16
- DEV,
17
- devWarn,
18
16
  reportError
19
- } from "./chunk-NYNYSPK7.js";
17
+ } from "./chunk-S37PZD6I.js";
18
+ import {
19
+ DEV,
20
+ devWarn
21
+ } from "./chunk-NT3ZYB5S.js";
20
22
 
21
23
  // src/patterns/machine.ts
22
24
  function ownEntry(table, key) {