@fictjs/runtime 0.5.2 → 0.7.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/advanced.cjs +13 -9
- package/dist/advanced.cjs.map +1 -1
- package/dist/advanced.d.cts +4 -4
- package/dist/advanced.d.ts +4 -4
- package/dist/advanced.js +8 -4
- package/dist/advanced.js.map +1 -1
- package/dist/{chunk-D2IWOO4X.js → chunk-4LCHQ7U4.js} +250 -99
- package/dist/chunk-4LCHQ7U4.js.map +1 -0
- package/dist/{chunk-LRFMCJY3.js → chunk-7YQK3XKY.js} +120 -27
- package/dist/chunk-7YQK3XKY.js.map +1 -0
- package/dist/{chunk-QB2UD62G.cjs → chunk-CEV6TO5U.cjs} +8 -8
- package/dist/{chunk-QB2UD62G.cjs.map → chunk-CEV6TO5U.cjs.map} +1 -1
- package/dist/{chunk-ZR435MDC.cjs → chunk-FSCBL7RI.cjs} +120 -27
- package/dist/chunk-FSCBL7RI.cjs.map +1 -0
- package/dist/{chunk-KNGHYGK4.cjs → chunk-HHDHQGJY.cjs} +17 -17
- package/dist/{chunk-KNGHYGK4.cjs.map → chunk-HHDHQGJY.cjs.map} +1 -1
- package/dist/{chunk-Z6M3HKLG.cjs → chunk-PRF4QG73.cjs} +400 -249
- package/dist/chunk-PRF4QG73.cjs.map +1 -0
- package/dist/{chunk-4NUHM77Z.js → chunk-TLDT76RV.js} +3 -3
- package/dist/{chunk-SLFAEVKJ.js → chunk-WRU3IZOA.js} +3 -3
- package/dist/{context-CTBE00S_.d.cts → context-BFbHf9nC.d.cts} +1 -1
- package/dist/{context-lkLhbkFJ.d.ts → context-C4vBQbb4.d.ts} +1 -1
- package/dist/{effect-BpSNEJJz.d.cts → effect-DAzpH7Mm.d.cts} +33 -1
- package/dist/{effect-BpSNEJJz.d.ts → effect-DAzpH7Mm.d.ts} +33 -1
- package/dist/index.cjs +42 -42
- package/dist/index.d.cts +5 -5
- package/dist/index.d.ts +5 -5
- package/dist/index.dev.js +206 -46
- package/dist/index.dev.js.map +1 -1
- package/dist/index.js +3 -3
- package/dist/internal.cjs +55 -41
- package/dist/internal.cjs.map +1 -1
- package/dist/internal.d.cts +3 -3
- package/dist/internal.d.ts +3 -3
- package/dist/internal.js +17 -3
- package/dist/internal.js.map +1 -1
- package/dist/loader.cjs +9 -9
- package/dist/loader.js +1 -1
- package/dist/{props-XTHYD19o.d.cts → props-84UJeWO8.d.cts} +1 -1
- package/dist/{props-x-HbI-jX.d.ts → props-BRhFK50f.d.ts} +1 -1
- package/dist/{scope-CdbGmsFf.d.ts → scope-D3DpsfoG.d.ts} +1 -1
- package/dist/{scope-DfcP9I-A.d.cts → scope-DlCBL1Ft.d.cts} +1 -1
- package/package.json +1 -1
- package/src/advanced.ts +1 -1
- package/src/binding.ts +229 -101
- package/src/constants.ts +1 -1
- package/src/cycle-guard.ts +4 -3
- package/src/dom.ts +15 -4
- package/src/hooks.ts +1 -1
- package/src/internal.ts +7 -0
- package/src/lifecycle.ts +1 -1
- package/src/props.ts +60 -1
- package/src/signal.ts +60 -10
- package/src/store.ts +131 -18
- package/src/transition.ts +46 -9
- package/dist/chunk-D2IWOO4X.js.map +0 -1
- package/dist/chunk-LRFMCJY3.js.map +0 -1
- package/dist/chunk-Z6M3HKLG.cjs.map +0 -1
- package/dist/chunk-ZR435MDC.cjs.map +0 -1
- package/dist/jsx-dev-runtime.d.cts +0 -671
- package/dist/jsx-dev-runtime.d.ts +0 -671
- /package/dist/{chunk-4NUHM77Z.js.map → chunk-TLDT76RV.js.map} +0 -0
- /package/dist/{chunk-SLFAEVKJ.js.map → chunk-WRU3IZOA.js.map} +0 -0
|
@@ -40,7 +40,7 @@
|
|
|
40
40
|
|
|
41
41
|
|
|
42
42
|
|
|
43
|
-
var
|
|
43
|
+
var _chunkFSCBL7RIcjs = require('./chunk-FSCBL7RI.cjs');
|
|
44
44
|
|
|
45
45
|
// src/jsx.ts
|
|
46
46
|
var Fragment = Symbol("Fragment");
|
|
@@ -249,33 +249,66 @@ function resolvePath(root, path) {
|
|
|
249
249
|
|
|
250
250
|
// src/transition.ts
|
|
251
251
|
function startTransition(fn) {
|
|
252
|
-
const prev =
|
|
252
|
+
const prev = _chunkFSCBL7RIcjs.setTransitionContext.call(void 0, true);
|
|
253
253
|
try {
|
|
254
254
|
fn();
|
|
255
255
|
} finally {
|
|
256
|
-
|
|
257
|
-
|
|
256
|
+
_chunkFSCBL7RIcjs.setTransitionContext.call(void 0, prev);
|
|
257
|
+
_chunkFSCBL7RIcjs.scheduleFlush.call(void 0, );
|
|
258
258
|
}
|
|
259
259
|
}
|
|
260
260
|
function useTransition() {
|
|
261
|
-
const pending =
|
|
261
|
+
const pending = _chunkFSCBL7RIcjs.signal.call(void 0, false);
|
|
262
|
+
let pendingCount = 0;
|
|
263
|
+
const beginPending = () => {
|
|
264
|
+
pendingCount += 1;
|
|
265
|
+
if (pendingCount === 1) {
|
|
266
|
+
pending(true);
|
|
267
|
+
}
|
|
268
|
+
};
|
|
269
|
+
const endPending = () => {
|
|
270
|
+
if (pendingCount === 0) return;
|
|
271
|
+
pendingCount -= 1;
|
|
272
|
+
if (pendingCount === 0) {
|
|
273
|
+
pending(false);
|
|
274
|
+
}
|
|
275
|
+
};
|
|
262
276
|
const start = (fn) => {
|
|
277
|
+
beginPending();
|
|
278
|
+
let result;
|
|
279
|
+
let thrown;
|
|
280
|
+
let didThrow = false;
|
|
263
281
|
startTransition(() => {
|
|
264
|
-
pending(true);
|
|
265
282
|
try {
|
|
266
|
-
fn();
|
|
267
|
-
}
|
|
268
|
-
|
|
283
|
+
result = fn();
|
|
284
|
+
} catch (err) {
|
|
285
|
+
thrown = err;
|
|
286
|
+
didThrow = true;
|
|
269
287
|
}
|
|
270
288
|
});
|
|
289
|
+
if (didThrow) {
|
|
290
|
+
endPending();
|
|
291
|
+
throw thrown;
|
|
292
|
+
}
|
|
293
|
+
if (result && typeof result.then === "function") {
|
|
294
|
+
Promise.resolve(result).finally(() => {
|
|
295
|
+
endPending();
|
|
296
|
+
});
|
|
297
|
+
return;
|
|
298
|
+
}
|
|
299
|
+
if (typeof queueMicrotask === "function") {
|
|
300
|
+
queueMicrotask(endPending);
|
|
301
|
+
} else {
|
|
302
|
+
Promise.resolve().then(endPending);
|
|
303
|
+
}
|
|
271
304
|
};
|
|
272
305
|
return [() => pending(), start];
|
|
273
306
|
}
|
|
274
307
|
function useDeferredValue(getValue) {
|
|
275
|
-
const deferredValue =
|
|
276
|
-
|
|
308
|
+
const deferredValue = _chunkFSCBL7RIcjs.signal.call(void 0, getValue());
|
|
309
|
+
_chunkFSCBL7RIcjs.createEffect.call(void 0, () => {
|
|
277
310
|
const newValue = getValue();
|
|
278
|
-
const currentDeferred =
|
|
311
|
+
const currentDeferred = _chunkFSCBL7RIcjs.untrack.call(void 0, () => deferredValue());
|
|
279
312
|
if (currentDeferred !== newValue) {
|
|
280
313
|
startTransition(() => {
|
|
281
314
|
deferredValue(newValue);
|
|
@@ -287,10 +320,10 @@ function useDeferredValue(getValue) {
|
|
|
287
320
|
|
|
288
321
|
// src/scheduler.ts
|
|
289
322
|
function batch2(fn) {
|
|
290
|
-
return
|
|
323
|
+
return _chunkFSCBL7RIcjs.batch.call(void 0, fn);
|
|
291
324
|
}
|
|
292
325
|
function untrack2(fn) {
|
|
293
|
-
return
|
|
326
|
+
return _chunkFSCBL7RIcjs.untrack.call(void 0, fn);
|
|
294
327
|
}
|
|
295
328
|
|
|
296
329
|
// src/hydration.ts
|
|
@@ -351,22 +384,83 @@ function isHydratingActive() {
|
|
|
351
384
|
}
|
|
352
385
|
|
|
353
386
|
// src/binding.ts
|
|
354
|
-
var isDev = typeof __DEV__ !== "undefined" ? __DEV__ : typeof process
|
|
387
|
+
var isDev = typeof __DEV__ !== "undefined" ? __DEV__ : typeof process !== "undefined" && _optionalChain([process, 'access', _5 => _5.env, 'optionalAccess', _6 => _6.NODE_ENV]) !== "production";
|
|
388
|
+
var TEXT_CACHE = Symbol("fict:text");
|
|
389
|
+
var ATTR_CACHE = Symbol("fict:attr");
|
|
390
|
+
var PROP_CACHE = Symbol("fict:prop");
|
|
391
|
+
var STYLE_CACHE = Symbol("fict:style");
|
|
392
|
+
var CLASS_STATE_CACHE = Symbol("fict:class-state");
|
|
393
|
+
var CLASS_VALUE_CACHE = Symbol("fict:class-value");
|
|
394
|
+
var NON_REACTIVE_FN_MARKER = Symbol.for("fict:non-reactive-fn");
|
|
395
|
+
var REACTIVE_FN_MARKER = Symbol.for("fict:reactive-fn");
|
|
396
|
+
var NON_REACTIVE_FN_REGISTRY_KEY = Symbol.for("fict:non-reactive-fn-registry");
|
|
397
|
+
var PROPERTY_BINDING_KEYS = /* @__PURE__ */ new Set([
|
|
398
|
+
"value",
|
|
399
|
+
"checked",
|
|
400
|
+
"selected",
|
|
401
|
+
"disabled",
|
|
402
|
+
"readOnly",
|
|
403
|
+
"multiple",
|
|
404
|
+
"muted"
|
|
405
|
+
]);
|
|
406
|
+
var STYLE_PROP_CACHE = /* @__PURE__ */ new Map();
|
|
407
|
+
var hasOwn = Object.prototype.hasOwnProperty;
|
|
408
|
+
function getNonReactiveFnRegistry() {
|
|
409
|
+
const host = globalThis;
|
|
410
|
+
let registry = host[NON_REACTIVE_FN_REGISTRY_KEY];
|
|
411
|
+
if (!registry) {
|
|
412
|
+
registry = /* @__PURE__ */ new WeakSet();
|
|
413
|
+
host[NON_REACTIVE_FN_REGISTRY_KEY] = registry;
|
|
414
|
+
}
|
|
415
|
+
return registry;
|
|
416
|
+
}
|
|
417
|
+
function isExplicitReactiveFn(value) {
|
|
418
|
+
if (typeof value !== "function") return false;
|
|
419
|
+
return value[REACTIVE_FN_MARKER] === true;
|
|
420
|
+
}
|
|
355
421
|
function isReactive(value) {
|
|
356
422
|
if (typeof value !== "function") return false;
|
|
357
|
-
if (
|
|
358
|
-
if (
|
|
423
|
+
if (isNonReactiveFn(value)) return false;
|
|
424
|
+
if (_chunkFSCBL7RIcjs.isSignal.call(void 0, value) || _chunkFSCBL7RIcjs.isComputed.call(void 0, value)) return true;
|
|
425
|
+
if (isExplicitReactiveFn(value)) return true;
|
|
426
|
+
if (_chunkFSCBL7RIcjs.isEffect.call(void 0, value) || _chunkFSCBL7RIcjs.isEffectScope.call(void 0, value)) return false;
|
|
359
427
|
return value.length === 0;
|
|
360
428
|
}
|
|
361
429
|
function isStrictlyReactive(value) {
|
|
362
430
|
if (typeof value !== "function") return false;
|
|
363
|
-
return
|
|
431
|
+
return _chunkFSCBL7RIcjs.isSignal.call(void 0, value) || _chunkFSCBL7RIcjs.isComputed.call(void 0, value) || isPropGetterFn(value) || isExplicitReactiveFn(value);
|
|
364
432
|
}
|
|
365
433
|
var PROP_GETTER_MARKER = Symbol.for("fict:prop-getter");
|
|
366
434
|
function isPropGetterFn(value) {
|
|
367
435
|
if (typeof value !== "function") return false;
|
|
368
436
|
return value[PROP_GETTER_MARKER] === true;
|
|
369
437
|
}
|
|
438
|
+
function isNonReactiveFn(value) {
|
|
439
|
+
if (typeof value !== "function") return false;
|
|
440
|
+
if (getNonReactiveFnRegistry().has(value)) return true;
|
|
441
|
+
return value[NON_REACTIVE_FN_MARKER] === true;
|
|
442
|
+
}
|
|
443
|
+
function nonReactive(fn) {
|
|
444
|
+
getNonReactiveFnRegistry().add(fn);
|
|
445
|
+
if (Object.isExtensible(fn)) {
|
|
446
|
+
try {
|
|
447
|
+
;
|
|
448
|
+
fn[NON_REACTIVE_FN_MARKER] = true;
|
|
449
|
+
} catch (e10) {
|
|
450
|
+
}
|
|
451
|
+
}
|
|
452
|
+
return fn;
|
|
453
|
+
}
|
|
454
|
+
function reactive(fn) {
|
|
455
|
+
if (Object.isExtensible(fn)) {
|
|
456
|
+
try {
|
|
457
|
+
;
|
|
458
|
+
fn[REACTIVE_FN_MARKER] = true;
|
|
459
|
+
} catch (e11) {
|
|
460
|
+
}
|
|
461
|
+
}
|
|
462
|
+
return fn;
|
|
463
|
+
}
|
|
370
464
|
function unwrap(value) {
|
|
371
465
|
return isReactive(value) ? value() : value;
|
|
372
466
|
}
|
|
@@ -397,25 +491,26 @@ function callEventHandler(handler, event, node, data) {
|
|
|
397
491
|
function createTextBinding(value) {
|
|
398
492
|
const text = document.createTextNode("");
|
|
399
493
|
if (isReactive(value)) {
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
const fmt = formatTextValue(v);
|
|
403
|
-
if (text.data !== fmt) {
|
|
404
|
-
text.data = fmt;
|
|
405
|
-
}
|
|
494
|
+
_chunkFSCBL7RIcjs.createRenderEffect.call(void 0, () => {
|
|
495
|
+
setText(text, value());
|
|
406
496
|
});
|
|
407
497
|
} else {
|
|
408
|
-
text
|
|
498
|
+
setText(text, value);
|
|
409
499
|
}
|
|
410
500
|
return text;
|
|
411
501
|
}
|
|
412
502
|
function bindText(textNode, getValue) {
|
|
413
|
-
return
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
503
|
+
return _chunkFSCBL7RIcjs.createRenderEffect.call(void 0, () => setText(textNode, getValue()));
|
|
504
|
+
}
|
|
505
|
+
function setText(textNode, value) {
|
|
506
|
+
const next = formatTextValue(value);
|
|
507
|
+
const cache = textNode;
|
|
508
|
+
const prev = cache[TEXT_CACHE];
|
|
509
|
+
if (prev === next && textNode.data === next) return;
|
|
510
|
+
cache[TEXT_CACHE] = next;
|
|
511
|
+
if (textNode.data !== next) {
|
|
512
|
+
textNode.data = next;
|
|
513
|
+
}
|
|
419
514
|
}
|
|
420
515
|
function formatTextValue(value) {
|
|
421
516
|
if (value == null || value === false) {
|
|
@@ -425,7 +520,7 @@ function formatTextValue(value) {
|
|
|
425
520
|
}
|
|
426
521
|
function createAttributeBinding(el, key, value, setter) {
|
|
427
522
|
if (isReactive(value)) {
|
|
428
|
-
|
|
523
|
+
_chunkFSCBL7RIcjs.createRenderEffect.call(void 0, () => {
|
|
429
524
|
setter(el, key, value());
|
|
430
525
|
});
|
|
431
526
|
} else {
|
|
@@ -433,65 +528,57 @@ function createAttributeBinding(el, key, value, setter) {
|
|
|
433
528
|
}
|
|
434
529
|
}
|
|
435
530
|
function bindAttribute(el, key, getValue) {
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
531
|
+
return _chunkFSCBL7RIcjs.createRenderEffect.call(void 0, () => setAttr(el, key, getValue()));
|
|
532
|
+
}
|
|
533
|
+
function setAttr(el, key, value) {
|
|
534
|
+
const cacheTarget = el;
|
|
535
|
+
const attrCache = _nullishCoalesce(cacheTarget[ATTR_CACHE], () => ( (cacheTarget[ATTR_CACHE] = /* @__PURE__ */ Object.create(null))));
|
|
536
|
+
if (attrCache[key] === value) return;
|
|
537
|
+
attrCache[key] = value;
|
|
538
|
+
if (value === void 0 || value === null || value === false) {
|
|
539
|
+
el.removeAttribute(key);
|
|
540
|
+
} else if (value === true) {
|
|
541
|
+
el.setAttribute(key, "");
|
|
542
|
+
} else {
|
|
543
|
+
el.setAttribute(key, String(value));
|
|
544
|
+
}
|
|
449
545
|
}
|
|
450
546
|
function bindProperty(el, key, getValue) {
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
if (PROPERTY_BINDING_KEYS.has(key) && (next === void 0 || next === null)) {
|
|
466
|
-
const fallback = key === "checked" || key === "selected" ? false : "";
|
|
467
|
-
el[key] = fallback;
|
|
468
|
-
return;
|
|
469
|
-
}
|
|
470
|
-
;
|
|
471
|
-
el[key] = next;
|
|
472
|
-
});
|
|
547
|
+
return _chunkFSCBL7RIcjs.createRenderEffect.call(void 0, () => setProp(el, key, getValue()));
|
|
548
|
+
}
|
|
549
|
+
function setProp(el, key, value) {
|
|
550
|
+
const cacheTarget = el;
|
|
551
|
+
const propCache = _nullishCoalesce(cacheTarget[PROP_CACHE], () => ( (cacheTarget[PROP_CACHE] = /* @__PURE__ */ Object.create(null))));
|
|
552
|
+
if (propCache[key] === value) return;
|
|
553
|
+
propCache[key] = value;
|
|
554
|
+
if (PROPERTY_BINDING_KEYS.has(key) && (value === void 0 || value === null)) {
|
|
555
|
+
const fallback = key === "checked" || key === "selected" ? false : "";
|
|
556
|
+
el[key] = fallback;
|
|
557
|
+
return;
|
|
558
|
+
}
|
|
559
|
+
;
|
|
560
|
+
el[key] = value;
|
|
473
561
|
}
|
|
474
562
|
function createStyleBinding(el, value) {
|
|
475
|
-
const target = el;
|
|
476
563
|
if (isReactive(value)) {
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
const next = value();
|
|
480
|
-
applyStyle(target, next, prev);
|
|
481
|
-
prev = next;
|
|
564
|
+
_chunkFSCBL7RIcjs.createRenderEffect.call(void 0, () => {
|
|
565
|
+
setStyle(el, value());
|
|
482
566
|
});
|
|
483
567
|
} else {
|
|
484
|
-
|
|
568
|
+
setStyle(el, value);
|
|
485
569
|
}
|
|
486
570
|
}
|
|
487
571
|
function bindStyle(el, getValue) {
|
|
572
|
+
return _chunkFSCBL7RIcjs.createRenderEffect.call(void 0, () => setStyle(el, getValue()));
|
|
573
|
+
}
|
|
574
|
+
function setStyle(el, value) {
|
|
488
575
|
const target = el;
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
|
|
576
|
+
const cache = target;
|
|
577
|
+
const prev = cache[STYLE_CACHE];
|
|
578
|
+
if (typeof value === "string" && prev === value) return;
|
|
579
|
+
if ((value === null || value === void 0) && (prev === null || prev === void 0)) return;
|
|
580
|
+
applyStyle(target, value, prev);
|
|
581
|
+
cache[STYLE_CACHE] = value;
|
|
495
582
|
}
|
|
496
583
|
function applyStyle(el, value, prev) {
|
|
497
584
|
if (typeof value === "string") {
|
|
@@ -503,29 +590,33 @@ function applyStyle(el, value, prev) {
|
|
|
503
590
|
}
|
|
504
591
|
if (prev && typeof prev === "object") {
|
|
505
592
|
const prevStyles = prev;
|
|
506
|
-
for (const key
|
|
507
|
-
if (!(key
|
|
508
|
-
|
|
593
|
+
for (const key in prevStyles) {
|
|
594
|
+
if (!hasOwn.call(prevStyles, key)) continue;
|
|
595
|
+
if (!hasOwn.call(styles, key)) {
|
|
596
|
+
const cssProperty = normalizeStyleProperty(key);
|
|
509
597
|
el.style.removeProperty(cssProperty);
|
|
510
598
|
}
|
|
511
599
|
}
|
|
512
600
|
}
|
|
513
|
-
for (const
|
|
601
|
+
for (const prop2 in styles) {
|
|
602
|
+
if (!hasOwn.call(styles, prop2)) continue;
|
|
603
|
+
const v = styles[prop2];
|
|
514
604
|
if (v != null) {
|
|
515
|
-
const cssProperty = prop2
|
|
605
|
+
const cssProperty = normalizeStyleProperty(prop2);
|
|
516
606
|
const unitless = isUnitlessStyleProperty(prop2) || isUnitlessStyleProperty(cssProperty);
|
|
517
607
|
const valueStr = typeof v === "number" && !unitless ? `${v}px` : String(v);
|
|
518
608
|
el.style.setProperty(cssProperty, valueStr);
|
|
519
609
|
} else {
|
|
520
|
-
const cssProperty = prop2
|
|
610
|
+
const cssProperty = normalizeStyleProperty(prop2);
|
|
521
611
|
el.style.removeProperty(cssProperty);
|
|
522
612
|
}
|
|
523
613
|
}
|
|
524
614
|
} else {
|
|
525
615
|
if (prev && typeof prev === "object") {
|
|
526
616
|
const prevStyles = prev;
|
|
527
|
-
for (const key
|
|
528
|
-
|
|
617
|
+
for (const key in prevStyles) {
|
|
618
|
+
if (!hasOwn.call(prevStyles, key)) continue;
|
|
619
|
+
const cssProperty = normalizeStyleProperty(key);
|
|
529
620
|
el.style.removeProperty(cssProperty);
|
|
530
621
|
}
|
|
531
622
|
} else if (typeof prev === "string") {
|
|
@@ -533,33 +624,39 @@ function applyStyle(el, value, prev) {
|
|
|
533
624
|
}
|
|
534
625
|
}
|
|
535
626
|
}
|
|
536
|
-
var isUnitlessStyleProperty = isDev ? (prop2) =>
|
|
627
|
+
var isUnitlessStyleProperty = isDev ? (prop2) => _chunkFSCBL7RIcjs.UnitlessStyles.has(prop2) : (prop2) => prop2 === "opacity" || prop2 === "zIndex";
|
|
628
|
+
function normalizeStyleProperty(prop2) {
|
|
629
|
+
const cached = STYLE_PROP_CACHE.get(prop2);
|
|
630
|
+
if (cached) return cached;
|
|
631
|
+
const normalized = prop2.includes("-") ? prop2 : prop2.replace(/([A-Z])/g, "-$1").toLowerCase();
|
|
632
|
+
STYLE_PROP_CACHE.set(prop2, normalized);
|
|
633
|
+
return normalized;
|
|
634
|
+
}
|
|
537
635
|
function createClassBinding(el, value) {
|
|
538
636
|
if (isReactive(value)) {
|
|
539
|
-
|
|
540
|
-
|
|
541
|
-
|
|
542
|
-
prev = applyClass(el, next, prev);
|
|
543
|
-
});
|
|
637
|
+
_chunkFSCBL7RIcjs.createRenderEffect.call(void 0,
|
|
638
|
+
() => setClass(el, value())
|
|
639
|
+
);
|
|
544
640
|
} else {
|
|
545
|
-
|
|
641
|
+
setClass(el, value);
|
|
546
642
|
}
|
|
547
643
|
}
|
|
548
644
|
function bindClass(el, getValue) {
|
|
549
|
-
|
|
550
|
-
|
|
551
|
-
|
|
552
|
-
|
|
553
|
-
|
|
554
|
-
|
|
555
|
-
|
|
556
|
-
|
|
557
|
-
|
|
558
|
-
|
|
559
|
-
|
|
560
|
-
|
|
561
|
-
|
|
562
|
-
|
|
645
|
+
return _chunkFSCBL7RIcjs.createRenderEffect.call(void 0, () => setClass(el, getValue()));
|
|
646
|
+
}
|
|
647
|
+
function setClass(el, value) {
|
|
648
|
+
const cache = el;
|
|
649
|
+
const prevValue = cache[CLASS_VALUE_CACHE];
|
|
650
|
+
const prevState = _nullishCoalesce(cache[CLASS_STATE_CACHE], () => ( {}));
|
|
651
|
+
if (typeof value === "string") {
|
|
652
|
+
if (typeof prevValue === "string" && prevValue === value) return;
|
|
653
|
+
el.className = value;
|
|
654
|
+
cache[CLASS_STATE_CACHE] = {};
|
|
655
|
+
cache[CLASS_VALUE_CACHE] = value;
|
|
656
|
+
return;
|
|
657
|
+
}
|
|
658
|
+
cache[CLASS_STATE_CACHE] = applyClass(el, value, prevState);
|
|
659
|
+
cache[CLASS_VALUE_CACHE] = value;
|
|
563
660
|
}
|
|
564
661
|
function toggleClassKey(node, key, value) {
|
|
565
662
|
const classNames = key.trim().split(/\s+/);
|
|
@@ -606,7 +703,7 @@ function classList(node, value, prev = {}) {
|
|
|
606
703
|
return applyClass(node, value, prev);
|
|
607
704
|
}
|
|
608
705
|
function insert(parent, getValue, markerOrCreateElement, createElementFn) {
|
|
609
|
-
const hostRoot =
|
|
706
|
+
const hostRoot = _chunkFSCBL7RIcjs.getCurrentRoot.call(void 0, );
|
|
610
707
|
let marker;
|
|
611
708
|
let ownsMarker = false;
|
|
612
709
|
let createFn = createElementFn;
|
|
@@ -645,13 +742,13 @@ function insert(parent, getValue, markerOrCreateElement, createElementFn) {
|
|
|
645
742
|
insertNodesBefore(parentNode, [currentText], marker);
|
|
646
743
|
currentNodes = [currentText];
|
|
647
744
|
};
|
|
648
|
-
const dispose =
|
|
745
|
+
const dispose = _chunkFSCBL7RIcjs.createRenderEffect.call(void 0, () => {
|
|
649
746
|
const value = getValue();
|
|
650
747
|
const parentNode = marker.parentNode;
|
|
651
748
|
const isPrimitive = value == null || value === false || typeof value === "string" || typeof value === "number" || typeof value === "boolean";
|
|
652
749
|
if (isPrimitive) {
|
|
653
750
|
if (currentRoot) {
|
|
654
|
-
|
|
751
|
+
_chunkFSCBL7RIcjs.destroyRoot.call(void 0, currentRoot);
|
|
655
752
|
currentRoot = null;
|
|
656
753
|
}
|
|
657
754
|
if (!parentNode) {
|
|
@@ -664,12 +761,12 @@ function insert(parent, getValue, markerOrCreateElement, createElementFn) {
|
|
|
664
761
|
return;
|
|
665
762
|
}
|
|
666
763
|
if (currentRoot) {
|
|
667
|
-
|
|
764
|
+
_chunkFSCBL7RIcjs.destroyRoot.call(void 0, currentRoot);
|
|
668
765
|
currentRoot = null;
|
|
669
766
|
}
|
|
670
767
|
clearCurrentNodes();
|
|
671
|
-
const root =
|
|
672
|
-
const prev =
|
|
768
|
+
const root = _chunkFSCBL7RIcjs.createRootContext.call(void 0, hostRoot);
|
|
769
|
+
const prev = _chunkFSCBL7RIcjs.pushRoot.call(void 0, root);
|
|
673
770
|
let nodes = [];
|
|
674
771
|
let handledError = false;
|
|
675
772
|
try {
|
|
@@ -696,28 +793,28 @@ function insert(parent, getValue, markerOrCreateElement, createElementFn) {
|
|
|
696
793
|
nodes = toNodeArray(newNode);
|
|
697
794
|
if (root.suspended) {
|
|
698
795
|
handledError = true;
|
|
699
|
-
|
|
796
|
+
_chunkFSCBL7RIcjs.destroyRoot.call(void 0, root);
|
|
700
797
|
return;
|
|
701
798
|
}
|
|
702
799
|
if (parentNode) {
|
|
703
800
|
insertNodesBefore(parentNode, nodes, marker);
|
|
704
801
|
}
|
|
705
802
|
} catch (err) {
|
|
706
|
-
if (
|
|
803
|
+
if (_chunkFSCBL7RIcjs.handleSuspend.call(void 0, err, root)) {
|
|
707
804
|
handledError = true;
|
|
708
|
-
|
|
805
|
+
_chunkFSCBL7RIcjs.destroyRoot.call(void 0, root);
|
|
709
806
|
return;
|
|
710
807
|
}
|
|
711
|
-
if (
|
|
808
|
+
if (_chunkFSCBL7RIcjs.handleError.call(void 0, err, { source: "renderChild" }, root)) {
|
|
712
809
|
handledError = true;
|
|
713
|
-
|
|
810
|
+
_chunkFSCBL7RIcjs.destroyRoot.call(void 0, root);
|
|
714
811
|
return;
|
|
715
812
|
}
|
|
716
813
|
throw err;
|
|
717
814
|
} finally {
|
|
718
|
-
|
|
815
|
+
_chunkFSCBL7RIcjs.popRoot.call(void 0, prev);
|
|
719
816
|
if (!handledError) {
|
|
720
|
-
|
|
817
|
+
_chunkFSCBL7RIcjs.flushOnMount.call(void 0, root);
|
|
721
818
|
}
|
|
722
819
|
}
|
|
723
820
|
currentRoot = root;
|
|
@@ -726,7 +823,7 @@ function insert(parent, getValue, markerOrCreateElement, createElementFn) {
|
|
|
726
823
|
return () => {
|
|
727
824
|
dispose();
|
|
728
825
|
if (currentRoot) {
|
|
729
|
-
|
|
826
|
+
_chunkFSCBL7RIcjs.destroyRoot.call(void 0, currentRoot);
|
|
730
827
|
currentRoot = null;
|
|
731
828
|
}
|
|
732
829
|
clearCurrentNodes();
|
|
@@ -736,11 +833,11 @@ function insert(parent, getValue, markerOrCreateElement, createElementFn) {
|
|
|
736
833
|
};
|
|
737
834
|
}
|
|
738
835
|
function insertBetween(start, end, getValue, createElementFn) {
|
|
739
|
-
const hostRoot =
|
|
836
|
+
const hostRoot = _chunkFSCBL7RIcjs.getCurrentRoot.call(void 0, );
|
|
740
837
|
let currentNodes = [];
|
|
741
838
|
let currentText = null;
|
|
742
839
|
let currentRoot = null;
|
|
743
|
-
let initialHydrating =
|
|
840
|
+
let initialHydrating = _chunkFSCBL7RIcjs.__fictIsHydrating.call(void 0, );
|
|
744
841
|
const collectBetween = () => {
|
|
745
842
|
const nodes = [];
|
|
746
843
|
let cursor = start.nextSibling;
|
|
@@ -776,7 +873,7 @@ function insertBetween(start, end, getValue, createElementFn) {
|
|
|
776
873
|
currentNodes = [currentText];
|
|
777
874
|
}
|
|
778
875
|
};
|
|
779
|
-
const dispose =
|
|
876
|
+
const dispose = _chunkFSCBL7RIcjs.createRenderEffect.call(void 0, () => {
|
|
780
877
|
const value = getValue();
|
|
781
878
|
const parentNode = start.parentNode;
|
|
782
879
|
const isPrimitive = value == null || value === false || typeof value === "string" || typeof value === "number" || typeof value === "boolean";
|
|
@@ -790,7 +887,7 @@ function insertBetween(start, end, getValue, createElementFn) {
|
|
|
790
887
|
}
|
|
791
888
|
}
|
|
792
889
|
if (currentRoot) {
|
|
793
|
-
|
|
890
|
+
_chunkFSCBL7RIcjs.destroyRoot.call(void 0, currentRoot);
|
|
794
891
|
currentRoot = null;
|
|
795
892
|
}
|
|
796
893
|
if (!parentNode) {
|
|
@@ -804,12 +901,12 @@ function insertBetween(start, end, getValue, createElementFn) {
|
|
|
804
901
|
return;
|
|
805
902
|
}
|
|
806
903
|
if (currentRoot) {
|
|
807
|
-
|
|
904
|
+
_chunkFSCBL7RIcjs.destroyRoot.call(void 0, currentRoot);
|
|
808
905
|
currentRoot = null;
|
|
809
906
|
}
|
|
810
907
|
clearCurrentNodes();
|
|
811
|
-
const root =
|
|
812
|
-
const prev =
|
|
908
|
+
const root = _chunkFSCBL7RIcjs.createRootContext.call(void 0, hostRoot);
|
|
909
|
+
const prev = _chunkFSCBL7RIcjs.pushRoot.call(void 0, root);
|
|
813
910
|
let nodes = [];
|
|
814
911
|
let handledError = false;
|
|
815
912
|
try {
|
|
@@ -843,28 +940,28 @@ function insertBetween(start, end, getValue, createElementFn) {
|
|
|
843
940
|
nodes = toNodeArray(newNode);
|
|
844
941
|
if (root.suspended) {
|
|
845
942
|
handledError = true;
|
|
846
|
-
|
|
943
|
+
_chunkFSCBL7RIcjs.destroyRoot.call(void 0, root);
|
|
847
944
|
return;
|
|
848
945
|
}
|
|
849
946
|
if (parentNode && !initialHydrating) {
|
|
850
947
|
insertNodesBefore(parentNode, nodes, end);
|
|
851
948
|
}
|
|
852
949
|
} catch (err) {
|
|
853
|
-
if (
|
|
950
|
+
if (_chunkFSCBL7RIcjs.handleSuspend.call(void 0, err, root)) {
|
|
854
951
|
handledError = true;
|
|
855
|
-
|
|
952
|
+
_chunkFSCBL7RIcjs.destroyRoot.call(void 0, root);
|
|
856
953
|
return;
|
|
857
954
|
}
|
|
858
|
-
if (
|
|
955
|
+
if (_chunkFSCBL7RIcjs.handleError.call(void 0, err, { source: "renderChild" }, root)) {
|
|
859
956
|
handledError = true;
|
|
860
|
-
|
|
957
|
+
_chunkFSCBL7RIcjs.destroyRoot.call(void 0, root);
|
|
861
958
|
return;
|
|
862
959
|
}
|
|
863
960
|
throw err;
|
|
864
961
|
} finally {
|
|
865
|
-
|
|
962
|
+
_chunkFSCBL7RIcjs.popRoot.call(void 0, prev);
|
|
866
963
|
if (!handledError) {
|
|
867
|
-
|
|
964
|
+
_chunkFSCBL7RIcjs.flushOnMount.call(void 0, root);
|
|
868
965
|
}
|
|
869
966
|
}
|
|
870
967
|
currentRoot = root;
|
|
@@ -874,7 +971,7 @@ function insertBetween(start, end, getValue, createElementFn) {
|
|
|
874
971
|
return () => {
|
|
875
972
|
dispose();
|
|
876
973
|
if (currentRoot) {
|
|
877
|
-
|
|
974
|
+
_chunkFSCBL7RIcjs.destroyRoot.call(void 0, currentRoot);
|
|
878
975
|
currentRoot = null;
|
|
879
976
|
}
|
|
880
977
|
clearCurrentNodes();
|
|
@@ -883,10 +980,10 @@ function insertBetween(start, end, getValue, createElementFn) {
|
|
|
883
980
|
function createChildBinding(parent, getValue, createElementFn) {
|
|
884
981
|
const marker = document.createComment("fict:child");
|
|
885
982
|
parent.appendChild(marker);
|
|
886
|
-
const hostRoot =
|
|
887
|
-
const dispose =
|
|
888
|
-
const root =
|
|
889
|
-
const prev =
|
|
983
|
+
const hostRoot = _chunkFSCBL7RIcjs.getCurrentRoot.call(void 0, );
|
|
984
|
+
const dispose = _chunkFSCBL7RIcjs.createRenderEffect.call(void 0, () => {
|
|
985
|
+
const root = _chunkFSCBL7RIcjs.createRootContext.call(void 0, hostRoot);
|
|
986
|
+
const prev = _chunkFSCBL7RIcjs.pushRoot.call(void 0, root);
|
|
890
987
|
let nodes = [];
|
|
891
988
|
let handledError = false;
|
|
892
989
|
try {
|
|
@@ -901,25 +998,25 @@ function createChildBinding(parent, getValue, createElementFn) {
|
|
|
901
998
|
insertNodesBefore(parentNode, nodes, marker);
|
|
902
999
|
}
|
|
903
1000
|
return () => {
|
|
904
|
-
|
|
1001
|
+
_chunkFSCBL7RIcjs.destroyRoot.call(void 0, root);
|
|
905
1002
|
removeNodes(nodes);
|
|
906
1003
|
};
|
|
907
1004
|
} catch (err) {
|
|
908
|
-
if (
|
|
1005
|
+
if (_chunkFSCBL7RIcjs.handleSuspend.call(void 0, err, root)) {
|
|
909
1006
|
handledError = true;
|
|
910
|
-
|
|
1007
|
+
_chunkFSCBL7RIcjs.destroyRoot.call(void 0, root);
|
|
911
1008
|
return;
|
|
912
1009
|
}
|
|
913
|
-
if (
|
|
1010
|
+
if (_chunkFSCBL7RIcjs.handleError.call(void 0, err, { source: "renderChild" }, root)) {
|
|
914
1011
|
handledError = true;
|
|
915
|
-
|
|
1012
|
+
_chunkFSCBL7RIcjs.destroyRoot.call(void 0, root);
|
|
916
1013
|
return;
|
|
917
1014
|
}
|
|
918
1015
|
throw err;
|
|
919
1016
|
} finally {
|
|
920
|
-
|
|
1017
|
+
_chunkFSCBL7RIcjs.popRoot.call(void 0, prev);
|
|
921
1018
|
if (!handledError) {
|
|
922
|
-
|
|
1019
|
+
_chunkFSCBL7RIcjs.flushOnMount.call(void 0, root);
|
|
923
1020
|
}
|
|
924
1021
|
}
|
|
925
1022
|
});
|
|
@@ -932,7 +1029,7 @@ function createChildBinding(parent, getValue, createElementFn) {
|
|
|
932
1029
|
};
|
|
933
1030
|
}
|
|
934
1031
|
function delegateEvents(eventNames, doc = window.document) {
|
|
935
|
-
const e = doc[
|
|
1032
|
+
const e = doc[_chunkFSCBL7RIcjs.$$EVENTS] || (doc[_chunkFSCBL7RIcjs.$$EVENTS] = /* @__PURE__ */ new Set());
|
|
936
1033
|
for (let i = 0, l = eventNames.length; i < l; i++) {
|
|
937
1034
|
const name = eventNames[i];
|
|
938
1035
|
if (!e.has(name)) {
|
|
@@ -942,12 +1039,12 @@ function delegateEvents(eventNames, doc = window.document) {
|
|
|
942
1039
|
}
|
|
943
1040
|
}
|
|
944
1041
|
function clearDelegatedEvents(doc = window.document) {
|
|
945
|
-
const e = doc[
|
|
1042
|
+
const e = doc[_chunkFSCBL7RIcjs.$$EVENTS];
|
|
946
1043
|
if (e) {
|
|
947
1044
|
for (const name of e.keys()) {
|
|
948
1045
|
doc.removeEventListener(name, globalEventHandler);
|
|
949
1046
|
}
|
|
950
|
-
delete doc[
|
|
1047
|
+
delete doc[_chunkFSCBL7RIcjs.$$EVENTS];
|
|
951
1048
|
}
|
|
952
1049
|
}
|
|
953
1050
|
function globalEventHandler(e) {
|
|
@@ -977,7 +1074,7 @@ function globalEventHandler(e) {
|
|
|
977
1074
|
try {
|
|
978
1075
|
const fn = value;
|
|
979
1076
|
return fn.length > 0 ? fn(e) : fn();
|
|
980
|
-
} catch (
|
|
1077
|
+
} catch (e12) {
|
|
981
1078
|
return value();
|
|
982
1079
|
}
|
|
983
1080
|
}
|
|
@@ -1060,8 +1157,8 @@ function addEventListener(node, name, handler, delegate) {
|
|
|
1060
1157
|
function bindEvent(el, eventName, handler, options) {
|
|
1061
1158
|
if (handler == null) return () => {
|
|
1062
1159
|
};
|
|
1063
|
-
const rootRef =
|
|
1064
|
-
const shouldDelegate = options == null &&
|
|
1160
|
+
const rootRef = _chunkFSCBL7RIcjs.getCurrentRoot.call(void 0, );
|
|
1161
|
+
const shouldDelegate = options == null && _chunkFSCBL7RIcjs.DelegatedEvents.has(eventName);
|
|
1065
1162
|
if (shouldDelegate) {
|
|
1066
1163
|
const key = `$$${eventName}`;
|
|
1067
1164
|
delegateEvents([eventName]);
|
|
@@ -1071,7 +1168,7 @@ function bindEvent(el, eventName, handler, options) {
|
|
|
1071
1168
|
const fn = resolveHandler();
|
|
1072
1169
|
callEventHandler(fn, args[0], el);
|
|
1073
1170
|
} catch (err) {
|
|
1074
|
-
if (!
|
|
1171
|
+
if (!_chunkFSCBL7RIcjs.handleError.call(void 0, err, { source: "event", eventName }, rootRef)) {
|
|
1075
1172
|
throw err;
|
|
1076
1173
|
}
|
|
1077
1174
|
}
|
|
@@ -1086,7 +1183,7 @@ function bindEvent(el, eventName, handler, options) {
|
|
|
1086
1183
|
const resolved = getHandler();
|
|
1087
1184
|
callEventHandler(resolved, event, el);
|
|
1088
1185
|
} catch (err) {
|
|
1089
|
-
if (
|
|
1186
|
+
if (_chunkFSCBL7RIcjs.handleError.call(void 0, err, { source: "event", eventName }, rootRef)) {
|
|
1090
1187
|
return;
|
|
1091
1188
|
}
|
|
1092
1189
|
throw err;
|
|
@@ -1094,7 +1191,7 @@ function bindEvent(el, eventName, handler, options) {
|
|
|
1094
1191
|
};
|
|
1095
1192
|
el.addEventListener(eventName, wrapped, options);
|
|
1096
1193
|
const cleanup = () => el.removeEventListener(eventName, wrapped, options);
|
|
1097
|
-
|
|
1194
|
+
_chunkFSCBL7RIcjs.registerRootCleanup.call(void 0, cleanup);
|
|
1098
1195
|
return cleanup;
|
|
1099
1196
|
}
|
|
1100
1197
|
function bindRef(el, ref) {
|
|
@@ -1114,11 +1211,11 @@ function bindRef(el, ref) {
|
|
|
1114
1211
|
const initialRef = getRef();
|
|
1115
1212
|
applyRef2(initialRef);
|
|
1116
1213
|
if (isReactive(ref)) {
|
|
1117
|
-
const cleanup2 =
|
|
1214
|
+
const cleanup2 = _chunkFSCBL7RIcjs.createRenderEffect.call(void 0, () => {
|
|
1118
1215
|
const currentRef = getRef();
|
|
1119
1216
|
applyRef2(currentRef);
|
|
1120
1217
|
});
|
|
1121
|
-
|
|
1218
|
+
_chunkFSCBL7RIcjs.registerRootCleanup.call(void 0, cleanup2);
|
|
1122
1219
|
const nullifyCleanup = () => {
|
|
1123
1220
|
const currentRef = getRef();
|
|
1124
1221
|
if (currentRef && typeof currentRef === "object" && "current" in currentRef) {
|
|
@@ -1126,7 +1223,7 @@ function bindRef(el, ref) {
|
|
|
1126
1223
|
currentRef.current = null;
|
|
1127
1224
|
}
|
|
1128
1225
|
};
|
|
1129
|
-
|
|
1226
|
+
_chunkFSCBL7RIcjs.registerRootCleanup.call(void 0, nullifyCleanup);
|
|
1130
1227
|
return () => {
|
|
1131
1228
|
cleanup2();
|
|
1132
1229
|
nullifyCleanup();
|
|
@@ -1139,23 +1236,23 @@ function bindRef(el, ref) {
|
|
|
1139
1236
|
refValue.current = null;
|
|
1140
1237
|
}
|
|
1141
1238
|
};
|
|
1142
|
-
|
|
1239
|
+
_chunkFSCBL7RIcjs.registerRootCleanup.call(void 0, cleanup);
|
|
1143
1240
|
return cleanup;
|
|
1144
1241
|
}
|
|
1145
1242
|
function spread(node, props = {}, isSVG = false, skipChildren = false) {
|
|
1146
1243
|
const prevProps = {};
|
|
1147
1244
|
if (!skipChildren && "children" in props) {
|
|
1148
|
-
|
|
1245
|
+
_chunkFSCBL7RIcjs.createRenderEffect.call(void 0, () => {
|
|
1149
1246
|
prevProps.children = props.children;
|
|
1150
1247
|
});
|
|
1151
1248
|
}
|
|
1152
|
-
|
|
1249
|
+
_chunkFSCBL7RIcjs.createRenderEffect.call(void 0, () => {
|
|
1153
1250
|
if (typeof props.ref === "function") {
|
|
1154
1251
|
;
|
|
1155
1252
|
props.ref(node);
|
|
1156
1253
|
}
|
|
1157
1254
|
});
|
|
1158
|
-
|
|
1255
|
+
_chunkFSCBL7RIcjs.createRenderEffect.call(void 0, () => {
|
|
1159
1256
|
assign(node, props, isSVG, true, prevProps, true);
|
|
1160
1257
|
});
|
|
1161
1258
|
return prevProps;
|
|
@@ -1213,7 +1310,7 @@ function assignProp(node, prop2, value, prev, isSVG, skipRef, props) {
|
|
|
1213
1310
|
}
|
|
1214
1311
|
if (prop2.slice(0, 2) === "on") {
|
|
1215
1312
|
const eventName = prop2.slice(2).toLowerCase();
|
|
1216
|
-
const shouldDelegate =
|
|
1313
|
+
const shouldDelegate = _chunkFSCBL7RIcjs.DelegatedEvents.has(eventName);
|
|
1217
1314
|
if (!shouldDelegate && prev) {
|
|
1218
1315
|
const handler = Array.isArray(prev) ? prev[0] : prev;
|
|
1219
1316
|
node.removeEventListener(eventName, handler);
|
|
@@ -1246,9 +1343,9 @@ function assignProp(node, prop2, value, prev, isSVG, skipRef, props) {
|
|
|
1246
1343
|
}
|
|
1247
1344
|
const isCE = node.nodeName.includes("-") || "is" in props;
|
|
1248
1345
|
if (!isSVG) {
|
|
1249
|
-
const propAlias = isDev ?
|
|
1250
|
-
const isProperty = isDev ?
|
|
1251
|
-
const isChildProp = isDev ?
|
|
1346
|
+
const propAlias = isDev ? _chunkFSCBL7RIcjs.getPropAlias.call(void 0, prop2, node.tagName) : void 0;
|
|
1347
|
+
const isProperty = isDev ? _chunkFSCBL7RIcjs.Properties.has(prop2) : prop2 in node;
|
|
1348
|
+
const isChildProp = isDev ? _chunkFSCBL7RIcjs.ChildProperties.has(prop2) : prop2 === "innerHTML" || prop2 === "textContent" || prop2 === "innerText" || prop2 === "children";
|
|
1252
1349
|
if (propAlias || isProperty || isChildProp || isCE) {
|
|
1253
1350
|
const propName = propAlias || prop2;
|
|
1254
1351
|
if (isCE && !isProperty && !isChildProp && !propAlias) {
|
|
@@ -1263,7 +1360,7 @@ function assignProp(node, prop2, value, prev, isSVG, skipRef, props) {
|
|
|
1263
1360
|
}
|
|
1264
1361
|
if (isSVG && prop2.indexOf(":") > -1) {
|
|
1265
1362
|
const [prefix, name] = prop2.split(":");
|
|
1266
|
-
const ns =
|
|
1363
|
+
const ns = _chunkFSCBL7RIcjs.SVGNamespace[prefix];
|
|
1267
1364
|
if (ns) {
|
|
1268
1365
|
if (value == null) node.removeAttributeNS(ns, name);
|
|
1269
1366
|
else node.setAttributeNS(ns, name, String(value));
|
|
@@ -1287,12 +1384,12 @@ function createConditional(condition, renderTrue, createElementFn, renderFalse,
|
|
|
1287
1384
|
;
|
|
1288
1385
|
fragment.append(startMarker, endMarker);
|
|
1289
1386
|
}
|
|
1290
|
-
const hostRoot =
|
|
1387
|
+
const hostRoot = _chunkFSCBL7RIcjs.getCurrentRoot.call(void 0, );
|
|
1291
1388
|
let currentNodes = [];
|
|
1292
1389
|
let currentRoot = null;
|
|
1293
1390
|
let lastCondition = void 0;
|
|
1294
1391
|
let pendingRender = false;
|
|
1295
|
-
let initialHydrating =
|
|
1392
|
+
let initialHydrating = _chunkFSCBL7RIcjs.__fictIsHydrating.call(void 0, );
|
|
1296
1393
|
const collectBetween = () => {
|
|
1297
1394
|
const nodes = [];
|
|
1298
1395
|
let cursor = startMarker.nextSibling;
|
|
@@ -1302,7 +1399,7 @@ function createConditional(condition, renderTrue, createElementFn, renderFalse,
|
|
|
1302
1399
|
}
|
|
1303
1400
|
return nodes;
|
|
1304
1401
|
};
|
|
1305
|
-
const conditionMemo =
|
|
1402
|
+
const conditionMemo = _chunkFSCBL7RIcjs.computed.call(void 0, condition);
|
|
1306
1403
|
const runConditional = () => {
|
|
1307
1404
|
const cond = conditionMemo();
|
|
1308
1405
|
const parent = startMarker.parentNode;
|
|
@@ -1319,8 +1416,8 @@ function createConditional(condition, renderTrue, createElementFn, renderFalse,
|
|
|
1319
1416
|
currentNodes = collectBetween();
|
|
1320
1417
|
return;
|
|
1321
1418
|
}
|
|
1322
|
-
const root2 =
|
|
1323
|
-
const prev2 =
|
|
1419
|
+
const root2 = _chunkFSCBL7RIcjs.createRootContext.call(void 0, hostRoot);
|
|
1420
|
+
const prev2 = _chunkFSCBL7RIcjs.pushRoot.call(void 0, root2);
|
|
1324
1421
|
let handledError2 = false;
|
|
1325
1422
|
try {
|
|
1326
1423
|
withHydrationRange(
|
|
@@ -1328,7 +1425,7 @@ function createConditional(condition, renderTrue, createElementFn, renderFalse,
|
|
|
1328
1425
|
endMarker,
|
|
1329
1426
|
_nullishCoalesce(parent.ownerDocument, () => ( document)),
|
|
1330
1427
|
() => {
|
|
1331
|
-
const output =
|
|
1428
|
+
const output = _chunkFSCBL7RIcjs.untrack.call(void 0, render3);
|
|
1332
1429
|
if (output == null || output === false) {
|
|
1333
1430
|
return;
|
|
1334
1431
|
}
|
|
@@ -1337,21 +1434,21 @@ function createConditional(condition, renderTrue, createElementFn, renderFalse,
|
|
|
1337
1434
|
);
|
|
1338
1435
|
currentNodes = collectBetween();
|
|
1339
1436
|
} catch (err) {
|
|
1340
|
-
if (
|
|
1437
|
+
if (_chunkFSCBL7RIcjs.handleSuspend.call(void 0, err, root2)) {
|
|
1341
1438
|
handledError2 = true;
|
|
1342
|
-
|
|
1439
|
+
_chunkFSCBL7RIcjs.destroyRoot.call(void 0, root2);
|
|
1343
1440
|
return;
|
|
1344
1441
|
}
|
|
1345
|
-
if (
|
|
1442
|
+
if (_chunkFSCBL7RIcjs.handleError.call(void 0, err, { source: "renderChild" }, root2)) {
|
|
1346
1443
|
handledError2 = true;
|
|
1347
|
-
|
|
1444
|
+
_chunkFSCBL7RIcjs.destroyRoot.call(void 0, root2);
|
|
1348
1445
|
return;
|
|
1349
1446
|
}
|
|
1350
1447
|
throw err;
|
|
1351
1448
|
} finally {
|
|
1352
|
-
|
|
1449
|
+
_chunkFSCBL7RIcjs.popRoot.call(void 0, prev2);
|
|
1353
1450
|
if (!handledError2) {
|
|
1354
|
-
|
|
1451
|
+
_chunkFSCBL7RIcjs.flushOnMount.call(void 0, root2);
|
|
1355
1452
|
currentRoot = root2;
|
|
1356
1453
|
} else {
|
|
1357
1454
|
currentRoot = null;
|
|
@@ -1367,7 +1464,7 @@ function createConditional(condition, renderTrue, createElementFn, renderFalse,
|
|
|
1367
1464
|
}
|
|
1368
1465
|
lastCondition = cond;
|
|
1369
1466
|
if (currentRoot) {
|
|
1370
|
-
|
|
1467
|
+
_chunkFSCBL7RIcjs.destroyRoot.call(void 0, currentRoot);
|
|
1371
1468
|
currentRoot = null;
|
|
1372
1469
|
}
|
|
1373
1470
|
removeNodes(currentNodes);
|
|
@@ -1376,11 +1473,11 @@ function createConditional(condition, renderTrue, createElementFn, renderFalse,
|
|
|
1376
1473
|
if (!render2) {
|
|
1377
1474
|
return;
|
|
1378
1475
|
}
|
|
1379
|
-
const root =
|
|
1380
|
-
const prev =
|
|
1476
|
+
const root = _chunkFSCBL7RIcjs.createRootContext.call(void 0, hostRoot);
|
|
1477
|
+
const prev = _chunkFSCBL7RIcjs.pushRoot.call(void 0, root);
|
|
1381
1478
|
let handledError = false;
|
|
1382
1479
|
try {
|
|
1383
|
-
const output =
|
|
1480
|
+
const output = _chunkFSCBL7RIcjs.untrack.call(void 0, render2);
|
|
1384
1481
|
if (output == null || output === false) {
|
|
1385
1482
|
return;
|
|
1386
1483
|
}
|
|
@@ -1389,28 +1486,28 @@ function createConditional(condition, renderTrue, createElementFn, renderFalse,
|
|
|
1389
1486
|
insertNodesBefore(parent, nodes, endMarker);
|
|
1390
1487
|
currentNodes = nodes;
|
|
1391
1488
|
} catch (err) {
|
|
1392
|
-
if (
|
|
1489
|
+
if (_chunkFSCBL7RIcjs.handleSuspend.call(void 0, err, root)) {
|
|
1393
1490
|
handledError = true;
|
|
1394
|
-
|
|
1491
|
+
_chunkFSCBL7RIcjs.destroyRoot.call(void 0, root);
|
|
1395
1492
|
return;
|
|
1396
1493
|
}
|
|
1397
|
-
if (
|
|
1494
|
+
if (_chunkFSCBL7RIcjs.handleError.call(void 0, err, { source: "renderChild" }, root)) {
|
|
1398
1495
|
handledError = true;
|
|
1399
|
-
|
|
1496
|
+
_chunkFSCBL7RIcjs.destroyRoot.call(void 0, root);
|
|
1400
1497
|
return;
|
|
1401
1498
|
}
|
|
1402
1499
|
throw err;
|
|
1403
1500
|
} finally {
|
|
1404
|
-
|
|
1501
|
+
_chunkFSCBL7RIcjs.popRoot.call(void 0, prev);
|
|
1405
1502
|
if (!handledError) {
|
|
1406
|
-
|
|
1503
|
+
_chunkFSCBL7RIcjs.flushOnMount.call(void 0, root);
|
|
1407
1504
|
currentRoot = root;
|
|
1408
1505
|
} else {
|
|
1409
1506
|
currentRoot = null;
|
|
1410
1507
|
}
|
|
1411
1508
|
}
|
|
1412
1509
|
};
|
|
1413
|
-
const dispose =
|
|
1510
|
+
const dispose = _chunkFSCBL7RIcjs.createRenderEffect.call(void 0, runConditional);
|
|
1414
1511
|
return {
|
|
1415
1512
|
marker: fragment,
|
|
1416
1513
|
flush: () => {
|
|
@@ -1421,7 +1518,7 @@ function createConditional(condition, renderTrue, createElementFn, renderFalse,
|
|
|
1421
1518
|
dispose: () => {
|
|
1422
1519
|
dispose();
|
|
1423
1520
|
if (currentRoot) {
|
|
1424
|
-
|
|
1521
|
+
_chunkFSCBL7RIcjs.destroyRoot.call(void 0, currentRoot);
|
|
1425
1522
|
}
|
|
1426
1523
|
removeNodes(currentNodes);
|
|
1427
1524
|
currentNodes = [];
|
|
@@ -1432,27 +1529,27 @@ function createConditional(condition, renderTrue, createElementFn, renderFalse,
|
|
|
1432
1529
|
}
|
|
1433
1530
|
function createShow(el, condition, displayValue) {
|
|
1434
1531
|
const originalDisplay = _nullishCoalesce(displayValue, () => ( el.style.display));
|
|
1435
|
-
|
|
1532
|
+
_chunkFSCBL7RIcjs.createRenderEffect.call(void 0, () => {
|
|
1436
1533
|
el.style.display = condition() ? originalDisplay : "none";
|
|
1437
1534
|
});
|
|
1438
1535
|
}
|
|
1439
1536
|
function createPortal(container, render2, createElementFn) {
|
|
1440
|
-
const parentRoot =
|
|
1537
|
+
const parentRoot = _chunkFSCBL7RIcjs.getCurrentRoot.call(void 0, );
|
|
1441
1538
|
const marker = document.createComment("fict:portal");
|
|
1442
1539
|
container.appendChild(marker);
|
|
1443
1540
|
let currentNodes = [];
|
|
1444
1541
|
let currentRoot = null;
|
|
1445
|
-
const dispose =
|
|
1542
|
+
const dispose = _chunkFSCBL7RIcjs.createRenderEffect.call(void 0, () => {
|
|
1446
1543
|
if (currentRoot) {
|
|
1447
|
-
|
|
1544
|
+
_chunkFSCBL7RIcjs.destroyRoot.call(void 0, currentRoot);
|
|
1448
1545
|
currentRoot = null;
|
|
1449
1546
|
}
|
|
1450
1547
|
if (currentNodes.length > 0) {
|
|
1451
1548
|
removeNodes(currentNodes);
|
|
1452
1549
|
currentNodes = [];
|
|
1453
1550
|
}
|
|
1454
|
-
const root =
|
|
1455
|
-
const prev =
|
|
1551
|
+
const root = _chunkFSCBL7RIcjs.createRootContext.call(void 0, parentRoot);
|
|
1552
|
+
const prev = _chunkFSCBL7RIcjs.pushRoot.call(void 0, root);
|
|
1456
1553
|
let handledError = false;
|
|
1457
1554
|
try {
|
|
1458
1555
|
const output = render2();
|
|
@@ -1465,23 +1562,23 @@ function createPortal(container, render2, createElementFn) {
|
|
|
1465
1562
|
currentNodes = nodes;
|
|
1466
1563
|
}
|
|
1467
1564
|
} catch (err) {
|
|
1468
|
-
if (
|
|
1565
|
+
if (_chunkFSCBL7RIcjs.handleSuspend.call(void 0, err, root)) {
|
|
1469
1566
|
handledError = true;
|
|
1470
|
-
|
|
1567
|
+
_chunkFSCBL7RIcjs.destroyRoot.call(void 0, root);
|
|
1471
1568
|
currentNodes = [];
|
|
1472
1569
|
return;
|
|
1473
1570
|
}
|
|
1474
|
-
if (
|
|
1571
|
+
if (_chunkFSCBL7RIcjs.handleError.call(void 0, err, { source: "renderChild" }, root)) {
|
|
1475
1572
|
handledError = true;
|
|
1476
|
-
|
|
1573
|
+
_chunkFSCBL7RIcjs.destroyRoot.call(void 0, root);
|
|
1477
1574
|
currentNodes = [];
|
|
1478
1575
|
return;
|
|
1479
1576
|
}
|
|
1480
1577
|
throw err;
|
|
1481
1578
|
} finally {
|
|
1482
|
-
|
|
1579
|
+
_chunkFSCBL7RIcjs.popRoot.call(void 0, prev);
|
|
1483
1580
|
if (!handledError) {
|
|
1484
|
-
|
|
1581
|
+
_chunkFSCBL7RIcjs.flushOnMount.call(void 0, root);
|
|
1485
1582
|
currentRoot = root;
|
|
1486
1583
|
} else {
|
|
1487
1584
|
currentRoot = null;
|
|
@@ -1491,7 +1588,7 @@ function createPortal(container, render2, createElementFn) {
|
|
|
1491
1588
|
const portalDispose = () => {
|
|
1492
1589
|
dispose();
|
|
1493
1590
|
if (currentRoot) {
|
|
1494
|
-
|
|
1591
|
+
_chunkFSCBL7RIcjs.destroyRoot.call(void 0, currentRoot);
|
|
1495
1592
|
}
|
|
1496
1593
|
if (currentNodes.length > 0) {
|
|
1497
1594
|
removeNodes(currentNodes);
|
|
@@ -1509,9 +1606,21 @@ function createPortal(container, render2, createElementFn) {
|
|
|
1509
1606
|
|
|
1510
1607
|
// src/props.ts
|
|
1511
1608
|
var PROP_GETTER_MARKER2 = Symbol.for("fict:prop-getter");
|
|
1609
|
+
var NON_REACTIVE_FN_MARKER2 = Symbol.for("fict:non-reactive-fn");
|
|
1610
|
+
var REACTIVE_FN_MARKER2 = Symbol.for("fict:reactive-fn");
|
|
1611
|
+
var NON_REACTIVE_FN_REGISTRY_KEY2 = Symbol.for("fict:non-reactive-fn-registry");
|
|
1512
1612
|
var propGetters = /* @__PURE__ */ new WeakSet();
|
|
1513
1613
|
var rawToProxy = /* @__PURE__ */ new WeakMap();
|
|
1514
1614
|
var proxyToRaw = /* @__PURE__ */ new WeakMap();
|
|
1615
|
+
function getNonReactiveFnRegistry2() {
|
|
1616
|
+
const host = globalThis;
|
|
1617
|
+
let registry = host[NON_REACTIVE_FN_REGISTRY_KEY2];
|
|
1618
|
+
if (!registry) {
|
|
1619
|
+
registry = /* @__PURE__ */ new WeakSet();
|
|
1620
|
+
host[NON_REACTIVE_FN_REGISTRY_KEY2] = registry;
|
|
1621
|
+
}
|
|
1622
|
+
return registry;
|
|
1623
|
+
}
|
|
1515
1624
|
function __fictProp(getter) {
|
|
1516
1625
|
if (typeof getter === "function" && getter.length === 0) {
|
|
1517
1626
|
propGetters.add(getter);
|
|
@@ -1519,7 +1628,7 @@ function __fictProp(getter) {
|
|
|
1519
1628
|
try {
|
|
1520
1629
|
;
|
|
1521
1630
|
getter[PROP_GETTER_MARKER2] = true;
|
|
1522
|
-
} catch (
|
|
1631
|
+
} catch (e13) {
|
|
1523
1632
|
}
|
|
1524
1633
|
}
|
|
1525
1634
|
}
|
|
@@ -1530,6 +1639,35 @@ function isPropGetter(value) {
|
|
|
1530
1639
|
const fn = value;
|
|
1531
1640
|
return propGetters.has(fn) || fn[PROP_GETTER_MARKER2] === true;
|
|
1532
1641
|
}
|
|
1642
|
+
function isNonReactiveFn2(value) {
|
|
1643
|
+
if (typeof value !== "function") return false;
|
|
1644
|
+
if (getNonReactiveFnRegistry2().has(value)) return true;
|
|
1645
|
+
return value[NON_REACTIVE_FN_MARKER2] === true;
|
|
1646
|
+
}
|
|
1647
|
+
function markNonReactiveFn(fn) {
|
|
1648
|
+
getNonReactiveFnRegistry2().add(fn);
|
|
1649
|
+
if (Object.isExtensible(fn)) {
|
|
1650
|
+
try {
|
|
1651
|
+
;
|
|
1652
|
+
fn[NON_REACTIVE_FN_MARKER2] = true;
|
|
1653
|
+
} catch (e14) {
|
|
1654
|
+
}
|
|
1655
|
+
}
|
|
1656
|
+
return fn;
|
|
1657
|
+
}
|
|
1658
|
+
function isExplicitReactiveFn2(value) {
|
|
1659
|
+
if (typeof value !== "function") return false;
|
|
1660
|
+
return value[REACTIVE_FN_MARKER2] === true;
|
|
1661
|
+
}
|
|
1662
|
+
function normalizePropsFunction(value) {
|
|
1663
|
+
if (typeof value !== "function") return value;
|
|
1664
|
+
if (value.length !== 0) return value;
|
|
1665
|
+
if (isPropGetter(value) || _chunkFSCBL7RIcjs.isSignal.call(void 0, value) || _chunkFSCBL7RIcjs.isComputed.call(void 0, value) || isExplicitReactiveFn2(value)) {
|
|
1666
|
+
return value;
|
|
1667
|
+
}
|
|
1668
|
+
if (_chunkFSCBL7RIcjs.isEffect.call(void 0, value) || _chunkFSCBL7RIcjs.isEffectScope.call(void 0, value) || isNonReactiveFn2(value)) return value;
|
|
1669
|
+
return markNonReactiveFn(value);
|
|
1670
|
+
}
|
|
1533
1671
|
function createPropsProxy(props) {
|
|
1534
1672
|
if (!props || typeof props !== "object") {
|
|
1535
1673
|
return props;
|
|
@@ -1547,7 +1685,7 @@ function createPropsProxy(props) {
|
|
|
1547
1685
|
if (isPropGetter(value)) {
|
|
1548
1686
|
return value();
|
|
1549
1687
|
}
|
|
1550
|
-
return value;
|
|
1688
|
+
return normalizePropsFunction(value);
|
|
1551
1689
|
},
|
|
1552
1690
|
set(target, prop2, value, receiver) {
|
|
1553
1691
|
return Reflect.set(target, prop2, value, receiver);
|
|
@@ -1666,7 +1804,7 @@ function prop(getter, options) {
|
|
|
1666
1804
|
const fn = getter;
|
|
1667
1805
|
const unwrap2 = _optionalChain([options, 'optionalAccess', _22 => _22.unwrap]) !== false;
|
|
1668
1806
|
return __fictProp(
|
|
1669
|
-
|
|
1807
|
+
_chunkFSCBL7RIcjs.createMemo.call(void 0, () => {
|
|
1670
1808
|
const value = fn();
|
|
1671
1809
|
if (unwrap2 && isPropGetter(value)) {
|
|
1672
1810
|
return value();
|
|
@@ -1679,15 +1817,15 @@ function prop(getter, options) {
|
|
|
1679
1817
|
// src/dom.ts
|
|
1680
1818
|
var SVG_NS = "http://www.w3.org/2000/svg";
|
|
1681
1819
|
var MATHML_NS = "http://www.w3.org/1998/Math/MathML";
|
|
1682
|
-
var isDev2 = typeof __DEV__ !== "undefined" ? __DEV__ : typeof process
|
|
1820
|
+
var isDev2 = typeof __DEV__ !== "undefined" ? __DEV__ : typeof process !== "undefined" && _optionalChain([process, 'access', _23 => _23.env, 'optionalAccess', _24 => _24.NODE_ENV]) !== "production";
|
|
1683
1821
|
var nextComponentId = 1;
|
|
1684
1822
|
function render(view, container) {
|
|
1685
|
-
const root =
|
|
1686
|
-
const prev =
|
|
1823
|
+
const root = _chunkFSCBL7RIcjs.createRootContext.call(void 0, );
|
|
1824
|
+
const prev = _chunkFSCBL7RIcjs.pushRoot.call(void 0, root);
|
|
1687
1825
|
let dom = void 0;
|
|
1688
1826
|
try {
|
|
1689
1827
|
const output = view();
|
|
1690
|
-
if (
|
|
1828
|
+
if (_chunkFSCBL7RIcjs.__fictIsHydrating.call(void 0, )) {
|
|
1691
1829
|
withHydration(container, () => {
|
|
1692
1830
|
dom = createElement(output);
|
|
1693
1831
|
});
|
|
@@ -1695,35 +1833,35 @@ function render(view, container) {
|
|
|
1695
1833
|
dom = createElement(output);
|
|
1696
1834
|
}
|
|
1697
1835
|
} finally {
|
|
1698
|
-
|
|
1836
|
+
_chunkFSCBL7RIcjs.popRoot.call(void 0, prev);
|
|
1699
1837
|
}
|
|
1700
|
-
if (!
|
|
1838
|
+
if (!_chunkFSCBL7RIcjs.__fictIsHydrating.call(void 0, )) {
|
|
1701
1839
|
container.replaceChildren(dom);
|
|
1702
1840
|
}
|
|
1703
1841
|
container.setAttribute("data-fict-fine-grained", "1");
|
|
1704
|
-
|
|
1842
|
+
_chunkFSCBL7RIcjs.flushOnMount.call(void 0, root);
|
|
1705
1843
|
const teardown = () => {
|
|
1706
|
-
|
|
1844
|
+
_chunkFSCBL7RIcjs.destroyRoot.call(void 0, root);
|
|
1707
1845
|
container.innerHTML = "";
|
|
1708
1846
|
};
|
|
1709
1847
|
return teardown;
|
|
1710
1848
|
}
|
|
1711
1849
|
function hydrateComponent(view, container) {
|
|
1712
|
-
const root =
|
|
1713
|
-
const prev =
|
|
1714
|
-
|
|
1850
|
+
const root = _chunkFSCBL7RIcjs.createRootContext.call(void 0, );
|
|
1851
|
+
const prev = _chunkFSCBL7RIcjs.pushRoot.call(void 0, root);
|
|
1852
|
+
_chunkFSCBL7RIcjs.__fictEnterHydration.call(void 0, );
|
|
1715
1853
|
try {
|
|
1716
1854
|
withHydration(container, () => {
|
|
1717
1855
|
view();
|
|
1718
1856
|
});
|
|
1719
1857
|
} finally {
|
|
1720
|
-
|
|
1721
|
-
|
|
1858
|
+
_chunkFSCBL7RIcjs.__fictExitHydration.call(void 0, );
|
|
1859
|
+
_chunkFSCBL7RIcjs.popRoot.call(void 0, prev);
|
|
1722
1860
|
}
|
|
1723
1861
|
container.setAttribute("data-fict-fine-grained", "1");
|
|
1724
|
-
|
|
1862
|
+
_chunkFSCBL7RIcjs.flushOnMount.call(void 0, root);
|
|
1725
1863
|
const teardown = () => {
|
|
1726
|
-
|
|
1864
|
+
_chunkFSCBL7RIcjs.destroyRoot.call(void 0, root);
|
|
1727
1865
|
};
|
|
1728
1866
|
return teardown;
|
|
1729
1867
|
}
|
|
@@ -1735,7 +1873,7 @@ function resolveNamespace(tagName, namespace) {
|
|
|
1735
1873
|
if (tagName === "math") return "mathml";
|
|
1736
1874
|
if (namespace === "mathml") return "mathml";
|
|
1737
1875
|
if (namespace === "svg") return "svg";
|
|
1738
|
-
if (isDev2 &&
|
|
1876
|
+
if (isDev2 && _chunkFSCBL7RIcjs.SVGElements.has(tagName)) return "svg";
|
|
1739
1877
|
return null;
|
|
1740
1878
|
}
|
|
1741
1879
|
function createElementWithContext(node, namespace) {
|
|
@@ -1752,11 +1890,14 @@ function createElementWithContext(node, namespace) {
|
|
|
1752
1890
|
}
|
|
1753
1891
|
return createElementWithContext(resolved, namespace);
|
|
1754
1892
|
}
|
|
1893
|
+
if (typeof node === "function") {
|
|
1894
|
+
return document.createTextNode("");
|
|
1895
|
+
}
|
|
1755
1896
|
if (typeof node === "object" && node !== null && !(node instanceof Node)) {
|
|
1756
1897
|
if ("marker" in node) {
|
|
1757
1898
|
const handle = node;
|
|
1758
1899
|
if (typeof handle.dispose === "function") {
|
|
1759
|
-
|
|
1900
|
+
_chunkFSCBL7RIcjs.registerRootCleanup.call(void 0, handle.dispose);
|
|
1760
1901
|
}
|
|
1761
1902
|
if (typeof handle.flush === "function") {
|
|
1762
1903
|
const runFlush = () => handle.flush && handle.flush();
|
|
@@ -1807,13 +1948,13 @@ function createElementWithContext(node, namespace) {
|
|
|
1807
1948
|
}
|
|
1808
1949
|
});
|
|
1809
1950
|
const props = createPropsProxy(baseProps);
|
|
1810
|
-
const hook = isDev2 ?
|
|
1811
|
-
const parentId = hook ?
|
|
1951
|
+
const hook = isDev2 ? _chunkFSCBL7RIcjs.getDevtoolsHook.call(void 0, ) : void 0;
|
|
1952
|
+
const parentId = hook ? _chunkFSCBL7RIcjs.__fictGetCurrentComponentId.call(void 0, ) : void 0;
|
|
1812
1953
|
const componentId = hook ? nextComponentId++ : void 0;
|
|
1813
1954
|
if (_optionalChain([hook, 'optionalAccess', _25 => _25.registerComponent]) && componentId !== void 0) {
|
|
1814
1955
|
hook.registerComponent(componentId, vnode.type.name || "Anonymous", parentId);
|
|
1815
1956
|
}
|
|
1816
|
-
const ctx =
|
|
1957
|
+
const ctx = _chunkFSCBL7RIcjs.__fictPushContext.call(void 0, );
|
|
1817
1958
|
if (componentId !== void 0) {
|
|
1818
1959
|
ctx.componentId = componentId;
|
|
1819
1960
|
if (parentId !== void 0) {
|
|
@@ -1823,12 +1964,12 @@ function createElementWithContext(node, namespace) {
|
|
|
1823
1964
|
try {
|
|
1824
1965
|
const rendered = vnode.type(props);
|
|
1825
1966
|
if (hook && componentId !== void 0) {
|
|
1826
|
-
|
|
1967
|
+
_chunkFSCBL7RIcjs.onMount.call(void 0, () => {
|
|
1827
1968
|
_optionalChain([hook, 'access', _26 => _26.componentMount, 'optionalCall', _27 => _27(componentId)]);
|
|
1828
1969
|
});
|
|
1829
|
-
|
|
1970
|
+
_chunkFSCBL7RIcjs.onCleanup.call(void 0, () => _optionalChain([hook, 'access', _28 => _28.componentUnmount, 'optionalCall', _29 => _29(componentId)]));
|
|
1830
1971
|
}
|
|
1831
|
-
if (
|
|
1972
|
+
if (_chunkFSCBL7RIcjs.__fictIsResumable.call(void 0, ) && !_chunkFSCBL7RIcjs.__fictIsHydrating.call(void 0, )) {
|
|
1832
1973
|
const content = createElementWithContext(rendered, namespace);
|
|
1833
1974
|
const host = namespace === "svg" ? document.createElementNS(SVG_NS, "fict-host") : namespace === "mathml" ? document.createElementNS(MATHML_NS, "fict-host") : document.createElement("fict-host");
|
|
1834
1975
|
host.setAttribute("data-fict-host", "");
|
|
@@ -1838,7 +1979,7 @@ function createElementWithContext(node, namespace) {
|
|
|
1838
1979
|
}
|
|
1839
1980
|
const meta = vnode.type.__fictMeta;
|
|
1840
1981
|
const typeKey = (_nullishCoalesce(_optionalChain([meta, 'optionalAccess', _30 => _30.id]), () => ( vnode.type.name))) || "Anonymous";
|
|
1841
|
-
|
|
1982
|
+
_chunkFSCBL7RIcjs.__fictRegisterScope.call(void 0, ctx, host, typeKey, rawProps);
|
|
1842
1983
|
if (_optionalChain([meta, 'optionalAccess', _31 => _31.resume])) {
|
|
1843
1984
|
host.setAttribute("data-fict-h", meta.resume);
|
|
1844
1985
|
}
|
|
@@ -1851,13 +1992,13 @@ function createElementWithContext(node, namespace) {
|
|
|
1851
1992
|
}
|
|
1852
1993
|
return createElementWithContext(rendered, namespace);
|
|
1853
1994
|
} catch (err) {
|
|
1854
|
-
if (
|
|
1995
|
+
if (_chunkFSCBL7RIcjs.handleSuspend.call(void 0, err)) {
|
|
1855
1996
|
return document.createComment("fict:suspend");
|
|
1856
1997
|
}
|
|
1857
|
-
|
|
1998
|
+
_chunkFSCBL7RIcjs.handleError.call(void 0, err, { source: "render", componentName: vnode.type.name });
|
|
1858
1999
|
throw err;
|
|
1859
2000
|
} finally {
|
|
1860
|
-
|
|
2001
|
+
_chunkFSCBL7RIcjs.__fictPopContext.call(void 0, );
|
|
1861
2002
|
}
|
|
1862
2003
|
}
|
|
1863
2004
|
if (vnode.type === Fragment) {
|
|
@@ -1945,9 +2086,12 @@ function appendChildNode(parent, child, namespace) {
|
|
|
1945
2086
|
_optionalChain([child, 'access', _36 => _36.flush, 'optionalCall', _37 => _37()]);
|
|
1946
2087
|
return;
|
|
1947
2088
|
}
|
|
1948
|
-
if (typeof child === "function"
|
|
2089
|
+
if (typeof child === "function") {
|
|
1949
2090
|
const childGetter = child;
|
|
1950
|
-
|
|
2091
|
+
if (isReactive(childGetter)) {
|
|
2092
|
+
createChildBinding(parent, childGetter, (node) => createElementWithContext(node, namespace));
|
|
2093
|
+
return;
|
|
2094
|
+
}
|
|
1951
2095
|
return;
|
|
1952
2096
|
}
|
|
1953
2097
|
if (Array.isArray(child)) {
|
|
@@ -1997,9 +2141,9 @@ function applyRef(el, value) {
|
|
|
1997
2141
|
if (typeof value === "function") {
|
|
1998
2142
|
const refFn = value;
|
|
1999
2143
|
refFn(el);
|
|
2000
|
-
const root =
|
|
2144
|
+
const root = _chunkFSCBL7RIcjs.getCurrentRoot.call(void 0, );
|
|
2001
2145
|
if (root) {
|
|
2002
|
-
|
|
2146
|
+
_chunkFSCBL7RIcjs.registerRootCleanup.call(void 0, () => {
|
|
2003
2147
|
refFn(null);
|
|
2004
2148
|
});
|
|
2005
2149
|
} else if (isDev2) {
|
|
@@ -2010,9 +2154,9 @@ function applyRef(el, value) {
|
|
|
2010
2154
|
} else if (value && typeof value === "object" && "current" in value) {
|
|
2011
2155
|
const refObj = value;
|
|
2012
2156
|
refObj.current = el;
|
|
2013
|
-
const root =
|
|
2157
|
+
const root = _chunkFSCBL7RIcjs.getCurrentRoot.call(void 0, );
|
|
2014
2158
|
if (root) {
|
|
2015
|
-
|
|
2159
|
+
_chunkFSCBL7RIcjs.registerRootCleanup.call(void 0, () => {
|
|
2016
2160
|
refObj.current = null;
|
|
2017
2161
|
});
|
|
2018
2162
|
} else if (isDev2) {
|
|
@@ -2086,7 +2230,7 @@ function applyProps(el, props, isSVG = false) {
|
|
|
2086
2230
|
}
|
|
2087
2231
|
continue;
|
|
2088
2232
|
}
|
|
2089
|
-
if (isDev2 &&
|
|
2233
|
+
if (isDev2 && _chunkFSCBL7RIcjs.ChildProperties.has(key) || key === "innerHTML" || key === "textContent" || key === "innerText" || key === "children") {
|
|
2090
2234
|
createAttributeBinding(el, key, value, setProperty);
|
|
2091
2235
|
continue;
|
|
2092
2236
|
}
|
|
@@ -2102,8 +2246,8 @@ function applyProps(el, props, isSVG = false) {
|
|
|
2102
2246
|
createAttributeBinding(el, key.slice(5), value, setProperty);
|
|
2103
2247
|
continue;
|
|
2104
2248
|
}
|
|
2105
|
-
const propAlias = !isSVG && isDev2 ?
|
|
2106
|
-
const isProperty = !isSVG ? isDev2 ?
|
|
2249
|
+
const propAlias = !isSVG && isDev2 ? _chunkFSCBL7RIcjs.getPropAlias.call(void 0, key, tagName) : void 0;
|
|
2250
|
+
const isProperty = !isSVG ? isDev2 ? _chunkFSCBL7RIcjs.Properties.has(key) : key in el : false;
|
|
2107
2251
|
if (propAlias || isProperty || isCE && !isSVG) {
|
|
2108
2252
|
const propName = propAlias || key;
|
|
2109
2253
|
if (isCE && !isProperty && !propAlias) {
|
|
@@ -2120,7 +2264,7 @@ function applyProps(el, props, isSVG = false) {
|
|
|
2120
2264
|
}
|
|
2121
2265
|
if (isSVG && key.indexOf(":") > -1) {
|
|
2122
2266
|
const [prefix, name] = key.split(":");
|
|
2123
|
-
const ns =
|
|
2267
|
+
const ns = _chunkFSCBL7RIcjs.SVGNamespace[prefix];
|
|
2124
2268
|
if (ns) {
|
|
2125
2269
|
createAttributeBinding(
|
|
2126
2270
|
el,
|
|
@@ -2255,5 +2399,12 @@ function eventNameFromProp(key) {
|
|
|
2255
2399
|
|
|
2256
2400
|
|
|
2257
2401
|
|
|
2258
|
-
|
|
2259
|
-
|
|
2402
|
+
|
|
2403
|
+
|
|
2404
|
+
|
|
2405
|
+
|
|
2406
|
+
|
|
2407
|
+
|
|
2408
|
+
|
|
2409
|
+
exports.withHydrationRange = withHydrationRange; exports.isHydratingActive = isHydratingActive; exports.Fragment = Fragment; exports.toNodeArray = toNodeArray; exports.insertNodesBefore = insertNodesBefore; exports.removeNodes = removeNodes; exports.getSlotEnd = getSlotEnd; exports.resolvePath = resolvePath; exports.startTransition = startTransition; exports.useTransition = useTransition; exports.useDeferredValue = useDeferredValue; exports.batch = batch2; exports.untrack = untrack2; exports.isReactive = isReactive; exports.nonReactive = nonReactive; exports.reactive = reactive; exports.unwrap = unwrap; exports.callEventHandler = callEventHandler; exports.createTextBinding = createTextBinding; exports.bindText = bindText; exports.setText = setText; exports.createAttributeBinding = createAttributeBinding; exports.bindAttribute = bindAttribute; exports.setAttr = setAttr; exports.bindProperty = bindProperty; exports.setProp = setProp; exports.createStyleBinding = createStyleBinding; exports.bindStyle = bindStyle; exports.setStyle = setStyle; exports.createClassBinding = createClassBinding; exports.bindClass = bindClass; exports.setClass = setClass; exports.classList = classList; exports.insert = insert; exports.insertBetween = insertBetween; exports.createChildBinding = createChildBinding; exports.delegateEvents = delegateEvents; exports.clearDelegatedEvents = clearDelegatedEvents; exports.addEventListener = addEventListener; exports.bindEvent = bindEvent; exports.bindRef = bindRef; exports.spread = spread; exports.assign = assign; exports.createConditional = createConditional; exports.createShow = createShow; exports.createPortal = createPortal; exports.__fictProp = __fictProp; exports.createPropsProxy = createPropsProxy; exports.__fictPropsRest = __fictPropsRest; exports.mergeProps = mergeProps; exports.keyed = keyed; exports.prop = prop; exports.render = render; exports.hydrateComponent = hydrateComponent; exports.createElement = createElement; exports.template = template;
|
|
2410
|
+
//# sourceMappingURL=chunk-PRF4QG73.cjs.map
|