@cabloy/vue-runtime-core 3.4.24 → 3.4.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,11 +1,11 @@
1
1
  /**
2
- * @cabloy/vue-runtime-core v3.4.21
2
+ * @cabloy/vue-runtime-core v3.4.23
3
3
  * (c) 2018-present Yuxi (Evan) You and Vue contributors
4
4
  * @license MIT
5
5
  **/
6
6
  import { pauseTracking, resetTracking, isRef, toRaw, isShallow, isReactive, ReactiveEffect, getCurrentScope, ref, shallowReadonly, track, reactive, shallowReactive, trigger, isProxy, proxyRefs, markRaw, EffectScope, computed as computed$1, customRef, isReadonly } from '@vue/reactivity';
7
7
  export { EffectScope, ReactiveEffect, TrackOpTypes, TriggerOpTypes, customRef, effect, effectScope, getCurrentScope, isProxy, isReactive, isReadonly, isRef, isShallow, markRaw, onScopeDispose, proxyRefs, reactive, readonly, ref, shallowReactive, shallowReadonly, shallowRef, stop, toRaw, toRef, toRefs, toValue, triggerRef, unref } from '@vue/reactivity';
8
- import { isString, isFunction, isPromise, isArray, NOOP, getGlobalThis, extend, EMPTY_OBJ, toHandlerKey, looseToNumber, hyphenate, camelize, isObject, isOn, hasOwn, isModelListener, capitalize, toNumber, hasChanged, remove, isSet, isMap, isPlainObject, isBuiltInDirective, invokeArrayFns, isRegExp, isGloballyAllowed, NO, def, isReservedProp, EMPTY_ARR, toRawType, makeMap, normalizeClass, stringifyStyle, normalizeStyle, isKnownSvgAttr, isBooleanAttr, isKnownHtmlAttr, includeBooleanAttr, isRenderableAttrValue } from '@vue/shared';
8
+ import { isString, isFunction, isPromise, isArray, NOOP, getGlobalThis, extend, EMPTY_OBJ, toHandlerKey, looseToNumber, hyphenate, camelize, isObject, isOn, hasOwn, isModelListener, capitalize, toNumber, hasChanged, remove, isSet, isMap, isPlainObject, isBuiltInDirective, invokeArrayFns, isRegExp, isGloballyAllowed, NO, isReservedProp, EMPTY_ARR, toRawType, makeMap, def, normalizeClass, stringifyStyle, normalizeStyle, isKnownSvgAttr, isBooleanAttr, isKnownHtmlAttr, includeBooleanAttr, isRenderableAttrValue } from '@vue/shared';
9
9
  export { camelize, capitalize, normalizeClass, normalizeProps, normalizeStyle, toDisplayString, toHandlerKey } from '@vue/shared';
10
10
 
11
11
  const stack = [];
@@ -207,11 +207,17 @@ function callWithAsyncErrorHandling(fn, instance, type, args) {
207
207
  }
208
208
  return res;
209
209
  }
210
- const values = [];
211
- for (let i = 0; i < fn.length; i++) {
212
- values.push(callWithAsyncErrorHandling(fn[i], instance, type, args));
210
+ if (isArray(fn)) {
211
+ const values = [];
212
+ for (let i = 0; i < fn.length; i++) {
213
+ values.push(callWithAsyncErrorHandling(fn[i], instance, type, args));
214
+ }
215
+ return values;
216
+ } else if (!!(process.env.NODE_ENV !== "production")) {
217
+ warn$1(
218
+ `Invalid value type passed to callWithAsyncErrorHandling(): ${typeof fn}`
219
+ );
213
220
  }
214
- return values;
215
221
  }
216
222
  function handleError(err, instance, type, throwInDev = true) {
217
223
  const contextVNode = instance ? instance.vnode : null;
@@ -2400,11 +2406,19 @@ function emptyPlaceholder(vnode) {
2400
2406
  }
2401
2407
  }
