@vuact/runtime-dom 3.5.46-vuact.0 → 3.5.47-vuact.0

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.46
2
+ * @vue/runtime-dom v3.5.47
3
3
  * (c) 2018-present Yuxi (Evan) You and Vue contributors
4
4
  * @license MIT
5
5
  **/
@@ -2046,8 +2046,14 @@ const keyNames = {
2046
2046
  const withKeys = (fn, modifiers) => {
2047
2047
  const cache = fn._withKeys || (fn._withKeys = {});
2048
2048
  const cacheKey = modifiers.join(".");
2049
- return cache[cacheKey] || (cache[cacheKey] = ((event) => {
2049
+ const cached = cache[cacheKey];
2050
+ if (cached) return cached;
2051
+ const hasButtonModifier = modifiers.some((m) => m === "left" || m === "right");
2052
+ return cache[cacheKey] = ((event) => {
2050
2053
  if (!("key" in event)) {
2054
+ if (hasButtonModifier) {
2055
+ return fn(event);
2056
+ }
2051
2057
  return;
2052
2058
  }
2053
2059
  const eventKey = hyphenate(event.key);
@@ -2056,7 +2062,7 @@ const withKeys = (fn, modifiers) => {
2056
2062
  )) {
2057
2063
  return fn(event);
2058
2064
  }
2059
- }));
2065
+ });
2060
2066
  };
2061
2067
 
2062
2068
  const rendererOptions = /* @__PURE__ */ extend({ patchProp }, nodeOps);
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @vue/runtime-dom v3.5.46
2
+ * @vue/runtime-dom v3.5.47
3
3
  * (c) 2018-present Yuxi (Evan) You and Vue contributors
4
4
  * @license MIT
5
5
  **/
@@ -145,6 +145,7 @@ var VueRuntimeDOM = (function (exports) {
145
145
  });
146
146
  return ret;
147
147
  }
