@vue/runtime-dom 3.3.5 → 3.3.7

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.
@@ -321,7 +321,7 @@ export interface HTMLAttributes extends AriaAttributes, EventHandlers<Events> {
321
321
  class?: any;
322
322
  style?: StyleValue;
323
323
  accesskey?: string;
324
- contenteditable?: Booleanish | 'inherit';
324
+ contenteditable?: Booleanish | 'inherit' | 'plaintext-only';
325
325
  contextmenu?: string;
326
326
  dir?: string;
327
327
  draggable?: Booleanish;
@@ -540,7 +540,7 @@ function trigger(target, type, key, newValue, oldValue, oldTarget) {
540
540
  } else if (key === "length" && isArray(target)) {
541
541
  const newLength = Number(newValue);
542
542
  depsMap.forEach((dep, key2) => {
543
- if (key2 === "length" || key2 >= newLength) {
543
+ if (key2 === "length" || !isSymbol(key2) && key2 >= newLength) {
544
544
  deps.push(dep);
545
545
  }
546
546
  });
@@ -1636,8 +1636,13 @@ function findInsertionIndex(id) {
1636
1636
  let end = queue.length;
1637
1637
  while (start < end) {
1638
1638
  const middle = start + end >>> 1;
1639
- const middleJobId = getId(queue[middle]);
1640
- middleJobId < id ? start = middle + 1 : end = middle;
1639
+ const middleJob = queue[middle];
1640
+ const middleJobId = getId(middleJob);
1641
+ if (middleJobId < id || middleJobId === id && middleJob.pre) {
1642
+ start = middle + 1;
1643
+ } else {
1644
+ end = middle;
1645
+ }
1641
1646
  }
1642
1647
  return start;
1643
1648
  }
@@ -2752,14 +2757,16 @@ function createSuspenseBoundary(vnode, parentSuspense, parentComponent, containe
2752
2757
  parentComponent: parentComponent2,
2753
2758
  container: container2
2754
2759
  } = suspense;
2760
+ let delayEnter = false;
2755
2761
  if (suspense.isHydrating) {
2756
2762
  suspense.isHydrating = false;
2757
2763
  } else if (!resume) {
2758
- const delayEnter = activeBranch && pendingBranch.transition && pendingBranch.transition.mode === "out-in";
2764
+ delayEnter = activeBranch && pendingBranch.transition && pendingBranch.transition.mode === "out-in";
2759
2765
  if (delayEnter) {
2760
2766
  activeBranch.transition.afterLeave = () => {
2761
2767
  if (pendingId === suspense.pendingId) {
2762
2768
  move(pendingBranch, container2, anchor2, 0);
2769
+ queuePostFlushCb(effects);
2763
2770
  }
2764
2771
  };
2765
2772
  }
@@ -2785,7 +2792,7 @@ function createSuspenseBoundary(vnode, parentSuspense, parentComponent, containe
2785
2792
  }
2786
2793
  parent = parent.parent;
2787
2794
  }
2788
- if (!hasUnresolvedAncestor) {
2795
+ if (!hasUnresolvedAncestor && !delayEnter) {
2789
2796
  queuePostFlushCb(effects);
2790
2797
  }
2791
2798
  suspense.effects = [];
@@ -5087,7 +5094,7 @@ function createAppAPI(render, hydrate) {
5087
5094
  }
5088
5095
  });
5089
5096
  }
5090
- const installedPlugins = /* @__PURE__ */ new Set();
5097
+ const installedPlugins = /* @__PURE__ */ new WeakSet();
5091
5098
  let isMounted = false;
5092
5099
  const app = context.app = {
5093
5100
  _uid: uid$1++,
@@ -5751,7 +5758,7 @@ const updateSlots = (instance, children, optimized) => {
5751
5758
  }
5752
5759
  if (needDeletionCheck) {
5753
5760
  for (const key in slots) {
5754
- if (!isInternalKey(key) && !(key in deletionComparisonTarget)) {
5761
+ if (!isInternalKey(key) && deletionComparisonTarget[key] == null) {
5755
5762
  delete slots[key];
5756
5763
  }
5757
5764
  }
@@ -5927,7 +5934,14 @@ function createHydrationFunctions(rendererInternals) {
5927
5934
  break;
5928
5935
  case Comment:
5929
5936
  if (domType !== 8 /* COMMENT */ || isFragmentStart) {
5930
- nextNode = onMismatch();
5937
+ if (node.tagName.toLowerCase() === "template") {
5938
+ const content = vnode.el.content.firstChild;
5939
+ replaceNode(content, node, parentComponent);
5940
+ vnode.el = node = content;
5941
+ nextNode = nextSibling(node);
5942
+ } else {
5943
+ nextNode = onMismatch();
5944
+ }
5931
5945
  } else {
5932
5946
  nextNode = nextSibling(node);
5933
5947
  }
@@ -5969,7 +5983,7 @@ function createHydrationFunctions(rendererInternals) {
5969
5983
  break;
5970
5984
  default:
5971
5985
  if (shapeFlag & 1) {
5972
- if (domType !== 1 /* ELEMENT */ || vnode.type.toLowerCase() !== node.tagName.toLowerCase()) {
5986
+ if ((domType !== 1 /* ELEMENT */ || vnode.type.toLowerCase() !== node.tagName.toLowerCase()) && !isTemplateNode(node)) {
5973
5987
  nextNode = onMismatch();
5974
5988
  } else {
5975
5989
  nextNode = hydrateElement(
@@ -5984,6 +5998,13 @@ function createHydrationFunctions(rendererInternals) {
5984
5998
  } else if (shapeFlag & 6) {
5985
5999
  vnode.slotScopeIds = slotScopeIds;
5986
6000
  const container = parentNode(node);
6001
+ if (isFragmentStart) {
6002
+ nextNode = locateClosingAnchor(node);
6003
+ } else if (isComment(node) && node.data === "teleport start") {
6004
+ nextNode = locateClosingAnchor(node, node.data, "teleport end");
6005
+ } else {
6006
+ nextNode = nextSibling(node);
6007
+ }
5987
6008
  mountComponent(
5988
6009
  vnode,
5989
6010
  container,
@@ -5993,10 +6014,6 @@ function createHydrationFunctions(rendererInternals) {
5993
6014
  isSVGContainer(container),
5994
6015
  optimized
5995
6016
  );
5996
- nextNode = isFragmentStart ? locateClosingAsyncAnchor(node) : nextSibling(node);
5997
- if (nextNode && isComment(nextNode) && nextNode.data === "teleport end") {
5998
- nextNode = nextSibling(nextNode);
5999
- }
6000
6017
  if (isAsyncWrapper(vnode)) {
6001
6018
  let subTree;
6002
6019
  if (isFragmentStart) {
@@ -6046,7 +6063,7 @@ function createHydrationFunctions(rendererInternals) {
6046
6063
  };
6047
6064
  const hydrateElement = (el, vnode, parentComponent, parentSuspense, slotScopeIds, optimized) => {
6048
6065
  optimized = optimized || !!vnode.dynamicChildren;
6049
- const { type, props, patchFlag, shapeFlag, dirs } = vnode;
6066
+ const { type, props, patchFlag, shapeFlag, dirs, transition } = vnode;
6050
6067
  const forcePatchValue = type === "input" && dirs || type === "option";
6051
6068
  {
6052
6069
  if (dirs) {
@@ -6083,12 +6100,23 @@ function createHydrationFunctions(rendererInternals) {
6083
6100
  if (vnodeHooks = props && props.onVnodeBeforeMount) {
6084
6101
  invokeVNodeHook(vnodeHooks, parentComponent, vnode);
6085
6102
  }
6103
+ let needCallTransitionHooks = false;
6104
+ if (isTemplateNode(el)) {
6105
+ needCallTransitionHooks = needTransition(parentSuspense, transition) && parentComponent && parentComponent.vnode.props && parentComponent.vnode.props.appear;
6106
+ const content = el.content.firstChild;
6107
+ if (needCallTransitionHooks) {
6108
+ transition.beforeEnter(content);
6109
+ }
6110
+ replaceNode(content, el, parentComponent);
6111
+ vnode.el = el = content;
6112
+ }
6086
6113
  if (dirs) {
6087
6114
  invokeDirectiveHook(vnode, null, parentComponent, "beforeMount");
6088
6115
  }
6089
- if ((vnodeHooks = props && props.onVnodeMounted) || dirs) {
6116
+ if ((vnodeHooks = props && props.onVnodeMounted) || dirs || needCallTransitionHooks) {
6090
6117
  queueEffectWithSuspense(() => {
6091
6118
  vnodeHooks && invokeVNodeHook(vnodeHooks, parentComponent, vnode);
6119
+ needCallTransitionHooks && transition.enter(el);
6092
6120
  dirs && invokeDirectiveHook(vnode, null, parentComponent, "mounted");
6093
6121
  }, parentSuspense);
6094
6122
  }
@@ -6206,7 +6234,7 @@ function createHydrationFunctions(rendererInternals) {
6206
6234
  );
6207
6235
  vnode.el = null;
6208
6236
  if (isFragment) {
6209
- const end = locateClosingAsyncAnchor(node);
6237
+ const end = locateClosingAnchor(node);
6210
6238
  while (true) {
6211
6239
  const next2 = nextSibling(node);
6212
6240
  if (next2 && next2 !== end) {
@@ -6231,14 +6259,14 @@ function createHydrationFunctions(rendererInternals) {
6231
6259
  );
6232
6260
  return next;
6233
6261
  };
6234
- const locateClosingAsyncAnchor = (node) => {
6262
+ const locateClosingAnchor = (node, open = "[", close = "]") => {
6235
6263
  let match = 0;
6236
6264
  while (node) {
6237
6265
  node = nextSibling(node);
6238
6266
  if (node && isComment(node)) {
6239
- if (node.data === "[")
6267
+ if (node.data === open)
6240
6268
  match++;
6241
- if (node.data === "]") {
6269
+ if (node.data === close) {
6242
6270
  if (match === 0) {
6243
6271
  return nextSibling(node);
6244
6272
  } else {
@@ -6249,6 +6277,23 @@ function createHydrationFunctions(rendererInternals) {
6249
6277
  }
6250
6278
  return node;
6251
6279
  };
6280
+ const replaceNode = (newNode, oldNode, parentComponent) => {
6281
+ const parentNode2 = oldNode.parentNode;
6282
+ if (parentNode2) {
6283
+ parentNode2.replaceChild(newNode, oldNode);
6284
+ }
6285
+ let parent = parentComponent;
6286
+ while (parent) {
6287
+ if (parent.vnode.el === oldNode) {
6288
+ parent.vnode.el = newNode;
6289
+ parent.subTree.el = newNode;
6290
+ }
6291
+ parent = parent.parent;
6292
+ }
6293
+ };
6294
+ const isTemplateNode = (node) => {
6295
+ return node.nodeType === 1 /* ELEMENT */ && node.tagName.toLowerCase() === "template";
6296
+ };
6252
6297
  return [hydrate, hydrateNode];
6253
6298
  }
6254
6299
 
@@ -6576,7 +6621,7 @@ function baseCreateRenderer(options, createHydrationFns) {
6576
6621
  if (dirs) {
6577
6622
  invokeDirectiveHook(vnode, null, parentComponent, "beforeMount");
6578
6623
  }
6579
- const needCallTransitionHooks = (!parentSuspense || parentSuspense && !parentSuspense.pendingBranch) && transition && !transition.persisted;
6624
+ const needCallTransitionHooks = needTransition(parentSuspense, transition);
6580
6625
  if (needCallTransitionHooks) {
6581
6626
  transition.beforeEnter(el);
6582
6627
  }
@@ -7468,8 +7513,8 @@ function baseCreateRenderer(options, createHydrationFns) {
7468
7513
  moveStaticNode(vnode, container, anchor);
7469
7514
  return;
7470
7515
  }
7471
- const needTransition = moveType !== 2 && shapeFlag & 1 && transition;
7472
- if (needTransition) {
7516
+ const needTransition2 = moveType !== 2 && shapeFlag & 1 && transition;
7517
+ if (needTransition2) {
7473
7518
  if (moveType === 0) {
7474
7519
  transition.beforeEnter(el);
7475
7520
  hostInsert(el, container, anchor);
@@ -7689,6 +7734,9 @@ function baseCreateRenderer(options, createHydrationFns) {
7689
7734
  function toggleRecurse({ effect, update }, allowed) {
7690
7735
  effect.allowRecurse = update.allowRecurse = allowed;
7691
7736
  }
7737
+ function needTransition(parentSuspense, transition) {
7738
+ return (!parentSuspense || parentSuspense && !parentSuspense.pendingBranch) && transition && !transition.persisted;
7739
+ }
7692
7740
  function traverseStaticChildren(n1, n2, shallow = false) {
7693
7741
  const ch1 = n1.children;
7694
7742
  const ch2 = n2.children;
@@ -7914,19 +7962,18 @@ const TeleportImpl = {
7914
7962
  if (target) {
7915
7963
  hostRemove(targetAnchor);
7916
7964
  }
7917
- if (doRemove || !isTeleportDisabled(props)) {
7918
- hostRemove(anchor);
7919
- if (shapeFlag & 16) {
7920
- for (let i = 0; i < children.length; i++) {
7921
- const child = children[i];
7922
- unmount(
7923
- child,
7924
- parentComponent,
7925
- parentSuspense,
7926
- true,
7927
- !!child.dynamicChildren
7928
- );
7929
- }
7965
+ doRemove && hostRemove(anchor);
7966
+ if (shapeFlag & 16) {
7967
+ const shouldRemove = doRemove || !isTeleportDisabled(props);
7968
+ for (let i = 0; i < children.length; i++) {
7969
+ const child = children[i];
7970
+ unmount(
7971
+ child,
7972
+ parentComponent,
7973
+ parentSuspense,
7974
+ shouldRemove,
7975
+ !!child.dynamicChildren
7976
+ );
7930
7977
  }
7931
7978
  }
7932
7979
  },
@@ -8010,7 +8057,7 @@ function updateCssVars(vnode) {
8010
8057
  const ctx = vnode.ctx;
8011
8058
  if (ctx && ctx.ut) {
8012
8059
  let node = vnode.children[0].el;
8013
- while (node !== vnode.targetAnchor) {
8060
+ while (node && node !== vnode.targetAnchor) {
8014
8061
  if (node.nodeType === 1)
8015
8062
  node.setAttribute("data-v-owner", ctx.uid);
8016
8063
  node = node.nextSibling;
@@ -9025,7 +9072,7 @@ function isMemoSame(cached, memo) {
9025
9072
  return true;
9026
9073
  }
9027
9074
 
9028
- const version = "3.3.5";
9075
+ const version = "3.3.7";
9029
9076
  const ssrUtils = null;
9030
9077
  const resolveFilter = null;
9031
9078
  const compatUtils = null;