vite 7.1.5 → 7.1.7

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,4 +1,4 @@
1
1
  import "./dep-SmwnYDP9.js";
2
- import { BuildEnvironment, build, buildEnvironmentOptionsDefaults, builderOptionsDefaults, createBuilder, createToImportMetaURLBasedRelativeRuntime, injectEnvironmentToHooks, onRollupLog, resolveBuildEnvironmentOptions, resolveBuildOutputs, resolveBuildPlugins, resolveBuilderOptions, resolveLibFilename, resolveUserExternal, toOutputFilePathInCss, toOutputFilePathInHtml, toOutputFilePathInJS, toOutputFilePathWithoutRuntime } from "./dep-M_KD0XSK.js";
2
+ import { BuildEnvironment, build, buildEnvironmentOptionsDefaults, builderOptionsDefaults, createBuilder, createToImportMetaURLBasedRelativeRuntime, injectEnvironmentToHooks, onRollupLog, resolveBuildEnvironmentOptions, resolveBuildOutputs, resolveBuildPlugins, resolveBuilderOptions, resolveLibFilename, resolveUserExternal, toOutputFilePathInCss, toOutputFilePathInHtml, toOutputFilePathInJS, toOutputFilePathWithoutRuntime } from "./dep-Bm2ujbhY.js";
3
3
 
4
4
  export { createBuilder, resolveBuildPlugins };
@@ -250,10 +250,7 @@ var Preprocessor = class {
250
250
  return false;
251
251
  }
252
252
  if (caseSensitive) return this.html.startsWith(pattern, this.pos);
253
- for (let i = 0; i < pattern.length; i++) {
254
- const cp = this.html.charCodeAt(this.pos + i) | 32;
255
- if (cp !== pattern.charCodeAt(i)) return false;
256
- }
253
+ for (let i = 0; i < pattern.length; i++) if ((this.html.charCodeAt(this.pos + i) | 32) !== pattern.charCodeAt(i)) return false;
257
254
  return true;
258
255
  }
259
256
  peek(offset) {
@@ -293,8 +290,7 @@ var Preprocessor = class {
293
290
  }
294
291
  this.skipNextNewLine = false;
295
292
  if (isSurrogate(cp)) cp = this._processSurrogate(cp);
296
- const isCommonValidRange = this.handler.onParseError === null || cp > 31 && cp < 127 || cp === CODE_POINTS.LINE_FEED || cp === CODE_POINTS.CARRIAGE_RETURN || cp > 159 && cp < 64976;
297
- if (!isCommonValidRange) this._checkForProblematicCharacters(cp);
293
+ if (!(this.handler.onParseError === null || cp > 31 && cp < 127 || cp === CODE_POINTS.LINE_FEED || cp === CODE_POINTS.CARRIAGE_RETURN || cp > 159 && cp < 64976)) this._checkForProblematicCharacters(cp);
298
294
  return cp;
299
295
  }
