@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
  **/
@@ -1918,8 +1918,14 @@ const keyNames = {
1918
1918
  const withKeys = (fn, modifiers) => {
1919
1919
  const cache = fn._withKeys || (fn._withKeys = {});
1920
1920
  const cacheKey = modifiers.join(".");
1921
- return cache[cacheKey] || (cache[cacheKey] = ((event) => {
1921
+ const cached = cache[cacheKey];
1922
+ if (cached) return cached;
1923
+ const hasButtonModifier = modifiers.some((m) => m === "left" || m === "right");
1924
+ return cache[cacheKey] = ((event) => {
1922
1925
  if (!("key" in event)) {
1926
+ if (hasButtonModifier) {
1927
+ return fn(event);
1928
+ }
1923
1929
  return;
1924
1930
  }
1925
1931
  const eventKey = shared.hyphenate(event.key);
@@ -1928,7 +1934,7 @@ const withKeys = (fn, modifiers) => {
1928
1934
  )) {
1929
1935
  return fn(event);
1930
1936
  }
1931
- }));
1937
+ });
1932
1938
  };
1933
1939
 
1934
1940
  const rendererOptions = /* @__PURE__ */ shared.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
  **/
@@ -1816,8 +1816,14 @@ const keyNames = {
1816
1816
  const withKeys = (fn, modifiers) => {
1817
1817
  const cache = fn._withKeys || (fn._withKeys = {});
1818
1818
  const cacheKey = modifiers.join(".");
1819
- return cache[cacheKey] || (cache[cacheKey] = ((event) => {
1819
+ const cached = cache[cacheKey];
1820
+ if (cached) return cached;
1821
+ const hasButtonModifier = modifiers.some((m) => m === "left" || m === "right");
1822
+ return cache[cacheKey] = ((event) => {
1820
1823
  if (!("key" in event)) {
1824
+ if (hasButtonModifier) {
1825
+ return fn(event);
1826
+ }
1821
1827
  return;
1822
1828
  }
1823
1829
  const eventKey = shared.hyphenate(event.key);
@@ -1826,7 +1832,7 @@ const withKeys = (fn, modifiers) => {
1826
1832
  )) {
1827
1833
  return fn(event);
1828
1834
  }
1829
- }));
1835
+ });
1830
1836
  };
1831
1837
 
1832
1838
  const rendererOptions = /* @__PURE__ */ shared.extend({ patchProp }, nodeOps);
@@ -296,6 +296,8 @@ export type StyleValue = false | null | undefined | string | CSSProperties | Arr
296
296
  export type ClassValue = false | null | undefined | string | Record<string, any> | Array<ClassValue>;
297
297
  export interface HTMLAttributes extends AriaAttributes, EventHandlers<Events> {
298
298
  innerHTML?: string | undefined;
299
+ innerText?: string | undefined;
300
+ textContent?: string | undefined;
299
301
  class?: ClassValue | undefined;
300
302
  style?: StyleValue | undefined;
301
303
  accesskey?: string | undefined;
@@ -767,6 +769,7 @@ export interface WebViewHTMLAttributes extends HTMLAttributes {
767
769
  }
768
770
  export interface SVGAttributes extends AriaAttributes, EventHandlers<Events> {
769
771
  innerHTML?: string | undefined;
772
+ textContent?: string | undefined;
770
773
  /**
771
774
  * SVG Styling Attributes
772
775
  * @see https://www.w3.org/TR/SVG/styling.html#ElementSpecificStyling
@@ -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
  **/
@@ -142,6 +142,7 @@ function parseStringStyle(cssText) {
142
142
  });
143
143
  return ret;
144
144
  }
