sibujs 1.5.0 → 2.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/browser.cjs +238 -69
- package/dist/browser.d.cts +5 -0
- package/dist/browser.d.ts +5 -0
- package/dist/browser.js +6 -6
- package/dist/build.cjs +916 -292
- package/dist/build.js +15 -13
- package/dist/cdn.global.js +17 -16
- package/dist/chunk-2RA7SHDA.js +65 -0
- package/dist/chunk-2UPRY23K.js +80 -0
- package/dist/chunk-3JHCYHWN.js +125 -0
- package/dist/{chunk-VAPYJN4X.js → chunk-3LR7GLWQ.js} +93 -23
- package/dist/{chunk-RJ46C3CS.js → chunk-3NSGB5JN.js} +71 -20
- package/dist/{chunk-XUEEGU5O.js → chunk-52YJLLRO.js} +16 -4
- package/dist/{chunk-XHK6BDAJ.js → chunk-54EDRCEF.js} +25 -8
- package/dist/chunk-7JDB7I65.js +1327 -0
- package/dist/{chunk-WZSPOOER.js → chunk-CC65Y57T.js} +8 -5
- package/dist/{chunk-23VV7YD3.js → chunk-DFPFITST.js} +25 -30
- package/dist/{chunk-BGN5ZMP4.js → chunk-GTBNNBJ6.js} +14 -2
- package/dist/chunk-HB24TBAF.js +121 -0
- package/dist/{chunk-CZUGLNJS.js → chunk-ITX6OO3F.js} +3 -3
- package/dist/{chunk-BGTHZHJ5.js → chunk-JA6667UN.js} +188 -44
- package/dist/{chunk-7GRNSCFT.js → chunk-JXMMDLBY.js} +306 -183
- package/dist/{chunk-3X2YG6YM.js → chunk-JYD2PWXH.js} +59 -28
- package/dist/{chunk-SFKNRVCU.js → chunk-KLRMB5ZS.js} +135 -79
- package/dist/{chunk-5X6PP2UK.js → chunk-LMLD24FC.js} +2 -2
- package/dist/{chunk-M4NLBH4I.js → chunk-LYTCUZ7H.js} +3 -2
- package/dist/{chunk-BMPL52BF.js → chunk-MIUAXB7K.js} +118 -66
- package/dist/{chunk-JCDUJN2F.js → chunk-ND2664SF.js} +486 -153
- package/dist/{chunk-VQDZK23A.js → chunk-O2MNQFLP.js} +181 -66
- package/dist/{chunk-NHUC2QWH.js → chunk-R73P76YZ.js} +1 -1
- package/dist/{chunk-2BYQDGN3.js → chunk-SAHNHTFC.js} +234 -63
- package/dist/chunk-UCS6AMJ7.js +79 -0
- package/dist/{chunk-K4G4ZQNR.js → chunk-VLPPXTYG.js} +84 -38
- package/dist/{chunk-OUZZEE4S.js → chunk-WOMYAHHI.js} +17 -11
- package/dist/{customElement-BL3Uo8dL.d.cts → customElement-CPfIrbvg.d.cts} +14 -10
- package/dist/{customElement-BL3Uo8dL.d.ts → customElement-CPfIrbvg.d.ts} +14 -10
- package/dist/data.cjs +410 -99
- package/dist/data.d.cts +20 -2
- package/dist/data.d.ts +20 -2
- package/dist/data.js +11 -9
- package/dist/devtools.cjs +513 -223
- package/dist/devtools.d.cts +1 -1
- package/dist/devtools.d.ts +1 -1
- package/dist/devtools.js +12 -6
- package/dist/ecosystem.cjs +475 -144
- package/dist/ecosystem.d.cts +9 -7
- package/dist/ecosystem.d.ts +9 -7
- package/dist/ecosystem.js +12 -11
- package/dist/extras.cjs +3355 -1541
- package/dist/extras.d.cts +9 -9
- package/dist/extras.d.ts +9 -9
- package/dist/extras.js +58 -45
- package/dist/index.cjs +920 -292
- package/dist/index.d.cts +71 -8
- package/dist/index.d.ts +71 -8
- package/dist/index.js +28 -16
- package/dist/{introspect-BumjnBKr.d.cts → introspect-BWNjNw64.d.cts} +22 -2
- package/dist/{introspect-CZrlcaYy.d.ts → introspect-cY2pg9pW.d.ts} +22 -2
- package/dist/motion.cjs +77 -34
- package/dist/motion.js +4 -4
- package/dist/patterns.cjs +335 -69
- package/dist/patterns.d.cts +11 -12
- package/dist/patterns.d.ts +11 -12
- package/dist/patterns.js +7 -7
- package/dist/performance.cjs +279 -108
- package/dist/performance.d.cts +23 -16
- package/dist/performance.d.ts +23 -16
- package/dist/performance.js +13 -8
- package/dist/plugin-D30wlGW5.d.cts +71 -0
- package/dist/plugin-D30wlGW5.d.ts +71 -0
- package/dist/plugins.cjs +635 -260
- package/dist/plugins.d.cts +10 -3
- package/dist/plugins.d.ts +10 -3
- package/dist/plugins.js +106 -38
- package/dist/{ssr-Do_SiVoL.d.cts → ssr-CrVNy6Pa.d.cts} +9 -15
- package/dist/{ssr-Do_SiVoL.d.ts → ssr-CrVNy6Pa.d.ts} +9 -15
- package/dist/{ssr-4PBXAOO3.js → ssr-FXD2PPMC.js} +4 -3
- package/dist/ssr.cjs +642 -222
- package/dist/ssr.d.cts +26 -6
- package/dist/ssr.d.ts +26 -6
- package/dist/ssr.js +12 -11
- package/dist/{tagFactory-DaJ0YWX6.d.cts → tagFactory-S17H2qxu.d.cts} +9 -1
- package/dist/{tagFactory-DaJ0YWX6.d.ts → tagFactory-S17H2qxu.d.ts} +9 -1
- package/dist/testing.cjs +252 -63
- package/dist/testing.d.cts +17 -4
- package/dist/testing.d.ts +17 -4
- package/dist/testing.js +100 -44
- package/dist/ui.cjs +463 -137
- package/dist/ui.d.cts +1 -1
- package/dist/ui.d.ts +1 -1
- package/dist/ui.js +20 -17
- package/dist/widgets.cjs +977 -94
- package/dist/widgets.d.cts +104 -2
- package/dist/widgets.d.ts +104 -2
- package/dist/widgets.js +9 -7
- package/package.json +8 -2
- package/dist/chunk-32DY64NT.js +0 -282
- package/dist/chunk-3AIRKM3B.js +0 -1263
- package/dist/chunk-3ARAQO7B.js +0 -398
- package/dist/chunk-3CRQALYP.js +0 -877
- package/dist/chunk-4EI4AG32.js +0 -482
- package/dist/chunk-4MYMUBRS.js +0 -21
- package/dist/chunk-5ZYQ6KDD.js +0 -154
- package/dist/chunk-6BMPXPUW.js +0 -26
- package/dist/chunk-6HLLIF3K.js +0 -398
- package/dist/chunk-6LSNVCS2.js +0 -937
- package/dist/chunk-6SA3QQES.js +0 -61
- package/dist/chunk-77L6NL3X.js +0 -1097
- package/dist/chunk-7BF6TK55.js +0 -1097
- package/dist/chunk-7TQKR4PP.js +0 -294
- package/dist/chunk-7V26P53V.js +0 -712
- package/dist/chunk-AZ3ISID5.js +0 -298
- package/dist/chunk-B7SWRFUT.js +0 -332
- package/dist/chunk-BTU3TJDS.js +0 -365
- package/dist/chunk-BW3WT46K.js +0 -937
- package/dist/chunk-C6KFWOFV.js +0 -616
- package/dist/chunk-CHF5OHIA.js +0 -61
- package/dist/chunk-CHJ27IGK.js +0 -26
- package/dist/chunk-CMBFNA7L.js +0 -27
- package/dist/chunk-DAHRH4ON.js +0 -331
- package/dist/chunk-DKOHBI74.js +0 -924
- package/dist/chunk-DTCOOBMX.js +0 -725
- package/dist/chunk-EBGIRKQY.js +0 -616
- package/dist/chunk-EUZND3CB.js +0 -27
- package/dist/chunk-EVCZO745.js +0 -365
- package/dist/chunk-EWFVA3TJ.js +0 -282
- package/dist/chunk-F3FA4F32.js +0 -292
- package/dist/chunk-FGOEVHY3.js +0 -60
- package/dist/chunk-G3BOQPVO.js +0 -365
- package/dist/chunk-GCOK2LC3.js +0 -282
- package/dist/chunk-GJPXRJ45.js +0 -37
- package/dist/chunk-HGMJFBC7.js +0 -654
- package/dist/chunk-JAKHTMQU.js +0 -1000
- package/dist/chunk-JCI5M6U6.js +0 -956
- package/dist/chunk-K5ZUMYVS.js +0 -89
- package/dist/chunk-KQPDEVVS.js +0 -398
- package/dist/chunk-L6JRBDNS.js +0 -60
- package/dist/chunk-LA6KQEDU.js +0 -712
- package/dist/chunk-MB6QFH3I.js +0 -2776
- package/dist/chunk-MDVXJWFN.js +0 -304
- package/dist/chunk-MEZVEBPN.js +0 -2008
- package/dist/chunk-MK4ERFYL.js +0 -2249
- package/dist/chunk-MLKGABMK.js +0 -9
- package/dist/chunk-MQ5GOYPH.js +0 -2249
- package/dist/chunk-MYRV7VDM.js +0 -742
- package/dist/chunk-N6IZB6KJ.js +0 -567
- package/dist/chunk-NEKUBFPT.js +0 -60
- package/dist/chunk-NMRUZALC.js +0 -1097
- package/dist/chunk-NYVAC6P5.js +0 -37
- package/dist/chunk-NZIIMDWI.js +0 -84
- package/dist/chunk-OF7UZIVB.js +0 -725
- package/dist/chunk-P3XWXJZU.js +0 -282
- package/dist/chunk-P6W3STU4.js +0 -2249
- package/dist/chunk-PBHF5WKN.js +0 -616
- package/dist/chunk-PDZQY43A.js +0 -616
- package/dist/chunk-PTQJDMRT.js +0 -146
- package/dist/chunk-PZEGYCF5.js +0 -61
- package/dist/chunk-QBMDLBU2.js +0 -975
- package/dist/chunk-QWZG56ET.js +0 -2744
- package/dist/chunk-RQGQSLQK.js +0 -725
- package/dist/chunk-SDLZDHKP.js +0 -107
- package/dist/chunk-TDGZL5CU.js +0 -365
- package/dist/chunk-TNQWPPE6.js +0 -37
- package/dist/chunk-TSOKIX5Z.js +0 -654
- package/dist/chunk-UHNL42EF.js +0 -2730
- package/dist/chunk-UNXCEF6S.js +0 -21
- package/dist/chunk-V2XTI523.js +0 -347
- package/dist/chunk-VAU366PN.js +0 -2241
- package/dist/chunk-VMVDTCXB.js +0 -712
- package/dist/chunk-VQNQZCWJ.js +0 -61
- package/dist/chunk-VRW3FULF.js +0 -725
- package/dist/chunk-WADYRCO2.js +0 -304
- package/dist/chunk-WILQZRO4.js +0 -282
- package/dist/chunk-WR5D4EGH.js +0 -26
- package/dist/chunk-WUHJISPP.js +0 -298
- package/dist/chunk-XYU6TZOW.js +0 -182
- package/dist/chunk-Y6GP4QGG.js +0 -276
- package/dist/chunk-YECR7UIA.js +0 -347
- package/dist/chunk-YUTWTI4B.js +0 -654
- package/dist/chunk-Z65KYU7I.js +0 -26
- package/dist/chunk-Z6POF5YC.js +0 -975
- package/dist/chunk-ZBJP6WFL.js +0 -482
- package/dist/chunk-ZD6OAMTH.js +0 -277
- package/dist/chunk-ZWKZCBO6.js +0 -317
- package/dist/contracts-DDrwxvJ-.d.cts +0 -245
- package/dist/contracts-DDrwxvJ-.d.ts +0 -245
- package/dist/contracts-DOrhwbke.d.cts +0 -245
- package/dist/contracts-DOrhwbke.d.ts +0 -245
- package/dist/contracts-xo5ckdRP.d.cts +0 -240
- package/dist/contracts-xo5ckdRP.d.ts +0 -240
- package/dist/customElement-BKQfbSZQ.d.cts +0 -262
- package/dist/customElement-BKQfbSZQ.d.ts +0 -262
- package/dist/customElement-D2DJp_xn.d.cts +0 -313
- package/dist/customElement-D2DJp_xn.d.ts +0 -313
- package/dist/customElement-yz8uyk-0.d.cts +0 -308
- package/dist/customElement-yz8uyk-0.d.ts +0 -308
- package/dist/introspect-Cb0zgpi2.d.cts +0 -477
- package/dist/introspect-Y2xNXGSf.d.ts +0 -477
- package/dist/plugin-Bek4RhJY.d.cts +0 -43
- package/dist/plugin-Bek4RhJY.d.ts +0 -43
- package/dist/ssr-3RXHP5ES.js +0 -38
- package/dist/ssr-6GIMY5MX.js +0 -38
- package/dist/ssr-BA6sxxUd.d.cts +0 -135
- package/dist/ssr-BA6sxxUd.d.ts +0 -135
- package/dist/ssr-WKUPVSSK.js +0 -36
- package/dist/tagFactory-Dl8QCLga.d.cts +0 -23
- package/dist/tagFactory-Dl8QCLga.d.ts +0 -23
package/dist/index.d.cts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
import { T as TagProps, N as NodeChildren, a as NodeChild } from './tagFactory-
|
|
2
|
-
export { S as SVG_NS, t as tagFactory } from './tagFactory-
|
|
1
|
+
import { T as TagProps, N as NodeChildren, a as NodeChild } from './tagFactory-S17H2qxu.cjs';
|
|
2
|
+
export { D as Dispose, S as SVG_NS, t as tagFactory } from './tagFactory-S17H2qxu.cjs';
|
|
3
3
|
import { R as ReactiveSignal } from './signal-BnWpq6WB.cjs';
|
|
4
|
+
export { T as TrustedHTML, t as trustHTML } from './ssr-CrVNy6Pa.cjs';
|
|
4
5
|
|
|
5
6
|
type reactive<T> = T | (() => T);
|
|
6
7
|
interface AnchorProps extends TagProps {
|
|
@@ -734,14 +735,29 @@ interface EffectOptions {
|
|
|
734
735
|
* ```
|
|
735
736
|
*/
|
|
736
737
|
declare function on<T>(deps: () => T, handler: (value: T, prev: T | undefined) => void): () => void;
|
|
738
|
+
/** Registers a function to run before the effect re-runs or is disposed.
|
|
739
|
+
* Called with the same signature inside every invocation. */
|
|
740
|
+
type OnCleanup = (fn: () => void) => void;
|
|
741
|
+
/** The user's effect body — may accept an `onCleanup` callback to register
|
|
742
|
+
* teardown that runs before the next re-run or on dispose. */
|
|
743
|
+
type EffectBody = (onCleanup: OnCleanup) => void;
|
|
737
744
|
/**
|
|
738
745
|
* effect runs the provided effectFn immediately and re-runs it whenever
|
|
739
746
|
* any reactive dependency changes.
|
|
740
747
|
* Returns a cleanup function to stop further executions.
|
|
741
748
|
*
|
|
742
749
|
* In SSR mode, effect is a no-op — side effects should not run on the server.
|
|
750
|
+
*
|
|
751
|
+
* @example addEventListener pattern with built-in teardown:
|
|
752
|
+
* ```ts
|
|
753
|
+
* effect((onCleanup) => {
|
|
754
|
+
* const handler = (e: Event) => { ... };
|
|
755
|
+
* window.addEventListener("resize", handler);
|
|
756
|
+
* onCleanup(() => window.removeEventListener("resize", handler));
|
|
757
|
+
* });
|
|
758
|
+
* ```
|
|
743
759
|
*/
|
|
744
|
-
declare function effect(effectFn: () => void, options?: EffectOptions): () => void;
|
|
760
|
+
declare function effect(effectFn: EffectBody | (() => void), options?: EffectOptions): () => void;
|
|
745
761
|
|
|
746
762
|
/**
|
|
747
763
|
* derived creates a derived reactive signal whose value updates when dependencies change.
|
|
@@ -755,6 +771,9 @@ declare function effect(effectFn: () => void, options?: EffectOptions): () => vo
|
|
|
755
771
|
*/
|
|
756
772
|
declare function derived<T>(getter: () => T, options?: {
|
|
757
773
|
name?: string;
|
|
774
|
+
/** Custom equality — when the recomputed value equals the previous,
|
|
775
|
+
* downstream subscribers are not notified. Defaults to `Object.is`. */
|
|
776
|
+
equals?: (a: T, b: T) => boolean;
|
|
758
777
|
}): Accessor<T>;
|
|
759
778
|
|
|
760
779
|
/**
|
|
@@ -1044,7 +1063,8 @@ type CleanupFn = () => void;
|
|
|
1044
1063
|
declare function onMount(callback: () => undefined | CleanupFn, element?: HTMLElement): void;
|
|
1045
1064
|
/**
|
|
1046
1065
|
* Runs a callback when the given element is removed from the DOM.
|
|
1047
|
-
* Uses MutationObserver to watch for disconnection
|
|
1066
|
+
* Uses a shared MutationObserver to watch for disconnection, plus
|
|
1067
|
+
* `registerDisposer` so explicit dispose() paths also trigger the callback.
|
|
1048
1068
|
*
|
|
1049
1069
|
* @param callback Function to run on unmount
|
|
1050
1070
|
* @param element The element to watch for removal
|
|
@@ -1095,14 +1115,32 @@ declare function onCleanup(callback: CleanupFn, element: Node): void;
|
|
|
1095
1115
|
* ```
|
|
1096
1116
|
*/
|
|
1097
1117
|
interface Context<T> {
|
|
1098
|
-
/**
|
|
1099
|
-
|
|
1118
|
+
/**
|
|
1119
|
+
* Set the context value globally. Affects all consumers.
|
|
1120
|
+
*
|
|
1121
|
+
* Returns a `restore` function that re-sets the context to the value it
|
|
1122
|
+
* had *before* this `provide` call. Useful for scoped overrides:
|
|
1123
|
+
*
|
|
1124
|
+
* ```ts
|
|
1125
|
+
* const restore = Theme.provide("dark");
|
|
1126
|
+
* try { renderChild(); } finally { restore(); }
|
|
1127
|
+
* ```
|
|
1128
|
+
*
|
|
1129
|
+
* Callers that don't need scoping can ignore the return value — existing
|
|
1130
|
+
* semantics are preserved.
|
|
1131
|
+
*/
|
|
1132
|
+
provide(value: T): () => void;
|
|
1100
1133
|
/** Get a reactive getter for the current context value. */
|
|
1101
1134
|
use(): () => T;
|
|
1102
1135
|
/** Get the current value directly (non-reactive). */
|
|
1103
1136
|
get(): T;
|
|
1104
1137
|
/** Update the provided value reactively. */
|
|
1105
1138
|
set(value: T): void;
|
|
1139
|
+
/**
|
|
1140
|
+
* Run `fn` with the context temporarily set to `value`, then restore the
|
|
1141
|
+
* previous value (even if `fn` throws). Returns the result of `fn`.
|
|
1142
|
+
*/
|
|
1143
|
+
withContext<R>(value: T, fn: () => R): R;
|
|
1106
1144
|
}
|
|
1107
1145
|
/**
|
|
1108
1146
|
* Creates a new context with an optional default value.
|
|
@@ -1158,6 +1196,11 @@ declare function strictEffect(fn: () => void): () => void;
|
|
|
1158
1196
|
* During server-side rendering, side effects (effect, watch, onMount)
|
|
1159
1197
|
* should not run. This module provides a flag to enable/disable SSR mode.
|
|
1160
1198
|
*
|
|
1199
|
+
* Concurrency: on Node we back the flag with AsyncLocalStorage so
|
|
1200
|
+
* simultaneous requests get independent SSR scopes. On runtimes without
|
|
1201
|
+
* AsyncLocalStorage (browser, some edge runtimes) we fall back to a
|
|
1202
|
+
* module-global boolean.
|
|
1203
|
+
*
|
|
1161
1204
|
* Usage:
|
|
1162
1205
|
* enableSSR(); // Call before rendering on the server
|
|
1163
1206
|
* renderToString(...);
|
|
@@ -1165,13 +1208,30 @@ declare function strictEffect(fn: () => void): () => void;
|
|
|
1165
1208
|
*
|
|
1166
1209
|
* Or use the scoped helper:
|
|
1167
1210
|
* withSSR(() => renderToString(...));
|
|
1211
|
+
* runInSSRContext(() => renderToString(...));
|
|
1212
|
+
*/
|
|
1213
|
+
/**
|
|
1214
|
+
* Per-request SSR store. Currently holds the SSR flag plus a
|
|
1215
|
+
* suspense-id counter so concurrent streaming renders never collide.
|
|
1168
1216
|
*/
|
|
1217
|
+
interface SSRStore {
|
|
1218
|
+
ssr: boolean;
|
|
1219
|
+
suspenseIdCounter: number;
|
|
1220
|
+
}
|
|
1221
|
+
/** Returns the active store (ALS or fallback). */
|
|
1222
|
+
declare function getSSRStore(): SSRStore;
|
|
1169
1223
|
/** Returns true when running in SSR mode. */
|
|
1170
1224
|
declare function isSSR(): boolean;
|
|
1171
1225
|
/** Enable SSR mode. Side effects (effect, watch, onMount) become no-ops. */
|
|
1172
1226
|
declare function enableSSR(): void;
|
|
1173
1227
|
/** Disable SSR mode. Side effects resume normal behavior. */
|
|
1174
1228
|
declare function disableSSR(): void;
|
|
1229
|
+
/**
|
|
1230
|
+
* Run `fn` inside a fresh request-scoped SSR context. On Node this uses
|
|
1231
|
+
* AsyncLocalStorage so concurrent requests never share state; elsewhere
|
|
1232
|
+
* it falls back to mutating the module-global store.
|
|
1233
|
+
*/
|
|
1234
|
+
declare function runInSSRContext<T>(fn: () => T): T;
|
|
1175
1235
|
/**
|
|
1176
1236
|
* Run a function in SSR mode. Automatically enables/disables SSR around the callback.
|
|
1177
1237
|
* Returns whatever the callback returns.
|
|
@@ -1256,7 +1316,9 @@ declare function nextTick(): Promise<void>;
|
|
|
1256
1316
|
* each(() => heavyFilter(items, deferredQuery()), row => li(row.name));
|
|
1257
1317
|
* ```
|
|
1258
1318
|
*/
|
|
1259
|
-
declare function defer<T>(getter: () => T): () => T
|
|
1319
|
+
declare function defer<T>(getter: () => T): (() => T) & {
|
|
1320
|
+
dispose: () => void;
|
|
1321
|
+
};
|
|
1260
1322
|
interface TransitionState {
|
|
1261
1323
|
pending: () => boolean;
|
|
1262
1324
|
start: (fn: () => void | Promise<void>) => void;
|
|
@@ -1306,6 +1368,7 @@ declare function untracked<T>(fn: () => T): T;
|
|
|
1306
1368
|
*/
|
|
1307
1369
|
declare function bindDynamic(el: HTMLElement, nameGetter: string | (() => string), valueGetter: string | (() => unknown)): () => void;
|
|
1308
1370
|
|
|
1371
|
+
declare function takePendingError(node: Element): Error | undefined;
|
|
1309
1372
|
type Component = () => HTMLElement;
|
|
1310
1373
|
type LazyImport = () => Promise<{
|
|
1311
1374
|
default: Component;
|
|
@@ -1471,4 +1534,4 @@ interface LoadingProps {
|
|
|
1471
1534
|
*/
|
|
1472
1535
|
declare function Loading(props?: LoadingProps): HTMLElement;
|
|
1473
1536
|
|
|
1474
|
-
export { type Accessor, type ActionFn, type AnchorProps, type ArrayActions, type AsyncDerivedState, type AudioProps, type ButtonProps, type Context, DynamicComponent, type EffectOptions, ErrorBoundary, type ErrorBoundaryProps, ErrorDisplay, type ErrorDisplayProps, type ErrorSeverity, type FormProps, Fragment, type ImgProps, type InputProps, type InputType, KeepAlive, type KeepAliveOptions, type LabelProps, Loading, type LoadingProps, type LongPressOptions, type MediaProps, NodeChild, NodeChildren, type OptionProps, Portal, type Ref, type SelectProps, type SignalOptions, type SlotFn, type Slots, type StoreActions, Suspense, type SuspenseProps, TagProps, type TextareaProps, type TypedTagFunction, type VideoProps, __resetIdCounter, a, abbr, action, address, area, array, article, aside, asyncDerived, audio, autoResize, b, base, batch, bdi, bdo, bindDynamic, blockquote, body, br, button, canvas, caption, catchError, catchErrorAsync, center, checkLeaks, circle, cite, clickOutside, clipPath, code, col, colgroup, context, copyOnClick, createId, customElement, data, datalist, dd, deepEqual, deepSignal, defer, defs, del, derived, details, dfn, dialog, disableSSR, dispose, div, dl, dt, each, effect, ellipse, em, embed, enableSSR, enqueueBatchedSignal, fieldset, figcaption, figure, font, footer, form, g, getSlot, h1, h2, h3, h4, h5, h6, head, header, hr, html, i, iframe, img, input, ins, isBatching, isSSR, kbd, label, lazy, legend, li, line, linearGradient, link, longPress, main, map, mark, marker, marquee, mask, match, math, menu, meta, meter, mount, nav, nextTick, noscript, object, ol, on, onCleanup, onMount, onUnmount, optgroup, option, output, p, param, path, pattern, picture, polygon, polyline, portal, pre, progress, q, radialGradient, reactiveArray, rect, ref, registerComponent, registerDisposer, resolveComponent, rp, rt, ruby, s, samp, script, section, select, setGlobalErrorHandler, show, signal, slot, small, source, span, stop, store, strict, strictEffect, strong, style, sub, summary, sup, svg, symbol, table, tbody, td, template, text, textarea, tfoot, th, thead, time, title, tr, track, transition, trapFocus, tspan, u, ul, unregisterComponent, untracked, use, var_, video, watch, when, withSSR, writable };
|
|
1537
|
+
export { type Accessor, type ActionFn, type AnchorProps, type ArrayActions, type AsyncDerivedState, type AudioProps, type ButtonProps, type Context, DynamicComponent, type EffectBody, type EffectOptions, ErrorBoundary, type ErrorBoundaryProps, ErrorDisplay, type ErrorDisplayProps, type ErrorSeverity, type FormProps, Fragment, type ImgProps, type InputProps, type InputType, KeepAlive, type KeepAliveOptions, type LabelProps, Loading, type LoadingProps, type LongPressOptions, type MediaProps, NodeChild, NodeChildren, type OnCleanup, type OptionProps, Portal, type Ref, type SSRStore, type SelectProps, type SignalOptions, type SlotFn, type Slots, type StoreActions, Suspense, type SuspenseProps, TagProps, type TextareaProps, type TypedTagFunction, type VideoProps, __resetIdCounter, a, abbr, action, address, area, array, article, aside, asyncDerived, audio, autoResize, b, base, batch, bdi, bdo, bindDynamic, blockquote, body, br, button, canvas, caption, catchError, catchErrorAsync, center, checkLeaks, circle, cite, clickOutside, clipPath, code, col, colgroup, context, copyOnClick, createId, customElement, data, datalist, dd, deepEqual, deepSignal, defer, defs, del, derived, details, dfn, dialog, disableSSR, dispose, div, dl, dt, each, effect, ellipse, em, embed, enableSSR, enqueueBatchedSignal, fieldset, figcaption, figure, font, footer, form, g, getSSRStore, getSlot, h1, h2, h3, h4, h5, h6, head, header, hr, html, i, iframe, img, input, ins, isBatching, isSSR, kbd, label, lazy, legend, li, line, linearGradient, link, longPress, main, map, mark, marker, marquee, mask, match, math, menu, meta, meter, mount, nav, nextTick, noscript, object, ol, on, onCleanup, onMount, onUnmount, optgroup, option, output, p, param, path, pattern, picture, polygon, polyline, portal, pre, progress, q, radialGradient, reactiveArray, rect, ref, registerComponent, registerDisposer, resolveComponent, rp, rt, ruby, runInSSRContext, s, samp, script, section, select, setGlobalErrorHandler, show, signal, slot, small, source, span, stop, store, strict, strictEffect, strong, style, sub, summary, sup, svg, symbol, table, takePendingError, tbody, td, template, text, textarea, tfoot, th, thead, time, title, tr, track, transition, trapFocus, tspan, u, ul, unregisterComponent, untracked, use, var_, video, watch, when, withSSR, writable };
|
package/dist/index.d.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
import { T as TagProps, N as NodeChildren, a as NodeChild } from './tagFactory-
|
|
2
|
-
export { S as SVG_NS, t as tagFactory } from './tagFactory-
|
|
1
|
+
import { T as TagProps, N as NodeChildren, a as NodeChild } from './tagFactory-S17H2qxu.js';
|
|
2
|
+
export { D as Dispose, S as SVG_NS, t as tagFactory } from './tagFactory-S17H2qxu.js';
|
|
3
3
|
import { R as ReactiveSignal } from './signal-BnWpq6WB.js';
|
|
4
|
+
export { T as TrustedHTML, t as trustHTML } from './ssr-CrVNy6Pa.js';
|
|
4
5
|
|
|
5
6
|
type reactive<T> = T | (() => T);
|
|
6
7
|
interface AnchorProps extends TagProps {
|
|
@@ -734,14 +735,29 @@ interface EffectOptions {
|
|
|
734
735
|
* ```
|
|
735
736
|
*/
|
|
736
737
|
declare function on<T>(deps: () => T, handler: (value: T, prev: T | undefined) => void): () => void;
|
|
738
|
+
/** Registers a function to run before the effect re-runs or is disposed.
|
|
739
|
+
* Called with the same signature inside every invocation. */
|
|
740
|
+
type OnCleanup = (fn: () => void) => void;
|
|
741
|
+
/** The user's effect body — may accept an `onCleanup` callback to register
|
|
742
|
+
* teardown that runs before the next re-run or on dispose. */
|
|
743
|
+
type EffectBody = (onCleanup: OnCleanup) => void;
|
|
737
744
|
/**
|
|
738
745
|
* effect runs the provided effectFn immediately and re-runs it whenever
|
|
739
746
|
* any reactive dependency changes.
|
|
740
747
|
* Returns a cleanup function to stop further executions.
|
|
741
748
|
*
|
|
742
749
|
* In SSR mode, effect is a no-op — side effects should not run on the server.
|
|
750
|
+
*
|
|
751
|
+
* @example addEventListener pattern with built-in teardown:
|
|
752
|
+
* ```ts
|
|
753
|
+
* effect((onCleanup) => {
|
|
754
|
+
* const handler = (e: Event) => { ... };
|
|
755
|
+
* window.addEventListener("resize", handler);
|
|
756
|
+
* onCleanup(() => window.removeEventListener("resize", handler));
|
|
757
|
+
* });
|
|
758
|
+
* ```
|
|
743
759
|
*/
|
|
744
|
-
declare function effect(effectFn: () => void, options?: EffectOptions): () => void;
|
|
760
|
+
declare function effect(effectFn: EffectBody | (() => void), options?: EffectOptions): () => void;
|
|
745
761
|
|
|
746
762
|
/**
|
|
747
763
|
* derived creates a derived reactive signal whose value updates when dependencies change.
|
|
@@ -755,6 +771,9 @@ declare function effect(effectFn: () => void, options?: EffectOptions): () => vo
|
|
|
755
771
|
*/
|
|
756
772
|
declare function derived<T>(getter: () => T, options?: {
|
|
757
773
|
name?: string;
|
|
774
|
+
/** Custom equality — when the recomputed value equals the previous,
|
|
775
|
+
* downstream subscribers are not notified. Defaults to `Object.is`. */
|
|
776
|
+
equals?: (a: T, b: T) => boolean;
|
|
758
777
|
}): Accessor<T>;
|
|
759
778
|
|
|
760
779
|
/**
|
|
@@ -1044,7 +1063,8 @@ type CleanupFn = () => void;
|
|
|
1044
1063
|
declare function onMount(callback: () => undefined | CleanupFn, element?: HTMLElement): void;
|
|
1045
1064
|
/**
|
|
1046
1065
|
* Runs a callback when the given element is removed from the DOM.
|
|
1047
|
-
* Uses MutationObserver to watch for disconnection
|
|
1066
|
+
* Uses a shared MutationObserver to watch for disconnection, plus
|
|
1067
|
+
* `registerDisposer` so explicit dispose() paths also trigger the callback.
|
|
1048
1068
|
*
|
|
1049
1069
|
* @param callback Function to run on unmount
|
|
1050
1070
|
* @param element The element to watch for removal
|
|
@@ -1095,14 +1115,32 @@ declare function onCleanup(callback: CleanupFn, element: Node): void;
|
|
|
1095
1115
|
* ```
|
|
1096
1116
|
*/
|
|
1097
1117
|
interface Context<T> {
|
|
1098
|
-
/**
|
|
1099
|
-
|
|
1118
|
+
/**
|
|
1119
|
+
* Set the context value globally. Affects all consumers.
|
|
1120
|
+
*
|
|
1121
|
+
* Returns a `restore` function that re-sets the context to the value it
|
|
1122
|
+
* had *before* this `provide` call. Useful for scoped overrides:
|
|
1123
|
+
*
|
|
1124
|
+
* ```ts
|
|
1125
|
+
* const restore = Theme.provide("dark");
|
|
1126
|
+
* try { renderChild(); } finally { restore(); }
|
|
1127
|
+
* ```
|
|
1128
|
+
*
|
|
1129
|
+
* Callers that don't need scoping can ignore the return value — existing
|
|
1130
|
+
* semantics are preserved.
|
|
1131
|
+
*/
|
|
1132
|
+
provide(value: T): () => void;
|
|
1100
1133
|
/** Get a reactive getter for the current context value. */
|
|
1101
1134
|
use(): () => T;
|
|
1102
1135
|
/** Get the current value directly (non-reactive). */
|
|
1103
1136
|
get(): T;
|
|
1104
1137
|
/** Update the provided value reactively. */
|
|
1105
1138
|
set(value: T): void;
|
|
1139
|
+
/**
|
|
1140
|
+
* Run `fn` with the context temporarily set to `value`, then restore the
|
|
1141
|
+
* previous value (even if `fn` throws). Returns the result of `fn`.
|
|
1142
|
+
*/
|
|
1143
|
+
withContext<R>(value: T, fn: () => R): R;
|
|
1106
1144
|
}
|
|
1107
1145
|
/**
|
|
1108
1146
|
* Creates a new context with an optional default value.
|
|
@@ -1158,6 +1196,11 @@ declare function strictEffect(fn: () => void): () => void;
|
|
|
1158
1196
|
* During server-side rendering, side effects (effect, watch, onMount)
|
|
1159
1197
|
* should not run. This module provides a flag to enable/disable SSR mode.
|
|
1160
1198
|
*
|
|
1199
|
+
* Concurrency: on Node we back the flag with AsyncLocalStorage so
|
|
1200
|
+
* simultaneous requests get independent SSR scopes. On runtimes without
|
|
1201
|
+
* AsyncLocalStorage (browser, some edge runtimes) we fall back to a
|
|
1202
|
+
* module-global boolean.
|
|
1203
|
+
*
|
|
1161
1204
|
* Usage:
|
|
1162
1205
|
* enableSSR(); // Call before rendering on the server
|
|
1163
1206
|
* renderToString(...);
|
|
@@ -1165,13 +1208,30 @@ declare function strictEffect(fn: () => void): () => void;
|
|
|
1165
1208
|
*
|
|
1166
1209
|
* Or use the scoped helper:
|
|
1167
1210
|
* withSSR(() => renderToString(...));
|
|
1211
|
+
* runInSSRContext(() => renderToString(...));
|
|
1212
|
+
*/
|
|
1213
|
+
/**
|
|
1214
|
+
* Per-request SSR store. Currently holds the SSR flag plus a
|
|
1215
|
+
* suspense-id counter so concurrent streaming renders never collide.
|
|
1168
1216
|
*/
|
|
1217
|
+
interface SSRStore {
|
|
1218
|
+
ssr: boolean;
|
|
1219
|
+
suspenseIdCounter: number;
|
|
1220
|
+
}
|
|
1221
|
+
/** Returns the active store (ALS or fallback). */
|
|
1222
|
+
declare function getSSRStore(): SSRStore;
|
|
1169
1223
|
/** Returns true when running in SSR mode. */
|
|
1170
1224
|
declare function isSSR(): boolean;
|
|
1171
1225
|
/** Enable SSR mode. Side effects (effect, watch, onMount) become no-ops. */
|
|
1172
1226
|
declare function enableSSR(): void;
|
|
1173
1227
|
/** Disable SSR mode. Side effects resume normal behavior. */
|
|
1174
1228
|
declare function disableSSR(): void;
|
|
1229
|
+
/**
|
|
1230
|
+
* Run `fn` inside a fresh request-scoped SSR context. On Node this uses
|
|
1231
|
+
* AsyncLocalStorage so concurrent requests never share state; elsewhere
|
|
1232
|
+
* it falls back to mutating the module-global store.
|
|
1233
|
+
*/
|
|
1234
|
+
declare function runInSSRContext<T>(fn: () => T): T;
|
|
1175
1235
|
/**
|
|
1176
1236
|
* Run a function in SSR mode. Automatically enables/disables SSR around the callback.
|
|
1177
1237
|
* Returns whatever the callback returns.
|
|
@@ -1256,7 +1316,9 @@ declare function nextTick(): Promise<void>;
|
|
|
1256
1316
|
* each(() => heavyFilter(items, deferredQuery()), row => li(row.name));
|
|
1257
1317
|
* ```
|
|
1258
1318
|
*/
|
|
1259
|
-
declare function defer<T>(getter: () => T): () => T
|
|
1319
|
+
declare function defer<T>(getter: () => T): (() => T) & {
|
|
1320
|
+
dispose: () => void;
|
|
1321
|
+
};
|
|
1260
1322
|
interface TransitionState {
|
|
1261
1323
|
pending: () => boolean;
|
|
1262
1324
|
start: (fn: () => void | Promise<void>) => void;
|
|
@@ -1306,6 +1368,7 @@ declare function untracked<T>(fn: () => T): T;
|
|
|
1306
1368
|
*/
|
|
1307
1369
|
declare function bindDynamic(el: HTMLElement, nameGetter: string | (() => string), valueGetter: string | (() => unknown)): () => void;
|
|
1308
1370
|
|
|
1371
|
+
declare function takePendingError(node: Element): Error | undefined;
|
|
1309
1372
|
type Component = () => HTMLElement;
|
|
1310
1373
|
type LazyImport = () => Promise<{
|
|
1311
1374
|
default: Component;
|
|
@@ -1471,4 +1534,4 @@ interface LoadingProps {
|
|
|
1471
1534
|
*/
|
|
1472
1535
|
declare function Loading(props?: LoadingProps): HTMLElement;
|
|
1473
1536
|
|
|
1474
|
-
export { type Accessor, type ActionFn, type AnchorProps, type ArrayActions, type AsyncDerivedState, type AudioProps, type ButtonProps, type Context, DynamicComponent, type EffectOptions, ErrorBoundary, type ErrorBoundaryProps, ErrorDisplay, type ErrorDisplayProps, type ErrorSeverity, type FormProps, Fragment, type ImgProps, type InputProps, type InputType, KeepAlive, type KeepAliveOptions, type LabelProps, Loading, type LoadingProps, type LongPressOptions, type MediaProps, NodeChild, NodeChildren, type OptionProps, Portal, type Ref, type SelectProps, type SignalOptions, type SlotFn, type Slots, type StoreActions, Suspense, type SuspenseProps, TagProps, type TextareaProps, type TypedTagFunction, type VideoProps, __resetIdCounter, a, abbr, action, address, area, array, article, aside, asyncDerived, audio, autoResize, b, base, batch, bdi, bdo, bindDynamic, blockquote, body, br, button, canvas, caption, catchError, catchErrorAsync, center, checkLeaks, circle, cite, clickOutside, clipPath, code, col, colgroup, context, copyOnClick, createId, customElement, data, datalist, dd, deepEqual, deepSignal, defer, defs, del, derived, details, dfn, dialog, disableSSR, dispose, div, dl, dt, each, effect, ellipse, em, embed, enableSSR, enqueueBatchedSignal, fieldset, figcaption, figure, font, footer, form, g, getSlot, h1, h2, h3, h4, h5, h6, head, header, hr, html, i, iframe, img, input, ins, isBatching, isSSR, kbd, label, lazy, legend, li, line, linearGradient, link, longPress, main, map, mark, marker, marquee, mask, match, math, menu, meta, meter, mount, nav, nextTick, noscript, object, ol, on, onCleanup, onMount, onUnmount, optgroup, option, output, p, param, path, pattern, picture, polygon, polyline, portal, pre, progress, q, radialGradient, reactiveArray, rect, ref, registerComponent, registerDisposer, resolveComponent, rp, rt, ruby, s, samp, script, section, select, setGlobalErrorHandler, show, signal, slot, small, source, span, stop, store, strict, strictEffect, strong, style, sub, summary, sup, svg, symbol, table, tbody, td, template, text, textarea, tfoot, th, thead, time, title, tr, track, transition, trapFocus, tspan, u, ul, unregisterComponent, untracked, use, var_, video, watch, when, withSSR, writable };
|
|
1537
|
+
export { type Accessor, type ActionFn, type AnchorProps, type ArrayActions, type AsyncDerivedState, type AudioProps, type ButtonProps, type Context, DynamicComponent, type EffectBody, type EffectOptions, ErrorBoundary, type ErrorBoundaryProps, ErrorDisplay, type ErrorDisplayProps, type ErrorSeverity, type FormProps, Fragment, type ImgProps, type InputProps, type InputType, KeepAlive, type KeepAliveOptions, type LabelProps, Loading, type LoadingProps, type LongPressOptions, type MediaProps, NodeChild, NodeChildren, type OnCleanup, type OptionProps, Portal, type Ref, type SSRStore, type SelectProps, type SignalOptions, type SlotFn, type Slots, type StoreActions, Suspense, type SuspenseProps, TagProps, type TextareaProps, type TypedTagFunction, type VideoProps, __resetIdCounter, a, abbr, action, address, area, array, article, aside, asyncDerived, audio, autoResize, b, base, batch, bdi, bdo, bindDynamic, blockquote, body, br, button, canvas, caption, catchError, catchErrorAsync, center, checkLeaks, circle, cite, clickOutside, clipPath, code, col, colgroup, context, copyOnClick, createId, customElement, data, datalist, dd, deepEqual, deepSignal, defer, defs, del, derived, details, dfn, dialog, disableSSR, dispose, div, dl, dt, each, effect, ellipse, em, embed, enableSSR, enqueueBatchedSignal, fieldset, figcaption, figure, font, footer, form, g, getSSRStore, getSlot, h1, h2, h3, h4, h5, h6, head, header, hr, html, i, iframe, img, input, ins, isBatching, isSSR, kbd, label, lazy, legend, li, line, linearGradient, link, longPress, main, map, mark, marker, marquee, mask, match, math, menu, meta, meter, mount, nav, nextTick, noscript, object, ol, on, onCleanup, onMount, onUnmount, optgroup, option, output, p, param, path, pattern, picture, polygon, polyline, portal, pre, progress, q, radialGradient, reactiveArray, rect, ref, registerComponent, registerDisposer, resolveComponent, rp, rt, ruby, runInSSRContext, s, samp, script, section, select, setGlobalErrorHandler, show, signal, slot, small, source, span, stop, store, strict, strictEffect, strong, style, sub, summary, sup, svg, symbol, table, takePendingError, tbody, td, template, text, textarea, tfoot, th, thead, time, title, tr, track, transition, trapFocus, tspan, u, ul, unregisterComponent, untracked, use, var_, video, watch, when, withSSR, writable };
|
package/dist/index.js
CHANGED
|
@@ -38,12 +38,13 @@ import {
|
|
|
38
38
|
store,
|
|
39
39
|
strict,
|
|
40
40
|
strictEffect,
|
|
41
|
+
takePendingError,
|
|
41
42
|
transition,
|
|
42
43
|
trapFocus,
|
|
43
44
|
unregisterComponent,
|
|
44
45
|
when,
|
|
45
46
|
writable
|
|
46
|
-
} from "./chunk-
|
|
47
|
+
} from "./chunk-ND2664SF.js";
|
|
47
48
|
import {
|
|
48
49
|
__resetIdCounter,
|
|
49
50
|
createId
|
|
@@ -185,47 +186,54 @@ import {
|
|
|
185
186
|
use,
|
|
186
187
|
var_,
|
|
187
188
|
video
|
|
188
|
-
} from "./chunk-
|
|
189
|
+
} from "./chunk-R73P76YZ.js";
|
|
189
190
|
import {
|
|
190
191
|
watch
|
|
191
|
-
} from "./chunk-
|
|
192
|
+
} from "./chunk-ITX6OO3F.js";
|
|
193
|
+
import {
|
|
194
|
+
trustHTML
|
|
195
|
+
} from "./chunk-JYD2PWXH.js";
|
|
192
196
|
import {
|
|
193
197
|
context
|
|
194
|
-
} from "./chunk-
|
|
198
|
+
} from "./chunk-GTBNNBJ6.js";
|
|
195
199
|
import {
|
|
196
200
|
SVG_NS,
|
|
197
201
|
tagFactory
|
|
198
|
-
} from "./chunk-
|
|
202
|
+
} from "./chunk-KLRMB5ZS.js";
|
|
203
|
+
import {
|
|
204
|
+
bindDynamic
|
|
205
|
+
} from "./chunk-DFPFITST.js";
|
|
206
|
+
import {
|
|
207
|
+
derived
|
|
208
|
+
} from "./chunk-54EDRCEF.js";
|
|
199
209
|
import {
|
|
200
|
-
bindDynamic,
|
|
201
210
|
checkLeaks,
|
|
202
211
|
dispose,
|
|
203
212
|
registerDisposer
|
|
204
|
-
} from "./chunk-
|
|
205
|
-
import
|
|
206
|
-
derived
|
|
207
|
-
} from "./chunk-XHK6BDAJ.js";
|
|
208
|
-
import "./chunk-CMBFNA7L.js";
|
|
213
|
+
} from "./chunk-2UPRY23K.js";
|
|
214
|
+
import "./chunk-UCS6AMJ7.js";
|
|
209
215
|
import {
|
|
210
216
|
effect,
|
|
211
217
|
on
|
|
212
|
-
} from "./chunk-
|
|
218
|
+
} from "./chunk-HB24TBAF.js";
|
|
213
219
|
import {
|
|
214
220
|
disableSSR,
|
|
215
221
|
enableSSR,
|
|
222
|
+
getSSRStore,
|
|
216
223
|
isSSR,
|
|
224
|
+
runInSSRContext,
|
|
217
225
|
withSSR
|
|
218
|
-
} from "./chunk-
|
|
226
|
+
} from "./chunk-2RA7SHDA.js";
|
|
219
227
|
import {
|
|
220
228
|
batch,
|
|
221
229
|
enqueueBatchedSignal,
|
|
222
230
|
isBatching,
|
|
223
231
|
signal
|
|
224
|
-
} from "./chunk-
|
|
232
|
+
} from "./chunk-CC65Y57T.js";
|
|
225
233
|
import {
|
|
226
234
|
untracked
|
|
227
|
-
} from "./chunk-
|
|
228
|
-
import "./chunk-
|
|
235
|
+
} from "./chunk-VLPPXTYG.js";
|
|
236
|
+
import "./chunk-LMLD24FC.js";
|
|
229
237
|
export {
|
|
230
238
|
DynamicComponent,
|
|
231
239
|
ErrorBoundary,
|
|
@@ -306,6 +314,7 @@ export {
|
|
|
306
314
|
footer,
|
|
307
315
|
form,
|
|
308
316
|
g,
|
|
317
|
+
getSSRStore,
|
|
309
318
|
getSlot,
|
|
310
319
|
h1,
|
|
311
320
|
h2,
|
|
@@ -378,6 +387,7 @@ export {
|
|
|
378
387
|
rp,
|
|
379
388
|
rt,
|
|
380
389
|
ruby,
|
|
390
|
+
runInSSRContext,
|
|
381
391
|
s,
|
|
382
392
|
samp,
|
|
383
393
|
script,
|
|
@@ -403,6 +413,7 @@ export {
|
|
|
403
413
|
symbol,
|
|
404
414
|
table,
|
|
405
415
|
tagFactory,
|
|
416
|
+
takePendingError,
|
|
406
417
|
tbody,
|
|
407
418
|
td,
|
|
408
419
|
template,
|
|
@@ -417,6 +428,7 @@ export {
|
|
|
417
428
|
track,
|
|
418
429
|
transition,
|
|
419
430
|
trapFocus,
|
|
431
|
+
trustHTML,
|
|
420
432
|
tspan,
|
|
421
433
|
u,
|
|
422
434
|
ul,
|
|
@@ -102,6 +102,13 @@ interface DevToolsConfig {
|
|
|
102
102
|
maxEvents?: number;
|
|
103
103
|
enabled?: boolean;
|
|
104
104
|
maxSignals?: number;
|
|
105
|
+
/**
|
|
106
|
+
* When true, attach the devtools API and data providers onto
|
|
107
|
+
* `globalThis.__SIBU__` (and the deprecated legacy `__SIBU_DEVTOOLS__*`
|
|
108
|
+
* aliases) so the browser extension / panel can read them. Defaults to
|
|
109
|
+
* `false` — production and tests should leave this off.
|
|
110
|
+
*/
|
|
111
|
+
expose?: boolean;
|
|
105
112
|
}
|
|
106
113
|
interface ComponentEntry {
|
|
107
114
|
element: HTMLElement;
|
|
@@ -134,6 +141,7 @@ declare function initDevTools(config?: DevToolsConfig): {
|
|
|
134
141
|
setEnabled: (v: boolean) => void;
|
|
135
142
|
snapshot: () => Record<string, unknown>;
|
|
136
143
|
highlightElement: (name: string) => void;
|
|
144
|
+
getElementHTML: (name: string, max?: number) => string | null;
|
|
137
145
|
destroy: () => void;
|
|
138
146
|
};
|
|
139
147
|
declare function devState<T>(name: string, initial: T): [() => T, (value: T | ((prev: T) => T)) => void];
|
|
@@ -150,6 +158,12 @@ declare function devState<T>(name: string, initial: T): [() => T, (value: T | ((
|
|
|
150
158
|
* The utilities integrate with bundlers that expose a `module.hot` or
|
|
151
159
|
* `import.meta.hot` API (Webpack, Vite, Parcel, etc.).
|
|
152
160
|
*/
|
|
161
|
+
/**
|
|
162
|
+
* Remove a single HMR module entry (state + registry) by id.
|
|
163
|
+
* Call this from `import.meta.hot.accept()` / `module.hot.dispose()` handlers
|
|
164
|
+
* when the module is being fully replaced or torn down.
|
|
165
|
+
*/
|
|
166
|
+
declare function clearHMRModule(id: string): void;
|
|
153
167
|
/**
|
|
154
168
|
* Create an HMR-aware state that persists across module reloads.
|
|
155
169
|
* During development, state is stored in a global map keyed by a unique `id`.
|
|
@@ -228,6 +242,12 @@ declare function createHMRBoundary(id: string): {
|
|
|
228
242
|
* Clear all HMR state (useful for a full page refresh or test teardown).
|
|
229
243
|
*/
|
|
230
244
|
declare function clearHMRState(): void;
|
|
245
|
+
/**
|
|
246
|
+
* Register HMR helpers under `__SIBU__.hmr` so devtools panels can reach them.
|
|
247
|
+
* Call this explicitly from your app bootstrap when you want the exposure —
|
|
248
|
+
* nothing is attached by default, matching initDevTools({ expose: true }).
|
|
249
|
+
*/
|
|
250
|
+
declare function exposeHMR(): void;
|
|
231
251
|
/**
|
|
232
252
|
* Check if HMR is available in the current environment.
|
|
233
253
|
* Returns `true` when any of the common bundler HMR APIs are detected
|
|
@@ -468,10 +488,10 @@ declare function inspectSignal(getter: () => unknown): ReactiveNodeInfo | null;
|
|
|
468
488
|
*
|
|
469
489
|
* Set maxDepth to limit traversal (default: 10).
|
|
470
490
|
*/
|
|
471
|
-
declare function walkDependencyGraph(getter: () => unknown, maxDepth?: number): {
|
|
491
|
+
declare function walkDependencyGraph(getter: () => unknown, maxDepth?: number, visited?: WeakSet<ReactiveSignal>): {
|
|
472
492
|
name: string | undefined;
|
|
473
493
|
subscribers: number;
|
|
474
494
|
downstream: ReturnType<typeof walkDependencyGraph>[];
|
|
475
495
|
};
|
|
476
496
|
|
|
477
|
-
export {
|
|
497
|
+
export { isDebugEnabled as A, isHMRAvailable as B, measureRender as C, type DevToolsEvent as D, perfTracker as E, registerHMR as F, runCleanups as G, startMeasure as H, trackCleanup as I, walkDependencyGraph as J, withErrorTracking as K, type ProfilerResult as P, type ReactiveNodeInfo as R, SibuError as S, type DevtoolsOverlayOptions as a, clearDebugValues as b, checkLeaks as c, clearHMRModule as d, clearHMRState as e, clearPerformanceData as f, createDevtoolsOverlay as g, createErrorReporter as h, createHMRBoundary as i, createProfiler as j, debugLog as k, debugValue as l, devState as m, disableDebug as n, enableDebug as o, exposeHMR as p, formatError as q, getActiveDevTools as r, getDebugValues as s, getDependencies as t, getPerformanceReport as u, getSignalName as v, getSubscriberCount as w, hmrState as x, initDevTools as y, inspectSignal as z };
|
|
@@ -102,6 +102,13 @@ interface DevToolsConfig {
|
|
|
102
102
|
maxEvents?: number;
|
|
103
103
|
enabled?: boolean;
|
|
104
104
|
maxSignals?: number;
|
|
105
|
+
/**
|
|
106
|
+
* When true, attach the devtools API and data providers onto
|
|
107
|
+
* `globalThis.__SIBU__` (and the deprecated legacy `__SIBU_DEVTOOLS__*`
|
|
108
|
+
* aliases) so the browser extension / panel can read them. Defaults to
|
|
109
|
+
* `false` — production and tests should leave this off.
|
|
110
|
+
*/
|
|
111
|
+
expose?: boolean;
|
|
105
112
|
}
|
|
106
113
|
interface ComponentEntry {
|
|
107
114
|
element: HTMLElement;
|
|
@@ -134,6 +141,7 @@ declare function initDevTools(config?: DevToolsConfig): {
|
|
|
134
141
|
setEnabled: (v: boolean) => void;
|
|
135
142
|
snapshot: () => Record<string, unknown>;
|
|
136
143
|
highlightElement: (name: string) => void;
|
|
144
|
+
getElementHTML: (name: string, max?: number) => string | null;
|
|
137
145
|
destroy: () => void;
|
|
138
146
|
};
|
|
139
147
|
declare function devState<T>(name: string, initial: T): [() => T, (value: T | ((prev: T) => T)) => void];
|
|
@@ -150,6 +158,12 @@ declare function devState<T>(name: string, initial: T): [() => T, (value: T | ((
|
|
|
150
158
|
* The utilities integrate with bundlers that expose a `module.hot` or
|
|
151
159
|
* `import.meta.hot` API (Webpack, Vite, Parcel, etc.).
|
|
152
160
|
*/
|
|
161
|
+
/**
|
|
162
|
+
* Remove a single HMR module entry (state + registry) by id.
|
|
163
|
+
* Call this from `import.meta.hot.accept()` / `module.hot.dispose()` handlers
|
|
164
|
+
* when the module is being fully replaced or torn down.
|
|
165
|
+
*/
|
|
166
|
+
declare function clearHMRModule(id: string): void;
|
|
153
167
|
/**
|
|
154
168
|
* Create an HMR-aware state that persists across module reloads.
|
|
155
169
|
* During development, state is stored in a global map keyed by a unique `id`.
|
|
@@ -228,6 +242,12 @@ declare function createHMRBoundary(id: string): {
|
|
|
228
242
|
* Clear all HMR state (useful for a full page refresh or test teardown).
|
|
229
243
|
*/
|
|
230
244
|
declare function clearHMRState(): void;
|
|
245
|
+
/**
|
|
246
|
+
* Register HMR helpers under `__SIBU__.hmr` so devtools panels can reach them.
|
|
247
|
+
* Call this explicitly from your app bootstrap when you want the exposure —
|
|
248
|
+
* nothing is attached by default, matching initDevTools({ expose: true }).
|
|
249
|
+
*/
|
|
250
|
+
declare function exposeHMR(): void;
|
|
231
251
|
/**
|
|
232
252
|
* Check if HMR is available in the current environment.
|
|
233
253
|
* Returns `true` when any of the common bundler HMR APIs are detected
|
|
@@ -468,10 +488,10 @@ declare function inspectSignal(getter: () => unknown): ReactiveNodeInfo | null;
|
|
|
468
488
|
*
|
|
469
489
|
* Set maxDepth to limit traversal (default: 10).
|
|
470
490
|
*/
|
|
471
|
-
declare function walkDependencyGraph(getter: () => unknown, maxDepth?: number): {
|
|
491
|
+
declare function walkDependencyGraph(getter: () => unknown, maxDepth?: number, visited?: WeakSet<ReactiveSignal>): {
|
|
472
492
|
name: string | undefined;
|
|
473
493
|
subscribers: number;
|
|
474
494
|
downstream: ReturnType<typeof walkDependencyGraph>[];
|
|
475
495
|
};
|
|
476
496
|
|
|
477
|
-
export {
|
|
497
|
+
export { isDebugEnabled as A, isHMRAvailable as B, measureRender as C, type DevToolsEvent as D, perfTracker as E, registerHMR as F, runCleanups as G, startMeasure as H, trackCleanup as I, walkDependencyGraph as J, withErrorTracking as K, type ProfilerResult as P, type ReactiveNodeInfo as R, SibuError as S, type DevtoolsOverlayOptions as a, clearDebugValues as b, checkLeaks as c, clearHMRModule as d, clearHMRState as e, clearPerformanceData as f, createDevtoolsOverlay as g, createErrorReporter as h, createHMRBoundary as i, createProfiler as j, debugLog as k, debugValue as l, devState as m, disableDebug as n, enableDebug as o, exposeHMR as p, formatError as q, getActiveDevTools as r, getDebugValues as s, getDependencies as t, getPerformanceReport as u, getSignalName as v, getSubscriberCount as w, hmrState as x, initDevTools as y, inspectSignal as z };
|