@vue/runtime-dom 3.5.4 → 3.5.5

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,9 +1,9 @@
1
1
  /**
2
- * @vue/runtime-dom v3.5.4
2
+ * @vue/runtime-dom v3.5.5
3
3
  * (c) 2018-present Yuxi (Evan) You and Vue contributors
4
4
  * @license MIT
5
5
  **/
6
- import { warn, h, BaseTransition, assertNumber, BaseTransitionPropsValidators, getCurrentInstance, onBeforeMount, watchPostEffect, onMounted, onUnmounted, Fragment, Static, camelize, callWithAsyncErrorHandling, defineComponent, nextTick, unref, createVNode, useTransitionState, onUpdated, toRaw, getTransitionRawChildren, setTransitionHooks, resolveTransitionHooks, isRuntimeOnly, createRenderer, createHydrationRenderer } from '@vue/runtime-core';
6
+ import { warn, h, BaseTransition, assertNumber, BaseTransitionPropsValidators, getCurrentInstance, onBeforeMount, watchPostEffect, onMounted, onUnmounted, Fragment, Static, camelize, callWithAsyncErrorHandling, defineComponent, nextTick, unref, createVNode, useTransitionState, onUpdated, toRaw, getTransitionRawChildren, setTransitionHooks, resolveTransitionHooks, Text, isRuntimeOnly, createRenderer, createHydrationRenderer } from '@vue/runtime-core';
7
7
  export * from '@vue/runtime-core';
8
8
  import { extend, isObject, toNumber, isArray, isString, hyphenate, capitalize, includeBooleanAttr, isSymbol, isSpecialBooleanAttr, isFunction, NOOP, isOn, isModelListener, isPlainObject, hasOwn, camelize as camelize$1, EMPTY_OBJ, looseToNumber, looseIndexOf, isSet, looseEqual, invokeArrayFns, isHTMLTag, isSVGTag, isMathMLTag } from '@vue/shared';
9
9
 
@@ -885,6 +885,7 @@ class VueElement extends BaseClass {
885
885
  }
886
886
  }
887
887
  connectedCallback() {
888
+ if (!this.isConnected) return;
888
889
  if (!this.shadowRoot) {
889
890
  this._parseSlots();
890
891
  }
@@ -927,7 +928,7 @@ class VueElement extends BaseClass {
927
928
  this._ob = null;
928
929
  }
929
930
  this._app && this._app.unmount();
930
- this._instance.ce = void 0;
931
+ if (this._instance) this._instance.ce = void 0;
931
932
  this._app = this._instance = null;
932
933
  }
933
934
  });
@@ -1146,7 +1147,7 @@ class VueElement extends BaseClass {
1146
1147
  }
1147
1148
  }
1148
1149
  /**
1149
- * Only called when shaddowRoot is false
1150
+ * Only called when shadowRoot is false
1150
1151
  */
1151
1152
  _parseSlots() {
1152
1153
  const slots = this._slots = {};
@@ -1158,10 +1159,10 @@ class VueElement extends BaseClass {
1158
1159
  }
1159
1160
  }
1160
1161
  /**
1161
- * Only called when shaddowRoot is false
1162
+ * Only called when shadowRoot is false
1162
1163
  */