145
+ const vendorPrefixRE = /^(?:webkit|moz|ms)-/;
145
146
  function stringifyStyle(styles) {
146
147
  if (!styles) return "";
147
148
  if (isString(styles)) return styles;
@@ -149,7 +150,10 @@ function stringifyStyle(styles) {
149
150
  for (const key in styles) {
150
151
  const value = styles[key];
151
152
  if (isString(value) || typeof value === "number") {
152
- const normalizedKey = key.startsWith(`--`) ? key : hyphenate(key);
153
+ let normalizedKey = key.startsWith(`--`) ? key : hyphenate(key);
154
+ if (vendorPrefixRE.test(normalizedKey)) {
155
+ normalizedKey = `-${normalizedKey}`;
156
+ }
153
157
  ret += `${normalizedKey}:${value};`;
154
158
  }
155
159
  }
@@ -197,7 +201,7 @@ const isMathMLTag = /* @__PURE__ */ makeMap(MATH_TAGS);
197
201
  const specialBooleanAttrs = `itemscope,allowfullscreen,disablepictureinpicture,disableremoteplayback,formnovalidate,ismap,nomodule,novalidate,playsinline,readonly`;
198
202
  const isSpecialBooleanAttr = /* @__PURE__ */ makeMap(specialBooleanAttrs);
199
203
  const isBooleanAttr = /* @__PURE__ */ makeMap(
200
- specialBooleanAttrs + `,async,autofocus,autoplay,controls,default,defer,disabled,inert,loop,open,required,reversed,scoped,seamless,checked,muted,multiple,selected`
204
+ specialBooleanAttrs + `,async,autofocus,autoplay,controls,default,defer,disabled,inert,loop,open,required,reversed,scoped,seamless,checked,muted,multiple,selected,webkitdirectory`
201
205
  );
202
206
  function includeBooleanAttr(value) {
203
207
  return !!value || value === "";
@@ -213,7 +217,9 @@ function isRenderableAttrValue(value) {
213
217
  return false;
214
218
  }
215
219
  const type = typeof value;
216
- return type === "string" || type === "number" || type === "boolean";
220
+ return type === "string" || type === "number" || type === "boolean" || // bigint stringifies the same way on both sides (`setAttribute`/property
221
+ // assignment on the client, `escapeHtml` during SSR)
222
+ type === "bigint";
217
223
  }
218
224
 
219
225
  const cssVarNameEscapeSymbolsRE = /[ !"#$%&'()*+,./:;<=>?@[\\\]^`{|}~]/g;
@@ -1128,16 +1134,17 @@ function shallowReadArray(arr) {
1128
1134
  track(arr = toRaw(arr), "iterate", ARRAY_ITERATE_KEY);
1129
1135
  return arr;
1130
1136
  }
1131
- function toWrapped(target, item) {
1137
+ const toReadonlyReactive = (item) => toReadonly(toReactive(item));
1138
+ function getWrapper(target) {
1132
1139
  if (isReadonly(target)) {
1133
- return isReactive(target) ? toReadonly(toReactive(item)) : toReadonly(item);
1140
+ return isReactive(target) ? toReadonlyReactive : toReadonly;
1134
1141
  }
1135
- return toReactive(item);
1142
+ return toReactive;
1136
1143
  }
1137
1144
  const arrayInstrumentations = {
1138
1145
  __proto__: null,
1139
1146
  [Symbol.iterator]() {
1140
- return iterator(this, Symbol.iterator, (item) => toWrapped(this, item));
1147
+ return iterator(this, Symbol.iterator, getWrapper(this));
1141
1148
  },
1142
1149
  concat(...args) {
1143
1150
  return reactiveReadArray(this).concat(
@@ -1145,8 +1152,9 @@ const arrayInstrumentations = {
1145
1152
  );
1146
1153
  },
1147
1154
  entries() {
1155
+ const wrap = getWrapper(this);
1148
1156
  return iterator(this, "entries", (value) => {
1149
- value[1] = toWrapped(this, value[1]);
1157
+ value[1] = wrap(value[1]);
1150
1158
  return value;
1151
1159
  });
1152
1160
  },
@@ -1159,7 +1167,7 @@ const arrayInstrumentations = {
1159
1167
  "filter",
1160
1168
  fn,
1161
1169
  thisArg,
1162
- (v) => v.map((item) => toWrapped(this, item)),
1170
+ (v) => v.map(getWrapper(this)),
1163
1171
  arguments
1164
1172
  );
1165
1173
  },
@@ -1169,7 +1177,8 @@ const arrayInstrumentations = {
1169
1177
  "find",
1170
1178
  fn,
1171
1179
  thisArg,
1172
- (item) => toWrapped(this, item),
1180
+ // only the found item is wrapped, so read the flags only then
1181
+ (item) => getWrapper(this)(item),
1173
1182
  arguments
1174
1183
  );
1175
1184
  },
@@ -1182,7 +1191,8 @@ const arrayInstrumentations = {
1182
1191
  "findLast",
1183
1192
  fn,
1184
1193
  thisArg,
1185
- (item) => toWrapped(this, item),
1194
+ // only the found item is wrapped, so read the flags only then
1195
+ (item) => getWrapper(this)(item),
1186
1196
  arguments
1187
1197
  );
1188
1198
  },
@@ -1244,7 +1254,7 @@ const arrayInstrumentations = {
1244
1254
  return noTracking(this, "unshift", args);
1245
1255
  },
1246
1256
  values() {
1247
- return iterator(this, "values", (item) => toWrapped(this, item));
1257
+ return iterator(this, "values", getWrapper(this));
1248
1258
  }
1249
1259
  };
1250
1260
  function iterator(self, method, wrapValue) {
@@ -1296,8 +1306,9 @@ function apply(self, method, fn, thisArg, wrappedRetFn, args) {
1296
1306
  let wrappedFn = fn;
1297
1307
  if (arr !== self) {
1298
1308
  if (needsWrap) {
1309
+ const wrap = getWrapper(self);
1299
1310
  wrappedFn = function(item, index) {
1300
- return fn.call(this, toWrapped(self, item), index, self);
1311
+ return fn.call(this, wrap(item), index, self);
1301
1312
  };
1302
1313
  } else if (fn.length > 2) {
1303
1314
  wrappedFn = function(item, index) {
@@ -1315,13 +1326,14 @@ function reduce(self, method, fn, args) {
1315
1326
  let wrapInitialAccumulator = false;
1316
1327
  if (arr !== self) {
1317
1328
  if (needsWrap) {
1329
+ const wrap = getWrapper(self);
1318
1330
  wrapInitialAccumulator = args.length === 0;
1319
1331
  wrappedFn = function(acc, item, index) {
1320
1332
  if (wrapInitialAccumulator) {
1321
1333
  wrapInitialAccumulator = false;
1322
- acc = toWrapped(self, acc);
1334
+ acc = wrap(acc);
1323
1335
  }
1324
- return fn.call(this, acc, toWrapped(self, item), index, self);
1336
+ return fn.call(this, acc, wrap(item), index, self);
1325
1337
  };
1326
1338
  } else if (fn.length > 3) {
1327
1339
  wrappedFn = function(acc, item, index) {
@@ -1330,7 +1342,7 @@ function reduce(self, method, fn, args) {
1330
1342
  }
1331
1343
  }
1332
1344
  const result = arr[method](wrappedFn, ...args);
1333
- return wrapInitialAccumulator ? toWrapped(self, result) : result;
1345
+ return wrapInitialAccumulator ? getWrapper(self)(result) : result;
1334
1346
  }
1335
1347
  function searchProxy(self, method, args) {
1336
1348
  const arr = toRaw(self);
@@ -2172,7 +2184,7 @@ function onWatcherCleanup(cleanupFn, failSilently = false, owner = activeWatcher
2172
2184
  }
2173
2185
  }
2174
2186
  function watch$1(source, cb, options = EMPTY_OBJ) {
2175
- const { immediate, deep, once, scheduler, augmentJob, call } = options;
2187
+ const { immediate, deep, once, scheduler, augmentJob, call, onStop } = options;
2176
2188
  const warnInvalidSource = (s) => {
2177
2189
  (options.onWarn || warn$2)(
2178
2190
  `Invalid watch source: `,
@@ -2241,7 +2253,7 @@ function watch$1(source, cb, options = EMPTY_OBJ) {
2241
2253
  if (cb && deep) {
2242
2254
  const baseGetter = getter;
2243
2255
  const depth = deep === true ? Infinity : deep;
2244
- getter = () => traverse(baseGetter(), depth);
2256
+ getter = () => traverse(baseGetter(), isMultiSource ? depth + 1 : depth);
2245
2257
  }
2246
2258
  const scope = getCurrentScope();
2247
2259
  const watchHandle = () => {
@@ -2250,9 +2262,11 @@ function watch$1(source, cb, options = EMPTY_OBJ) {
2250
2262
  remove(scope.effects, effect);
2251
2263
  }
2252
2264
  };
2265
+ let onceCallbackInvoked = false;
2253
2266
  if (once && cb) {
2254
2267
  const _cb = cb;
2255
2268
  cb = (...args) => {
2269
+ onceCallbackInvoked = true;
2256
2270
  try {
2257
2271
  return _cb(...args);
2258
2272
  } finally {
@@ -2262,7 +2276,7 @@ function watch$1(source, cb, options = EMPTY_OBJ) {
2262
2276
  }
2263
2277
  let oldValue = isMultiSource ? new Array(source.length).fill(INITIAL_WATCHER_VALUE) : INITIAL_WATCHER_VALUE;
2264
2278
  const job = (immediateFirstRun) => {
2265
- if (!(effect.flags & 1) || !effect.dirty && !immediateFirstRun) {
2279
+ if (onceCallbackInvoked || !(effect.flags & 1) || !effect.dirty && !immediateFirstRun) {
2266
2280
  return;
2267
2281
  }
2268
2282
  if (cb) {
@@ -2312,6 +2326,12 @@ function watch$1(source, cb, options = EMPTY_OBJ) {
2312
2326
  cleanupMap.delete(effect);
2313
2327
  }
2314
2328
  };
2329
+ if (onStop) {
2330
+ effect.onStop = () => {
2331
+ cleanup();
2332
+ onStop();
2333
+ };
2334
+ }
2315
2335
  {
2316
2336
  effect.onTrack = options.onTrack;
2317
2337
  effect.onTrigger = options.onTrigger;
@@ -2345,8 +2365,17 @@ function traverse(value, depth = Infinity, seen) {
2345
2365
  if (isRef(value)) {
2346
2366
  traverse(value.value, depth, seen);
2347
2367
  } else if (isArray(value)) {
2348
- for (let i = 0; i < value.length; i++) {
2349
- traverse(value[i], depth, seen);
2368
+ if (isReactive(value) && !isReadonly(value) && !isShallow(value)) {
2369
+ const raw = toRaw(value);
2370
+ track(raw, "iterate", ARRAY_ITERATE_KEY);
2371
+ for (let i = 0; i < raw.length; i++) {
2372
+ const item = raw[i];
2373
+ traverse(isRef(item) ? item : toReactive(item), depth, seen);
2374
+ }
2375
+ } else {
2376
+ for (let i = 0; i < value.length; i++) {
2377
+ traverse(value[i], depth, seen);
2378
+ }
2350
2379
  }
2351
2380
  } else if (isSet(value) || isMap(value)) {
2352
2381
  value.forEach((v) => {
@@ -2356,8 +2385,9 @@ function traverse(value, depth = Infinity, seen) {
2356
2385
  for (const key in value) {
2357
2386
  traverse(value[key], depth, seen);
2358
2387
  }
2359
- for (const key of Object.getOwnPropertySymbols(value)) {
2360
- if (Object.prototype.propertyIsEnumerable.call(value, key)) {
2388
+ const raw = toRaw(value);
2389
+ for (const key of Object.getOwnPropertySymbols(raw)) {
2390
+ if (Object.prototype.propertyIsEnumerable.call(raw, key)) {
2361
2391
  traverse(value[key], depth, seen);
2362
2392
  }
2363
2393
  }
@@ -3307,7 +3337,27 @@ function doWatch(source, cb, options = EMPTY_OBJ) {
3307
3337
  return watchStopHandle;
3308
3338
  }
3309
3339
  }
3310
- const instance = currentInstance;
3340
+ let instance = currentInstance;
3341
+ let watcherJob;
3342
+ if (instance && getCurrentScope() !== instance.scope) {
3343
+ if (instance.scope.active) {
3344
+ const ownerScope = instance.scope.run(() => new EffectScope());
3345
+ ownerScope.run(
3346
+ () => onScopeDispose(
3347
+ () => (
3348
+ // deferred: the watchers this unmount stops still report to the owner
3349
+ Promise.resolve().then(() => {
3350
+ instance = null;
3351
+ if (watcherJob) watcherJob.i = null;
3352
+ })
3353
+ )
3354
+ )
3355
+ );
3356
+ baseWatchOptions.onStop = () => ownerScope.stop();
3357
+ } else {
3358
+ instance = null;
3359
+ }
3360
+ }
3311
3361
  baseWatchOptions.call = (fn, type, args) => callWithAsyncErrorHandling(fn, instance, type, args);
3312
3362
  let isPre = false;
3313
3363
  if (flush === "post") {
@@ -3326,6 +3376,7 @@ function doWatch(source, cb, options = EMPTY_OBJ) {
3326
3376
  };
3327
3377
  }
3328
3378
  baseWatchOptions.augmentJob = (job) => {
3379
+ watcherJob = job;
3329
3380
  if (cb) {
3330
3381
  job.flags |= 4;
3331
3382
  }
@@ -3695,17 +3746,20 @@ function hydrateTeleport(node, vnode, parentComponent, parentSuspense, slotScope
3695
3746
  } else {
3696
3747
  vnode.anchor = nextSibling(node);
3697
3748
  hydrateAnchor(target, targetNode);
3698
- if (!vnode.targetAnchor) {
3749
+ const hasSSRAnchor = !!vnode.targetAnchor;
3750
+ if (!hasSSRAnchor) {
3699
3751
  prepareAnchor(target, vnode, createText, insert);
3700
3752
  }
3701
3753
  hydrateChildren(
3702
- targetNode && nextSibling(targetNode),
3754
+ // #15937 without SSR anchors, mount instead of hydrating unrelated nodes.
3755
+ hasSSRAnchor ? targetNode && nextSibling(targetNode) : null,
3703
3756
  vnode,
3704
3757
  target,
3705
3758
  parentComponent,
3706
3759
  parentSuspense,
3707
3760
  slotScopeIds,
3708
- optimized
3761
+ optimized,
3762
+ vnode.targetAnchor
3709
3763
  );
3710
3764
  }
3711
3765
  }
@@ -3857,11 +3911,13 @@ const BaseTransitionImpl = {
3857
3911
  earlyRemove();
3858
3912
  el[leaveCbKey] = void 0;
3859
3913
  delete enterHooks.delayedLeave;
3914
+ delete leavingHooks.delayLeave;
3860
3915
  oldInnerChild = void 0;
3861
3916
  };
3862
3917
  enterHooks.delayedLeave = () => {
3863
3918
  delayedLeave();
3864
3919
  delete enterHooks.delayedLeave;
3920
+ delete leavingHooks.delayLeave;
3865
3921
  oldInnerChild = void 0;
3866
3922
  };
3867
3923
  };
@@ -4478,7 +4534,7 @@ function createHydrationFunctions(rendererInternals) {
4478
4534
  }
4479
4535
  return isFragmentStart ? nextSibling(nextNode) : nextNode;
4480
4536
  } else {
4481
- onMismatch();
4537
+ nextNode = onMismatch();
4482
4538
  }
4483
4539
  break;
4484
4540
  case Fragment:
@@ -4692,15 +4748,19 @@ Server rendered element contains more child nodes than client vdom.`
4692
4748
  }
4693
4749
  return el.nextSibling;
4694
4750
  };
4695
- const hydrateChildren = (node, parentVNode, container, parentComponent, parentSuspense, slotScopeIds, optimized) => {
4751
+ const hydrateChildren = (node, parentVNode, container, parentComponent, parentSuspense, slotScopeIds, optimized, anchor) => {
4696
4752
  optimized = optimized || !!parentVNode.dynamicChildren;
4697
4753
  const children = parentVNode.children;
4698
4754
  const l = children.length;
4755
+ const isFragment = parentVNode.type === Fragment;
4699
4756
  let hasCheckedMismatch = false;
4700
4757
  for (let i = 0; i < l; i++) {
4701
4758
  const vnode = optimized ? children[i] : children[i] = normalizeVNode(children[i]);
4702
4759
  const isText = vnode.type === Text;
4703
- if (node) {
4760
+ if (isFragment && node && isComment(node) && node.data === "]") {
4761
+ anchor = node;
4762
+ }
4763
+ if (node && node !== anchor) {
4704
4764
  if (isText && !optimized) {
4705
4765
  if (i + 1 < l && normalizeVNode(children[i + 1]).type === Text) {
4706
4766
  insert(
@@ -4722,7 +4782,7 @@ Server rendered element contains more child nodes than client vdom.`
4722
4782
  optimized
4723
4783
  );
4724
4784
  } else if (isText && !vnode.children) {
4725
- insert(vnode.el = createText(""), container);
4785
+ insert(vnode.el = createText(""), container, anchor);
4726
4786
  } else {
4727
4787
  if (!hasCheckedMismatch) {
4728
4788
  hasCheckedMismatch = true;
@@ -4740,7 +4800,7 @@ Server rendered element contains fewer child nodes than client vdom.`
4740
4800
  null,
4741
4801
  vnode,
4742
4802
  container,
4743
- null,
4803
+ anchor,
4744
4804
  parentComponent,
4745
4805
  parentSuspense,
4746
4806
  getContainerType(container),
@@ -5441,7 +5501,7 @@ const KeepAliveImpl = {
5441
5501
  const cached = cache.get(key);
5442
5502
  if (cached && (!current || !isSameVNodeType(cached, current))) {
5443
5503
  unmount(cached);
5444
- } else if (current) {
5504
+ } else if (current && (current.key == null ? current.type : current.key) === key) {
5445
5505
  resetShapeFlag(current);
5446
5506
  if (cached) resetShapeFlag(cached);
5447
5507
  }
@@ -9803,6 +9863,8 @@ function patchSuspense(n1, n2, container, anchor, parentComponent, namespace, sl
9803
9863
  optimized
9804
9864
  );
9805
9865
  suspense.resolve(true);
9866
+ suspense.pendingId = suspenseId++;
9867
+ suspense.deps = 0;
9806
9868
  } else {
9807
9869
  patch(
9808
9870
  null,
@@ -11369,7 +11431,7 @@ function isMemoSame(cached, memo) {
11369
11431
  return true;
11370
11432
  }
11371
11433
 
11372
- const version = "3.5.46";
11434
+ const version = "3.5.47";
11373
11435
  const warn = warn$1 ;
11374
11436
  const ErrorTypeStrings = ErrorTypeStrings$1 ;
11375
11437
  const devtools = devtools$1 ;
@@ -13430,8 +13492,14 @@ const keyNames = {
13430
13492
  const withKeys = (fn, modifiers) => {
13431
13493
  const cache = fn._withKeys || (fn._withKeys = {});
13432
13494
  const cacheKey = modifiers.join(".");
13433
- return cache[cacheKey] || (cache[cacheKey] = ((event) => {
13495
+ const cached = cache[cacheKey];
13496
+ if (cached) return cached;
13497
+ const hasButtonModifier = modifiers.some((m) => m === "left" || m === "right");
13498
+ return cache[cacheKey] = ((event) => {
13434
13499
  if (!("key" in event)) {
13500
+ if (hasButtonModifier) {
13501
+ return fn(event);
13502
+ }
13435
13503
  return;
13436
13504
  }
13437
13505
  const eventKey = hyphenate(event.key);
@@ -13440,7 +13508,7 @@ const withKeys = (fn, modifiers) => {
13440
13508
  )) {
13441
13509
  return fn(event);
13442
13510
  }
13443
- }));
13511
+ });
13444
13512
  };
13445
13513
 
13446
13514
  const rendererOptions = /* @__PURE__ */ extend({ patchProp }, nodeOps);