@vue/compiler-sfc 3.5.4 → 3.5.5

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/compiler-sfc v3.5.4
2
+ * @vue/compiler-sfc v3.5.5
3
3
  * (c) 2018-present Yuxi (Evan) You and Vue contributors
4
4
  * @license MIT
5
5
  **/
@@ -7911,16 +7911,12 @@ function rewriteSelector(id, rule, selector, selectorRoot, deep, slotted = false
7911
7911
  });
7912
7912
  if (rule.nodes.some((node2) => node2.type === "rule")) {
7913
7913
  const deep2 = rule.__deep;
7914
- const decls = rule.nodes.filter((node2) => node2.type === "decl");
7915
- if (!deep2 && decls.length) {
7916
- for (const decl of decls) {
7917
- rule.removeChild(decl);
7914
+ if (!deep2) {
7915
+ extractAndWrapNodes(rule);
7916
+ const atruleNodes = rule.nodes.filter((node2) => node2.type === "atrule");
7917
+ for (const atnode of atruleNodes) {
7918
+ extractAndWrapNodes(atnode);
7918
7919
  }
7919
- const hostRule = new require$$0$1.Rule({
7920
- nodes: decls,
7921
- selector: "&"
7922
- });
7923
- rule.prepend(hostRule);
7924
7920
  }
7925
7921
  shouldInject = deep2;
7926
7922
  }
@@ -7956,6 +7952,22 @@ function rewriteSelector(id, rule, selector, selectorRoot, deep, slotted = false
7956
7952
  function isSpaceCombinator(node) {
7957
7953
  return node.type === "combinator" && /^\s+$/.test(node.value);
7958
7954
  }
7955
+ function extractAndWrapNodes(parentNode) {
7956
+ if (!parentNode.nodes) return;
7957
+ const nodes = parentNode.nodes.filter(
7958
+ (node) => node.type === "decl" || node.type === "comment"
7959
+ );
7960
+ if (nodes.length) {
7961
+ for (const node of nodes) {
7962
+ parentNode.removeChild(node);
7963
+ }
7964
+ const wrappedRule = new require$$0$1.Rule({
7965
+ nodes,
7966
+ selector: "&"
7967
+ });
7968
+ parentNode.prepend(wrappedRule);
7969
+ }
7970
+ }
7959
7971
  scopedPlugin.postcss = true;
7960
7972
 
7961
7973
  var sourceMap$1 = {};
@@ -20882,7 +20894,7 @@ function isStaticNode(node) {
20882
20894
  return false;
20883
20895
  }
20884
20896
 
20885
- const version = "3.5.4";
20897
+ const version = "3.5.5";
20886
20898
  const parseCache = parseCache$1;
20887
20899
  const errorMessages = {
20888
20900
  ...CompilerDOM.errorMessages,
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @vue/compiler-sfc v3.5.4
2
+ * @vue/compiler-sfc v3.5.5
3
3
  * (c) 2018-present Yuxi (Evan) You and Vue contributors
4
4
  * @license MIT
5
5
  **/
@@ -1486,7 +1486,7 @@ let Tokenizer$1 = class Tokenizer {
1486
1486
  if (this.currentSequence === Sequences.TitleEnd || this.currentSequence === Sequences.TextareaEnd && !this.inSFCRoot) {
1487
1487
  if (c === 38) {
1488
1488
  this.startEntity();
1489
- } else if (c === this.delimiterOpen[0]) {
1489
+ } else if (!this.inVPre && c === this.delimiterOpen[0]) {
1490
1490
  this.state = 2;
1491
1491
  this.delimiterIndex = 0;
1492
1492
  this.stateInterpolationOpen(c);
@@ -17293,6 +17293,7 @@ const defaultParserOptions = {
17293
17293
  getNamespace: () => 0,
17294
17294
  isVoidTag: NO,
17295
17295
  isPreTag: NO,
17296
+ isIgnoreNewlineTag: NO,
17296
17297
  isCustomElement: NO,
17297
17298
  onError: defaultOnError,
17298
17299
  onWarn: defaultOnWarn,
@@ -17720,7 +17721,7 @@ function onCloseTag(el, end, isImplied = false) {
17720
17721
  el.innerLoc.end.offset
17721
17722
  );
17722
17723
  }
17723
- const { tag, ns } = el;
17724
+ const { tag, ns, children } = el;
17724
17725
  if (!inVPre) {
17725
17726
  if (tag === "slot") {
17726
17727
  el.tagType = 2;
@@ -17731,7 +17732,13 @@ function onCloseTag(el, end, isImplied = false) {
17731
17732
  }
17732
17733
  }
17733
17734
  if (!tokenizer$2.inRCDATA) {
17734
- el.children = condenseWhitespace(el.children, el.tag);
17735
+ el.children = condenseWhitespace(children);
17736
+ }
17737
+ if (ns === 0 && currentOptions.isIgnoreNewlineTag(tag)) {
17738
+ const first = children[0];
17739
+ if (first && first.type === 2) {
17740
+ first.content = first.content.replace(/^\r?\n/, "");
17741
+ }
17735
17742
  }
17736
17743
  if (ns === 0 && currentOptions.isPreTag(tag)) {
17737
17744
  inPre--;
@@ -17812,12 +17819,6 @@ function condenseWhitespace(nodes, tag) {
17812
17819
  }
17813
17820
  }
17814
17821
  }
17815
- if (inPre && tag && currentOptions.isPreTag(tag)) {
17816
- const first = nodes[0];
17817
- if (first && first.type === 2) {
17818
- first.content = first.content.replace(/^\r?\n/, "");
17819
- }
17820
- }
17821
17822
  return removedWhitespace ? nodes.filter(Boolean) : nodes;
17822
17823
  }
17823
17824
  function isAllWhitespace(str) {
@@ -24808,6 +24809,7 @@ const parserOptions = {
24808
24809
  isVoidTag,
24809
24810
  isNativeTag: (tag) => isHTMLTag(tag) || isSVGTag(tag) || isMathMLTag(tag),
24810
24811
  isPreTag: (tag) => tag === "pre",
24812
+ isIgnoreNewlineTag: (tag) => tag === "pre" || tag === "textarea",
24811
24813
  decodeEntities: void 0,
24812
24814
  isBuiltInComponent: (tag) => {
24813
24815
  if (tag === "Transition" || tag === "transition") {
@@ -25220,12 +25222,17 @@ const stringifyStatic = (children, context, parent) => {
25220
25222
  // will insert / hydrate
25221
25223
  String(currentChunk.length)
25222
25224
  ]);
25225
+ const deleteCount = currentChunk.length - 1;
25223
25226
  if (isParentCached) {
25224
- parent.codegenNode.children.value = createArrayExpression([staticCall]);
25227
+ children.splice(
25228
+ currentIndex - currentChunk.length,
25229
+ currentChunk.length,
25230
+ // @ts-expect-error
25231
+ staticCall
25232
+ );
25225
25233
  } else {
25226
25234
  currentChunk[0].codegenNode.value = staticCall;
25227
25235
  if (currentChunk.length > 1) {
25228
- const deleteCount = currentChunk.length - 1;
25229
25236
  children.splice(currentIndex - currentChunk.length + 1, deleteCount);
25230
25237
  const cacheIndex = context.cached.indexOf(
25231
25238
  currentChunk[currentChunk.length - 1].codegenNode
@@ -25237,9 +25244,9 @@ const stringifyStatic = (children, context, parent) => {
25237
25244
  }
25238
25245
  context.cached.splice(cacheIndex - deleteCount + 1, deleteCount);
25239
25246
  }
25240
- return deleteCount;
25241
25247
  }
25242
25248
  }
25249
+ return deleteCount;
25243
25250
  }
25244
25251
  return 0;
25245
25252
  };
@@ -40744,16 +40751,12 @@ function rewriteSelector(id, rule, selector, selectorRoot, deep, slotted = false
40744
40751
  });
40745
40752
  if (rule.nodes.some((node2) => node2.type === "rule")) {
40746
40753
  const deep2 = rule.__deep;
40747
- const decls = rule.nodes.filter((node2) => node2.type === "decl");
40748
- if (!deep2 && decls.length) {
40749
- for (const decl of decls) {
40750
- rule.removeChild(decl);
40751
- }
40752
- const hostRule = new Rule({
40753
- nodes: decls,
40754
- selector: "&"
40755
- });
40756
- rule.prepend(hostRule);
40754
+ if (!deep2) {
40755
+ extractAndWrapNodes(rule);
40756
+ const atruleNodes = rule.nodes.filter((node2) => node2.type === "atrule");
40757
+ for (const atnode of atruleNodes) {
40758
+ extractAndWrapNodes(atnode);
40759
+ }
40757
40760
  }
40758
40761
  shouldInject = deep2;
40759
40762
  }
@@ -40789,6 +40792,22 @@ function rewriteSelector(id, rule, selector, selectorRoot, deep, slotted = false
40789
40792
  function isSpaceCombinator(node) {
40790
40793
  return node.type === "combinator" && /^\s+$/.test(node.value);
40791
40794
  }
40795
+ function extractAndWrapNodes(parentNode) {
40796
+ if (!parentNode.nodes) return;
40797
+ const nodes = parentNode.nodes.filter(
40798
+ (node) => node.type === "decl" || node.type === "comment"
40799
+ );
40800
+ if (nodes.length) {
40801
+ for (const node of nodes) {
40802
+ parentNode.removeChild(node);
40803
+ }
40804
+ const wrappedRule = new Rule({
40805
+ nodes,
40806
+ selector: "&"
40807
+ });
40808
+ parentNode.prepend(wrappedRule);
40809
+ }
40810
+ }
40792
40811
  scopedPlugin.postcss = true;
40793
40812
 
40794
40813
  var sourceMap$1 = {};
@@ -48911,7 +48930,7 @@ var __spreadValues = (a, b) => {
48911
48930
  }
48912
48931
  return a;
48913
48932
  };
48914
- const version = "3.5.4";
48933
+ const version = "3.5.5";
48915
48934
  const parseCache = parseCache$1;
48916
48935
  const errorMessages = __spreadValues(__spreadValues({}, errorMessages$1), DOMErrorMessages);
48917
48936
  const walk = walk$2;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vue/compiler-sfc",
3
- "version": "3.5.4",
3
+ "version": "3.5.5",
4
4
  "description": "@vue/compiler-sfc",
5
5
  "main": "dist/compiler-sfc.cjs.js",
6
6
  "module": "dist/compiler-sfc.esm-browser.js",
@@ -47,10 +47,10 @@
47
47
  "magic-string": "^0.30.11",
48
48
  "postcss": "^8.4.44",
49
49
  "source-map-js": "^1.2.0",
50
- "@vue/compiler-core": "3.5.4",
51
- "@vue/compiler-dom": "3.5.4",
52
- "@vue/compiler-ssr": "3.5.4",
53
- "@vue/shared": "3.5.4"
50
+ "@vue/compiler-core": "3.5.5",
51
+ "@vue/compiler-dom": "3.5.5",
52
+ "@vue/shared": "3.5.5",
53
+ "@vue/compiler-ssr": "3.5.5"
54
54
  },
55
55
  "devDependencies": {
56
56
  "@babel/types": "^7.25.2",