@vue/compiler-sfc 3.5.31 → 3.5.33

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.31
2
+ * @vue/compiler-sfc v3.5.33
3
3
  * (c) 2018-present Yuxi (Evan) You and Vue contributors
4
4
  * @license MIT
5
5
  **/
@@ -8110,6 +8110,8 @@ function processRule(id, rule) {
8110
8110
  function rewriteSelector(id, rule, selector, selectorRoot, deep, slotted = false) {
8111
8111
  let node = null;
8112
8112
  let shouldInject = !deep;
8113
+ let hasNestedDeep = false;
8114
+ let splitForNestedDeep = false;
8113
8115
  selector.each((n) => {
8114
8116
  if (n.type === "combinator" && (n.value === ">>>" || n.value === "/deep/")) {
8115
8117
  n.value = " ";
@@ -8121,6 +8123,49 @@ function rewriteSelector(id, rule, selector, selectorRoot, deep, slotted = false
8121
8123
  }
8122
8124
  if (n.type === "pseudo") {
8123
8125
  const { value } = n;
8126
+ if (isDeepContainerPseudo(n)) {
8127
+ const hasDeepSelectors = n.nodes.some(
8128
+ (selector2) => selector2.some(isDeepSelector)
8129
+ );
8130
+ if (hasDeepSelectors) {
8131
+ const hasScopeAnchor = !!node;
8132
+ const hasMixedSelectors = n.nodes.some(
8133
+ (selector2) => !selector2.some(isDeepSelector)
8134
+ );
8135
+ const hasTrailingNodes = selector.index(n) < selector.length - 1;
8136
+ if (canSplitDeepContainerPseudo(n) && !deep && !hasScopeAnchor && hasMixedSelectors && hasTrailingNodes) {
8137
+ splitSelectorForNestedDeep(
8138
+ id,
8139
+ rule,
8140
+ selector,
8141
+ selectorRoot,
8142
+ n,
8143
+ deep,
8144
+ slotted
8145
+ );
8146
+ splitForNestedDeep = true;
8147
+ return false;
8148
+ }
8149
+ if (value === ":not" && !deep && !hasScopeAnchor && hasMixedSelectors && hasTrailingNodes) {
8150
+ return;
8151
+ }
8152
+ n.nodes.forEach(
8153
+ (selector2) => rewriteSelector(
8154
+ id,
8155
+ rule,
8156
+ selector2,
8157
+ selectorRoot,
8158
+ deep || hasScopeAnchor,
8159
+ slotted
8160
+ )
8161
+ );
8162
+ if (!hasScopeAnchor) {
8163
+ node = n;
8164
+ shouldInject = false;
8165
+ }
8166
+ hasNestedDeep = true;
8167
+ }
8168
+ }
8124
8169
  if (value === ":deep" || value === "::v-deep") {
8125
8170
  rule.__deep = true;
8126
8171
  if (n.nodes.length) {
@@ -8195,10 +8240,13 @@ function rewriteSelector(id, rule, selector, selectorRoot, deep, slotted = false
8195
8240
  }
8196
8241
  if (node) return;
8197
8242
  }
8198
- if (n.type !== "pseudo" && n.type !== "combinator" || n.type === "pseudo" && (n.value === ":is" || n.value === ":where") && !node) {
8243
+ if (!hasNestedDeep && (n.type !== "pseudo" && n.type !== "combinator" || n.type === "pseudo" && (n.value === ":is" || n.value === ":where") && !node)) {
8199
8244
  node = n;
8200
8245
  }
8201
8246
  });
8247
+ if (splitForNestedDeep) {
8248
+ return;
8249
+ }
8202
8250
  if (rule.nodes.some((node2) => node2.type === "rule")) {
8203
8251
  const deep2 = rule.__deep;
8204
8252
  if (!deep2) {
@@ -8210,7 +8258,7 @@ function rewriteSelector(id, rule, selector, selectorRoot, deep, slotted = false
8210
8258
  }
8211
8259
  shouldInject = deep2;
8212
8260
  }
8213
- if (node) {
8261
+ if (node && !hasNestedDeep) {
8214
8262
  const { type, value } = node;
8215
8263
  if (type === "pseudo" && (value === ":is" || value === ":where")) {
8216
8264
  node.nodes.forEach(
@@ -8242,6 +8290,38 @@ function rewriteSelector(id, rule, selector, selectorRoot, deep, slotted = false
8242
8290
  function isSpaceCombinator(node) {
8243
8291
  return node.type === "combinator" && /^\s+$/.test(node.value);
8244
8292
  }
8293
+ function isDeepSelector(node) {
8294
+ var _a;
8295
+ if (node.type === "pseudo" && (node.value === ":deep" || node.value === "::v-deep")) {
8296
+ return true;
8297
+ }
8298
+ return !!((_a = node.nodes) == null ? void 0 : _a.some((child) => isDeepSelector(child)));
8299
+ }
8300
+ function isDeepContainerPseudo(node) {
8301
+ return node.type === "pseudo" && (node.value === ":is" || node.value === ":where" || node.value === ":has" || node.value === ":not");
8302
+ }
8303
+ function canSplitDeepContainerPseudo(node) {
8304
+ return node.value === ":is" || node.value === ":where" || node.value === ":has";
8305
+ }
8306
+ function splitSelectorForNestedDeep(id, rule, selector, selectorRoot, pseudo, deep, slotted) {
8307
+ const pseudoIndex = selector.index(pseudo);
8308
+ const selectors = pseudo.nodes.map((branch, index) => {
8309
+ const branchSelector = selector.clone();
8310
+ if (branchSelector.first) {
8311
+ branchSelector.first.spaces.before = index === 0 ? selector.first.spaces.before : " ";
8312
+ }
8313
+ const branchPseudo = branchSelector.at(pseudoIndex);
8314
+ const branchClone = branch.clone();
8315
+ if (branchClone.first) {
8316
+ branchClone.first.spaces.before = "";
8317
+ }
8318
+ branchPseudo.removeAll();
8319
+ branchPseudo.append(branchClone);
8320
+ rewriteSelector(id, rule, branchSelector, selectorRoot, deep, slotted);
8321
+ return branchSelector;
8322
+ });
8323
+ selector.replaceWith(...selectors);
8324
+ }
8245
8325
  function extractAndWrapNodes(parentNode) {
8246
8326
  if (!parentNode.nodes) return;
8247
8327
  const nodes = parentNode.nodes.filter(
@@ -20189,7 +20269,9 @@ function expand_(str, max, isTop) {
20189
20269
  const x = numeric(n[0]);
20190
20270
  const y = numeric(n[1]);
20191
20271
  const width = Math.max(n[0].length, n[1].length);
20192
- let incr = n.length === 3 && n[2] !== undefined ? Math.abs(numeric(n[2])) : 1;
20272
+ let incr = n.length === 3 && n[2] !== undefined ?
20273
+ Math.max(Math.abs(numeric(n[2])), 1)
20274
+ : 1;
20193
20275
  let test = lte;
20194
20276
  const reverse = y < x;
20195
20277
  if (reverse) {
@@ -20420,16 +20502,16 @@ const parseClass = (glob, position) => {
20420
20502
  const unescape = (s, { windowsPathsNoEscape = false, magicalBraces = true, } = {}) => {
20421
20503
  if (magicalBraces) {
20422
20504
  return windowsPathsNoEscape ?
20423
- s.replace(/\[([^\/\\])\]/g, '$1')
20505
+ s.replace(/\[([^/\\])\]/g, '$1')
20424
20506
  : s
20425
- .replace(/((?!\\).|^)\[([^\/\\])\]/g, '$1$2')
20426
- .replace(/\\([^\/])/g, '$1');
20507
+ .replace(/((?!\\).|^)\[([^/\\])\]/g, '$1$2')
20508
+ .replace(/\\([^/])/g, '$1');
20427
20509
  }
20428
20510
  return windowsPathsNoEscape ?
20429
- s.replace(/\[([^\/\\{}])\]/g, '$1')
20511
+ s.replace(/\[([^/\\{}])\]/g, '$1')
20430
20512
  : s
20431
- .replace(/((?!\\).|^)\[([^\/\\{}])\]/g, '$1$2')
20432
- .replace(/\\([^\/{}])/g, '$1');
20513
+ .replace(/((?!\\).|^)\[([^/\\{}])\]/g, '$1$2')
20514
+ .replace(/\\([^/{}])/g, '$1');
20433
20515
  };
20434
20516
 
20435
20517
  // parse a single path portion
@@ -20621,15 +20703,14 @@ class AST {
20621
20703
  }
20622
20704
  // reconstructs the pattern
20623
20705
  toString() {
20624
- if (this.#toString !== undefined)
20625
- return this.#toString;
20626
- if (!this.type) {
20627
- return (this.#toString = this.#parts.map(p => String(p)).join(''));
20628
- }
20629
- else {
20630
- return (this.#toString =
20631
- this.type + '(' + this.#parts.map(p => String(p)).join('|') + ')');
20632
- }
20706
+ return (this.#toString !== undefined ? this.#toString
20707
+ : !this.type ?
20708
+ (this.#toString = this.#parts.map(p => String(p)).join(''))
20709
+ : (this.#toString =
20710
+ this.type +
20711
+ '(' +
20712
+ this.#parts.map(p => String(p)).join('|') +
20713
+ ')'));
20633
20714
  }
20634
20715
  #fillNegs() {
20635
20716
  /* c8 ignore start */
@@ -20909,7 +20990,7 @@ class AST {
20909
20990
  }
20910
20991
  #canUsurpType(c) {
20911
20992
  const m = usurpMap.get(this.type);
20912
- return !!(m?.has(c));
20993
+ return !!m?.has(c);
20913
20994
  }
20914
20995
  #canUsurp(child) {
20915
20996
  if (!child ||
@@ -21307,7 +21388,7 @@ const minimatch = (p, pattern, options = {}) => {
21307
21388
  return new Minimatch(pattern, options).match(p);
21308
21389
  };
21309
21390
  // Optimized checking for the most common glob patterns.
21310
- const starDotExtRE = /^\*+([^+@!?\*\[\(]*)$/;
21391
+ const starDotExtRE = /^\*+([^+@!?*[(]*)$/;
21311
21392
  const starDotExtTest = (ext) => (f) => !f.startsWith('.') && f.endsWith(ext);
21312
21393
  const starDotExtTestDot = (ext) => (f) => f.endsWith(ext);
21313
21394
  const starDotExtTestNocase = (ext) => {
@@ -21326,7 +21407,7 @@ const dotStarTest = (f) => f !== '.' && f !== '..' && f.startsWith('.');
21326
21407
  const starRE = /^\*+$/;
21327
21408
  const starTest = (f) => f.length !== 0 && !f.startsWith('.');
21328
21409
  const starTestDot = (f) => f.length !== 0 && f !== '.' && f !== '..';
21329
- const qmarksRE = /^\?+([^+@!?\*\[\(]*)?$/;
21410
+ const qmarksRE = /^\?+([^+@!?*[(]*)?$/;
21330
21411
  const qmarksTestNocase = ([$0, ext = '']) => {
21331
21412
  const noext = qmarksTestNoExt([$0]);
21332
21413
  if (!ext)
@@ -21553,6 +21634,7 @@ class Minimatch {
21553
21634
  // step 2: expand braces
21554
21635
  this.globSet = [...new Set(this.braceExpand())];
21555
21636
  if (options.debug) {
21637
+ //oxlint-disable-next-line no-console
21556
21638
  this.debug = (...args) => console.error(...args);
21557
21639
  }
21558
21640
  this.debug(this.pattern, this.globSet);
@@ -21615,10 +21697,10 @@ class Minimatch {
21615
21697
  preprocess(globParts) {
21616
21698
  // if we're not in globstar mode, then turn ** into *
21617
21699
  if (this.options.noglobstar) {
21618
- for (let i = 0; i < globParts.length; i++) {
21619
- for (let j = 0; j < globParts[i].length; j++) {
21620
- if (globParts[i][j] === '**') {
21621
- globParts[i][j] = '*';
21700
+ for (const partset of globParts) {
21701
+ for (let j = 0; j < partset.length; j++) {
21702
+ if (partset[j] === '**') {
21703
+ partset[j] = '*';
21622
21704
  }
21623
21705
  }
21624
21706
  }
@@ -21706,7 +21788,11 @@ class Minimatch {
21706
21788
  let dd = 0;
21707
21789
  while (-1 !== (dd = parts.indexOf('..', dd + 1))) {
21708
21790
  const p = parts[dd - 1];
21709
- if (p && p !== '.' && p !== '..' && p !== '**') {
21791
+ if (p &&
21792
+ p !== '.' &&
21793
+ p !== '..' &&
21794
+ p !== '**' &&
21795
+ !(this.isWindows && /^[a-z]:$/i.test(p))) {
21710
21796
  didSomething = true;
21711
21797
  parts.splice(dd - 1, 2);
21712
21798
  dd -= 2;
@@ -21955,15 +22041,17 @@ class Minimatch {
21955
22041
  // split the pattern up into globstar-delimited sections
21956
22042
  // the tail has to be at the end, and the others just have
21957
22043
  // to be found in order from the head.
21958
- const [head, body, tail] = partial ? [
21959
- pattern.slice(patternIndex, firstgs),
21960
- pattern.slice(firstgs + 1),
21961
- [],
21962
- ] : [
21963
- pattern.slice(patternIndex, firstgs),
21964
- pattern.slice(firstgs + 1, lastgs),
21965
- pattern.slice(lastgs + 1),
21966
- ];
22044
+ const [head, body, tail] = partial ?
22045
+ [
22046
+ pattern.slice(patternIndex, firstgs),
22047
+ pattern.slice(firstgs + 1),
22048
+ [],
22049
+ ]
22050
+ : [
22051
+ pattern.slice(patternIndex, firstgs),
22052
+ pattern.slice(firstgs + 1, lastgs),
22053
+ pattern.slice(lastgs + 1),
22054
+ ];
21967
22055
  // check the head, from the current file/pattern index.
21968
22056
  if (head.length) {
21969
22057
  const fileHead = file.slice(fileIndex, fileIndex + head.length);
@@ -22309,7 +22397,7 @@ class Minimatch {
22309
22397
  this.regexp = new RegExp(re, [...flags].join(''));
22310
22398
  /* c8 ignore start */
22311
22399
  }
22312
- catch (ex) {
22400
+ catch {
22313
22401
  // should be impossible
22314
22402
  this.regexp = false;
22315
22403
  }
@@ -22324,7 +22412,7 @@ class Minimatch {
22324
22412
  if (this.preserveMultipleSlashes) {
22325
22413
  return p.split('/');
22326
22414
  }
22327
- else if (this.isWindows && /^\/\/[^\/]+/.test(p)) {
22415
+ else if (this.isWindows && /^\/\/[^/]+/.test(p)) {
22328
22416
  // add an extra '' for the one we lose
22329
22417
  return ['', ...p.split(/\/+/)];
22330
22418
  }
@@ -22366,8 +22454,7 @@ class Minimatch {
22366
22454
  filename = ff[i];
22367
22455
  }
22368
22456
  }
22369
- for (let i = 0; i < set.length; i++) {
22370
- const pattern = set[i];
22457
+ for (const pattern of set) {
22371
22458
  let file = ff;
22372
22459
  if (options.matchBase && pattern.length === 1) {
22373
22460
  file = [filename];
@@ -25583,7 +25670,7 @@ function mergeSourceMaps(scriptMap, templateMap, templateLineOffset) {
25583
25670
  return generator.toJSON();
25584
25671
  }
25585
25672
 
25586
- const version = "3.5.31";
25673
+ const version = "3.5.33";
25587
25674
  const parseCache = parseCache$1;
25588
25675
  const errorMessages = {
25589
25676
  ...CompilerDOM.errorMessages,
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @vue/compiler-sfc v3.5.31
2
+ * @vue/compiler-sfc v3.5.33
3
3
  * (c) 2018-present Yuxi (Evan) You and Vue contributors
4
4
  * @license MIT
5
5
  **/
@@ -34270,6 +34270,18 @@ function requireStringifier () {
34270
34270
  if (hasRequiredStringifier) return stringifier;
34271
34271
  hasRequiredStringifier = 1;
34272
34272
 
34273
+ // Escapes sequences that could break out of an HTML <style> context.
34274
+ // Uses CSS unicode escaping (\3c = '<') which is valid CSS and parsed
34275
+ // correctly by all compliant CSS consumers.
34276
+ const STYLE_TAG = /(<)(\/?style\b)/gi;
34277
+ const COMMENT_OPEN = /(<)(!--)/g;
34278
+
34279
+ function escapeHTMLInCSS(str) {
34280
+ if (typeof str !== 'string') return str
34281
+ if (!str.includes('<')) return str
34282
+ return str.replace(STYLE_TAG, '\\3c $2').replace(COMMENT_OPEN, '\\3c $2')
34283
+ }
34284
+
34273
34285
  const DEFAULT_RAW = {
34274
34286
  after: '\n',
34275
34287
  beforeClose: '\n',
@@ -34308,7 +34320,7 @@ function requireStringifier () {
34308
34320
  this.block(node, name + params);
34309
34321
  } else {
34310
34322
  let end = (node.raws.between || '') + (semicolon ? ';' : '');
34311
- this.builder(name + params + end, node);
34323
+ this.builder(escapeHTMLInCSS(name + params + end), node);
34312
34324
  }
34313
34325
  }
34314
34326
 
@@ -34343,7 +34355,7 @@ function requireStringifier () {
34343
34355
 
34344
34356
  block(node, start) {
34345
34357
  let between = this.raw(node, 'between', 'beforeOpen');
34346
- this.builder(start + between + '{', node, 'start');
34358
+ this.builder(escapeHTMLInCSS(start + between) + '{', node, 'start');
34347
34359
 
34348
34360
  let after;
34349
34361
  if (node.nodes && node.nodes.length) {
@@ -34353,7 +34365,7 @@ function requireStringifier () {
34353
34365
  after = this.raw(node, 'after', 'emptyBody');
34354
34366
  }
34355
34367
 
34356
- if (after) this.builder(after);
34368
+ if (after) this.builder(escapeHTMLInCSS(after));
34357
34369
  this.builder('}', node, 'end');
34358
34370
  }
34359
34371
 
@@ -34365,10 +34377,11 @@ function requireStringifier () {
34365
34377
  }
34366
34378
 
34367
34379
  let semicolon = this.raw(node, 'semicolon');
34380
+ let isDocument = node.type === 'document';
34368
34381
  for (let i = 0; i < node.nodes.length; i++) {
34369
34382
  let child = node.nodes[i];
34370
34383
  let before = this.raw(child, 'before');
34371
- if (before) this.builder(before);
34384
+ if (before) this.builder(isDocument ? before : escapeHTMLInCSS(before));
34372
34385
  this.stringify(child, last !== i || semicolon);
34373
34386
  }
34374
34387
  }
@@ -34376,7 +34389,7 @@ function requireStringifier () {
34376
34389
  comment(node) {
34377
34390
  let left = this.raw(node, 'left', 'commentLeft');
34378
34391
  let right = this.raw(node, 'right', 'commentRight');
34379
- this.builder('/*' + left + node.text + right + '*/', node);
34392
+ this.builder(escapeHTMLInCSS('/*' + left + node.text + right + '*/'), node);
34380
34393
  }
34381
34394
 
34382
34395
  decl(node, semicolon) {
@@ -34388,7 +34401,7 @@ function requireStringifier () {
34388
34401
  }
34389
34402
 
34390
34403
  if (semicolon) string += ';';
34391
- this.builder(string, node);
34404
+ this.builder(escapeHTMLInCSS(string), node);
34392
34405
  }
34393
34406
 
34394
34407
  document(node) {
@@ -34594,13 +34607,17 @@ function requireStringifier () {
34594
34607
 
34595
34608
  root(node) {
34596
34609
  this.body(node);
34597
- if (node.raws.after) this.builder(node.raws.after);
34610
+ if (node.raws.after) {
34611
+ let after = node.raws.after;
34612
+ let isDocument = node.parent && node.parent.type === 'document';
34613
+ this.builder(isDocument ? after : escapeHTMLInCSS(after));
34614
+ }
34598
34615
  }
34599
34616
 
34600
34617
  rule(node) {
34601
34618
  this.block(node, this.rawValue(node, 'selector'));
34602
34619
  if (node.raws.ownSemicolon) {
34603
- this.builder(node.raws.ownSemicolon, node, 'end');
34620
+ this.builder(escapeHTMLInCSS(node.raws.ownSemicolon), node, 'end');
34604
34621
  }
34605
34622
  }
34606
34623
 
@@ -35799,7 +35816,8 @@ function requirePreviousMap () {
35799
35816
  return fromBase64(text.substr(baseUriMatch[0].length))
35800
35817
  }
35801
35818
 
35802
- let encoding = text.match(/data:application\/json;([^,]+),/)[1];
35819
+ let encoding = text.slice('data:application/json;'.length);
35820
+ encoding = encoding.slice(0, encoding.indexOf(','));
35803
35821
  throw new Error('Unsupported source map encoding ' + encoding)
35804
35822
  }
35805
35823
 
@@ -36042,7 +36060,15 @@ function requireInput () {
36042
36060
  );
36043
36061
  }
36044
36062
 
36045
- result.input = { column, endColumn, endLine, endOffset, line, offset, source: this.css };
36063
+ result.input = {
36064
+ column,
36065
+ endColumn,
36066
+ endLine,
36067
+ endOffset,
36068
+ line,
36069
+ offset,
36070
+ source: this.css
36071
+ };
36046
36072
  if (this.file) {
36047
36073
  if (pathToFileURL) {
36048
36074
  result.input.url = pathToFileURL(this.file).toString();
@@ -38135,7 +38161,7 @@ function requireNoWorkResult () {
38135
38161
 
38136
38162
  let MapGenerator = /*@__PURE__*/ requireMapGenerator();
38137
38163
  let parse = /*@__PURE__*/ requireParse();
38138
- const Result = /*@__PURE__*/ requireResult();
38164
+ let Result = /*@__PURE__*/ requireResult();
38139
38165
  let stringify = /*@__PURE__*/ requireStringify();
38140
38166
  let warnOnce = /*@__PURE__*/ requireWarnOnce();
38141
38167
 
@@ -38285,7 +38311,7 @@ function requireProcessor$1 () {
38285
38311
 
38286
38312
  class Processor {
38287
38313
  constructor(plugins = []) {
38288
- this.version = '8.5.8';
38314
+ this.version = '8.5.10';
38289
38315
  this.plugins = this.normalize(plugins);
38290
38316
  }
38291
38317
 
@@ -42186,6 +42212,8 @@ function processRule(id, rule) {
42186
42212
  function rewriteSelector(id, rule, selector, selectorRoot, deep, slotted = false) {
42187
42213
  let node = null;
42188
42214
  let shouldInject = !deep;
42215
+ let hasNestedDeep = false;
42216
+ let splitForNestedDeep = false;
42189
42217
  selector.each((n) => {
42190
42218
  if (n.type === "combinator" && (n.value === ">>>" || n.value === "/deep/")) {
42191
42219
  n.value = " ";
@@ -42197,6 +42225,49 @@ function rewriteSelector(id, rule, selector, selectorRoot, deep, slotted = false
42197
42225
  }
42198
42226
  if (n.type === "pseudo") {
42199
42227
  const { value } = n;
42228
+ if (isDeepContainerPseudo(n)) {
42229
+ const hasDeepSelectors = n.nodes.some(
42230
+ (selector2) => selector2.some(isDeepSelector)
42231
+ );
42232
+ if (hasDeepSelectors) {
42233
+ const hasScopeAnchor = !!node;
42234
+ const hasMixedSelectors = n.nodes.some(
42235
+ (selector2) => !selector2.some(isDeepSelector)
42236
+ );
42237
+ const hasTrailingNodes = selector.index(n) < selector.length - 1;
42238
+ if (canSplitDeepContainerPseudo(n) && !deep && !hasScopeAnchor && hasMixedSelectors && hasTrailingNodes) {
42239
+ splitSelectorForNestedDeep(
42240
+ id,
42241
+ rule,
42242
+ selector,
42243
+ selectorRoot,
42244
+ n,
42245
+ deep,
42246
+ slotted
42247
+ );
42248
+ splitForNestedDeep = true;
42249
+ return false;
42250
+ }
42251
+ if (value === ":not" && !deep && !hasScopeAnchor && hasMixedSelectors && hasTrailingNodes) {
42252
+ return;
42253
+ }
42254
+ n.nodes.forEach(
42255
+ (selector2) => rewriteSelector(
42256
+ id,
42257
+ rule,
42258
+ selector2,
42259
+ selectorRoot,
42260
+ deep || hasScopeAnchor,
42261
+ slotted
42262
+ )
42263
+ );
42264
+ if (!hasScopeAnchor) {
42265
+ node = n;
42266
+ shouldInject = false;
42267
+ }
42268
+ hasNestedDeep = true;
42269
+ }
42270
+ }
42200
42271
  if (value === ":deep" || value === "::v-deep") {
42201
42272
  rule.__deep = true;
42202
42273
  if (n.nodes.length) {
@@ -42271,10 +42342,13 @@ function rewriteSelector(id, rule, selector, selectorRoot, deep, slotted = false
42271
42342
  }
42272
42343
  if (node) return;
42273
42344
  }
42274
- if (n.type !== "pseudo" && n.type !== "combinator" || n.type === "pseudo" && (n.value === ":is" || n.value === ":where") && !node) {
42345
+ if (!hasNestedDeep && (n.type !== "pseudo" && n.type !== "combinator" || n.type === "pseudo" && (n.value === ":is" || n.value === ":where") && !node)) {
42275
42346
  node = n;
42276
42347
  }
42277
42348
  });
42349
+ if (splitForNestedDeep) {
42350
+ return;
42351
+ }
42278
42352
  if (rule.nodes.some((node2) => node2.type === "rule")) {
42279
42353
  const deep2 = rule.__deep;
42280
42354
  if (!deep2) {
@@ -42286,7 +42360,7 @@ function rewriteSelector(id, rule, selector, selectorRoot, deep, slotted = false
42286
42360
  }
42287
42361
  shouldInject = deep2;
42288
42362
  }
42289
- if (node) {
42363
+ if (node && !hasNestedDeep) {
42290
42364
  const { type, value } = node;
42291
42365
  if (type === "pseudo" && (value === ":is" || value === ":where")) {
42292
42366
  node.nodes.forEach(
@@ -42318,6 +42392,38 @@ function rewriteSelector(id, rule, selector, selectorRoot, deep, slotted = false
42318
42392
  function isSpaceCombinator(node) {
42319
42393
  return node.type === "combinator" && /^\s+$/.test(node.value);
42320
42394
  }
42395
+ function isDeepSelector(node) {
42396
+ var _a;
42397
+ if (node.type === "pseudo" && (node.value === ":deep" || node.value === "::v-deep")) {
42398
+ return true;
42399
+ }
42400
+ return !!((_a = node.nodes) == null ? void 0 : _a.some((child) => isDeepSelector(child)));
42401
+ }
42402
+ function isDeepContainerPseudo(node) {
42403
+ return node.type === "pseudo" && (node.value === ":is" || node.value === ":where" || node.value === ":has" || node.value === ":not");
42404
+ }
42405
+ function canSplitDeepContainerPseudo(node) {
42406
+ return node.value === ":is" || node.value === ":where" || node.value === ":has";
42407
+ }
42408
+ function splitSelectorForNestedDeep(id, rule, selector, selectorRoot, pseudo, deep, slotted) {
42409
+ const pseudoIndex = selector.index(pseudo);
42410
+ const selectors = pseudo.nodes.map((branch, index) => {
42411
+ const branchSelector = selector.clone();
42412
+ if (branchSelector.first) {
42413
+ branchSelector.first.spaces.before = index === 0 ? selector.first.spaces.before : " ";
42414
+ }
42415
+ const branchPseudo = branchSelector.at(pseudoIndex);
42416
+ const branchClone = branch.clone();
42417
+ if (branchClone.first) {
42418
+ branchClone.first.spaces.before = "";
42419
+ }
42420
+ branchPseudo.removeAll();
42421
+ branchPseudo.append(branchClone);
42422
+ rewriteSelector(id, rule, branchSelector, selectorRoot, deep, slotted);
42423
+ return branchSelector;
42424
+ });
42425
+ selector.replaceWith(...selectors);
42426
+ }
42321
42427
  function extractAndWrapNodes(parentNode) {
42322
42428
  if (!parentNode.nodes) return;
42323
42429
  const nodes = parentNode.nodes.filter(
@@ -50823,7 +50929,7 @@ var __spreadValues = (a, b) => {
50823
50929
  }
50824
50930
  return a;
50825
50931
  };
50826
- const version = "3.5.31";
50932
+ const version = "3.5.33";
50827
50933
  const parseCache = parseCache$1;
50828
50934
  const errorMessages = __spreadValues(__spreadValues({}, errorMessages$1), DOMErrorMessages);
50829
50935
  const walk = walk$2;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vue/compiler-sfc",
3
- "version": "3.5.31",
3
+ "version": "3.5.33",
4
4
  "description": "@vue/compiler-sfc",
5
5
  "main": "dist/compiler-sfc.cjs.js",
6
6
  "module": "dist/compiler-sfc.esm-browser.js",
@@ -45,12 +45,12 @@
45
45
  "@babel/parser": "^7.29.2",
46
46
  "estree-walker": "^2.0.2",
47
47
  "magic-string": "^0.30.21",
48
- "postcss": "^8.5.8",
48
+ "postcss": "^8.5.10",
49
49
  "source-map-js": "^1.2.1",
50
- "@vue/compiler-core": "3.5.31",
51
- "@vue/compiler-dom": "3.5.31",
52
- "@vue/shared": "3.5.31",
53
- "@vue/compiler-ssr": "3.5.31"
50
+ "@vue/compiler-core": "3.5.33",
51
+ "@vue/shared": "3.5.33",
52
+ "@vue/compiler-dom": "3.5.33",
53
+ "@vue/compiler-ssr": "3.5.33"
54
54
  },
55
55
  "devDependencies": {
56
56
  "@babel/types": "^7.29.0",
@@ -58,10 +58,10 @@
58
58
  "hash-sum": "^2.0.0",
59
59
  "lru-cache": "10.1.0",
60
60
  "merge-source-map": "^1.1.0",
61
- "minimatch": "~10.2.4",
61
+ "minimatch": "~10.2.5",
62
62
  "postcss-modules": "^6.0.1",
63
63
  "postcss-selector-parser": "^7.1.1",
64
64
  "pug": "^3.0.4",
65
- "sass": "^1.98.0"
65
+ "sass": "^1.99.0"
66
66
  }
67
67
  }