sibujs 3.3.0 → 3.3.2
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 +230 -40
- package/dist/browser.js +5 -5
- package/dist/build.cjs +240 -108
- package/dist/build.js +13 -13
- package/dist/cdn.global.js +7 -7
- package/dist/{chunk-BEIKESVL.js → chunk-2ARSB7NG.js} +36 -13
- package/dist/{chunk-X3NHE2DK.js → chunk-4NJEAPLI.js} +83 -17
- package/dist/{chunk-JBXNCZSC.js → chunk-5VH3GIDX.js} +1 -1
- package/dist/{chunk-6G6UNHZI.js → chunk-62V653X2.js} +16 -21
- package/dist/{chunk-S4FHR5ZZ.js → chunk-655B7MMR.js} +3 -3
- package/dist/{chunk-24DBWDTK.js → chunk-6TCOWMGY.js} +1 -1
- package/dist/{chunk-USDR2GFV.js → chunk-A7CZH3GN.js} +3 -3
- package/dist/{chunk-SLCUP2EK.js → chunk-AEOLHSSQ.js} +3 -3
- package/dist/chunk-CCSJMTRN.js +15 -0
- package/dist/{chunk-R3QEDXFS.js → chunk-EX77FXTT.js} +1 -1
- package/dist/{chunk-ZUVLC7TM.js → chunk-FJIRS3FM.js} +1 -1
- package/dist/{chunk-4WXWJ4SW.js → chunk-FJO2ZL4Q.js} +4 -4
- package/dist/{chunk-CVMMULHO.js → chunk-G6N3LMO2.js} +4 -4
- package/dist/{chunk-XQ7XSGYP.js → chunk-IQJ36UTJ.js} +1 -1
- package/dist/{chunk-5K72I3UQ.js → chunk-JCQG2I2G.js} +21 -4
- package/dist/{chunk-7JHWAGRQ.js → chunk-N5TQVEKE.js} +2 -2
- package/dist/{chunk-IHBVTURX.js → chunk-P7C7SEJV.js} +4 -4
- package/dist/{chunk-M6WSIGYW.js → chunk-Q46YIQYW.js} +2 -2
- package/dist/{chunk-Q2ERM6NT.js → chunk-QCFBIVIQ.js} +1 -1
- package/dist/{chunk-F4UM7QBJ.js → chunk-RLTFJYDN.js} +2 -2
- package/dist/{chunk-GOJMFRBL.js → chunk-S3NFJO6L.js} +20 -14
- package/dist/{chunk-MWZFOIBG.js → chunk-YUBEOWII.js} +5 -5
- package/dist/{chunk-WVJJUFPC.js → chunk-YUR5SX7F.js} +2 -2
- package/dist/{chunk-NUWKIEHE.js → chunk-ZEUP4TUD.js} +2 -2
- package/dist/data.cjs +181 -37
- package/dist/data.js +7 -7
- package/dist/devtools.cjs +265 -45
- package/dist/devtools.js +5 -5
- package/dist/ecosystem.cjs +203 -59
- package/dist/ecosystem.js +8 -8
- package/dist/extras.cjs +216 -116
- package/dist/extras.js +22 -22
- package/dist/index.cjs +242 -108
- package/dist/index.d.cts +78 -14
- package/dist/index.d.ts +78 -14
- package/dist/index.js +17 -13
- package/dist/motion.cjs +329 -13
- package/dist/motion.js +3 -3
- package/dist/patterns.cjs +181 -37
- package/dist/patterns.js +6 -6
- package/dist/performance.cjs +278 -37
- package/dist/performance.js +6 -6
- package/dist/plugins.cjs +353 -153
- package/dist/plugins.js +95 -94
- package/dist/{ssr-6D67RAVB.js → ssr-2PPULEK2.js} +2 -2
- package/dist/ssr.cjs +203 -58
- package/dist/ssr.js +9 -9
- package/dist/testing.cjs +416 -19
- package/dist/testing.js +3 -3
- package/dist/ui.cjs +256 -65
- package/dist/ui.js +8 -8
- package/dist/widgets.cjs +166 -40
- package/dist/widgets.js +7 -7
- package/package.json +1 -1
- package/dist/chunk-YT6HQ6AM.js +0 -14
package/dist/browser.cjs
CHANGED
|
@@ -81,7 +81,7 @@ function devWarn(message) {
|
|
|
81
81
|
}
|
|
82
82
|
}
|
|
83
83
|
|
|
84
|
-
// src/reactivity/track.ts
|
|
84
|
+
// src/reactivity/track-core.ts
|
|
85
85
|
var _isDev2 = isDev();
|
|
86
86
|
var POOL_MAX = 4096;
|
|
87
87
|
var nodePool = [];
|
|
@@ -165,6 +165,7 @@ function unlinkSub(node) {
|
|
|
165
165
|
else sub.depsTail = prev;
|
|
166
166
|
}
|
|
167
167
|
var currentSubscriber = null;
|
|
168
|
+
var suspendSavedSub = null;
|
|
168
169
|
var notifyDepth = 0;
|
|
169
170
|
var pendingQueue = [];
|
|
170
171
|
var pendingSet = /* @__PURE__ */ new Set();
|
|
@@ -176,6 +177,35 @@ function safeInvoke(sub) {
|
|
|
176
177
|
if (_isDev2) devWarn(`Subscriber threw during notification: ${err instanceof Error ? err.message : String(err)}`);
|
|
177
178
|
}
|
|
178
179
|
}
|
|
180
|
+
var suspendDepth = 0;
|
|
181
|
+
var trackingSuspended = false;
|
|
182
|
+
function suspendTracking() {
|
|
183
|
+
if (suspendDepth === 0) {
|
|
184
|
+
suspendSavedSub = currentSubscriber;
|
|
185
|
+
currentSubscriber = null;
|
|
186
|
+
trackingSuspended = true;
|
|
187
|
+
}
|
|
188
|
+
suspendDepth++;
|
|
189
|
+
}
|
|
190
|
+
function resumeTracking() {
|
|
191
|
+
suspendDepth--;
|
|
192
|
+
if (suspendDepth === 0) {
|
|
193
|
+
currentSubscriber = suspendSavedSub;
|
|
194
|
+
suspendSavedSub = null;
|
|
195
|
+
trackingSuspended = false;
|
|
196
|
+
}
|
|
197
|
+
}
|
|
198
|
+
function isTrackingSuspended() {
|
|
199
|
+
return trackingSuspended;
|
|
200
|
+
}
|
|
201
|
+
function untracked(fn) {
|
|
202
|
+
suspendTracking();
|
|
203
|
+
try {
|
|
204
|
+
return fn();
|
|
205
|
+
} finally {
|
|
206
|
+
resumeTracking();
|
|
207
|
+
}
|
|
208
|
+
}
|
|
179
209
|
var subscriberEpochCounter = 0;
|
|
180
210
|
function retrack(effectFn, subscriber) {
|
|
181
211
|
const prev = currentSubscriber;
|
|
@@ -208,6 +238,51 @@ function retrack(effectFn, subscriber) {
|
|
|
208
238
|
}
|
|
209
239
|
}
|
|
210
240
|
}
|
|
241
|
+
function track(effectFn, subscriber) {
|
|
242
|
+
if (!subscriber) return reactiveBinding(effectFn);
|
|
243
|
+
cleanup(subscriber);
|
|
244
|
+
const prev = currentSubscriber;
|
|
245
|
+
currentSubscriber = subscriber;
|
|
246
|
+
try {
|
|
247
|
+
effectFn();
|
|
248
|
+
} finally {
|
|
249
|
+
currentSubscriber = prev;
|
|
250
|
+
const sub2 = subscriber;
|
|
251
|
+
for (let n = sub2.depsHead ?? null; n !== null; n = n.subNext) {
|
|
252
|
+
const sig = n.sig;
|
|
253
|
+
sig.__activeNode = n.prevActive;
|
|
254
|
+
n.prevActive = null;
|
|
255
|
+
}
|
|
256
|
+
}
|
|
257
|
+
const sub = subscriber;
|
|
258
|
+
return sub._dispose ?? (sub._dispose = () => cleanup(subscriber));
|
|
259
|
+
}
|
|
260
|
+
function reactiveBinding(commit) {
|
|
261
|
+
const run = () => {
|
|
262
|
+
const s = subscriber;
|
|
263
|
+
if (s._disposed || s._reentrant) return;
|
|
264
|
+
s._reentrant = true;
|
|
265
|
+
try {
|
|
266
|
+
retrack(commit, subscriber);
|
|
267
|
+
} finally {
|
|
268
|
+
s._reentrant = false;
|
|
269
|
+
}
|
|
270
|
+
};
|
|
271
|
+
const subscriber = run;
|
|
272
|
+
subscriber.depsHead = null;
|
|
273
|
+
subscriber.depsTail = null;
|
|
274
|
+
subscriber._epoch = 0;
|
|
275
|
+
subscriber._structDirty = false;
|
|
276
|
+
subscriber._runEpoch = 0;
|
|
277
|
+
subscriber._runs = 0;
|
|
278
|
+
subscriber._reentrant = false;
|
|
279
|
+
subscriber._disposed = false;
|
|
280
|
+
run();
|
|
281
|
+
return subscriber._dispose ?? (subscriber._dispose = () => {
|
|
282
|
+
subscriber._disposed = true;
|
|
283
|
+
cleanup(subscriber);
|
|
284
|
+
});
|
|
285
|
+
}
|
|
211
286
|
function recordDependency(signal2) {
|
|
212
287
|
if (!currentSubscriber) return;
|
|
213
288
|
const sub = currentSubscriber;
|
|
@@ -240,6 +315,16 @@ function cleanup(subscriber) {
|
|
|
240
315
|
var maxSubscriberRepeats = 50;
|
|
241
316
|
var maxDrainIterations = 1e6;
|
|
242
317
|
var drainEpoch = 0;
|
|
318
|
+
function setMaxSubscriberRepeats(n) {
|
|
319
|
+
const prev = maxSubscriberRepeats;
|
|
320
|
+
if (Number.isFinite(n) && n > 0) maxSubscriberRepeats = Math.floor(n);
|
|
321
|
+
return prev;
|
|
322
|
+
}
|
|
323
|
+
function setMaxDrainIterations(n) {
|
|
324
|
+
const prev = maxDrainIterations;
|
|
325
|
+
if (Number.isFinite(n) && n > 0) maxDrainIterations = Math.floor(n);
|
|
326
|
+
return prev;
|
|
327
|
+
}
|
|
243
328
|
function tickRepeat(sub) {
|
|
244
329
|
const s = sub;
|
|
245
330
|
if (s._runEpoch !== drainEpoch) {
|
|
@@ -388,11 +473,90 @@ function notifySubscribers(signal2) {
|
|
|
388
473
|
}
|
|
389
474
|
}
|
|
390
475
|
}
|
|
476
|
+
function getSubscriberCount(signal2) {
|
|
477
|
+
return signal2.__sc ?? 0;
|
|
478
|
+
}
|
|
479
|
+
function getSubscriberDeps(subscriber) {
|
|
480
|
+
const sub = subscriber;
|
|
481
|
+
const out = [];
|
|
482
|
+
let node = sub.depsHead ?? null;
|
|
483
|
+
while (node) {
|
|
484
|
+
if (node.sig) out.push(node.sig);
|
|
485
|
+
node = node.subNext;
|
|
486
|
+
}
|
|
487
|
+
return out;
|
|
488
|
+
}
|
|
489
|
+
function forEachSubscriber(signal2, visit) {
|
|
490
|
+
let node = signal2.subsHead ?? null;
|
|
491
|
+
while (node) {
|
|
492
|
+
const s = node.sub;
|
|
493
|
+
if (s) visit(s);
|
|
494
|
+
node = node.sigNext;
|
|
495
|
+
}
|
|
496
|
+
}
|
|
497
|
+
|
|
498
|
+
// src/reactivity/track.ts
|
|
499
|
+
var _isDev3 = isDev();
|
|
500
|
+
var _runtimeVersion = true ? "3.3.2" : "dev";
|
|
501
|
+
var REGISTRY_KEY = /* @__PURE__ */ Symbol.for("sibujs.reactive.v1");
|
|
502
|
+
function resolveReactiveApi() {
|
|
503
|
+
const g = globalThis;
|
|
504
|
+
const existing = g[REGISTRY_KEY];
|
|
505
|
+
if (existing) {
|
|
506
|
+
if (_isDev3 && !existing.__dupWarned) {
|
|
507
|
+
existing.__dupWarned = true;
|
|
508
|
+
devWarn(
|
|
509
|
+
`Multiple instances of the reactive runtime detected on this page (active: ${existing.version}, duplicate: ${_runtimeVersion}). Reactivity still works \u2014 all copies share the first one \u2014 but de-duplicate sibujs in your bundler (e.g. Vite optimizeDeps.exclude: ['sibujs'] or resolve.dedupe: ['sibujs']).`
|
|
510
|
+
);
|
|
511
|
+
}
|
|
512
|
+
return existing;
|
|
513
|
+
}
|
|
514
|
+
const local = {
|
|
515
|
+
suspendTracking,
|
|
516
|
+
resumeTracking,
|
|
517
|
+
isTrackingSuspended,
|
|
518
|
+
untracked,
|
|
519
|
+
retrack,
|
|
520
|
+
track,
|
|
521
|
+
reactiveBinding,
|
|
522
|
+
recordDependency,
|
|
523
|
+
cleanup,
|
|
524
|
+
setMaxSubscriberRepeats,
|
|
525
|
+
setMaxDrainIterations,
|
|
526
|
+
drainNotificationQueue,
|
|
527
|
+
queueSignalNotification,
|
|
528
|
+
notifySubscribers,
|
|
529
|
+
getSubscriberCount,
|
|
530
|
+
getSubscriberDeps,
|
|
531
|
+
forEachSubscriber,
|
|
532
|
+
version: _runtimeVersion
|
|
533
|
+
};
|
|
534
|
+
g[REGISTRY_KEY] = local;
|
|
535
|
+
return local;
|
|
536
|
+
}
|
|
537
|
+
var API = resolveReactiveApi();
|
|
538
|
+
var suspendTracking2 = API.suspendTracking;
|
|
539
|
+
var resumeTracking2 = API.resumeTracking;
|
|
540
|
+
var isTrackingSuspended2 = API.isTrackingSuspended;
|
|
541
|
+
var untracked2 = API.untracked;
|
|
542
|
+
var retrack2 = API.retrack;
|
|
543
|
+
var track2 = API.track;
|
|
544
|
+
var reactiveBinding2 = API.reactiveBinding;
|
|
545
|
+
var recordDependency2 = API.recordDependency;
|
|
546
|
+
var cleanup2 = API.cleanup;
|
|
547
|
+
var setMaxSubscriberRepeats2 = API.setMaxSubscriberRepeats;
|
|
548
|
+
var setMaxDrainIterations2 = API.setMaxDrainIterations;
|
|
549
|
+
var drainNotificationQueue2 = API.drainNotificationQueue;
|
|
550
|
+
var queueSignalNotification2 = API.queueSignalNotification;
|
|
551
|
+
var notifySubscribers2 = API.notifySubscribers;
|
|
552
|
+
var getSubscriberCount2 = API.getSubscriberCount;
|
|
553
|
+
var getSubscriberDeps2 = API.getSubscriberDeps;
|
|
554
|
+
var forEachSubscriber2 = API.forEachSubscriber;
|
|
391
555
|
|
|
392
556
|
// src/reactivity/batch.ts
|
|
393
557
|
var batchDepth = 0;
|
|
394
558
|
var pendingSignals = /* @__PURE__ */ new Set();
|
|
395
|
-
function
|
|
559
|
+
function batchImpl(fn) {
|
|
396
560
|
batchDepth++;
|
|
397
561
|
try {
|
|
398
562
|
return fn();
|
|
@@ -403,25 +567,45 @@ function batch(fn) {
|
|
|
403
567
|
}
|
|
404
568
|
}
|
|
405
569
|
}
|
|
406
|
-
function
|
|
570
|
+
function enqueueBatchedSignalImpl(signal2) {
|
|
407
571
|
if (batchDepth === 0) return false;
|
|
408
572
|
pendingSignals.add(signal2);
|
|
409
573
|
return true;
|
|
410
574
|
}
|
|
575
|
+
function isBatchingImpl() {
|
|
576
|
+
return batchDepth > 0;
|
|
577
|
+
}
|
|
411
578
|
function flushBatch() {
|
|
412
579
|
try {
|
|
413
580
|
for (const signal2 of pendingSignals) {
|
|
414
|
-
|
|
581
|
+
queueSignalNotification2(signal2);
|
|
415
582
|
}
|
|
416
583
|
} finally {
|
|
417
584
|
pendingSignals.clear();
|
|
418
585
|
}
|
|
419
|
-
|
|
586
|
+
drainNotificationQueue2();
|
|
587
|
+
}
|
|
588
|
+
var BATCH_REGISTRY_KEY = /* @__PURE__ */ Symbol.for("sibujs.reactive.batch.v1");
|
|
589
|
+
function resolveBatchApi() {
|
|
590
|
+
const g = globalThis;
|
|
591
|
+
const existing = g[BATCH_REGISTRY_KEY];
|
|
592
|
+
if (existing) return existing;
|
|
593
|
+
const local = {
|
|
594
|
+
batch: batchImpl,
|
|
595
|
+
enqueueBatchedSignal: enqueueBatchedSignalImpl,
|
|
596
|
+
isBatching: isBatchingImpl
|
|
597
|
+
};
|
|
598
|
+
g[BATCH_REGISTRY_KEY] = local;
|
|
599
|
+
return local;
|
|
420
600
|
}
|
|
601
|
+
var API2 = resolveBatchApi();
|
|
602
|
+
var batch = API2.batch;
|
|
603
|
+
var enqueueBatchedSignal = API2.enqueueBatchedSignal;
|
|
604
|
+
var isBatching = API2.isBatching;
|
|
421
605
|
|
|
422
606
|
// src/core/signals/signal.ts
|
|
423
607
|
var _g = globalThis;
|
|
424
|
-
var
|
|
608
|
+
var _isDev4 = isDev();
|
|
425
609
|
function signal(initial, options) {
|
|
426
610
|
const state = {
|
|
427
611
|
value: initial,
|
|
@@ -432,11 +616,11 @@ function signal(initial, options) {
|
|
|
432
616
|
__activeNode: null,
|
|
433
617
|
__name: void 0
|
|
434
618
|
};
|
|
435
|
-
const debugName =
|
|
619
|
+
const debugName = _isDev4 ? options?.name : void 0;
|
|
436
620
|
const equalsFn = options?.equals;
|
|
437
621
|
if (debugName) state.__name = debugName;
|
|
438
622
|
function get() {
|
|
439
|
-
|
|
623
|
+
recordDependency2(state);
|
|
440
624
|
return state.value;
|
|
441
625
|
}
|
|
442
626
|
get.__signal = state;
|
|
@@ -449,15 +633,15 @@ function signal(initial, options) {
|
|
|
449
633
|
if (equalsFn(prev, newValue)) return;
|
|
450
634
|
state.value = newValue;
|
|
451
635
|
state.__v++;
|
|
452
|
-
if (
|
|
636
|
+
if (_isDev4) {
|
|
453
637
|
const hook = _g.__SIBU_DEVTOOLS_GLOBAL_HOOK__;
|
|
454
638
|
if (hook) hook.emit("signal:update", { signal: state, name: debugName, oldValue: prev, newValue });
|
|
455
639
|
}
|
|
456
640
|
if (!enqueueBatchedSignal(state)) {
|
|
457
|
-
|
|
641
|
+
notifySubscribers2(state);
|
|
458
642
|
}
|
|
459
643
|
};
|
|
460
|
-
} else if (
|
|
644
|
+
} else if (_isDev4) {
|
|
461
645
|
set = (next) => {
|
|
462
646
|
const prev = state.value;
|
|
463
647
|
const newValue = typeof next === "function" ? next(prev) : next;
|
|
@@ -467,7 +651,7 @@ function signal(initial, options) {
|
|
|
467
651
|
const hook = _g.__SIBU_DEVTOOLS_GLOBAL_HOOK__;
|
|
468
652
|
if (hook) hook.emit("signal:update", { signal: state, name: debugName, oldValue: prev, newValue });
|
|
469
653
|
if (!enqueueBatchedSignal(state)) {
|
|
470
|
-
|
|
654
|
+
notifySubscribers2(state);
|
|
471
655
|
}
|
|
472
656
|
};
|
|
473
657
|
} else {
|
|
@@ -478,11 +662,11 @@ function signal(initial, options) {
|
|
|
478
662
|
state.value = newValue;
|
|
479
663
|
state.__v++;
|
|
480
664
|
if (!enqueueBatchedSignal(state)) {
|
|
481
|
-
|
|
665
|
+
notifySubscribers2(state);
|
|
482
666
|
}
|
|
483
667
|
};
|
|
484
668
|
}
|
|
485
|
-
if (
|
|
669
|
+
if (_isDev4) {
|
|
486
670
|
const hook = _g.__SIBU_DEVTOOLS_GLOBAL_HOOK__;
|
|
487
671
|
if (hook) hook.emit("signal:create", { signal: state, name: debugName, getter: get, initial });
|
|
488
672
|
}
|
|
@@ -509,23 +693,29 @@ function media(query) {
|
|
|
509
693
|
}
|
|
510
694
|
|
|
511
695
|
// src/core/ssr-context.ts
|
|
512
|
-
var
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
|
|
518
|
-
|
|
519
|
-
|
|
520
|
-
|
|
521
|
-
|
|
696
|
+
var SSR_KEY = /* @__PURE__ */ Symbol.for("sibujs.ssr.v1");
|
|
697
|
+
function detectSSRShared() {
|
|
698
|
+
let detected = null;
|
|
699
|
+
try {
|
|
700
|
+
if (typeof process !== "undefined" && process.versions && process.versions.node) {
|
|
701
|
+
let mod = null;
|
|
702
|
+
const getBuiltin = process.getBuiltinModule;
|
|
703
|
+
if (typeof getBuiltin === "function") {
|
|
704
|
+
mod = getBuiltin("node:async_hooks");
|
|
705
|
+
} else {
|
|
706
|
+
const req = Function("return typeof require==='function'?require:null")();
|
|
707
|
+
if (req) mod = req("node:async_hooks");
|
|
708
|
+
}
|
|
709
|
+
if (mod) detected = new mod.AsyncLocalStorage();
|
|
522
710
|
}
|
|
523
|
-
|
|
711
|
+
} catch {
|
|
712
|
+
detected = null;
|
|
524
713
|
}
|
|
525
|
-
|
|
526
|
-
als = null;
|
|
714
|
+
return { als: detected, fallbackStore: { ssr: false, suspenseIdCounter: 0 } };
|
|
527
715
|
}
|
|
528
|
-
var
|
|
716
|
+
var _shared = globalThis[SSR_KEY] ?? (globalThis[SSR_KEY] = detectSSRShared());
|
|
717
|
+
var als = _shared.als;
|
|
718
|
+
var fallbackStore = _shared.fallbackStore;
|
|
529
719
|
function getSSRStore() {
|
|
530
720
|
if (als) {
|
|
531
721
|
const s = als.getStore();
|
|
@@ -557,7 +747,7 @@ function drainReruns(ctx) {
|
|
|
557
747
|
do {
|
|
558
748
|
ctx.rerunPending = false;
|
|
559
749
|
if (ctx.userCleanups.length > 0) flushUserCleanups(ctx);
|
|
560
|
-
|
|
750
|
+
retrack2(ctx.bodyFn, ctx.subscriber);
|
|
561
751
|
} while (ctx.rerunPending && ++reruns <= MAX_RERUNS);
|
|
562
752
|
if (ctx.rerunPending) {
|
|
563
753
|
ctx.rerunPending = false;
|
|
@@ -586,7 +776,7 @@ function disposeEffect(ctx) {
|
|
|
586
776
|
}
|
|
587
777
|
}
|
|
588
778
|
try {
|
|
589
|
-
|
|
779
|
+
cleanup2(ctx.subscriber);
|
|
590
780
|
} catch (err) {
|
|
591
781
|
if (typeof console !== "undefined") {
|
|
592
782
|
console.warn("[SibuJS effect] dispose threw:", err);
|
|
@@ -631,7 +821,7 @@ function effect(effectFn, options) {
|
|
|
631
821
|
try {
|
|
632
822
|
ctx.rerunPending = false;
|
|
633
823
|
if (ctx.userCleanups.length > 0) flushUserCleanups(ctx);
|
|
634
|
-
|
|
824
|
+
retrack2(ctx.bodyFn, sub);
|
|
635
825
|
if (ctx.rerunPending) drainReruns(ctx);
|
|
636
826
|
} finally {
|
|
637
827
|
ctx.running = false;
|
|
@@ -647,7 +837,7 @@ function effect(effectFn, options) {
|
|
|
647
837
|
ctx.subscriber = sub;
|
|
648
838
|
ctx.running = true;
|
|
649
839
|
try {
|
|
650
|
-
|
|
840
|
+
retrack2(ctx.bodyFn, ctx.subscriber);
|
|
651
841
|
if (ctx.rerunPending) drainReruns(ctx);
|
|
652
842
|
} finally {
|
|
653
843
|
ctx.running = false;
|
|
@@ -671,7 +861,7 @@ function resize(target) {
|
|
|
671
861
|
} };
|
|
672
862
|
}
|
|
673
863
|
const getter = resolveTarget(target);
|
|
674
|
-
const
|
|
864
|
+
const cleanup3 = effect(() => {
|
|
675
865
|
const el = getter();
|
|
676
866
|
if (observer) {
|
|
677
867
|
observer.disconnect();
|
|
@@ -690,7 +880,7 @@ function resize(target) {
|
|
|
690
880
|
observer.observe(el);
|
|
691
881
|
});
|
|
692
882
|
function dispose() {
|
|
693
|
-
|
|
883
|
+
cleanup3();
|
|
694
884
|
if (observer) {
|
|
695
885
|
observer.disconnect();
|
|
696
886
|
observer = null;
|
|
@@ -967,7 +1157,7 @@ function draggable(element, data) {
|
|
|
967
1157
|
let onDragStart = null;
|
|
968
1158
|
let onDragEnd = null;
|
|
969
1159
|
const getter = resolveTarget2(element);
|
|
970
|
-
const
|
|
1160
|
+
const cleanup3 = effect(() => {
|
|
971
1161
|
if (currentEl && onDragStart && onDragEnd) {
|
|
972
1162
|
currentEl.removeEventListener("dragstart", onDragStart);
|
|
973
1163
|
currentEl.removeEventListener("dragend", onDragEnd);
|
|
@@ -989,7 +1179,7 @@ function draggable(element, data) {
|
|
|
989
1179
|
el.addEventListener("dragend", onDragEnd);
|
|
990
1180
|
});
|
|
991
1181
|
function dispose() {
|
|
992
|
-
|
|
1182
|
+
cleanup3();
|
|
993
1183
|
if (currentEl && onDragStart && onDragEnd) {
|
|
994
1184
|
currentEl.removeEventListener("dragstart", onDragStart);
|
|
995
1185
|
currentEl.removeEventListener("dragend", onDragEnd);
|
|
@@ -1010,7 +1200,7 @@ function dropZone(element, options) {
|
|
|
1010
1200
|
let onDragLeave = null;
|
|
1011
1201
|
let onDrop = null;
|
|
1012
1202
|
const getter = resolveTarget2(element);
|
|
1013
|
-
const
|
|
1203
|
+
const cleanup3 = effect(() => {
|
|
1014
1204
|
if (currentEl && onDragOver && onDragEnter && onDragLeave && onDrop) {
|
|
1015
1205
|
currentEl.removeEventListener("dragover", onDragOver);
|
|
1016
1206
|
currentEl.removeEventListener("dragenter", onDragEnter);
|
|
@@ -1052,7 +1242,7 @@ function dropZone(element, options) {
|
|
|
1052
1242
|
el.addEventListener("drop", onDrop);
|
|
1053
1243
|
});
|
|
1054
1244
|
function dispose() {
|
|
1055
|
-
|
|
1245
|
+
cleanup3();
|
|
1056
1246
|
if (currentEl && onDragOver && onDragEnter && onDragLeave && onDrop) {
|
|
1057
1247
|
currentEl.removeEventListener("dragover", onDragOver);
|
|
1058
1248
|
currentEl.removeEventListener("dragenter", onDragEnter);
|
|
@@ -1072,11 +1262,11 @@ function title(value) {
|
|
|
1072
1262
|
}
|
|
1073
1263
|
const previousTitle = document.title;
|
|
1074
1264
|
if (typeof value === "function") {
|
|
1075
|
-
const
|
|
1265
|
+
const cleanup3 = effect(() => {
|
|
1076
1266
|
document.title = value();
|
|
1077
1267
|
});
|
|
1078
1268
|
return () => {
|
|
1079
|
-
|
|
1269
|
+
cleanup3();
|
|
1080
1270
|
document.title = previousTitle;
|
|
1081
1271
|
};
|
|
1082
1272
|
}
|
package/dist/browser.js
CHANGED
|
@@ -35,12 +35,12 @@ import {
|
|
|
35
35
|
visibility,
|
|
36
36
|
wakeLock,
|
|
37
37
|
windowSize
|
|
38
|
-
} from "./chunk-
|
|
38
|
+
} from "./chunk-Q46YIQYW.js";
|
|
39
39
|
import "./chunk-H3SRKIYX.js";
|
|
40
|
-
import "./chunk-
|
|
41
|
-
import "./chunk-
|
|
42
|
-
import "./chunk-
|
|
43
|
-
import "./chunk-
|
|
40
|
+
import "./chunk-N5TQVEKE.js";
|
|
41
|
+
import "./chunk-S3NFJO6L.js";
|
|
42
|
+
import "./chunk-JCQG2I2G.js";
|
|
43
|
+
import "./chunk-4NJEAPLI.js";
|
|
44
44
|
import "./chunk-COY6PUD2.js";
|
|
45
45
|
export {
|
|
46
46
|
animationFrame,
|