sibujs 4.9.0 → 4.10.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 +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-FNOK662L.js → chunk-2NWHJ2UJ.js} +73 -43
- package/dist/{chunk-KG25XMGP.js → chunk-4DCVJ4YA.js} +15 -8
- package/dist/{chunk-CF2KCWRE.js → chunk-54F4TPHK.js} +2 -2
- package/dist/{chunk-X7NRHFZR.js → chunk-5PC7OTQW.js} +1 -1
- package/dist/{chunk-SBTZEYNI.js → chunk-7WIHYHWD.js} +8 -1
- package/dist/{chunk-K6K5ACO6.js → chunk-BMCR7TXG.js} +3 -3
- package/dist/{chunk-G2WHYEL7.js → chunk-D6HYFOWR.js} +39 -4
- package/dist/{chunk-5MLWTIQE.js → chunk-EVI4ZQO3.js} +2 -2
- package/dist/{chunk-CDBKFGXN.js → chunk-EVOK663Z.js} +1 -1
- package/dist/{chunk-SYHGGDNW.js → chunk-FYUEL5IW.js} +1 -1
- package/dist/{chunk-562UVHMM.js → chunk-GMMDHJJT.js} +11 -6
- package/dist/{chunk-FHCZMHHE.js → chunk-GOL3FU5Q.js} +1 -1
- package/dist/{chunk-YW6HQKGO.js → chunk-GTS35FLA.js} +2 -2
- package/dist/{chunk-2K3Z3XO4.js → chunk-IFRIBZ4O.js} +4 -4
- package/dist/{chunk-DRMLIF6M.js → chunk-IL5MMSCL.js} +19 -12
- package/dist/{chunk-XJVTQUIV.js → chunk-ITEL5KPL.js} +5 -5
- package/dist/{chunk-TV464N2M.js → chunk-JCKUWWHU.js} +3 -3
- package/dist/{chunk-QBKCK6MJ.js → chunk-N6U4GOIU.js} +1 -1
- package/dist/{chunk-NQMKWBKU.js → chunk-TOPRMXFY.js} +1 -1
- package/dist/{chunk-7OV5Q2UU.js → chunk-VWPMWV7O.js} +4 -4
- package/dist/{chunk-MPWDSTYK.js → chunk-XUQUQJYE.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 +16 -0
- package/dist/index.d.ts +16 -0
- 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/index.d.cts
CHANGED
|
@@ -2182,6 +2182,19 @@ declare function isTrackingSuspended(): boolean;
|
|
|
2182
2182
|
* @returns Whatever `fn` returns.
|
|
2183
2183
|
*/
|
|
2184
2184
|
declare function untracked$1<T>(fn: () => T): T;
|
|
2185
|
+
/** The owner scope in effect right now (`null` when there is none). @internal */
|
|
2186
|
+
declare function getOwnerScope(): unknown;
|
|
2187
|
+
/**
|
|
2188
|
+
* Run `fn` with `scope` as the current owner scope, restoring the previous
|
|
2189
|
+
* scope afterwards (even if `fn` throws). @internal
|
|
2190
|
+
*/
|
|
2191
|
+
declare function runWithOwnerScope<T>(scope: unknown, fn: () => T): T;
|
|
2192
|
+
/**
|
|
2193
|
+
* Capture the current owner scope into `fn`, for work that runs later (a
|
|
2194
|
+
* deferred first render, a lifecycle callback). Returns `fn` itself when there
|
|
2195
|
+
* is no scope to carry. @internal
|
|
2196
|
+
*/
|
|
2197
|
+
declare function bindOwnerScope<A extends unknown[], R>(fn: (...args: A) => R): (...args: A) => R;
|
|
2185
2198
|
declare function retrack$1(effectFn: () => void, subscriber: Subscriber): void;
|
|
2186
2199
|
declare function track(effectFn: () => void, subscriber?: Subscriber): () => void;
|
|
2187
2200
|
declare function reactiveBinding(commit: () => void, ownerNode?: unknown): () => void;
|
|
@@ -2246,6 +2259,9 @@ interface ReactiveApi {
|
|
|
2246
2259
|
getSubscriberCount: typeof getSubscriberCount;
|
|
2247
2260
|
getSubscriberDeps: typeof getSubscriberDeps;
|
|
2248
2261
|
forEachSubscriber: typeof forEachSubscriber;
|
|
2262
|
+
getOwnerScope?: typeof getOwnerScope;
|
|
2263
|
+
runWithOwnerScope?: typeof runWithOwnerScope;
|
|
2264
|
+
bindOwnerScope?: typeof bindOwnerScope;
|
|
2249
2265
|
version: string;
|
|
2250
2266
|
__dupWarned?: boolean;
|
|
2251
2267
|
}
|
package/dist/index.d.ts
CHANGED
|
@@ -2182,6 +2182,19 @@ declare function isTrackingSuspended(): boolean;
|
|
|
2182
2182
|
* @returns Whatever `fn` returns.
|
|
2183
2183
|
*/
|
|
2184
2184
|
declare function untracked$1<T>(fn: () => T): T;
|
|
2185
|
+
/** The owner scope in effect right now (`null` when there is none). @internal */
|
|
2186
|
+
declare function getOwnerScope(): unknown;
|
|
2187
|
+
/**
|
|
2188
|
+
* Run `fn` with `scope` as the current owner scope, restoring the previous
|
|
2189
|
+
* scope afterwards (even if `fn` throws). @internal
|
|
2190
|
+
*/
|
|
2191
|
+
declare function runWithOwnerScope<T>(scope: unknown, fn: () => T): T;
|
|
2192
|
+
/**
|
|
2193
|
+
* Capture the current owner scope into `fn`, for work that runs later (a
|
|
2194
|
+
* deferred first render, a lifecycle callback). Returns `fn` itself when there
|
|
2195
|
+
* is no scope to carry. @internal
|
|
2196
|
+
*/
|
|
2197
|
+
declare function bindOwnerScope<A extends unknown[], R>(fn: (...args: A) => R): (...args: A) => R;
|
|
2185
2198
|
declare function retrack$1(effectFn: () => void, subscriber: Subscriber): void;
|
|
2186
2199
|
declare function track(effectFn: () => void, subscriber?: Subscriber): () => void;
|
|
2187
2200
|
declare function reactiveBinding(commit: () => void, ownerNode?: unknown): () => void;
|
|
@@ -2246,6 +2259,9 @@ interface ReactiveApi {
|
|
|
2246
2259
|
getSubscriberCount: typeof getSubscriberCount;
|
|
2247
2260
|
getSubscriberDeps: typeof getSubscriberDeps;
|
|
2248
2261
|
forEachSubscriber: typeof forEachSubscriber;
|
|
2262
|
+
getOwnerScope?: typeof getOwnerScope;
|
|
2263
|
+
runWithOwnerScope?: typeof runWithOwnerScope;
|
|
2264
|
+
bindOwnerScope?: typeof bindOwnerScope;
|
|
2249
2265
|
version: string;
|
|
2250
2266
|
__dupWarned?: boolean;
|
|
2251
2267
|
}
|
package/dist/index.js
CHANGED
|
@@ -54,7 +54,7 @@ import {
|
|
|
54
54
|
unregisterIsland,
|
|
55
55
|
when,
|
|
56
56
|
writable
|
|
57
|
-
} from "./chunk-
|
|
57
|
+
} from "./chunk-2NWHJ2UJ.js";
|
|
58
58
|
import {
|
|
59
59
|
a,
|
|
60
60
|
abbr,
|
|
@@ -192,34 +192,34 @@ import {
|
|
|
192
192
|
use,
|
|
193
193
|
var_,
|
|
194
194
|
video
|
|
195
|
-
} from "./chunk-
|
|
195
|
+
} from "./chunk-N6U4GOIU.js";
|
|
196
196
|
import {
|
|
197
197
|
trustHTML
|
|
198
198
|
} from "./chunk-FC6KCJSA.js";
|
|
199
199
|
import {
|
|
200
200
|
watch
|
|
201
|
-
} from "./chunk-
|
|
201
|
+
} from "./chunk-EVOK663Z.js";
|
|
202
202
|
import {
|
|
203
203
|
__resetIdCounter,
|
|
204
204
|
createId
|
|
205
|
-
} from "./chunk-
|
|
205
|
+
} from "./chunk-GOL3FU5Q.js";
|
|
206
206
|
import "./chunk-62BDYGAG.js";
|
|
207
207
|
import {
|
|
208
208
|
SVG_NS,
|
|
209
209
|
tagFactory
|
|
210
|
-
} from "./chunk-
|
|
210
|
+
} from "./chunk-EVI4ZQO3.js";
|
|
211
211
|
import {
|
|
212
212
|
bindDynamic
|
|
213
|
-
} from "./chunk-
|
|
213
|
+
} from "./chunk-XUQUQJYE.js";
|
|
214
214
|
import "./chunk-3ACAAQIN.js";
|
|
215
215
|
import {
|
|
216
216
|
derived
|
|
217
|
-
} from "./chunk-
|
|
217
|
+
} from "./chunk-5PC7OTQW.js";
|
|
218
218
|
import "./chunk-7ZHH77QA.js";
|
|
219
219
|
import {
|
|
220
220
|
effect,
|
|
221
221
|
on
|
|
222
|
-
} from "./chunk-
|
|
222
|
+
} from "./chunk-7WIHYHWD.js";
|
|
223
223
|
import "./chunk-EXXSN3BW.js";
|
|
224
224
|
import {
|
|
225
225
|
disableSSR,
|
|
@@ -237,12 +237,12 @@ import {
|
|
|
237
237
|
external,
|
|
238
238
|
isBatching,
|
|
239
239
|
signal
|
|
240
|
-
} from "./chunk-
|
|
240
|
+
} from "./chunk-FYUEL5IW.js";
|
|
241
241
|
import {
|
|
242
242
|
retrack,
|
|
243
243
|
setMaxDrainIterations,
|
|
244
244
|
untracked
|
|
245
|
-
} from "./chunk-
|
|
245
|
+
} from "./chunk-D6HYFOWR.js";
|
|
246
246
|
import {
|
|
247
247
|
MAX_DRAIN_TEARDOWNS,
|
|
248
248
|
checkLeaks,
|
package/dist/motion.cjs
CHANGED
|
@@ -414,6 +414,24 @@ function untracked(fn) {
|
|
|
414
414
|
resumeTracking();
|
|
415
415
|
}
|
|
416
416
|
}
|
|
417
|
+
var currentOwnerScope = null;
|
|
418
|
+
function getOwnerScope() {
|
|
419
|
+
return currentOwnerScope;
|
|
420
|
+
}
|
|
421
|
+
function runWithOwnerScope(scope, fn) {
|
|
422
|
+
const prev = currentOwnerScope;
|
|
423
|
+
currentOwnerScope = scope;
|
|
424
|
+
try {
|
|
425
|
+
return fn();
|
|
426
|
+
} finally {
|
|
427
|
+
currentOwnerScope = prev;
|
|
428
|
+
}
|
|
429
|
+
}
|
|
430
|
+
function bindOwnerScope(fn) {
|
|
431
|
+
const scope = currentOwnerScope;
|
|
432
|
+
if (scope === null) return fn;
|
|
433
|
+
return (...args) => runWithOwnerScope(scope, () => fn(...args));
|
|
434
|
+
}
|
|
417
435
|
var subscriberEpochCounter = 0;
|
|
418
436
|
function retrack(effectFn, subscriber) {
|
|
419
437
|
const prev = currentSubscriber;
|
|
@@ -429,6 +447,10 @@ function retrack(effectFn, subscriber) {
|
|
|
429
447
|
currentSubscriber = subscriber;
|
|
430
448
|
const sub = subscriber;
|
|
431
449
|
if (sub._cap === void 0) sub._cap = currentDisposerCapture();
|
|
450
|
+
const prevScope = currentOwnerScope;
|
|
451
|
+
if (prevScope !== null && !sub._epoch && sub._scope === void 0) sub._scope = prevScope;
|
|
452
|
+
const scope = sub._scope === void 0 ? null : sub._scope;
|
|
453
|
+
if (scope !== prevScope) currentOwnerScope = scope;
|
|
432
454
|
const epoch = ++subscriberEpochCounter;
|
|
433
455
|
sub._epoch = epoch;
|
|
434
456
|
sub._structDirty = false;
|
|
@@ -441,6 +463,7 @@ function retrack(effectFn, subscriber) {
|
|
|
441
463
|
effectFn();
|
|
442
464
|
} finally {
|
|
443
465
|
currentSubscriber = prev;
|
|
466
|
+
currentOwnerScope = prevScope;
|
|
444
467
|
if (savedDepth !== 0) {
|
|
445
468
|
suspendDepth = savedDepth;
|
|
446
469
|
suspendSavedSub = savedSuspendSub;
|
|
@@ -475,23 +498,26 @@ function track(effectFn, subscriber) {
|
|
|
475
498
|
trackingSuspended = false;
|
|
476
499
|
}
|
|
477
500
|
currentSubscriber = subscriber;
|
|
501
|
+
const sub = subscriber;
|
|
502
|
+
if (sub._scope === void 0) sub._scope = currentOwnerScope;
|
|
503
|
+
const prevScope = currentOwnerScope;
|
|
504
|
+
currentOwnerScope = sub._scope;
|
|
478
505
|
try {
|
|
479
506
|
effectFn();
|
|
480
507
|
} finally {
|
|
481
508
|
currentSubscriber = prev;
|
|
509
|
+
currentOwnerScope = prevScope;
|
|
482
510
|
if (savedDepth !== 0) {
|
|
483
511
|
suspendDepth = savedDepth;
|
|
484
512
|
suspendSavedSub = savedSuspendSub;
|
|
485
513
|
trackingSuspended = true;
|
|
486
514
|
}
|
|
487
|
-
|
|
488
|
-
for (let n = sub2.depsHead ?? null; n !== null; n = n.subNext) {
|
|
515
|
+
for (let n = sub.depsHead ?? null; n !== null; n = n.subNext) {
|
|
489
516
|
const sig = n.sig;
|
|
490
517
|
sig.__activeNode = n.prevActive;
|
|
491
518
|
n.prevActive = null;
|
|
492
519
|
}
|
|
493
520
|
}
|
|
494
|
-
const sub = subscriber;
|
|
495
521
|
return sub._dispose ?? (sub._dispose = () => cleanup(subscriber));
|
|
496
522
|
}
|
|
497
523
|
function reactiveBinding(commit, ownerNode) {
|
|
@@ -761,7 +787,7 @@ function forEachSubscriber(signal2, visit) {
|
|
|
761
787
|
}
|
|
762
788
|
|
|
763
789
|
// src/reactivity/track.ts
|
|
764
|
-
var _runtimeVersion = true ? "4.
|
|
790
|
+
var _runtimeVersion = true ? "4.10.0" : "dev";
|
|
765
791
|
var REGISTRY_KEY = /* @__PURE__ */ Symbol.for("sibujs.reactive.v1");
|
|
766
792
|
function resolveReactiveApi() {
|
|
767
793
|
const g = globalThis;
|
|
@@ -793,6 +819,9 @@ function resolveReactiveApi() {
|
|
|
793
819
|
getSubscriberCount,
|
|
794
820
|
getSubscriberDeps,
|
|
795
821
|
forEachSubscriber,
|
|
822
|
+
getOwnerScope,
|
|
823
|
+
runWithOwnerScope,
|
|
824
|
+
bindOwnerScope,
|
|
796
825
|
version: _runtimeVersion
|
|
797
826
|
};
|
|
798
827
|
g[REGISTRY_KEY] = local;
|
|
@@ -816,6 +845,9 @@ var notifySubscribers2 = API.notifySubscribers;
|
|
|
816
845
|
var getSubscriberCount2 = API.getSubscriberCount;
|
|
817
846
|
var getSubscriberDeps2 = API.getSubscriberDeps;
|
|
818
847
|
var forEachSubscriber2 = API.forEachSubscriber;
|
|
848
|
+
var getOwnerScope2 = API.getOwnerScope ?? getOwnerScope;
|
|
849
|
+
var runWithOwnerScope2 = API.runWithOwnerScope ?? runWithOwnerScope;
|
|
850
|
+
var bindOwnerScope2 = API.bindOwnerScope ?? bindOwnerScope;
|
|
819
851
|
|
|
820
852
|
// src/reactivity/batch.ts
|
|
821
853
|
var batchDepth = 0;
|
package/dist/motion.js
CHANGED
|
@@ -20,10 +20,10 @@ import {
|
|
|
20
20
|
stagger,
|
|
21
21
|
transition,
|
|
22
22
|
viewTransition
|
|
23
|
-
} from "./chunk-
|
|
23
|
+
} from "./chunk-TOPRMXFY.js";
|
|
24
24
|
import "./chunk-5HZXGZ6T.js";
|
|
25
|
-
import "./chunk-
|
|
26
|
-
import "./chunk-
|
|
25
|
+
import "./chunk-FYUEL5IW.js";
|
|
26
|
+
import "./chunk-D6HYFOWR.js";
|
|
27
27
|
import "./chunk-NYNYSPK7.js";
|
|
28
28
|
export {
|
|
29
29
|
TransitionGroup,
|
package/dist/patterns.cjs
CHANGED
|
@@ -310,6 +310,24 @@ function untracked(fn) {
|
|
|
310
310
|
resumeTracking();
|
|
311
311
|
}
|
|
312
312
|
}
|
|
313
|
+
var currentOwnerScope = null;
|
|
314
|
+
function getOwnerScope() {
|
|
315
|
+
return currentOwnerScope;
|
|
316
|
+
}
|
|
317
|
+
function runWithOwnerScope(scope, fn) {
|
|
318
|
+
const prev = currentOwnerScope;
|
|
319
|
+
currentOwnerScope = scope;
|
|
320
|
+
try {
|
|
321
|
+
return fn();
|
|
322
|
+
} finally {
|
|
323
|
+
currentOwnerScope = prev;
|
|
324
|
+
}
|
|
325
|
+
}
|
|
326
|
+
function bindOwnerScope(fn) {
|
|
327
|
+
const scope = currentOwnerScope;
|
|
328
|
+
if (scope === null) return fn;
|
|
329
|
+
return (...args) => runWithOwnerScope(scope, () => fn(...args));
|
|
330
|
+
}
|
|
313
331
|
var subscriberEpochCounter = 0;
|
|
314
332
|
function retrack(effectFn, subscriber) {
|
|
315
333
|
const prev = currentSubscriber;
|
|
@@ -325,6 +343,10 @@ function retrack(effectFn, subscriber) {
|
|
|
325
343
|
currentSubscriber = subscriber;
|
|
326
344
|
const sub = subscriber;
|
|
327
345
|
if (sub._cap === void 0) sub._cap = currentDisposerCapture();
|
|
346
|
+
const prevScope = currentOwnerScope;
|
|
347
|
+
if (prevScope !== null && !sub._epoch && sub._scope === void 0) sub._scope = prevScope;
|
|
348
|
+
const scope = sub._scope === void 0 ? null : sub._scope;
|
|
349
|
+
if (scope !== prevScope) currentOwnerScope = scope;
|
|
328
350
|
const epoch = ++subscriberEpochCounter;
|
|
329
351
|
sub._epoch = epoch;
|
|
330
352
|
sub._structDirty = false;
|
|
@@ -337,6 +359,7 @@ function retrack(effectFn, subscriber) {
|
|
|
337
359
|
effectFn();
|
|
338
360
|
} finally {
|
|
339
361
|
currentSubscriber = prev;
|
|
362
|
+
currentOwnerScope = prevScope;
|
|
340
363
|
if (savedDepth !== 0) {
|
|
341
364
|
suspendDepth = savedDepth;
|
|
342
365
|
suspendSavedSub = savedSuspendSub;
|
|
@@ -371,23 +394,26 @@ function track(effectFn, subscriber) {
|
|
|
371
394
|
trackingSuspended = false;
|
|
372
395
|
}
|
|
373
396
|
currentSubscriber = subscriber;
|
|
397
|
+
const sub = subscriber;
|
|
398
|
+
if (sub._scope === void 0) sub._scope = currentOwnerScope;
|
|
399
|
+
const prevScope = currentOwnerScope;
|
|
400
|
+
currentOwnerScope = sub._scope;
|
|
374
401
|
try {
|
|
375
402
|
effectFn();
|
|
376
403
|
} finally {
|
|
377
404
|
currentSubscriber = prev;
|
|
405
|
+
currentOwnerScope = prevScope;
|
|
378
406
|
if (savedDepth !== 0) {
|
|
379
407
|
suspendDepth = savedDepth;
|
|
380
408
|
suspendSavedSub = savedSuspendSub;
|
|
381
409
|
trackingSuspended = true;
|
|
382
410
|
}
|
|
383
|
-
|
|
384
|
-
for (let n = sub2.depsHead ?? null; n !== null; n = n.subNext) {
|
|
411
|
+
for (let n = sub.depsHead ?? null; n !== null; n = n.subNext) {
|
|
385
412
|
const sig = n.sig;
|
|
386
413
|
sig.__activeNode = n.prevActive;
|
|
387
414
|
n.prevActive = null;
|
|
388
415
|
}
|
|
389
416
|
}
|
|
390
|
-
const sub = subscriber;
|
|
391
417
|
return sub._dispose ?? (sub._dispose = () => cleanup(subscriber));
|
|
392
418
|
}
|
|
393
419
|
function reactiveBinding(commit, ownerNode) {
|
|
@@ -657,7 +683,7 @@ function forEachSubscriber(signal2, visit) {
|
|
|
657
683
|
}
|
|
658
684
|
|
|
659
685
|
// src/reactivity/track.ts
|
|
660
|
-
var _runtimeVersion = true ? "4.
|
|
686
|
+
var _runtimeVersion = true ? "4.10.0" : "dev";
|
|
661
687
|
var REGISTRY_KEY = /* @__PURE__ */ Symbol.for("sibujs.reactive.v1");
|
|
662
688
|
function resolveReactiveApi() {
|
|
663
689
|
const g = globalThis;
|
|
@@ -689,6 +715,9 @@ function resolveReactiveApi() {
|
|
|
689
715
|
getSubscriberCount,
|
|
690
716
|
getSubscriberDeps,
|
|
691
717
|
forEachSubscriber,
|
|
718
|
+
getOwnerScope,
|
|
719
|
+
runWithOwnerScope,
|
|
720
|
+
bindOwnerScope,
|
|
692
721
|
version: _runtimeVersion
|
|
693
722
|
};
|
|
694
723
|
g[REGISTRY_KEY] = local;
|
|
@@ -712,6 +741,9 @@ var notifySubscribers2 = API.notifySubscribers;
|
|
|
712
741
|
var getSubscriberCount2 = API.getSubscriberCount;
|
|
713
742
|
var getSubscriberDeps2 = API.getSubscriberDeps;
|
|
714
743
|
var forEachSubscriber2 = API.forEachSubscriber;
|
|
744
|
+
var getOwnerScope2 = API.getOwnerScope ?? getOwnerScope;
|
|
745
|
+
var runWithOwnerScope2 = API.runWithOwnerScope ?? runWithOwnerScope;
|
|
746
|
+
var bindOwnerScope2 = API.bindOwnerScope ?? bindOwnerScope;
|
|
715
747
|
|
|
716
748
|
// src/reactivity/batch.ts
|
|
717
749
|
var batchDepth = 0;
|
|
@@ -997,6 +1029,11 @@ function flushUserCleanups(ctx) {
|
|
|
997
1029
|
const list = ctx.userCleanups;
|
|
998
1030
|
if (list.length === 0) return;
|
|
999
1031
|
ctx.userCleanups = [];
|
|
1032
|
+
const scope = ctx.subscriber._scope ?? null;
|
|
1033
|
+
if (scope === getOwnerScope2()) runCleanups(list);
|
|
1034
|
+
else runWithOwnerScope2(scope, () => runCleanups(list));
|
|
1035
|
+
}
|
|
1036
|
+
function runCleanups(list) {
|
|
1000
1037
|
for (let i = list.length - 1; i >= 0; i--) {
|
|
1001
1038
|
try {
|
|
1002
1039
|
list[i]();
|
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-JCKUWWHU.js";
|
|
9
9
|
import {
|
|
10
10
|
RenderProp,
|
|
11
11
|
assertType,
|
|
@@ -23,11 +23,11 @@ import {
|
|
|
23
23
|
withWrapper
|
|
24
24
|
} from "./chunk-TUCPL2HB.js";
|
|
25
25
|
import "./chunk-62BDYGAG.js";
|
|
26
|
-
import "./chunk-
|
|
27
|
-
import "./chunk-
|
|
26
|
+
import "./chunk-5PC7OTQW.js";
|
|
27
|
+
import "./chunk-7WIHYHWD.js";
|
|
28
28
|
import "./chunk-7XHATCIH.js";
|
|
29
|
-
import "./chunk-
|
|
30
|
-
import "./chunk-
|
|
29
|
+
import "./chunk-FYUEL5IW.js";
|
|
30
|
+
import "./chunk-D6HYFOWR.js";
|
|
31
31
|
import "./chunk-NYNYSPK7.js";
|
|
32
32
|
export {
|
|
33
33
|
RenderProp,
|
package/dist/performance.cjs
CHANGED
|
@@ -576,6 +576,24 @@ function untracked(fn) {
|
|
|
576
576
|
resumeTracking();
|
|
577
577
|
}
|
|
578
578
|
}
|
|
579
|
+
var currentOwnerScope = null;
|
|
580
|
+
function getOwnerScope() {
|
|
581
|
+
return currentOwnerScope;
|
|
582
|
+
}
|
|
583
|
+
function runWithOwnerScope(scope, fn) {
|
|
584
|
+
const prev = currentOwnerScope;
|
|
585
|
+
currentOwnerScope = scope;
|
|
586
|
+
try {
|
|
587
|
+
return fn();
|
|
588
|
+
} finally {
|
|
589
|
+
currentOwnerScope = prev;
|
|
590
|
+
}
|
|
591
|
+
}
|
|
592
|
+
function bindOwnerScope(fn) {
|
|
593
|
+
const scope = currentOwnerScope;
|
|
594
|
+
if (scope === null) return fn;
|
|
595
|
+
return (...args) => runWithOwnerScope(scope, () => fn(...args));
|
|
596
|
+
}
|
|
579
597
|
var subscriberEpochCounter = 0;
|
|
580
598
|
function retrack(effectFn, subscriber) {
|
|
581
599
|
const prev = currentSubscriber;
|
|
@@ -591,6 +609,10 @@ function retrack(effectFn, subscriber) {
|
|
|
591
609
|
currentSubscriber = subscriber;
|
|
592
610
|
const sub = subscriber;
|
|
593
611
|
if (sub._cap === void 0) sub._cap = currentDisposerCapture();
|
|
612
|
+
const prevScope = currentOwnerScope;
|
|
613
|
+
if (prevScope !== null && !sub._epoch && sub._scope === void 0) sub._scope = prevScope;
|
|
614
|
+
const scope = sub._scope === void 0 ? null : sub._scope;
|
|
615
|
+
if (scope !== prevScope) currentOwnerScope = scope;
|
|
594
616
|
const epoch = ++subscriberEpochCounter;
|
|
595
617
|
sub._epoch = epoch;
|
|
596
618
|
sub._structDirty = false;
|
|
@@ -603,6 +625,7 @@ function retrack(effectFn, subscriber) {
|
|
|
603
625
|
effectFn();
|
|
604
626
|
} finally {
|
|
605
627
|
currentSubscriber = prev;
|
|
628
|
+
currentOwnerScope = prevScope;
|
|
606
629
|
if (savedDepth !== 0) {
|
|
607
630
|
suspendDepth = savedDepth;
|
|
608
631
|
suspendSavedSub = savedSuspendSub;
|
|
@@ -637,23 +660,26 @@ function track(effectFn, subscriber) {
|
|
|
637
660
|
trackingSuspended = false;
|
|
638
661
|
}
|
|
639
662
|
currentSubscriber = subscriber;
|
|
663
|
+
const sub = subscriber;
|
|
664
|
+
if (sub._scope === void 0) sub._scope = currentOwnerScope;
|
|
665
|
+
const prevScope = currentOwnerScope;
|
|
666
|
+
currentOwnerScope = sub._scope;
|
|
640
667
|
try {
|
|
641
668
|
effectFn();
|
|
642
669
|
} finally {
|
|
643
670
|
currentSubscriber = prev;
|
|
671
|
+
currentOwnerScope = prevScope;
|
|
644
672
|
if (savedDepth !== 0) {
|
|
645
673
|
suspendDepth = savedDepth;
|
|
646
674
|
suspendSavedSub = savedSuspendSub;
|
|
647
675
|
trackingSuspended = true;
|
|
648
676
|
}
|
|
649
|
-
|
|
650
|
-
for (let n = sub2.depsHead ?? null; n !== null; n = n.subNext) {
|
|
677
|
+
for (let n = sub.depsHead ?? null; n !== null; n = n.subNext) {
|
|
651
678
|
const sig = n.sig;
|
|
652
679
|
sig.__activeNode = n.prevActive;
|
|
653
680
|
n.prevActive = null;
|
|
654
681
|
}
|
|
655
682
|
}
|
|
656
|
-
const sub = subscriber;
|
|
657
683
|
return sub._dispose ?? (sub._dispose = () => cleanup(subscriber));
|
|
658
684
|
}
|
|
659
685
|
function reactiveBinding(commit, ownerNode) {
|
|
@@ -923,7 +949,7 @@ function forEachSubscriber(signal2, visit) {
|
|
|
923
949
|
}
|
|
924
950
|
|
|
925
951
|
// src/reactivity/track.ts
|
|
926
|
-
var _runtimeVersion = true ? "4.
|
|
952
|
+
var _runtimeVersion = true ? "4.10.0" : "dev";
|
|
927
953
|
var REGISTRY_KEY = /* @__PURE__ */ Symbol.for("sibujs.reactive.v1");
|
|
928
954
|
function resolveReactiveApi() {
|
|
929
955
|
const g = globalThis;
|
|
@@ -955,6 +981,9 @@ function resolveReactiveApi() {
|
|
|
955
981
|
getSubscriberCount,
|
|
956
982
|
getSubscriberDeps,
|
|
957
983
|
forEachSubscriber,
|
|
984
|
+
getOwnerScope,
|
|
985
|
+
runWithOwnerScope,
|
|
986
|
+
bindOwnerScope,
|
|
958
987
|
version: _runtimeVersion
|
|
959
988
|
};
|
|
960
989
|
g[REGISTRY_KEY] = local;
|
|
@@ -978,6 +1007,9 @@ var notifySubscribers2 = API.notifySubscribers;
|
|
|
978
1007
|
var getSubscriberCount2 = API.getSubscriberCount;
|
|
979
1008
|
var getSubscriberDeps2 = API.getSubscriberDeps;
|
|
980
1009
|
var forEachSubscriber2 = API.forEachSubscriber;
|
|
1010
|
+
var getOwnerScope2 = API.getOwnerScope ?? getOwnerScope;
|
|
1011
|
+
var runWithOwnerScope2 = API.runWithOwnerScope ?? runWithOwnerScope;
|
|
1012
|
+
var bindOwnerScope2 = API.bindOwnerScope ?? bindOwnerScope;
|
|
981
1013
|
|
|
982
1014
|
// src/core/devtoolsHook.ts
|
|
983
1015
|
function emitDevtools(hook, event, payload) {
|
|
@@ -1033,6 +1065,11 @@ function flushUserCleanups(ctx) {
|
|
|
1033
1065
|
const list = ctx.userCleanups;
|
|
1034
1066
|
if (list.length === 0) return;
|
|
1035
1067
|
ctx.userCleanups = [];
|
|
1068
|
+
const scope = ctx.subscriber._scope ?? null;
|
|
1069
|
+
if (scope === getOwnerScope2()) runCleanups(list);
|
|
1070
|
+
else runWithOwnerScope2(scope, () => runCleanups(list));
|
|
1071
|
+
}
|
|
1072
|
+
function runCleanups(list) {
|
|
1036
1073
|
for (let i = list.length - 1; i >= 0; i--) {
|
|
1037
1074
|
try {
|
|
1038
1075
|
list[i]();
|
|
@@ -1920,16 +1957,20 @@ function lazyChunk(id, loader, registry, fallback) {
|
|
|
1920
1957
|
registry.load(id, async () => {
|
|
1921
1958
|
const mod = await loader();
|
|
1922
1959
|
return typeof mod === "function" ? mod : mod.default;
|
|
1923
|
-
}).then(
|
|
1924
|
-
|
|
1925
|
-
|
|
1926
|
-
|
|
1927
|
-
|
|
1928
|
-
|
|
1929
|
-
|
|
1930
|
-
|
|
1931
|
-
|
|
1932
|
-
|
|
1960
|
+
}).then(
|
|
1961
|
+
// Instantiated after the chunk resolves, in the owner scope of the
|
|
1962
|
+
// render that asked for it — as `lazy()` does.
|
|
1963
|
+
bindOwnerScope2((component) => {
|
|
1964
|
+
if (disposed) return;
|
|
1965
|
+
const node = component();
|
|
1966
|
+
if (disposed) {
|
|
1967
|
+
dispose(node);
|
|
1968
|
+
return;
|
|
1969
|
+
}
|
|
1970
|
+
clearChildren(container);
|
|
1971
|
+
container.appendChild(node);
|
|
1972
|
+
})
|
|
1973
|
+
).catch((err) => {
|
|
1933
1974
|
if (disposed) return;
|
|
1934
1975
|
clearChildren(container);
|
|
1935
1976
|
const errorEl = document.createElement("div");
|
package/dist/performance.js
CHANGED
|
@@ -33,18 +33,18 @@ import {
|
|
|
33
33
|
transitionState,
|
|
34
34
|
uniqueId,
|
|
35
35
|
yieldToMain
|
|
36
|
-
} from "./chunk-
|
|
36
|
+
} from "./chunk-IL5MMSCL.js";
|
|
37
37
|
import {
|
|
38
38
|
trustHTML
|
|
39
39
|
} from "./chunk-FC6KCJSA.js";
|
|
40
40
|
import "./chunk-62BDYGAG.js";
|
|
41
41
|
import "./chunk-3ACAAQIN.js";
|
|
42
42
|
import "./chunk-7ZHH77QA.js";
|
|
43
|
-
import "./chunk-
|
|
43
|
+
import "./chunk-7WIHYHWD.js";
|
|
44
44
|
import "./chunk-EXXSN3BW.js";
|
|
45
45
|
import "./chunk-7XHATCIH.js";
|
|
46
|
-
import "./chunk-
|
|
47
|
-
import "./chunk-
|
|
46
|
+
import "./chunk-FYUEL5IW.js";
|
|
47
|
+
import "./chunk-D6HYFOWR.js";
|
|
48
48
|
import "./chunk-NYNYSPK7.js";
|
|
49
49
|
export {
|
|
50
50
|
DOMPool,
|