sibujs 4.7.0 → 4.8.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 (81) hide show
  1. package/dist/browser.cjs +45 -4
  2. package/dist/browser.d.cts +23 -0
  3. package/dist/browser.d.ts +23 -0
  4. package/dist/browser.js +6 -5
  5. package/dist/build.cjs +513 -78
  6. package/dist/build.d.cts +22 -8
  7. package/dist/build.d.ts +22 -8
  8. package/dist/build.js +68 -21
  9. package/dist/cdn.dev.global.js +15 -13
  10. package/dist/cdn.full.dev.global.js +15 -13
  11. package/dist/cdn.full.global.js +14 -12
  12. package/dist/cdn.global.js +14 -12
  13. package/dist/chunk-3ACAAQIN.js +224 -0
  14. package/dist/{chunk-DKXRACVN.js → chunk-44MTL7ED.js} +6 -6
  15. package/dist/{chunk-3QWBSL5R.js → chunk-4WMSTZ7J.js} +8 -5
  16. package/dist/{chunk-H3SRKIYX.js → chunk-62BDYGAG.js} +8 -0
  17. package/dist/{chunk-BSY63EM6.js → chunk-C5PEWEGH.js} +20 -5
  18. package/dist/{chunk-BC2SECJD.js → chunk-C7AA2CZX.js} +1 -1
  19. package/dist/{chunk-SLM3IA34.js → chunk-CZPRSWSS.js} +1 -1
  20. package/dist/{chunk-FQRUXCEE.js → chunk-DSID757X.js} +1 -1
  21. package/dist/{chunk-ZVL7TY4K.js → chunk-EGUQLBHE.js} +22 -8
  22. package/dist/{chunk-2INLLLMZ.js → chunk-EXXSN3BW.js} +202 -26
  23. package/dist/{chunk-HURREPU2.js → chunk-FC6KCJSA.js} +87 -150
  24. package/dist/{chunk-Z3OHK6QT.js → chunk-GSGNX35Q.js} +5 -5
  25. package/dist/{chunk-XYV3EDB7.js → chunk-J3YQ457H.js} +37 -20
  26. package/dist/{chunk-VZSG24LS.js → chunk-JUTFX2RM.js} +18 -10
  27. package/dist/{chunk-RUSSKG6G.js → chunk-KJ3UKABJ.js} +1 -1
  28. package/dist/{chunk-UNWRJRKC.js → chunk-LI4W3U6C.js} +1 -1
  29. package/dist/{chunk-FNJXNGYZ.js → chunk-O6TRVMJI.js} +58 -6
  30. package/dist/{chunk-7LUJQAOJ.js → chunk-Q5J2LVKH.js} +1 -1
  31. package/dist/{chunk-4AWA2PVD.js → chunk-QGMSESDD.js} +10 -5
  32. package/dist/{chunk-XZR4PXRE.js → chunk-RGLPEBDE.js} +13 -10
  33. package/dist/{chunk-JWKYU5GV.js → chunk-TQQUN4WR.js} +1 -1
  34. package/dist/{chunk-WOLJZUFQ.js → chunk-UCNP3HVM.js} +12 -8
  35. package/dist/{chunk-WEQ3DMVL.js → chunk-V3LHZSU5.js} +1 -1
  36. package/dist/{chunk-UOL2ECCS.js → chunk-VWT3VXPL.js} +18 -12
  37. package/dist/{chunk-2BPG2XDA.js → chunk-ZVLHNEEL.js} +17 -35
  38. package/dist/{customElement-MmInOW1U.d.ts → customElement-pYDKUzWl.d.cts} +11 -3
  39. package/dist/{customElement-MmInOW1U.d.cts → customElement-pYDKUzWl.d.ts} +11 -3
  40. package/dist/data.cjs +9 -2
  41. package/dist/data.js +6 -6
  42. package/dist/devtools.cjs +1 -1
  43. package/dist/devtools.js +5 -5
  44. package/dist/ecosystem.cjs +400 -37
  45. package/dist/ecosystem.js +9 -8
  46. package/dist/extras.cjs +621 -252
  47. package/dist/extras.d.cts +2 -2
  48. package/dist/extras.d.ts +2 -2
  49. package/dist/extras.js +24 -23
  50. package/dist/index.cjs +464 -70
  51. package/dist/index.d.cts +28 -2
  52. package/dist/index.d.ts +28 -2
  53. package/dist/index.js +16 -12
  54. package/dist/motion.cjs +1 -1
  55. package/dist/motion.js +3 -3
  56. package/dist/patterns.cjs +10 -7
  57. package/dist/patterns.js +6 -6
  58. package/dist/performance.cjs +31 -2
  59. package/dist/performance.d.cts +12 -2
  60. package/dist/performance.d.ts +12 -2
  61. package/dist/performance.js +8 -6
  62. package/dist/plugins.cjs +558 -231
  63. package/dist/plugins.d.cts +8 -3
  64. package/dist/plugins.d.ts +8 -3
  65. package/dist/plugins.js +22 -28
  66. package/dist/{ssr-XOTUASDO.js → ssr-5OWAH3U2.js} +4 -2
  67. package/dist/{ssr-Bli9XRW5.d.ts → ssr-C8hgIAw7.d.cts} +6 -0
  68. package/dist/{ssr-Bli9XRW5.d.cts → ssr-C8hgIAw7.d.ts} +6 -0
  69. package/dist/ssr.cjs +457 -131
  70. package/dist/ssr.d.cts +55 -5
  71. package/dist/ssr.d.ts +55 -5
  72. package/dist/ssr.js +11 -9
  73. package/dist/testing.cjs +3 -3
  74. package/dist/testing.js +4 -4
  75. package/dist/ui.cjs +608 -240
  76. package/dist/ui.d.cts +1 -1
  77. package/dist/ui.d.ts +1 -1
  78. package/dist/ui.js +9 -8
  79. package/dist/widgets.cjs +1 -1
  80. package/dist/widgets.js +7 -7
  81. package/package.json +5 -4
