@vtj/materials 0.8.172 → 0.9.0-alpha.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 v3.5.12
2
+ * vue v3.5.13
3
3
  * (c) 2018-present Yuxi (Evan) You and Vue contributors
4
4
  * @license MIT
5
5
  **/
@@ -215,10 +215,9 @@ var Vue = (function (exports) {
215
215
  return ret;
216
216
  }
217
217
  function stringifyStyle(styles) {
218
+ if (!styles) return "";
219
+ if (isString(styles)) return styles;
218
220
  let ret = "";
219
- if (!styles || isString(styles)) {
220
- return ret;
221
- }
222
221
  for (const key in styles) {
223
222
  const value = styles[key];
224
223
  if (isString(value) || typeof value === "number") {
@@ -481,17 +480,21 @@ var Vue = (function (exports) {
481
480
  }
482
481
  stop(fromParent) {
483
482
  if (this._active) {
483
+ this._active = false;
484
484
  let i, l;
485
485
  for (i = 0, l = this.effects.length; i < l; i++) {
486
486
  this.effects[i].stop();
487
487
  }
488
+ this.effects.length = 0;
488
489
  for (i = 0, l = this.cleanups.length; i < l; i++) {
489
490
  this.cleanups[i]();
490
491
  }
492
+ this.cleanups.length = 0;
491
493
  if (this.scopes) {
492
494
  for (i = 0, l = this.scopes.length; i < l; i++) {
493
495
  this.scopes[i].stop(true);
494
496
  }
497
+ this.scopes.length = 0;
495
498
  }
496
499
  if (!this.detached && this.parent && !fromParent) {
497
500
  const last = this.parent.scopes.pop();
@@ -501,7 +504,6 @@ var Vue = (function (exports) {
501
504
  }
502
505
  }
503
506
  this.parent = void 0;
504
- this._active = false;
505
507
  }
506
508
  }
507
509
  }
@@ -1267,6 +1269,7 @@ var Vue = (function (exports) {
1267
1269
  this._isShallow = _isShallow;
1268
1270
  }
1269
1271
  get(target, key, receiver) {
1272
+ if (key === "__v_skip") return target["__v_skip"];
1270
1273
  const isReadonly2 = this._isReadonly, isShallow2 = this._isShallow;
1271
1274
  if (key === "__v_isReactive") {
1272
1275
  return !isReadonly2;
@@ -2103,7 +2106,7 @@ var Vue = (function (exports) {
2103
2106
  const scope = getCurrentScope();
2104
2107
  const watchHandle = () => {
2105
2108
  effect.stop();
2106
- if (scope) {
2109
+ if (scope && scope.active) {
2107
2110
  remove(scope.effects, effect);
2108
2111
  }
2109
2112
  };
@@ -3063,11 +3066,32 @@ var Vue = (function (exports) {
3063
3066
  updateCssVars(n2, true);
3064
3067
  }
3065
3068
  if (isTeleportDeferred(n2.props)) {
3066
- queuePostRenderEffect(mountToTarget, parentSuspense);
3069
+ queuePostRenderEffect(() => {
3070
+ mountToTarget();
3071
+ n2.el.__isMounted = true;
3072
+ }, parentSuspense);
3067
3073
  } else {
3068
3074
  mountToTarget();
3069
3075
  }
3070
3076
  } else {
3077
+ if (isTeleportDeferred(n2.props) && !n1.el.__isMounted) {
3078
+ queuePostRenderEffect(() => {
3079
+ TeleportImpl.process(
3080
+ n1,
3081
+ n2,
3082
+ container,
3083
+ anchor,
3084
+ parentComponent,
3085
+ parentSuspense,
3086
+ namespace,
3087
+ slotScopeIds,
3088
+ optimized,
3089
+ internals
3090
+ );
3091
+ delete n1.el.__isMounted;
3092
+ }, parentSuspense);
3093
+ return;
3094
+ }
3071
3095
  n2.el = n1.el;
3072
3096
  n2.targetStart = n1.targetStart;
3073
3097
  const mainAnchor = n2.anchor = n1.anchor;
@@ -3373,10 +3397,9 @@ var Vue = (function (exports) {
3373
3397
  if (innerChild.type !== Comment) {
3374
3398
  setTransitionHooks(innerChild, enterHooks);
3375
3399
  }
3376
- const oldChild = instance.subTree;
3377
- const oldInnerChild = oldChild && getInnerChild$1(oldChild);
3400
+ let oldInnerChild = instance.subTree && getInnerChild$1(instance.subTree);
3378
3401
  if (oldInnerChild && oldInnerChild.type !== Comment && !isSameVNodeType(innerChild, oldInnerChild) && recursiveGetSubtree(instance).type !== Comment) {
3379
- const leavingHooks = resolveTransitionHooks(
3402
+ let leavingHooks = resolveTransitionHooks(
3380
3403
  oldInnerChild,
3381
3404
  rawProps,
3382
3405
  state,
@@ -3391,6 +3414,7 @@ var Vue = (function (exports) {
3391
3414
  instance.update();
3392
3415
  }
3393
3416
  delete leavingHooks.afterLeave;
3417
+ oldInnerChild = void 0;
3394
3418
  };
3395
3419
  return emptyPlaceholder(child);
3396
3420
  } else if (mode === "in-out" && innerChild.type !== Comment) {
@@ -3404,10 +3428,19 @@ var Vue = (function (exports) {
3404
3428
  earlyRemove();
3405
3429
  el[leaveCbKey] = void 0;
3406
3430
  delete enterHooks.delayedLeave;
3431
+ oldInnerChild = void 0;
3432
+ };
3433
+ enterHooks.delayedLeave = () => {
3434
+ delayedLeave();
3435
+ delete enterHooks.delayedLeave;
3436
+ oldInnerChild = void 0;
3407
3437
  };
3408
- enterHooks.delayedLeave = delayedLeave;
3409
3438
  };
3439
+ } else {
3440
+ oldInnerChild = void 0;
3410
3441
  }
3442
+ } else if (oldInnerChild) {
3443
+ oldInnerChild = void 0;
3411
3444
  }
3412
3445
  return child;
3413
3446
  };
@@ -3712,6 +3745,9 @@ var Vue = (function (exports) {
3712
3745
  return;
3713
3746
  }
3714
3747
  if (isAsyncWrapper(vnode) && !isUnmount) {
3748
+ if (vnode.shapeFlag & 512 && vnode.type.__asyncResolved && vnode.component.subTree.component) {
3749
+ setRef(rawRef, oldRawRef, parentSuspense, vnode.component.subTree);
3750
+ }
3715
3751
  return;
3716
3752
  }
3717
3753
  const refValue = vnode.shapeFlag & 4 ? getComponentPublicInstance(vnode.component) : vnode.el;
@@ -3976,7 +4012,7 @@ var Vue = (function (exports) {
3976
4012
  getContainerType(container),
3977
4013
  optimized
3978
4014
  );
3979
- if (isAsyncWrapper(vnode)) {
4015
+ if (isAsyncWrapper(vnode) && !vnode.type.__asyncResolved) {
3980
4016
  let subTree;
3981
4017
  if (isFragmentStart) {
3982
4018
  subTree = createVNode(Fragment);
@@ -4245,6 +4281,10 @@ Server rendered element contains fewer child nodes than client vdom.`
4245
4281
  getContainerType(container),
4246
4282
  slotScopeIds
4247
4283
  );
4284
+ if (parentComponent) {
4285
+ parentComponent.vnode.el = vnode.el;
4286
+ updateHOCHostEl(parentComponent, vnode.el);
4287
+ }
4248
4288
  return next;
4249
4289
  };
4250
4290
  const locateClosingAnchor = (node, open = "[", close = "]") => {
@@ -8647,7 +8687,7 @@ If you want to remount the same app, move your app creation logic into a factory
8647
8687
  }
8648
8688
  if (extraAttrs.length) {
8649
8689
  warn$1(
8650
- `Extraneous non-props attributes (${extraAttrs.join(", ")}) were passed to component but could not be automatically inherited because component renders fragment or text root nodes.`
8690
+ `Extraneous non-props attributes (${extraAttrs.join(", ")}) were passed to component but could not be automatically inherited because component renders fragment or text or teleport root nodes.`
8651
8691
  );
8652
8692
  }
8653
8693
  if (eventAttrs.length) {
@@ -9430,9 +9470,9 @@ If you want to remount the same app, move your app creation logic into a factory
9430
9470
  currentBlock = blockStack[blockStack.length - 1] || null;
9431
9471
  }
9432
9472
  let isBlockTreeEnabled = 1;
9433
- function setBlockTracking(value) {
9473
+ function setBlockTracking(value, inVOnce = false) {
9434
9474
  isBlockTreeEnabled += value;
9435
- if (value < 0 && currentBlock) {
9475
+ if (value < 0 && currentBlock && inVOnce) {
9436
9476
  currentBlock.hasOnce = true;
9437
9477
  }
9438
9478
  }
@@ -10442,7 +10482,7 @@ Component that was made reactive: `,
10442
10482
  return true;
10443
10483
  }
10444
10484
 
10445
- const version = "3.5.12";
10485
+ const version = "3.5.13";
10446
10486
  const warn = warn$1 ;
10447
10487
  const ErrorTypeStrings = ErrorTypeStrings$1 ;
10448
10488
  const devtools = devtools$1 ;
@@ -10614,7 +10654,8 @@ Component that was made reactive: `,
10614
10654
  onAppear = onEnter,
10615
10655
  onAppearCancelled = onEnterCancelled
10616
10656
  } = baseProps;
10617
- const finishEnter = (el, isAppear, done) => {
10657
+ const finishEnter = (el, isAppear, done, isCancelled) => {
10658
+ el._enterCancelled = isCancelled;
10618
10659
  removeTransitionClass(el, isAppear ? appearToClass : enterToClass);
10619
10660
  removeTransitionClass(el, isAppear ? appearActiveClass : enterActiveClass);
10620
10661
  done && done();
@@ -10657,8 +10698,13 @@ Component that was made reactive: `,
10657
10698
  el._isLeaving = true;
10658
10699
  const resolve = () => finishLeave(el, done);
10659
10700
  addTransitionClass(el, leaveFromClass);
10660
- addTransitionClass(el, leaveActiveClass);
10661
- forceReflow();
10701
+ if (!el._enterCancelled) {
10702
+ forceReflow();
10703
+ addTransitionClass(el, leaveActiveClass);
10704
+ } else {
10705
+ addTransitionClass(el, leaveActiveClass);
10706
+ forceReflow();
10707
+ }
10662
10708
  nextFrame(() => {
10663
10709
  if (!el._isLeaving) {
10664
10710
  return;
@@ -10672,11 +10718,11 @@ Component that was made reactive: `,
10672
10718
  callHook(onLeave, [el, resolve]);
10673
10719
  },
10674
10720
  onEnterCancelled(el) {
10675
- finishEnter(el, false);
10721
+ finishEnter(el, false, void 0, true);
10676
10722
  callHook(onEnterCancelled, [el]);
10677
10723
  },
10678
10724
  onAppearCancelled(el) {
10679
- finishEnter(el, true);
10725
+ finishEnter(el, true, void 0, true);
10680
10726
  callHook(onAppearCancelled, [el]);
10681
10727
  },
10682
10728
  onLeaveCancelled(el) {
@@ -10889,10 +10935,11 @@ Component that was made reactive: `,
10889
10935
  }
10890
10936
  updateTeleports(vars);
10891
10937
  };
10892
- onBeforeMount(() => {
10893
- watchPostEffect(setVars);
10938
+ onBeforeUpdate(() => {
10939
+ queuePostFlushCb(setVars);
10894
10940
  });
10895
10941
  onMounted(() => {
10942
+ watch(setVars, NOOP, { flush: "post" });
10896
10943
  const ob = new MutationObserver(setVars);
10897
10944
  ob.observe(instance.subTree.el.parentNode, { childList: true });
10898
10945
  onUnmounted(() => ob.disconnect());
@@ -11499,6 +11546,8 @@ Expected function or array of functions, received type ${typeof value}.`
11499
11546
  this._update();
11500
11547
  }
11501
11548
  if (shouldReflect) {
11549
+ const ob = this._ob;
11550
+ ob && ob.disconnect();
11502
11551
  if (val === true) {
11503
11552
  this.setAttribute(hyphenate(key), "");
11504
11553
  } else if (typeof val === "string" || typeof val === "number") {
@@ -11506,6 +11555,7 @@ Expected function or array of functions, received type ${typeof value}.`
11506
11555
  } else if (!val) {
11507
11556
  this.removeAttribute(hyphenate(key));
11508
11557
  }
11558
+ ob && ob.observe(this, { attributes: true });
11509
11559
  }
11510
11560
  }
11511
11561
  }
@@ -12479,12 +12529,13 @@ Make sure to use the production build (*.prod.js) when deploying for production.
12479
12529
  loc: locStub
12480
12530
  };
12481
12531
  }
12482
- function createCacheExpression(index, value, needPauseTracking = false) {
12532
+ function createCacheExpression(index, value, needPauseTracking = false, inVOnce = false) {
12483
12533
  return {
12484
12534
  type: 20,
12485
12535
  index,
12486
12536
  value,
12487
12537
  needPauseTracking,
12538
+ inVOnce,
12488
12539
  needArraySpread: false,
12489
12540
  loc: locStub
12490
12541
  };
@@ -14718,11 +14769,12 @@ Use a v-bind binding combined with a v-on listener that emits update:x event ins
14718
14769
  identifier.hoisted = exp;
14719
14770
  return identifier;
14720
14771
  },
14721
- cache(exp, isVNode = false) {
14772
+ cache(exp, isVNode = false, inVOnce = false) {
14722
14773
  const cacheExp = createCacheExpression(
14723
14774
  context.cached.length,
14724
14775
  exp,
14725
- isVNode
14776
+ isVNode,
14777
+ inVOnce
14726
14778
  );
14727
14779
  context.cached.push(cacheExp);
14728
14780
  return cacheExp;
@@ -15421,7 +15473,9 @@ Use a v-bind binding combined with a v-on listener that emits update:x event ins
15421
15473
  push(`_cache[${node.index}] || (`);
15422
15474
  if (needPauseTracking) {
15423
15475
  indent();
15424
- push(`${helper(SET_BLOCK_TRACKING)}(-1),`);
15476
+ push(`${helper(SET_BLOCK_TRACKING)}(-1`);
15477
+ if (node.inVOnce) push(`, true`);
15478
+ push(`),`);
15425
15479
  newline();
15426
15480
  push(`(`);
15427
15481
  }
@@ -15478,12 +15532,14 @@ Use a v-bind binding combined with a v-on listener that emits update:x event ins
15478
15532
  context
15479
15533
  );
15480
15534
  } else if (node.type === 1) {
15535
+ const memo = findDir(node, "memo");
15481
15536
  for (let i = 0; i < node.props.length; i++) {
15482
15537
  const dir = node.props[i];
15483
15538
  if (dir.type === 7 && dir.name !== "for") {
15484
15539
  const exp = dir.exp;
15485
15540
  const arg = dir.arg;
15486
- if (exp && exp.type === 4 && !(dir.name === "on" && arg)) {
15541
+ if (exp && exp.type === 4 && !(dir.name === "on" && arg) && // key has been processed in transformFor(vMemo + vFor)
15542
+ !(memo && arg && arg.type === 4 && arg.content === "key")) {
15487
15543
  dir.exp = processExpression(
15488
15544
  exp,
15489
15545
  context,
@@ -15811,10 +15867,11 @@ Use a v-bind binding combined with a v-on listener that emits update:x event ins
15811
15867
  const isTemplate = isTemplateNode(node);
15812
15868
  const memo = findDir(node, "memo");
15813
15869
  const keyProp = findProp(node, `key`, false, true);
15814
- if (keyProp && keyProp.type === 7 && !keyProp.exp) {
15870
+ const isDirKey = keyProp && keyProp.type === 7;
15871
+ if (isDirKey && !keyProp.exp) {
15815
15872
  transformBindShorthand(keyProp);
15816
15873
  }
15817
- const keyExp = keyProp && (keyProp.type === 6 ? keyProp.value ? createSimpleExpression(keyProp.value.content, true) : void 0 : keyProp.exp);
15874
+ let keyExp = keyProp && (keyProp.type === 6 ? keyProp.value ? createSimpleExpression(keyProp.value.content, true) : void 0 : keyProp.exp);
15818
15875
  const keyProperty = keyProp && keyExp ? createObjectProperty(`key`, keyExp) : null;
15819
15876
  const isStableFragment = forNode.source.type === 4 && forNode.source.constType > 0;
15820
15877
  const fragmentFlag = isStableFragment ? 64 : keyProp ? 128 : 256;
@@ -17011,8 +17068,8 @@ Use a v-bind binding combined with a v-on listener that emits update:x event ins
17011
17068
  if (cur.codegenNode) {
17012
17069
  cur.codegenNode = context.cache(
17013
17070
  cur.codegenNode,
17071
+ true,
17014
17072
  true
17015
- /* isVNode */
17016
17073
  );
17017
17074
  }
17018
17075
  };