@novely/solid-renderer 0.36.0 → 0.37.0-experemental
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/components/DialogName.d.ts +0 -2
- package/dist/components/Root.d.ts +2 -3
- package/dist/context/index.d.ts +1 -3
- package/dist/custom-actions/index.d.ts +0 -1
- package/dist/custom-actions/show-arbitrary-character.d.ts +4 -4
- package/dist/index.jsx +279 -566
- package/dist/renderer.d.ts +0 -7
- package/package.json +5 -5
package/dist/index.jsx
CHANGED
|
@@ -74,10 +74,8 @@ function createSignal(value, options) {
|
|
|
74
74
|
};
|
|
75
75
|
const setter = (value2) => {
|
|
76
76
|
if (typeof value2 === "function") {
|
|
77
|
-
if (Transition && Transition.running && Transition.sources.has(s))
|
|
78
|
-
|
|
79
|
-
else
|
|
80
|
-
value2 = value2(s.value);
|
|
77
|
+
if (Transition && Transition.running && Transition.sources.has(s)) value2 = value2(s.tValue);
|
|
78
|
+
else value2 = value2(s.value);
|
|
81
79
|
}
|
|
82
80
|
return writeSignal(s, value2);
|
|
83
81
|
};
|
|
@@ -85,25 +83,19 @@ function createSignal(value, options) {
|
|
|
85
83
|
}
|
|
86
84
|
function createComputed(fn, value, options) {
|
|
87
85
|
const c = createComputation(fn, value, true, STALE);
|
|
88
|
-
if (Scheduler && Transition && Transition.running)
|
|
89
|
-
|
|
90
|
-
else
|
|
91
|
-
updateComputation(c);
|
|
86
|
+
if (Scheduler && Transition && Transition.running) Updates.push(c);
|
|
87
|
+
else updateComputation(c);
|
|
92
88
|
}
|
|
93
89
|
function createRenderEffect(fn, value, options) {
|
|
94
90
|
const c = createComputation(fn, value, false, STALE);
|
|
95
|
-
if (Scheduler && Transition && Transition.running)
|
|
96
|
-
|
|
97
|
-
else
|
|
98
|
-
updateComputation(c);
|
|
91
|
+
if (Scheduler && Transition && Transition.running) Updates.push(c);
|
|
92
|
+
else updateComputation(c);
|
|
99
93
|
}
|
|
100
94
|
function createEffect(fn, value, options) {
|
|
101
95
|
runEffects = runUserEffects;
|
|
102
96
|
const c = createComputation(fn, value, false, STALE), s = SuspenseContext && useContext(SuspenseContext);
|
|
103
|
-
if (s)
|
|
104
|
-
|
|
105
|
-
if (!options || !options.render)
|
|
106
|
-
c.user = true;
|
|
97
|
+
if (s) c.suspense = s;
|
|
98
|
+
if (!options || !options.render) c.user = true;
|
|
107
99
|
Effects ? Effects.push(c) : updateComputation(c);
|
|
108
100
|
}
|
|
109
101
|
function createMemo(fn, value, options) {
|
|
@@ -115,21 +107,18 @@ function createMemo(fn, value, options) {
|
|
|
115
107
|
if (Scheduler && Transition && Transition.running) {
|
|
116
108
|
c.tState = STALE;
|
|
117
109
|
Updates.push(c);
|
|
118
|
-
} else
|
|
119
|
-
updateComputation(c);
|
|
110
|
+
} else updateComputation(c);
|
|
120
111
|
return readSignal.bind(c);
|
|
121
112
|
}
|
|
122
113
|
function batch(fn) {
|
|
123
114
|
return runUpdates(fn, false);
|
|
124
115
|
}
|
|
125
116
|
function untrack(fn) {
|
|
126
|
-
if (!ExternalSourceConfig && Listener === null)
|
|
127
|
-
return fn();
|
|
117
|
+
if (!ExternalSourceConfig && Listener === null) return fn();
|
|
128
118
|
const listener = Listener;
|
|
129
119
|
Listener = null;
|
|
130
120
|
try {
|
|
131
|
-
if (ExternalSourceConfig)
|
|
132
|
-
return ExternalSourceConfig.untrack(fn);
|
|
121
|
+
if (ExternalSourceConfig) return ExternalSourceConfig.untrack(fn);
|
|
133
122
|
return fn();
|
|
134
123
|
} finally {
|
|
135
124
|
Listener = listener;
|
|
@@ -143,10 +132,8 @@ function on(deps, fn, options) {
|
|
|
143
132
|
let input;
|
|
144
133
|
if (isArray) {
|
|
145
134
|
input = Array(deps.length);
|
|
146
|
-
for (let i = 0; i < deps.length; i++)
|
|
147
|
-
|
|
148
|
-
} else
|
|
149
|
-
input = deps();
|
|
135
|
+
for (let i = 0; i < deps.length; i++) input[i] = deps[i]();
|
|
136
|
+
} else input = deps();
|
|
150
137
|
if (defer2) {
|
|
151
138
|
defer2 = false;
|
|
152
139
|
return prevValue;
|
|
@@ -160,12 +147,9 @@ function onMount(fn) {
|
|
|
160
147
|
createEffect(() => untrack(fn));
|
|
161
148
|
}
|
|
162
149
|
function onCleanup(fn) {
|
|
163
|
-
if (Owner === null)
|
|
164
|
-
|
|
165
|
-
else
|
|
166
|
-
Owner.cleanups = [fn];
|
|
167
|
-
else
|
|
168
|
-
Owner.cleanups.push(fn);
|
|
150
|
+
if (Owner === null) ;
|
|
151
|
+
else if (Owner.cleanups === null) Owner.cleanups = [fn];
|
|
152
|
+
else Owner.cleanups.push(fn);
|
|
169
153
|
return fn;
|
|
170
154
|
}
|
|
171
155
|
function getOwner() {
|
|
@@ -242,8 +226,7 @@ var SuspenseContext;
|
|
|
242
226
|
function readSignal() {
|
|
243
227
|
const runningTransition = Transition && Transition.running;
|
|
244
228
|
if (this.sources && (runningTransition ? this.tState : this.state)) {
|
|
245
|
-
if ((runningTransition ? this.tState : this.state) === STALE)
|
|
246
|
-
updateComputation(this);
|
|
229
|
+
if ((runningTransition ? this.tState : this.state) === STALE) updateComputation(this);
|
|
247
230
|
else {
|
|
248
231
|
const updates = Updates;
|
|
249
232
|
Updates = null;
|
|
@@ -268,8 +251,7 @@ function readSignal() {
|
|
|
268
251
|
this.observerSlots.push(Listener.sources.length - 1);
|
|
269
252
|
}
|
|
270
253
|
}
|
|
271
|
-
if (runningTransition && Transition.sources.has(this))
|
|
272
|
-
return this.tValue;
|
|
254
|
+
if (runningTransition && Transition.sources.has(this)) return this.tValue;
|
|
273
255
|
return this.value;
|
|
274
256
|
}
|
|
275
257
|
function writeSignal(node, value, isComp) {
|
|
@@ -281,34 +263,25 @@ function writeSignal(node, value, isComp) {
|
|
|
281
263
|
Transition.sources.add(node);
|
|
282
264
|
node.tValue = value;
|
|
283
265
|
}
|
|
284
|
-
if (!TransitionRunning)
|
|
285
|
-
|
|
286
|
-
} else
|
|
287
|
-
node.value = value;
|
|
266
|
+
if (!TransitionRunning) node.value = value;
|
|
267
|
+
} else node.value = value;
|
|
288
268
|
if (node.observers && node.observers.length) {
|
|
289
269
|
runUpdates(() => {
|
|
290
270
|
for (let i = 0; i < node.observers.length; i += 1) {
|
|
291
271
|
const o = node.observers[i];
|
|
292
272
|
const TransitionRunning = Transition && Transition.running;
|
|
293
|
-
if (TransitionRunning && Transition.disposed.has(o))
|
|
294
|
-
continue;
|
|
273
|
+
if (TransitionRunning && Transition.disposed.has(o)) continue;
|
|
295
274
|
if (TransitionRunning ? !o.tState : !o.state) {
|
|
296
|
-
if (o.pure)
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
Effects.push(o);
|
|
300
|
-
if (o.observers)
|
|
301
|
-
markDownstream(o);
|
|
275
|
+
if (o.pure) Updates.push(o);
|
|
276
|
+
else Effects.push(o);
|
|
277
|
+
if (o.observers) markDownstream(o);
|
|
302
278
|
}
|
|
303
|
-
if (!TransitionRunning)
|
|
304
|
-
|
|
305
|
-
else
|
|
306
|
-
o.tState = STALE;
|
|
279
|
+
if (!TransitionRunning) o.state = STALE;
|
|
280
|
+
else o.tState = STALE;
|
|
307
281
|
}
|
|
308
282
|
if (Updates.length > 1e6) {
|
|
309
283
|
Updates = [];
|
|
310
|
-
if (false)
|
|
311
|
-
;
|
|
284
|
+
if (false) ;
|
|
312
285
|
throw new Error();
|
|
313
286
|
}
|
|
314
287
|
}, false);
|
|
@@ -317,8 +290,7 @@ function writeSignal(node, value, isComp) {
|
|
|
317
290
|
return value;
|
|
318
291
|
}
|
|
319
292
|
function updateComputation(node) {
|
|
320
|
-
if (!node.fn)
|
|
321
|
-
return;
|
|
293
|
+
if (!node.fn) return;
|
|
322
294
|
cleanNode(node);
|
|
323
295
|
const time = ExecCount;
|
|
324
296
|
runComputation(node, Transition && Transition.running && Transition.sources.has(node) ? node.tValue : node.value, time);
|
|
@@ -363,8 +335,7 @@ function runComputation(node, value, time) {
|
|
|
363
335
|
} else if (Transition && Transition.running && node.pure) {
|
|
364
336
|
Transition.sources.add(node);
|
|
365
337
|
node.tValue = nextValue;
|
|
366
|
-
} else
|
|
367
|
-
node.value = nextValue;
|
|
338
|
+
} else node.value = nextValue;
|
|
368
339
|
node.updatedAt = time;
|
|
369
340
|
}
|
|
370
341
|
}
|
|
@@ -386,19 +357,14 @@ function createComputation(fn, init, pure, state = STALE, options) {
|
|
|
386
357
|
c.state = 0;
|
|
387
358
|
c.tState = state;
|
|
388
359
|
}
|
|
389
|
-
if (Owner === null)
|
|
390
|
-
;
|
|
360
|
+
if (Owner === null) ;
|
|
391
361
|
else if (Owner !== UNOWNED) {
|
|
392
362
|
if (Transition && Transition.running && Owner.pure) {
|
|
393
|
-
if (!Owner.tOwned)
|
|
394
|
-
|
|
395
|
-
else
|
|
396
|
-
Owner.tOwned.push(c);
|
|
363
|
+
if (!Owner.tOwned) Owner.tOwned = [c];
|
|
364
|
+
else Owner.tOwned.push(c);
|
|
397
365
|
} else {
|
|
398
|
-
if (!Owner.owned)
|
|
399
|
-
|
|
400
|
-
else
|
|
401
|
-
Owner.owned.push(c);
|
|
366
|
+
if (!Owner.owned) Owner.owned = [c];
|
|
367
|
+
else Owner.owned.push(c);
|
|
402
368
|
}
|
|
403
369
|
}
|
|
404
370
|
if (ExternalSourceConfig && c.fn) {
|
|
@@ -418,26 +384,20 @@ function createComputation(fn, init, pure, state = STALE, options) {
|
|
|
418
384
|
}
|
|
419
385
|
function runTop(node) {
|
|
420
386
|
const runningTransition = Transition && Transition.running;
|
|
421
|
-
if ((runningTransition ? node.tState : node.state) === 0)
|
|
422
|
-
|
|
423
|
-
if (
|
|
424
|
-
return lookUpstream(node);
|
|
425
|
-
if (node.suspense && untrack(node.suspense.inFallback))
|
|
426
|
-
return node.suspense.effects.push(node);
|
|
387
|
+
if ((runningTransition ? node.tState : node.state) === 0) return;
|
|
388
|
+
if ((runningTransition ? node.tState : node.state) === PENDING) return lookUpstream(node);
|
|
389
|
+
if (node.suspense && untrack(node.suspense.inFallback)) return node.suspense.effects.push(node);
|
|
427
390
|
const ancestors = [node];
|
|
428
391
|
while ((node = node.owner) && (!node.updatedAt || node.updatedAt < ExecCount)) {
|
|
429
|
-
if (runningTransition && Transition.disposed.has(node))
|
|
430
|
-
|
|
431
|
-
if (runningTransition ? node.tState : node.state)
|
|
432
|
-
ancestors.push(node);
|
|
392
|
+
if (runningTransition && Transition.disposed.has(node)) return;
|
|
393
|
+
if (runningTransition ? node.tState : node.state) ancestors.push(node);
|
|
433
394
|
}
|
|
434
395
|
for (let i = ancestors.length - 1; i >= 0; i--) {
|
|
435
396
|
node = ancestors[i];
|
|
436
397
|
if (runningTransition) {
|
|
437
398
|
let top = node, prev = ancestors[i + 1];
|
|
438
399
|
while ((top = top.owner) && top !== prev) {
|
|
439
|
-
if (Transition.disposed.has(top))
|
|
440
|
-
return;
|
|
400
|
+
if (Transition.disposed.has(top)) return;
|
|
441
401
|
}
|
|
442
402
|
}
|
|
443
403
|
if ((runningTransition ? node.tState : node.state) === STALE) {
|
|
@@ -451,37 +411,29 @@ function runTop(node) {
|
|
|
451
411
|
}
|
|
452
412
|
}
|
|
453
413
|
function runUpdates(fn, init) {
|
|
454
|
-
if (Updates)
|
|
455
|
-
return fn();
|
|
414
|
+
if (Updates) return fn();
|
|
456
415
|
let wait = false;
|
|
457
|
-
if (!init)
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
wait = true;
|
|
461
|
-
else
|
|
462
|
-
Effects = [];
|
|
416
|
+
if (!init) Updates = [];
|
|
417
|
+
if (Effects) wait = true;
|
|
418
|
+
else Effects = [];
|
|
463
419
|
ExecCount++;
|
|
464
420
|
try {
|
|
465
421
|
const res = fn();
|
|
466
422
|
completeUpdates(wait);
|
|
467
423
|
return res;
|
|
468
424
|
} catch (err) {
|
|
469
|
-
if (!wait)
|
|
470
|
-
Effects = null;
|
|
425
|
+
if (!wait) Effects = null;
|
|
471
426
|
Updates = null;
|
|
472
427
|
handleError(err);
|
|
473
428
|
}
|
|
474
429
|
}
|
|
475
430
|
function completeUpdates(wait) {
|
|
476
431
|
if (Updates) {
|
|
477
|
-
if (Scheduler && Transition && Transition.running)
|
|
478
|
-
|
|
479
|
-
else
|
|
480
|
-
runQueue(Updates);
|
|
432
|
+
if (Scheduler && Transition && Transition.running) scheduleQueue(Updates);
|
|
433
|
+
else runQueue(Updates);
|
|
481
434
|
Updates = null;
|
|
482
435
|
}
|
|
483
|
-
if (wait)
|
|
484
|
-
return;
|
|
436
|
+
if (wait) return;
|
|
485
437
|
let res;
|
|
486
438
|
if (Transition) {
|
|
487
439
|
if (!Transition.promises.size && !Transition.queue.size) {
|
|
@@ -495,16 +447,13 @@ function completeUpdates(wait) {
|
|
|
495
447
|
}
|
|
496
448
|
Transition = null;
|
|
497
449
|
runUpdates(() => {
|
|
498
|
-
for (const d of disposed)
|
|
499
|
-
cleanNode(d);
|
|
450
|
+
for (const d of disposed) cleanNode(d);
|
|
500
451
|
for (const v of sources) {
|
|
501
452
|
v.value = v.tValue;
|
|
502
453
|
if (v.owned) {
|
|
503
|
-
for (let i = 0, len = v.owned.length; i < len; i++)
|
|
504
|
-
cleanNode(v.owned[i]);
|
|
454
|
+
for (let i = 0, len = v.owned.length; i < len; i++) cleanNode(v.owned[i]);
|
|
505
455
|
}
|
|
506
|
-
if (v.tOwned)
|
|
507
|
-
v.owned = v.tOwned;
|
|
456
|
+
if (v.tOwned) v.owned = v.tOwned;
|
|
508
457
|
delete v.tValue;
|
|
509
458
|
delete v.tOwned;
|
|
510
459
|
v.tState = 0;
|
|
@@ -521,14 +470,11 @@ function completeUpdates(wait) {
|
|
|
521
470
|
}
|
|
522
471
|
const e = Effects;
|
|
523
472
|
Effects = null;
|
|
524
|
-
if (e.length)
|
|
525
|
-
|
|
526
|
-
if (res)
|
|
527
|
-
res();
|
|
473
|
+
if (e.length) runUpdates(() => runEffects(e), false);
|
|
474
|
+
if (res) res();
|
|
528
475
|
}
|
|
529
476
|
function runQueue(queue) {
|
|
530
|
-
for (let i = 0; i < queue.length; i++)
|
|
531
|
-
runTop(queue[i]);
|
|
477
|
+
for (let i = 0; i < queue.length; i++) runTop(queue[i]);
|
|
532
478
|
}
|
|
533
479
|
function scheduleQueue(queue) {
|
|
534
480
|
for (let i = 0; i < queue.length; i++) {
|
|
@@ -551,10 +497,8 @@ function runUserEffects(queue) {
|
|
|
551
497
|
let i, userLength = 0;
|
|
552
498
|
for (i = 0; i < queue.length; i++) {
|
|
553
499
|
const e = queue[i];
|
|
554
|
-
if (!e.user)
|
|
555
|
-
|
|
556
|
-
else
|
|
557
|
-
queue[userLength++] = e;
|
|
500
|
+
if (!e.user) runTop(e);
|
|
501
|
+
else queue[userLength++] = e;
|
|
558
502
|
}
|
|
559
503
|
if (sharedConfig.context) {
|
|
560
504
|
if (sharedConfig.count) {
|
|
@@ -568,24 +512,19 @@ function runUserEffects(queue) {
|
|
|
568
512
|
}
|
|
569
513
|
setHydrateContext();
|
|
570
514
|
}
|
|
571
|
-
for (i = 0; i < userLength; i++)
|
|
572
|
-
runTop(queue[i]);
|
|
515
|
+
for (i = 0; i < userLength; i++) runTop(queue[i]);
|
|
573
516
|
}
|
|
574
517
|
function lookUpstream(node, ignore) {
|
|
575
518
|
const runningTransition = Transition && Transition.running;
|
|
576
|
-
if (runningTransition)
|
|
577
|
-
|
|
578
|
-
else
|
|
579
|
-
node.state = 0;
|
|
519
|
+
if (runningTransition) node.tState = 0;
|
|
520
|
+
else node.state = 0;
|
|
580
521
|
for (let i = 0; i < node.sources.length; i += 1) {
|
|
581
522
|
const source = node.sources[i];
|
|
582
523
|
if (source.sources) {
|
|
583
524
|
const state = runningTransition ? source.tState : source.state;
|
|
584
525
|
if (state === STALE) {
|
|
585
|
-
if (source !== ignore && (!source.updatedAt || source.updatedAt < ExecCount))
|
|
586
|
-
|
|
587
|
-
} else if (state === PENDING)
|
|
588
|
-
lookUpstream(source, ignore);
|
|
526
|
+
if (source !== ignore && (!source.updatedAt || source.updatedAt < ExecCount)) runTop(source);
|
|
527
|
+
} else if (state === PENDING) lookUpstream(source, ignore);
|
|
589
528
|
}
|
|
590
529
|
}
|
|
591
530
|
}
|
|
@@ -594,14 +533,10 @@ function markDownstream(node) {
|
|
|
594
533
|
for (let i = 0; i < node.observers.length; i += 1) {
|
|
595
534
|
const o = node.observers[i];
|
|
596
535
|
if (runningTransition ? !o.tState : !o.state) {
|
|
597
|
-
if (runningTransition)
|
|
598
|
-
|
|
599
|
-
|
|
600
|
-
|
|
601
|
-
if (o.pure)
|
|
602
|
-
Updates.push(o);
|
|
603
|
-
else
|
|
604
|
-
Effects.push(o);
|
|
536
|
+
if (runningTransition) o.tState = PENDING;
|
|
537
|
+
else o.state = PENDING;
|
|
538
|
+
if (o.pure) Updates.push(o);
|
|
539
|
+
else Effects.push(o);
|
|
605
540
|
o.observers && markDownstream(o);
|
|
606
541
|
}
|
|
607
542
|
}
|
|
@@ -623,25 +558,20 @@ function cleanNode(node) {
|
|
|
623
558
|
}
|
|
624
559
|
if (Transition && Transition.running && node.pure) {
|
|
625
560
|
if (node.tOwned) {
|
|
626
|
-
for (i = node.tOwned.length - 1; i >= 0; i--)
|
|
627
|
-
cleanNode(node.tOwned[i]);
|
|
561
|
+
for (i = node.tOwned.length - 1; i >= 0; i--) cleanNode(node.tOwned[i]);
|
|
628
562
|
delete node.tOwned;
|
|
629
563
|
}
|
|
630
564
|
reset(node, true);
|
|
631
565
|
} else if (node.owned) {
|
|
632
|
-
for (i = node.owned.length - 1; i >= 0; i--)
|
|
633
|
-
cleanNode(node.owned[i]);
|
|
566
|
+
for (i = node.owned.length - 1; i >= 0; i--) cleanNode(node.owned[i]);
|
|
634
567
|
node.owned = null;
|
|
635
568
|
}
|
|
636
569
|
if (node.cleanups) {
|
|
637
|
-
for (i = node.cleanups.length - 1; i >= 0; i--)
|
|
638
|
-
node.cleanups[i]();
|
|
570
|
+
for (i = node.cleanups.length - 1; i >= 0; i--) node.cleanups[i]();
|
|
639
571
|
node.cleanups = null;
|
|
640
572
|
}
|
|
641
|
-
if (Transition && Transition.running)
|
|
642
|
-
|
|
643
|
-
else
|
|
644
|
-
node.state = 0;
|
|
573
|
+
if (Transition && Transition.running) node.tState = 0;
|
|
574
|
+
else node.state = 0;
|
|
645
575
|
}
|
|
646
576
|
function reset(node, top) {
|
|
647
577
|
if (!top) {
|
|
@@ -649,21 +579,18 @@ function reset(node, top) {
|
|
|
649
579
|
Transition.disposed.add(node);
|
|
650
580
|
}
|
|
651
581
|
if (node.owned) {
|
|
652
|
-
for (let i = 0; i < node.owned.length; i++)
|
|
653
|
-
reset(node.owned[i]);
|
|
582
|
+
for (let i = 0; i < node.owned.length; i++) reset(node.owned[i]);
|
|
654
583
|
}
|
|
655
584
|
}
|
|
656
585
|
function castError(err) {
|
|
657
|
-
if (err instanceof Error)
|
|
658
|
-
return err;
|
|
586
|
+
if (err instanceof Error) return err;
|
|
659
587
|
return new Error(typeof err === "string" ? err : "Unknown error", {
|
|
660
588
|
cause: err
|
|
661
589
|
});
|
|
662
590
|
}
|
|
663
591
|
function runErrors(err, fns, owner) {
|
|
664
592
|
try {
|
|
665
|
-
for (const f of fns)
|
|
666
|
-
f(err);
|
|
593
|
+
for (const f of fns) f(err);
|
|
667
594
|
} catch (e) {
|
|
668
595
|
handleError(e, owner && owner.owner || null);
|
|
669
596
|
}
|
|
@@ -671,21 +598,17 @@ function runErrors(err, fns, owner) {
|
|
|
671
598
|
function handleError(err, owner = Owner) {
|
|
672
599
|
const fns = ERROR && owner && owner.context && owner.context[ERROR];
|
|
673
600
|
const error = castError(err);
|
|
674
|
-
if (!fns)
|
|
675
|
-
|
|
676
|
-
|
|
677
|
-
|
|
678
|
-
|
|
679
|
-
|
|
680
|
-
|
|
681
|
-
|
|
682
|
-
});
|
|
683
|
-
else
|
|
684
|
-
runErrors(error, fns, owner);
|
|
601
|
+
if (!fns) throw error;
|
|
602
|
+
if (Effects) Effects.push({
|
|
603
|
+
fn() {
|
|
604
|
+
runErrors(error, fns, owner);
|
|
605
|
+
},
|
|
606
|
+
state: STALE
|
|
607
|
+
});
|
|
608
|
+
else runErrors(error, fns, owner);
|
|
685
609
|
}
|
|
686
610
|
function resolveChildren(children2) {
|
|
687
|
-
if (typeof children2 === "function" && !children2.length)
|
|
688
|
-
return resolveChildren(children2());
|
|
611
|
+
if (typeof children2 === "function" && !children2.length) return resolveChildren(children2());
|
|
689
612
|
if (Array.isArray(children2)) {
|
|
690
613
|
const results = [];
|
|
691
614
|
for (let i = 0; i < children2.length; i++) {
|
|
@@ -724,8 +647,7 @@ function from(producer) {
|
|
|
724
647
|
}
|
|
725
648
|
var FALLBACK = Symbol("fallback");
|
|
726
649
|
function dispose(d) {
|
|
727
|
-
for (let i = 0; i < d.length; i++)
|
|
728
|
-
d[i]();
|
|
650
|
+
for (let i = 0; i < d.length; i++) d[i]();
|
|
729
651
|
}
|
|
730
652
|
function mapArray(list, mapFn, options = {}) {
|
|
731
653
|
let items = [], mapped = [], disposers = [], len = 0, indexes = mapFn.length > 1 ? [] : null;
|
|
@@ -763,8 +685,7 @@ function mapArray(list, mapFn, options = {}) {
|
|
|
763
685
|
temp = new Array(newLen);
|
|
764
686
|
tempdisposers = new Array(newLen);
|
|
765
687
|
indexes && (tempIndexes = new Array(newLen));
|
|
766
|
-
for (start = 0, end = Math.min(len, newLen); start < end && items[start] === newItems[start]; start++)
|
|
767
|
-
;
|
|
688
|
+
for (start = 0, end = Math.min(len, newLen); start < end && items[start] === newItems[start]; start++) ;
|
|
768
689
|
for (end = len - 1, newEnd = newLen - 1; end >= start && newEnd >= start && items[end] === newItems[newEnd]; end--, newEnd--) {
|
|
769
690
|
temp[newEnd] = mapped[end];
|
|
770
691
|
tempdisposers[newEnd] = disposers[end];
|
|
@@ -787,8 +708,7 @@ function mapArray(list, mapFn, options = {}) {
|
|
|
787
708
|
indexes && (tempIndexes[j] = indexes[i]);
|
|
788
709
|
j = newIndicesNext[j];
|
|
789
710
|
newIndices.set(item, j);
|
|
790
|
-
} else
|
|
791
|
-
disposers[i]();
|
|
711
|
+
} else disposers[i]();
|
|
792
712
|
}
|
|
793
713
|
for (j = start; j < newLen; j++) {
|
|
794
714
|
if (j in temp) {
|
|
@@ -798,8 +718,7 @@ function mapArray(list, mapFn, options = {}) {
|
|
|
798
718
|
indexes[j] = tempIndexes[j];
|
|
799
719
|
indexes[j](j);
|
|
800
720
|
}
|
|
801
|
-
} else
|
|
802
|
-
mapped[j] = createRoot(mapper);
|
|
721
|
+
} else mapped[j] = createRoot(mapper);
|
|
803
722
|
}
|
|
804
723
|
mapped = mapped.slice(0, len = newLen);
|
|
805
724
|
items = newItems.slice(0);
|
|
@@ -835,13 +754,11 @@ function trueFn() {
|
|
|
835
754
|
}
|
|
836
755
|
var propTraps = {
|
|
837
756
|
get(_, property, receiver) {
|
|
838
|
-
if (property === $PROXY)
|
|
839
|
-
return receiver;
|
|
757
|
+
if (property === $PROXY) return receiver;
|
|
840
758
|
return _.get(property);
|
|
841
759
|
},
|
|
842
760
|
has(_, property) {
|
|
843
|
-
if (property === $PROXY)
|
|
844
|
-
return true;
|
|
761
|
+
if (property === $PROXY) return true;
|
|
845
762
|
return _.has(property);
|
|
846
763
|
},
|
|
847
764
|
set: trueFn,
|
|
@@ -867,8 +784,7 @@ function resolveSource(s) {
|
|
|
867
784
|
function resolveSources() {
|
|
868
785
|
for (let i = 0, length = this.length; i < length; ++i) {
|
|
869
786
|
const v = this[i]();
|
|
870
|
-
if (v !== void 0)
|
|
871
|
-
return v;
|
|
787
|
+
if (v !== void 0) return v;
|
|
872
788
|
}
|
|
873
789
|
}
|
|
874
790
|
function mergeProps(...sources) {
|
|
@@ -883,21 +799,18 @@ function mergeProps(...sources) {
|
|
|
883
799
|
get(property) {
|
|
884
800
|
for (let i = sources.length - 1; i >= 0; i--) {
|
|
885
801
|
const v = resolveSource(sources[i])[property];
|
|
886
|
-
if (v !== void 0)
|
|
887
|
-
return v;
|
|
802
|
+
if (v !== void 0) return v;
|
|
888
803
|
}
|
|
889
804
|
},
|
|
890
805
|
has(property) {
|
|
891
806
|
for (let i = sources.length - 1; i >= 0; i--) {
|
|
892
|
-
if (property in resolveSource(sources[i]))
|
|
893
|
-
return true;
|
|
807
|
+
if (property in resolveSource(sources[i])) return true;
|
|
894
808
|
}
|
|
895
809
|
return false;
|
|
896
810
|
},
|
|
897
811
|
keys() {
|
|
898
812
|
const keys2 = [];
|
|
899
|
-
for (let i = 0; i < sources.length; i++)
|
|
900
|
-
keys2.push(...Object.keys(resolveSource(sources[i])));
|
|
813
|
+
for (let i = 0; i < sources.length; i++) keys2.push(...Object.keys(resolveSource(sources[i])));
|
|
901
814
|
return [...new Set(keys2)];
|
|
902
815
|
}
|
|
903
816
|
}, propTraps);
|
|
@@ -906,13 +819,11 @@ function mergeProps(...sources) {
|
|
|
906
819
|
const defined = /* @__PURE__ */ Object.create(null);
|
|
907
820
|
for (let i = sources.length - 1; i >= 0; i--) {
|
|
908
821
|
const source = sources[i];
|
|
909
|
-
if (!source)
|
|
910
|
-
continue;
|
|
822
|
+
if (!source) continue;
|
|
911
823
|
const sourceKeys = Object.getOwnPropertyNames(source);
|
|
912
824
|
for (let i2 = sourceKeys.length - 1; i2 >= 0; i2--) {
|
|
913
825
|
const key = sourceKeys[i2];
|
|
914
|
-
if (key === "__proto__" || key === "constructor")
|
|
915
|
-
continue;
|
|
826
|
+
if (key === "__proto__" || key === "constructor") continue;
|
|
916
827
|
const desc = Object.getOwnPropertyDescriptor(source, key);
|
|
917
828
|
if (!defined[key]) {
|
|
918
829
|
defined[key] = desc.get ? {
|
|
@@ -923,10 +834,8 @@ function mergeProps(...sources) {
|
|
|
923
834
|
} else {
|
|
924
835
|
const sources2 = sourcesMap[key];
|
|
925
836
|
if (sources2) {
|
|
926
|
-
if (desc.get)
|
|
927
|
-
|
|
928
|
-
else if (desc.value !== void 0)
|
|
929
|
-
sources2.push(() => desc.value);
|
|
837
|
+
if (desc.get) sources2.push(desc.get.bind(source));
|
|
838
|
+
else if (desc.value !== void 0) sources2.push(() => desc.value);
|
|
930
839
|
}
|
|
931
840
|
}
|
|
932
841
|
}
|
|
@@ -935,10 +844,8 @@ function mergeProps(...sources) {
|
|
|
935
844
|
const definedKeys = Object.keys(defined);
|
|
936
845
|
for (let i = definedKeys.length - 1; i >= 0; i--) {
|
|
937
846
|
const key = definedKeys[i], desc = defined[key];
|
|
938
|
-
if (desc && desc.get)
|
|
939
|
-
|
|
940
|
-
else
|
|
941
|
-
target[key] = desc ? desc.value : void 0;
|
|
847
|
+
if (desc && desc.get) Object.defineProperty(target, key, desc);
|
|
848
|
+
else target[key] = desc ? desc.value : void 0;
|
|
942
849
|
}
|
|
943
850
|
return target;
|
|
944
851
|
}
|
|
@@ -1014,8 +921,7 @@ function Show(props) {
|
|
|
1014
921
|
const child = props.children;
|
|
1015
922
|
const fn = typeof child === "function" && child.length > 0;
|
|
1016
923
|
return fn ? untrack(() => child(keyed ? c : () => {
|
|
1017
|
-
if (!untrack(condition))
|
|
1018
|
-
throw narrowedError("Show");
|
|
924
|
+
if (!untrack(condition)) throw narrowedError("Show");
|
|
1019
925
|
return props.when;
|
|
1020
926
|
})) : child;
|
|
1021
927
|
}
|
|
@@ -1027,8 +933,7 @@ function Switch(props) {
|
|
|
1027
933
|
const equals = (a, b) => (keyed ? a[1] === b[1] : !a[1] === !b[1]) && a[2] === b[2];
|
|
1028
934
|
const conditions = children(() => props.children), evalConditions = createMemo(() => {
|
|
1029
935
|
let conds = conditions();
|
|
1030
|
-
if (!Array.isArray(conds))
|
|
1031
|
-
conds = [conds];
|
|
936
|
+
if (!Array.isArray(conds)) conds = [conds];
|
|
1032
937
|
for (let i = 0; i < conds.length; i++) {
|
|
1033
938
|
const c = conds[i].when;
|
|
1034
939
|
if (c) {
|
|
@@ -1042,13 +947,11 @@ function Switch(props) {
|
|
|
1042
947
|
});
|
|
1043
948
|
return createMemo(() => {
|
|
1044
949
|
const [index, when, cond] = evalConditions();
|
|
1045
|
-
if (index < 0)
|
|
1046
|
-
return props.fallback;
|
|
950
|
+
if (index < 0) return props.fallback;
|
|
1047
951
|
const c = cond.children;
|
|
1048
952
|
const fn = typeof c === "function" && c.length > 0;
|
|
1049
953
|
return fn ? untrack(() => c(keyed ? when : () => {
|
|
1050
|
-
if (untrack(evalConditions)[0] !== index)
|
|
1051
|
-
throw narrowedError("Match");
|
|
954
|
+
if (untrack(evalConditions)[0] !== index) throw narrowedError("Match");
|
|
1052
955
|
return cond.when;
|
|
1053
956
|
})) : c;
|
|
1054
957
|
}, void 0, void 0);
|
|
@@ -1113,12 +1016,10 @@ function reconcileArrays(parentNode, a, b) {
|
|
|
1113
1016
|
}
|
|
1114
1017
|
if (aEnd === aStart) {
|
|
1115
1018
|
const node = bEnd < bLength ? bStart ? b[bStart - 1].nextSibling : b[bEnd - bStart] : after;
|
|
1116
|
-
while (bStart < bEnd)
|
|
1117
|
-
parentNode.insertBefore(b[bStart++], node);
|
|
1019
|
+
while (bStart < bEnd) parentNode.insertBefore(b[bStart++], node);
|
|
1118
1020
|
} else if (bEnd === bStart) {
|
|
1119
1021
|
while (aStart < aEnd) {
|
|
1120
|
-
if (!map2 || !map2.has(a[aStart]))
|
|
1121
|
-
a[aStart].remove();
|
|
1022
|
+
if (!map2 || !map2.has(a[aStart])) a[aStart].remove();
|
|
1122
1023
|
aStart++;
|
|
1123
1024
|
}
|
|
1124
1025
|
} else if (a[aStart] === b[bEnd - 1] && b[bStart] === a[aEnd - 1]) {
|
|
@@ -1130,28 +1031,22 @@ function reconcileArrays(parentNode, a, b) {
|
|
|
1130
1031
|
if (!map2) {
|
|
1131
1032
|
map2 = /* @__PURE__ */ new Map();
|
|
1132
1033
|
let i = bStart;
|
|
1133
|
-
while (i < bEnd)
|
|
1134
|
-
map2.set(b[i], i++);
|
|
1034
|
+
while (i < bEnd) map2.set(b[i], i++);
|
|
1135
1035
|
}
|
|
1136
1036
|
const index = map2.get(a[aStart]);
|
|
1137
1037
|
if (index != null) {
|
|
1138
1038
|
if (bStart < index && index < bEnd) {
|
|
1139
1039
|
let i = aStart, sequence = 1, t;
|
|
1140
1040
|
while (++i < aEnd && i < bEnd) {
|
|
1141
|
-
if ((t = map2.get(a[i])) == null || t !== index + sequence)
|
|
1142
|
-
break;
|
|
1041
|
+
if ((t = map2.get(a[i])) == null || t !== index + sequence) break;
|
|
1143
1042
|
sequence++;
|
|
1144
1043
|
}
|
|
1145
1044
|
if (sequence > index - bStart) {
|
|
1146
1045
|
const node = a[aStart];
|
|
1147
|
-
while (bStart < index)
|
|
1148
|
-
|
|
1149
|
-
|
|
1150
|
-
|
|
1151
|
-
} else
|
|
1152
|
-
aStart++;
|
|
1153
|
-
} else
|
|
1154
|
-
a[aStart++].remove();
|
|
1046
|
+
while (bStart < index) parentNode.insertBefore(b[bStart++], node);
|
|
1047
|
+
} else parentNode.replaceChild(b[bStart++], a[aStart++]);
|
|
1048
|
+
} else aStart++;
|
|
1049
|
+
} else a[aStart++].remove();
|
|
1155
1050
|
}
|
|
1156
1051
|
}
|
|
1157
1052
|
}
|
|
@@ -1189,67 +1084,52 @@ function delegateEvents(eventNames, document2 = window.document) {
|
|
|
1189
1084
|
}
|
|
1190
1085
|
}
|
|
1191
1086
|
function setAttribute(node, name, value) {
|
|
1192
|
-
if (!!sharedConfig.context && node.isConnected)
|
|
1193
|
-
|
|
1194
|
-
|
|
1195
|
-
node.removeAttribute(name);
|
|
1196
|
-
else
|
|
1197
|
-
node.setAttribute(name, value);
|
|
1087
|
+
if (!!sharedConfig.context && node.isConnected) return;
|
|
1088
|
+
if (value == null) node.removeAttribute(name);
|
|
1089
|
+
else node.setAttribute(name, value);
|
|
1198
1090
|
}
|
|
1199
1091
|
function setAttributeNS(node, namespace, name, value) {
|
|
1200
|
-
if (!!sharedConfig.context && node.isConnected)
|
|
1201
|
-
|
|
1202
|
-
|
|
1203
|
-
node.removeAttributeNS(namespace, name);
|
|
1204
|
-
else
|
|
1205
|
-
node.setAttributeNS(namespace, name, value);
|
|
1092
|
+
if (!!sharedConfig.context && node.isConnected) return;
|
|
1093
|
+
if (value == null) node.removeAttributeNS(namespace, name);
|
|
1094
|
+
else node.setAttributeNS(namespace, name, value);
|
|
1206
1095
|
}
|
|
1207
1096
|
function className(node, value) {
|
|
1208
|
-
if (!!sharedConfig.context && node.isConnected)
|
|
1209
|
-
|
|
1210
|
-
|
|
1211
|
-
node.removeAttribute("class");
|
|
1212
|
-
else
|
|
1213
|
-
node.className = value;
|
|
1097
|
+
if (!!sharedConfig.context && node.isConnected) return;
|
|
1098
|
+
if (value == null) node.removeAttribute("class");
|
|
1099
|
+
else node.className = value;
|
|
1214
1100
|
}
|
|
1215
1101
|
function addEventListener2(node, name, handler, delegate) {
|
|
1216
1102
|
if (delegate) {
|
|
1217
1103
|
if (Array.isArray(handler)) {
|
|
1218
1104
|
node[`$$${name}`] = handler[0];
|
|
1219
1105
|
node[`$$${name}Data`] = handler[1];
|
|
1220
|
-
} else
|
|
1221
|
-
node[`$$${name}`] = handler;
|
|
1106
|
+
} else node[`$$${name}`] = handler;
|
|
1222
1107
|
} else if (Array.isArray(handler)) {
|
|
1223
1108
|
const handlerFn = handler[0];
|
|
1224
1109
|
node.addEventListener(name, handler[0] = (e) => handlerFn.call(node, handler[1], e));
|
|
1225
|
-
} else
|
|
1226
|
-
node.addEventListener(name, handler);
|
|
1110
|
+
} else node.addEventListener(name, handler);
|
|
1227
1111
|
}
|
|
1228
1112
|
function classList(node, value, prev = {}) {
|
|
1229
1113
|
const classKeys = Object.keys(value || {}), prevKeys = Object.keys(prev);
|
|
1230
1114
|
let i, len;
|
|
1231
1115
|
for (i = 0, len = prevKeys.length; i < len; i++) {
|
|
1232
1116
|
const key = prevKeys[i];
|
|
1233
|
-
if (!key || key === "undefined" || value[key])
|
|
1234
|
-
continue;
|
|
1117
|
+
if (!key || key === "undefined" || value[key]) continue;
|
|
1235
1118
|
toggleClassKey(node, key, false);
|
|
1236
1119
|
delete prev[key];
|
|
1237
1120
|
}
|
|
1238
1121
|
for (i = 0, len = classKeys.length; i < len; i++) {
|
|
1239
1122
|
const key = classKeys[i], classValue = !!value[key];
|
|
1240
|
-
if (!key || key === "undefined" || prev[key] === classValue || !classValue)
|
|
1241
|
-
continue;
|
|
1123
|
+
if (!key || key === "undefined" || prev[key] === classValue || !classValue) continue;
|
|
1242
1124
|
toggleClassKey(node, key, true);
|
|
1243
1125
|
prev[key] = classValue;
|
|
1244
1126
|
}
|
|
1245
1127
|
return prev;
|
|
1246
1128
|
}
|
|
1247
1129
|
function style(node, value, prev) {
|
|
1248
|
-
if (!value)
|
|
1249
|
-
return prev ? setAttribute(node, "style") : value;
|
|
1130
|
+
if (!value) return prev ? setAttribute(node, "style") : value;
|
|
1250
1131
|
const nodeStyle = node.style;
|
|
1251
|
-
if (typeof value === "string")
|
|
1252
|
-
return nodeStyle.cssText = value;
|
|
1132
|
+
if (typeof value === "string") return nodeStyle.cssText = value;
|
|
1253
1133
|
typeof prev === "string" && (nodeStyle.cssText = prev = void 0);
|
|
1254
1134
|
prev || (prev = {});
|
|
1255
1135
|
value || (value = {});
|
|
@@ -1280,25 +1160,21 @@ function use(fn, element, arg) {
|
|
|
1280
1160
|
return untrack(() => fn(element, arg));
|
|
1281
1161
|
}
|
|
1282
1162
|
function insert(parent, accessor, marker, initial) {
|
|
1283
|
-
if (marker !== void 0 && !initial)
|
|
1284
|
-
|
|
1285
|
-
if (typeof accessor !== "function")
|
|
1286
|
-
return insertExpression(parent, accessor, initial, marker);
|
|
1163
|
+
if (marker !== void 0 && !initial) initial = [];
|
|
1164
|
+
if (typeof accessor !== "function") return insertExpression(parent, accessor, initial, marker);
|
|
1287
1165
|
createRenderEffect((current) => insertExpression(parent, accessor(), current, marker), initial);
|
|
1288
1166
|
}
|
|
1289
1167
|
function assign(node, props, isSVG, skipChildren, prevProps = {}, skipRef = false) {
|
|
1290
1168
|
props || (props = {});
|
|
1291
1169
|
for (const prop in prevProps) {
|
|
1292
1170
|
if (!(prop in props)) {
|
|
1293
|
-
if (prop === "children")
|
|
1294
|
-
continue;
|
|
1171
|
+
if (prop === "children") continue;
|
|
1295
1172
|
prevProps[prop] = assignProp(node, prop, null, prevProps[prop], isSVG, skipRef);
|
|
1296
1173
|
}
|
|
1297
1174
|
}
|
|
1298
1175
|
for (const prop in props) {
|
|
1299
1176
|
if (prop === "children") {
|
|
1300
|
-
if (!skipChildren)
|
|
1301
|
-
insertExpression(node, props.children);
|
|
1177
|
+
if (!skipChildren) insertExpression(node, props.children);
|
|
1302
1178
|
continue;
|
|
1303
1179
|
}
|
|
1304
1180
|
const value = props[prop];
|
|
@@ -1310,20 +1186,15 @@ function toPropertyName(name) {
|
|
|
1310
1186
|
}
|
|
1311
1187
|
function toggleClassKey(node, key, value) {
|
|
1312
1188
|
const classNames = key.trim().split(/\s+/);
|
|
1313
|
-
for (let i = 0, nameLen = classNames.length; i < nameLen; i++)
|
|
1314
|
-
node.classList.toggle(classNames[i], value);
|
|
1189
|
+
for (let i = 0, nameLen = classNames.length; i < nameLen; i++) node.classList.toggle(classNames[i], value);
|
|
1315
1190
|
}
|
|
1316
1191
|
function assignProp(node, prop, value, prev, isSVG, skipRef) {
|
|
1317
1192
|
let isCE, isProp, isChildProp, propAlias, forceProp;
|
|
1318
|
-
if (prop === "style")
|
|
1319
|
-
|
|
1320
|
-
if (
|
|
1321
|
-
return classList(node, value, prev);
|
|
1322
|
-
if (value === prev)
|
|
1323
|
-
return prev;
|
|
1193
|
+
if (prop === "style") return style(node, value, prev);
|
|
1194
|
+
if (prop === "classList") return classList(node, value, prev);
|
|
1195
|
+
if (value === prev) return prev;
|
|
1324
1196
|
if (prop === "ref") {
|
|
1325
|
-
if (!skipRef)
|
|
1326
|
-
value(node);
|
|
1197
|
+
if (!skipRef) value(node);
|
|
1327
1198
|
} else if (prop.slice(0, 3) === "on:") {
|
|
1328
1199
|
const e = prop.slice(3);
|
|
1329
1200
|
prev && node.removeEventListener(e, prev);
|
|
@@ -1349,20 +1220,14 @@ function assignProp(node, prop, value, prev, isSVG, skipRef) {
|
|
|
1349
1220
|
if (forceProp) {
|
|
1350
1221
|
prop = prop.slice(5);
|
|
1351
1222
|
isProp = true;
|
|
1352
|
-
} else if (!!sharedConfig.context && node.isConnected)
|
|
1353
|
-
|
|
1354
|
-
if (
|
|
1355
|
-
|
|
1356
|
-
else if (isCE && !isProp && !isChildProp)
|
|
1357
|
-
node[toPropertyName(prop)] = value;
|
|
1358
|
-
else
|
|
1359
|
-
node[propAlias || prop] = value;
|
|
1223
|
+
} else if (!!sharedConfig.context && node.isConnected) return value;
|
|
1224
|
+
if (prop === "class" || prop === "className") className(node, value);
|
|
1225
|
+
else if (isCE && !isProp && !isChildProp) node[toPropertyName(prop)] = value;
|
|
1226
|
+
else node[propAlias || prop] = value;
|
|
1360
1227
|
} else {
|
|
1361
1228
|
const ns = isSVG && prop.indexOf(":") > -1 && SVGNamespace[prop.split(":")[0]];
|
|
1362
|
-
if (ns)
|
|
1363
|
-
|
|
1364
|
-
else
|
|
1365
|
-
setAttribute(node, Aliases[prop] || prop, value);
|
|
1229
|
+
if (ns) setAttributeNS(node, ns, prop, value);
|
|
1230
|
+
else setAttribute(node, Aliases[prop] || prop, value);
|
|
1366
1231
|
}
|
|
1367
1232
|
return value;
|
|
1368
1233
|
}
|
|
@@ -1381,15 +1246,13 @@ function eventHandler(e) {
|
|
|
1381
1246
|
return node || document;
|
|
1382
1247
|
}
|
|
1383
1248
|
});
|
|
1384
|
-
if (sharedConfig.registry && !sharedConfig.done)
|
|
1385
|
-
sharedConfig.done = _$HY.done = true;
|
|
1249
|
+
if (sharedConfig.registry && !sharedConfig.done) sharedConfig.done = _$HY.done = true;
|
|
1386
1250
|
while (node) {
|
|
1387
1251
|
const handler = node[key];
|
|
1388
1252
|
if (handler && !node.disabled) {
|
|
1389
1253
|
const data = node[`${key}Data`];
|
|
1390
1254
|
data !== void 0 ? handler.call(node, data, e) : handler.call(node, e);
|
|
1391
|
-
if (e.cancelBubble)
|
|
1392
|
-
return;
|
|
1255
|
+
if (e.cancelBubble) return;
|
|
1393
1256
|
}
|
|
1394
1257
|
node = node._$host || node.parentNode || node.host;
|
|
1395
1258
|
}
|
|
@@ -1401,49 +1264,39 @@ function insertExpression(parent, value, current, marker, unwrapArray) {
|
|
|
1401
1264
|
let cleaned = [];
|
|
1402
1265
|
for (let i = 0; i < current.length; i++) {
|
|
1403
1266
|
const node = current[i];
|
|
1404
|
-
if (node.nodeType === 8 && node.data.slice(0, 2) === "!$")
|
|
1405
|
-
|
|
1406
|
-
else
|
|
1407
|
-
cleaned.push(node);
|
|
1267
|
+
if (node.nodeType === 8 && node.data.slice(0, 2) === "!$") node.remove();
|
|
1268
|
+
else cleaned.push(node);
|
|
1408
1269
|
}
|
|
1409
1270
|
current = cleaned;
|
|
1410
1271
|
}
|
|
1411
|
-
while (typeof current === "function")
|
|
1412
|
-
|
|
1413
|
-
if (value === current)
|
|
1414
|
-
return current;
|
|
1272
|
+
while (typeof current === "function") current = current();
|
|
1273
|
+
if (value === current) return current;
|
|
1415
1274
|
const t = typeof value, multi = marker !== void 0;
|
|
1416
1275
|
parent = multi && current[0] && current[0].parentNode || parent;
|
|
1417
1276
|
if (t === "string" || t === "number") {
|
|
1418
|
-
if (hydrating)
|
|
1419
|
-
return current;
|
|
1277
|
+
if (hydrating) return current;
|
|
1420
1278
|
if (t === "number") {
|
|
1421
1279
|
value = value.toString();
|
|
1422
|
-
if (value === current)
|
|
1423
|
-
return current;
|
|
1280
|
+
if (value === current) return current;
|
|
1424
1281
|
}
|
|
1425
1282
|
if (multi) {
|
|
1426
1283
|
let node = current[0];
|
|
1427
1284
|
if (node && node.nodeType === 3) {
|
|
1428
1285
|
node.data !== value && (node.data = value);
|
|
1429
|
-
} else
|
|
1430
|
-
node = document.createTextNode(value);
|
|
1286
|
+
} else node = document.createTextNode(value);
|
|
1431
1287
|
current = cleanChildren(parent, current, marker, node);
|
|
1432
1288
|
} else {
|
|
1433
1289
|
if (current !== "" && typeof current === "string") {
|
|
1434
1290
|
current = parent.firstChild.data = value;
|
|
1435
|
-
} else
|
|
1436
|
-
current = parent.textContent = value;
|
|
1291
|
+
} else current = parent.textContent = value;
|
|
1437
1292
|
}
|
|
1438
1293
|
} else if (value == null || t === "boolean") {
|
|
1439
|
-
if (hydrating)
|
|
1440
|
-
return current;
|
|
1294
|
+
if (hydrating) return current;
|
|
1441
1295
|
current = cleanChildren(parent, current, marker);
|
|
1442
1296
|
} else if (t === "function") {
|
|
1443
1297
|
createRenderEffect(() => {
|
|
1444
1298
|
let v = value();
|
|
1445
|
-
while (typeof v === "function")
|
|
1446
|
-
v = v();
|
|
1299
|
+
while (typeof v === "function") v = v();
|
|
1447
1300
|
current = insertExpression(parent, v, current, marker);
|
|
1448
1301
|
});
|
|
1449
1302
|
return () => current;
|
|
@@ -1455,60 +1308,49 @@ function insertExpression(parent, value, current, marker, unwrapArray) {
|
|
|
1455
1308
|
return () => current;
|
|
1456
1309
|
}
|
|
1457
1310
|
if (hydrating) {
|
|
1458
|
-
if (!array.length)
|
|
1459
|
-
|
|
1460
|
-
if (marker === void 0)
|
|
1461
|
-
return [...parent.childNodes];
|
|
1311
|
+
if (!array.length) return current;
|
|
1312
|
+
if (marker === void 0) return [...parent.childNodes];
|
|
1462
1313
|
let node = array[0];
|
|
1463
1314
|
let nodes = [node];
|
|
1464
|
-
while ((node = node.nextSibling) !== marker)
|
|
1465
|
-
nodes.push(node);
|
|
1315
|
+
while ((node = node.nextSibling) !== marker) nodes.push(node);
|
|
1466
1316
|
return current = nodes;
|
|
1467
1317
|
}
|
|
1468
1318
|
if (array.length === 0) {
|
|
1469
1319
|
current = cleanChildren(parent, current, marker);
|
|
1470
|
-
if (multi)
|
|
1471
|
-
return current;
|
|
1320
|
+
if (multi) return current;
|
|
1472
1321
|
} else if (currentArray) {
|
|
1473
1322
|
if (current.length === 0) {
|
|
1474
1323
|
appendNodes(parent, array, marker);
|
|
1475
|
-
} else
|
|
1476
|
-
reconcileArrays(parent, current, array);
|
|
1324
|
+
} else reconcileArrays(parent, current, array);
|
|
1477
1325
|
} else {
|
|
1478
1326
|
current && cleanChildren(parent);
|
|
1479
1327
|
appendNodes(parent, array);
|
|
1480
1328
|
}
|
|
1481
1329
|
current = array;
|
|
1482
1330
|
} else if (value.nodeType) {
|
|
1483
|
-
if (hydrating && value.parentNode)
|
|
1484
|
-
return current = multi ? [value] : value;
|
|
1331
|
+
if (hydrating && value.parentNode) return current = multi ? [value] : value;
|
|
1485
1332
|
if (Array.isArray(current)) {
|
|
1486
|
-
if (multi)
|
|
1487
|
-
return current = cleanChildren(parent, current, marker, value);
|
|
1333
|
+
if (multi) return current = cleanChildren(parent, current, marker, value);
|
|
1488
1334
|
cleanChildren(parent, current, null, value);
|
|
1489
1335
|
} else if (current == null || current === "" || !parent.firstChild) {
|
|
1490
1336
|
parent.appendChild(value);
|
|
1491
|
-
} else
|
|
1492
|
-
parent.replaceChild(value, parent.firstChild);
|
|
1337
|
+
} else parent.replaceChild(value, parent.firstChild);
|
|
1493
1338
|
current = value;
|
|
1494
|
-
} else
|
|
1495
|
-
;
|
|
1339
|
+
} else ;
|
|
1496
1340
|
return current;
|
|
1497
1341
|
}
|
|
1498
1342
|
function normalizeIncomingArray(normalized, array, current, unwrap) {
|
|
1499
1343
|
let dynamic = false;
|
|
1500
1344
|
for (let i = 0, len = array.length; i < len; i++) {
|
|
1501
1345
|
let item = array[i], prev = current && current[normalized.length], t;
|
|
1502
|
-
if (item == null || item === true || item === false)
|
|
1503
|
-
;
|
|
1346
|
+
if (item == null || item === true || item === false) ;
|
|
1504
1347
|
else if ((t = typeof item) === "object" && item.nodeType) {
|
|
1505
1348
|
normalized.push(item);
|
|
1506
1349
|
} else if (Array.isArray(item)) {
|
|
1507
1350
|
dynamic = normalizeIncomingArray(normalized, item, prev) || dynamic;
|
|
1508
1351
|
} else if (t === "function") {
|
|
1509
1352
|
if (unwrap) {
|
|
1510
|
-
while (typeof item === "function")
|
|
1511
|
-
item = item();
|
|
1353
|
+
while (typeof item === "function") item = item();
|
|
1512
1354
|
dynamic = normalizeIncomingArray(normalized, Array.isArray(item) ? item : [item], Array.isArray(prev) ? prev : [prev]) || dynamic;
|
|
1513
1355
|
} else {
|
|
1514
1356
|
normalized.push(item);
|
|
@@ -1516,21 +1358,17 @@ function normalizeIncomingArray(normalized, array, current, unwrap) {
|
|
|
1516
1358
|
}
|
|
1517
1359
|
} else {
|
|
1518
1360
|
const value = String(item);
|
|
1519
|
-
if (prev && prev.nodeType === 3 && prev.data === value)
|
|
1520
|
-
|
|
1521
|
-
else
|
|
1522
|
-
normalized.push(document.createTextNode(value));
|
|
1361
|
+
if (prev && prev.nodeType === 3 && prev.data === value) normalized.push(prev);
|
|
1362
|
+
else normalized.push(document.createTextNode(value));
|
|
1523
1363
|
}
|
|
1524
1364
|
}
|
|
1525
1365
|
return dynamic;
|
|
1526
1366
|
}
|
|
1527
1367
|
function appendNodes(parent, array, marker = null) {
|
|
1528
|
-
for (let i = 0, len = array.length; i < len; i++)
|
|
1529
|
-
parent.insertBefore(array[i], marker);
|
|
1368
|
+
for (let i = 0, len = array.length; i < len; i++) parent.insertBefore(array[i], marker);
|
|
1530
1369
|
}
|
|
1531
1370
|
function cleanChildren(parent, current, marker, replacement) {
|
|
1532
|
-
if (marker === void 0)
|
|
1533
|
-
return parent.textContent = "";
|
|
1371
|
+
if (marker === void 0) return parent.textContent = "";
|
|
1534
1372
|
const node = replacement || document.createTextNode("");
|
|
1535
1373
|
if (current.length) {
|
|
1536
1374
|
let inserted = false;
|
|
@@ -1538,15 +1376,11 @@ function cleanChildren(parent, current, marker, replacement) {
|
|
|
1538
1376
|
const el = current[i];
|
|
1539
1377
|
if (node !== el) {
|
|
1540
1378
|
const isParent = el.parentNode === parent;
|
|
1541
|
-
if (!inserted && !i)
|
|
1542
|
-
|
|
1543
|
-
|
|
1544
|
-
|
|
1545
|
-
|
|
1546
|
-
inserted = true;
|
|
1547
|
-
}
|
|
1548
|
-
} else
|
|
1549
|
-
parent.insertBefore(node, marker);
|
|
1379
|
+
if (!inserted && !i) isParent ? parent.replaceChild(node, el) : parent.insertBefore(node, marker);
|
|
1380
|
+
else isParent && el.remove();
|
|
1381
|
+
} else inserted = true;
|
|
1382
|
+
}
|
|
1383
|
+
} else parent.insertBefore(node, marker);
|
|
1550
1384
|
return [node];
|
|
1551
1385
|
}
|
|
1552
1386
|
var RequestContext = Symbol();
|
|
@@ -1562,8 +1396,7 @@ function Portal(props) {
|
|
|
1562
1396
|
let content;
|
|
1563
1397
|
let hydrating = !!sharedConfig.context;
|
|
1564
1398
|
createEffect(() => {
|
|
1565
|
-
if (hydrating)
|
|
1566
|
-
getOwner().user = hydrating = false;
|
|
1399
|
+
if (hydrating) getOwner().user = hydrating = false;
|
|
1567
1400
|
content || (content = runWithOwner(owner, () => createMemo(() => props.children)));
|
|
1568
1401
|
const el = mount();
|
|
1569
1402
|
if (el instanceof HTMLHeadElement) {
|
|
@@ -1592,13 +1425,13 @@ function Portal(props) {
|
|
|
1592
1425
|
return marker;
|
|
1593
1426
|
}
|
|
1594
1427
|
|
|
1595
|
-
// ../../node_modules/.pnpm/nanostores@0.
|
|
1428
|
+
// ../../node_modules/.pnpm/nanostores@0.11.2/node_modules/nanostores/task/index.js
|
|
1596
1429
|
var tasks = 0;
|
|
1597
1430
|
function cleanTasks() {
|
|
1598
1431
|
tasks = 0;
|
|
1599
1432
|
}
|
|
1600
1433
|
|
|
1601
|
-
// ../../node_modules/.pnpm/nanostores@0.
|
|
1434
|
+
// ../../node_modules/.pnpm/nanostores@0.11.2/node_modules/nanostores/clean-stores/index.js
|
|
1602
1435
|
var clean = Symbol("clean");
|
|
1603
1436
|
var cleanStores = (...stores) => {
|
|
1604
1437
|
if (false) {
|
|
@@ -1609,17 +1442,18 @@ var cleanStores = (...stores) => {
|
|
|
1609
1442
|
cleanTasks();
|
|
1610
1443
|
for (let $store of stores) {
|
|
1611
1444
|
if ($store) {
|
|
1612
|
-
if ($store.mocked)
|
|
1613
|
-
|
|
1614
|
-
if ($store[clean])
|
|
1615
|
-
$store[clean]();
|
|
1445
|
+
if ($store.mocked) delete $store.mocked;
|
|
1446
|
+
if ($store[clean]) $store[clean]();
|
|
1616
1447
|
}
|
|
1617
1448
|
}
|
|
1618
1449
|
};
|
|
1619
1450
|
|
|
1620
|
-
// ../../node_modules/.pnpm/nanostores@0.
|
|
1451
|
+
// ../../node_modules/.pnpm/nanostores@0.11.2/node_modules/nanostores/atom/index.js
|
|
1621
1452
|
var listenerQueue = [];
|
|
1622
|
-
var
|
|
1453
|
+
var lqIndex = 0;
|
|
1454
|
+
var QUEUE_ITEMS_PER_LISTENER = 4;
|
|
1455
|
+
var epoch = 0;
|
|
1456
|
+
var atom = (initialValue) => {
|
|
1623
1457
|
let listeners = [];
|
|
1624
1458
|
let $atom = {
|
|
1625
1459
|
get() {
|
|
@@ -1629,51 +1463,42 @@ var atom = (initialValue, level) => {
|
|
|
1629
1463
|
}
|
|
1630
1464
|
return $atom.value;
|
|
1631
1465
|
},
|
|
1632
|
-
l: level || 0,
|
|
1633
1466
|
lc: 0,
|
|
1634
|
-
listen(listener
|
|
1635
|
-
$atom.lc = listeners.push(listener
|
|
1467
|
+
listen(listener) {
|
|
1468
|
+
$atom.lc = listeners.push(listener);
|
|
1636
1469
|
return () => {
|
|
1470
|
+
for (let i = lqIndex + QUEUE_ITEMS_PER_LISTENER; i < listenerQueue.length; ) {
|
|
1471
|
+
if (listenerQueue[i] === listener) {
|
|
1472
|
+
listenerQueue.splice(i, QUEUE_ITEMS_PER_LISTENER);
|
|
1473
|
+
} else {
|
|
1474
|
+
i += QUEUE_ITEMS_PER_LISTENER;
|
|
1475
|
+
}
|
|
1476
|
+
}
|
|
1637
1477
|
let index = listeners.indexOf(listener);
|
|
1638
1478
|
if (~index) {
|
|
1639
|
-
listeners.splice(index,
|
|
1640
|
-
if (!--$atom.lc)
|
|
1641
|
-
$atom.off();
|
|
1479
|
+
listeners.splice(index, 1);
|
|
1480
|
+
if (!--$atom.lc) $atom.off();
|
|
1642
1481
|
}
|
|
1643
1482
|
};
|
|
1644
1483
|
},
|
|
1645
1484
|
notify(oldValue, changedKey) {
|
|
1485
|
+
epoch++;
|
|
1646
1486
|
let runListenerQueue = !listenerQueue.length;
|
|
1647
|
-
for (let
|
|
1487
|
+
for (let listener of listeners) {
|
|
1648
1488
|
listenerQueue.push(
|
|
1649
|
-
|
|
1650
|
-
listeners[i + 1],
|
|
1489
|
+
listener,
|
|
1651
1490
|
$atom.value,
|
|
1652
1491
|
oldValue,
|
|
1653
1492
|
changedKey
|
|
1654
1493
|
);
|
|
1655
1494
|
}
|
|
1656
1495
|
if (runListenerQueue) {
|
|
1657
|
-
for (
|
|
1658
|
-
|
|
1659
|
-
|
|
1660
|
-
|
|
1661
|
-
|
|
1662
|
-
|
|
1663
|
-
listenerQueue[i + 1],
|
|
1664
|
-
listenerQueue[i + 2],
|
|
1665
|
-
listenerQueue[i + 3],
|
|
1666
|
-
listenerQueue[i + 4]
|
|
1667
|
-
);
|
|
1668
|
-
}
|
|
1669
|
-
}
|
|
1670
|
-
if (!skip) {
|
|
1671
|
-
listenerQueue[i](
|
|
1672
|
-
listenerQueue[i + 2],
|
|
1673
|
-
listenerQueue[i + 3],
|
|
1674
|
-
listenerQueue[i + 4]
|
|
1675
|
-
);
|
|
1676
|
-
}
|
|
1496
|
+
for (lqIndex = 0; lqIndex < listenerQueue.length; lqIndex += QUEUE_ITEMS_PER_LISTENER) {
|
|
1497
|
+
listenerQueue[lqIndex](
|
|
1498
|
+
listenerQueue[lqIndex + 1],
|
|
1499
|
+
listenerQueue[lqIndex + 2],
|
|
1500
|
+
listenerQueue[lqIndex + 3]
|
|
1501
|
+
);
|
|
1677
1502
|
}
|
|
1678
1503
|
listenerQueue.length = 0;
|
|
1679
1504
|
}
|
|
@@ -1689,8 +1514,8 @@ var atom = (initialValue, level) => {
|
|
|
1689
1514
|
$atom.notify(oldValue);
|
|
1690
1515
|
}
|
|
1691
1516
|
},
|
|
1692
|
-
subscribe(listener
|
|
1693
|
-
let unbind = $atom.listen(listener
|
|
1517
|
+
subscribe(listener) {
|
|
1518
|
+
let unbind = $atom.listen(listener);
|
|
1694
1519
|
listener($atom.value);
|
|
1695
1520
|
return unbind;
|
|
1696
1521
|
},
|
|
@@ -1706,7 +1531,7 @@ var atom = (initialValue, level) => {
|
|
|
1706
1531
|
return $atom;
|
|
1707
1532
|
};
|
|
1708
1533
|
|
|
1709
|
-
// ../../node_modules/.pnpm/nanostores@0.
|
|
1534
|
+
// ../../node_modules/.pnpm/nanostores@0.11.2/node_modules/nanostores/lifecycle/index.js
|
|
1710
1535
|
var MOUNT = 5;
|
|
1711
1536
|
var UNMOUNT = 6;
|
|
1712
1537
|
var REVERT_MUTATION = 10;
|
|
@@ -1737,8 +1562,7 @@ var STORE_UNMOUNT_DELAY = 1e3;
|
|
|
1737
1562
|
var onMount2 = ($store, initialize) => {
|
|
1738
1563
|
let listener = (payload) => {
|
|
1739
1564
|
let destroy = initialize(payload);
|
|
1740
|
-
if (destroy)
|
|
1741
|
-
$store.events[UNMOUNT].push(destroy);
|
|
1565
|
+
if (destroy) $store.events[UNMOUNT].push(destroy);
|
|
1742
1566
|
};
|
|
1743
1567
|
return on2($store, listener, MOUNT, (runListeners) => {
|
|
1744
1568
|
let originListen = $store.listen;
|
|
@@ -1756,8 +1580,7 @@ var onMount2 = ($store, initialize) => {
|
|
|
1756
1580
|
setTimeout(() => {
|
|
1757
1581
|
if ($store.active && !$store.lc) {
|
|
1758
1582
|
$store.active = false;
|
|
1759
|
-
for (let destroy of $store.events[UNMOUNT])
|
|
1760
|
-
destroy();
|
|
1583
|
+
for (let destroy of $store.events[UNMOUNT]) destroy();
|
|
1761
1584
|
$store.events[UNMOUNT] = [];
|
|
1762
1585
|
}
|
|
1763
1586
|
}, STORE_UNMOUNT_DELAY);
|
|
@@ -1765,8 +1588,7 @@ var onMount2 = ($store, initialize) => {
|
|
|
1765
1588
|
if (true) {
|
|
1766
1589
|
let originClean = $store[clean];
|
|
1767
1590
|
$store[clean] = () => {
|
|
1768
|
-
for (let destroy of $store.events[UNMOUNT])
|
|
1769
|
-
destroy();
|
|
1591
|
+
for (let destroy of $store.events[UNMOUNT]) destroy();
|
|
1770
1592
|
$store.events[UNMOUNT] = [];
|
|
1771
1593
|
$store.active = false;
|
|
1772
1594
|
originClean();
|
|
@@ -1779,7 +1601,7 @@ var onMount2 = ($store, initialize) => {
|
|
|
1779
1601
|
});
|
|
1780
1602
|
};
|
|
1781
1603
|
|
|
1782
|
-
// ../../node_modules/.pnpm/nanostores@0.
|
|
1604
|
+
// ../../node_modules/.pnpm/nanostores@0.11.2/node_modules/nanostores/deep-map/path.js
|
|
1783
1605
|
function getPath(obj, path) {
|
|
1784
1606
|
let allKeys = getAllKeysFromPath(path);
|
|
1785
1607
|
let res = obj;
|
|
@@ -1796,11 +1618,10 @@ function setPath(obj, path, value) {
|
|
|
1796
1618
|
}
|
|
1797
1619
|
function setByKey(obj, splittedKeys, value) {
|
|
1798
1620
|
let key = splittedKeys[0];
|
|
1799
|
-
ensureKey(obj, key, splittedKeys[1]);
|
|
1800
1621
|
let copy = Array.isArray(obj) ? [...obj] : { ...obj };
|
|
1801
1622
|
if (splittedKeys.length === 1) {
|
|
1802
1623
|
if (value === void 0) {
|
|
1803
|
-
if (Array.isArray(
|
|
1624
|
+
if (Array.isArray(copy)) {
|
|
1804
1625
|
copy.splice(key, 1);
|
|
1805
1626
|
} else {
|
|
1806
1627
|
delete copy[key];
|
|
@@ -1810,9 +1631,9 @@ function setByKey(obj, splittedKeys, value) {
|
|
|
1810
1631
|
}
|
|
1811
1632
|
return copy;
|
|
1812
1633
|
}
|
|
1813
|
-
|
|
1814
|
-
|
|
1815
|
-
return
|
|
1634
|
+
ensureKey(copy, key, splittedKeys[1]);
|
|
1635
|
+
copy[key] = setByKey(copy[key], splittedKeys.slice(1), value);
|
|
1636
|
+
return copy;
|
|
1816
1637
|
}
|
|
1817
1638
|
var ARRAY_INDEX = /(.*)\[(\d+)\]/;
|
|
1818
1639
|
function getAllKeysFromPath(path) {
|
|
@@ -1832,24 +1653,19 @@ function ensureKey(obj, key, nextKey) {
|
|
|
1832
1653
|
}
|
|
1833
1654
|
let isNum = IS_NUMBER.test(nextKey);
|
|
1834
1655
|
if (isNum) {
|
|
1835
|
-
obj[key] = Array(parseInt(nextKey, 10) + 1)
|
|
1656
|
+
obj[key] = Array(parseInt(nextKey, 10) + 1);
|
|
1836
1657
|
} else {
|
|
1837
1658
|
obj[key] = {};
|
|
1838
1659
|
}
|
|
1839
1660
|
}
|
|
1840
1661
|
|
|
1841
|
-
// ../../node_modules/.pnpm/nanostores@0.
|
|
1662
|
+
// ../../node_modules/.pnpm/nanostores@0.11.2/node_modules/nanostores/deep-map/index.js
|
|
1842
1663
|
function deepMap(initial = {}) {
|
|
1843
1664
|
let $deepMap = atom(initial);
|
|
1844
1665
|
$deepMap.setKey = (key, value) => {
|
|
1845
|
-
let oldValue;
|
|
1846
|
-
try {
|
|
1847
|
-
oldValue = structuredClone($deepMap.value);
|
|
1848
|
-
} catch {
|
|
1849
|
-
oldValue = { ...$deepMap.value };
|
|
1850
|
-
}
|
|
1851
1666
|
if (getPath($deepMap.value, key) !== value) {
|
|
1852
|
-
|
|
1667
|
+
let oldValue = $deepMap.value;
|
|
1668
|
+
$deepMap.value = setPath($deepMap.value, key, value);
|
|
1853
1669
|
$deepMap.notify(oldValue, key);
|
|
1854
1670
|
}
|
|
1855
1671
|
};
|
|
@@ -1860,23 +1676,18 @@ function deepMap(initial = {}) {
|
|
|
1860
1676
|
var has = Object.prototype.hasOwnProperty;
|
|
1861
1677
|
function find(iter, tar, key) {
|
|
1862
1678
|
for (key of iter.keys()) {
|
|
1863
|
-
if (dequal(key, tar))
|
|
1864
|
-
return key;
|
|
1679
|
+
if (dequal(key, tar)) return key;
|
|
1865
1680
|
}
|
|
1866
1681
|
}
|
|
1867
1682
|
function dequal(foo, bar) {
|
|
1868
1683
|
var ctor, len, tmp;
|
|
1869
|
-
if (foo === bar)
|
|
1870
|
-
return true;
|
|
1684
|
+
if (foo === bar) return true;
|
|
1871
1685
|
if (foo && bar && (ctor = foo.constructor) === bar.constructor) {
|
|
1872
|
-
if (ctor === Date)
|
|
1873
|
-
|
|
1874
|
-
if (ctor === RegExp)
|
|
1875
|
-
return foo.toString() === bar.toString();
|
|
1686
|
+
if (ctor === Date) return foo.getTime() === bar.getTime();
|
|
1687
|
+
if (ctor === RegExp) return foo.toString() === bar.toString();
|
|
1876
1688
|
if (ctor === Array) {
|
|
1877
1689
|
if ((len = foo.length) === bar.length) {
|
|
1878
|
-
while (len-- && dequal(foo[len], bar[len]))
|
|
1879
|
-
;
|
|
1690
|
+
while (len-- && dequal(foo[len], bar[len])) ;
|
|
1880
1691
|
}
|
|
1881
1692
|
return len === -1;
|
|
1882
1693
|
}
|
|
@@ -1888,11 +1699,9 @@ function dequal(foo, bar) {
|
|
|
1888
1699
|
tmp = len;
|
|
1889
1700
|
if (tmp && typeof tmp === "object") {
|
|
1890
1701
|
tmp = find(bar, tmp);
|
|
1891
|
-
if (!tmp)
|
|
1892
|
-
return false;
|
|
1702
|
+
if (!tmp) return false;
|
|
1893
1703
|
}
|
|
1894
|
-
if (!bar.has(tmp))
|
|
1895
|
-
return false;
|
|
1704
|
+
if (!bar.has(tmp)) return false;
|
|
1896
1705
|
}
|
|
1897
1706
|
return true;
|
|
1898
1707
|
}
|
|
@@ -1904,8 +1713,7 @@ function dequal(foo, bar) {
|
|
|
1904
1713
|
tmp = len[0];
|
|
1905
1714
|
if (tmp && typeof tmp === "object") {
|
|
1906
1715
|
tmp = find(bar, tmp);
|
|
1907
|
-
if (!tmp)
|
|
1908
|
-
return false;
|
|
1716
|
+
if (!tmp) return false;
|
|
1909
1717
|
}
|
|
1910
1718
|
if (!dequal(len[1], bar.get(tmp))) {
|
|
1911
1719
|
return false;
|
|
@@ -1918,25 +1726,21 @@ function dequal(foo, bar) {
|
|
|
1918
1726
|
bar = new Uint8Array(bar);
|
|
1919
1727
|
} else if (ctor === DataView) {
|
|
1920
1728
|
if ((len = foo.byteLength) === bar.byteLength) {
|
|
1921
|
-
while (len-- && foo.getInt8(len) === bar.getInt8(len))
|
|
1922
|
-
;
|
|
1729
|
+
while (len-- && foo.getInt8(len) === bar.getInt8(len)) ;
|
|
1923
1730
|
}
|
|
1924
1731
|
return len === -1;
|
|
1925
1732
|
}
|
|
1926
1733
|
if (ArrayBuffer.isView(foo)) {
|
|
1927
1734
|
if ((len = foo.byteLength) === bar.byteLength) {
|
|
1928
|
-
while (len-- && foo[len] === bar[len])
|
|
1929
|
-
;
|
|
1735
|
+
while (len-- && foo[len] === bar[len]) ;
|
|
1930
1736
|
}
|
|
1931
1737
|
return len === -1;
|
|
1932
1738
|
}
|
|
1933
1739
|
if (!ctor || typeof foo === "object") {
|
|
1934
1740
|
len = 0;
|
|
1935
1741
|
for (ctor in foo) {
|
|
1936
|
-
if (has.call(foo, ctor) && ++len && !has.call(bar, ctor))
|
|
1937
|
-
|
|
1938
|
-
if (!(ctor in bar) || !dequal(foo[ctor], bar[ctor]))
|
|
1939
|
-
return false;
|
|
1742
|
+
if (has.call(foo, ctor) && ++len && !has.call(bar, ctor)) return false;
|
|
1743
|
+
if (!(ctor in bar) || !dequal(foo[ctor], bar[ctor])) return false;
|
|
1940
1744
|
}
|
|
1941
1745
|
return Object.keys(bar).length === len;
|
|
1942
1746
|
}
|
|
@@ -2120,8 +1924,7 @@ var createQueue = (queue, stopped = false) => {
|
|
|
2120
1924
|
const run = async () => {
|
|
2121
1925
|
const items = queue.slice();
|
|
2122
1926
|
for await (const item of items) {
|
|
2123
|
-
if (stopped)
|
|
2124
|
-
break;
|
|
1927
|
+
if (stopped) break;
|
|
2125
1928
|
try {
|
|
2126
1929
|
await item();
|
|
2127
1930
|
} catch (error) {
|
|
@@ -2241,15 +2044,13 @@ var createAudio = (options) => {
|
|
|
2241
2044
|
let resume = false;
|
|
2242
2045
|
const unregister = registerEventListeners({
|
|
2243
2046
|
focus: () => {
|
|
2244
|
-
if (!options.pauseOnBlur || !resume || state.destroyed)
|
|
2245
|
-
return;
|
|
2047
|
+
if (!options.pauseOnBlur || !resume || state.destroyed) return;
|
|
2246
2048
|
resume = false;
|
|
2247
2049
|
queue.queue.push(playAudio);
|
|
2248
2050
|
queue.execute();
|
|
2249
2051
|
},
|
|
2250
2052
|
blur: () => {
|
|
2251
|
-
if (!options.pauseOnBlur || !state.playing || state.destroyed)
|
|
2252
|
-
return;
|
|
2053
|
+
if (!options.pauseOnBlur || !state.playing || state.destroyed) return;
|
|
2253
2054
|
resume = true;
|
|
2254
2055
|
queue.queue.push(pauseAudio);
|
|
2255
2056
|
queue.execute();
|
|
@@ -2261,8 +2062,7 @@ var createAudio = (options) => {
|
|
|
2261
2062
|
destroyed: false
|
|
2262
2063
|
};
|
|
2263
2064
|
const playAudio = async () => {
|
|
2264
|
-
if (state.destroyed)
|
|
2265
|
-
return;
|
|
2065
|
+
if (state.destroyed) return;
|
|
2266
2066
|
if (audioContext.state === "suspended") {
|
|
2267
2067
|
await audioContext.resume();
|
|
2268
2068
|
if (state.started) {
|
|
@@ -2276,8 +2076,7 @@ var createAudio = (options) => {
|
|
|
2276
2076
|
}
|
|
2277
2077
|
};
|
|
2278
2078
|
const pauseAudio = async () => {
|
|
2279
|
-
if (state.destroyed)
|
|
2280
|
-
return;
|
|
2079
|
+
if (state.destroyed) return;
|
|
2281
2080
|
if (audioContext.state === "suspended" && queue.queue.at(-1) === playAudio) {
|
|
2282
2081
|
queue.queue.pop();
|
|
2283
2082
|
}
|
|
@@ -2292,20 +2091,17 @@ var createAudio = (options) => {
|
|
|
2292
2091
|
};
|
|
2293
2092
|
const instance = {
|
|
2294
2093
|
async play() {
|
|
2295
|
-
if (state.destroyed)
|
|
2296
|
-
return;
|
|
2094
|
+
if (state.destroyed) return;
|
|
2297
2095
|
queue.queue.push(playAudio);
|
|
2298
2096
|
return queue.execute();
|
|
2299
2097
|
},
|
|
2300
2098
|
async pause() {
|
|
2301
|
-
if (state.destroyed)
|
|
2302
|
-
return;
|
|
2099
|
+
if (state.destroyed) return;
|
|
2303
2100
|
queue.queue.push(pauseAudio);
|
|
2304
2101
|
return queue.execute();
|
|
2305
2102
|
},
|
|
2306
2103
|
async reset() {
|
|
2307
|
-
if (state.destroyed)
|
|
2308
|
-
return;
|
|
2104
|
+
if (state.destroyed) return;
|
|
2309
2105
|
if (state.playing) {
|
|
2310
2106
|
queue.queue.push(pauseAudio);
|
|
2311
2107
|
}
|
|
@@ -2321,8 +2117,7 @@ var createAudio = (options) => {
|
|
|
2321
2117
|
return queue.execute();
|
|
2322
2118
|
},
|
|
2323
2119
|
async stop() {
|
|
2324
|
-
if (state.destroyed)
|
|
2325
|
-
return;
|
|
2120
|
+
if (state.destroyed) return;
|
|
2326
2121
|
queue.queue.push(
|
|
2327
2122
|
pauseAudio,
|
|
2328
2123
|
disconnectAudio,
|
|
@@ -2333,8 +2128,7 @@ var createAudio = (options) => {
|
|
|
2333
2128
|
return queue.execute();
|
|
2334
2129
|
},
|
|
2335
2130
|
async destroy() {
|
|
2336
|
-
if (state.destroyed)
|
|
2337
|
-
return;
|
|
2131
|
+
if (state.destroyed) return;
|
|
2338
2132
|
unregister();
|
|
2339
2133
|
queue.queue = [
|
|
2340
2134
|
pauseAudio,
|
|
@@ -2349,8 +2143,7 @@ var createAudio = (options) => {
|
|
|
2349
2143
|
audioBuffer = null;
|
|
2350
2144
|
},
|
|
2351
2145
|
async fetch() {
|
|
2352
|
-
if (state.destroyed)
|
|
2353
|
-
return;
|
|
2146
|
+
if (state.destroyed) return;
|
|
2354
2147
|
await fetchArrayBuffer();
|
|
2355
2148
|
},
|
|
2356
2149
|
get playing() {
|
|
@@ -2363,8 +2156,7 @@ var createAudio = (options) => {
|
|
|
2363
2156
|
return pendingVolume;
|
|
2364
2157
|
},
|
|
2365
2158
|
set volume(value) {
|
|
2366
|
-
if (state.destroyed)
|
|
2367
|
-
return;
|
|
2159
|
+
if (state.destroyed) return;
|
|
2368
2160
|
pendingVolume = value;
|
|
2369
2161
|
queue.queue.push(setVolume);
|
|
2370
2162
|
queue.execute();
|
|
@@ -2373,8 +2165,7 @@ var createAudio = (options) => {
|
|
|
2373
2165
|
return pendingLoop;
|
|
2374
2166
|
},
|
|
2375
2167
|
set loop(value) {
|
|
2376
|
-
if (state.destroyed)
|
|
2377
|
-
return;
|
|
2168
|
+
if (state.destroyed) return;
|
|
2378
2169
|
pendingLoop = value;
|
|
2379
2170
|
queue.queue.push(setLoop);
|
|
2380
2171
|
queue.execute();
|
|
@@ -2445,16 +2236,7 @@ var deepAtom = (init) => {
|
|
|
2445
2236
|
return newValue;
|
|
2446
2237
|
}
|
|
2447
2238
|
const oldValue = $atom.value;
|
|
2448
|
-
|
|
2449
|
-
split: () => {
|
|
2450
|
-
return {
|
|
2451
|
-
flatMap: () => {
|
|
2452
|
-
return path;
|
|
2453
|
-
}
|
|
2454
|
-
};
|
|
2455
|
-
}
|
|
2456
|
-
};
|
|
2457
|
-
$atom.value = setPath($atom.value, fakedPath, newValue);
|
|
2239
|
+
$atom.value = setByKey($atom.value, path, newValue);
|
|
2458
2240
|
$atom.notify(oldValue, path.join("."));
|
|
2459
2241
|
return newValue;
|
|
2460
2242
|
};
|
|
@@ -2592,8 +2374,7 @@ var createAudio2 = (storageData) => {
|
|
|
2592
2374
|
const getAudio = (type, src) => {
|
|
2593
2375
|
const kind = type === "voice" ? "voices" : type;
|
|
2594
2376
|
const cached = store[kind][src];
|
|
2595
|
-
if (cached)
|
|
2596
|
-
return cached;
|
|
2377
|
+
if (cached) return cached;
|
|
2597
2378
|
const audio = createAudio({
|
|
2598
2379
|
src,
|
|
2599
2380
|
volume: getVolume(type),
|
|
@@ -2630,21 +2411,18 @@ var createAudio2 = (storageData) => {
|
|
|
2630
2411
|
resource.play();
|
|
2631
2412
|
},
|
|
2632
2413
|
voiceStop() {
|
|
2633
|
-
if (!store.voice)
|
|
2634
|
-
return;
|
|
2414
|
+
if (!store.voice) return;
|
|
2635
2415
|
store.voice.stop();
|
|
2636
2416
|
store.voice = void 0;
|
|
2637
2417
|
},
|
|
2638
2418
|
start() {
|
|
2639
|
-
if (unsubscribe !== noop)
|
|
2640
|
-
return;
|
|
2419
|
+
if (unsubscribe !== noop) return;
|
|
2641
2420
|
unsubscribe = storageData.subscribe(() => {
|
|
2642
2421
|
for (const type of ["music", "sound", "voice"]) {
|
|
2643
2422
|
const volume = getVolume(type);
|
|
2644
2423
|
if (type === "music" || type === "sound") {
|
|
2645
2424
|
for (const audio of Object.values(store[type])) {
|
|
2646
|
-
if (!audio)
|
|
2647
|
-
continue;
|
|
2425
|
+
if (!audio) continue;
|
|
2648
2426
|
try {
|
|
2649
2427
|
audio.volume = volume;
|
|
2650
2428
|
} catch {
|
|
@@ -2682,8 +2460,7 @@ var createAudio2 = (storageData) => {
|
|
|
2682
2460
|
const musics = Object.entries(store.music).filter(([name]) => keepAudio.music && !keepAudio.music.has(name)).map(([_, h]) => h);
|
|
2683
2461
|
const sounds = Object.entries(store.sound).filter(([name]) => keepAudio.sounds && !keepAudio.sounds.has(name)).map(([_, h]) => h);
|
|
2684
2462
|
for (const music of [...musics, ...sounds]) {
|
|
2685
|
-
if (!music)
|
|
2686
|
-
continue;
|
|
2463
|
+
if (!music) continue;
|
|
2687
2464
|
music.stop();
|
|
2688
2465
|
}
|
|
2689
2466
|
};
|
|
@@ -2776,14 +2553,7 @@ var vibrate = (pattern) => {
|
|
|
2776
2553
|
}
|
|
2777
2554
|
}
|
|
2778
2555
|
};
|
|
2779
|
-
var
|
|
2780
|
-
if (media === "portrait" || media === "landscape") {
|
|
2781
|
-
return `(orientation: ${media})`;
|
|
2782
|
-
}
|
|
2783
|
-
return media;
|
|
2784
|
-
};
|
|
2785
|
-
var useBackground = (obj, set) => {
|
|
2786
|
-
const backgrounds = Object.fromEntries(Object.entries(obj).map(([key, value]) => [toMedia(key), value]));
|
|
2556
|
+
var useBackground = (backgrounds, set) => {
|
|
2787
2557
|
const mediaQueries = Object.keys(backgrounds).map((media) => matchMedia(media));
|
|
2788
2558
|
const allMedia = mediaQueries.find(({ media }) => media === "all");
|
|
2789
2559
|
const handle = () => {
|
|
@@ -2796,8 +2566,7 @@ var useBackground = (obj, set) => {
|
|
|
2796
2566
|
}
|
|
2797
2567
|
let disposed = false;
|
|
2798
2568
|
Promise.resolve().then(() => {
|
|
2799
|
-
if (disposed)
|
|
2800
|
-
return;
|
|
2569
|
+
if (disposed) return;
|
|
2801
2570
|
handle();
|
|
2802
2571
|
});
|
|
2803
2572
|
return {
|
|
@@ -2943,10 +2712,8 @@ var handleClearAction = ($rendererState, $contextState, options, context, keep,
|
|
|
2943
2712
|
}
|
|
2944
2713
|
}
|
|
2945
2714
|
for (const [id, obj] of Object.entries(custom)) {
|
|
2946
|
-
if (!obj)
|
|
2947
|
-
|
|
2948
|
-
if (context.meta.goingBack && obj.fn.skipClearOnGoingBack)
|
|
2949
|
-
continue;
|
|
2715
|
+
if (!obj) continue;
|
|
2716
|
+
if (context.meta.goingBack && obj.fn.skipClearOnGoingBack) continue;
|
|
2950
2717
|
options.clearCustomAction(context, obj.fn);
|
|
2951
2718
|
$contextState.mutate((s) => s.custom[id], void 0);
|
|
2952
2719
|
}
|
|
@@ -3044,8 +2811,7 @@ var handleInputAction = ($contextState, options, context, label, onInput, setup,
|
|
|
3044
2811
|
error,
|
|
3045
2812
|
state: options.getStateFunction(context.id),
|
|
3046
2813
|
get value() {
|
|
3047
|
-
if (value)
|
|
3048
|
-
return value;
|
|
2814
|
+
if (value) return value;
|
|
3049
2815
|
return value = escapeHTML(input.value);
|
|
3050
2816
|
}
|
|
3051
2817
|
});
|
|
@@ -3236,8 +3002,7 @@ var getDocumentStyles = () => {
|
|
|
3236
3002
|
var once = (fn) => {
|
|
3237
3003
|
let ran = false;
|
|
3238
3004
|
return () => {
|
|
3239
|
-
if (ran)
|
|
3240
|
-
return;
|
|
3005
|
+
if (ran) return;
|
|
3241
3006
|
ran = true;
|
|
3242
3007
|
fn();
|
|
3243
3008
|
};
|
|
@@ -3277,7 +3042,6 @@ var Provider = (props) => {
|
|
|
3277
3042
|
media: {
|
|
3278
3043
|
hyperWide: useMedia("(max-aspect-ratio: 0.26)")
|
|
3279
3044
|
},
|
|
3280
|
-
characters: props.characters,
|
|
3281
3045
|
getContext: props.getContext,
|
|
3282
3046
|
removeContext: props.removeContext
|
|
3283
3047
|
};
|
|
@@ -3438,10 +3202,9 @@ delegateEvents(["click"]);
|
|
|
3438
3202
|
// src/components/DialogName.tsx
|
|
3439
3203
|
var _tmpl$4 = /* @__PURE__ */ template(`<span class="action-dialog-name">`);
|
|
3440
3204
|
var DialogName = (props) => {
|
|
3205
|
+
const data = useData();
|
|
3441
3206
|
const color = () => {
|
|
3442
|
-
|
|
3443
|
-
const cs = props.characters;
|
|
3444
|
-
return c ? c in cs ? cs[c].color : "#000" : "#000";
|
|
3207
|
+
return props.character ? data.options.getCharacterColor(props.character) : "#000";
|
|
3445
3208
|
};
|
|
3446
3209
|
return (() => {
|
|
3447
3210
|
const _el$ = _tmpl$4();
|
|
@@ -3546,8 +3309,7 @@ var Modal = (props) => {
|
|
|
3546
3309
|
const nodes = modalWindow.querySelectorAll("*");
|
|
3547
3310
|
const tabbable = Array.from(nodes).filter((node) => node.tabIndex >= 0);
|
|
3548
3311
|
let index = tabbable.indexOf(document.activeElement);
|
|
3549
|
-
if (index === -1 && event.shiftKey)
|
|
3550
|
-
index = 0;
|
|
3312
|
+
if (index === -1 && event.shiftKey) index = 0;
|
|
3551
3313
|
index += tabbable.length + (event.shiftKey ? -1 : 1);
|
|
3552
3314
|
index %= tabbable.length;
|
|
3553
3315
|
tabbable[index].focus();
|
|
@@ -3833,16 +3595,14 @@ var Save = (props) => {
|
|
|
3833
3595
|
const {
|
|
3834
3596
|
contentDocument
|
|
3835
3597
|
} = iframe();
|
|
3836
|
-
if (!contentDocument)
|
|
3837
|
-
return;
|
|
3598
|
+
if (!contentDocument) return;
|
|
3838
3599
|
contentDocument.head.insertAdjacentHTML("beforeend", `<style>:root { font-size: 30%; background: black; cursor: pointer; } * { pointer-events: none; } *, *::before, *::after { animation-play-state: paused !important; }</style><style>${stylesheet()}</style>`);
|
|
3839
3600
|
context.root = contentDocument.body;
|
|
3840
3601
|
setIframeLoaded(true);
|
|
3841
3602
|
};
|
|
3842
3603
|
createEffect(async () => {
|
|
3843
3604
|
const ready = props.observed && iframeLoaded() && !previewStarted();
|
|
3844
|
-
if (!ready)
|
|
3845
|
-
return;
|
|
3605
|
+
if (!ready) return;
|
|
3846
3606
|
setPreviewStarted(true);
|
|
3847
3607
|
setTimeout(() => {
|
|
3848
3608
|
previewDone();
|
|
@@ -3869,8 +3629,7 @@ var Save = (props) => {
|
|
|
3869
3629
|
onCleanup(() => {
|
|
3870
3630
|
const state = useContextState(KEY);
|
|
3871
3631
|
for (const custom of Object.values(state.get().custom)) {
|
|
3872
|
-
if (!custom)
|
|
3873
|
-
continue;
|
|
3632
|
+
if (!custom) continue;
|
|
3874
3633
|
try {
|
|
3875
3634
|
options.clearCustomAction(context, custom.fn);
|
|
3876
3635
|
} catch {
|
|
@@ -3985,10 +3744,8 @@ var defaultSpeed = () => {
|
|
|
3985
3744
|
var collectTextNodes = (el) => {
|
|
3986
3745
|
const items = [];
|
|
3987
3746
|
el.childNodes.forEach((child) => {
|
|
3988
|
-
if (child.nodeName === "#text")
|
|
3989
|
-
|
|
3990
|
-
else
|
|
3991
|
-
items.push(...collectTextNodes(child));
|
|
3747
|
+
if (child.nodeName === "#text") items.push(child);
|
|
3748
|
+
else items.push(...collectTextNodes(child));
|
|
3992
3749
|
});
|
|
3993
3750
|
return items;
|
|
3994
3751
|
};
|
|
@@ -4122,10 +3879,8 @@ var createTypewriter = ({
|
|
|
4122
3879
|
const text = props.content;
|
|
4123
3880
|
typewriter2?.destroy();
|
|
4124
3881
|
setState("idle");
|
|
4125
|
-
if (!text)
|
|
4126
|
-
|
|
4127
|
-
if (!node)
|
|
4128
|
-
return;
|
|
3882
|
+
if (!text) return;
|
|
3883
|
+
if (!node) return;
|
|
4129
3884
|
if (PRM.matches || untrack(() => props.ignore)) {
|
|
4130
3885
|
node.innerHTML = text;
|
|
4131
3886
|
bypassed = true;
|
|
@@ -4198,8 +3953,7 @@ var Canvas = (props) => {
|
|
|
4198
3953
|
}
|
|
4199
3954
|
});
|
|
4200
3955
|
const onResize = () => {
|
|
4201
|
-
if (!local.resize)
|
|
4202
|
-
return;
|
|
3956
|
+
if (!local.resize) return;
|
|
4203
3957
|
const canvasElement = untrack(canvas);
|
|
4204
3958
|
const canvasContext = untrack(ctx);
|
|
4205
3959
|
if (canvasElement) {
|
|
@@ -4360,13 +4114,11 @@ var Game = (props) => {
|
|
|
4360
4114
|
} = props;
|
|
4361
4115
|
const [auto, setAuto] = createSignal(false);
|
|
4362
4116
|
const onChoicesButtonClick = ([disabled, i]) => {
|
|
4363
|
-
if (disabled)
|
|
4364
|
-
return;
|
|
4117
|
+
if (disabled) return;
|
|
4365
4118
|
choice().resolve?.(i);
|
|
4366
4119
|
};
|
|
4367
4120
|
const onInputButtonClick = () => {
|
|
4368
|
-
if (input().error)
|
|
4369
|
-
return;
|
|
4121
|
+
if (input().error) return;
|
|
4370
4122
|
const {
|
|
4371
4123
|
resolve,
|
|
4372
4124
|
cleanup
|
|
@@ -4381,8 +4133,7 @@ var Game = (props) => {
|
|
|
4381
4133
|
const onWriterEnd = (cb) => {
|
|
4382
4134
|
return (prm) => {
|
|
4383
4135
|
const next = untrack(auto);
|
|
4384
|
-
if (!next)
|
|
4385
|
-
return;
|
|
4136
|
+
if (!next) return;
|
|
4386
4137
|
if (prm) {
|
|
4387
4138
|
setAuto(false);
|
|
4388
4139
|
} else {
|
|
@@ -4468,9 +4219,6 @@ var Game = (props) => {
|
|
|
4468
4219
|
},
|
|
4469
4220
|
get name() {
|
|
4470
4221
|
return dialog().name;
|
|
4471
|
-
},
|
|
4472
|
-
get characters() {
|
|
4473
|
-
return data.characters;
|
|
4474
4222
|
}
|
|
4475
4223
|
}), _el$4);
|
|
4476
4224
|
addEventListener2(_el$4, "keydown", onKey(DialogWriter.clear, " "), true);
|
|
@@ -4489,14 +4237,12 @@ var Game = (props) => {
|
|
|
4489
4237
|
keyed: true,
|
|
4490
4238
|
children: (emotion) => {
|
|
4491
4239
|
const character = dialog().miniature.character;
|
|
4492
|
-
if (!character)
|
|
4493
|
-
return null;
|
|
4240
|
+
if (!character) return null;
|
|
4494
4241
|
if (!store.characters[character] || !store.characters[character].emotions[emotion]) {
|
|
4495
4242
|
context.character(character).emotion(emotion, false);
|
|
4496
4243
|
}
|
|
4497
4244
|
const image = store.characters[character].emotions[emotion];
|
|
4498
|
-
if ("src" in image)
|
|
4499
|
-
return image;
|
|
4245
|
+
if ("src" in image) return image;
|
|
4500
4246
|
const canvas = document.createElement("canvas");
|
|
4501
4247
|
canvasDrawImages(canvas, void 0, Object.values(image));
|
|
4502
4248
|
return canvas;
|
|
@@ -4752,8 +4498,7 @@ var MainMenu = () => {
|
|
|
4752
4498
|
const language = () => storageData().meta[0];
|
|
4753
4499
|
const rendererStore = from($rendererState);
|
|
4754
4500
|
const goto = simple((screen) => {
|
|
4755
|
-
if (!coreData().dataLoaded)
|
|
4756
|
-
return;
|
|
4501
|
+
if (!coreData().dataLoaded) return;
|
|
4757
4502
|
$rendererState.mutate((s) => s.screen, screen);
|
|
4758
4503
|
});
|
|
4759
4504
|
return (() => {
|
|
@@ -4826,17 +4571,13 @@ var Saves = () => {
|
|
|
4826
4571
|
const processed = /* @__PURE__ */ new Set();
|
|
4827
4572
|
onMount(() => {
|
|
4828
4573
|
const listElement = list();
|
|
4829
|
-
if (!listElement)
|
|
4830
|
-
return;
|
|
4574
|
+
if (!listElement) return;
|
|
4831
4575
|
const observer = new IntersectionObserver((entries2) => {
|
|
4832
4576
|
const currentEntryTimestamps = [];
|
|
4833
4577
|
entries2.forEach((entry) => {
|
|
4834
|
-
if (!entry.isIntersecting)
|
|
4835
|
-
|
|
4836
|
-
if (
|
|
4837
|
-
return;
|
|
4838
|
-
if (!(entry.target instanceof HTMLElement))
|
|
4839
|
-
return;
|
|
4578
|
+
if (!entry.isIntersecting) return;
|
|
4579
|
+
if (processed.has(entry.target)) return;
|
|
4580
|
+
if (!(entry.target instanceof HTMLElement)) return;
|
|
4840
4581
|
processed.add(entry.target);
|
|
4841
4582
|
setLoadingAllowed((prev) => {
|
|
4842
4583
|
if (entry.target instanceof HTMLElement) {
|
|
@@ -5093,7 +4834,6 @@ var createRootComponent = ({
|
|
|
5093
4834
|
$contextState,
|
|
5094
4835
|
coreOptions,
|
|
5095
4836
|
setRoot,
|
|
5096
|
-
characters,
|
|
5097
4837
|
renderer,
|
|
5098
4838
|
showAudioSettings,
|
|
5099
4839
|
fullscreen,
|
|
@@ -5137,7 +4877,6 @@ var createRootComponent = ({
|
|
|
5137
4877
|
options: coreOptions,
|
|
5138
4878
|
renderer,
|
|
5139
4879
|
emitter,
|
|
5140
|
-
characters,
|
|
5141
4880
|
get getContext() {
|
|
5142
4881
|
return renderer.getContext;
|
|
5143
4882
|
},
|
|
@@ -5210,25 +4949,6 @@ var createRootComponent = ({
|
|
|
5210
4949
|
return Root;
|
|
5211
4950
|
};
|
|
5212
4951
|
|
|
5213
|
-
// src/custom-actions/show-arbitrary-character.ts
|
|
5214
|
-
var SHOW_ARBITARY_CHARACTER = Symbol();
|
|
5215
|
-
var createShowArbitraryCharacterAction = (_) => {
|
|
5216
|
-
const showArbitraryCharacter = (params) => {
|
|
5217
|
-
const handler = ({ rendererContext }) => {
|
|
5218
|
-
const handle = rendererContext.character(params.id);
|
|
5219
|
-
handle.append(params.classes, params.style, rendererContext.meta.restoring);
|
|
5220
|
-
handle.emotion(params.emotion, true);
|
|
5221
|
-
const extension = ((e) => Array.isArray(e) ? e : [e])(params.extendWith());
|
|
5222
|
-
canvasDrawImages(handle.canvas, handle.ctx, extension.map((src) => imagePreloadWithCachingNotComplete(src)));
|
|
5223
|
-
};
|
|
5224
|
-
handler.id = SHOW_ARBITARY_CHARACTER;
|
|
5225
|
-
handler.key = params.id;
|
|
5226
|
-
handler.callOnlyLatest = true;
|
|
5227
|
-
return ["custom", handler];
|
|
5228
|
-
};
|
|
5229
|
-
return showArbitraryCharacter;
|
|
5230
|
-
};
|
|
5231
|
-
|
|
5232
4952
|
// src/custom-actions/show-hide-image.ts
|
|
5233
4953
|
var SHOW_IMAGE = Symbol();
|
|
5234
4954
|
var showImage = (source, params = {}) => {
|
|
@@ -5348,7 +5068,6 @@ var createSolidRenderer = ({
|
|
|
5348
5068
|
emitter,
|
|
5349
5069
|
renderer(options) {
|
|
5350
5070
|
const {
|
|
5351
|
-
characters,
|
|
5352
5071
|
characterAssetSizes
|
|
5353
5072
|
} = options;
|
|
5354
5073
|
const {
|
|
@@ -5364,8 +5083,7 @@ var createSolidRenderer = ({
|
|
|
5364
5083
|
root: root(),
|
|
5365
5084
|
background(background) {
|
|
5366
5085
|
handleBackgroundAction($contextState, background, (bg) => {
|
|
5367
|
-
if (!isCSSImage(bg))
|
|
5368
|
-
return;
|
|
5086
|
+
if (!isCSSImage(bg)) return;
|
|
5369
5087
|
renderer.misc.preloadImage(bg);
|
|
5370
5088
|
});
|
|
5371
5089
|
},
|
|
@@ -5384,12 +5102,10 @@ var createSolidRenderer = ({
|
|
|
5384
5102
|
canvas,
|
|
5385
5103
|
ctx: canvasContext,
|
|
5386
5104
|
emotions: {},
|
|
5387
|
-
emotion(emotion, shouldRender) {
|
|
5105
|
+
async emotion(emotion, shouldRender) {
|
|
5388
5106
|
let stored = this.emotions[emotion];
|
|
5389
5107
|
if (!stored) {
|
|
5390
|
-
|
|
5391
|
-
const emotionData = ((unknown) => Array.isArray(unknown) ? unknown : [unknown])(characterEmotion);
|
|
5392
|
-
stored = this.emotions[emotion] = emotionData.map((src) => imagePreloadWithCachingNotComplete(src));
|
|
5108
|
+
stored = this.emotions[emotion] = options.getCharacterAssets(character, emotion).map((src) => imagePreloadWithCachingNotComplete(src));
|
|
5393
5109
|
}
|
|
5394
5110
|
if (shouldRender && stored) {
|
|
5395
5111
|
canvasContext.clearRect(0, 0, canvas.width, canvas.height);
|
|
@@ -5468,8 +5184,7 @@ var createSolidRenderer = ({
|
|
|
5468
5184
|
},
|
|
5469
5185
|
animate(classes) {
|
|
5470
5186
|
const target2 = this.canvas;
|
|
5471
|
-
if (!target2)
|
|
5472
|
-
return;
|
|
5187
|
+
if (!target2) return;
|
|
5473
5188
|
const classNames = classes.filter((className2) => !target2.classList.contains(className2));
|
|
5474
5189
|
target2.classList.add(...classNames);
|
|
5475
5190
|
const onAnimationEnd = () => {
|
|
@@ -5557,7 +5272,6 @@ var createSolidRenderer = ({
|
|
|
5557
5272
|
const Root = createRootComponent({
|
|
5558
5273
|
setRoot,
|
|
5559
5274
|
renderer,
|
|
5560
|
-
characters,
|
|
5561
5275
|
fullscreen,
|
|
5562
5276
|
emitter,
|
|
5563
5277
|
controls,
|
|
@@ -5583,7 +5297,6 @@ var createSolidRenderer = ({
|
|
|
5583
5297
|
preloadAudioBlocking
|
|
5584
5298
|
},
|
|
5585
5299
|
actions: {
|
|
5586
|
-
showArbitraryCharacter: createShowArbitraryCharacterAction(options.characters),
|
|
5587
5300
|
showImage,
|
|
5588
5301
|
hideImage
|
|
5589
5302
|
}
|