sibujs 4.14.0 → 4.15.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/browser.cjs +297 -45
- package/dist/browser.js +6 -7
- package/dist/build.cjs +2189 -573
- package/dist/build.js +16 -15
- package/dist/cdn.dev.global.js +13 -12
- package/dist/cdn.full.dev.global.js +14 -13
- package/dist/cdn.full.global.js +12 -12
- package/dist/cdn.global.js +12 -12
- package/dist/{chunk-RVR5NPFL.js → chunk-2VKTFA7C.js} +1 -1
- package/dist/{chunk-7ILEHTVX.js → chunk-4AEFGRYW.js} +1 -1
- package/dist/{chunk-4TQDTWWN.js → chunk-6IV5ZRG6.js} +5 -7
- package/dist/{chunk-GVAMIU6K.js → chunk-75EAQH3U.js} +2 -2
- package/dist/{chunk-TLS4NVIB.js → chunk-7JO7DPSS.js} +4 -4
- package/dist/{chunk-SVULV7O4.js → chunk-AQH7WDSE.js} +6 -8
- package/dist/{chunk-S37PZD6I.js → chunk-BF3WBJJQ.js} +60 -10
- package/dist/{chunk-LJMX4SQ7.js → chunk-BG4BP44S.js} +3 -3
- package/dist/{chunk-N7A6FKWW.js → chunk-D44TAGCT.js} +2 -2
- package/dist/{chunk-CCKUNHVU.js → chunk-DAEXQJQA.js} +1 -1
- package/dist/chunk-DNCQDFJJ.js +22 -0
- package/dist/{chunk-BKZ5N6NK.js → chunk-DNCT2UXB.js} +4 -4
- package/dist/{chunk-BOYKGGVD.js → chunk-DRWOD7RZ.js} +4 -4
- package/dist/chunk-DS5V2PRE.js +64 -0
- package/dist/{chunk-VM2U5LEL.js → chunk-EHSJESRN.js} +595 -123
- package/dist/{chunk-MIRKTVH4.js → chunk-GFM5WWPU.js} +252 -5
- package/dist/{chunk-52XFPGSN.js → chunk-HTPOIAAL.js} +1 -1
- package/dist/{chunk-3HEX6QJQ.js → chunk-I2R5QALY.js} +2 -4
- package/dist/{chunk-4FJSAUKB.js → chunk-IUBV5WO5.js} +1 -1
- package/dist/{chunk-A454RAEK.js → chunk-KIDETDMU.js} +5 -7
- package/dist/{chunk-JTFQ7IL4.js → chunk-KPAXG5IR.js} +7 -9
- package/dist/{chunk-AE32RGWX.js → chunk-LGUXYHTZ.js} +3 -3
- package/dist/{chunk-Y4LUM2XS.js → chunk-LQWLPQOK.js} +6 -8
- package/dist/{chunk-CNPT6NKV.js → chunk-MINLMJUY.js} +48 -9
- package/dist/{chunk-BNXRWZZV.js → chunk-OURTGOJT.js} +8 -10
- package/dist/{chunk-F67F77IA.js → chunk-TQ24Y3IV.js} +2 -2
- package/dist/{chunk-2TTRW2TE.js → chunk-UM3M5PXS.js} +8 -8
- package/dist/{chunk-CJ7KS3DF.js → chunk-VSTX3XSX.js} +205 -15
- package/dist/{chunk-HQIAL7F2.js → chunk-XPDZ2LDR.js} +2 -2
- package/dist/{chunk-UUIKJJIK.js → chunk-Y7JM7GY2.js} +5 -7
- package/dist/{chunk-QS6GMWDD.js → chunk-YAFITBOK.js} +1269 -162
- package/dist/data.cjs +285 -33
- package/dist/data.js +6 -7
- package/dist/devtools.cjs +289 -39
- package/dist/devtools.js +5 -6
- package/dist/{dispose-EIHHHDC7.js → dispose-3WDBYJMH.js} +3 -1
- package/dist/ecosystem.cjs +345 -61
- package/dist/ecosystem.d.cts +1 -1
- package/dist/ecosystem.d.ts +1 -1
- package/dist/ecosystem.js +10 -10
- package/dist/extras.cjs +568 -248
- package/dist/extras.d.cts +1 -1
- package/dist/extras.d.ts +1 -1
- package/dist/extras.js +27 -27
- package/dist/index.cjs +2134 -515
- package/dist/index.d.cts +628 -211
- package/dist/index.d.ts +628 -211
- package/dist/index.js +22 -15
- package/dist/motion.cjs +286 -30
- package/dist/motion.js +4 -4
- package/dist/patterns.cjs +301 -43
- package/dist/patterns.js +6 -6
- package/dist/performance.cjs +286 -36
- package/dist/performance.js +9 -9
- package/dist/plugins.cjs +1237 -291
- package/dist/plugins.d.cts +3 -1
- package/dist/plugins.d.ts +3 -1
- package/dist/plugins.js +20 -19
- package/dist/{renderRoute-fxgsm2Ir.d.ts → renderRoute-B84MONaO.d.cts} +2 -2
- package/dist/{renderRoute-DP20XwMS.d.cts → renderRoute-_yxPuEQY.d.ts} +2 -2
- package/dist/{routeHead-CE9SV-cH.d.cts → routeHead-DLxlq15W.d.cts} +94 -0
- package/dist/{routeHead-DzVxPviY.d.ts → routeHead-w8nANZ3M.d.ts} +94 -0
- package/dist/{ssr-NECEU4X4.js → ssr-EF3IUHTE.js} +6 -6
- package/dist/ssr-dom.cjs +64 -9
- package/dist/ssr-dom.d.cts +2 -0
- package/dist/ssr-dom.d.ts +2 -0
- package/dist/ssr-dom.js +2 -1
- package/dist/ssr.cjs +850 -170
- package/dist/ssr.d.cts +5 -3
- package/dist/ssr.d.ts +5 -3
- package/dist/ssr.js +16 -15
- package/dist/{tagFactory-DkytnJws.d.cts → tagFactory-BfEh69VF.d.cts} +7 -0
- package/dist/{tagFactory-Bnd_Nph9.d.ts → tagFactory-pSYiLYyh.d.ts} +7 -0
- package/dist/testing.cjs +817 -132
- package/dist/testing.d.cts +4 -2
- package/dist/testing.d.ts +4 -2
- package/dist/testing.js +18 -17
- package/dist/track-core-0edROAF5.d.ts +187 -0
- package/dist/track-core-DN5fYLWi.d.cts +187 -0
- package/dist/ui.cjs +293 -43
- package/dist/ui.js +10 -12
- package/dist/widgets.cjs +285 -27
- package/dist/widgets.js +7 -7
- package/package.json +1 -1
- package/dist/chunk-7ZHH77QA.js +0 -9
|
@@ -1,15 +1,13 @@
|
|
|
1
1
|
import {
|
|
2
2
|
renderToString
|
|
3
|
-
} from "./chunk-
|
|
4
|
-
import {
|
|
5
|
-
globalSingleton
|
|
6
|
-
} from "./chunk-7ZHH77QA.js";
|
|
3
|
+
} from "./chunk-DRWOD7RZ.js";
|
|
7
4
|
import {
|
|
8
5
|
sanitizeUrl
|
|
9
6
|
} from "./chunk-B3HOT4TK.js";
|
|
10
7
|
import {
|
|
8
|
+
globalSingleton,
|
|
11
9
|
reportError
|
|
12
|
-
} from "./chunk-
|
|
10
|
+
} from "./chunk-BF3WBJJQ.js";
|
|
13
11
|
|
|
14
12
|
// src/plugins/modular.ts
|
|
15
13
|
function createModuleRegistry() {
|
|
@@ -171,7 +169,7 @@ var CDN_ENTRY_POINTS = {
|
|
|
171
169
|
};
|
|
172
170
|
var packageInfo = {
|
|
173
171
|
name: "sibujs",
|
|
174
|
-
version: true ? "4.
|
|
172
|
+
version: true ? "4.15.0" : "dev",
|
|
175
173
|
entryPoints: MODULE_ENTRY_POINTS,
|
|
176
174
|
/**
|
|
177
175
|
* Generate the package.json `exports` map. Module entries resolve to the
|
|
@@ -316,7 +314,7 @@ var env = {
|
|
|
316
314
|
};
|
|
317
315
|
|
|
318
316
|
// src/plugins/versioning.ts
|
|
319
|
-
var VERSION = true ? "4.
|
|
317
|
+
var VERSION = true ? "4.15.0" : "dev";
|
|
320
318
|
var NUM = "(?:0|[1-9]\\d*)";
|
|
321
319
|
var PRE_ID = `(?:${NUM}|\\d*[a-zA-Z-][0-9a-zA-Z-]*)`;
|
|
322
320
|
var BUILD_ID = "[0-9a-zA-Z-]+";
|
|
@@ -2,13 +2,13 @@ import {
|
|
|
2
2
|
Route,
|
|
3
3
|
createRouter,
|
|
4
4
|
route
|
|
5
|
-
} from "./chunk-
|
|
5
|
+
} from "./chunk-EHSJESRN.js";
|
|
6
6
|
import {
|
|
7
7
|
DEFAULT_SETTLE_TIMEOUT,
|
|
8
8
|
assembleDocument,
|
|
9
9
|
collectServerHead,
|
|
10
10
|
renderToStringAsync
|
|
11
|
-
} from "./chunk-
|
|
11
|
+
} from "./chunk-DRWOD7RZ.js";
|
|
12
12
|
import {
|
|
13
13
|
assertRequestIsolation,
|
|
14
14
|
getRequestStore,
|
|
@@ -4,22 +4,22 @@ import {
|
|
|
4
4
|
} from "./chunk-N5TBYXHW.js";
|
|
5
5
|
import {
|
|
6
6
|
watch
|
|
7
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-2VKTFA7C.js";
|
|
8
8
|
import {
|
|
9
9
|
createId,
|
|
10
10
|
domBinding,
|
|
11
11
|
idSegment
|
|
12
|
-
} from "./chunk-
|
|
12
|
+
} from "./chunk-DAEXQJQA.js";
|
|
13
13
|
import {
|
|
14
14
|
derived
|
|
15
|
-
} from "./chunk-
|
|
15
|
+
} from "./chunk-D44TAGCT.js";
|
|
16
16
|
import {
|
|
17
17
|
stripHtml
|
|
18
18
|
} from "./chunk-B3HOT4TK.js";
|
|
19
19
|
import {
|
|
20
20
|
batch,
|
|
21
21
|
signal
|
|
22
|
-
} from "./chunk-
|
|
22
|
+
} from "./chunk-IUBV5WO5.js";
|
|
23
23
|
|
|
24
24
|
// src/widgets/Combobox.ts
|
|
25
25
|
var boundComboboxes = /* @__PURE__ */ new WeakMap();
|
|
@@ -5,13 +5,10 @@ import {
|
|
|
5
5
|
} from "./chunk-3HZOSMPX.js";
|
|
6
6
|
import {
|
|
7
7
|
derived
|
|
8
|
-
} from "./chunk-
|
|
9
|
-
import {
|
|
10
|
-
globalSingleton
|
|
11
|
-
} from "./chunk-7ZHH77QA.js";
|
|
8
|
+
} from "./chunk-D44TAGCT.js";
|
|
12
9
|
import {
|
|
13
10
|
effect
|
|
14
|
-
} from "./chunk-
|
|
11
|
+
} from "./chunk-LGUXYHTZ.js";
|
|
15
12
|
import {
|
|
16
13
|
sanitizeUrl
|
|
17
14
|
} from "./chunk-B3HOT4TK.js";
|
|
@@ -24,13 +21,14 @@ import {
|
|
|
24
21
|
import {
|
|
25
22
|
batch,
|
|
26
23
|
signal
|
|
27
|
-
} from "./chunk-
|
|
24
|
+
} from "./chunk-IUBV5WO5.js";
|
|
28
25
|
import {
|
|
29
26
|
untracked
|
|
30
|
-
} from "./chunk-
|
|
27
|
+
} from "./chunk-GFM5WWPU.js";
|
|
31
28
|
import {
|
|
29
|
+
globalSingleton,
|
|
32
30
|
reportError
|
|
33
|
-
} from "./chunk-
|
|
31
|
+
} from "./chunk-BF3WBJJQ.js";
|
|
34
32
|
|
|
35
33
|
// src/data/abort.ts
|
|
36
34
|
function isAbortError(error) {
|
|
@@ -4,6 +4,12 @@ import {
|
|
|
4
4
|
isHydrating
|
|
5
5
|
} from "./chunk-NT3ZYB5S.js";
|
|
6
6
|
|
|
7
|
+
// src/utils/globalSingleton.ts
|
|
8
|
+
function globalSingleton(key, create) {
|
|
9
|
+
const g = globalThis;
|
|
10
|
+
return g[key] ?? (g[key] = create());
|
|
11
|
+
}
|
|
12
|
+
|
|
7
13
|
// src/core/errors.ts
|
|
8
14
|
var ERROR_STATE_KEY = /* @__PURE__ */ Symbol.for("sibujs.runtime-errors.v1");
|
|
9
15
|
function state() {
|
|
@@ -113,7 +119,12 @@ function reportError(error, context) {
|
|
|
113
119
|
}
|
|
114
120
|
|
|
115
121
|
// src/core/rendering/dispose.ts
|
|
116
|
-
var
|
|
122
|
+
var state2 = globalSingleton(/* @__PURE__ */ Symbol.for("sibujs.disposers.v1"), () => ({
|
|
123
|
+
disposers: /* @__PURE__ */ new WeakMap(),
|
|
124
|
+
captures: [],
|
|
125
|
+
bindings: { count: 0 }
|
|
126
|
+
}));
|
|
127
|
+
var elementDisposers = state2.disposers;
|
|
117
128
|
var MAX_DRAIN_TEARDOWNS = 1e4;
|
|
118
129
|
function reportDrainRunaway(label, executed, remaining) {
|
|
119
130
|
if (typeof console === "undefined") return;
|
|
@@ -122,13 +133,13 @@ function reportDrainRunaway(label, executed, remaining) {
|
|
|
122
133
|
{ executed, remaining }
|
|
123
134
|
);
|
|
124
135
|
}
|
|
125
|
-
var
|
|
136
|
+
var bindings = state2.bindings;
|
|
126
137
|
function resolveCapture(capture) {
|
|
127
138
|
let frame = capture;
|
|
128
139
|
while (frame?.closed) frame = frame.forwardTo;
|
|
129
140
|
return frame ?? null;
|
|
130
141
|
}
|
|
131
|
-
var registrationCaptures =
|
|
142
|
+
var registrationCaptures = state2.captures;
|
|
132
143
|
function currentDisposerCapture() {
|
|
133
144
|
return resolveCapture(registrationCaptures[registrationCaptures.length - 1]);
|
|
134
145
|
}
|
|
@@ -147,7 +158,7 @@ function registerDisposer(node, teardown) {
|
|
|
147
158
|
elementDisposers.set(node, disposers);
|
|
148
159
|
}
|
|
149
160
|
disposers.push(teardown);
|
|
150
|
-
if (DEV)
|
|
161
|
+
if (DEV) bindings.count++;
|
|
151
162
|
const capture = resolveCapture(registrationCaptures[registrationCaptures.length - 1]);
|
|
152
163
|
if (capture) capture.entries.push([node, teardown]);
|
|
153
164
|
}
|
|
@@ -200,7 +211,7 @@ function unregisterDisposer(node, teardown) {
|
|
|
200
211
|
const index = disposers.indexOf(teardown);
|
|
201
212
|
if (index === -1) return false;
|
|
202
213
|
disposers.splice(index, 1);
|
|
203
|
-
if (DEV)
|
|
214
|
+
if (DEV) bindings.count--;
|
|
204
215
|
if (disposers.length === 0) elementDisposers.delete(node);
|
|
205
216
|
return true;
|
|
206
217
|
}
|
|
@@ -228,13 +239,13 @@ function disposeNodeOwn(node) {
|
|
|
228
239
|
if (!pending || pending.length === 0) break;
|
|
229
240
|
const snapshot = pending.slice();
|
|
230
241
|
elementDisposers.delete(node);
|
|
231
|
-
if (DEV)
|
|
242
|
+
if (DEV) bindings.count -= snapshot.length;
|
|
232
243
|
for (let i = 0; i < snapshot.length; i++) {
|
|
233
244
|
if (executed >= MAX_DRAIN_TEARDOWNS) {
|
|
234
245
|
const rest = snapshot.slice(i);
|
|
235
246
|
const added = elementDisposers.get(node);
|
|
236
247
|
elementDisposers.set(node, added ? rest.concat(added) : rest);
|
|
237
|
-
if (DEV)
|
|
248
|
+
if (DEV) bindings.count += rest.length;
|
|
238
249
|
reportDrainRunaway("dispose", executed, rest.length + (added?.length ?? 0));
|
|
239
250
|
runaway = true;
|
|
240
251
|
break;
|
|
@@ -273,14 +284,51 @@ function replaceChildrenSafely(parent, ...next) {
|
|
|
273
284
|
}
|
|
274
285
|
parent.replaceChildren(...next);
|
|
275
286
|
}
|
|
287
|
+
function stageReplaceChildren(parent, next) {
|
|
288
|
+
const done = /* @__PURE__ */ new Set();
|
|
289
|
+
const adopted = () => {
|
|
290
|
+
if (!isHydrating() || next.length === 0 || next[0] !== parent.firstChild) return false;
|
|
291
|
+
for (let i = 1; i < next.length; i++) if (next[i - 1].nextSibling !== next[i]) return false;
|
|
292
|
+
return true;
|
|
293
|
+
};
|
|
294
|
+
const outgoing = () => {
|
|
295
|
+
if (adopted()) {
|
|
296
|
+
const out = [];
|
|
297
|
+
for (let n = next[next.length - 1].nextSibling; n !== null; n = n.nextSibling) out.push(n);
|
|
298
|
+
return out;
|
|
299
|
+
}
|
|
300
|
+
for (let i = 0; i < next.length; i++) next[i].parentNode?.removeChild(next[i]);
|
|
301
|
+
return Array.from(parent.childNodes);
|
|
302
|
+
};
|
|
303
|
+
return {
|
|
304
|
+
teardown: () => {
|
|
305
|
+
let ran = false;
|
|
306
|
+
for (const node of outgoing()) {
|
|
307
|
+
if (done.has(node)) continue;
|
|
308
|
+
done.add(node);
|
|
309
|
+
ran = true;
|
|
310
|
+
dispose(node);
|
|
311
|
+
}
|
|
312
|
+
return ran;
|
|
313
|
+
},
|
|
314
|
+
insert: () => {
|
|
315
|
+
if (!adopted()) {
|
|
316
|
+
parent.replaceChildren(...next);
|
|
317
|
+
return;
|
|
318
|
+
}
|
|
319
|
+
const last = next[next.length - 1];
|
|
320
|
+
while (last.nextSibling) parent.removeChild(last.nextSibling);
|
|
321
|
+
}
|
|
322
|
+
};
|
|
323
|
+
}
|
|
276
324
|
function checkLeaks(warnThreshold = 0) {
|
|
277
325
|
if (!DEV) return 0;
|
|
278
|
-
if (warnThreshold > 0 &&
|
|
326
|
+
if (warnThreshold > 0 && bindings.count > warnThreshold) {
|
|
279
327
|
devWarn(
|
|
280
|
-
`checkLeaks: ${
|
|
328
|
+
`checkLeaks: ${bindings.count} active DOM bindings detected. Expected \u2264${warnThreshold}. This may indicate a component was removed from the DOM without calling dispose().`
|
|
281
329
|
);
|
|
282
330
|
}
|
|
283
|
-
return
|
|
331
|
+
return bindings.count;
|
|
284
332
|
}
|
|
285
333
|
|
|
286
334
|
export {
|
|
@@ -288,6 +336,7 @@ export {
|
|
|
288
336
|
getRuntimeErrorHandler,
|
|
289
337
|
normalizeError,
|
|
290
338
|
reportError,
|
|
339
|
+
globalSingleton,
|
|
291
340
|
MAX_DRAIN_TEARDOWNS,
|
|
292
341
|
reportDrainRunaway,
|
|
293
342
|
currentDisposerCapture,
|
|
@@ -299,5 +348,6 @@ export {
|
|
|
299
348
|
dispose,
|
|
300
349
|
disposeNodeOwn,
|
|
301
350
|
replaceChildrenSafely,
|
|
351
|
+
stageReplaceChildren,
|
|
302
352
|
checkLeaks
|
|
303
353
|
};
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import {
|
|
2
|
-
globalSingleton
|
|
3
|
-
} from "./chunk-7ZHH77QA.js";
|
|
4
1
|
import {
|
|
5
2
|
sanitizeUrl
|
|
6
3
|
} from "./chunk-B3HOT4TK.js";
|
|
7
4
|
import {
|
|
8
5
|
getRequestStore
|
|
9
6
|
} from "./chunk-UYTYNCMZ.js";
|
|
7
|
+
import {
|
|
8
|
+
globalSingleton
|
|
9
|
+
} from "./chunk-BF3WBJJQ.js";
|
|
10
10
|
|
|
11
11
|
// src/utils/embedPolicy.ts
|
|
12
12
|
var state = globalSingleton(/* @__PURE__ */ Symbol.for("sibujs.embed.v2"), () => ({
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import {
|
|
2
2
|
emitDevtools
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-IUBV5WO5.js";
|
|
4
4
|
import {
|
|
5
5
|
cleanup,
|
|
6
6
|
isTrackingSuspended,
|
|
7
7
|
recordDependency,
|
|
8
8
|
retrack,
|
|
9
9
|
track
|
|
10
|
-
} from "./chunk-
|
|
10
|
+
} from "./chunk-GFM5WWPU.js";
|
|
11
11
|
import {
|
|
12
12
|
devAssert
|
|
13
13
|
} from "./chunk-NT3ZYB5S.js";
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
// src/utils/styleKey.ts
|
|
2
|
+
var EXCEPTIONS = { cssFloat: "float" };
|
|
3
|
+
var VENDOR_PREFIX = /^(webkit|moz|ms|o)-/;
|
|
4
|
+
var cache = /* @__PURE__ */ new Map();
|
|
5
|
+
var CACHE_MAX = 1e3;
|
|
6
|
+
function styleKeyToProperty(key) {
|
|
7
|
+
let name = cache.get(key);
|
|
8
|
+
if (name !== void 0) return name;
|
|
9
|
+
if (key.startsWith("--")) name = key;
|
|
10
|
+
else if (Object.hasOwn(EXCEPTIONS, key)) name = EXCEPTIONS[key];
|
|
11
|
+
else {
|
|
12
|
+
name = key.replace(/[A-Z]/g, (m) => `-${m.toLowerCase()}`);
|
|
13
|
+
if (VENDOR_PREFIX.test(name)) name = `-${name}`;
|
|
14
|
+
}
|
|
15
|
+
if (cache.size >= CACHE_MAX) cache.clear();
|
|
16
|
+
cache.set(key, name);
|
|
17
|
+
return name;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
export {
|
|
21
|
+
styleKeyToProperty
|
|
22
|
+
};
|
|
@@ -4,17 +4,17 @@ import {
|
|
|
4
4
|
} from "./chunk-62BDYGAG.js";
|
|
5
5
|
import {
|
|
6
6
|
derived
|
|
7
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-D44TAGCT.js";
|
|
8
8
|
import {
|
|
9
9
|
effect
|
|
10
|
-
} from "./chunk-
|
|
10
|
+
} from "./chunk-LGUXYHTZ.js";
|
|
11
11
|
import {
|
|
12
12
|
batch,
|
|
13
13
|
signal
|
|
14
|
-
} from "./chunk-
|
|
14
|
+
} from "./chunk-IUBV5WO5.js";
|
|
15
15
|
import {
|
|
16
16
|
reportError
|
|
17
|
-
} from "./chunk-
|
|
17
|
+
} from "./chunk-BF3WBJJQ.js";
|
|
18
18
|
import {
|
|
19
19
|
DEV,
|
|
20
20
|
devWarn
|
|
@@ -2,12 +2,12 @@ import {
|
|
|
2
2
|
ensureServerDom,
|
|
3
3
|
explainServerError,
|
|
4
4
|
watchBrowserApis
|
|
5
|
-
} from "./chunk-
|
|
5
|
+
} from "./chunk-MINLMJUY.js";
|
|
6
6
|
import {
|
|
7
7
|
embedSerializationTail,
|
|
8
8
|
embedSerializedAttribute,
|
|
9
9
|
getEmbedRecord
|
|
10
|
-
} from "./chunk-
|
|
10
|
+
} from "./chunk-BG4BP44S.js";
|
|
11
11
|
import {
|
|
12
12
|
collectTransfer
|
|
13
13
|
} from "./chunk-3HZOSMPX.js";
|
|
@@ -40,11 +40,11 @@ import {
|
|
|
40
40
|
} from "./chunk-UYTYNCMZ.js";
|
|
41
41
|
import {
|
|
42
42
|
untracked
|
|
43
|
-
} from "./chunk-
|
|
43
|
+
} from "./chunk-GFM5WWPU.js";
|
|
44
44
|
import {
|
|
45
45
|
dispose,
|
|
46
46
|
replaceChildrenSafely
|
|
47
|
-
} from "./chunk-
|
|
47
|
+
} from "./chunk-BF3WBJJQ.js";
|
|
48
48
|
import {
|
|
49
49
|
DEV,
|
|
50
50
|
beginHydration,
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
import {
|
|
2
|
+
holdSubtree
|
|
3
|
+
} from "./chunk-GFM5WWPU.js";
|
|
4
|
+
|
|
5
|
+
// src/core/rendering/heldCommit.ts
|
|
6
|
+
var NOOP = () => {
|
|
7
|
+
};
|
|
8
|
+
function commitWhenActive(slot, c) {
|
|
9
|
+
let over = false;
|
|
10
|
+
let unhold = null;
|
|
11
|
+
let drop = NOOP;
|
|
12
|
+
const finish = () => {
|
|
13
|
+
over = true;
|
|
14
|
+
if (slot.cancel === cancel) slot.cancel = NOOP;
|
|
15
|
+
drop();
|
|
16
|
+
drop = NOOP;
|
|
17
|
+
};
|
|
18
|
+
const cancel = () => {
|
|
19
|
+
if (over) return;
|
|
20
|
+
finish();
|
|
21
|
+
const release = unhold;
|
|
22
|
+
unhold = null;
|
|
23
|
+
try {
|
|
24
|
+
c.discard();
|
|
25
|
+
} finally {
|
|
26
|
+
release?.();
|
|
27
|
+
}
|
|
28
|
+
};
|
|
29
|
+
const attempt = () => {
|
|
30
|
+
drop = NOOP;
|
|
31
|
+
let clean = false;
|
|
32
|
+
while (!over) {
|
|
33
|
+
const state = c.held.state();
|
|
34
|
+
if (state === 2 || c.owned !== void 0 && !c.owned()) {
|
|
35
|
+
cancel();
|
|
36
|
+
return;
|
|
37
|
+
}
|
|
38
|
+
if (state === 1) {
|
|
39
|
+
if (c.node !== null && unhold === null) unhold = holdSubtree(c.node);
|
|
40
|
+
drop = c.held.wait(attempt, attempt);
|
|
41
|
+
return;
|
|
42
|
+
}
|
|
43
|
+
if (unhold !== null) {
|
|
44
|
+
const release = unhold;
|
|
45
|
+
unhold = null;
|
|
46
|
+
release();
|
|
47
|
+
continue;
|
|
48
|
+
}
|
|
49
|
+
if (!clean) {
|
|
50
|
+
clean = c.teardown?.() !== true;
|
|
51
|
+
continue;
|
|
52
|
+
}
|
|
53
|
+
finish();
|
|
54
|
+
c.insert();
|
|
55
|
+
return;
|
|
56
|
+
}
|
|
57
|
+
};
|
|
58
|
+
slot.cancel = cancel;
|
|
59
|
+
attempt();
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
export {
|
|
63
|
+
commitWhenActive
|
|
64
|
+
};
|