2402
2408
  function getKeepAliveChild(vnode) {
2403
- return isKeepAlive(vnode) ? (
2404
- // #7121 ensure get the child component subtree in case
2405
- // it's been replaced during HMR
2406
- !!(process.env.NODE_ENV !== "production") && vnode.component ? vnode.component.subTree : vnode.children ? vnode.children[0] : void 0
2407
- ) : vnode;
2409
+ if (!isKeepAlive(vnode)) {
2410
+ return vnode;
2411
+ }
2412
+ if (!!(process.env.NODE_ENV !== "production") && vnode.component) {
2413
+ return vnode.component.subTree;
2414
+ }
2415
+ const { shapeFlag, children } = vnode;
2416
+ if (shapeFlag & 16) {
2417
+ return children[0];
2418
+ }
2419
+ if (shapeFlag & 32 && isFunction(children.default)) {
2420
+ return children.default();
2421
+ }
2408
2422
  }
2409
2423
  function setTransitionHooks(vnode, hooks) {
2410
2424
  if (vnode.shapeFlag & 6 && vnode.component) {
@@ -2726,7 +2740,7 @@ const KeepAliveImpl = {
2726
2740
  return () => {
2727
2741
  pendingCacheKey = null;
2728
2742
  if (!slots.default) {
2729
- return null;
2743
+ return current = null;
2730
2744
  }
2731
2745
  const children = slots.default();
2732
2746
  const rawVNode = children[0];
@@ -3039,6 +3053,9 @@ const isReservedPrefix = (key) => key === "_" || key === "$";
3039
3053
  const hasSetupBinding = (state, key) => state !== EMPTY_OBJ && !state.__isScriptSetup && hasOwn(state, key);
3040
3054
  const PublicInstanceProxyHandlers = {
3041
3055
  get({ _: instance }, key) {
3056
+ if (key === "__v_skip") {
3057
+ return true;
3058
+ }
3042
3059
  const { ctx, setupState, data, props, accessCache, type, appContext } = instance;
3043
3060
  if (!!(process.env.NODE_ENV !== "production") && key === "__isVue") {
3044
3061
  return true;
@@ -3081,7 +3098,7 @@ const PublicInstanceProxyHandlers = {
3081
3098
  let cssModule, globalProperties;
3082
3099
  if (publicGetter) {
3083
3100
  if (key === "$attrs") {
3084
- track(instance, "get", key);
3101
+ track(instance.attrs, "get", "");
3085
3102
  !!(process.env.NODE_ENV !== "production") && markAttrsAccessed();
3086
3103
  } else if (!!(process.env.NODE_ENV !== "production") && key === "$slots") {
3087
3104
  track(instance, "get", key);
@@ -4010,10 +4027,13 @@ function hasInjectionContext() {
4010
4027
  return !!(currentInstance || currentRenderingInstance || currentApp);
4011
4028
  }
4012
4029
 
4030
+ const internalObjectProto = /* @__PURE__ */ Object.create(null);
4031
+ const createInternalObject = () => Object.create(internalObjectProto);
4032
+ const isInternalObject = (obj) => Object.getPrototypeOf(obj) === internalObjectProto;
4033
+
4013
4034
  function initProps(instance, rawProps, isStateful, isSSR = false) {
4014
4035
  const props = {};
4015
- const attrs = {};
4016
- def(attrs, InternalObjectKey, 1);
4036
+ const attrs = createInternalObject();
4017
4037
  instance.propsDefaults = /* @__PURE__ */ Object.create(null);
4018
4038
  setFullProps(instance, rawProps, props, attrs);
4019
4039
  for (const key in instance.propsOptions[0]) {
@@ -4128,7 +4148,7 @@ function updateProps(instance, rawProps, rawPrevProps, optimized) {
4128
4148
  }
4129
4149
  }
4130
4150
  if (hasAttrsChanged) {
4131
- trigger(instance, "set", "$attrs");
4151
+ trigger(instance.attrs, "set", "");
4132
4152
  }
4133
4153
  if (!!(process.env.NODE_ENV !== "production")) {
4134
4154
  validateProps(rawProps || {}, props, instance);
@@ -4460,23 +4480,18 @@ const normalizeVNodeSlots = (instance, children) => {
4460
4480
  instance.slots.default = () => normalized;
4461
4481
  };
4462
4482
  const initSlots = (instance, children) => {
4483
+ const slots = instance.slots = createInternalObject();
4463
4484
  if (instance.vnode.shapeFlag & 32) {
4464
4485
  const type = children._;
4465
4486
  if (type) {
4466
- instance.slots = toRaw(children);
4467
- def(children, "_", type);
4487
+ extend(slots, children);
4488
+ def(slots, "_", type);
4468
4489
  } else {
4469
- normalizeObjectSlots(
4470
- children,
4471
- instance.slots = {});
4472
- }
4473
- } else {
4474
- instance.slots = {};
4475
- if (children) {
4476
- normalizeVNodeSlots(instance, children);
4490
+ normalizeObjectSlots(children, slots);
4477
4491
  }
4492
+ } else if (children) {
4493
+ normalizeVNodeSlots(instance, children);
4478
4494
  }
4479
- def(instance.slots, InternalObjectKey, 1);
4480
4495
  };
4481
4496
  const updateSlots = (instance, children, optimized) => {
4482
4497
  const { vnode, slots } = instance;
@@ -4648,6 +4663,7 @@ function createHydrationFunctions(rendererInternals) {
4648
4663
  }
4649
4664
  };
4650
4665
  const hydrateNode = (node, vnode, parentComponent, parentSuspense, slotScopeIds, optimized = false) => {
4666
+ optimized = optimized || !!vnode.dynamicChildren;
4651
4667
  const isFragmentStart = isComment(node) && node.data === "[";
4652
4668
  const onMismatch = () => handleMismatch(
4653
4669
  node,
@@ -4893,9 +4909,9 @@ Server rendered element contains more child nodes than client vdom.`
4893
4909
  }
4894
4910
  }
4895
4911
  if (props) {
4896
- if (!!(process.env.NODE_ENV !== "production") || forcePatch || !optimized || patchFlag & (16 | 32)) {
4912
+ if (!!(process.env.NODE_ENV !== "production") || __VUE_PROD_HYDRATION_MISMATCH_DETAILS__ || forcePatch || !optimized || patchFlag & (16 | 32)) {
4897
4913
  for (const key in props) {
4898
- if (!!(process.env.NODE_ENV !== "production") && propHasMismatch(el, key, props[key], vnode, parentComponent)) {
4914
+ if ((!!(process.env.NODE_ENV !== "production") || __VUE_PROD_HYDRATION_MISMATCH_DETAILS__) && propHasMismatch(el, key, props[key], vnode, parentComponent)) {
4899
4915
  hasMismatch = true;
4900
4916
  }
4901
4917
  if (forcePatch && (key.endsWith("value") || key === "indeterminate") || isOn(key) && !isReservedProp(key) || // force hydrate v-bind with .prop modifiers
@@ -7130,7 +7146,6 @@ const createVNodeWithArgsTransform = (...args) => {
7130
7146
  ...vnodeArgsTransformer ? vnodeArgsTransformer(args, currentRenderingInstance) : args
7131
7147
  );
7132
7148
  };
7133
- const InternalObjectKey = `__vInternal`;
7134
7149
  const normalizeKey = ({ key }) => key != null ? key : null;
7135
7150
  const normalizeRef = ({
7136
7151
  ref,
@@ -7263,7 +7278,7 @@ Component that was made reactive: `,
7263
7278
  function guardReactiveProps(props) {
7264
7279
  if (!props)
7265
7280
  return null;
7266
- return isProxy(props) || InternalObjectKey in props ? extend({}, props) : props;
7281
+ return isProxy(props) || isInternalObject(props) ? extend({}, props) : props;
7267
7282
  }
7268
7283
  function cloneVNode(vnode, extraProps, mergeRef = false) {
7269
7284
  const { props, ref, patchFlag, children } = vnode;
@@ -7368,7 +7383,7 @@ function normalizeChildren(vnode, children) {
7368
7383
  } else {
7369
7384
  type = 32;
7370
7385
  const slotFlag = children._;
7371
- if (!slotFlag && !(InternalObjectKey in children)) {
7386
+ if (!slotFlag && !isInternalObject(children)) {
7372
7387
  children._ctx = currentRenderingInstance;
7373
7388
  } else if (slotFlag === 3 && currentRenderingInstance) {
7374
7389
  if (currentRenderingInstance.slots._ === 1) {
@@ -7606,7 +7621,7 @@ function setupStatefulComponent(instance, isSSR) {
7606
7621
  }
7607
7622
  }
7608
7623
  instance.accessCache = /* @__PURE__ */ Object.create(null);
7609
- instance.proxy = markRaw(new Proxy(instance.ctx, PublicInstanceProxyHandlers));
7624
+ instance.proxy = new Proxy(instance.ctx, PublicInstanceProxyHandlers);
7610
7625
  if (!!(process.env.NODE_ENV !== "production")) {
7611
7626
  exposePropsOnRenderContext(instance);
7612
7627
  }
@@ -7740,31 +7755,26 @@ function finishComponentSetup(instance, isSSR, skipOptions) {
7740
7755
  }
7741
7756
  }
7742
7757
  }
7743
- function getAttrsProxy(instance) {
7744
- return instance.attrsProxy || (instance.attrsProxy = new Proxy(
7745
- instance.attrs,
7746
- !!(process.env.NODE_ENV !== "production") ? {
7747
- get(target, key) {
7748
- markAttrsAccessed();
7749
- track(instance, "get", "$attrs");
7750
- return target[key];
7751
- },
7752
- set() {
7753
- warn$1(`setupContext.attrs is readonly.`);
7754
- return false;
7755
- },
7756
- deleteProperty() {
7757
- warn$1(`setupContext.attrs is readonly.`);
7758
- return false;
7759
- }
7760
- } : {
7761
- get(target, key) {
7762
- track(instance, "get", "$attrs");
7763
- return target[key];
7764
- }
7765
- }
7766
- ));
7767
- }
7758
+ const attrsProxyHandlers = !!(process.env.NODE_ENV !== "production") ? {
7759
+ get(target, key) {
7760
+ markAttrsAccessed();
7761
+ track(target, "get", "");
7762
+ return target[key];
7763
+ },
7764
+ set() {
7765
+ warn$1(`setupContext.attrs is readonly.`);
7766
+ return false;
7767
+ },
7768
+ deleteProperty() {
7769
+ warn$1(`setupContext.attrs is readonly.`);
7770
+ return false;
7771
+ }
7772
+ } : {
7773
+ get(target, key) {
7774
+ track(target, "get", "");
7775
+ return target[key];
7776
+ }
7777
+ };
7768
7778
  function getSlotsProxy(instance) {
7769
7779
  return instance.slotsProxy || (instance.slotsProxy = new Proxy(instance.slots, {
7770
7780
  get(target, key) {
@@ -7798,9 +7808,10 @@ function createSetupContext(instance) {
7798
7808
  instance.exposed = exposed || {};
7799
7809
  };
7800
7810
  if (!!(process.env.NODE_ENV !== "production")) {
7811
+ let attrsProxy;
7801
7812
  return Object.freeze({
7802
7813
  get attrs() {
7803
- return getAttrsProxy(instance);
7814
+ return attrsProxy || (attrsProxy = new Proxy(instance.attrs, attrsProxyHandlers));
7804
7815
  },
7805
7816
  get slots() {
7806
7817
  return getSlotsProxy(instance);
@@ -7812,9 +7823,7 @@ function createSetupContext(instance) {
7812
7823
  });
7813
7824
  } else {
7814
7825
  return {
7815
- get attrs() {
7816
- return getAttrsProxy(instance);
7817
- },
7826
+ attrs: new Proxy(instance.attrs, attrsProxyHandlers),
7818
7827
  slots: instance.slots,
7819
7828
  emit: instance.emit,
7820
7829
  expose
@@ -8154,7 +8163,7 @@ function isMemoSame(cached, memo) {
8154
8163
  return true;
8155
8164
  }
8156
8165
 
8157
- const version = "3.4.21";
8166
+ const version = "3.4.23";
8158
8167
  const warn = !!(process.env.NODE_ENV !== "production") ? warn$1 : NOOP;
8159
8168
  const ErrorTypeStrings = ErrorTypeStrings$1 ;
8160
8169
  const devtools = !!(process.env.NODE_ENV !== "production") || true ? devtools$1 : void 0;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cabloy/vue-runtime-core",
3
- "version": "3.4.24",
3
+ "version": "3.4.26",
4
4
  "description": "@vue/runtime-core",
5
5
  "main": "index.js",
6
6
  "module": "dist/runtime-core.esm-bundler.js",