300
296
  _checkForProblematicCharacters(cp) {
@@ -1250,15 +1246,6 @@ const NUMBERED_HEADERS = new Set([
1250
1246
  $.H5,
1251
1247
  $.H6
1252
1248
  ]);
1253
- const UNESCAPED_TEXT = new Set([
1254
- TAG_NAMES.STYLE,
1255
- TAG_NAMES.SCRIPT,
1256
- TAG_NAMES.XMP,
1257
- TAG_NAMES.IFRAME,
1258
- TAG_NAMES.NOEMBED,
1259
- TAG_NAMES.NOFRAMES,
1260
- TAG_NAMES.PLAINTEXT
1261
- ]);
1262
1249
 
1263
1250
  //#endregion
1264
1251
  //#region ../../node_modules/.pnpm/parse5@8.0.0/node_modules/parse5/dist/tokenizer/index.js
@@ -2069,8 +2056,7 @@ var Tokenizer = class {
2069
2056
  this._createEndTagToken();
2070
2057
  const token = this.currentToken;
2071
2058
  token.tagName = this.lastStartTagName;
2072
- const cp = this.preprocessor.peek(this.lastStartTagName.length);
2073
- switch (cp) {
2059
+ switch (this.preprocessor.peek(this.lastStartTagName.length)) {
2074
2060
  case CODE_POINTS.SPACE:
2075
2061
  case CODE_POINTS.LINE_FEED:
2076
2062
  case CODE_POINTS.TABULATION:
@@ -2637,13 +2623,11 @@ var Tokenizer = class {
2637
2623
  case CODE_POINTS.HYPHEN_MINUS:
2638
2624
  this.state = State.COMMENT_START_DASH;
2639
2625
  break;
2640
- case CODE_POINTS.GREATER_THAN_SIGN: {
2626
+ case CODE_POINTS.GREATER_THAN_SIGN:
2641
2627
  this._err(ERR.abruptClosingOfEmptyComment);
2642
2628
  this.state = State.DATA;
2643
- const token = this.currentToken;
2644
- this.emitCurrentComment(token);
2629
+ this.emitCurrentComment(this.currentToken);
2645
2630
  break;
2646
- }
2647
2631
  default:
2648
2632
  this.state = State.COMMENT;
2649
2633
  this._stateComment(cp);
@@ -3765,16 +3749,13 @@ const defaultTreeAdapter = {
3765
3749
  doctypeNode.name = name;
3766
3750
  doctypeNode.publicId = publicId;
3767
3751
  doctypeNode.systemId = systemId;
3768
- } else {
3769
- const node = {
3770
- nodeName: "#documentType",
3771
- name,
3772
- publicId,
3773
- systemId,
3774
- parentNode: null
3775
- };
3776
- defaultTreeAdapter.appendChild(document, node);
3777
- }
3752
+ } else defaultTreeAdapter.appendChild(document, {
3753
+ nodeName: "#documentType",
3754
+ name,
3755
+ publicId,
3756
+ systemId,
3757
+ parentNode: null
3758
+ });
3778
3759
  },
3779
3760
  setDocumentMode(document, mode) {
3780
3761
  document.mode = mode;
@@ -4178,8 +4159,7 @@ const EXITS_FOREIGN_CONTENT = new Set([
4178
4159
  ]);
4179
4160
  function causesExit(startTagToken) {
4180
4161
  const tn = startTagToken.tagID;
4181
- const isFontWithAttrs = tn === TAG_ID.FONT && startTagToken.attrs.some(({ name }) => name === ATTRS.COLOR || name === ATTRS.SIZE || name === ATTRS.FACE);
4182
- return isFontWithAttrs || EXITS_FOREIGN_CONTENT.has(tn);
4162
+ return tn === TAG_ID.FONT && startTagToken.attrs.some(({ name }) => name === ATTRS.COLOR || name === ATTRS.SIZE || name === ATTRS.FACE) || EXITS_FOREIGN_CONTENT.has(tn);
4183
4163
  }
4184
4164
  function adjustTokenMathMLAttrs(token) {
4185
4165
  for (let i = 0; i < token.attrs.length; i++) if (token.attrs[i].name === DEFINITION_URL_ATTR) {
@@ -4356,7 +4336,7 @@ var Parser = class {
4356
4336
  var _a$1;
4357
4337
  if (!this.onParseError) return;
4358
4338
  const loc = (_a$1 = token.location) !== null && _a$1 !== void 0 ? _a$1 : BASE_LOC;
4359
- const err = {
4339
+ this.onParseError({
4360
4340
  code,
4361
4341
  startLine: loc.startLine,
4362
4342
  startCol: loc.startCol,
@@ -4364,8 +4344,7 @@ var Parser = class {
4364
4344
  endLine: beforeToken ? loc.startLine : loc.endLine,
4365
4345
  endCol: beforeToken ? loc.startCol : loc.endCol,
4366
4346
  endOffset: beforeToken ? loc.startOffset : loc.endOffset
4367
- };
4368
- this.onParseError(err);
4347
+ });
4369
4348
  }
4370
4349
  /** @internal */
4371
4350
  onItemPush(node, tid, isTop) {
@@ -4446,13 +4425,9 @@ var Parser = class {
4446
4425
  }
4447
4426
  /** @protected */
4448
4427
  _setDocumentType(token) {
4449
- const name = token.name || "";
4450
- const publicId = token.publicId || "";
4451
- const systemId = token.systemId || "";
4452
- this.treeAdapter.setDocumentType(this.document, name, publicId, systemId);
4428
+ this.treeAdapter.setDocumentType(this.document, token.name || "", token.publicId || "", token.systemId || "");
4453
4429
  if (token.location) {
4454
- const documentChildren = this.treeAdapter.getChildNodes(this.document);
4455
- const docTypeNode = documentChildren.find((node) => this.treeAdapter.isDocumentTypeNode(node));
4430
+ const docTypeNode = this.treeAdapter.getChildNodes(this.document).find((node) => this.treeAdapter.isDocumentTypeNode(node));
4456
4431
  if (docTypeNode) this.treeAdapter.setNodeSourceCodeLocation(docTypeNode, token.location);
4457
4432
  }
4458
4433
  }
@@ -4530,8 +4505,7 @@ var Parser = class {
4530
4505
  const siblings = this.treeAdapter.getChildNodes(parent);
4531
4506
  const textNodeIdx = beforeElement ? siblings.lastIndexOf(beforeElement) : siblings.length;
4532
4507
  const textNode = siblings[textNodeIdx - 1];
4533
- const tnLoc = this.treeAdapter.getNodeSourceCodeLocation(textNode);
4534
- if (tnLoc) {
4508
+ if (this.treeAdapter.getNodeSourceCodeLocation(textNode)) {
4535
4509
  const { endLine, endCol, endOffset } = token.location;
4536
4510
  this.treeAdapter.updateNodeSourceCodeLocation(textNode, {
4537
4511
  endLine,
@@ -5212,8 +5186,7 @@ function aaInnerLoop(p, furthestBlock, formattingElement) {
5212
5186
  nextElement = p.openElements.getCommonAncestor(element);
5213
5187
  const elementEntry = p.activeFormattingElements.getElementEntry(element);
5214
5188
  const counterOverflow = elementEntry && i >= AA_INNER_LOOP_ITER;
5215
- const shouldRemoveFromOpenElements = !elementEntry || counterOverflow;
5216
- if (shouldRemoveFromOpenElements) {
5189
+ if (!elementEntry || counterOverflow) {
5217
5190
  if (counterOverflow) p.activeFormattingElements.removeEntry(elementEntry);
5218
5191
  p.openElements.remove(element);
5219
5192
  } else {
@@ -5456,8 +5429,7 @@ function endTagInHeadNoScript(p, token) {
5456
5429
  }
5457
5430
  }
5458
5431
  function tokenInHeadNoScript(p, token) {
5459
- const errCode = token.type === TokenType.EOF ? ERR.openElementsLeftAfterEof : ERR.disallowedContentInNoscriptInHead;
5460
- p._err(token, errCode);
5432
+ p._err(token, token.type === TokenType.EOF ? ERR.openElementsLeftAfterEof : ERR.disallowedContentInNoscriptInHead);
5461
5433
  p.openElements.pop();
5462
5434
  p.insertionMode = InsertionMode.IN_HEAD;
5463
5435
  p._processToken(token);
@@ -6268,8 +6240,7 @@ const TABLE_VOID_ELEMENTS = new Set([
6268
6240
  TAG_ID.TR
6269
6241
  ]);
6270
6242
  function startTagInCaption(p, token) {
6271
- const tn = token.tagID;
6272
- if (TABLE_VOID_ELEMENTS.has(tn)) {
6243
+ if (TABLE_VOID_ELEMENTS.has(token.tagID)) {
6273
6244
  if (p.openElements.hasInTableScope(TAG_ID.CAPTION)) {
6274
6245
  p.openElements.generateImpliedEndTags();
6275
6246
  p.openElements.popUntilTagNamePopped(TAG_ID.CAPTION);
@@ -6467,8 +6438,7 @@ function endTagInRow(p, token) {
6467
6438
  }
6468
6439
  }
6469
6440
  function startTagInCell(p, token) {
6470
- const tn = token.tagID;
6471
- if (TABLE_VOID_ELEMENTS.has(tn)) {
6441
+ if (TABLE_VOID_ELEMENTS.has(token.tagID)) {
6472
6442
  if (p.openElements.hasInTableScope(TAG_ID.TD) || p.openElements.hasInTableScope(TAG_ID.TH)) {
6473
6443
  p._closeTableCell();
6474
6444
  startTagInRow(p, token);
@@ -6764,29 +6734,6 @@ function endTagInForeignContent(p, token) {
6764
6734
  }
6765
6735
  }
6766
6736
 
6767
- //#endregion
6768
- //#region ../../node_modules/.pnpm/parse5@8.0.0/node_modules/parse5/dist/serializer/index.js
6769
- const VOID_ELEMENTS = new Set([
6770
- TAG_NAMES.AREA,
6771
- TAG_NAMES.BASE,
6772
- TAG_NAMES.BASEFONT,
6773
- TAG_NAMES.BGSOUND,
6774
- TAG_NAMES.BR,
6775
- TAG_NAMES.COL,
6776
- TAG_NAMES.EMBED,
6777
- TAG_NAMES.FRAME,
6778
- TAG_NAMES.HR,
6779
- TAG_NAMES.IMG,
6780
- TAG_NAMES.INPUT,
6781
- TAG_NAMES.KEYGEN,
6782
- TAG_NAMES.LINK,
6783
- TAG_NAMES.META,
6784
- TAG_NAMES.PARAM,
6785
- TAG_NAMES.SOURCE,
6786
- TAG_NAMES.TRACK,
6787
- TAG_NAMES.WBR
6788
- ]);
6789
-
6790
6737
  //#endregion
6791
6738
  //#region ../../node_modules/.pnpm/parse5@8.0.0/node_modules/parse5/dist/index.js
6792
6739
  /**
@@ -384,10 +384,9 @@ var require_parse_styles = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnp
384
384
  parent: sourceFile
385
385
  });
386
386
  });
387
- const importedContent = await Promise.all(resolved.map((file) => {
387
+ stmt.children = (await Promise.all(resolved.map((file) => {
388
388
  return loadImportContent(result, stmt, file, options, state, postcss);
389
- }));
390
- stmt.children = importedContent.flat().filter((x) => !!x);
389
+ }))).flat().filter((x) => !!x);
391
390
  }
392
391
  async function loadImportContent(result, stmt, filename, options, state, postcss) {
393
392
  const atRule = stmt.node;
@@ -409,10 +408,9 @@ var require_parse_styles = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnp
409
408
  const styles = importedResult.root;
410
409
  result.messages = result.messages.concat(importedResult.messages);
411
410
  if (options.skipDuplicates) {
412
- const hasImport = styles.some((child) => {
411
+ if (!styles.some((child) => {
413
412
  return child.type === "atrule" && child.name === "import";
414
- });
415
- if (!hasImport) {
413
+ })) {
416
414
  if (!state.hashFiles[content]) state.hashFiles[content] = {};
417
415
  state.hashFiles[content][stmtDuplicateCheckKey] = true;
418
416
  }
@@ -422,8 +420,7 @@ var require_parse_styles = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnp
422
420
  function isProcessableURL(uri) {
423
421
  if (/^(?:[a-z]+:)?\/\//i.test(uri)) return false;
424
422
  try {
425
- const url = new URL(uri, "https://example.com");
426
- if (url.search) return false;
423
+ if (new URL(uri, "https://example.com").search) return false;
427
424
  } catch {}
428
425
  return true;
429
426
  }