sibujs 2.2.0 → 3.1.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.js +4 -4
- package/dist/build.cjs +48 -7
- package/dist/build.js +10 -10
- package/dist/cdn.global.js +7 -7
- package/dist/{chunk-VSNLICTS.js → chunk-2HAGQWDV.js} +1 -1
- package/dist/{chunk-L52H775O.js → chunk-2N2UL7O4.js} +4 -4
- package/dist/{chunk-UKMXT5T6.js → chunk-2ZJ7TSW4.js} +4 -5
- package/dist/{chunk-NEWH4O5U.js → chunk-3DJH25UO.js} +1 -1
- package/dist/{chunk-XDKP4T7G.js → chunk-3DYB5B3S.js} +2 -2
- package/dist/{chunk-L4DAT4WU.js → chunk-3U4ZVXVD.js} +24 -1
- package/dist/{chunk-J63GPPCJ.js → chunk-CR4MXPHB.js} +14 -11
- package/dist/{chunk-YMOIAHWA.js → chunk-EFOAE5NC.js} +1 -1
- package/dist/{chunk-4YTVESDX.js → chunk-GQ7RRFPU.js} +1 -1
- package/dist/{chunk-2KM2724A.js → chunk-IVOUCSZL.js} +2 -2
- package/dist/{chunk-KZA7ANXP.js → chunk-KB3BA2XK.js} +3 -3
- package/dist/{chunk-2JQUV4Y3.js → chunk-PMSDFTK3.js} +4 -4
- package/dist/{chunk-KH4OE6WY.js → chunk-QNQY5DUS.js} +5 -5
- package/dist/{chunk-6QZO7MMG.js → chunk-RK4BQG25.js} +1 -1
- package/dist/{chunk-DF3GTP4Q.js → chunk-SC437AMI.js} +1 -1
- package/dist/{chunk-XVYB3J6C.js → chunk-SVVAUX7J.js} +3 -3
- package/dist/{chunk-V65KTDZW.js → chunk-UYX2NDOH.js} +3 -3
- package/dist/{chunk-STFTTMO2.js → chunk-WKUXSE7V.js} +21 -3
- package/dist/{chunk-RJIRT46U.js → chunk-WYU7CYJ3.js} +4 -4
- package/dist/{chunk-5WD7BYTZ.js → chunk-ZIBE2SAT.js} +1 -1
- package/dist/data.cjs +23 -1
- package/dist/data.js +6 -6
- package/dist/devtools.js +4 -4
- package/dist/ecosystem.cjs +42 -4
- package/dist/ecosystem.js +7 -7
- package/dist/extras.cjs +42 -4
- package/dist/extras.js +19 -19
- package/dist/index.cjs +48 -7
- package/dist/index.d.cts +13 -14
- package/dist/index.d.ts +13 -14
- package/dist/index.js +10 -10
- package/dist/motion.js +3 -3
- package/dist/patterns.cjs +23 -1
- package/dist/patterns.js +5 -5
- package/dist/performance.js +4 -4
- package/dist/plugins.cjs +42 -4
- package/dist/plugins.js +6 -6
- package/dist/ssr.cjs +42 -4
- package/dist/ssr.js +7 -7
- package/dist/testing.js +2 -2
- package/dist/ui.cjs +24 -3
- package/dist/ui.js +6 -6
- package/dist/widgets.cjs +23 -1
- package/dist/widgets.js +6 -6
- package/package.json +1 -1
package/dist/extras.js
CHANGED
|
@@ -5,7 +5,7 @@ import {
|
|
|
5
5
|
optimisticList,
|
|
6
6
|
persisted,
|
|
7
7
|
timeline
|
|
8
|
-
} from "./chunk-
|
|
8
|
+
} from "./chunk-KB3BA2XK.js";
|
|
9
9
|
import {
|
|
10
10
|
DOMPool,
|
|
11
11
|
Features,
|
|
@@ -41,7 +41,7 @@ import {
|
|
|
41
41
|
transitionState,
|
|
42
42
|
uniqueId,
|
|
43
43
|
yieldToMain
|
|
44
|
-
} from "./chunk-
|
|
44
|
+
} from "./chunk-3DYB5B3S.js";
|
|
45
45
|
import {
|
|
46
46
|
VERSION,
|
|
47
47
|
bundlerMetadata,
|
|
@@ -87,7 +87,7 @@ import {
|
|
|
87
87
|
wasm,
|
|
88
88
|
worker,
|
|
89
89
|
workerFn
|
|
90
|
-
} from "./chunk-
|
|
90
|
+
} from "./chunk-UYX2NDOH.js";
|
|
91
91
|
import {
|
|
92
92
|
FocusTrap,
|
|
93
93
|
VirtualList,
|
|
@@ -128,7 +128,7 @@ import {
|
|
|
128
128
|
toast,
|
|
129
129
|
withScopedStyle,
|
|
130
130
|
zipMask
|
|
131
|
-
} from "./chunk-
|
|
131
|
+
} from "./chunk-QNQY5DUS.js";
|
|
132
132
|
import {
|
|
133
133
|
RenderProp,
|
|
134
134
|
assertType,
|
|
@@ -155,7 +155,7 @@ import {
|
|
|
155
155
|
select,
|
|
156
156
|
tabs,
|
|
157
157
|
tooltip
|
|
158
|
-
} from "./chunk-
|
|
158
|
+
} from "./chunk-WYU7CYJ3.js";
|
|
159
159
|
import {
|
|
160
160
|
animationFrame,
|
|
161
161
|
battery,
|
|
@@ -193,7 +193,7 @@ import {
|
|
|
193
193
|
visibility,
|
|
194
194
|
wakeLock,
|
|
195
195
|
windowSize
|
|
196
|
-
} from "./chunk-
|
|
196
|
+
} from "./chunk-IVOUCSZL.js";
|
|
197
197
|
import {
|
|
198
198
|
__resetQueryCache,
|
|
199
199
|
calculateDelay,
|
|
@@ -216,7 +216,7 @@ import {
|
|
|
216
216
|
syncAdapter,
|
|
217
217
|
throttle,
|
|
218
218
|
withRetry
|
|
219
|
-
} from "./chunk-
|
|
219
|
+
} from "./chunk-PMSDFTK3.js";
|
|
220
220
|
import {
|
|
221
221
|
SibuError,
|
|
222
222
|
checkLeaks,
|
|
@@ -254,7 +254,7 @@ import {
|
|
|
254
254
|
trackCleanup,
|
|
255
255
|
walkDependencyGraph,
|
|
256
256
|
withErrorTracking
|
|
257
|
-
} from "./chunk-
|
|
257
|
+
} from "./chunk-SVVAUX7J.js";
|
|
258
258
|
import {
|
|
259
259
|
antdAdapter,
|
|
260
260
|
chakraAdapter,
|
|
@@ -264,7 +264,7 @@ import {
|
|
|
264
264
|
mobXAdapter,
|
|
265
265
|
reduxAdapter,
|
|
266
266
|
zustandAdapter
|
|
267
|
-
} from "./chunk-
|
|
267
|
+
} from "./chunk-2N2UL7O4.js";
|
|
268
268
|
import {
|
|
269
269
|
createPlugin,
|
|
270
270
|
createPluginRegistry,
|
|
@@ -276,8 +276,8 @@ import {
|
|
|
276
276
|
triggerPluginMount,
|
|
277
277
|
triggerPluginUnmount
|
|
278
278
|
} from "./chunk-3JHCYHWN.js";
|
|
279
|
-
import "./chunk-
|
|
280
|
-
import "./chunk-
|
|
279
|
+
import "./chunk-2HAGQWDV.js";
|
|
280
|
+
import "./chunk-3DJH25UO.js";
|
|
281
281
|
import {
|
|
282
282
|
collectStream,
|
|
283
283
|
deserializeState,
|
|
@@ -297,13 +297,13 @@ import {
|
|
|
297
297
|
suspenseSwapScript,
|
|
298
298
|
trustHTML
|
|
299
299
|
} from "./chunk-JYD2PWXH.js";
|
|
300
|
-
import "./chunk-
|
|
301
|
-
import "./chunk-
|
|
302
|
-
import "./chunk-
|
|
303
|
-
import "./chunk-
|
|
300
|
+
import "./chunk-EFOAE5NC.js";
|
|
301
|
+
import "./chunk-WKUXSE7V.js";
|
|
302
|
+
import "./chunk-2ZJ7TSW4.js";
|
|
303
|
+
import "./chunk-SC437AMI.js";
|
|
304
304
|
import "./chunk-2UPRY23K.js";
|
|
305
305
|
import "./chunk-UCS6AMJ7.js";
|
|
306
|
-
import "./chunk-
|
|
306
|
+
import "./chunk-ZIBE2SAT.js";
|
|
307
307
|
import "./chunk-2RA7SHDA.js";
|
|
308
308
|
import {
|
|
309
309
|
TransitionGroup,
|
|
@@ -326,9 +326,9 @@ import {
|
|
|
326
326
|
stagger,
|
|
327
327
|
transition,
|
|
328
328
|
viewTransition
|
|
329
|
-
} from "./chunk-
|
|
330
|
-
import "./chunk-
|
|
331
|
-
import "./chunk-
|
|
329
|
+
} from "./chunk-GQ7RRFPU.js";
|
|
330
|
+
import "./chunk-RK4BQG25.js";
|
|
331
|
+
import "./chunk-3U4ZVXVD.js";
|
|
332
332
|
import "./chunk-LMLD24FC.js";
|
|
333
333
|
export {
|
|
334
334
|
DOMPool,
|
package/dist/index.cjs
CHANGED
|
@@ -471,7 +471,7 @@ function retrack(effectFn, subscriber) {
|
|
|
471
471
|
}
|
|
472
472
|
}
|
|
473
473
|
function track(effectFn, subscriber) {
|
|
474
|
-
if (!subscriber)
|
|
474
|
+
if (!subscriber) return reactiveBinding(effectFn);
|
|
475
475
|
cleanup(subscriber);
|
|
476
476
|
const prev = currentSubscriber;
|
|
477
477
|
currentSubscriber = subscriber;
|
|
@@ -489,6 +489,28 @@ function track(effectFn, subscriber) {
|
|
|
489
489
|
const sub2 = subscriber;
|
|
490
490
|
return sub2._dispose ?? (sub2._dispose = () => cleanup(subscriber));
|
|
491
491
|
}
|
|
492
|
+
function reactiveBinding(commit) {
|
|
493
|
+
const run = () => {
|
|
494
|
+
const s2 = subscriber;
|
|
495
|
+
if (s2._reentrant) return;
|
|
496
|
+
s2._reentrant = true;
|
|
497
|
+
try {
|
|
498
|
+
retrack(commit, subscriber);
|
|
499
|
+
} finally {
|
|
500
|
+
s2._reentrant = false;
|
|
501
|
+
}
|
|
502
|
+
};
|
|
503
|
+
const subscriber = run;
|
|
504
|
+
subscriber.depsHead = null;
|
|
505
|
+
subscriber.depsTail = null;
|
|
506
|
+
subscriber._epoch = 0;
|
|
507
|
+
subscriber._structDirty = false;
|
|
508
|
+
subscriber._runEpoch = 0;
|
|
509
|
+
subscriber._runs = 0;
|
|
510
|
+
subscriber._reentrant = false;
|
|
511
|
+
run();
|
|
512
|
+
return subscriber._dispose ?? (subscriber._dispose = () => cleanup(subscriber));
|
|
513
|
+
}
|
|
492
514
|
function recordDependency(signal2) {
|
|
493
515
|
if (!currentSubscriber) return;
|
|
494
516
|
const sub2 = currentSubscriber;
|
|
@@ -720,8 +742,7 @@ function bindAttribute(el, attr, getter) {
|
|
|
720
742
|
el.setAttribute(attr, isUrlAttribute(attr) ? sanitizeUrl(str) : str);
|
|
721
743
|
}
|
|
722
744
|
}
|
|
723
|
-
|
|
724
|
-
return teardown;
|
|
745
|
+
return reactiveBinding(commit);
|
|
725
746
|
}
|
|
726
747
|
function bindDynamic(el, nameGetter, valueGetter) {
|
|
727
748
|
let prevName = null;
|
|
@@ -752,7 +773,7 @@ function bindDynamic(el, nameGetter, valueGetter) {
|
|
|
752
773
|
}
|
|
753
774
|
prevName = name;
|
|
754
775
|
}
|
|
755
|
-
const teardown =
|
|
776
|
+
const teardown = reactiveBinding(commit);
|
|
756
777
|
return () => {
|
|
757
778
|
teardown();
|
|
758
779
|
if (prevName !== null) {
|
|
@@ -832,7 +853,7 @@ function bindChildNode(placeholder, getter) {
|
|
|
832
853
|
}
|
|
833
854
|
lastNodes = newNodes;
|
|
834
855
|
}
|
|
835
|
-
return
|
|
856
|
+
return reactiveBinding(commit);
|
|
836
857
|
}
|
|
837
858
|
|
|
838
859
|
// src/core/rendering/dispose.ts
|
|
@@ -931,6 +952,18 @@ var CLOBBER_RISKY_IDS = /* @__PURE__ */ new Set([
|
|
|
931
952
|
function setProp2(el, key, val) {
|
|
932
953
|
el[key] = val;
|
|
933
954
|
}
|
|
955
|
+
function looksLikeClassList(s2) {
|
|
956
|
+
const t = s2.trim();
|
|
957
|
+
if (!t) return false;
|
|
958
|
+
const tokens = t.split(/\s+/);
|
|
959
|
+
let sawClassish = false;
|
|
960
|
+
for (let i2 = 0; i2 < tokens.length; i2++) {
|
|
961
|
+
const tok = tokens[i2];
|
|
962
|
+
if (!/^-?[A-Za-z_][A-Za-z0-9_:/.-]*$/.test(tok)) return false;
|
|
963
|
+
if (/[-:/0-9]/.test(tok)) sawClassish = true;
|
|
964
|
+
}
|
|
965
|
+
return sawClassish;
|
|
966
|
+
}
|
|
934
967
|
var kebabCache = /* @__PURE__ */ new Map();
|
|
935
968
|
function toKebab(prop) {
|
|
936
969
|
let cached = kebabCache.get(prop);
|
|
@@ -1066,6 +1099,11 @@ var tagFactory = (tag, ns) => {
|
|
|
1066
1099
|
appendChildren(el, second);
|
|
1067
1100
|
return el;
|
|
1068
1101
|
}
|
|
1102
|
+
if (_isDev6 && looksLikeClassList(first)) {
|
|
1103
|
+
devWarn(
|
|
1104
|
+
`tagFactory: lone string "${first}" looks like a class list but is being rendered as TEXT. For a class, use ${tag}({ class: "${first}" }) \u2014 or ${tag}("${first}", children) to set the class AND add children.`
|
|
1105
|
+
);
|
|
1106
|
+
}
|
|
1069
1107
|
el.textContent = first;
|
|
1070
1108
|
return el;
|
|
1071
1109
|
}
|
|
@@ -4174,7 +4212,10 @@ function getMemoizedFallback(fallbackFn, error, retry) {
|
|
|
4174
4212
|
}
|
|
4175
4213
|
return factory();
|
|
4176
4214
|
}
|
|
4177
|
-
function ErrorBoundary(
|
|
4215
|
+
function ErrorBoundary(optionsOrChildren, maybeChildren) {
|
|
4216
|
+
const children = typeof optionsOrChildren === "function" ? optionsOrChildren : maybeChildren;
|
|
4217
|
+
const options = typeof optionsOrChildren === "function" ? {} : optionsOrChildren;
|
|
4218
|
+
const { fallback, onError, resetKeys } = options;
|
|
4178
4219
|
injectStyles2();
|
|
4179
4220
|
const [error, setError] = signal(null);
|
|
4180
4221
|
const retry = () => {
|
|
@@ -4249,7 +4290,7 @@ function ErrorBoundary({ nodes, fallback, onError, resetKeys }) {
|
|
|
4249
4290
|
return tryRenderFallback(currentError);
|
|
4250
4291
|
}
|
|
4251
4292
|
try {
|
|
4252
|
-
const result =
|
|
4293
|
+
const result = children();
|
|
4253
4294
|
if (result && typeof result.then === "function") {
|
|
4254
4295
|
const asyncContainer = div({ class: "sibu-error-async" });
|
|
4255
4296
|
asyncContainer.appendChild(span({ class: "sibu-lazy-loading", nodes: "Loading..." }));
|
package/dist/index.d.cts
CHANGED
|
@@ -1422,11 +1422,7 @@ interface SuspenseProps {
|
|
|
1422
1422
|
}
|
|
1423
1423
|
declare function Suspense({ nodes, fallback }: SuspenseProps): HTMLElement;
|
|
1424
1424
|
|
|
1425
|
-
interface
|
|
1426
|
-
/**
|
|
1427
|
-
* Function that renders child content or throws.
|
|
1428
|
-
*/
|
|
1429
|
-
nodes: () => Element;
|
|
1425
|
+
interface ErrorBoundaryOptions {
|
|
1430
1426
|
/**
|
|
1431
1427
|
* Fallback renderer given an Error and retry callback.
|
|
1432
1428
|
* Memoized internally — only re-created when the error changes.
|
|
@@ -1446,27 +1442,30 @@ interface ErrorBoundaryProps {
|
|
|
1446
1442
|
* @example
|
|
1447
1443
|
* ```ts
|
|
1448
1444
|
* const [route, setRoute] = signal("/");
|
|
1449
|
-
* ErrorBoundary(
|
|
1450
|
-
* resetKeys: [route],
|
|
1451
|
-
*
|
|
1452
|
-
*
|
|
1445
|
+
* ErrorBoundary(
|
|
1446
|
+
* { resetKeys: [route] },
|
|
1447
|
+
* () => div(riskyPageFor(route())),
|
|
1448
|
+
* );
|
|
1453
1449
|
* ```
|
|
1454
1450
|
*/
|
|
1455
1451
|
resetKeys?: Array<() => unknown>;
|
|
1456
1452
|
}
|
|
1453
|
+
/** @deprecated Renamed to `ErrorBoundaryOptions`; kept for typing compatibility. */
|
|
1454
|
+
type ErrorBoundaryProps = ErrorBoundaryOptions;
|
|
1457
1455
|
/**
|
|
1458
1456
|
* ErrorBoundary component using SibuJS reactive pattern.
|
|
1459
1457
|
*
|
|
1460
1458
|
* Features:
|
|
1461
|
-
* - Catches sync errors thrown by
|
|
1462
|
-
* - Catches async errors (Promise rejections) from
|
|
1459
|
+
* - Catches sync errors thrown by children
|
|
1460
|
+
* - Catches async errors (Promise rejections) from children
|
|
1463
1461
|
* - Supports nested ErrorBoundaries (inner catches first, outer catches propagation)
|
|
1464
|
-
* - Retry functionality to clear error and re-render
|
|
1462
|
+
* - Retry functionality to clear error and re-render children
|
|
1465
1463
|
* - Memoized fallback to avoid re-creating fallback UI on every render
|
|
1466
1464
|
* - onError callback for logging/telemetry
|
|
1467
1465
|
* - Improved CSS styling
|
|
1468
1466
|
*/
|
|
1469
|
-
declare function ErrorBoundary(
|
|
1467
|
+
declare function ErrorBoundary(children: () => Element): Element;
|
|
1468
|
+
declare function ErrorBoundary(options: ErrorBoundaryOptions, children: () => Element): Element;
|
|
1470
1469
|
|
|
1471
1470
|
type ErrorSeverity = "error" | "warning" | "info";
|
|
1472
1471
|
interface ErrorDisplayProps {
|
|
@@ -1539,4 +1538,4 @@ interface LoadingProps {
|
|
|
1539
1538
|
*/
|
|
1540
1539
|
declare function Loading(props?: LoadingProps): HTMLElement;
|
|
1541
1540
|
|
|
1542
|
-
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, retrack, rp, rt, ruby, runInSSRContext, s, samp, script, section, select, setGlobalErrorHandler, setMaxDrainIterations, 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 };
|
|
1541
|
+
export { type Accessor, type ActionFn, type AnchorProps, type ArrayActions, type AsyncDerivedState, type AudioProps, type ButtonProps, type Context, DynamicComponent, type EffectBody, type EffectOptions, ErrorBoundary, type ErrorBoundaryOptions, 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, retrack, rp, rt, ruby, runInSSRContext, s, samp, script, section, select, setGlobalErrorHandler, setMaxDrainIterations, 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
|
@@ -1422,11 +1422,7 @@ interface SuspenseProps {
|
|
|
1422
1422
|
}
|
|
1423
1423
|
declare function Suspense({ nodes, fallback }: SuspenseProps): HTMLElement;
|
|
1424
1424
|
|
|
1425
|
-
interface
|
|
1426
|
-
/**
|
|
1427
|
-
* Function that renders child content or throws.
|
|
1428
|
-
*/
|
|
1429
|
-
nodes: () => Element;
|
|
1425
|
+
interface ErrorBoundaryOptions {
|
|
1430
1426
|
/**
|
|
1431
1427
|
* Fallback renderer given an Error and retry callback.
|
|
1432
1428
|
* Memoized internally — only re-created when the error changes.
|
|
@@ -1446,27 +1442,30 @@ interface ErrorBoundaryProps {
|
|
|
1446
1442
|
* @example
|
|
1447
1443
|
* ```ts
|
|
1448
1444
|
* const [route, setRoute] = signal("/");
|
|
1449
|
-
* ErrorBoundary(
|
|
1450
|
-
* resetKeys: [route],
|
|
1451
|
-
*
|
|
1452
|
-
*
|
|
1445
|
+
* ErrorBoundary(
|
|
1446
|
+
* { resetKeys: [route] },
|
|
1447
|
+
* () => div(riskyPageFor(route())),
|
|
1448
|
+
* );
|
|
1453
1449
|
* ```
|
|
1454
1450
|
*/
|
|
1455
1451
|
resetKeys?: Array<() => unknown>;
|
|
1456
1452
|
}
|
|
1453
|
+
/** @deprecated Renamed to `ErrorBoundaryOptions`; kept for typing compatibility. */
|
|
1454
|
+
type ErrorBoundaryProps = ErrorBoundaryOptions;
|
|
1457
1455
|
/**
|
|
1458
1456
|
* ErrorBoundary component using SibuJS reactive pattern.
|
|
1459
1457
|
*
|
|
1460
1458
|
* Features:
|
|
1461
|
-
* - Catches sync errors thrown by
|
|
1462
|
-
* - Catches async errors (Promise rejections) from
|
|
1459
|
+
* - Catches sync errors thrown by children
|
|
1460
|
+
* - Catches async errors (Promise rejections) from children
|
|
1463
1461
|
* - Supports nested ErrorBoundaries (inner catches first, outer catches propagation)
|
|
1464
|
-
* - Retry functionality to clear error and re-render
|
|
1462
|
+
* - Retry functionality to clear error and re-render children
|
|
1465
1463
|
* - Memoized fallback to avoid re-creating fallback UI on every render
|
|
1466
1464
|
* - onError callback for logging/telemetry
|
|
1467
1465
|
* - Improved CSS styling
|
|
1468
1466
|
*/
|
|
1469
|
-
declare function ErrorBoundary(
|
|
1467
|
+
declare function ErrorBoundary(children: () => Element): Element;
|
|
1468
|
+
declare function ErrorBoundary(options: ErrorBoundaryOptions, children: () => Element): Element;
|
|
1470
1469
|
|
|
1471
1470
|
type ErrorSeverity = "error" | "warning" | "info";
|
|
1472
1471
|
interface ErrorDisplayProps {
|
|
@@ -1539,4 +1538,4 @@ interface LoadingProps {
|
|
|
1539
1538
|
*/
|
|
1540
1539
|
declare function Loading(props?: LoadingProps): HTMLElement;
|
|
1541
1540
|
|
|
1542
|
-
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, retrack, rp, rt, ruby, runInSSRContext, s, samp, script, section, select, setGlobalErrorHandler, setMaxDrainIterations, 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 };
|
|
1541
|
+
export { type Accessor, type ActionFn, type AnchorProps, type ArrayActions, type AsyncDerivedState, type AudioProps, type ButtonProps, type Context, DynamicComponent, type EffectBody, type EffectOptions, ErrorBoundary, type ErrorBoundaryOptions, 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, retrack, rp, rt, ruby, runInSSRContext, s, samp, script, section, select, setGlobalErrorHandler, setMaxDrainIterations, 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
|
@@ -44,7 +44,7 @@ import {
|
|
|
44
44
|
unregisterComponent,
|
|
45
45
|
when,
|
|
46
46
|
writable
|
|
47
|
-
} from "./chunk-
|
|
47
|
+
} from "./chunk-CR4MXPHB.js";
|
|
48
48
|
import {
|
|
49
49
|
__resetIdCounter,
|
|
50
50
|
createId
|
|
@@ -186,26 +186,26 @@ import {
|
|
|
186
186
|
use,
|
|
187
187
|
var_,
|
|
188
188
|
video
|
|
189
|
-
} from "./chunk-
|
|
189
|
+
} from "./chunk-2HAGQWDV.js";
|
|
190
190
|
import {
|
|
191
191
|
watch
|
|
192
|
-
} from "./chunk-
|
|
192
|
+
} from "./chunk-3DJH25UO.js";
|
|
193
193
|
import {
|
|
194
194
|
trustHTML
|
|
195
195
|
} from "./chunk-JYD2PWXH.js";
|
|
196
196
|
import {
|
|
197
197
|
context
|
|
198
|
-
} from "./chunk-
|
|
198
|
+
} from "./chunk-EFOAE5NC.js";
|
|
199
199
|
import {
|
|
200
200
|
SVG_NS,
|
|
201
201
|
tagFactory
|
|
202
|
-
} from "./chunk-
|
|
202
|
+
} from "./chunk-WKUXSE7V.js";
|
|
203
203
|
import {
|
|
204
204
|
bindDynamic
|
|
205
|
-
} from "./chunk-
|
|
205
|
+
} from "./chunk-2ZJ7TSW4.js";
|
|
206
206
|
import {
|
|
207
207
|
derived
|
|
208
|
-
} from "./chunk-
|
|
208
|
+
} from "./chunk-SC437AMI.js";
|
|
209
209
|
import {
|
|
210
210
|
checkLeaks,
|
|
211
211
|
dispose,
|
|
@@ -215,7 +215,7 @@ import "./chunk-UCS6AMJ7.js";
|
|
|
215
215
|
import {
|
|
216
216
|
effect,
|
|
217
217
|
on
|
|
218
|
-
} from "./chunk-
|
|
218
|
+
} from "./chunk-ZIBE2SAT.js";
|
|
219
219
|
import {
|
|
220
220
|
disableSSR,
|
|
221
221
|
enableSSR,
|
|
@@ -229,12 +229,12 @@ import {
|
|
|
229
229
|
enqueueBatchedSignal,
|
|
230
230
|
isBatching,
|
|
231
231
|
signal
|
|
232
|
-
} from "./chunk-
|
|
232
|
+
} from "./chunk-RK4BQG25.js";
|
|
233
233
|
import {
|
|
234
234
|
retrack,
|
|
235
235
|
setMaxDrainIterations,
|
|
236
236
|
untracked
|
|
237
|
-
} from "./chunk-
|
|
237
|
+
} from "./chunk-3U4ZVXVD.js";
|
|
238
238
|
import "./chunk-LMLD24FC.js";
|
|
239
239
|
export {
|
|
240
240
|
DynamicComponent,
|
package/dist/motion.js
CHANGED
|
@@ -19,9 +19,9 @@ import {
|
|
|
19
19
|
stagger,
|
|
20
20
|
transition,
|
|
21
21
|
viewTransition
|
|
22
|
-
} from "./chunk-
|
|
23
|
-
import "./chunk-
|
|
24
|
-
import "./chunk-
|
|
22
|
+
} from "./chunk-GQ7RRFPU.js";
|
|
23
|
+
import "./chunk-RK4BQG25.js";
|
|
24
|
+
import "./chunk-3U4ZVXVD.js";
|
|
25
25
|
import "./chunk-LMLD24FC.js";
|
|
26
26
|
export {
|
|
27
27
|
TransitionGroup,
|
package/dist/patterns.cjs
CHANGED
|
@@ -188,7 +188,7 @@ function retrack(effectFn, subscriber) {
|
|
|
188
188
|
}
|
|
189
189
|
}
|
|
190
190
|
function track(effectFn, subscriber) {
|
|
191
|
-
if (!subscriber)
|
|
191
|
+
if (!subscriber) return reactiveBinding(effectFn);
|
|
192
192
|
cleanup(subscriber);
|
|
193
193
|
const prev = currentSubscriber;
|
|
194
194
|
currentSubscriber = subscriber;
|
|
@@ -206,6 +206,28 @@ function track(effectFn, subscriber) {
|
|
|
206
206
|
const sub = subscriber;
|
|
207
207
|
return sub._dispose ?? (sub._dispose = () => cleanup(subscriber));
|
|
208
208
|
}
|
|
209
|
+
function reactiveBinding(commit) {
|
|
210
|
+
const run = () => {
|
|
211
|
+
const s = subscriber;
|
|
212
|
+
if (s._reentrant) return;
|
|
213
|
+
s._reentrant = true;
|
|
214
|
+
try {
|
|
215
|
+
retrack(commit, subscriber);
|
|
216
|
+
} finally {
|
|
217
|
+
s._reentrant = false;
|
|
218
|
+
}
|
|
219
|
+
};
|
|
220
|
+
const subscriber = run;
|
|
221
|
+
subscriber.depsHead = null;
|
|
222
|
+
subscriber.depsTail = null;
|
|
223
|
+
subscriber._epoch = 0;
|
|
224
|
+
subscriber._structDirty = false;
|
|
225
|
+
subscriber._runEpoch = 0;
|
|
226
|
+
subscriber._runs = 0;
|
|
227
|
+
subscriber._reentrant = false;
|
|
228
|
+
run();
|
|
229
|
+
return subscriber._dispose ?? (subscriber._dispose = () => cleanup(subscriber));
|
|
230
|
+
}
|
|
209
231
|
function recordDependency(signal2) {
|
|
210
232
|
if (!currentSubscriber) return;
|
|
211
233
|
const sub = currentSubscriber;
|
package/dist/patterns.js
CHANGED
|
@@ -5,7 +5,7 @@ import {
|
|
|
5
5
|
optimisticList,
|
|
6
6
|
persisted,
|
|
7
7
|
timeline
|
|
8
|
-
} from "./chunk-
|
|
8
|
+
} from "./chunk-KB3BA2XK.js";
|
|
9
9
|
import {
|
|
10
10
|
RenderProp,
|
|
11
11
|
assertType,
|
|
@@ -22,11 +22,11 @@ import {
|
|
|
22
22
|
withProps,
|
|
23
23
|
withWrapper
|
|
24
24
|
} from "./chunk-CNZ35WI2.js";
|
|
25
|
-
import "./chunk-
|
|
26
|
-
import "./chunk-
|
|
25
|
+
import "./chunk-SC437AMI.js";
|
|
26
|
+
import "./chunk-ZIBE2SAT.js";
|
|
27
27
|
import "./chunk-2RA7SHDA.js";
|
|
28
|
-
import "./chunk-
|
|
29
|
-
import "./chunk-
|
|
28
|
+
import "./chunk-RK4BQG25.js";
|
|
29
|
+
import "./chunk-3U4ZVXVD.js";
|
|
30
30
|
import "./chunk-LMLD24FC.js";
|
|
31
31
|
export {
|
|
32
32
|
RenderProp,
|
package/dist/performance.js
CHANGED
|
@@ -33,15 +33,15 @@ import {
|
|
|
33
33
|
transitionState,
|
|
34
34
|
uniqueId,
|
|
35
35
|
yieldToMain
|
|
36
|
-
} from "./chunk-
|
|
36
|
+
} from "./chunk-3DYB5B3S.js";
|
|
37
37
|
import {
|
|
38
38
|
trustHTML
|
|
39
39
|
} from "./chunk-JYD2PWXH.js";
|
|
40
40
|
import "./chunk-UCS6AMJ7.js";
|
|
41
|
-
import "./chunk-
|
|
41
|
+
import "./chunk-ZIBE2SAT.js";
|
|
42
42
|
import "./chunk-2RA7SHDA.js";
|
|
43
|
-
import "./chunk-
|
|
44
|
-
import "./chunk-
|
|
43
|
+
import "./chunk-RK4BQG25.js";
|
|
44
|
+
import "./chunk-3U4ZVXVD.js";
|
|
45
45
|
import "./chunk-LMLD24FC.js";
|
|
46
46
|
export {
|
|
47
47
|
DOMPool,
|
package/dist/plugins.cjs
CHANGED
|
@@ -901,7 +901,7 @@ function retrack(effectFn, subscriber) {
|
|
|
901
901
|
}
|
|
902
902
|
}
|
|
903
903
|
function track(effectFn, subscriber) {
|
|
904
|
-
if (!subscriber)
|
|
904
|
+
if (!subscriber) return reactiveBinding(effectFn);
|
|
905
905
|
cleanup(subscriber);
|
|
906
906
|
const prev = currentSubscriber;
|
|
907
907
|
currentSubscriber = subscriber;
|
|
@@ -919,6 +919,28 @@ function track(effectFn, subscriber) {
|
|
|
919
919
|
const sub2 = subscriber;
|
|
920
920
|
return sub2._dispose ?? (sub2._dispose = () => cleanup(subscriber));
|
|
921
921
|
}
|
|
922
|
+
function reactiveBinding(commit) {
|
|
923
|
+
const run = () => {
|
|
924
|
+
const s2 = subscriber;
|
|
925
|
+
if (s2._reentrant) return;
|
|
926
|
+
s2._reentrant = true;
|
|
927
|
+
try {
|
|
928
|
+
retrack(commit, subscriber);
|
|
929
|
+
} finally {
|
|
930
|
+
s2._reentrant = false;
|
|
931
|
+
}
|
|
932
|
+
};
|
|
933
|
+
const subscriber = run;
|
|
934
|
+
subscriber.depsHead = null;
|
|
935
|
+
subscriber.depsTail = null;
|
|
936
|
+
subscriber._epoch = 0;
|
|
937
|
+
subscriber._structDirty = false;
|
|
938
|
+
subscriber._runEpoch = 0;
|
|
939
|
+
subscriber._runs = 0;
|
|
940
|
+
subscriber._reentrant = false;
|
|
941
|
+
run();
|
|
942
|
+
return subscriber._dispose ?? (subscriber._dispose = () => cleanup(subscriber));
|
|
943
|
+
}
|
|
922
944
|
function recordDependency(signal2) {
|
|
923
945
|
if (!currentSubscriber) return;
|
|
924
946
|
const sub2 = currentSubscriber;
|
|
@@ -1115,8 +1137,7 @@ function bindAttribute(el, attr, getter) {
|
|
|
1115
1137
|
el.setAttribute(attr, isUrlAttribute(attr) ? sanitizeUrl(str) : str);
|
|
1116
1138
|
}
|
|
1117
1139
|
}
|
|
1118
|
-
|
|
1119
|
-
return teardown;
|
|
1140
|
+
return reactiveBinding(commit);
|
|
1120
1141
|
}
|
|
1121
1142
|
|
|
1122
1143
|
// src/reactivity/bindChildNode.ts
|
|
@@ -1191,7 +1212,7 @@ function bindChildNode(placeholder, getter) {
|
|
|
1191
1212
|
}
|
|
1192
1213
|
lastNodes = newNodes;
|
|
1193
1214
|
}
|
|
1194
|
-
return
|
|
1215
|
+
return reactiveBinding(commit);
|
|
1195
1216
|
}
|
|
1196
1217
|
|
|
1197
1218
|
// src/core/rendering/tagFactory.ts
|
|
@@ -1285,6 +1306,18 @@ var CLOBBER_RISKY_IDS = /* @__PURE__ */ new Set([
|
|
|
1285
1306
|
function setProp2(el, key, val) {
|
|
1286
1307
|
el[key] = val;
|
|
1287
1308
|
}
|
|
1309
|
+
function looksLikeClassList(s2) {
|
|
1310
|
+
const t2 = s2.trim();
|
|
1311
|
+
if (!t2) return false;
|
|
1312
|
+
const tokens = t2.split(/\s+/);
|
|
1313
|
+
let sawClassish = false;
|
|
1314
|
+
for (let i2 = 0; i2 < tokens.length; i2++) {
|
|
1315
|
+
const tok = tokens[i2];
|
|
1316
|
+
if (!/^-?[A-Za-z_][A-Za-z0-9_:/.-]*$/.test(tok)) return false;
|
|
1317
|
+
if (/[-:/0-9]/.test(tok)) sawClassish = true;
|
|
1318
|
+
}
|
|
1319
|
+
return sawClassish;
|
|
1320
|
+
}
|
|
1288
1321
|
var kebabCache = /* @__PURE__ */ new Map();
|
|
1289
1322
|
function toKebab(prop) {
|
|
1290
1323
|
let cached = kebabCache.get(prop);
|
|
@@ -1420,6 +1453,11 @@ var tagFactory = (tag, ns) => {
|
|
|
1420
1453
|
appendChildren(el, second);
|
|
1421
1454
|
return el;
|
|
1422
1455
|
}
|
|
1456
|
+
if (_isDev6 && looksLikeClassList(first)) {
|
|
1457
|
+
devWarn(
|
|
1458
|
+
`tagFactory: lone string "${first}" looks like a class list but is being rendered as TEXT. For a class, use ${tag}({ class: "${first}" }) \u2014 or ${tag}("${first}", children) to set the class AND add children.`
|
|
1459
|
+
);
|
|
1460
|
+
}
|
|
1423
1461
|
el.textContent = first;
|
|
1424
1462
|
return el;
|
|
1425
1463
|
}
|
package/dist/plugins.js
CHANGED
|
@@ -32,13 +32,13 @@ import {
|
|
|
32
32
|
} from "./chunk-3JHCYHWN.js";
|
|
33
33
|
import {
|
|
34
34
|
span
|
|
35
|
-
} from "./chunk-
|
|
35
|
+
} from "./chunk-2HAGQWDV.js";
|
|
36
36
|
import {
|
|
37
37
|
escapeScriptJson,
|
|
38
38
|
renderToString
|
|
39
39
|
} from "./chunk-JYD2PWXH.js";
|
|
40
|
-
import "./chunk-
|
|
41
|
-
import "./chunk-
|
|
40
|
+
import "./chunk-WKUXSE7V.js";
|
|
41
|
+
import "./chunk-2ZJ7TSW4.js";
|
|
42
42
|
import {
|
|
43
43
|
dispose,
|
|
44
44
|
registerDisposer
|
|
@@ -48,14 +48,14 @@ import {
|
|
|
48
48
|
} from "./chunk-UCS6AMJ7.js";
|
|
49
49
|
import {
|
|
50
50
|
effect
|
|
51
|
-
} from "./chunk-
|
|
51
|
+
} from "./chunk-ZIBE2SAT.js";
|
|
52
52
|
import "./chunk-2RA7SHDA.js";
|
|
53
53
|
import {
|
|
54
54
|
signal
|
|
55
|
-
} from "./chunk-
|
|
55
|
+
} from "./chunk-RK4BQG25.js";
|
|
56
56
|
import {
|
|
57
57
|
track
|
|
58
|
-
} from "./chunk-
|
|
58
|
+
} from "./chunk-3U4ZVXVD.js";
|
|
59
59
|
import "./chunk-LMLD24FC.js";
|
|
60
60
|
|
|
61
61
|
// src/plugins/i18n.ts
|