brumate 0.8.0 → 0.8.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{boot-BkUdiYOF.d.ts → boot-DQuAhAd5.d.ts} +2 -2
- package/dist/cli.js +2 -2
- package/dist/{client-Cq6aTiDs.d.ts → client-4eabQtYJ.d.ts} +25 -7
- package/dist/{client-B0FXW5Kw.js → client-CwVcmymi.js} +102 -19
- package/dist/client-CwVcmymi.js.map +1 -0
- package/dist/{defer-BMIMP4Hq.js → defer-BaXWydb0.js} +2 -2
- package/dist/{defer-BMIMP4Hq.js.map → defer-BaXWydb0.js.map} +1 -1
- package/dist/{devtools-B4prrxht.js → devtools-CMuj12yR.js} +4 -4
- package/dist/{devtools-B4prrxht.js.map → devtools-CMuj12yR.js.map} +1 -1
- package/dist/{devtools-panel-B1nF1KB7.js → devtools-panel-Cq8LpsyW.js} +2 -2
- package/dist/{devtools-panel-B1nF1KB7.js.map → devtools-panel-Cq8LpsyW.js.map} +1 -1
- package/dist/{files-D5GtxwEQ.js → files-DXS8RAtZ.js} +2 -2
- package/dist/{files-D5GtxwEQ.js.map → files-DXS8RAtZ.js.map} +1 -1
- package/dist/index.js +1 -1
- package/dist/{inspect-CGl5Y8q6.js → inspect-B5AoHh5O.js} +59 -14
- package/dist/inspect-B5AoHh5O.js.map +1 -0
- package/dist/{loader-BsaSuIoG.js → loader-CTeT6ie9.js} +4 -4
- package/dist/{loader-BsaSuIoG.js.map → loader-CTeT6ie9.js.map} +1 -1
- package/dist/{navigate-BlowKvhB.js → navigate-Bj73X4ZS.js} +10 -3
- package/dist/navigate-Bj73X4ZS.js.map +1 -0
- package/dist/{rpc-C1jYVNAe.js → rpc-kVB0Ujdx.js} +2 -2
- package/dist/{rpc-C1jYVNAe.js.map → rpc-kVB0Ujdx.js.map} +1 -1
- package/dist/runtime/bundles.d.ts +3 -2
- package/dist/runtime/bundles.js +14 -3
- package/dist/runtime/bundles.js.map +1 -1
- package/dist/runtime/client.d.ts +2 -2
- package/dist/runtime/client.js +2 -2
- package/dist/runtime/devtools.d.ts +1 -1
- package/dist/runtime/devtools.js +1 -1
- package/dist/runtime/hot.d.ts +1 -1
- package/dist/runtime/loader.d.ts +2 -2
- package/dist/runtime/loader.js +2 -2
- package/dist/runtime/static-loader.d.ts +2 -2
- package/dist/runtime/static-loader.js +1 -1
- package/dist/runtime/testing.d.ts +1 -1
- package/dist/runtime/testing.js +1 -1
- package/dist/{static-loader-C_en-4v8.js → static-loader-BM0-wdIc.js} +2 -2
- package/dist/{static-loader-C_en-4v8.js.map → static-loader-BM0-wdIc.js.map} +1 -1
- package/dist/{static-loader-UKnK11Em.d.ts → static-loader-BSAyFqG0.d.ts} +2 -2
- package/dist/vite.d.ts +1 -1
- package/dist/vite.js +2 -2
- package/package.json +1 -1
- package/dist/client-B0FXW5Kw.js.map +0 -1
- package/dist/inspect-CGl5Y8q6.js.map +0 -1
- package/dist/navigate-BlowKvhB.js.map +0 -1
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { r as SerialEntry } from "./values-B8C7CLvG.js";
|
|
2
|
-
import {
|
|
2
|
+
import { Yt as ClientModule } from "./client-4eabQtYJ.js";
|
|
3
3
|
//#region src/runtime/boot.d.ts
|
|
4
4
|
interface LoaderOptions {
|
|
5
5
|
/**
|
|
@@ -51,4 +51,4 @@ interface NavigateOptions {
|
|
|
51
51
|
}
|
|
52
52
|
//#endregion
|
|
53
53
|
export { NavigateOptions as n, LoaderOptions as t };
|
|
54
|
-
//# sourceMappingURL=boot-
|
|
54
|
+
//# sourceMappingURL=boot-DQuAhAd5.d.ts.map
|
package/dist/cli.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import { a as findError } from "./error-catalog-DakxjSgj.js";
|
|
3
|
-
import { A as analyzeProjectProps, C as resolveFromDisk, Q as getLocation, W as BRIDGE_EXPORT, Y as scriptBridges, Z as BrumateError, o as CompileError, r as inspect, s as compile } from "./inspect-
|
|
4
|
-
import { _ as findPackages, a as findScripts, b as resolveComponentPackage, c as findServerImport, n as defaultExclude, s as findPackageServerFile, t as collectSources } from "./files-
|
|
3
|
+
import { A as analyzeProjectProps, C as resolveFromDisk, Q as getLocation, W as BRIDGE_EXPORT, Y as scriptBridges, Z as BrumateError, o as CompileError, r as inspect, s as compile } from "./inspect-B5AoHh5O.js";
|
|
4
|
+
import { _ as findPackages, a as findScripts, b as resolveComponentPackage, c as findServerImport, n as defaultExclude, s as findPackageServerFile, t as collectSources } from "./files-DXS8RAtZ.js";
|
|
5
5
|
import { createRequire } from "node:module";
|
|
6
6
|
import { existsSync, readFileSync, statSync } from "node:fs";
|
|
7
7
|
import { cp, readdir } from "node:fs/promises";
|
|
@@ -71,9 +71,9 @@ interface HiddenBody {
|
|
|
71
71
|
//#region src/runtime/client/children.d.ts
|
|
72
72
|
/**
|
|
73
73
|
* A call of a `#template` of the file, which an insert can update in place. `render` is the
|
|
74
|
-
* template's code, and `owner` the scope that holds the template. The call
|
|
75
|
-
*
|
|
76
|
-
*
|
|
74
|
+
* template's code, and `owner` the scope that holds the template. The call renders as children
|
|
75
|
+
* of its owner, where the component that gets it inserts it, so it reads the contexts there, as
|
|
76
|
+
* on the server.
|
|
77
77
|
*/
|
|
78
78
|
declare function templateCall(ref: string, owner: Scope | undefined, render: (...args: unknown[]) => unknown, args: unknown[]): TemplateCall;
|
|
79
79
|
/** Renders a value inserted in markup. Children render here, at `scope`, for their contexts. */
|
|
@@ -97,7 +97,7 @@ declare class TemplateCall extends Children {
|
|
|
97
97
|
/** The scope of the component that wrote the template. */
|
|
98
98
|
readonly owner: Scope | undefined;
|
|
99
99
|
readonly args: unknown[];
|
|
100
|
-
constructor(ref: string, owner: Scope | undefined, args: unknown[], html: (at?: Scope) => string
|
|
100
|
+
constructor(ref: string, owner: Scope | undefined, args: unknown[], html: (at?: Scope) => string);
|
|
101
101
|
}
|
|
102
102
|
/** The children of a component that the client renders. See `Children`. */
|
|
103
103
|
declare function children(from: Scope | ScopeId | undefined, html: () => string | DocumentFragment): Children;
|
|
@@ -132,7 +132,10 @@ declare function memoNow(value: unknown): unknown;
|
|
|
132
132
|
* of a memo until a read.
|
|
133
133
|
*/
|
|
134
134
|
declare function renderMemo(compute: () => unknown): unknown;
|
|
135
|
-
/**
|
|
135
|
+
/**
|
|
136
|
+
* Reads a memo of a render: the error that a throw held is thrown at the read. A memo that is
|
|
137
|
+
* still loading stops the code that reads it, which waits for the memo.
|
|
138
|
+
*/
|
|
136
139
|
declare function readMemo(value: unknown): unknown;
|
|
137
140
|
declare function setSlots(id: ScopeId, values: unknown[]): void;
|
|
138
141
|
declare function setItem(id: ScopeId, value: unknown): void;
|
|
@@ -178,6 +181,8 @@ interface Scope {
|
|
|
178
181
|
/** The component ID, for a component's root scope. */
|
|
179
182
|
m?: string;
|
|
180
183
|
s: unknown[];
|
|
184
|
+
/** True once the scope is removed, so a wait that ends later computes nothing. */
|
|
185
|
+
gone?: boolean;
|
|
181
186
|
/** The item of a list item scope. */
|
|
182
187
|
i?: unknown;
|
|
183
188
|
c?: Record<number, ScopeId>;
|
|
@@ -460,6 +465,12 @@ declare function attempt(body: () => Out): DocumentFragment;
|
|
|
460
465
|
* A scope that goes during the wait ends it with `leave`.
|
|
461
466
|
*/
|
|
462
467
|
declare function fillSettled(id: ScopeId | Scope, values: unknown[], write: (...values: unknown[]) => void): void;
|
|
468
|
+
/**
|
|
469
|
+
* A write of cloned markup whose values come from code that can read a memo that is still
|
|
470
|
+
* loading, such as a block header or a prop that calls a function. The write waits for the memo,
|
|
471
|
+
* and runs again with its value. It counts in the boundary of the render, as `fillSettled` does.
|
|
472
|
+
*/
|
|
473
|
+
declare function fillPend(id: ScopeId | Scope, write: () => void): void;
|
|
463
474
|
/**
|
|
464
475
|
* A value of markup that the browser writes, in text or an attribute, which can be a promise.
|
|
465
476
|
* A value that is not one is written at once. A promise counts in the boundary of the render, as
|
|
@@ -779,6 +790,13 @@ declare function unreadMemo(scope: Scope | ScopeId, value: unknown): void;
|
|
|
779
790
|
* keeps its value, and `pending` is true. Only the latest load is written.
|
|
780
791
|
*/
|
|
781
792
|
declare function asyncMemo(scope: Scope, slot: number, promise: Promise<unknown>): number;
|
|
793
|
+
/**
|
|
794
|
+
* Computes a value of a render that can read a memo that is still loading, as an update does:
|
|
795
|
+
* the value is a promise that computes again once the memo settles, so what reads it waits.
|
|
796
|
+
* A second stop at the same wait is no wait for it, so it throws. A scope that goes, `owner`,
|
|
797
|
+
* computes nothing more. The scopes and the work that a stopped compute started are dropped.
|
|
798
|
+
*/
|
|
799
|
+
declare function pend(compute: () => unknown, owner?: Scope | ScopeId, last?: PromiseLike<unknown>): unknown;
|
|
782
800
|
/**
|
|
783
801
|
* `$resolve(memo, { timeout, signal })`: resolves with the value of the memo once it is no longer
|
|
784
802
|
* pending, also after a load that its inputs started. `isLoading` tells whether the memo or a
|
|
@@ -833,5 +851,5 @@ declare const loader: {
|
|
|
833
851
|
updateRoute: typeof updateRoute;
|
|
834
852
|
};
|
|
835
853
|
//#endregion
|
|
836
|
-
export {
|
|
837
|
-
//# sourceMappingURL=client-
|
|
854
|
+
export { setVar as $, Scope as $t, markBlock as A, forget as At, createScope as B, spread as Bt, branchNodes as C, fill as Cn, reveal as Ct, keep as D, reset as Dn, loadModule as Dt, fillList as E, rekey as En, fail as Et, setContent as F, removeRoot as Ft, setOwner as G, setGlobal as Gt, getScope as H, consumeContext as Ht, setOn as I, action as It, spreadProps as J, updateRoute as Jt, sink as K, storeUpdate as Kt, setSpread as L, handle as Lt, putText as M, leavePage as Mt, setAttr as N, leaveRoutes as Nt, keepText as O, retag as On, nameComment as Ot, setAttrText as P, remount as Pt, deferInBrowser as Q, DevtoolsHooks as Qt, template as R, handlerProp as Rt, appendText as S, branch as Sn, loading as St, fillBranch as T, offscreen as Tn, wait as Tt, makeId as U, consumeStore as Ut, descendants as V, submitAction as Vt, removeScope as W, provideValue as Wt, addPortal as X, CoreOptions as Xt, addHead as Y, ClientModule as Yt, addStyle as Z, DEVTOOLS as Zt, update as _, setSlots as _n, fillPend as _t, cells as a, Component as an, attrs as at, paramEffect as b, templateCall as bn, fillValue as bt, get as c, dynamic as cn, restRef as ct, pend as d, foreignNodes as dn, guess as dt, build as en, list as et, pending as f, memoNow as fn, track as ft, unreadMemo as g, setItem as gn, fillAttrs as gt, timed as h, renderMemo as hn, countLoads as ht, bindings as i, skew as in, attr as it, nodes as j, init as jt, listNodes as k, NavigationReport as kn, dispose as kt, isBound as l, dynamicNodes as ln, text as lt, set as m, readMemo as mn, attempt as mt, asyncMemo as n, rpcPrefix as nn, windowList as nt, effect as o, component as on, content as ot, resolve as p, place as pn, after as pt, prop as q, toStore as qt, binding as r, scopes as rn, windowStart as rt, gate as s, componentNodes as sn, portalTo as st, loader as t, hooks as tn, toList as tt, memo as u, elementAt as un, writeText as ut, updated as v, children as vn, fillSettled as vt, clone as w, held as wn, started as wt, searchParam as x, HiddenBody as xn, keepValue as xt, title as y, insert as yn, fillSpread as yt, afterInsert as z, rpc as zt };
|
|
855
|
+
//# sourceMappingURL=client-4eabQtYJ.d.ts.map
|
|
@@ -397,6 +397,7 @@ function removeScope(scope) {
|
|
|
397
397
|
}
|
|
398
398
|
if (scope.h) hiding?.bodies.delete(scope.h);
|
|
399
399
|
scopes.delete(scope.id);
|
|
400
|
+
scope.gone = true;
|
|
400
401
|
for (const [check, owner] of waiters) if (owner === scope) check();
|
|
401
402
|
scope.p?.children?.delete(scope);
|
|
402
403
|
scope.o?.owned?.delete(scope);
|
|
@@ -862,12 +863,12 @@ function templateReference(ref, scope) {
|
|
|
862
863
|
}
|
|
863
864
|
/**
|
|
864
865
|
* A call of a `#template` of the file, which an insert can update in place. `render` is the
|
|
865
|
-
* template's code, and `owner` the scope that holds the template. The call
|
|
866
|
-
*
|
|
867
|
-
*
|
|
866
|
+
* template's code, and `owner` the scope that holds the template. The call renders as children
|
|
867
|
+
* of its owner, where the component that gets it inserts it, so it reads the contexts there, as
|
|
868
|
+
* on the server.
|
|
868
869
|
*/
|
|
869
870
|
function templateCall(ref, owner, render, args) {
|
|
870
|
-
return new TemplateCall(ref, owner, args, (at) => insert(render(...args), void 0, at)
|
|
871
|
+
return new TemplateCall(ref, owner, args, (at) => insert(render(...args), void 0, at));
|
|
871
872
|
}
|
|
872
873
|
/** Renders a value inserted in markup. Children render here, at `scope`, for their contexts. */
|
|
873
874
|
function insert(value, _ctx, scope) {
|
|
@@ -937,8 +938,8 @@ var TemplateCall = class extends Children {
|
|
|
937
938
|
/** The scope of the component that wrote the template. */
|
|
938
939
|
owner;
|
|
939
940
|
args;
|
|
940
|
-
constructor(ref, owner, args, html
|
|
941
|
-
super(
|
|
941
|
+
constructor(ref, owner, args, html) {
|
|
942
|
+
super(owner, html);
|
|
942
943
|
this.ref = ref;
|
|
943
944
|
this.owner = owner;
|
|
944
945
|
this.args = args;
|
|
@@ -1115,9 +1116,14 @@ async function catchInto(owner, body, module, [, anchor, , fallback, kinds, hold
|
|
|
1115
1116
|
function get(scope, slot) {
|
|
1116
1117
|
if (dirty.size > 0 && !draining) settle(scope);
|
|
1117
1118
|
const value = scope.s[slot];
|
|
1118
|
-
if (value === void 0 && exempt > 0 && !(slot in scope.s)) throw new NotReady(
|
|
1119
|
+
if (value === void 0 && (exempt > 0 || reading > 0) && !(slot in scope.s)) throw new NotReady(unreached);
|
|
1119
1120
|
if (value instanceof Promise && !scope.plain?.has(slot)) {
|
|
1120
1121
|
if (computing > 0) throw new NotReady(value);
|
|
1122
|
+
if (reading > 0 && loadingValues.has(value)) {
|
|
1123
|
+
const result = memoResults.get(value);
|
|
1124
|
+
if (result) return result.value;
|
|
1125
|
+
throw new NotReady(value);
|
|
1126
|
+
}
|
|
1121
1127
|
if (loadingValues.has(value)) {
|
|
1122
1128
|
if (runningEffects > 0) throw new NotReady(value);
|
|
1123
1129
|
if (exempt === 0) throw new Error("This value is still loading. Wait for it with await $resolve(memo), or check $isPending(memo) first");
|
|
@@ -1370,6 +1376,41 @@ var NotReady = class extends Error {
|
|
|
1370
1376
|
this.source = source;
|
|
1371
1377
|
}
|
|
1372
1378
|
};
|
|
1379
|
+
/** The values of the promises of memos of a render that settled, which a read of the memo gives. */
|
|
1380
|
+
const memoResults = /* @__PURE__ */ new WeakMap();
|
|
1381
|
+
let reading = 0;
|
|
1382
|
+
function isReading() {
|
|
1383
|
+
return reading > 0;
|
|
1384
|
+
}
|
|
1385
|
+
const unreached = Promise.resolve();
|
|
1386
|
+
/**
|
|
1387
|
+
* Computes a value of a render that can read a memo that is still loading, as an update does:
|
|
1388
|
+
* the value is a promise that computes again once the memo settles, so what reads it waits.
|
|
1389
|
+
* A second stop at the same wait is no wait for it, so it throws. A scope that goes, `owner`,
|
|
1390
|
+
* computes nothing more. The scopes and the work that a stopped compute started are dropped.
|
|
1391
|
+
*/
|
|
1392
|
+
function pend(compute, owner, last) {
|
|
1393
|
+
const at = owner === void 0 || typeof owner === "object" ? owner : scopes.get(owner) ?? findRendered(owner);
|
|
1394
|
+
const made = rendered.length;
|
|
1395
|
+
const queued = afterInsert.length;
|
|
1396
|
+
reading++;
|
|
1397
|
+
try {
|
|
1398
|
+
return compute();
|
|
1399
|
+
} catch (error) {
|
|
1400
|
+
if (error instanceof NotReady && error.source !== last) {
|
|
1401
|
+
rendered.length = made;
|
|
1402
|
+
afterInsert.length = queued;
|
|
1403
|
+
const source = error.source;
|
|
1404
|
+
return Promise.resolve(source).then(() => at?.gone ? void 0 : pend(compute, at, source));
|
|
1405
|
+
}
|
|
1406
|
+
throw error;
|
|
1407
|
+
} finally {
|
|
1408
|
+
reading--;
|
|
1409
|
+
}
|
|
1410
|
+
}
|
|
1411
|
+
function findRendered(id) {
|
|
1412
|
+
return rendered.find((scope) => scope.id === id);
|
|
1413
|
+
}
|
|
1373
1414
|
let computing = 0;
|
|
1374
1415
|
let origin;
|
|
1375
1416
|
let viaContext = false;
|
|
@@ -2195,12 +2236,12 @@ function action(name, id, method, result) {
|
|
|
2195
2236
|
* call loads, so the core holds only this.
|
|
2196
2237
|
*/
|
|
2197
2238
|
function submitAction(form, submitter) {
|
|
2198
|
-
import("./rpc-
|
|
2239
|
+
import("./rpc-kVB0Ujdx.js").then((module) => module.sendAction(form, submitter));
|
|
2199
2240
|
}
|
|
2200
2241
|
/** Calls a server function. */
|
|
2201
2242
|
async function rpc(id, args) {
|
|
2202
2243
|
const signal = memoSignal();
|
|
2203
|
-
return track(import("./rpc-
|
|
2244
|
+
return track(import("./rpc-kVB0Ujdx.js").then((module) => module.call(rpcPrefix, id, args, signal)));
|
|
2204
2245
|
}
|
|
2205
2246
|
/** A function prop rendered on the client calls the parent's exported handler. */
|
|
2206
2247
|
function handlerProp(value, ref, scope, bound = [], modifiers) {
|
|
@@ -2912,6 +2953,7 @@ const memoLoads = /* @__PURE__ */ new WeakMap();
|
|
|
2912
2953
|
*/
|
|
2913
2954
|
function memoNow(value) {
|
|
2914
2955
|
if (isThenable(value) || isAsyncIterable(value)) memoLoads.set(value, (memoLoads.get(value) ?? 0) + 1);
|
|
2956
|
+
if (isThenable(value)) value.then((result) => memoResults.set(value, { value: result }), noop$1);
|
|
2915
2957
|
return value;
|
|
2916
2958
|
}
|
|
2917
2959
|
/**
|
|
@@ -2920,14 +2962,22 @@ function memoNow(value) {
|
|
|
2920
2962
|
*/
|
|
2921
2963
|
function renderMemo(compute) {
|
|
2922
2964
|
try {
|
|
2923
|
-
return memoNow(compute());
|
|
2965
|
+
return memoNow(pend(compute, rendered.at(-1)));
|
|
2924
2966
|
} catch (error) {
|
|
2925
2967
|
return new MemoError(error);
|
|
2926
2968
|
}
|
|
2927
2969
|
}
|
|
2928
|
-
/**
|
|
2970
|
+
/**
|
|
2971
|
+
* Reads a memo of a render: the error that a throw held is thrown at the read. A memo that is
|
|
2972
|
+
* still loading stops the code that reads it, which waits for the memo.
|
|
2973
|
+
*/
|
|
2929
2974
|
function readMemo(value) {
|
|
2930
2975
|
if (value instanceof MemoError) throw value.error;
|
|
2976
|
+
if (isThenable(value) && memoLoads.has(value)) {
|
|
2977
|
+
const result = memoResults.get(value);
|
|
2978
|
+
if (result) return result.value;
|
|
2979
|
+
if (isReading()) throw new NotReady(value);
|
|
2980
|
+
}
|
|
2931
2981
|
return value;
|
|
2932
2982
|
}
|
|
2933
2983
|
function setSlots(id, values) {
|
|
@@ -3131,7 +3181,7 @@ const writtenInserts = /* @__PURE__ */ new WeakSet();
|
|
|
3131
3181
|
function renderedTemplate(call, at, k, first, end) {
|
|
3132
3182
|
if (k === void 0) return;
|
|
3133
3183
|
let found;
|
|
3134
|
-
for (const scope of scopes.values()) if (call.owner && scope.p === call.owner && scope.k === k && (scope.t === at || scope.l === at && inRange(scope, first, end))
|
|
3184
|
+
for (const scope of scopes.values()) if (call.owner && scope.p === call.owner && scope.k === k && (scope.t === at || scope.l === at) && inRange(scope, first, end)) {
|
|
3135
3185
|
if (found) return;
|
|
3136
3186
|
found = scope;
|
|
3137
3187
|
}
|
|
@@ -3140,17 +3190,39 @@ function renderedTemplate(call, at, k, first, end) {
|
|
|
3140
3190
|
scope: found
|
|
3141
3191
|
};
|
|
3142
3192
|
}
|
|
3143
|
-
/**
|
|
3193
|
+
/**
|
|
3194
|
+
* True if the range holds markup of the scope or of a scope inside it: an anchor, a comment or an
|
|
3195
|
+
* element, or a kept node. A template that only renders a component has no anchor of its own, so
|
|
3196
|
+
* the anchors of the scopes it made count too.
|
|
3197
|
+
*/
|
|
3144
3198
|
function inRange(scope, first, end) {
|
|
3145
|
-
const
|
|
3146
|
-
const element = `${scope.id}:`;
|
|
3199
|
+
const kept = keptNodes(scope, []);
|
|
3147
3200
|
for (let node = first; node && node !== end; node = node.nextSibling) {
|
|
3148
3201
|
const walker = document.createTreeWalker(node, 129);
|
|
3149
|
-
for (let item = node; item; item = walker.nextNode())
|
|
3150
|
-
|
|
3202
|
+
for (let item = node; item; item = walker.nextNode()) {
|
|
3203
|
+
let id;
|
|
3204
|
+
if (item.nodeType === 8) {
|
|
3205
|
+
const data = item.data;
|
|
3206
|
+
id = MARKER.test(data) ? data.slice(1).split(":")[0] : void 0;
|
|
3207
|
+
} else if (item.nodeType === 1) id = item.getAttribute("b-b")?.split(":")[0];
|
|
3208
|
+
if (id !== void 0 && isInside(scopes.get(parseId(id)), scope)) return true;
|
|
3209
|
+
}
|
|
3210
|
+
for (const item of kept) if (item === node || node.contains(item)) return true;
|
|
3151
3211
|
}
|
|
3152
3212
|
return false;
|
|
3153
3213
|
}
|
|
3214
|
+
/** True if `found` is `scope` or a scope that it made, by its parents and owners. */
|
|
3215
|
+
function isInside(found, scope) {
|
|
3216
|
+
for (let current = found; current; current = current.p ?? current.o) if (current === scope) return true;
|
|
3217
|
+
return false;
|
|
3218
|
+
}
|
|
3219
|
+
/** Adds the nodes that the scope and the scopes inside it keep, of markup the browser cloned. */
|
|
3220
|
+
function keptNodes(scope, nodes) {
|
|
3221
|
+
for (const node of scope.n ?? []) if (node) nodes.push(node);
|
|
3222
|
+
for (const child of scope.children ?? []) keptNodes(child, nodes);
|
|
3223
|
+
for (const child of scope.owned ?? []) keptNodes(child, nodes);
|
|
3224
|
+
return nodes;
|
|
3225
|
+
}
|
|
3154
3226
|
/** The `value` and `checked` that updates last wrote to each field. */
|
|
3155
3227
|
const fieldValues = /* @__PURE__ */ new WeakMap();
|
|
3156
3228
|
function setAttribute(element, name, value, spread = false) {
|
|
@@ -3412,6 +3484,17 @@ function fillSettled(id, values, write) {
|
|
|
3412
3484
|
}, (error) => failOnce(scope, own, error));
|
|
3413
3485
|
}
|
|
3414
3486
|
/**
|
|
3487
|
+
* A write of cloned markup whose values come from code that can read a memo that is still
|
|
3488
|
+
* loading, such as a block header or a prop that calls a function. The write waits for the memo,
|
|
3489
|
+
* and runs again with its value. It counts in the boundary of the render, as `fillSettled` does.
|
|
3490
|
+
*/
|
|
3491
|
+
function fillPend(id, write) {
|
|
3492
|
+
const waiting = pend(() => {
|
|
3493
|
+
write();
|
|
3494
|
+
}, id);
|
|
3495
|
+
if (isThenable(waiting)) fillSettled(id, [waiting], noop$1);
|
|
3496
|
+
}
|
|
3497
|
+
/**
|
|
3415
3498
|
* A value of markup that the browser writes, in text or an attribute, which can be a promise.
|
|
3416
3499
|
* A value that is not one is written at once. A promise counts in the boundary of the render, as
|
|
3417
3500
|
* a memo of `fillSettled` does, and `write` gets its value once it settles. The scope keeps the
|
|
@@ -4656,6 +4739,6 @@ const loader = {
|
|
|
4656
4739
|
};
|
|
4657
4740
|
function noop() {}
|
|
4658
4741
|
//#endregion
|
|
4659
|
-
export {
|
|
4742
|
+
export { setSlots as $, unreadMemo as $t, reveal as A, guess as At, prop as B, binding as Bt, fillAttrs as C, removeRoot as Ct, fillValue as D, rpc as Dt, fillSpread as E, handlerProp as Et, content as F, setGlobal as Ft, dynamicNodes as G, get as Gt, component as H, cells as Ht, portalTo as I, storeUpdate as It, memoNow as J, pend as Jt, elementAt as K, isBound as Kt, restRef as L, toStore as Lt, wait as M, consumeContext as Mt, attr as N, consumeStore as Nt, keepValue as O, spread as Ot, attrs as P, provideValue as Pt, setItem as Q, timed as Qt, text as R, updateRoute as Rt, countLoads as S, skew as Sn, remount as St, fillSettled as T, handle as Tt, componentNodes as U, effect as Ut, spreadProps as V, bindings as Vt, dynamic as W, gate as Wt, readMemo as X, resolve as Xt, place as Y, pending as Yt, renderMemo as Z, set as Zt, rekey as _, DEVTOOLS as _n, dispose as _t, addPortal as a, templateCall as an, keep as at, after as b, rpcPrefix as bn, leavePage as bt, setVar as c, createScope as cn, markBlock as ct, windowList as d, makeId as dn, setAttr as dt, update as en, appendText as et, windowStart as f, removeScope as fn, setAttrText as ft, offscreen as g, loadModule as gn, template as gt, held as h, nameComment as hn, setSpread as ht, addHead as i, insert as in, fillList as it, started as j, track as jt, loading as k, submitAction as kt, list as l, descendants as ln, nodes as lt, fill as m, sink as mn, setOn as mt, paramEffect as n, fail as nn, clone as nt, addStyle as o, title as on, keepText as ot, branch as p, setOwner as pn, setContent as pt, foreignNodes as q, memo as qt, searchParam as r, children as rn, fillBranch as rt, deferInBrowser as s, afterInsert as sn, listNodes as st, loader as t, updated as tn, branchNodes as tt, toList as u, getScope as un, putText as ut, reset as v, build as vn, forget as vt, fillPend as w, action as wt, attempt as x, scopes as xn, leaveRoutes as xt, retag as y, hooks as yn, init as yt, writeText as z, asyncMemo as zt };
|
|
4660
4743
|
|
|
4661
|
-
//# sourceMappingURL=client-
|
|
4744
|
+
//# sourceMappingURL=client-CwVcmymi.js.map
|