@vue/shared 3.6.0-beta.12 → 3.6.0-beta.14

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/shared v3.6.0-beta.12
2
+ * @vue/shared v3.6.0-beta.14
3
3
  * (c) 2018-present Yuxi (Evan) You and Vue contributors
4
4
  * @license MIT
5
5
  **/
@@ -664,7 +664,13 @@ const VaporVForFlags = {
664
664
  "IS_COMPONENT": 2,
665
665
  "2": "IS_COMPONENT",
666
666
  "ONCE": 4,
667
- "4": "ONCE"
667
+ "4": "ONCE",
668
+ "IS_SINGLE_NODE": 8,
669
+ "8": "IS_SINGLE_NODE",
670
+ "IS_FRAGMENT": 16,
671
+ "16": "IS_FRAGMENT",
672
+ "SLOT_ROOT": 32,
673
+ "32": "SLOT_ROOT"
668
674
  };
669
675
  const VaporBlockShape = {
670
676
  "EMPTY": 0,
@@ -674,6 +680,65 @@ const VaporBlockShape = {
674
680
  "MULTI_ROOT": 2,
675
681
  "2": "MULTI_ROOT"
676
682
  };
683
+ /**
684
+ * Bit layout for vapor `createIf` flags.
685
+ *
686
+ * - bits 0-1: true branch VaporBlockShape
687
+ * - bits 2-3: false branch VaporBlockShape
688
+ * - bit 4: v-once
689
+ * - bit 5: true branch does not need EffectScope
690
+ * - bit 6: false branch does not need EffectScope
691
+ * - bit 7: v-if sits on a slot content/fallback root chain
692
+ * - bits 8+: branch index + 1 for keyed dynamic fragments
693
+ *
694
+ * Examples:
695
+ * - v-once, true single-root, no false branch: 1 | ONCE = 17
696
+ * - keyed index 0, true/false single-root: 1 | (1 << 2) | (1 << 8) = 261
697
+ */
698
+ const VaporIfFlags = {
699
+ "BLOCK_SHAPE": 15,
700
+ "15": "BLOCK_SHAPE",
701
+ "ONCE": 16,
702
+ "16": "ONCE",
703
+ "TRUE_NO_SCOPE": 32,
704
+ "32": "TRUE_NO_SCOPE",
705
+ "FALSE_NO_SCOPE": 64,
706
+ "64": "FALSE_NO_SCOPE",
707
+ "SLOT_ROOT": 128,
708
+ "128": "SLOT_ROOT",
709
+ "INDEX_SHIFT": 8,
710
+ "8": "INDEX_SHIFT"
711
+ };
712
+ /**
713
+ * Flags used by vapor template factories, shared between the compiler and the
714
+ * runtime.
715
+ */
716
+ const TemplateFlags = {
717
+ "ROOT": 1,
718
+ "1": "ROOT",
719
+ "STATIC": 2,
720
+ "2": "STATIC"
721
+ };
722
+ /**
723
+ * Flags used by vapor slot outlets, shared between the compiler and the
724
+ * runtime.
725
+ */
726
+ const VaporSlotFlags = {
727
+ "NO_SLOTTED": 1,
728
+ "1": "NO_SLOTTED",
729
+ "ONCE": 2,
730
+ "2": "ONCE",
731
+ "SLOT_ROOT": 4,
732
+ "4": "SLOT_ROOT"
733
+ };
734
+ const VaporDynamicComponentFlags = {
735
+ "SINGLE_ROOT": 1,
736
+ "1": "SINGLE_ROOT",
737
+ "ONCE": 2,
738
+ "2": "ONCE",
739
+ "SLOT_ROOT": 4,
740
+ "4": "SLOT_ROOT"
741
+ };
677
742
  //#endregion
678
743
  exports.EMPTY_ARR = EMPTY_ARR;
679
744
  exports.EMPTY_OBJ = EMPTY_OBJ;
@@ -684,7 +749,11 @@ exports.PatchFlagNames = PatchFlagNames;
684
749
  exports.PatchFlags = PatchFlags;
685
750
  exports.ShapeFlags = ShapeFlags;
686
751
  exports.SlotFlags = SlotFlags;
752
+ exports.TemplateFlags = TemplateFlags;
687
753
  exports.VaporBlockShape = VaporBlockShape;
754
+ exports.VaporDynamicComponentFlags = VaporDynamicComponentFlags;
755
+ exports.VaporIfFlags = VaporIfFlags;
756
+ exports.VaporSlotFlags = VaporSlotFlags;
688
757
  exports.VaporVForFlags = VaporVForFlags;
689
758
  exports.YES = YES;
690
759
  exports.camelize = camelize;
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @vue/shared v3.6.0-beta.12
2
+ * @vue/shared v3.6.0-beta.14
3
3
  * (c) 2018-present Yuxi (Evan) You and Vue contributors
4
4
  * @license MIT
5
5
  **/
@@ -664,7 +664,13 @@ const VaporVForFlags = {
664
664
  "IS_COMPONENT": 2,
665
665
  "2": "IS_COMPONENT",
666
666
  "ONCE": 4,
667
- "4": "ONCE"
667
+ "4": "ONCE",
668
+ "IS_SINGLE_NODE": 8,
669
+ "8": "IS_SINGLE_NODE",
670
+ "IS_FRAGMENT": 16,
671
+ "16": "IS_FRAGMENT",
672
+ "SLOT_ROOT": 32,
673
+ "32": "SLOT_ROOT"
668
674
  };
669
675
  const VaporBlockShape = {
670
676
  "EMPTY": 0,
@@ -674,6 +680,65 @@ const VaporBlockShape = {
674
680
  "MULTI_ROOT": 2,
675
681
  "2": "MULTI_ROOT"
676
682
  };
683
+ /**
684
+ * Bit layout for vapor `createIf` flags.
685
+ *
686
+ * - bits 0-1: true branch VaporBlockShape
687
+ * - bits 2-3: false branch VaporBlockShape
688
+ * - bit 4: v-once
689
+ * - bit 5: true branch does not need EffectScope
690
+ * - bit 6: false branch does not need EffectScope
691
+ * - bit 7: v-if sits on a slot content/fallback root chain
692
+ * - bits 8+: branch index + 1 for keyed dynamic fragments
693
+ *
694
+ * Examples:
695
+ * - v-once, true single-root, no false branch: 1 | ONCE = 17
696
+ * - keyed index 0, true/false single-root: 1 | (1 << 2) | (1 << 8) = 261
697
+ */
698
+ const VaporIfFlags = {
699
+ "BLOCK_SHAPE": 15,
700
+ "15": "BLOCK_SHAPE",
701
+ "ONCE": 16,
702
+ "16": "ONCE",
703
+ "TRUE_NO_SCOPE": 32,
704
+ "32": "TRUE_NO_SCOPE",
705
+ "FALSE_NO_SCOPE": 64,
706
+ "64": "FALSE_NO_SCOPE",
707
+ "SLOT_ROOT": 128,
708
+ "128": "SLOT_ROOT",
709
+ "INDEX_SHIFT": 8,
710
+ "8": "INDEX_SHIFT"
711
+ };
712
+ /**
713
+ * Flags used by vapor template factories, shared between the compiler and the
714
+ * runtime.
715
+ */
716
+ const TemplateFlags = {
717
+ "ROOT": 1,
718
+ "1": "ROOT",
719
+ "STATIC": 2,
720
+ "2": "STATIC"
721
+ };
722
+ /**
723
+ * Flags used by vapor slot outlets, shared between the compiler and the
724
+ * runtime.
725
+ */
726
+ const VaporSlotFlags = {
727
+ "NO_SLOTTED": 1,
728
+ "1": "NO_SLOTTED",
729
+ "ONCE": 2,
730
+ "2": "ONCE",
731
+ "SLOT_ROOT": 4,
732
+ "4": "SLOT_ROOT"
733
+ };
734
+ const VaporDynamicComponentFlags = {
735
+ "SINGLE_ROOT": 1,
736
+ "1": "SINGLE_ROOT",
737
+ "ONCE": 2,
738
+ "2": "ONCE",
739
+ "SLOT_ROOT": 4,
740
+ "4": "SLOT_ROOT"
741
+ };
677
742
  //#endregion
678
743
  exports.EMPTY_ARR = EMPTY_ARR;
679
744
  exports.EMPTY_OBJ = EMPTY_OBJ;
@@ -684,7 +749,11 @@ exports.PatchFlagNames = PatchFlagNames;
684
749
  exports.PatchFlags = PatchFlags;
685
750
  exports.ShapeFlags = ShapeFlags;
686
751
  exports.SlotFlags = SlotFlags;
752
+ exports.TemplateFlags = TemplateFlags;
687
753
  exports.VaporBlockShape = VaporBlockShape;
754
+ exports.VaporDynamicComponentFlags = VaporDynamicComponentFlags;
755
+ exports.VaporIfFlags = VaporIfFlags;
756
+ exports.VaporSlotFlags = VaporSlotFlags;
688
757
  exports.VaporVForFlags = VaporVForFlags;
689
758
  exports.YES = YES;
690
759
  exports.camelize = camelize;
package/dist/shared.d.ts CHANGED
@@ -401,17 +401,101 @@ export declare enum VaporVForFlags {
401
401
  FAST_REMOVE = 1,
402
402
  /**
403
403
  * v-for used on component - we can skip creating child scopes for each block
404
- * because the component itself already has a scope.
404
+ * because the component itself already has a scope. This does not guarantee
405
+ * the item block is a VaporComponentInstance: component fallback paths may
406
+ * still return a DOM Node.
405
407
  */
406
408
  IS_COMPONENT = 2,
407
409
  /**
408
410
  * v-for inside v-once
409
411
  */
410
- ONCE = 4
412
+ ONCE = 4,
413
+ /**
414
+ * v-for item block is a single DOM Node.
415
+ */
416
+ IS_SINGLE_NODE = 8,
417
+ /**
418
+ * v-for item block is known to be a VaporFragment, so runtime can use
419
+ * fragment-specific insert/remove helpers.
420
+ */
421
+ IS_FRAGMENT = 16,
422
+ /**
423
+ * v-for sits on a slot content/fallback root chain and can change slot
424
+ * validity.
425
+ */
426
+ SLOT_ROOT = 32
411
427
  }
412
428
  export declare enum VaporBlockShape {
413
429
  EMPTY = 0,
414
430
  SINGLE_ROOT = 1,
415
431
  MULTI_ROOT = 2
416
432
  }
433
+ /**
434
+ * Bit layout for vapor `createIf` flags.
435
+ *
436
+ * - bits 0-1: true branch VaporBlockShape
437
+ * - bits 2-3: false branch VaporBlockShape
438
+ * - bit 4: v-once
439
+ * - bit 5: true branch does not need EffectScope
440
+ * - bit 6: false branch does not need EffectScope
441
+ * - bit 7: v-if sits on a slot content/fallback root chain
442
+ * - bits 8+: branch index + 1 for keyed dynamic fragments
443
+ *
444
+ * Examples:
445
+ * - v-once, true single-root, no false branch: 1 | ONCE = 17
446
+ * - keyed index 0, true/false single-root: 1 | (1 << 2) | (1 << 8) = 261
447
+ */
448
+ export declare enum VaporIfFlags {
449
+ /**
450
+ * Documents the packed true/false branch shape bits. Runtime decode shifts
451
+ * to the selected branch first, then masks with 0b11 for one VaporBlockShape.
452
+ */
453
+ BLOCK_SHAPE = 15,
454
+ /**
455
+ * Marks a branch that is created once and never updated.
456
+ */
457
+ ONCE = 16,
458
+ /**
459
+ * The compiler proved that the true branch does not create branch-owned
460
+ * effects or disposers.
461
+ */
462
+ TRUE_NO_SCOPE = 32,
463
+ /**
464
+ * The compiler proved that the false branch does not create branch-owned
465
+ * effects or disposers.
466
+ */
467
+ FALSE_NO_SCOPE = 64,
468
+ /**
469
+ * v-if sits on a slot content/fallback root chain and can change slot
470
+ * validity.
471
+ */
472
+ SLOT_ROOT = 128,
473
+ /**
474
+ * Shift for keyed branch index. The encoded value is index + 1, so decoded
475
+ * zero means "not keyed" and source index 0 still round-trips.
476
+ */
477
+ INDEX_SHIFT = 8
478
+ }
479
+ /**
480
+ * Flags used by vapor template factories, shared between the compiler and the
481
+ * runtime.
482
+ */
483
+ export declare enum TemplateFlags {
484
+ ROOT = 1,
485
+ STATIC = 2
486
+ }
487
+ /**
488
+ * Flags used by vapor slot outlets, shared between the compiler and the
489
+ * runtime.
490
+ */
491
+ export declare enum VaporSlotFlags {
492
+ NO_SLOTTED = 1,
493
+ ONCE = 2,
494
+ SLOT_ROOT = 4
495
+ }
496
+ export declare enum VaporDynamicComponentFlags {
497
+ SINGLE_ROOT = 1,
498
+ ONCE = 2,
499
+ SLOT_ROOT = 4
500
+ }
417
501
  //#endregion
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @vue/shared v3.6.0-beta.12
2
+ * @vue/shared v3.6.0-beta.14
3
3
  * (c) 2018-present Yuxi (Evan) You and Vue contributors
4
4
  * @license MIT
5
5
  **/
@@ -662,7 +662,13 @@ const VaporVForFlags = {
662
662
  "IS_COMPONENT": 2,
663
663
  "2": "IS_COMPONENT",
664
664
  "ONCE": 4,
665
- "4": "ONCE"
665
+ "4": "ONCE",
666
+ "IS_SINGLE_NODE": 8,
667
+ "8": "IS_SINGLE_NODE",
668
+ "IS_FRAGMENT": 16,
669
+ "16": "IS_FRAGMENT",
670
+ "SLOT_ROOT": 32,
671
+ "32": "SLOT_ROOT"
666
672
  };
667
673
  const VaporBlockShape = {
668
674
  "EMPTY": 0,
@@ -672,5 +678,64 @@ const VaporBlockShape = {
672
678
  "MULTI_ROOT": 2,
673
679
  "2": "MULTI_ROOT"
674
680
  };
681
+ /**
682
+ * Bit layout for vapor `createIf` flags.
683
+ *
684
+ * - bits 0-1: true branch VaporBlockShape
685
+ * - bits 2-3: false branch VaporBlockShape
686
+ * - bit 4: v-once
687
+ * - bit 5: true branch does not need EffectScope
688
+ * - bit 6: false branch does not need EffectScope
689
+ * - bit 7: v-if sits on a slot content/fallback root chain
690
+ * - bits 8+: branch index + 1 for keyed dynamic fragments
691
+ *
692
+ * Examples:
693
+ * - v-once, true single-root, no false branch: 1 | ONCE = 17
694
+ * - keyed index 0, true/false single-root: 1 | (1 << 2) | (1 << 8) = 261
695
+ */
696
+ const VaporIfFlags = {
697
+ "BLOCK_SHAPE": 15,
698
+ "15": "BLOCK_SHAPE",
699
+ "ONCE": 16,
700
+ "16": "ONCE",
701
+ "TRUE_NO_SCOPE": 32,
702
+ "32": "TRUE_NO_SCOPE",
703
+ "FALSE_NO_SCOPE": 64,
704
+ "64": "FALSE_NO_SCOPE",
705
+ "SLOT_ROOT": 128,
706
+ "128": "SLOT_ROOT",
707
+ "INDEX_SHIFT": 8,
708
+ "8": "INDEX_SHIFT"
709
+ };
710
+ /**
711
+ * Flags used by vapor template factories, shared between the compiler and the
712
+ * runtime.
713
+ */
714
+ const TemplateFlags = {
715
+ "ROOT": 1,
716
+ "1": "ROOT",
717
+ "STATIC": 2,
718
+ "2": "STATIC"
719
+ };
720
+ /**
721
+ * Flags used by vapor slot outlets, shared between the compiler and the
722
+ * runtime.
723
+ */
724
+ const VaporSlotFlags = {
725
+ "NO_SLOTTED": 1,
726
+ "1": "NO_SLOTTED",
727
+ "ONCE": 2,
728
+ "2": "ONCE",
729
+ "SLOT_ROOT": 4,
730
+ "4": "SLOT_ROOT"
731
+ };
732
+ const VaporDynamicComponentFlags = {
733
+ "SINGLE_ROOT": 1,
734
+ "1": "SINGLE_ROOT",
735
+ "ONCE": 2,
736
+ "2": "ONCE",
737
+ "SLOT_ROOT": 4,
738
+ "4": "SLOT_ROOT"
739
+ };
675
740
  //#endregion
676
- export { EMPTY_ARR, EMPTY_OBJ, NO, NOOP, Namespaces, PatchFlagNames, PatchFlags, ShapeFlags, SlotFlags, VaporBlockShape, VaporVForFlags, YES, camelize, canSetValueDirectly, capitalize, cssVarNameEscapeSymbolsRE, def, escapeHtml, escapeHtmlComment, extend, genCacheKey, genPropsAccessExp, generateCodeFrame, getEscapedCssVarName, getGlobalThis, getModifierPropName, getSequence, hasChanged, hasOwn, hyphenate, includeBooleanAttr, invokeArrayFns, isAlwaysCloseTag, isArray, isBlockTag, isBooleanAttr, isBuiltInDirective, isBuiltInTag, isDate, isFormattingTag, isFunction, isGloballyAllowed, isGloballyWhitelisted, isHTMLTag, isInlineTag, isIntegerKey, isKnownHtmlAttr, isKnownMathMLAttr, isKnownSvgAttr, isMap, isMathMLTag, isModelListener, isNativeOn, isObject, isOn, isPlainObject, isPromise, isRegExp, isRenderableAttrValue, isReservedProp, isSSRSafeAttrName, isSVGTag, isSet, isSpecialBooleanAttr, isString, isSymbol, isVoidTag, looseEqual, looseIndexOf, looseToNumber, makeMap, normalizeClass, normalizeCssVarValue, normalizeProps, normalizeStyle, objectToString, parseStringStyle, propsToAttrMap, remove, shouldSetAsAttr, slotFlagsText, stringifyStyle, toDisplayString, toHandlerKey, toNumber, toRawType, toTypeString };
741
+ export { EMPTY_ARR, EMPTY_OBJ, NO, NOOP, Namespaces, PatchFlagNames, PatchFlags, ShapeFlags, SlotFlags, TemplateFlags, VaporBlockShape, VaporDynamicComponentFlags, VaporIfFlags, VaporSlotFlags, VaporVForFlags, YES, camelize, canSetValueDirectly, capitalize, cssVarNameEscapeSymbolsRE, def, escapeHtml, escapeHtmlComment, extend, genCacheKey, genPropsAccessExp, generateCodeFrame, getEscapedCssVarName, getGlobalThis, getModifierPropName, getSequence, hasChanged, hasOwn, hyphenate, includeBooleanAttr, invokeArrayFns, isAlwaysCloseTag, isArray, isBlockTag, isBooleanAttr, isBuiltInDirective, isBuiltInTag, isDate, isFormattingTag, isFunction, isGloballyAllowed, isGloballyWhitelisted, isHTMLTag, isInlineTag, isIntegerKey, isKnownHtmlAttr, isKnownMathMLAttr, isKnownSvgAttr, isMap, isMathMLTag, isModelListener, isNativeOn, isObject, isOn, isPlainObject, isPromise, isRegExp, isRenderableAttrValue, isReservedProp, isSSRSafeAttrName, isSVGTag, isSet, isSpecialBooleanAttr, isString, isSymbol, isVoidTag, looseEqual, looseIndexOf, looseToNumber, makeMap, normalizeClass, normalizeCssVarValue, normalizeProps, normalizeStyle, objectToString, parseStringStyle, propsToAttrMap, remove, shouldSetAsAttr, slotFlagsText, stringifyStyle, toDisplayString, toHandlerKey, toNumber, toRawType, toTypeString };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vue/shared",
3
- "version": "3.6.0-beta.12",
3
+ "version": "3.6.0-beta.14",
4
4
  "description": "internal utils shared across @vue packages",
5
5
  "main": "index.js",
6
6
  "module": "dist/shared.esm-bundler.js",