@@ -1,6 +1,6 @@
1
1
  import { A as Accessor } from './signal-EotCj4hS.cjs';
2
- import { N as NodeChildren } from './types-CJFViL6Q.cjs';
3
- import { T as TrustedHTML } from './ssr-Bli9XRW5.cjs';
2
+ import { C as Component$1, N as NodeChildren } from './types-CJFViL6Q.cjs';
3
+ import { T as TrustedHTML } from './ssr-C8hgIAw7.cjs';
4
4
  export { P as PluginContext, a as PluginInstallCancelledError, b as PluginRegistry, S as SibuPlugin, c as createPlugin, d as createPluginRegistry, i as inject, e as isPluginInstallCancelledError, p as plugin, r as resetPlugins, s as setDefaultPluginRegistry, t as triggerPluginError, f as triggerPluginMount, g as triggerPluginUnmount } from './plugin-DVgSnTfK.cjs';
5
5
  export { L as LazyModule, M as Migration, a as MigrationStorageError, P as PackageExportTarget, S as SemVer, V as VERSION, b as bundlerMetadata, c as checkCompatibility, d as compareSemVer, e as createBootSequence, f as createBundle, g as createMigrationRunner, h as createModuleRegistry, i as createSSRCache, j as createTestHarness, k as deferNonCritical, l as env, m as healthCheck, n as lazyModule, p as packageInfo, o as parseSemVer, q as preloadCritical, r as prerenderRoutes, s as satisfies } from './startup-BLfSeL15.cjs';
6
6
 
@@ -166,7 +166,12 @@ declare function hasTranslation(key: string): boolean;
166
166
  */
167
167
  declare function getAvailableLocales(): string[];
168
168
 
169
- type Component = () => Element;
169
+ /**
170
+ * A route component. An alias of the public `Component` (props-less, any
171
+ * `Element` root), kept under this name so existing imports of the router's
172
+ * `Component` continue to work.
173
+ */
174
+ type Component = Component$1<void, Element>;
170
175
  type AsyncComponent = () => Promise<Element>;
