@absolutejs/absolute 0.19.0-beta.1078 → 0.19.0-beta.1079

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.
package/dist/vue/index.js CHANGED
@@ -1940,16 +1940,39 @@ var init_islandSsr = __esm(() => {
1940
1940
  });
1941
1941
 
1942
1942
  // src/build/maskLiterals.ts
1943
- var SENTINEL = "\uE000", isIdentChar = (c) => /[A-Za-z0-9_$]/.test(c), REGEX_OK_AFTER_CHAR, REGEX_OK_AFTER_WORD, maskLiterals = (src) => {
1943
+ var SENTINEL, isIdentChar = (c) => /[A-Za-z0-9_$]/.test(c), REGEX_OK_AFTER_CHAR, REGEX_OK_AFTER_WORD, maskLiterals = (src) => {
1944
1944
  const n = src.length;
1945
1945
  const pieces = [];
1946
1946
  let out = "";
1947
1947
  let i = 0;
1948
1948
  let prevChar = "";
1949
1949
  let prevWord = "";
1950
+ let prevWasSpace = false;
1951
+ let wordBeforeParen = "";
1950
1952
  const mask = (text) => {
1951
1953
  out += SENTINEL + pieces.length + SENTINEL;
1952
1954
  pieces.push(text);
1955
+ prevChar = ")";
1956
+ prevWord = "";
1957
+ prevWasSpace = false;
1958
+ };
1959
+ const endOfString = (start) => {
1960
+ const q = src[start];
1961
+ let j = start + 1;
1962
+ while (j < n) {
1963
+ const c = src[j];
1964
+ if (c === "\\") {
1965
+ j += 2;
1966
+ continue;
1967
+ }
1968
+ if (c === q)
1969
+ return j + 1;
1970
+ if (c === `
1971
+ `)
1972
+ return j;
1973
+ j++;
1974
+ }
1975
+ return j;
1953
1976
  };
1954
1977
  const endOfInterp = (start) => {
1955
1978
  let j = start;
@@ -2005,24 +2028,6 @@ var SENTINEL = "\uE000", isIdentChar = (c) => /[A-Za-z0-9_$]/.test(c), REGEX_OK_
2005
2028
  }
2006
2029
  return j;
2007
2030
  }
2008
- function endOfString(start) {
2009
- const q = src[start];
2010
- let j = start + 1;
2011
- while (j < n) {
2012
- const c = src[j];
2013
- if (c === "\\") {
2014
- j += 2;
2015
- continue;
2016
- }
2017
- if (c === q)
2018
- return j + 1;
2019
- if (c === `
2020
- `)
2021
- return j;
2022
- j++;
2023
- }
2024
- return j;
2025
- }
2026
2031
  const endOfRegex = (start) => {
2027
2032
  let j = start + 1;
2028
2033
  let inClass = false;
@@ -2060,8 +2065,6 @@ var SENTINEL = "\uE000", isIdentChar = (c) => /[A-Za-z0-9_$]/.test(c), REGEX_OK_
2060
2065
  `)
2061
2066
  i++;
2062
2067
  mask(src.slice(s, i));
2063
- prevChar = "";
2064
- prevWord = "";
2065
2068
  continue;
2066
2069
  }
2067
2070
  if (c === "/" && c2 === "*") {
@@ -2079,16 +2082,20 @@ var SENTINEL = "\uE000", isIdentChar = (c) => /[A-Za-z0-9_$]/.test(c), REGEX_OK_
2079
2082
  const end = endOfTemplate(i);
2080
2083
  mask(src.slice(i, end));
2081
2084
  i = end;
2082
- prevChar = "`";
2083
- prevWord = "";
2084
2085
  continue;
2085
2086
  }
2086
2087
  if (c === '"' || c === "'") {
2087
2088
  const end = endOfString(i);
2088
- out += src.slice(i, end);
2089
+ const isSpecifier = prevWord === "from" || prevWord === "import" || prevChar === "(" && (wordBeforeParen === "import" || wordBeforeParen === "require");
2090
+ if (isSpecifier) {
2091
+ out += src.slice(i, end);
2092
+ prevChar = '"';
2093
+ prevWord = "";
2094
+ prevWasSpace = false;
2095
+ } else {
2096
+ mask(src.slice(i, end));
2097
+ }
2089
2098
  i = end;
2090
- prevChar = '"';
2091
- prevWord = "";
2092
2099
  continue;
2093
2100
  }
2094
2101
  if (c === "/" && (prevChar === "" || REGEX_OK_AFTER_CHAR.has(prevChar) || REGEX_OK_AFTER_WORD.has(prevWord))) {
@@ -2096,25 +2103,36 @@ var SENTINEL = "\uE000", isIdentChar = (c) => /[A-Za-z0-9_$]/.test(c), REGEX_OK_
2096
2103
  if (end > 0) {
2097
2104
  out += src.slice(i, end);
2098
2105
  i = end;
2099
- prevChar = "/";
2106
+ prevChar = ")";
2100
2107
  prevWord = "";
2108
+ prevWasSpace = false;
2101
2109
  continue;
2102
2110
  }
2103
2111
  }
2104
2112
  out += c;
2105
2113
  i++;
2106
2114
  if (c === " " || c === "\t" || c === "\r" || c === `
2107
- `)
2115
+ `) {
2116
+ prevWasSpace = true;
2108
2117
  continue;
2109
- const wasIdent = isIdentChar(prevChar);
2118
+ }
2119
+ if (isIdentChar(c)) {
2120
+ const contiguous = isIdentChar(prevChar) && !prevWasSpace;
2121
+ prevWord = contiguous ? prevWord + c : c;
2122
+ } else {
2123
+ if (c === "(")
2124
+ wordBeforeParen = prevWord;
2125
+ prevWord = "";
2126
+ }
2110
2127
  prevChar = c;
2111
- prevWord = isIdentChar(c) ? wasIdent ? prevWord + c : c : "";
2128
+ prevWasSpace = false;
2112
2129
  }
2113
2130
  const restoreRegex = new RegExp(`${SENTINEL}(\\d+)${SENTINEL}`, "g");
2114
2131
  const restore = (rewritten) => rewritten.replace(restoreRegex, (_m, d) => pieces[Number(d)] ?? "");
2115
2132
  return { masked: out, restore };
2116
2133
  };
2117
2134
  var init_maskLiterals = __esm(() => {
2135
+ SENTINEL = String.fromCharCode(57344);
2118
2136
  REGEX_OK_AFTER_CHAR = new Set([
2119
2137
  "(",
2120
2138
  ",",
@@ -5580,5 +5598,5 @@ export {
5580
5598
  Image
5581
5599
  };
5582
5600
 
5583
- //# debugId=2118F34820604CAB64756E2164756E21
5601
+ //# debugId=F0E283E992F376C264756E2164756E21
5584
5602
  //# sourceMappingURL=index.js.map