sibujs 4.9.0 → 4.10.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/browser.cjs +41 -4
- package/dist/browser.js +4 -4
- package/dist/build.cjs +102 -38
- package/dist/build.js +10 -10
- package/dist/cdn.dev.global.js +14 -14
- package/dist/cdn.full.dev.global.js +13 -13
- package/dist/cdn.full.global.js +12 -12
- package/dist/cdn.global.js +15 -15
- package/dist/{chunk-7OV5Q2UU.js → chunk-2D47RVVK.js} +4 -4
- package/dist/{chunk-5MLWTIQE.js → chunk-2T73SWKF.js} +2 -2
- package/dist/{chunk-YW6HQKGO.js → chunk-42REZXE4.js} +2 -2
- package/dist/{chunk-SBTZEYNI.js → chunk-6DYRY2NF.js} +8 -1
- package/dist/{chunk-562UVHMM.js → chunk-ADJEMTRC.js} +11 -6
- package/dist/{chunk-SYHGGDNW.js → chunk-BNZDDNBR.js} +1 -1
- package/dist/{chunk-K6K5ACO6.js → chunk-CID4BYBF.js} +3 -3
- package/dist/{chunk-TV464N2M.js → chunk-CYUU3XXG.js} +3 -3
- package/dist/{chunk-FNOK662L.js → chunk-CZINTERN.js} +73 -43
- package/dist/{chunk-CDBKFGXN.js → chunk-DA2LJXK3.js} +1 -1
- package/dist/{chunk-MPWDSTYK.js → chunk-DS6PFIZK.js} +1 -1
- package/dist/{chunk-XJVTQUIV.js → chunk-GEQNWNYS.js} +5 -5
- package/dist/{chunk-FHCZMHHE.js → chunk-GVVZPMA5.js} +1 -1
- package/dist/{chunk-NQMKWBKU.js → chunk-HZQEL575.js} +1 -1
- package/dist/{chunk-CF2KCWRE.js → chunk-JZMLRF2G.js} +2 -2
- package/dist/{chunk-X7NRHFZR.js → chunk-LK3VK47W.js} +1 -1
- package/dist/{chunk-2K3Z3XO4.js → chunk-LYM6TT2R.js} +4 -4
- package/dist/{chunk-KG25XMGP.js → chunk-MJZUXQHR.js} +15 -8
- package/dist/{chunk-G2WHYEL7.js → chunk-NROLUUCO.js} +39 -4
- package/dist/{chunk-DRMLIF6M.js → chunk-WHZKRSHQ.js} +19 -12
- package/dist/{chunk-QBKCK6MJ.js → chunk-YNE4FSVX.js} +1 -1
- package/dist/data.cjs +48 -6
- package/dist/data.d.cts +9 -1
- package/dist/data.d.ts +9 -1
- package/dist/data.js +5 -5
- package/dist/devtools.cjs +41 -4
- package/dist/devtools.js +4 -4
- package/dist/ecosystem.cjs +41 -4
- package/dist/ecosystem.js +7 -7
- package/dist/extras.cjs +75 -25
- package/dist/extras.js +20 -20
- package/dist/index.cjs +102 -38
- package/dist/index.d.cts +32 -4
- package/dist/index.d.ts +32 -4
- package/dist/index.js +10 -10
- package/dist/motion.cjs +36 -4
- package/dist/motion.js +3 -3
- package/dist/patterns.cjs +41 -4
- package/dist/patterns.js +5 -5
- package/dist/performance.cjs +55 -14
- package/dist/performance.js +4 -4
- package/dist/plugins.cjs +163 -51
- package/dist/plugins.d.cts +56 -2
- package/dist/plugins.d.ts +56 -2
- package/dist/plugins.js +130 -52
- package/dist/ssr.cjs +50 -9
- package/dist/ssr.js +7 -7
- package/dist/testing.cjs +41 -4
- package/dist/testing.js +2 -2
- package/dist/ui.cjs +41 -4
- package/dist/ui.js +7 -7
- package/dist/widgets.cjs +36 -4
- package/dist/widgets.js +6 -6
- package/package.json +1 -1
package/dist/browser.cjs
CHANGED
|
@@ -327,6 +327,24 @@ function untracked(fn) {
|
|
|
327
327
|
resumeTracking();
|
|
328
328
|
}
|
|
329
329
|
}
|
|
330
|
+
var currentOwnerScope = null;
|
|
331
|
+
function getOwnerScope() {
|
|
332
|
+
return currentOwnerScope;
|
|
333
|
+
}
|
|
334
|
+
function runWithOwnerScope(scope, fn) {
|
|
335
|
+
const prev = currentOwnerScope;
|
|
336
|
+
currentOwnerScope = scope;
|
|
337
|
+
try {
|
|
338
|
+
return fn();
|
|
339
|
+
} finally {
|
|
340
|
+
currentOwnerScope = prev;
|
|
341
|
+
}
|
|
342
|
+
}
|
|
343
|
+
function bindOwnerScope(fn) {
|
|
344
|
+
const scope = currentOwnerScope;
|
|
345
|
+
if (scope === null) return fn;
|
|
346
|
+
return (...args) => runWithOwnerScope(scope, () => fn(...args));
|
|
347
|
+
}
|
|
330
348
|
var subscriberEpochCounter = 0;
|
|
331
349
|
function retrack(effectFn, subscriber) {
|
|
332
350
|
const prev = currentSubscriber;
|
|
@@ -342,6 +360,10 @@ function retrack(effectFn, subscriber) {
|
|
|
342
360
|
currentSubscriber = subscriber;
|
|
343
361
|
const sub = subscriber;
|
|
344
362
|
if (sub._cap === void 0) sub._cap = currentDisposerCapture();
|
|
363
|
+
const prevScope = currentOwnerScope;
|
|
364
|
+
if (prevScope !== null && !sub._epoch && sub._scope === void 0) sub._scope = prevScope;
|
|
365
|
+
const scope = sub._scope === void 0 ? null : sub._scope;
|
|
366
|
+
if (scope !== prevScope) currentOwnerScope = scope;
|
|
345
367
|
const epoch = ++subscriberEpochCounter;
|
|
346
368
|
sub._epoch = epoch;
|
|
347
369
|
sub._structDirty = false;
|
|
@@ -354,6 +376,7 @@ function retrack(effectFn, subscriber) {
|
|
|
354
376
|
effectFn();
|
|
355
377
|
} finally {
|
|
356
378
|
currentSubscriber = prev;
|
|
379
|
+
currentOwnerScope = prevScope;
|
|
357
380
|
if (savedDepth !== 0) {
|
|
358
381
|
suspendDepth = savedDepth;
|
|
359
382
|
suspendSavedSub = savedSuspendSub;
|
|
@@ -388,23 +411,26 @@ function track(effectFn, subscriber) {
|
|
|
388
411
|
trackingSuspended = false;
|
|
389
412
|
}
|
|
390
413
|
currentSubscriber = subscriber;
|
|
414
|
+
const sub = subscriber;
|
|
415
|
+
if (sub._scope === void 0) sub._scope = currentOwnerScope;
|
|
416
|
+
const prevScope = currentOwnerScope;
|
|
417
|
+
currentOwnerScope = sub._scope;
|
|
391
418
|
try {
|
|
392
419
|
effectFn();
|
|
393
420
|
} finally {
|
|
394
421
|
currentSubscriber = prev;
|
|
422
|
+
currentOwnerScope = prevScope;
|
|
395
423
|
if (savedDepth !== 0) {
|
|
396
424
|
suspendDepth = savedDepth;
|
|
397
425
|
suspendSavedSub = savedSuspendSub;
|
|
398
426
|
trackingSuspended = true;
|
|
399
427
|
}
|
|
400
|
-
|
|
401
|
-
for (let n = sub2.depsHead ?? null; n !== null; n = n.subNext) {
|
|
428
|
+
for (let n = sub.depsHead ?? null; n !== null; n = n.subNext) {
|
|
402
429
|
const sig = n.sig;
|
|
403
430
|
sig.__activeNode = n.prevActive;
|
|
404
431
|
n.prevActive = null;
|
|
405
432
|
}
|
|
406
433
|
}
|
|
407
|
-
const sub = subscriber;
|
|
408
434
|
return sub._dispose ?? (sub._dispose = () => cleanup(subscriber));
|
|
409
435
|
}
|
|
410
436
|
function reactiveBinding(commit, ownerNode) {
|
|
@@ -674,7 +700,7 @@ function forEachSubscriber(signal2, visit) {
|
|
|
674
700
|
}
|
|
675
701
|
|
|
676
702
|
// src/reactivity/track.ts
|
|
677
|
-
var _runtimeVersion = true ? "4.
|
|
703
|
+
var _runtimeVersion = true ? "4.10.1" : "dev";
|
|
678
704
|
var REGISTRY_KEY = /* @__PURE__ */ Symbol.for("sibujs.reactive.v1");
|
|
679
705
|
function resolveReactiveApi() {
|
|
680
706
|
const g = globalThis;
|
|
@@ -706,6 +732,9 @@ function resolveReactiveApi() {
|
|
|
706
732
|
getSubscriberCount,
|
|
707
733
|
getSubscriberDeps,
|
|
708
734
|
forEachSubscriber,
|
|
735
|
+
getOwnerScope,
|
|
736
|
+
runWithOwnerScope,
|
|
737
|
+
bindOwnerScope,
|
|
709
738
|
version: _runtimeVersion
|
|
710
739
|
};
|
|
711
740
|
g[REGISTRY_KEY] = local;
|
|
@@ -729,6 +758,9 @@ var notifySubscribers2 = API.notifySubscribers;
|
|
|
729
758
|
var getSubscriberCount2 = API.getSubscriberCount;
|
|
730
759
|
var getSubscriberDeps2 = API.getSubscriberDeps;
|
|
731
760
|
var forEachSubscriber2 = API.forEachSubscriber;
|
|
761
|
+
var getOwnerScope2 = API.getOwnerScope ?? getOwnerScope;
|
|
762
|
+
var runWithOwnerScope2 = API.runWithOwnerScope ?? runWithOwnerScope;
|
|
763
|
+
var bindOwnerScope2 = API.bindOwnerScope ?? bindOwnerScope;
|
|
732
764
|
|
|
733
765
|
// src/reactivity/batch.ts
|
|
734
766
|
var batchDepth = 0;
|
|
@@ -924,6 +956,11 @@ function flushUserCleanups(ctx) {
|
|
|
924
956
|
const list = ctx.userCleanups;
|
|
925
957
|
if (list.length === 0) return;
|
|
926
958
|
ctx.userCleanups = [];
|
|
959
|
+
const scope = ctx.subscriber._scope ?? null;
|
|
960
|
+
if (scope === getOwnerScope2()) runCleanups(list);
|
|
961
|
+
else runWithOwnerScope2(scope, () => runCleanups(list));
|
|
962
|
+
}
|
|
963
|
+
function runCleanups(list) {
|
|
927
964
|
for (let i = list.length - 1; i >= 0; i--) {
|
|
928
965
|
try {
|
|
929
966
|
list[i]();
|
package/dist/browser.js
CHANGED
|
@@ -36,15 +36,15 @@ import {
|
|
|
36
36
|
visibility,
|
|
37
37
|
wakeLock,
|
|
38
38
|
windowSize
|
|
39
|
-
} from "./chunk-
|
|
39
|
+
} from "./chunk-42REZXE4.js";
|
|
40
40
|
import "./chunk-52XFPGSN.js";
|
|
41
41
|
import "./chunk-62BDYGAG.js";
|
|
42
42
|
import "./chunk-7ZHH77QA.js";
|
|
43
|
-
import "./chunk-
|
|
43
|
+
import "./chunk-6DYRY2NF.js";
|
|
44
44
|
import "./chunk-EXXSN3BW.js";
|
|
45
45
|
import "./chunk-7XHATCIH.js";
|
|
46
|
-
import "./chunk-
|
|
47
|
-
import "./chunk-
|
|
46
|
+
import "./chunk-BNZDDNBR.js";
|
|
47
|
+
import "./chunk-NROLUUCO.js";
|
|
48
48
|
import "./chunk-NYNYSPK7.js";
|
|
49
49
|
export {
|
|
50
50
|
__resetSpeechCoordinator,
|
package/dist/build.cjs
CHANGED
|
@@ -3201,6 +3201,24 @@ function untracked(fn) {
|
|
|
3201
3201
|
resumeTracking();
|
|
3202
3202
|
}
|
|
3203
3203
|
}
|
|
3204
|
+
var currentOwnerScope = null;
|
|
3205
|
+
function getOwnerScope() {
|
|
3206
|
+
return currentOwnerScope;
|
|
3207
|
+
}
|
|
3208
|
+
function runWithOwnerScope(scope, fn) {
|
|
3209
|
+
const prev = currentOwnerScope;
|
|
3210
|
+
currentOwnerScope = scope;
|
|
3211
|
+
try {
|
|
3212
|
+
return fn();
|
|
3213
|
+
} finally {
|
|
3214
|
+
currentOwnerScope = prev;
|
|
3215
|
+
}
|
|
3216
|
+
}
|
|
3217
|
+
function bindOwnerScope(fn) {
|
|
3218
|
+
const scope = currentOwnerScope;
|
|
3219
|
+
if (scope === null) return fn;
|
|
3220
|
+
return (...args) => runWithOwnerScope(scope, () => fn(...args));
|
|
3221
|
+
}
|
|
3204
3222
|
var subscriberEpochCounter = 0;
|
|
3205
3223
|
function retrack(effectFn, subscriber) {
|
|
3206
3224
|
const prev = currentSubscriber;
|
|
@@ -3216,6 +3234,10 @@ function retrack(effectFn, subscriber) {
|
|
|
3216
3234
|
currentSubscriber = subscriber;
|
|
3217
3235
|
const sub2 = subscriber;
|
|
3218
3236
|
if (sub2._cap === void 0) sub2._cap = currentDisposerCapture();
|
|
3237
|
+
const prevScope = currentOwnerScope;
|
|
3238
|
+
if (prevScope !== null && !sub2._epoch && sub2._scope === void 0) sub2._scope = prevScope;
|
|
3239
|
+
const scope = sub2._scope === void 0 ? null : sub2._scope;
|
|
3240
|
+
if (scope !== prevScope) currentOwnerScope = scope;
|
|
3219
3241
|
const epoch = ++subscriberEpochCounter;
|
|
3220
3242
|
sub2._epoch = epoch;
|
|
3221
3243
|
sub2._structDirty = false;
|
|
@@ -3228,6 +3250,7 @@ function retrack(effectFn, subscriber) {
|
|
|
3228
3250
|
effectFn();
|
|
3229
3251
|
} finally {
|
|
3230
3252
|
currentSubscriber = prev;
|
|
3253
|
+
currentOwnerScope = prevScope;
|
|
3231
3254
|
if (savedDepth !== 0) {
|
|
3232
3255
|
suspendDepth = savedDepth;
|
|
3233
3256
|
suspendSavedSub = savedSuspendSub;
|
|
@@ -3262,23 +3285,26 @@ function track(effectFn, subscriber) {
|
|
|
3262
3285
|
trackingSuspended = false;
|
|
3263
3286
|
}
|
|
3264
3287
|
currentSubscriber = subscriber;
|
|
3288
|
+
const sub2 = subscriber;
|
|
3289
|
+
if (sub2._scope === void 0) sub2._scope = currentOwnerScope;
|
|
3290
|
+
const prevScope = currentOwnerScope;
|
|
3291
|
+
currentOwnerScope = sub2._scope;
|
|
3265
3292
|
try {
|
|
3266
3293
|
effectFn();
|
|
3267
3294
|
} finally {
|
|
3268
3295
|
currentSubscriber = prev;
|
|
3296
|
+
currentOwnerScope = prevScope;
|
|
3269
3297
|
if (savedDepth !== 0) {
|
|
3270
3298
|
suspendDepth = savedDepth;
|
|
3271
3299
|
suspendSavedSub = savedSuspendSub;
|
|
3272
3300
|
trackingSuspended = true;
|
|
3273
3301
|
}
|
|
3274
|
-
|
|
3275
|
-
for (let n = sub3.depsHead ?? null; n !== null; n = n.subNext) {
|
|
3302
|
+
for (let n = sub2.depsHead ?? null; n !== null; n = n.subNext) {
|
|
3276
3303
|
const sig = n.sig;
|
|
3277
3304
|
sig.__activeNode = n.prevActive;
|
|
3278
3305
|
n.prevActive = null;
|
|
3279
3306
|
}
|
|
3280
3307
|
}
|
|
3281
|
-
const sub2 = subscriber;
|
|
3282
3308
|
return sub2._dispose ?? (sub2._dispose = () => cleanup(subscriber));
|
|
3283
3309
|
}
|
|
3284
3310
|
function reactiveBinding(commit, ownerNode) {
|
|
@@ -3548,7 +3574,7 @@ function forEachSubscriber(signal2, visit) {
|
|
|
3548
3574
|
}
|
|
3549
3575
|
|
|
3550
3576
|
// src/reactivity/track.ts
|
|
3551
|
-
var _runtimeVersion = true ? "4.
|
|
3577
|
+
var _runtimeVersion = true ? "4.10.1" : "dev";
|
|
3552
3578
|
var REGISTRY_KEY = /* @__PURE__ */ Symbol.for("sibujs.reactive.v1");
|
|
3553
3579
|
function resolveReactiveApi() {
|
|
3554
3580
|
const g2 = globalThis;
|
|
@@ -3580,6 +3606,9 @@ function resolveReactiveApi() {
|
|
|
3580
3606
|
getSubscriberCount,
|
|
3581
3607
|
getSubscriberDeps,
|
|
3582
3608
|
forEachSubscriber,
|
|
3609
|
+
getOwnerScope,
|
|
3610
|
+
runWithOwnerScope,
|
|
3611
|
+
bindOwnerScope,
|
|
3583
3612
|
version: _runtimeVersion
|
|
3584
3613
|
};
|
|
3585
3614
|
g2[REGISTRY_KEY] = local;
|
|
@@ -3603,6 +3632,9 @@ var notifySubscribers2 = API.notifySubscribers;
|
|
|
3603
3632
|
var getSubscriberCount2 = API.getSubscriberCount;
|
|
3604
3633
|
var getSubscriberDeps2 = API.getSubscriberDeps;
|
|
3605
3634
|
var forEachSubscriber2 = API.forEachSubscriber;
|
|
3635
|
+
var getOwnerScope2 = API.getOwnerScope ?? getOwnerScope;
|
|
3636
|
+
var runWithOwnerScope2 = API.runWithOwnerScope ?? runWithOwnerScope;
|
|
3637
|
+
var bindOwnerScope2 = API.bindOwnerScope ?? bindOwnerScope;
|
|
3606
3638
|
|
|
3607
3639
|
// src/reactivity/bindAttribute.ts
|
|
3608
3640
|
function bindAttribute(el, attr, getter) {
|
|
@@ -4276,12 +4308,16 @@ function lazy(importFn) {
|
|
|
4276
4308
|
}
|
|
4277
4309
|
const container = div({ class: "sibu-lazy" });
|
|
4278
4310
|
let disposed = false;
|
|
4279
|
-
importFn().then(
|
|
4280
|
-
|
|
4281
|
-
|
|
4282
|
-
|
|
4283
|
-
|
|
4284
|
-
|
|
4311
|
+
importFn().then(
|
|
4312
|
+
// The component renders after the import resolves, in the owner scope
|
|
4313
|
+
// of whoever rendered the placeholder.
|
|
4314
|
+
bindOwnerScope2((mod) => {
|
|
4315
|
+
if (disposed) return;
|
|
4316
|
+
cached = mod.default;
|
|
4317
|
+
const rendered = cached();
|
|
4318
|
+
replaceChildrenSafely(container, rendered);
|
|
4319
|
+
})
|
|
4320
|
+
).catch((err) => {
|
|
4285
4321
|
if (disposed) return;
|
|
4286
4322
|
const errorObj = err instanceof Error ? err : new Error(String(err));
|
|
4287
4323
|
replaceChildrenSafely(
|
|
@@ -4312,7 +4348,7 @@ function Suspense({ nodes, fallback }) {
|
|
|
4312
4348
|
}
|
|
4313
4349
|
if (childEl && !container.contains(childEl)) dispose(childEl);
|
|
4314
4350
|
});
|
|
4315
|
-
|
|
4351
|
+
const renderContent = bindOwnerScope2(() => {
|
|
4316
4352
|
if (suspenseDisposed) return;
|
|
4317
4353
|
try {
|
|
4318
4354
|
const el = nodes();
|
|
@@ -4340,10 +4376,14 @@ function Suspense({ nodes, fallback }) {
|
|
|
4340
4376
|
dispatchPropagate(container, errorObj);
|
|
4341
4377
|
}
|
|
4342
4378
|
});
|
|
4379
|
+
queueMicrotask(renderContent);
|
|
4343
4380
|
return container;
|
|
4344
4381
|
}
|
|
4345
4382
|
|
|
4346
4383
|
// src/core/rendering/lifecycle.ts
|
|
4384
|
+
function pinScope(scope, fn) {
|
|
4385
|
+
return () => getOwnerScope2() === scope ? fn() : runWithOwnerScope2(scope, fn);
|
|
4386
|
+
}
|
|
4347
4387
|
function safeCall(cb, hookName) {
|
|
4348
4388
|
try {
|
|
4349
4389
|
return cb();
|
|
@@ -4353,13 +4393,14 @@ function safeCall(cb, hookName) {
|
|
|
4353
4393
|
return void 0;
|
|
4354
4394
|
}
|
|
4355
4395
|
}
|
|
4356
|
-
function runMountCallback(callback, hookName, element, isDisposed) {
|
|
4357
|
-
const
|
|
4358
|
-
if (typeof
|
|
4396
|
+
function runMountCallback(callback, hookName, element, isDisposed, scope) {
|
|
4397
|
+
const returned = safeCall(callback, hookName);
|
|
4398
|
+
if (typeof returned !== "function") return;
|
|
4399
|
+
const cleanup3 = pinScope(scope, returned);
|
|
4359
4400
|
if (isDisposed() || !element.isConnected) {
|
|
4360
4401
|
safeCall(cleanup3, "onUnmount");
|
|
4361
4402
|
} else {
|
|
4362
|
-
|
|
4403
|
+
watchUnmount(cleanup3, element);
|
|
4363
4404
|
}
|
|
4364
4405
|
}
|
|
4365
4406
|
var mountWatchers = /* @__PURE__ */ new WeakMap();
|
|
@@ -4519,6 +4560,8 @@ function registerUnmountWatcher(element, cb) {
|
|
|
4519
4560
|
}
|
|
4520
4561
|
function onMount(callback, element) {
|
|
4521
4562
|
if (typeof document === "undefined") return;
|
|
4563
|
+
const scope = getOwnerScope2();
|
|
4564
|
+
callback = pinScope(scope, callback);
|
|
4522
4565
|
if (element) {
|
|
4523
4566
|
let disposed = false;
|
|
4524
4567
|
const isDisposed = () => disposed;
|
|
@@ -4528,19 +4571,19 @@ function onMount(callback, element) {
|
|
|
4528
4571
|
if (element.isConnected) {
|
|
4529
4572
|
queueMicrotask(() => {
|
|
4530
4573
|
if (disposed) return;
|
|
4531
|
-
runMountCallback(callback, "onMount", element, isDisposed);
|
|
4574
|
+
runMountCallback(callback, "onMount", element, isDisposed, scope);
|
|
4532
4575
|
});
|
|
4533
4576
|
return;
|
|
4534
4577
|
}
|
|
4535
4578
|
queueMicrotask(() => {
|
|
4536
4579
|
if (disposed) return;
|
|
4537
4580
|
if (element.isConnected) {
|
|
4538
|
-
runMountCallback(callback, "onMount", element, isDisposed);
|
|
4581
|
+
runMountCallback(callback, "onMount", element, isDisposed, scope);
|
|
4539
4582
|
return;
|
|
4540
4583
|
}
|
|
4541
4584
|
const unregister = registerMountWatcher(element, () => {
|
|
4542
4585
|
if (disposed) return;
|
|
4543
|
-
runMountCallback(callback, "onMount", element, isDisposed);
|
|
4586
|
+
runMountCallback(callback, "onMount", element, isDisposed, scope);
|
|
4544
4587
|
});
|
|
4545
4588
|
registerDisposer(element, unregister);
|
|
4546
4589
|
});
|
|
@@ -4552,6 +4595,9 @@ function onMount(callback, element) {
|
|
|
4552
4595
|
}
|
|
4553
4596
|
function onUnmount(callback, element) {
|
|
4554
4597
|
if (typeof document === "undefined") return;
|
|
4598
|
+
watchUnmount(pinScope(getOwnerScope2(), callback), element);
|
|
4599
|
+
}
|
|
4600
|
+
function watchUnmount(callback, element) {
|
|
4555
4601
|
let fired = false;
|
|
4556
4602
|
const fireOnce = () => {
|
|
4557
4603
|
if (fired) return;
|
|
@@ -4714,6 +4760,11 @@ function flushUserCleanups(ctx) {
|
|
|
4714
4760
|
const list = ctx.userCleanups;
|
|
4715
4761
|
if (list.length === 0) return;
|
|
4716
4762
|
ctx.userCleanups = [];
|
|
4763
|
+
const scope = ctx.subscriber._scope ?? null;
|
|
4764
|
+
if (scope === getOwnerScope2()) runCleanups(list);
|
|
4765
|
+
else runWithOwnerScope2(scope, () => runCleanups(list));
|
|
4766
|
+
}
|
|
4767
|
+
function runCleanups(list) {
|
|
4717
4768
|
for (let i2 = list.length - 1; i2 >= 0; i2--) {
|
|
4718
4769
|
try {
|
|
4719
4770
|
list[i2]();
|
|
@@ -5643,11 +5694,15 @@ function ErrorBoundary(optionsOrChildren, maybeChildren) {
|
|
|
5643
5694
|
return;
|
|
5644
5695
|
}
|
|
5645
5696
|
replaceChildrenSafely(asyncContainer, el);
|
|
5646
|
-
}).catch(
|
|
5647
|
-
|
|
5648
|
-
|
|
5649
|
-
|
|
5650
|
-
|
|
5697
|
+
}).catch(
|
|
5698
|
+
// The fallback is rendered later, in the owner scope of the
|
|
5699
|
+
// render that produced the async child.
|
|
5700
|
+
bindOwnerScope2((e) => {
|
|
5701
|
+
if (asyncDisposed) return;
|
|
5702
|
+
const err = handleError(e);
|
|
5703
|
+
replaceChildrenSafely(asyncContainer, tryRenderFallback(err));
|
|
5704
|
+
})
|
|
5705
|
+
);
|
|
5651
5706
|
return asyncContainer;
|
|
5652
5707
|
}
|
|
5653
5708
|
return result;
|
|
@@ -6100,9 +6155,11 @@ function when(condition, thenBranch, elseBranch) {
|
|
|
6100
6155
|
currentNode = null;
|
|
6101
6156
|
});
|
|
6102
6157
|
if (!initialized) {
|
|
6103
|
-
queueMicrotask(
|
|
6104
|
-
|
|
6105
|
-
|
|
6158
|
+
queueMicrotask(
|
|
6159
|
+
bindOwnerScope2(() => {
|
|
6160
|
+
if (!disposed && !initialized && anchor.parentNode) update();
|
|
6161
|
+
})
|
|
6162
|
+
);
|
|
6106
6163
|
}
|
|
6107
6164
|
return anchor;
|
|
6108
6165
|
}
|
|
@@ -6141,9 +6198,11 @@ function match(value, cases, fallback) {
|
|
|
6141
6198
|
currentNode = null;
|
|
6142
6199
|
});
|
|
6143
6200
|
if (!initialized) {
|
|
6144
|
-
queueMicrotask(
|
|
6145
|
-
|
|
6146
|
-
|
|
6201
|
+
queueMicrotask(
|
|
6202
|
+
bindOwnerScope2(() => {
|
|
6203
|
+
if (!disposed && !initialized && anchor.parentNode) update();
|
|
6204
|
+
})
|
|
6205
|
+
);
|
|
6147
6206
|
}
|
|
6148
6207
|
return anchor;
|
|
6149
6208
|
}
|
|
@@ -6441,11 +6500,13 @@ function each(getArray, render, options) {
|
|
|
6441
6500
|
};
|
|
6442
6501
|
registerDisposer(anchor, disposeRange);
|
|
6443
6502
|
if (!initialized) {
|
|
6444
|
-
queueMicrotask(
|
|
6445
|
-
|
|
6446
|
-
|
|
6447
|
-
|
|
6448
|
-
|
|
6503
|
+
queueMicrotask(
|
|
6504
|
+
bindOwnerScope2(() => {
|
|
6505
|
+
if (!initialized && !rangeDisposed && anchor.parentNode) {
|
|
6506
|
+
update();
|
|
6507
|
+
}
|
|
6508
|
+
})
|
|
6509
|
+
);
|
|
6449
6510
|
}
|
|
6450
6511
|
return anchor;
|
|
6451
6512
|
}
|
|
@@ -6923,9 +6984,11 @@ function KeepAlive(activeKey, cases, options) {
|
|
|
6923
6984
|
};
|
|
6924
6985
|
const untrack = track2(update);
|
|
6925
6986
|
if (!initialized) {
|
|
6926
|
-
queueMicrotask(
|
|
6927
|
-
|
|
6928
|
-
|
|
6987
|
+
queueMicrotask(
|
|
6988
|
+
bindOwnerScope2(() => {
|
|
6989
|
+
if (!initialized && anchor.parentNode) update();
|
|
6990
|
+
})
|
|
6991
|
+
);
|
|
6929
6992
|
}
|
|
6930
6993
|
registerDisposer(anchor, () => {
|
|
6931
6994
|
disposed = true;
|
|
@@ -7030,7 +7093,7 @@ function Portal(nodes, target) {
|
|
|
7030
7093
|
const container = target || document.body;
|
|
7031
7094
|
let portalContent = null;
|
|
7032
7095
|
let disposed = false;
|
|
7033
|
-
|
|
7096
|
+
const renderContent = bindOwnerScope2(() => {
|
|
7034
7097
|
if (disposed) return;
|
|
7035
7098
|
try {
|
|
7036
7099
|
portalContent = nodes();
|
|
@@ -7045,6 +7108,7 @@ function Portal(nodes, target) {
|
|
|
7045
7108
|
});
|
|
7046
7109
|
}
|
|
7047
7110
|
});
|
|
7111
|
+
queueMicrotask(renderContent);
|
|
7048
7112
|
registerDisposer(anchor, () => {
|
|
7049
7113
|
disposed = true;
|
|
7050
7114
|
if (portalContent) {
|
package/dist/build.js
CHANGED
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
import {
|
|
2
2
|
index_exports
|
|
3
|
-
} from "./chunk-
|
|
4
|
-
import "./chunk-
|
|
3
|
+
} from "./chunk-CZINTERN.js";
|
|
4
|
+
import "./chunk-YNE4FSVX.js";
|
|
5
5
|
import "./chunk-FC6KCJSA.js";
|
|
6
|
-
import "./chunk-
|
|
7
|
-
import "./chunk-
|
|
6
|
+
import "./chunk-DA2LJXK3.js";
|
|
7
|
+
import "./chunk-GVVZPMA5.js";
|
|
8
8
|
import "./chunk-62BDYGAG.js";
|
|
9
|
-
import "./chunk-
|
|
10
|
-
import "./chunk-
|
|
9
|
+
import "./chunk-2T73SWKF.js";
|
|
10
|
+
import "./chunk-DS6PFIZK.js";
|
|
11
11
|
import "./chunk-3ACAAQIN.js";
|
|
12
|
-
import "./chunk-
|
|
12
|
+
import "./chunk-LK3VK47W.js";
|
|
13
13
|
import "./chunk-7ZHH77QA.js";
|
|
14
|
-
import "./chunk-
|
|
14
|
+
import "./chunk-6DYRY2NF.js";
|
|
15
15
|
import {
|
|
16
16
|
isEventHandlerAttr,
|
|
17
17
|
isHtmlContentAttribute,
|
|
@@ -19,8 +19,8 @@ import {
|
|
|
19
19
|
} from "./chunk-EXXSN3BW.js";
|
|
20
20
|
import "./chunk-7XHATCIH.js";
|
|
21
21
|
import "./chunk-5HZXGZ6T.js";
|
|
22
|
-
import "./chunk-
|
|
23
|
-
import "./chunk-
|
|
22
|
+
import "./chunk-BNZDDNBR.js";
|
|
23
|
+
import "./chunk-NROLUUCO.js";
|
|
24
24
|
import "./chunk-NYNYSPK7.js";
|
|
25
25
|
|
|
26
26
|
// src/build/sourceEdit.ts
|