171
176
  type LazyComponent = () => Promise<{
172
177
  default: Component;
package/dist/plugins.d.ts CHANGED
@@ -1,6 +1,6 @@
1
1
  import { A as Accessor } from './signal-EotCj4hS.js';
2
- import { N as NodeChildren } from './types-CJFViL6Q.js';
3
- import { T as TrustedHTML } from './ssr-Bli9XRW5.js';
2
+ import { C as Component$1, N as NodeChildren } from './types-CJFViL6Q.js';
3
+ import { T as TrustedHTML } from './ssr-C8hgIAw7.js';
4
4
  export { P as PluginContext, a as PluginInstallCancelledError, b as PluginRegistry, S as SibuPlugin, c as createPlugin, d as createPluginRegistry, i as inject, e as isPluginInstallCancelledError, p as plugin, r as resetPlugins, s as setDefaultPluginRegistry, t as triggerPluginError, f as triggerPluginMount, g as triggerPluginUnmount } from './plugin-DVgSnTfK.js';
5
5
  export { L as LazyModule, M as Migration, a as MigrationStorageError, P as PackageExportTarget, S as SemVer, V as VERSION, b as bundlerMetadata, c as checkCompatibility, d as compareSemVer, e as createBootSequence, f as createBundle, g as createMigrationRunner, h as createModuleRegistry, i as createSSRCache, j as createTestHarness, k as deferNonCritical, l as env, m as healthCheck, n as lazyModule, p as packageInfo, o as parseSemVer, q as preloadCritical, r as prerenderRoutes, s as satisfies } from './startup-BLfSeL15.js';
6
6
 
@@ -166,7 +166,12 @@ declare function hasTranslation(key: string): boolean;
166
166
  */
167
167
  declare function getAvailableLocales(): string[];
168
168
 
169
- type Component = () => Element;
169
+ /**
170
+ * A route component. An alias of the public `Component` (props-less, any
171
+ * `Element` root), kept under this name so existing imports of the router's
172
+ * `Component` continue to work.
173
+ */
174
+ type Component = Component$1<void, Element>;
170
175
  type AsyncComponent = () => Promise<Element>;
171
176
  type LazyComponent = () => Promise<{
172
177
  default: Component;
package/dist/plugins.js CHANGED
@@ -19,10 +19,7 @@ import {
19
19
  preloadCritical,
20
20
  prerenderRoutes,
21
21
  satisfies
22
- } from "./chunk-4AWA2PVD.js";
23
- import {
24
- isUnsafeKey
25
- } from "./chunk-H3SRKIYX.js";
22
+ } from "./chunk-QGMSESDD.js";
26
23
  import {
27
24
  PluginInstallCancelledError,
28
25
  createPlugin,
@@ -38,40 +35,45 @@ import {
38
35
  } from "./chunk-J6FW5TV6.js";
39
36
  import {
40
37
  span
41
- } from "./chunk-7LUJQAOJ.js";
38
+ } from "./chunk-Q5J2LVKH.js";
42
39
  import {
43
40
  escapeScriptJson,
44
41
  renderToString,
45
42
  serializeHeadEntry
46
- } from "./chunk-HURREPU2.js";
43
+ } from "./chunk-FC6KCJSA.js";
44
+ import {
45
+ isUnsafeKey,
46
+ readOwnGlobal
47
+ } from "./chunk-62BDYGAG.js";
47
48
  import {
48
49
  appendChildren,
49
50
  resolveClassValue
50
- } from "./chunk-UOL2ECCS.js";
51
- import "./chunk-FNJXNGYZ.js";
51
+ } from "./chunk-VWT3VXPL.js";
52
52
  import {
53
- isUrlAttribute,
54
- sanitizeStyleAttribute,
55
- sanitizeUrl,
56
- stripControlChars
57
- } from "./chunk-2INLLLMZ.js";
53
+ setSafeAttribute
54
+ } from "./chunk-O6TRVMJI.js";
55
+ import "./chunk-3ACAAQIN.js";
58
56
  import {
59
57
  globalSingleton
60
58
  } from "./chunk-7ZHH77QA.js";
61
59
  import {
62
60
  effect
63
- } from "./chunk-WEQ3DMVL.js";
61
+ } from "./chunk-V3LHZSU5.js";
62
+ import {
63
+ sanitizeUrl,
64
+ stripControlChars
65
+ } from "./chunk-EXXSN3BW.js";
64
66
  import {
65
67
  getRequestStore
66
68
  } from "./chunk-7XHATCIH.js";
67
69
  import "./chunk-5HZXGZ6T.js";
68
70
  import {
69
71
  signal
70
- } from "./chunk-FQRUXCEE.js";
72
+ } from "./chunk-DSID757X.js";
71
73
  import {
72
74
  track,
73
75
  untracked
74
- } from "./chunk-JWKYU5GV.js";
76
+ } from "./chunk-TQQUN4WR.js";
75
77
  import {
76
78
  devWarn,
77
79
  dispose,
@@ -116,6 +118,7 @@ function getLocale() {
116
118
  }
117
119
  return clientLocale();
118
120
  }
