@vue/runtime-dom 3.5.31 → 3.5.32

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,5 +1,5 @@
1
1
  /**
2
- * @vue/runtime-dom v3.5.31
2
+ * @vue/runtime-dom v3.5.32
3
3
  * (c) 2018-present Yuxi (Evan) You and Vue contributors
4
4
  * @license MIT
5
5
  **/
@@ -3163,6 +3163,7 @@ var VueRuntimeDOM = (function (exports) {
3163
3163
  };
3164
3164
  }
3165
3165
 
3166
+ const pendingMounts = /* @__PURE__ */ new WeakMap();
3166
3167
  const TeleportEndKey = /* @__PURE__ */ Symbol("_vte");
3167
3168
  const isTeleport = (type) => type.__isTeleport;
3168
3169
  const isTeleportDisabled = (props) => props && (props.disabled || props.disabled === "");
@@ -3204,91 +3205,86 @@ var VueRuntimeDOM = (function (exports) {
3204
3205
  o: { insert, querySelector, createText, createComment }
3205
3206
  } = internals;
3206
3207
  const disabled = isTeleportDisabled(n2.props);
3207
- let { shapeFlag, children, dynamicChildren } = n2;
3208
+ let { dynamicChildren } = n2;
3208
3209
  if (isHmrUpdating) {
3209
3210
  optimized = false;
3210
3211
  dynamicChildren = null;
3211
3212
  }
3213
+ const mount = (vnode, container2, anchor2) => {
3214
+ if (vnode.shapeFlag & 16) {
3215
+ mountChildren(
3216
+ vnode.children,
3217
+ container2,
3218
+ anchor2,
3219
+ parentComponent,
3220
+ parentSuspense,
3221
+ namespace,
3222
+ slotScopeIds,
3223
+ optimized
3224
+ );
3225
+ }
3226
+ };
3227
+ const mountToTarget = (vnode = n2) => {
3228
+ const disabled2 = isTeleportDisabled(vnode.props);
3229
+ const target = vnode.target = resolveTarget(vnode.props, querySelector);
3230
+ const targetAnchor = prepareAnchor(target, vnode, createText, insert);
3231
+ if (target) {
3232
+ if (namespace !== "svg" && isTargetSVG(target)) {
3233
+ namespace = "svg";
3234
+ } else if (namespace !== "mathml" && isTargetMathML(target)) {
3235
+ namespace = "mathml";
3236
+ }
3237
+ if (parentComponent && parentComponent.isCE) {
3238
+ (parentComponent.ce._teleportTargets || (parentComponent.ce._teleportTargets = /* @__PURE__ */ new Set())).add(target);
3239
+ }
3240
+ if (!disabled2) {
3241
+ mount(vnode, target, targetAnchor);
3242
+ updateCssVars(vnode, false);
3243
+ }
3244
+ } else if (!disabled2) {
3245
+ warn$1("Invalid Teleport target on mount:", target, `(${typeof target})`);
3246
+ }
3247
+ };
3248
+ const queuePendingMount = (vnode) => {
3249
+ const mountJob = () => {
3250
+ if (pendingMounts.get(vnode) !== mountJob) return;
3251
+ pendingMounts.delete(vnode);
3252
+ if (isTeleportDisabled(vnode.props)) {
3253
+ mount(vnode, container, vnode.anchor);
3254
+ updateCssVars(vnode, true);
3255
+ }
3256
+ mountToTarget(vnode);
3257
+ };
3258
+ pendingMounts.set(vnode, mountJob);
3259
+ queuePostRenderEffect(mountJob, parentSuspense);
3260
+ };
3212
3261
  if (n1 == null) {
3213
3262
  const placeholder = n2.el = createComment("teleport start") ;
3214
3263
  const mainAnchor = n2.anchor = createComment("teleport end") ;
3215
3264
  insert(placeholder, container, anchor);
3216
3265
  insert(mainAnchor, container, anchor);
3217
- const mount = (container2, anchor2) => {
3218
- if (shapeFlag & 16) {
3219
- mountChildren(
3220
- children,
3221
- container2,
3222
- anchor2,
3223
- parentComponent,
3224
- parentSuspense,
3225
- namespace,
3226
- slotScopeIds,
3227
- optimized
3228
- );
3229
- }
3230
- };
3231
- const mountToTarget = () => {
3232
- const target = n2.target = resolveTarget(n2.props, querySelector);
3233
- const targetAnchor = prepareAnchor(target, n2, createText, insert);
3234
- if (target) {
3235
- if (namespace !== "svg" && isTargetSVG(target)) {
3236
- namespace = "svg";
3237
- } else if (namespace !== "mathml" && isTargetMathML(target)) {
3238
- namespace = "mathml";
3239
- }
3240
- if (parentComponent && parentComponent.isCE) {
3241
- (parentComponent.ce._teleportTargets || (parentComponent.ce._teleportTargets = /* @__PURE__ */ new Set())).add(target);
3242
- }
3243
- if (!disabled) {
3244
- mount(target, targetAnchor);
3245
- updateCssVars(n2, false);
3246
- }
3247
- } else if (!disabled) {
3248
- warn$1(
3249
- "Invalid Teleport target on mount:",
3250
- target,
3251
- `(${typeof target})`
3252
- );
3253
- }
3254
- };
3266
+ if (isTeleportDeferred(n2.props) || parentSuspense && parentSuspense.pendingBranch) {
3267
+ queuePendingMount(n2);
3268
+ return;
3269
+ }
3255
3270
  if (disabled) {
3256
- mount(container, mainAnchor);
3271
+ mount(n2, container, mainAnchor);
3257
3272
  updateCssVars(n2, true);
3258
3273
  }
3259
- if (isTeleportDeferred(n2.props) || parentSuspense && parentSuspense.pendingBranch) {
3260
- n2.el.__isMounted = false;
3261
- queuePostRenderEffect(() => {
3262
- if (n2.el.__isMounted !== false) return;
3263
- mountToTarget();
3264
- delete n2.el.__isMounted;
3265
- }, parentSuspense);
3266
- } else {
3267
- mountToTarget();
3268
- }
3274
+ mountToTarget();
3269
3275
  } else {
3270
3276
  n2.el = n1.el;
3271
- n2.targetStart = n1.targetStart;
3272
3277
  const mainAnchor = n2.anchor = n1.anchor;
3273
- const target = n2.target = n1.target;
3274
- const targetAnchor = n2.targetAnchor = n1.targetAnchor;
3275
- if (n1.el.__isMounted === false) {
3276
- queuePostRenderEffect(() => {
3277
- TeleportImpl.process(
3278
- n1,
3279
- n2,
3280
- container,
3281
- anchor,
3282
- parentComponent,
3283
- parentSuspense,
3284
- namespace,
3285
- slotScopeIds,
3286
- optimized,
3287
- internals
3288
- );
3289
- }, parentSuspense);
3278
+ const pendingMount = pendingMounts.get(n1);
3279
+ if (pendingMount) {
3280
+ pendingMount.flags |= 8;
3281
+ pendingMounts.delete(n1);
3282
+ queuePendingMount(n2);
3290
3283
  return;
3291
3284
  }
3285
+ n2.targetStart = n1.targetStart;
3286
+ const target = n2.target = n1.target;
3287
+ const targetAnchor = n2.targetAnchor = n1.targetAnchor;
3292
3288
  const wasDisabled = isTeleportDisabled(n1.props);
3293
3289
  const currentContainer = wasDisabled ? container : target;
3294
3290
  const currentAnchor = wasDisabled ? mainAnchor : targetAnchor;
@@ -3379,13 +3375,19 @@ var VueRuntimeDOM = (function (exports) {
3379
3375
  target,
3380
3376
  props
3381
3377
  } = vnode;
3378
+ let shouldRemove = doRemove || !isTeleportDisabled(props);
3379
+ const pendingMount = pendingMounts.get(vnode);
3380
+ if (pendingMount) {
3381
+ pendingMount.flags |= 8;
3382
+ pendingMounts.delete(vnode);
3383
+ shouldRemove = false;
3384
+ }
3382
3385
  if (target) {
3383
3386
  hostRemove(targetStart);
3384
3387
  hostRemove(targetAnchor);
3385
3388
  }
3386
3389
  doRemove && hostRemove(anchor);
3387
3390
  if (shapeFlag & 16) {
3388
- const shouldRemove = doRemove || !isTeleportDisabled(props);
3389
3391
  for (let i = 0; i < children.length; i++) {
3390
3392
  const child = children[i];
3391
3393
  unmount(
@@ -9553,6 +9555,7 @@ If you want to remount the same app, move your app creation logic into a factory
9553
9555
  if (instance.isUnmounted || suspense.isUnmounted || suspense.pendingId !== instance.suspenseId) {
9554
9556
  return;
9555
9557
  }
9558
+ unsetCurrentInstance();
9556
9559
  instance.asyncResolved = true;
9557
9560
  const { vnode: vnode2 } = instance;
9558
9561
  {
@@ -10743,7 +10746,7 @@ Component that was made reactive: `,
10743
10746
  return true;
10744
10747
  }
10745
10748
 
10746
- const version = "3.5.31";
10749
+ const version = "3.5.32";
10747
10750
  const warn = warn$1 ;
10748
10751
  const ErrorTypeStrings = ErrorTypeStrings$1 ;
10749
10752
  const devtools = devtools$1 ;