vue 3.5.25 → 3.5.26

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 v3.5.25
2
+ * vue v3.5.26
3
3
  * (c) 2018-present Yuxi (Evan) You and Vue contributors
4
4
  * @license MIT
5
5
  **/
@@ -932,13 +932,13 @@ var Vue = (function (exports) {
932
932
  }
933
933
  }
934
934
  const targetMap = /* @__PURE__ */ new WeakMap();
935
- const ITERATE_KEY = Symbol(
935
+ const ITERATE_KEY = /* @__PURE__ */ Symbol(
936
936
  "Object iterate"
937
937
  );
938
- const MAP_KEY_ITERATE_KEY = Symbol(
938
+ const MAP_KEY_ITERATE_KEY = /* @__PURE__ */ Symbol(
939
939
  "Map keys iterate"
940
940
  );
941
- const ARRAY_ITERATE_KEY = Symbol(
941
+ const ARRAY_ITERATE_KEY = /* @__PURE__ */ Symbol(
942
942
  "Array iterate"
943
943
  );
944
944
  function track(target, type, key) {
@@ -2987,7 +2987,152 @@ var Vue = (function (exports) {
2987
2987
  }
2988
2988
  }
2989
2989
 
2990
- const TeleportEndKey = Symbol("_vte");
2990
+ function provide(key, value) {
2991
+ {
2992
+ if (!currentInstance || currentInstance.isMounted) {
2993
+ warn$1(`provide() can only be used inside setup().`);
2994
+ }
2995
+ }
2996
+ if (currentInstance) {
2997
+ let provides = currentInstance.provides;
2998
+ const parentProvides = currentInstance.parent && currentInstance.parent.provides;
2999
+ if (parentProvides === provides) {
3000
+ provides = currentInstance.provides = Object.create(parentProvides);
3001
+ }
3002
+ provides[key] = value;
3003
+ }
3004
+ }
3005
+ function inject(key, defaultValue, treatDefaultAsFactory = false) {
3006
+ const instance = getCurrentInstance();
3007
+ if (instance || currentApp) {
3008
+ let provides = currentApp ? currentApp._context.provides : instance ? instance.parent == null || instance.ce ? instance.vnode.appContext && instance.vnode.appContext.provides : instance.parent.provides : void 0;
3009
+ if (provides && key in provides) {
3010
+ return provides[key];
3011
+ } else if (arguments.length > 1) {
3012
+ return treatDefaultAsFactory && isFunction(defaultValue) ? defaultValue.call(instance && instance.proxy) : defaultValue;
3013
+ } else {
3014
+ warn$1(`injection "${String(key)}" not found.`);
3015
+ }
3016
+ } else {
3017
+ warn$1(`inject() can only be used inside setup() or functional components.`);
3018
+ }
3019
+ }
3020
+ function hasInjectionContext() {
3021
+ return !!(getCurrentInstance() || currentApp);
3022
+ }
3023
+
3024
+ const ssrContextKey = /* @__PURE__ */ Symbol.for("v-scx");
3025
+ const useSSRContext = () => {
3026
+ {
3027
+ warn$1(`useSSRContext() is not supported in the global build.`);
3028
+ }
3029
+ };
3030
+
3031
+ function watchEffect(effect, options) {
3032
+ return doWatch(effect, null, options);
3033
+ }
3034
+ function watchPostEffect(effect, options) {
3035
+ return doWatch(
3036
+ effect,
3037
+ null,
3038
+ extend({}, options, { flush: "post" })
3039
+ );
3040
+ }
3041
+ function watchSyncEffect(effect, options) {
3042
+ return doWatch(
3043
+ effect,
3044
+ null,
3045
+ extend({}, options, { flush: "sync" })
3046
+ );
3047
+ }
3048
+ function watch(source, cb, options) {
3049
+ if (!isFunction(cb)) {
3050
+ warn$1(
3051
+ `\`watch(fn, options?)\` signature has been moved to a separate API. Use \`watchEffect(fn, options?)\` instead. \`watch\` now only supports \`watch(source, cb, options?) signature.`
3052
+ );
3053
+ }
3054
+ return doWatch(source, cb, options);
3055
+ }
3056
+ function doWatch(source, cb, options = EMPTY_OBJ) {
3057
+ const { immediate, deep, flush, once } = options;
3058
+ if (!cb) {
3059
+ if (immediate !== void 0) {
3060
+ warn$1(
3061
+ `watch() "immediate" option is only respected when using the watch(source, callback, options?) signature.`
3062
+ );
3063
+ }
3064
+ if (deep !== void 0) {
3065
+ warn$1(
3066
+ `watch() "deep" option is only respected when using the watch(source, callback, options?) signature.`
3067
+ );
3068
+ }
3069
+ if (once !== void 0) {
3070
+ warn$1(
3071
+ `watch() "once" option is only respected when using the watch(source, callback, options?) signature.`
3072
+ );
3073
+ }
3074
+ }
3075
+ const baseWatchOptions = extend({}, options);
3076
+ baseWatchOptions.onWarn = warn$1;
3077
+ const instance = currentInstance;
3078
+ baseWatchOptions.call = (fn, type, args) => callWithAsyncErrorHandling(fn, instance, type, args);
3079
+ let isPre = false;
3080
+ if (flush === "post") {
3081
+ baseWatchOptions.scheduler = (job) => {
3082
+ queuePostRenderEffect(job, instance && instance.suspense);
3083
+ };
3084
+ } else if (flush !== "sync") {
3085
+ isPre = true;
3086
+ baseWatchOptions.scheduler = (job, isFirstRun) => {
3087
+ if (isFirstRun) {
3088
+ job();
3089
+ } else {
3090
+ queueJob(job);
3091
+ }
3092
+ };
3093
+ }
3094
+ baseWatchOptions.augmentJob = (job) => {
3095
+ if (cb) {
3096
+ job.flags |= 4;
3097
+ }
3098
+ if (isPre) {
3099
+ job.flags |= 2;
3100
+ if (instance) {
3101
+ job.id = instance.uid;
3102
+ job.i = instance;
3103
+ }
3104
+ }
3105
+ };
3106
+ const watchHandle = watch$1(source, cb, baseWatchOptions);
3107
+ return watchHandle;
3108
+ }
3109
+ function instanceWatch(source, value, options) {
3110
+ const publicThis = this.proxy;
3111
+ const getter = isString(source) ? source.includes(".") ? createPathGetter(publicThis, source) : () => publicThis[source] : source.bind(publicThis, publicThis);
3112
+ let cb;
3113
+ if (isFunction(value)) {
3114
+ cb = value;
3115
+ } else {
3116
+ cb = value.handler;
3117
+ options = value;
3118
+ }
3119
+ const reset = setCurrentInstance(this);
3120
+ const res = doWatch(getter, cb.bind(publicThis), options);
3121
+ reset();
3122
+ return res;
3123
+ }
3124
+ function createPathGetter(ctx, path) {
3125
+ const segments = path.split(".");
3126
+ return () => {
3127
+ let cur = ctx;
3128
+ for (let i = 0; i < segments.length && cur; i++) {
3129
+ cur = cur[segments[i]];
3130
+ }
3131
+ return cur;
3132
+ };
3133
+ }
3134
+
3135
+ const TeleportEndKey = /* @__PURE__ */ Symbol("_vte");
2991
3136
  const isTeleport = (type) => type.__isTeleport;
2992
3137
  const isTeleportDisabled = (props) => props && (props.disabled || props.disabled === "");
2993
3138
  const isTeleportDeferred = (props) => props && (props.defer || props.defer === "");
@@ -3347,8 +3492,8 @@ var Vue = (function (exports) {
3347
3492
  return targetAnchor;
3348
3493
  }
3349
3494
 
3350
- const leaveCbKey = Symbol("_leaveCb");
3351
- const enterCbKey$1 = Symbol("_enterCb");
3495
+ const leaveCbKey = /* @__PURE__ */ Symbol("_leaveCb");
3496
+ const enterCbKey$1 = /* @__PURE__ */ Symbol("_enterCb");
3352
3497
  function useTransitionState() {
3353
3498
  const state = {
3354
3499
  isMounted: false,
@@ -4879,7 +5024,9 @@ Server rendered element contains fewer child nodes than client vdom.`
4879
5024
  }
4880
5025
  function pruneCache(filter) {
4881
5026
  cache.forEach((vnode, key) => {
4882
- const name = getComponentName(vnode.type);
5027
+ const name = getComponentName(
5028
+ isAsyncWrapper(vnode) ? vnode.type.__asyncResolved || {} : vnode.type
5029
+ );
4883
5030
  if (name && !filter(name)) {
4884
5031
  pruneCacheEntry(key);
4885
5032
  }
@@ -5106,7 +5253,7 @@ Server rendered element contains fewer child nodes than client vdom.`
5106
5253
  function resolveComponent(name, maybeSelfReference) {
5107
5254
  return resolveAsset(COMPONENTS, name, true, maybeSelfReference) || name;
5108
5255
  }
5109
- const NULL_DYNAMIC_COMPONENT = Symbol.for("v-ndc");
5256
+ const NULL_DYNAMIC_COMPONENT = /* @__PURE__ */ Symbol.for("v-ndc");
5110
5257
  function resolveDynamicComponent(component) {
5111
5258
  if (isString(component)) {
5112
5259
  return resolveAsset(COMPONENTS, component, false) || component;
@@ -6267,151 +6414,6 @@ If you want to remount the same app, move your app creation logic into a factory
6267
6414
  }
6268
6415
  let currentApp = null;
6269
6416
 
6270
- function provide(key, value) {
6271
- {
6272
- if (!currentInstance || currentInstance.isMounted) {
6273
- warn$1(`provide() can only be used inside setup().`);
6274
- }
6275
- }
6276
- if (currentInstance) {
6277
- let provides = currentInstance.provides;
6278
- const parentProvides = currentInstance.parent && currentInstance.parent.provides;
6279
- if (parentProvides === provides) {
6280
- provides = currentInstance.provides = Object.create(parentProvides);
6281
- }
6282
- provides[key] = value;
6283
- }
6284
- }
6285
- function inject(key, defaultValue, treatDefaultAsFactory = false) {
6286
- const instance = getCurrentInstance();
6287
- if (instance || currentApp) {
6288
- let provides = currentApp ? currentApp._context.provides : instance ? instance.parent == null || instance.ce ? instance.vnode.appContext && instance.vnode.appContext.provides : instance.parent.provides : void 0;
6289
- if (provides && key in provides) {
6290
- return provides[key];
6291
- } else if (arguments.length > 1) {
6292
- return treatDefaultAsFactory && isFunction(defaultValue) ? defaultValue.call(instance && instance.proxy) : defaultValue;
6293
- } else {
6294
- warn$1(`injection "${String(key)}" not found.`);
6295
- }
6296
- } else {
6297
- warn$1(`inject() can only be used inside setup() or functional components.`);
6298
- }
6299
- }
6300
- function hasInjectionContext() {
6301
- return !!(getCurrentInstance() || currentApp);
6302
- }
6303
-
6304
- const ssrContextKey = Symbol.for("v-scx");
6305
- const useSSRContext = () => {
6306
- {
6307
- warn$1(`useSSRContext() is not supported in the global build.`);
6308
- }
6309
- };
6310
-
6311
- function watchEffect(effect, options) {
6312
- return doWatch(effect, null, options);
6313
- }
6314
- function watchPostEffect(effect, options) {
6315
- return doWatch(
6316
- effect,
6317
- null,
6318
- extend({}, options, { flush: "post" })
6319
- );
6320
- }
6321
- function watchSyncEffect(effect, options) {
6322
- return doWatch(
6323
- effect,
6324
- null,
6325
- extend({}, options, { flush: "sync" })
6326
- );
6327
- }
6328
- function watch(source, cb, options) {
6329
- if (!isFunction(cb)) {
6330
- warn$1(
6331
- `\`watch(fn, options?)\` signature has been moved to a separate API. Use \`watchEffect(fn, options?)\` instead. \`watch\` now only supports \`watch(source, cb, options?) signature.`
6332
- );
6333
- }
6334
- return doWatch(source, cb, options);
6335
- }
6336
- function doWatch(source, cb, options = EMPTY_OBJ) {
6337
- const { immediate, deep, flush, once } = options;
6338
- if (!cb) {
6339
- if (immediate !== void 0) {
6340
- warn$1(
6341
- `watch() "immediate" option is only respected when using the watch(source, callback, options?) signature.`
6342
- );
6343
- }
6344
- if (deep !== void 0) {
6345
- warn$1(
6346
- `watch() "deep" option is only respected when using the watch(source, callback, options?) signature.`
6347
- );
6348
- }
6349
- if (once !== void 0) {
6350
- warn$1(
6351
- `watch() "once" option is only respected when using the watch(source, callback, options?) signature.`
6352
- );
6353
- }
6354
- }
6355
- const baseWatchOptions = extend({}, options);
6356
- baseWatchOptions.onWarn = warn$1;
6357
- const instance = currentInstance;
6358
- baseWatchOptions.call = (fn, type, args) => callWithAsyncErrorHandling(fn, instance, type, args);
6359
- let isPre = false;
6360
- if (flush === "post") {
6361
- baseWatchOptions.scheduler = (job) => {
6362
- queuePostRenderEffect(job, instance && instance.suspense);
6363
- };
6364
- } else if (flush !== "sync") {
6365
- isPre = true;
6366
- baseWatchOptions.scheduler = (job, isFirstRun) => {
6367
- if (isFirstRun) {
6368
- job();
6369
- } else {
6370
- queueJob(job);
6371
- }
6372
- };
6373
- }
6374
- baseWatchOptions.augmentJob = (job) => {
6375
- if (cb) {
6376
- job.flags |= 4;
6377
- }
6378
- if (isPre) {
6379
- job.flags |= 2;
6380
- if (instance) {
6381
- job.id = instance.uid;
6382
- job.i = instance;
6383
- }
6384
- }
6385
- };
6386
- const watchHandle = watch$1(source, cb, baseWatchOptions);
6387
- return watchHandle;
6388
- }
6389
- function instanceWatch(source, value, options) {
6390
- const publicThis = this.proxy;
6391
- const getter = isString(source) ? source.includes(".") ? createPathGetter(publicThis, source) : () => publicThis[source] : source.bind(publicThis, publicThis);
6392
- let cb;
6393
- if (isFunction(value)) {
6394
- cb = value;
6395
- } else {
6396
- cb = value.handler;
6397
- options = value;
6398
- }
6399
- const reset = setCurrentInstance(this);
6400
- const res = doWatch(getter, cb.bind(publicThis), options);
6401
- reset();
6402
- return res;
6403
- }
6404
- function createPathGetter(ctx, path) {
6405
- const segments = path.split(".");
6406
- return () => {
6407
- let cur = ctx;
6408
- for (let i = 0; i < segments.length && cur; i++) {
6409
- cur = cur[segments[i]];
6410
- }
6411
- return cur;
6412
- };
6413
- }
6414
-
6415
6417
  function useModel(props, name, options = EMPTY_OBJ) {
6416
6418
  const i = getCurrentInstance();
6417
6419
  if (!i) {
@@ -7594,7 +7596,15 @@ If you want to remount the same app, move your app creation logic into a factory
7594
7596
  } else {
7595
7597
  const el = n2.el = n1.el;
7596
7598
  if (n2.children !== n1.children) {
7597
- hostSetText(el, n2.children);
7599
+ if (isHmrUpdating && n2.patchFlag === -1 && "__elIndex" in n1) {
7600
+ const childNodes = container.childNodes;
7601
+ const newChild = hostCreateText(n2.children);
7602
+ const oldChild = childNodes[n2.__elIndex = n1.__elIndex];
7603
+ hostInsert(newChild, container, oldChild);
7604
+ hostRemove(oldChild);
7605
+ } else {
7606
+ hostSetText(el, n2.children);
7607
+ }
7598
7608
  }
7599
7609
  }
7600
7610
  };
@@ -7980,7 +7990,7 @@ If you want to remount the same app, move your app creation logic into a factory
7980
7990
  } else {
7981
7991
  if (patchFlag > 0 && patchFlag & 64 && dynamicChildren && // #2715 the previous fragment could've been a BAILed one as a result
7982
7992
  // of renderSlot() with no valid children
7983
- n1.dynamicChildren) {
7993
+ n1.dynamicChildren && n1.dynamicChildren.length === dynamicChildren.length) {
7984
7994
  patchBlockChildren(
7985
7995
  n1.dynamicChildren,
7986
7996
  dynamicChildren,
@@ -8569,8 +8579,8 @@ If you want to remount the same app, move your app creation logic into a factory
8569
8579
  const nextChild = c2[nextIndex];
8570
8580
  const anchorVNode = c2[nextIndex + 1];
8571
8581
  const anchor = nextIndex + 1 < l2 ? (
8572
- // #13559, fallback to el placeholder for unresolved async component
8573
- anchorVNode.el || anchorVNode.placeholder
8582
+ // #13559, #14173 fallback to el placeholder for unresolved async component
8583
+ anchorVNode.el || resolveAsyncComponentPlaceholder(anchorVNode)
8574
8584
  ) : parentAnchor;
8575
8585
  if (newIndexToOldIndexMap[i] === 0) {
8576
8586
  patch(
@@ -8826,9 +8836,11 @@ If you want to remount the same app, move your app creation logic into a factory
8826
8836
  };
8827
8837
  let isFlushing = false;
8828
8838
  const render = (vnode, container, namespace) => {
8839
+ let instance;
8829
8840
  if (vnode == null) {
8830
8841
  if (container._vnode) {
8831
8842
  unmount(container._vnode, null, null, true);
8843
+ instance = container._vnode.component;
8832
8844
  }
8833
8845
  } else {
8834
8846
  patch(
@@ -8844,7 +8856,7 @@ If you want to remount the same app, move your app creation logic into a factory
8844
8856
  container._vnode = vnode;
8845
8857
  if (!isFlushing) {
8846
8858
  isFlushing = true;
8847
- flushPreFlushCbs();
8859
+ flushPreFlushCbs(instance);
8848
8860
  flushPostFlushCbs();
8849
8861
  isFlushing = false;
8850
8862
  }
@@ -8904,9 +8916,13 @@ If you want to remount the same app, move your app creation logic into a factory
8904
8916
  if (!shallow && c2.patchFlag !== -2)
8905
8917
  traverseStaticChildren(c1, c2);
8906
8918
  }
8907
- if (c2.type === Text && // avoid cached text nodes retaining detached dom nodes
8908
- c2.patchFlag !== -1) {
8909
- c2.el = c1.el;
8919
+ if (c2.type === Text) {
8920
+ if (c2.patchFlag !== -1) {
8921
+ c2.el = c1.el;
8922
+ } else {
8923
+ c2.__elIndex = i + // take fragment start anchor into account
8924
+ (n1.type === Fragment ? 1 : 0);
8925
+ }
8910
8926
  }
8911
8927
  if (c2.type === Comment && !c2.el) {
8912
8928
  c2.el = c1.el;
@@ -8973,6 +8989,16 @@ If you want to remount the same app, move your app creation logic into a factory
8973
8989
  hooks[i].flags |= 8;
8974
8990
  }
8975
8991
  }
8992
+ function resolveAsyncComponentPlaceholder(anchorVnode) {
8993
+ if (anchorVnode.placeholder) {
8994
+ return anchorVnode.placeholder;
8995
+ }
8996
+ const instance = anchorVnode.component;
8997
+ if (instance) {
8998
+ return resolveAsyncComponentPlaceholder(instance.subTree);
8999
+ }
9000
+ return null;
9001
+ }
8976
9002
 
8977
9003
  const isSuspense = (type) => type.__isSuspense;
8978
9004
  let suspenseId = 0;
@@ -9575,10 +9601,10 @@ If you want to remount the same app, move your app creation logic into a factory
9575
9601
  return suspensible != null && suspensible !== false;
9576
9602
  }
9577
9603
 
9578
- const Fragment = Symbol.for("v-fgt");
9579
- const Text = Symbol.for("v-txt");
9580
- const Comment = Symbol.for("v-cmt");
9581
- const Static = Symbol.for("v-stc");
9604
+ const Fragment = /* @__PURE__ */ Symbol.for("v-fgt");
9605
+ const Text = /* @__PURE__ */ Symbol.for("v-txt");
9606
+ const Comment = /* @__PURE__ */ Symbol.for("v-cmt");
9607
+ const Static = /* @__PURE__ */ Symbol.for("v-stc");
9582
9608
  const blockStack = [];
9583
9609
  let currentBlock = null;
9584
9610
  function openBlock(disableTracking = false) {
@@ -10608,7 +10634,7 @@ Component that was made reactive: `,
10608
10634
  return true;
10609
10635
  }
10610
10636
 
10611
- const version = "3.5.25";
10637
+ const version = "3.5.26";
10612
10638
  const warn = warn$1 ;
10613
10639
  const ErrorTypeStrings = ErrorTypeStrings$1 ;
10614
10640
  const devtools = devtools$1 ;
@@ -10701,7 +10727,7 @@ Component that was made reactive: `,
10701
10727
 
10702
10728
  const TRANSITION = "transition";
10703
10729
  const ANIMATION = "animation";
10704
- const vtcKey = Symbol("_vtc");
10730
+ const vtcKey = /* @__PURE__ */ Symbol("_vtc");
10705
10731
  const DOMTransitionPropsValidators = {
10706
10732
  name: String,
10707
10733
  type: String,
@@ -10994,8 +11020,8 @@ Component that was made reactive: `,
10994
11020
  }
10995
11021
  }
10996
11022
 
10997
- const vShowOriginalDisplay = Symbol("_vod");
10998
- const vShowHidden = Symbol("_vsh");
11023
+ const vShowOriginalDisplay = /* @__PURE__ */ Symbol("_vod");
11024
+ const vShowHidden = /* @__PURE__ */ Symbol("_vsh");
10999
11025
  const vShow = {
11000
11026
  // used for prop mismatch check during hydration
11001
11027
  name: "show",
@@ -11037,7 +11063,7 @@ Component that was made reactive: `,
11037
11063
  el[vShowHidden] = !value;
11038
11064
  }
11039
11065
 
11040
- const CSS_VAR_TEXT = Symbol("CSS_VAR_TEXT" );
11066
+ const CSS_VAR_TEXT = /* @__PURE__ */ Symbol("CSS_VAR_TEXT" );
11041
11067
  function useCssVars(getter) {
11042
11068
  const instance = getCurrentInstance();
11043
11069
  if (!instance) {
@@ -11287,7 +11313,7 @@ Component that was made reactive: `,
11287
11313
  function removeEventListener(el, event, handler, options) {
11288
11314
  el.removeEventListener(event, handler, options);
11289
11315
  }
11290
- const veiKey = Symbol("_vei");
11316
+ const veiKey = /* @__PURE__ */ Symbol("_vei");
11291
11317
  function patchEvent(el, rawName, prevValue, nextValue, instance = null) {
11292
11318
  const invokers = el[veiKey] || (el[veiKey] = {});
11293
11319
  const existingInvoker = invokers[rawName];
@@ -11913,8 +11939,8 @@ Expected function or array of functions, received type ${typeof value}.`
11913
11939
 
11914
11940
  const positionMap = /* @__PURE__ */ new WeakMap();
11915
11941
  const newPositionMap = /* @__PURE__ */ new WeakMap();
11916
- const moveCbKey = Symbol("_moveCb");
11917
- const enterCbKey = Symbol("_enterCb");
11942
+ const moveCbKey = /* @__PURE__ */ Symbol("_moveCb");
11943
+ const enterCbKey = /* @__PURE__ */ Symbol("_enterCb");
11918
11944
  const decorate = (t) => {
11919
11945
  delete t.props.mode;
11920
11946
  return t;
@@ -12067,7 +12093,7 @@ Expected function or array of functions, received type ${typeof value}.`
12067
12093
  target.dispatchEvent(new Event("input"));
12068
12094
  }
12069
12095
  }
12070
- const assignKey = Symbol("_assign");
12096
+ const assignKey = /* @__PURE__ */ Symbol("_assign");
12071
12097
  function castValue(value, trim, number) {
12072
12098
  if (trim) value = value.trim();
12073
12099
  if (number) value = looseToNumber(value);