121
+ _i18n.getLocale ?? (_i18n.getLocale = getLocale);
119
122
  function registerTranslations(locale, messages) {
120
123
  const prepared = { ...messages };
121
124
  const merged = Object.assign(/* @__PURE__ */ Object.create(null), dictionaryFor(locale), prepared);
@@ -1692,15 +1695,7 @@ function RouterLink(props, children) {
1692
1695
  const lkey = key.toLowerCase();
1693
1696
  if (lkey === "href" || lkey[0] === "o" && lkey[1] === "n") return;
1694
1697
  if (typeof value === "string" || typeof value === "number" || typeof value === "boolean") {
1695
- const str = String(value);
1696
- if (isUrlAttribute(lkey)) {
1697
- const safe = sanitizeUrl(str);
1698
- if (safe) link.setAttribute(key, safe);
1699
- } else if (lkey === "style") {
1700
- link.setAttribute(key, sanitizeStyleAttribute(str, { element: link }));
1701
- } else {
1702
- link.setAttribute(key, str);
1703
- }
1698
+ setSafeAttribute(link, key, String(value), { syncValueProperty: false, label: "RouterLink" });
1704
1699
  }
1705
1700
  });
1706
1701
  if (content !== void 0) appendChildren(link, content);
@@ -2228,8 +2223,7 @@ function serializeRouteState(state, nonce) {
2228
2223
  return `<script${nonceAttr}>window.${SSR_ROUTE_STATE_KEY}=${json}</script>`;
2229
2224
  }
2230
2225
  function deserializeRouteState() {
2231
- if (typeof window === "undefined") return void 0;
2232
- return window[SSR_ROUTE_STATE_KEY];
2226
+ return readOwnGlobal(SSR_ROUTE_STATE_KEY);
2233
2227
  }
2234
2228
  function hydrateRouter(routes, options) {
2235
2229
  const serverState = deserializeRouteState();
@@ -2243,7 +2237,7 @@ function hydrateRouter(routes, options) {
2243
2237
  const liveUrl = `${window.location.pathname}${window.location.search}${window.location.hash}`;
2244
2238
  const resolved = resolveServerRoute(liveUrl, routes);
2245
2239
  const bootstrapEpoch = __getNavigationEpoch();
2246
- import("./ssr-XOTUASDO.js").then(async ({ hydrate }) => {
2240
+ import("./ssr-5OWAH3U2.js").then(async ({ hydrate }) => {
2247
2241
  const { replaceChildrenSafely } = await import("./dispose-GEIG2KOF.js");
2248
2242
  if (__getNavigationEpoch() !== bootstrapEpoch) return;
2249
2243
  if (resolved.component) {
@@ -17,8 +17,10 @@ import {
17
17
  ssrSuspense,
18
18
  suspenseSwapScript,
19
19
  trustHTML
20
- } from "./chunk-HURREPU2.js";
21
- import "./chunk-2INLLLMZ.js";
20
+ } from "./chunk-FC6KCJSA.js";
21
+ import "./chunk-62BDYGAG.js";
22
+ import "./chunk-3ACAAQIN.js";
23
+ import "./chunk-EXXSN3BW.js";
22
24
  import "./chunk-7XHATCIH.js";
23
25
  import "./chunk-NYNYSPK7.js";
24
26
  export {
@@ -103,6 +103,12 @@ declare function renderToDocument(component: () => HTMLElement, options?: {
103
103
  title?: string;
104
104
  meta?: Record<string, string>[];
105
105
  links?: Record<string, string>[];
106
+ /**
107
+ * External script URLs appended to `<body>`. Each passes the scheme
108
+ * allowlist; an allowed URL is still code that runs with the page's
109
+ * authority, so this option is an explicit trust decision — first-party
110
+ * or pinned URLs only, never request-derived values.
111
+ */
106
112
  scripts?: string[];
107
113
  bodyAttrs?: Record<string, string>;
108
114
  /**
@@ -103,6 +103,12 @@ declare function renderToDocument(component: () => HTMLElement, options?: {
103
103
  title?: string;
104
104
  meta?: Record<string, string>[];
105
105
  links?: Record<string, string>[];
106
+ /**
107
+ * External script URLs appended to `<body>`. Each passes the scheme
108
+ * allowlist; an allowed URL is still code that runs with the page's
109
+ * authority, so this option is an explicit trust decision — first-party
110
+ * or pinned URLs only, never request-derived values.
111
+ */
106
112
  scripts?: string[];
107
113
  bodyAttrs?: Record<string, string>;
108
114
  /**