1163
1164
  _renderSlots() {
1164
- const outlets = this.querySelectorAll("slot");
1165
+ const outlets = (this._teleportTarget || this).querySelectorAll("slot");
1165
1166
  const scopeId = this._instance.type.__scopeId;
1166
1167
  for (let i = 0; i < outlets.length; i++) {
1167
1168
  const o = outlets[i];
@@ -1340,7 +1341,7 @@ const TransitionGroupImpl = /* @__PURE__ */ decorate({
1340
1341
  child,
1341
1342
  resolveTransitionHooks(child, cssTransitionProps, state, instance)
1342
1343
  );
1343
- } else if (!!(process.env.NODE_ENV !== "production")) {
1344
+ } else if (!!(process.env.NODE_ENV !== "production") && child.type !== Text) {
1344
1345
  warn(`<TransitionGroup> children must be keyed.`);
1345
1346
  }
1346
1347
  }
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @vue/runtime-dom v3.5.4
2
+ * @vue/runtime-dom v3.5.5
3
3
  * (c) 2018-present Yuxi (Evan) You and Vue contributors
4
4
  * @license MIT
5
5
  **/
@@ -599,9 +599,11 @@ var VueRuntimeDOM = (function (exports) {
599
599
  function cleanupDeps(sub) {
600
600
  let head;
601
601
  let tail = sub.depsTail;
602
- for (let link = tail; link; link = link.prevDep) {
602
+ let link = tail;
603
+ while (link) {
604
+ const prev = link.prevDep;
603
605
  if (link.version === -1) {
604
- if (link === tail) tail = link.prevDep;
606
+ if (link === tail) tail = prev;
605
607
  removeSub(link);
606
608
  removeDep(link);
607
609
  } else {
@@ -609,6 +611,7 @@ var VueRuntimeDOM = (function (exports) {
609
611
  }
610
612
  link.dep.activeLink = link.prevActiveLink;
611
613
  link.prevActiveLink = void 0;
614
+ link = prev;
612
615
  }
613
616
  sub.deps = head;
614
617
  sub.depsTail = tail;
@@ -737,6 +740,14 @@ var VueRuntimeDOM = (function (exports) {
737
740
  }
738
741
 
739
742
  let globalVersion = 0;
743
+ class Link {
744
+ constructor(sub, dep) {
745
+ this.sub = sub;
746
+ this.dep = dep;
747
+ this.version = dep.version;
748
+ this.nextDep = this.prevDep = this.nextSub = this.prevSub = this.prevActiveLink = void 0;
749
+ }
750
+ }
740
751
  class Dep {
741
752
  constructor(computed) {
742
753
  this.computed = computed;
@@ -759,16 +770,7 @@ var VueRuntimeDOM = (function (exports) {
759
770
  }
760
771
  let link = this.activeLink;
761
772
  if (link === void 0 || link.sub !== activeSub) {
762
- link = this.activeLink = {
763
- dep: this,
764
- sub: activeSub,
765
- version: this.version,
766
- nextDep: void 0,
767
- prevDep: void 0,
768
- nextSub: void 0,
769
- prevSub: void 0,
770
- prevActiveLink: void 0
771
- };
773
+ link = this.activeLink = new Link(activeSub, this);
772
774
  if (!activeSub.deps) {
773
775
  activeSub.deps = activeSub.depsTail = link;
774
776
  } else {
@@ -2681,7 +2683,9 @@ var VueRuntimeDOM = (function (exports) {
2681
2683
  dirtyInstances.delete(instance);
2682
2684
  } else if (instance.parent) {
2683
2685
  queueJob(() => {
2686
+ isHmrUpdating = true;
2684
2687
  instance.parent.update();
2688
+ isHmrUpdating = false;
2685
2689
  dirtyInstances.delete(instance);
2686
2690
  });
2687
2691
  } else if (instance.appContext.reload) {
@@ -2972,6 +2976,9 @@ var VueRuntimeDOM = (function (exports) {
2972
2976
  insert(mainAnchor, container, anchor);
2973
2977
  const mount = (container2, anchor2) => {
2974
2978
  if (shapeFlag & 16) {
2979
+ if (parentComponent && parentComponent.isCE) {
2980
+ parentComponent.ce._teleportTarget = container2;
2981
+ }
2975
2982
  mountChildren(
2976
2983
  children,
2977
2984
  container2,
@@ -4002,7 +4009,11 @@ Server rendered element contains more child nodes than client vdom.`
4002
4009
  remove(cur);
4003
4010
  }
4004
4011
  } else if (shapeFlag & 8) {
4005
- if (el.textContent !== vnode.children) {
4012
+ let clientText = vnode.children;
4013
+ if (clientText[0] === "\n" && (el.tagName === "PRE" || el.tagName === "TEXTAREA")) {
4014
+ clientText = clientText.slice(1);
4015
+ }
4016
+ if (el.textContent !== clientText) {
4006
4017
  if (!isMismatchAllowed(el, 0 /* TEXT */)) {
4007
4018
  warn$1(
4008
4019
  `Hydration text content mismatch on`,
@@ -4201,7 +4212,7 @@ Server rendered element contains fewer child nodes than client vdom.`
4201
4212
  }
4202
4213
  };
4203
4214
  const isTemplateNode = (node) => {
4204
- return node.nodeType === 1 && node.tagName.toLowerCase() === "template";
4215
+ return node.nodeType === 1 && node.tagName === "TEMPLATE";
4205
4216
  };
4206
4217
  return [hydrate, hydrateNode];
4207
4218
  }
@@ -4553,7 +4564,7 @@ Server rendered element contains fewer child nodes than client vdom.`
4553
4564
  load().then(() => {
4554
4565
  loaded.value = true;
4555
4566
  if (instance.parent && isKeepAlive(instance.parent.vnode)) {
4556
- queueJob(instance.parent.update);
4567
+ instance.parent.update();
4557
4568
  }
4558
4569
  }).catch((err) => {
4559
4570
  onError(err);
@@ -7226,6 +7237,7 @@ If you want to remount the same app, move your app creation logic into a factory
7226
7237
  }
7227
7238
  }
7228
7239
  if (instance.asyncDep) {
7240
+ if (isHmrUpdating) initialVNode.el = null;
7229
7241
  parentSuspense && parentSuspense.registerDep(instance, setupRenderEffect, optimized);
7230
7242
  if (!initialVNode.el) {
7231
7243
  const placeholder = instance.subTree = createVNode(Comment);
@@ -10341,7 +10353,7 @@ Component that was made reactive: `,
10341
10353
  return true;
10342
10354
  }
10343
10355
 
10344
- const version = "3.5.4";
10356
+ const version = "3.5.5";
10345
10357
  const warn = warn$1 ;
10346
10358
  const ErrorTypeStrings = ErrorTypeStrings$1 ;
10347
10359
  const devtools = devtools$1 ;
@@ -11222,6 +11234,7 @@ Expected function or array of functions, received type ${typeof value}.`
11222
11234
  }
11223
11235
  }
11224
11236
  connectedCallback() {
11237
+ if (!this.isConnected) return;
11225
11238
  if (!this.shadowRoot) {
11226
11239
  this._parseSlots();
11227
11240
  }
@@ -11264,7 +11277,7 @@ Expected function or array of functions, received type ${typeof value}.`
11264
11277
  this._ob = null;
11265
11278
  }
11266
11279
  this._app && this._app.unmount();
11267
- this._instance.ce = void 0;
11280
+ if (this._instance) this._instance.ce = void 0;
11268
11281
  this._app = this._instance = null;
11269
11282
  }
11270
11283
  });
@@ -11483,7 +11496,7 @@ Expected function or array of functions, received type ${typeof value}.`
11483
11496
  }
11484
11497
  }
11485
11498
  /**
11486
- * Only called when shaddowRoot is false
11499
+ * Only called when shadowRoot is false
11487
11500
  */
11488
11501
  _parseSlots() {
11489
11502
  const slots = this._slots = {};
@@ -11495,10 +11508,10 @@ Expected function or array of functions, received type ${typeof value}.`
11495
11508
  }
11496
11509
  }
11497
11510
  /**
11498
- * Only called when shaddowRoot is false
11511
+ * Only called when shadowRoot is false
11499
11512
  */
11500
11513
  _renderSlots() {
11501
- const outlets = this.querySelectorAll("slot");
11514
+ const outlets = (this._teleportTarget || this).querySelectorAll("slot");
11502
11515
  const scopeId = this._instance.type.__scopeId;
11503
11516
  for (let i = 0; i < outlets.length; i++) {
11504
11517
  const o = outlets[i];
@@ -11665,7 +11678,7 @@ Expected function or array of functions, received type ${typeof value}.`
11665
11678
  child,
11666
11679
  resolveTransitionHooks(child, cssTransitionProps, state, instance)
11667
11680
  );
11668
- } else {
11681
+ } else if (child.type !== Text) {
11669
11682
  warn(`<TransitionGroup> children must be keyed.`);
11670
11683
  }
11671
11684
  }