148
+ const vendorPrefixRE = /^(?:webkit|moz|ms)-/;
148
149
  function stringifyStyle(styles) {
149
150
  if (!styles) return "";
150
151
  if (isString(styles)) return styles;
@@ -152,7 +153,10 @@ var VueRuntimeDOM = (function (exports) {
152
153
  for (const key in styles) {
153
154
  const value = styles[key];
154
155
  if (isString(value) || typeof value === "number") {
155
- const normalizedKey = key.startsWith(`--`) ? key : hyphenate(key);
156
+ let normalizedKey = key.startsWith(`--`) ? key : hyphenate(key);
157
+ if (vendorPrefixRE.test(normalizedKey)) {
158
+ normalizedKey = `-${normalizedKey}`;
159
+ }
156
160
  ret += `${normalizedKey}:${value};`;
157
161
  }
158
162
  }
@@ -200,7 +204,7 @@ var VueRuntimeDOM = (function (exports) {
200
204
  const specialBooleanAttrs = `itemscope,allowfullscreen,disablepictureinpicture,disableremoteplayback,formnovalidate,ismap,nomodule,novalidate,playsinline,readonly`;
201
205
  const isSpecialBooleanAttr = /* @__PURE__ */ makeMap(specialBooleanAttrs);
202
206
  const isBooleanAttr = /* @__PURE__ */ makeMap(
203
- specialBooleanAttrs + `,async,autofocus,autoplay,controls,default,defer,disabled,inert,loop,open,required,reversed,scoped,seamless,checked,muted,multiple,selected`
207
+ specialBooleanAttrs + `,async,autofocus,autoplay,controls,default,defer,disabled,inert,loop,open,required,reversed,scoped,seamless,checked,muted,multiple,selected,webkitdirectory`
204
208
  );
205
209
  function includeBooleanAttr(value) {
206
210
  return !!value || value === "";
@@ -216,7 +220,9 @@ var VueRuntimeDOM = (function (exports) {
216
220
  return false;
217
221
  }
218
222
  const type = typeof value;
219
- return type === "string" || type === "number" || type === "boolean";
223
+ return type === "string" || type === "number" || type === "boolean" || // bigint stringifies the same way on both sides (`setAttribute`/property
224
+ // assignment on the client, `escapeHtml` during SSR)
225
+ type === "bigint";
220
226
  }
221
227
 
222
228
  const cssVarNameEscapeSymbolsRE = /[ !"#$%&'()*+,./:;<=>?@[\\\]^`{|}~]/g;
@@ -1131,16 +1137,17 @@ var VueRuntimeDOM = (function (exports) {
1131
1137
  track(arr = toRaw(arr), "iterate", ARRAY_ITERATE_KEY);
1132
1138
  return arr;
1133
1139
  }
1134
- function toWrapped(target, item) {
1140
+ const toReadonlyReactive = (item) => toReadonly(toReactive(item));
1141
+ function getWrapper(target) {
1135
1142
  if (isReadonly(target)) {
1136
- return isReactive(target) ? toReadonly(toReactive(item)) : toReadonly(item);
1143
+ return isReactive(target) ? toReadonlyReactive : toReadonly;
1137
1144
  }
1138
- return toReactive(item);
1145
+ return toReactive;
1139
1146
  }
1140
1147
  const arrayInstrumentations = {
1141
1148
  __proto__: null,
1142
1149
  [Symbol.iterator]() {
1143
- return iterator(this, Symbol.iterator, (item) => toWrapped(this, item));
1150
+ return iterator(this, Symbol.iterator, getWrapper(this));
1144
1151
  },
1145
1152
  concat(...args) {
1146
1153
  return reactiveReadArray(this).concat(
@@ -1148,8 +1155,9 @@ var VueRuntimeDOM = (function (exports) {
1148
1155
  );
1149
1156
  },
1150
1157
  entries() {
1158
+ const wrap = getWrapper(this);
1151
1159
  return iterator(this, "entries", (value) => {
1152
- value[1] = toWrapped(this, value[1]);
1160
+ value[1] = wrap(value[1]);
1153
1161
  return value;
1154
1162
  });
1155
1163
  },
@@ -1162,7 +1170,7 @@ var VueRuntimeDOM = (function (exports) {
1162
1170
  "filter",
1163
1171
  fn,
1164
1172
  thisArg,
1165
- (v) => v.map((item) => toWrapped(this, item)),
1173
+ (v) => v.map(getWrapper(this)),
1166
1174
  arguments
1167
1175
  );
1168
1176
  },
@@ -1172,7 +1180,8 @@ var VueRuntimeDOM = (function (exports) {
1172
1180
  "find",
1173
1181
  fn,
1174
1182
  thisArg,
1175
- (item) => toWrapped(this, item),
1183
+ // only the found item is wrapped, so read the flags only then
1184
+ (item) => getWrapper(this)(item),
1176
1185
  arguments
1177
1186
  );
1178
1187
  },
@@ -1185,7 +1194,8 @@ var VueRuntimeDOM = (function (exports) {
1185
1194
  "findLast",
1186
1195
  fn,
1187
1196
  thisArg,
1188
- (item) => toWrapped(this, item),
1197
+ // only the found item is wrapped, so read the flags only then
1198
+ (item) => getWrapper(this)(item),
1189
1199
  arguments
1190
1200
  );
1191
1201
  },
@@ -1247,7 +1257,7 @@ var VueRuntimeDOM = (function (exports) {
1247
1257
  return noTracking(this, "unshift", args);
1248
1258
  },
1249
1259
  values() {
1250
- return iterator(this, "values", (item) => toWrapped(this, item));
1260
+ return iterator(this, "values", getWrapper(this));
1251
1261
  }
1252
1262
  };
1253
1263
  function iterator(self, method, wrapValue) {
@@ -1299,8 +1309,9 @@ var VueRuntimeDOM = (function (exports) {
1299
1309
  let wrappedFn = fn;
1300
1310
  if (arr !== self) {
1301
1311
  if (needsWrap) {
1312
+ const wrap = getWrapper(self);
1302
1313
  wrappedFn = function(item, index) {
1303
- return fn.call(this, toWrapped(self, item), index, self);
1314
+ return fn.call(this, wrap(item), index, self);
1304
1315
  };
1305
1316
  } else if (fn.length > 2) {
1306
1317
  wrappedFn = function(item, index) {
@@ -1318,13 +1329,14 @@ var VueRuntimeDOM = (function (exports) {
1318
1329
  let wrapInitialAccumulator = false;
1319
1330
  if (arr !== self) {
1320
1331
  if (needsWrap) {
1332
+ const wrap = getWrapper(self);
1321
1333
  wrapInitialAccumulator = args.length === 0;
1322
1334
  wrappedFn = function(acc, item, index) {
1323
1335
  if (wrapInitialAccumulator) {
1324
1336
  wrapInitialAccumulator = false;
1325
- acc = toWrapped(self, acc);
1337
+ acc = wrap(acc);
1326
1338
  }
1327
- return fn.call(this, acc, toWrapped(self, item), index, self);
1339
+ return fn.call(this, acc, wrap(item), index, self);
1328
1340
  };
1329
1341
  } else if (fn.length > 3) {
1330
1342
  wrappedFn = function(acc, item, index) {
@@ -1333,7 +1345,7 @@ var VueRuntimeDOM = (function (exports) {
1333
1345
  }
1334
1346
  }
1335
1347
  const result = arr[method](wrappedFn, ...args);
1336
- return wrapInitialAccumulator ? toWrapped(self, result) : result;
1348
+ return wrapInitialAccumulator ? getWrapper(self)(result) : result;
1337
1349
  }
1338
1350
  function searchProxy(self, method, args) {
1339
1351
  const arr = toRaw(self);
@@ -2175,7 +2187,7 @@ var VueRuntimeDOM = (function (exports) {
2175
2187
  }
2176
2188
  }
2177
2189
  function watch$1(source, cb, options = EMPTY_OBJ) {
2178
- const { immediate, deep, once, scheduler, augmentJob, call } = options;
2190
+ const { immediate, deep, once, scheduler, augmentJob, call, onStop } = options;
2179
2191
  const warnInvalidSource = (s) => {
2180
2192
  (options.onWarn || warn$2)(
2181
2193
  `Invalid watch source: `,
@@ -2244,7 +2256,7 @@ var VueRuntimeDOM = (function (exports) {
2244
2256
  if (cb && deep) {
2245
2257
  const baseGetter = getter;
2246
2258
  const depth = deep === true ? Infinity : deep;
2247
- getter = () => traverse(baseGetter(), depth);
2259
+ getter = () => traverse(baseGetter(), isMultiSource ? depth + 1 : depth);
2248
2260
  }
2249
2261
  const scope = getCurrentScope();
2250
2262
  const watchHandle = () => {
@@ -2253,9 +2265,11 @@ var VueRuntimeDOM = (function (exports) {
2253
2265
  remove(scope.effects, effect);
2254
2266
  }
2255
2267
  };
2268
+ let onceCallbackInvoked = false;
2256
2269
  if (once && cb) {
2257
2270
  const _cb = cb;
2258
2271
  cb = (...args) => {
2272
+ onceCallbackInvoked = true;
2259
2273
  try {
2260
2274
  return _cb(...args);
2261
2275
  } finally {
@@ -2265,7 +2279,7 @@ var VueRuntimeDOM = (function (exports) {
2265
2279
  }
2266
2280
  let oldValue = isMultiSource ? new Array(source.length).fill(INITIAL_WATCHER_VALUE) : INITIAL_WATCHER_VALUE;
2267
2281
  const job = (immediateFirstRun) => {
2268
- if (!(effect.flags & 1) || !effect.dirty && !immediateFirstRun) {
2282
+ if (onceCallbackInvoked || !(effect.flags & 1) || !effect.dirty && !immediateFirstRun) {
2269
2283
  return;
2270
2284
  }
2271
2285
  if (cb) {
@@ -2315,6 +2329,12 @@ var VueRuntimeDOM = (function (exports) {
2315
2329
  cleanupMap.delete(effect);
2316
2330
  }
2317
2331
  };
2332
+ if (onStop) {
2333
+ effect.onStop = () => {
2334
+ cleanup();
2335
+ onStop();
2336
+ };
2337
+ }
2318
2338
  {
2319
2339
  effect.onTrack = options.onTrack;
2320
2340
  effect.onTrigger = options.onTrigger;
@@ -2348,8 +2368,17 @@ var VueRuntimeDOM = (function (exports) {
2348
2368
  if (isRef(value)) {
2349
2369
  traverse(value.value, depth, seen);
2350
2370
  } else if (isArray(value)) {
2351
- for (let i = 0; i < value.length; i++) {
2352
- traverse(value[i], depth, seen);
2371
+ if (isReactive(value) && !isReadonly(value) && !isShallow(value)) {
2372
+ const raw = toRaw(value);
2373
+ track(raw, "iterate", ARRAY_ITERATE_KEY);
2374
+ for (let i = 0; i < raw.length; i++) {
2375
+ const item = raw[i];
2376
+ traverse(isRef(item) ? item : toReactive(item), depth, seen);
2377
+ }
2378
+ } else {
2379
+ for (let i = 0; i < value.length; i++) {
2380
+ traverse(value[i], depth, seen);
2381
+ }
2353
2382
  }
2354
2383
  } else if (isSet(value) || isMap(value)) {
2355
2384
  value.forEach((v) => {
@@ -2359,8 +2388,9 @@ var VueRuntimeDOM = (function (exports) {
2359
2388
  for (const key in value) {
2360
2389
  traverse(value[key], depth, seen);
2361
2390
  }
2362
- for (const key of Object.getOwnPropertySymbols(value)) {
2363
- if (Object.prototype.propertyIsEnumerable.call(value, key)) {
2391
+ const raw = toRaw(value);
2392
+ for (const key of Object.getOwnPropertySymbols(raw)) {
2393
+ if (Object.prototype.propertyIsEnumerable.call(raw, key)) {
2364
2394
  traverse(value[key], depth, seen);
2365
2395
  }
2366
2396
  }
@@ -3289,7 +3319,27 @@ var VueRuntimeDOM = (function (exports) {
3289
3319
  }
3290
3320
  const baseWatchOptions = extend({}, options);
3291
3321
  baseWatchOptions.onWarn = warn$1;
3292
- const instance = currentInstance;
3322
+ let instance = currentInstance;
3323
+ let watcherJob;
3324
+ if (instance && getCurrentScope() !== instance.scope) {
3325
+ if (instance.scope.active) {
3326
+ const ownerScope = instance.scope.run(() => new EffectScope());
3327
+ ownerScope.run(
3328
+ () => onScopeDispose(
3329
+ () => (
3330
+ // deferred: the watchers this unmount stops still report to the owner
3331
+ Promise.resolve().then(() => {
3332
+ instance = null;
3333
+ if (watcherJob) watcherJob.i = null;
3334
+ })
3335
+ )
3336
+ )
3337
+ );
3338
+ baseWatchOptions.onStop = () => ownerScope.stop();
3339
+ } else {
3340
+ instance = null;
3341
+ }
3342
+ }
3293
3343
  baseWatchOptions.call = (fn, type, args) => callWithAsyncErrorHandling(fn, instance, type, args);
3294
3344
  let isPre = false;
3295
3345
  if (flush === "post") {
@@ -3308,6 +3358,7 @@ var VueRuntimeDOM = (function (exports) {
3308
3358
  };
3309
3359
  }
3310
3360
  baseWatchOptions.augmentJob = (job) => {
3361
+ watcherJob = job;
3311
3362
  if (cb) {
3312
3363
  job.flags |= 4;
3313
3364
  }
@@ -3670,17 +3721,20 @@ var VueRuntimeDOM = (function (exports) {
3670
3721
  } else {
3671
3722
  vnode.anchor = nextSibling(node);
3672
3723
  hydrateAnchor(target, targetNode);
3673
- if (!vnode.targetAnchor) {
3724
+ const hasSSRAnchor = !!vnode.targetAnchor;
3725
+ if (!hasSSRAnchor) {
3674
3726
  prepareAnchor(target, vnode, createText, insert);
3675
3727
  }
3676
3728
  hydrateChildren(
3677
- targetNode && nextSibling(targetNode),
3729
+ // #15937 without SSR anchors, mount instead of hydrating unrelated nodes.
3730
+ hasSSRAnchor ? targetNode && nextSibling(targetNode) : null,
3678
3731
  vnode,
3679
3732
  target,
3680
3733
  parentComponent,
3681
3734
  parentSuspense,
3682
3735
  slotScopeIds,
3683
- optimized
3736
+ optimized,
3737
+ vnode.targetAnchor
3684
3738
  );
3685
3739
  }
3686
3740
  }
@@ -3832,11 +3886,13 @@ var VueRuntimeDOM = (function (exports) {
3832
3886
  earlyRemove();
3833
3887
  el[leaveCbKey] = void 0;
3834
3888
  delete enterHooks.delayedLeave;
3889
+ delete leavingHooks.delayLeave;
3835
3890
  oldInnerChild = void 0;
3836
3891
  };
3837
3892
  enterHooks.delayedLeave = () => {
3838
3893
  delayedLeave();
3839
3894
  delete enterHooks.delayedLeave;
3895
+ delete leavingHooks.delayLeave;
3840
3896
  oldInnerChild = void 0;
3841
3897
  };
3842
3898
  };
@@ -4453,7 +4509,7 @@ var VueRuntimeDOM = (function (exports) {
4453
4509
  }
4454
4510
  return isFragmentStart ? nextSibling(nextNode) : nextNode;
4455
4511
  } else {
4456
- onMismatch();
4512
+ nextNode = onMismatch();
4457
4513
  }
4458
4514
  break;
4459
4515
  case Fragment:
@@ -4667,15 +4723,19 @@ Server rendered element contains more child nodes than client vdom.`
4667
4723
  }
4668
4724
  return el.nextSibling;
4669
4725
  };
4670
- const hydrateChildren = (node, parentVNode, container, parentComponent, parentSuspense, slotScopeIds, optimized) => {
4726
+ const hydrateChildren = (node, parentVNode, container, parentComponent, parentSuspense, slotScopeIds, optimized, anchor) => {
4671
4727
  optimized = optimized || !!parentVNode.dynamicChildren;
4672
4728
  const children = parentVNode.children;
4673
4729
  const l = children.length;
4730
+ const isFragment = parentVNode.type === Fragment;
4674
4731
  let hasCheckedMismatch = false;
4675
4732
  for (let i = 0; i < l; i++) {
4676
4733
  const vnode = optimized ? children[i] : children[i] = normalizeVNode(children[i]);
4677
4734
  const isText = vnode.type === Text;
4678
- if (node) {
4735
+ if (isFragment && node && isComment(node) && node.data === "]") {
4736
+ anchor = node;
4737
+ }
4738
+ if (node && node !== anchor) {
4679
4739
  if (isText && !optimized) {
4680
4740
  if (i + 1 < l && normalizeVNode(children[i + 1]).type === Text) {
4681
4741
  insert(
@@ -4697,7 +4757,7 @@ Server rendered element contains more child nodes than client vdom.`
4697
4757
  optimized
4698
4758
  );
4699
4759
  } else if (isText && !vnode.children) {
4700
- insert(vnode.el = createText(""), container);
4760
+ insert(vnode.el = createText(""), container, anchor);
4701
4761
  } else {
4702
4762
  if (!hasCheckedMismatch) {
4703
4763
  hasCheckedMismatch = true;
@@ -4715,7 +4775,7 @@ Server rendered element contains fewer child nodes than client vdom.`
4715
4775
  null,
4716
4776
  vnode,
4717
4777
  container,
4718
- null,
4778
+ anchor,
4719
4779
  parentComponent,
4720
4780
  parentSuspense,
4721
4781
  getContainerType(container),
@@ -5410,7 +5470,7 @@ Server rendered element contains fewer child nodes than client vdom.`
5410
5470
  const cached = cache.get(key);
5411
5471
  if (cached && (!current || !isSameVNodeType(cached, current))) {
5412
5472
  unmount(cached);
5413
- } else if (current) {
5473
+ } else if (current && (current.key == null ? current.type : current.key) === key) {
5414
5474
  resetShapeFlag(current);
5415
5475
  if (cached) resetShapeFlag(cached);
5416
5476
  }
@@ -9769,6 +9829,8 @@ If you want to remount the same app, move your app creation logic into a factory
9769
9829
  optimized
9770
9830
  );
9771
9831
  suspense.resolve(true);
9832
+ suspense.pendingId = suspenseId++;
9833
+ suspense.deps = 0;
9772
9834
  } else {
9773
9835
  patch(
9774
9836
  null,
@@ -11321,7 +11383,7 @@ Component that was made reactive: `,
11321
11383
  return true;
11322
11384
  }
11323
11385
 
11324
- const version = "3.5.46";
11386
+ const version = "3.5.47";
11325
11387
  const warn = warn$1 ;
11326
11388
  const ErrorTypeStrings = ErrorTypeStrings$1 ;
11327
11389
  const devtools = devtools$1 ;
@@ -13317,8 +13379,14 @@ Expected function or array of functions, received type ${typeof value}.`
13317
13379
  const withKeys = (fn, modifiers) => {
13318
13380
  const cache = fn._withKeys || (fn._withKeys = {});
13319
13381
  const cacheKey = modifiers.join(".");
13320
- return cache[cacheKey] || (cache[cacheKey] = ((event) => {
13382
+ const cached = cache[cacheKey];
13383
+ if (cached) return cached;
13384
+ const hasButtonModifier = modifiers.some((m) => m === "left" || m === "right");
13385
+ return cache[cacheKey] = ((event) => {
13321
13386
  if (!("key" in event)) {
13387
+ if (hasButtonModifier) {
13388
+ return fn(event);
13389
+ }
13322
13390
  return;
13323
13391
  }
13324
13392
  const eventKey = hyphenate(event.key);
@@ -13327,7 +13395,7 @@ Expected function or array of functions, received type ${typeof value}.`
13327
13395
  )) {
13328
13396
  return fn(event);
13329
13397
  }
13330
- }));
13398
+ });
13331
13399
  };
13332
13400
 
13333
13401
  const rendererOptions = /* @__PURE__ */ extend({ patchProp }, nodeOps);