@vobs/transition 1.2.1 → 1.2.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,535 +1,37 @@
1
- 'use strict';
2
-
1
+ var __VOBS_CJS_FILE_URL = require("url").pathToFileURL(__filename).href;
2
+ "use strict";
3
3
  var __defProp = Object.defineProperty;
4
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
5
+ var __getOwnPropNames = Object.getOwnPropertyNames;
6
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
4
7
  var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
5
-
6
- // packages/reactivity/src/debug.ts
7
- var activeDebugHooks = null;
8
- var signalNames = /* @__PURE__ */ new WeakMap();
9
- function hasDebugHooks() {
10
- return activeDebugHooks !== null;
11
- }
12
- __name(hasDebugHooks, "hasDebugHooks");
13
- function setSignalDebugName(signal, name) {
14
- signalNames.set(signal, name);
15
- invokeDebug("signalNamed", signal, name);
16
- }
17
- __name(setSignalDebugName, "setSignalDebugName");
18
- function invokeDebug(name, ...args) {
19
- return;
20
- }
21
- __name(invokeDebug, "invokeDebug");
22
-
23
- // packages/reactivity/src/owner.ts
24
- var currentOwner = null;
25
- var nextOwnerId = 1;
26
- var ownerNames = /* @__PURE__ */ new WeakMap();
27
- function createOwner() {
28
- const parent = currentOwner;
29
- let disposed = parent?.disposed ?? false;
30
- const children = [];
31
- const cleanups = [];
32
- const errorHandlers = /* @__PURE__ */ new Set();
33
- const owner = {
34
- id: `owner-${nextOwnerId++}`,
35
- parent,
36
- children,
37
- depth: (parent?.depth ?? -1) + 1,
38
- get disposed() {
39
- return disposed;
40
- },
41
- run(fn) {
42
- if (disposed) throw new Error("Vobs: \u5DF2\u9500\u6BC1\u7684 Owner \u4E0D\u80FD\u7EE7\u7EED\u8FD0\u884C");
43
- const previous = currentOwner;
44
- currentOwner = owner;
45
- try {
46
- return fn();
47
- } finally {
48
- currentOwner = previous;
49
- }
50
- },
51
- addCleanup(cleanup) {
52
- if (disposed) {
53
- cleanup();
54
- return;
55
- }
56
- cleanups.push(cleanup);
57
- },
58
- onDispose(cleanup) {
59
- owner.addCleanup(cleanup);
60
- },
61
- onError(handler) {
62
- errorHandlers.add(handler);
63
- const remove = /* @__PURE__ */ __name(() => errorHandlers.delete(handler), "remove");
64
- owner.addCleanup(remove);
65
- return remove;
66
- },
67
- handleError(error) {
68
- for (const handler of [...errorHandlers].reverse()) {
69
- try {
70
- handler(error);
71
- return true;
72
- } catch (handlerError) {
73
- return parent?.handleError(handlerError) ?? false;
74
- }
75
- }
76
- return parent?.handleError(error) ?? false;
77
- },
78
- dispose() {
79
- if (disposed) return;
80
- disposed = true;
81
- for (const child of [...children]) child.dispose();
82
- children.length = 0;
83
- let firstError;
84
- for (let index = cleanups.length - 1; index >= 0; index--) {
85
- try {
86
- cleanups[index]();
87
- } catch (error) {
88
- firstError ?? (firstError = error);
89
- }
90
- }
91
- cleanups.length = 0;
92
- if (parent) {
93
- const index = parent.children.indexOf(owner);
94
- if (index >= 0) parent.children.splice(index, 1);
95
- }
96
- if (firstError) throw firstError;
97
- }
98
- };
99
- if (parent && !parent.disposed) parent.children.push(owner);
100
- return owner;
101
- }
102
- __name(createOwner, "createOwner");
103
- function setOwnerDebugName(owner, name) {
104
- ownerNames.set(owner, name);
105
- }
106
- __name(setOwnerDebugName, "setOwnerDebugName");
107
- function getCurrentOwner() {
108
- return currentOwner;
109
- }
110
- __name(getCurrentOwner, "getCurrentOwner");
111
- function onDispose(cleanup) {
112
- const owner = getCurrentOwner();
113
- if (!owner) throw new Error("Vobs: onDispose \u5FC5\u987B\u5728 Owner \u4F5C\u7528\u57DF\u5185\u8C03\u7528");
114
- owner.onDispose(cleanup);
115
- }
116
- __name(onDispose, "onDispose");
117
-
118
- // packages/reactivity/src/signal.ts
119
- var currentSubscriber = null;
120
- function getCurrentSubscriber() {
121
- return currentSubscriber;
122
- }
123
- __name(getCurrentSubscriber, "getCurrentSubscriber");
124
- function setCurrentSubscriber(subscriber) {
125
- currentSubscriber = subscriber;
126
- }
127
- __name(setCurrentSubscriber, "setCurrentSubscriber");
128
- function trackDependency(dependency) {
129
- if (!currentSubscriber || currentSubscriber.disposed) return;
130
- !currentSubscriber.dependencies.has(dependency);
131
- currentSubscriber.dependencies.add(dependency);
132
- }
133
- __name(trackDependency, "trackDependency");
134
- function state(initialValue, debugName) {
135
- let value = initialValue;
136
- let disposed = false;
137
- const subscribers = /* @__PURE__ */ new Set();
138
- const signalInstance = {
139
- get value() {
140
- const subscriber = getCurrentSubscriber();
141
- if (subscriber && !subscriber.disposed) {
142
- subscribers.add(subscriber);
143
- trackDependency(signalInstance);
144
- }
145
- return value;
146
- },
147
- set value(nextValue) {
148
- if (disposed || Object.is(value, nextValue)) return;
149
- value = nextValue;
150
- for (const subscriber of [...subscribers]) subscriber.notify();
151
- },
152
- unsubscribe(subscriber) {
153
- subscribers.delete(subscriber);
154
- },
155
- // 与 `.value =` 赋值同一条路径:判等短路、debug hook、notify 全部一致。
156
- // 以闭包实现,可安全地作为回调直接传递(无 this 绑定问题)。
157
- set(next) {
158
- signalInstance.value = next;
159
- },
160
- dispose() {
161
- if (disposed) return;
162
- disposed = true;
163
- subscribers.clear();
164
- }
165
- };
166
- const owner = getCurrentOwner();
167
- owner?.addCleanup(signalInstance.dispose);
168
- if (debugName?.trim()) setSignalDebugName(signalInstance, debugName.trim());
169
- return signalInstance;
170
- }
171
- __name(state, "state");
172
-
173
- // packages/reactivity/src/scheduler.ts
174
- var _Scheduler = class _Scheduler {
175
- constructor() {
176
- this.dirtyEffects = /* @__PURE__ */ new Set();
177
- this.lowPriorityEffects = /* @__PURE__ */ new Set();
178
- // flush 不可重入(flushing 标志保证),缓冲数组可在轮次间安全复用,避免每轮分配。
179
- this.normalBuffer = [];
180
- this.lowBuffer = [];
181
- this.flushing = false;
182
- this.scheduled = false;
183
- this.batchDepth = 0;
184
- }
185
- schedule(effect2) {
186
- if (effect2.disposed) return;
187
- this.dirtyEffects.add(effect2);
188
- this.lowPriorityEffects.delete(effect2);
189
- this.ensureScheduled();
190
- }
191
- /** Queue an effect behind normal updates while preserving deterministic order. */
192
- scheduleLow(effect2) {
193
- if (effect2.disposed) return;
194
- if (!this.dirtyEffects.has(effect2)) this.lowPriorityEffects.add(effect2);
195
- this.ensureScheduled();
196
- }
197
- ensureScheduled() {
198
- if (this.batchDepth === 0 && !this.flushing && !this.scheduled) {
199
- this.scheduled = true;
200
- queueMicrotask(() => {
201
- this.scheduled = false;
202
- this.flush();
203
- });
204
- }
205
- }
206
- remove(effect2) {
207
- this.dirtyEffects.delete(effect2);
208
- this.lowPriorityEffects.delete(effect2);
209
- }
210
- batch(fn) {
211
- this.batchDepth++;
212
- try {
213
- return fn();
214
- } finally {
215
- this.batchDepth--;
216
- if (this.batchDepth === 0) this.flush();
217
- }
218
- }
219
- flush() {
220
- if (this.flushing || this.batchDepth > 0) return;
221
- this.flushing = true;
222
- let rounds = 0;
223
- let firstError;
224
- let hasError = false;
225
- try {
226
- while (this.dirtyEffects.size > 0 || this.lowPriorityEffects.size > 0) {
227
- if (++rounds > 100) {
228
- this.dirtyEffects.clear();
229
- this.lowPriorityEffects.clear();
230
- throw new Error("Vobs: \u54CD\u5E94\u5F0F\u66F4\u65B0\u8D85\u8FC7 100 \u8F6E\uFF0C\u53EF\u80FD\u5B58\u5728\u5FAA\u73AF\u4F9D\u8D56");
231
- }
232
- this.collectRunnable(this.dirtyEffects, this.normalBuffer);
233
- this.collectRunnable(this.lowPriorityEffects, this.lowBuffer);
234
- sortEffects(this.normalBuffer);
235
- sortEffects(this.lowBuffer);
236
- for (const effect2 of this.normalBuffer) {
237
- try {
238
- effect2.run();
239
- } catch (error) {
240
- if (!hasError) {
241
- firstError = error;
242
- hasError = true;
243
- }
244
- }
245
- }
246
- for (const effect2 of this.lowBuffer) {
247
- try {
248
- effect2.run();
249
- } catch (error) {
250
- if (!hasError) {
251
- firstError = error;
252
- hasError = true;
253
- }
254
- }
255
- }
256
- this.normalBuffer.length = 0;
257
- this.lowBuffer.length = 0;
258
- }
259
- } finally {
260
- this.normalBuffer.length = 0;
261
- this.lowBuffer.length = 0;
262
- this.flushing = false;
263
- }
264
- if (hasError) throw firstError;
265
- }
266
- /** 收集未 disposed 的 effect 并清空源集合;run() 期间新调度的 effect 留给下一轮。 */
267
- collectRunnable(source, target) {
268
- for (const effect2 of source) {
269
- if (!effect2.disposed) target.push(effect2);
270
- }
271
- source.clear();
272
- }
8
+ var __export = (target, all) => {
9
+ for (var name in all)
10
+ __defProp(target, name, { get: all[name], enumerable: true });
273
11
  };
274
- __name(_Scheduler, "Scheduler");
275
- var Scheduler = _Scheduler;
276
- function sortEffects(effects) {
277
- if (effects.length > 1) {
278
- effects.sort((a, b) => b.depth - a.depth || a.order - b.order);
279
- }
280
- }
281
- __name(sortEffects, "sortEffects");
282
- var scheduler = new Scheduler();
283
-
284
- // packages/reactivity/src/effect.ts
285
- var nextEffectOrder = 1;
286
- function cleanupDependencies(subscriber) {
287
- for (const dependency of subscriber.dependencies) {
288
- dependency.unsubscribe(subscriber);
12
+ var __copyProps = (to, from, except, desc) => {
13
+ if (from && typeof from === "object" || typeof from === "function") {
14
+ for (let key of __getOwnPropNames(from))
15
+ if (!__hasOwnProp.call(to, key) && key !== except)
16
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
289
17
  }
290
- subscriber.dependencies.clear();
291
- }
292
- __name(cleanupDependencies, "cleanupDependencies");
293
- function effect(callback) {
294
- const owner = getCurrentOwner();
295
- let cleanup;
296
- let dirty = true;
297
- let disposed = false;
298
- const eff = {
299
- order: nextEffectOrder++,
300
- depth: owner?.depth ?? 0,
301
- dependencies: /* @__PURE__ */ new Set(),
302
- get disposed() {
303
- return disposed;
304
- },
305
- notify() {
306
- if (disposed || dirty) return;
307
- dirty = true;
308
- scheduler.schedule(eff);
309
- },
310
- run() {
311
- if (disposed || !dirty) return;
312
- dirty = false;
313
- const previousCleanup = cleanup;
314
- cleanup = void 0;
315
- let cleanupError;
316
- if (previousCleanup) {
317
- try {
318
- previousCleanup();
319
- } catch (error) {
320
- const handled2 = owner?.handleError(error) ?? false;
321
- if (!handled2) cleanupError = error;
322
- }
323
- }
324
- cleanupDependencies(eff);
325
- const previous = getCurrentSubscriber();
326
- setCurrentSubscriber(eff);
327
- let thrown;
328
- let handled = false;
329
- try {
330
- const result = owner ? owner.run(callback) : callback();
331
- cleanup = typeof result === "function" ? result : void 0;
332
- } catch (error) {
333
- thrown = error;
334
- handled = owner?.handleError(error) ?? false;
335
- if (!handled) throw error;
336
- } finally {
337
- setCurrentSubscriber(previous);
338
- }
339
- if (cleanupError && !thrown) throw cleanupError;
340
- },
341
- scheduleLow() {
342
- if (disposed || dirty) return;
343
- dirty = true;
344
- scheduler.scheduleLow(eff);
345
- },
346
- dispose() {
347
- if (disposed) return;
348
- disposed = true;
349
- dirty = false;
350
- scheduler.remove(eff);
351
- const previousCleanup = cleanup;
352
- cleanup = void 0;
353
- let cleanupError;
354
- if (previousCleanup) {
355
- try {
356
- previousCleanup();
357
- } catch (error) {
358
- const handled = owner?.handleError(error) ?? false;
359
- if (!handled) cleanupError = error;
360
- }
361
- }
362
- cleanupDependencies(eff);
363
- if (cleanupError) throw cleanupError;
364
- }
365
- };
366
- owner?.addCleanup(eff.dispose);
367
- eff.run();
368
- return eff;
369
- }
370
- __name(effect, "effect");
371
-
372
- // packages/runtime/src/debug.ts
373
- var activeRuntimeDebugHooks = null;
374
- function getRuntimeDebugHooks() {
375
- return activeRuntimeDebugHooks;
376
- }
377
- __name(getRuntimeDebugHooks, "getRuntimeDebugHooks");
378
- function invokeRuntimeDebug(name, ...args) {
379
- return;
380
- }
381
- __name(invokeRuntimeDebug, "invokeRuntimeDebug");
382
- function describeDebugNode(node) {
383
- if (!node || typeof node !== "object") return "node";
384
- const value = node;
385
- const name = typeof value.tagName === "string" ? value.tagName.toLowerCase() : typeof value.nodeName === "string" ? value.nodeName.toLowerCase() : "node";
386
- const id = typeof value.id === "string" && value.id ? `#${value.id}` : "";
387
- const className = typeof value.className === "string" && value.className ? `.${value.className.trim().split(/\s+/).filter(Boolean).join(".")}` : "";
388
- return `${name}${id}${className}`;
389
- }
390
- __name(describeDebugNode, "describeDebugNode");
391
-
392
- // packages/runtime/src/hmr.ts
393
- var globalTarget = globalThis;
394
- var hmrGlobal = globalTarget.__VOBS_HMR__ ?? { modules: /* @__PURE__ */ new Map() };
395
- globalTarget.__VOBS_HMR__ = hmrGlobal;
396
- function markHmrInstanceMounted(node, parent) {
397
- const instance = hmrInstances.get(node);
398
- if (instance) instance.parent = parent;
399
- }
400
- __name(markHmrInstanceMounted, "markHmrInstanceMounted");
401
- var hmrInstances = /* @__PURE__ */ new WeakMap();
402
- var nodeOwners = /* @__PURE__ */ new WeakMap();
403
- function getRenderer() {
404
- {
405
- throw new Error("\u6E32\u67D3\u5668\u672A\u521D\u59CB\u5316");
406
- }
407
- }
408
- __name(getRenderer, "getRenderer");
409
- function createText(content) {
410
- return getRenderer().createText(content);
411
- }
412
- __name(createText, "createText");
413
- function createComment(content) {
414
- return getRenderer().createComment(content);
415
- }
416
- __name(createComment, "createComment");
417
- function insertBefore(parent, child, anchor) {
418
- if (isVobsFragment(child)) {
419
- child.mount(parent, isVobsFragment(anchor) ? anchor.start : anchor);
420
- return;
421
- }
422
- getRenderer().insertBefore(parent, child, isVobsFragment(anchor) ? anchor.start : anchor);
423
- markHmrInstanceMounted(child, parent);
424
- }
425
- __name(insertBefore, "insertBefore");
426
- function removeChild(parent, child) {
427
- disposeNodeOwner(child);
428
- if (isVobsFragment(child)) {
429
- child.unmount(parent);
430
- return;
431
- }
432
- getRenderer().removeChild(parent, child);
433
- }
434
- __name(removeChild, "removeChild");
435
- function createBlock(factory) {
436
- const owner = createOwner();
437
- setOwnerDebugName(owner, "dynamic");
438
- let node;
439
- try {
440
- node = owner.run(factory);
441
- } catch (error) {
442
- owner.dispose();
443
- throw error;
444
- }
445
- if (!node) {
446
- owner.dispose();
447
- return null;
448
- }
449
- associateNodeOwner(node, owner);
450
- return node;
451
- }
452
- __name(createBlock, "createBlock");
453
- function associateNodeOwner(node, owner) {
454
- nodeOwners.set(node, owner);
455
- }
456
- __name(associateNodeOwner, "associateNodeOwner");
457
- function disposeNodeOwner(node) {
458
- const owner = nodeOwners.get(node);
459
- if (!owner) return;
460
- nodeOwners.delete(node);
461
- owner.dispose();
462
- }
463
- __name(disposeNodeOwner, "disposeNodeOwner");
18
+ return to;
19
+ };
20
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
464
21
 
465
- // packages/runtime/src/fragment.ts
466
- function createFragment(factory) {
467
- const start = createComment("vobs:fragment:start");
468
- const end = createComment("vobs:fragment:end");
469
- let parent = null;
470
- let initialized = false;
471
- const owner = getCurrentOwner();
472
- const fragment = {
473
- kind: "vobs-fragment",
474
- start,
475
- end,
476
- mount(nextParent, anchor) {
477
- if (parent && parent !== nextParent) {
478
- throw new Error("Vobs Fragment: \u4E0D\u80FD\u8DE8\u7236\u8282\u70B9\u79FB\u52A8 Fragment");
479
- }
480
- if (initialized) {
481
- moveRange(nextParent, start, end, anchor);
482
- return;
483
- }
484
- const renderer = getRenderer();
485
- renderer.insertBefore(nextParent, start, anchor);
486
- renderer.insertBefore(nextParent, end, anchor);
487
- parent = nextParent;
488
- initialized = true;
489
- if (owner) owner.run(() => factory(nextParent, end));
490
- else factory(nextParent, end);
491
- },
492
- unmount(nextParent) {
493
- if (!initialized || parent !== nextParent) {
494
- throw new Error("Vobs Fragment: Fragment \u4E0D\u5C5E\u4E8E\u6307\u5B9A\u7236\u8282\u70B9");
495
- }
496
- const renderer = getRenderer();
497
- let current = renderer.nextSibling(start);
498
- while (current && current !== end) {
499
- const next = renderer.nextSibling(current);
500
- renderer.removeChild(nextParent, current);
501
- current = next;
502
- }
503
- renderer.removeChild(nextParent, start);
504
- renderer.removeChild(nextParent, end);
505
- parent = null;
506
- initialized = false;
507
- }
508
- };
509
- return fragment;
510
- }
511
- __name(createFragment, "createFragment");
512
- function isVobsFragment(value) {
513
- return Boolean(value) && typeof value === "object" && value.kind === "vobs-fragment";
514
- }
515
- __name(isVobsFragment, "isVobsFragment");
516
- function moveRange(parent, start, end, anchor) {
517
- const renderer = getRenderer();
518
- const nodes = [start];
519
- let current = renderer.nextSibling(start);
520
- while (current) {
521
- nodes.push(current);
522
- if (current === end) break;
523
- current = renderer.nextSibling(current);
524
- }
525
- if (nodes[nodes.length - 1] !== end) {
526
- throw new Error("Vobs Fragment: \u627E\u4E0D\u5230\u7ED3\u675F\u951A\u70B9");
527
- }
528
- for (const node of nodes) renderer.insertBefore(parent, node, anchor);
529
- }
530
- __name(moveRange, "moveRange");
22
+ // packages/transition/src/transition.ts
23
+ var transition_exports = {};
24
+ __export(transition_exports, {
25
+ Transition: () => Transition,
26
+ TransitionGroup: () => TransitionGroup
27
+ });
28
+ module.exports = __toCommonJS(transition_exports);
29
+ var import_reactivity = require("@vobs/reactivity");
30
+ var import_vobs2 = require("@vobs/vobs");
31
+ var import_runtime2 = require("@vobs/runtime");
531
32
 
532
33
  // packages/transition/src/driver.ts
34
+ var import_vobs = require("@vobs/vobs");
533
35
  function runTransition(node, status, options, done) {
534
36
  const elements = getTransitionElements(node);
535
37
  if (elements.length === 0 || options.reducedMotion || !options.css && !hasStyles(options.phase)) {
@@ -610,9 +112,9 @@ __name(resolveReducedMotion, "resolveReducedMotion");
610
112
  function getTransitionElements(node) {
611
113
  const element = asTransitionElement(node);
612
114
  if (element) return [element];
613
- if (!isVobsFragment(node)) return [];
115
+ if (!(0, import_vobs.isVobsFragment)(node)) return [];
614
116
  const elements = [];
615
- const renderer = getRenderer();
117
+ const renderer = (0, import_vobs.getRenderer)();
616
118
  let current = renderer.nextSibling(node.start);
617
119
  while (current && current !== node.end) {
618
120
  const child = asTransitionElement(current);
@@ -708,11 +210,11 @@ __name(cancelFrame, "cancelFrame");
708
210
 
709
211
  // packages/transition/src/transition.ts
710
212
  function Transition(props = {}) {
711
- return createFragment((parent, anchor) => {
213
+ return (0, import_vobs2.createFragment)((parent, anchor) => {
712
214
  let current;
713
215
  let disposed = false;
714
216
  let initialized = false;
715
- const stop = effect(() => {
217
+ const stop = (0, import_reactivity.effect)(() => {
716
218
  const visible = readProp(props, "show", true) !== false;
717
219
  const initial = !initialized;
718
220
  initialized = true;
@@ -721,10 +223,10 @@ function Transition(props = {}) {
721
223
  if (current.status === "leaving") startEnter(current, props, true);
722
224
  return;
723
225
  }
724
- const node = createBlock(() => resolveChildren(readProp(props, "children", void 0)));
226
+ const node = (0, import_runtime2.createBlock)(() => resolveChildren(readProp(props, "children", void 0)));
725
227
  if (!node) return;
726
228
  current = { node, status: "entering" };
727
- insertBefore(parent, node, anchor);
229
+ (0, import_vobs2.insertBefore)(parent, node, anchor);
728
230
  startEnter(current, props, !initial || readProp(props, "appear", false));
729
231
  return;
730
232
  }
@@ -736,7 +238,7 @@ function Transition(props = {}) {
736
238
  });
737
239
  }
738
240
  });
739
- onDispose(() => {
241
+ (0, import_reactivity.onDispose)(() => {
740
242
  disposed = true;
741
243
  stop.dispose();
742
244
  current?.run?.cancel();
@@ -744,7 +246,7 @@ function Transition(props = {}) {
744
246
  function startLeave(entry, options, afterLeave) {
745
247
  startLeaveEntry(entry, options, () => {
746
248
  if (disposed || current?.node !== entry.node) return;
747
- removeChild(parent, entry.node);
249
+ (0, import_vobs2.removeChild)(parent, entry.node);
748
250
  afterLeave();
749
251
  });
750
252
  }
@@ -753,11 +255,11 @@ function Transition(props = {}) {
753
255
  }
754
256
  __name(Transition, "Transition");
755
257
  function TransitionGroup(props) {
756
- return createFragment((parent, anchor) => {
258
+ return (0, import_vobs2.createFragment)((parent, anchor) => {
757
259
  const entries = /* @__PURE__ */ new Map();
758
260
  let disposed = false;
759
261
  let initialized = false;
760
- const stop = effect(() => {
262
+ const stop = (0, import_reactivity.effect)(() => {
761
263
  const nextEntries = [];
762
264
  const initial = !initialized;
763
265
  initialized = true;
@@ -777,7 +279,7 @@ function TransitionGroup(props) {
777
279
  } else {
778
280
  entry = createGroupEntry(descriptor);
779
281
  entries.set(key, entry);
780
- insertBefore(parent, entry.node, anchor);
282
+ (0, import_vobs2.insertBefore)(parent, entry.node, anchor);
781
283
  startEnter(entry, props, !initial || readProp(props, "appear", false));
782
284
  }
783
285
  nextEntries.push(entry);
@@ -787,7 +289,7 @@ function TransitionGroup(props) {
787
289
  if (entry.status !== "leaving") {
788
290
  startLeaveEntry(entry, props, () => {
789
291
  if (disposed || entries.get(key) !== entry) return;
790
- removeChild(parent, entry.node);
292
+ (0, import_vobs2.removeChild)(parent, entry.node);
791
293
  entry.owner.dispose();
792
294
  entries.delete(key);
793
295
  });
@@ -795,11 +297,11 @@ function TransitionGroup(props) {
795
297
  }
796
298
  let reference = anchor;
797
299
  for (let index = nextEntries.length - 1; index >= 0; index--) {
798
- insertBefore(parent, nextEntries[index].node, reference);
300
+ (0, import_vobs2.insertBefore)(parent, nextEntries[index].node, reference);
799
301
  reference = nextEntries[index].node;
800
302
  }
801
303
  });
802
- onDispose(() => {
304
+ (0, import_reactivity.onDispose)(() => {
803
305
  disposed = true;
804
306
  stop.dispose();
805
307
  for (const entry of entries.values()) entry.run?.cancel();
@@ -817,12 +319,12 @@ function validateGroupDescriptors(descriptors) {
817
319
  }
818
320
  __name(validateGroupDescriptors, "validateGroupDescriptors");
819
321
  function createGroupEntry(descriptor) {
820
- const owner = createOwner();
322
+ const owner = (0, import_reactivity.createOwner)();
821
323
  let itemSignal;
822
324
  let node;
823
325
  try {
824
326
  owner.run(() => {
825
- itemSignal = state(descriptor.item);
327
+ itemSignal = (0, import_reactivity.state)(descriptor.item);
826
328
  node = renderGroupNode(itemSignal, descriptor, owner);
827
329
  });
828
330
  } catch (error) {
@@ -853,11 +355,11 @@ function refreshGroupEntry(parent, entry, descriptor) {
853
355
  entry.node = nextNode;
854
356
  entry.rawItem = descriptor.item;
855
357
  entry.index = descriptor.index;
856
- removeChild(parent, previousNode);
358
+ (0, import_vobs2.removeChild)(parent, previousNode);
857
359
  }
858
360
  __name(refreshGroupEntry, "refreshGroupEntry");
859
361
  function renderGroupNode(signal, descriptor, owner) {
860
- const node = owner.run(() => createBlock(() => resolveChildren(descriptor.render(toReactiveItem(signal, descriptor.item), descriptor.index))));
362
+ const node = owner.run(() => (0, import_runtime2.createBlock)(() => resolveChildren(descriptor.render(toReactiveItem(signal, descriptor.item), descriptor.index))));
861
363
  if (!node) throw new Error("TransitionGroup: renderItem \u5FC5\u987B\u8FD4\u56DE\u8282\u70B9");
862
364
  return node;
863
365
  }
@@ -958,12 +460,12 @@ __name(runWithDriver, "runWithDriver");
958
460
  function resolveChildren(value) {
959
461
  const resolved = typeof value === "function" ? resolveChildren(value()) : value;
960
462
  if (resolved === null || resolved === void 0 || resolved === false) return null;
961
- if (typeof resolved === "string" || typeof resolved === "number") return createText(String(resolved));
463
+ if (typeof resolved === "string" || typeof resolved === "number") return (0, import_vobs2.createText)(String(resolved));
962
464
  if (Array.isArray(resolved)) {
963
- return createFragment((parent, anchor) => {
465
+ return (0, import_vobs2.createFragment)((parent, anchor) => {
964
466
  for (const child of resolved) {
965
467
  const node = resolveChildren(child);
966
- if (node) insertBefore(parent, node, anchor);
468
+ if (node) (0, import_vobs2.insertBefore)(parent, node, anchor);
967
469
  }
968
470
  });
969
471
  }
@@ -997,8 +499,9 @@ function toReactiveItem(signal, initialValue) {
997
499
  });
998
500
  }
999
501
  __name(toReactiveItem, "toReactiveItem");
1000
-
1001
- exports.Transition = Transition;
1002
- exports.TransitionGroup = TransitionGroup;
1003
- //# sourceMappingURL=transition.cjs.map
502
+ // Annotate the CommonJS export names for ESM import in node:
503
+ 0 && (module.exports = {
504
+ Transition,
505
+ TransitionGroup
506
+ });
1004
507
  //# sourceMappingURL=transition.cjs.map