@pi-r/chrome 0.11.0 → 0.11.2
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/index.js +125 -134
- package/package.json +5 -5
- package/types/squared.d.ts +1 -1
package/index.js
CHANGED
|
@@ -21,16 +21,14 @@ const CACHE_CONTENT = new Map();
|
|
|
21
21
|
const CACHE_FORMAT = new Map();
|
|
22
22
|
const CACHE_DATASET = {};
|
|
23
23
|
const CACHE_ATRULES = {};
|
|
24
|
-
const
|
|
25
|
-
|
|
26
|
-
return [grouping + '*', grouping + '+'];
|
|
27
|
-
})();
|
|
24
|
+
const PATTERN_STRING_SOME = '(?:\\s|' + dom_1.DomWriter.PATTERN_COMMENT + '|`[0-9a-f]{8}-[0-9a-f]{4}-4[0-9a-f]{3}`)*';
|
|
25
|
+
const PATTERN_STRING_MANY = PATTERN_STRING_SOME.slice(0, -1) + '+';
|
|
28
26
|
const [REGEXP_NTHCHILD, REGEXP_NTHCHILD_UNSAFE, REGEXP_REPLACECSS] = (function () {
|
|
29
27
|
const parenthesis = '(?:,[^()]+(?=\\))|[^()]|\\([^()]*\\(+|\\([^()]*\\)|(?:\\)[^()]+)?\\)*?)+';
|
|
30
28
|
return [
|
|
31
29
|
new RegExp(`\\(${PATTERN_STRING_SOME}([+-])?(?:(\\d*)[nN]|(0))?${PATTERN_STRING_SOME}([+-])?${PATTERN_STRING_SOME}(\\d*)(?:${PATTERN_STRING_MANY}[oO][fF]${PATTERN_STRING_MANY}(${parenthesis})${PATTERN_STRING_SOME}\\)|${PATTERN_STRING_SOME}\\))`, 'g'),
|
|
32
30
|
new RegExp(`\\(\\s*([+-])?(?:(\\d*)[nN]|(0))?\\s*([+-])?\\s*(\\d*)(?:\\s+[oO][fF]\\s+(${parenthesis})\\s*\\)|\\s*\\))`, 'g'),
|
|
33
|
-
new RegExp(`^@import\\s+(?:url\\((?:[^)]|(?<=\\\\)\\))+\\)|"(?:[^"]|(?<=\\\\)")+"|'(?:[^']|(?<=\\\\)')+')(\\s*layer(?:\\(([^)]
|
|
31
|
+
new RegExp(`^@import\\s+(?:url\\((?:[^)]|(?<=\\\\)\\))+\\)|"(?:[^"]|(?<=\\\\)")+"|'(?:[^']|(?<=\\\\)')+')(\\s*layer(?:\\(([^)]+)\\))?)?(?:\\s*supports\\((${parenthesis})\\))?(.*)$`)
|
|
34
32
|
];
|
|
35
33
|
})();
|
|
36
34
|
const REGEXP_SRCSETSIZE = /~\s*([\d.]+)\s*([wx])/i;
|
|
@@ -48,19 +46,11 @@ const REGEXP_FONTFACE = new RegExp(`(\\s*)@font-face${PATTERN_STRING_SOME}{([^}]
|
|
|
48
46
|
const REGEXP_FONTFAMILY = new RegExp(`\\bfont-family${PATTERN_STRING_SOME}:([^;}]+)`, 'i');
|
|
49
47
|
const REGEXP_KEYFRAMES = new RegExp(`(\\s*)@keyframes${PATTERN_STRING_MANY}([^{]+){`, 'gi');
|
|
50
48
|
const REGEXP_PROPERTY = new RegExp(`(\\s*)@property${PATTERN_STRING_MANY}(--[^\\s]+)${PATTERN_STRING_SOME}{`, 'gi');
|
|
51
|
-
const REGEXP_VARIABLES_UNSAFE = new RegExp(`(?<!style\\()(\\s*)(--[^\\s:]
|
|
49
|
+
const REGEXP_VARIABLES_UNSAFE = new RegExp(`(?<!style\\()(\\s*)(--[^\\s:]+)\\s*:[^;}]*([;}])` + dom_1.DomWriter.PATTERN_TRAILINGSPACE, 'g');
|
|
52
50
|
const REGEXP_FONTFACE_UNSAFE = new RegExp(`(\\s*)@font-face\\s*{([^}]+)}` + dom_1.DomWriter.PATTERN_TRAILINGSPACE, 'gi');
|
|
53
51
|
const REGEXP_FONTFAMILY_UNSAFE = /\bfont-family\s*:([^;}]+)/i;
|
|
54
52
|
const REGEXP_KEYFRAMES_UNSAFE = /(\s*)@keyframes\s+([^{]+){/gi;
|
|
55
|
-
const REGEXP_PROPERTY_UNSAFE = /(\s*)@property\s+(
|
|
56
|
-
const REGEXP_OBJECT_NAME = /([^[.\s]+)((?:\s*\[[^\]]+\]\s*)+)?\s*\.?\s*/g;
|
|
57
|
-
const REGEXP_OBJECT_SUBSCRIPT = /\[\s*(["'])?(.+?)\1\s*\]/g;
|
|
58
|
-
const REGEXP_TEMPLATE_LEADING = /\s*\{\{- \s*((?:[^}]|}(?!}))+?)\}\}/g;
|
|
59
|
-
const REGEXP_TEMPLATE_TRAILING = /\{\{((?:[^}]|}(?!}))+?)\s*? -\}\}\s*/g;
|
|
60
|
-
const REGEXP_URL = /(?:\b[Uu][Rr][Ll]\(|@import\s+(["'])|\b([Hh][Rr][Ee][Ff])\s*=)/g;
|
|
61
|
-
const REGEXP_URL_JS = /\bimport\(/g;
|
|
62
|
-
const REGEXP_URL_SVG = /(?:\b[Uu][Rr][Ll]\(|@import\s+(["'])|\b([Hh][Rr][Ee][Ff])\s*=)/g;
|
|
63
|
-
const REGEXP_IMAGESET = /\b(?:-webkit-)?image-set\(/gi;
|
|
53
|
+
const REGEXP_PROPERTY_UNSAFE = /(\s*)@property\s+(--\S+)\s*{/gi;
|
|
64
54
|
const REGEXP_IMAGESET_URL = /(?:^|[^(])\s*("(\s*[^)][^"]*)"|'(\s*[^)][^"]*)')\s*(?:,|$|[^)][^,]*,?)/gd;
|
|
65
55
|
const REGEXP_SANITIZEALL = new RegExp(`(?:\\s+|\\b)data-(?:pathname|filename|intl-locales|(?:use|exclude)-[^=\\s]+)\\s*${dom_1.DomWriter.PATTERN_ATTRVALUE}(?=(?:[^"<]+"[^"]*"|[^'<]+'[^']*')*[^<>]*>)`, 'g');
|
|
66
56
|
function removeNamespace(name, source, newline, comments) {
|
|
@@ -80,16 +70,17 @@ function removeNamespace(name, source, newline, comments) {
|
|
|
80
70
|
return (0, types_1.isArray)(comments) ? source.replace(REGEXP_BLOCKEXCLUDE, (...capture) => getNewlineString(capture[1], capture[2], newline)) : source;
|
|
81
71
|
}
|
|
82
72
|
function getObjectValue(value, key) {
|
|
83
|
-
|
|
73
|
+
const objectName = /([^[.\s]+)((?:\s*\[[^\]]+\]\s*)+)?\s*\.?\s*/g;
|
|
74
|
+
const subscript = /\[\s*(["'])?(.+?)\1\s*\]/g;
|
|
84
75
|
let found = false, match;
|
|
85
|
-
while (match =
|
|
76
|
+
while (match = objectName.exec(key)) {
|
|
86
77
|
if ((0, types_1.isObject)(value)) {
|
|
87
78
|
value = value[match[1]];
|
|
88
79
|
const name = match[2];
|
|
89
80
|
if (name) {
|
|
90
|
-
|
|
81
|
+
subscript.lastIndex = 0;
|
|
91
82
|
let index;
|
|
92
|
-
while (index =
|
|
83
|
+
while (index = subscript.exec(name)) {
|
|
93
84
|
const quote = index[1];
|
|
94
85
|
const attr = quote ? index[2] : index[2].trim();
|
|
95
86
|
if (quote && (0, types_1.isObject)(value) || /^\d+$/.test(attr) && (typeof value === 'string' || (0, types_1.isObject)(value))) {
|
|
@@ -110,14 +101,14 @@ function getObjectValue(value, key) {
|
|
|
110
101
|
return found ? value : null;
|
|
111
102
|
}
|
|
112
103
|
function trimTemplate(value) {
|
|
113
|
-
|
|
104
|
+
const opening = /\s*\{\{- \s*((?:[^}]|}(?!}))+?)\}\}/g;
|
|
105
|
+
const closing = /\{\{((?:[^}]|}(?!}))+?)\s*? -\}\}\s*/g;
|
|
114
106
|
let match;
|
|
115
|
-
while (match =
|
|
116
|
-
value = replaceMatch(match, value, 1,
|
|
107
|
+
while (match = opening.exec(value)) {
|
|
108
|
+
value = replaceMatch(match, value, 1, opening);
|
|
117
109
|
}
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
value = replaceMatch(match, value, 1, REGEXP_TEMPLATE_TRAILING);
|
|
110
|
+
while (match = closing.exec(value)) {
|
|
111
|
+
value = replaceMatch(match, value, 1, closing);
|
|
121
112
|
}
|
|
122
113
|
return value;
|
|
123
114
|
}
|
|
@@ -1217,103 +1208,101 @@ class ChromeDocument extends Document {
|
|
|
1217
1208
|
}
|
|
1218
1209
|
resolveUri(file, source, trailing) {
|
|
1219
1210
|
const host = this.host;
|
|
1220
|
-
|
|
1221
|
-
|
|
1222
|
-
|
|
1223
|
-
|
|
1224
|
-
|
|
1225
|
-
|
|
1226
|
-
|
|
1227
|
-
|
|
1228
|
-
|
|
1229
|
-
|
|
1230
|
-
|
|
1231
|
-
|
|
1232
|
-
|
|
1211
|
+
switch (file.mimeType) {
|
|
1212
|
+
case "text/javascript":
|
|
1213
|
+
case "application/javascript":
|
|
1214
|
+
if (file.imports) {
|
|
1215
|
+
[[file.uri, source], [this.baseUrl, trailing]].forEach(([uri, code], index) => {
|
|
1216
|
+
let localFile;
|
|
1217
|
+
if (uri && code && (localFile = this.findSourceRoot(uri))) {
|
|
1218
|
+
const { exported, bundleId } = file;
|
|
1219
|
+
const bundleMain = !(0, types_1.isEmpty)(bundleId) && this.assets.find(item => item.bundleId === bundleId && item.bundleIndex === 0);
|
|
1220
|
+
let output;
|
|
1221
|
+
if ((index === 1 || exported) && Array.isArray(file.imports)) {
|
|
1222
|
+
output = this.resolveImports(file, code, bundleMain || file);
|
|
1223
|
+
}
|
|
1224
|
+
else if (index === 0 && !exported) {
|
|
1225
|
+
if (!Document.isDir(localFile)) {
|
|
1226
|
+
localFile = path.dirname(localFile);
|
|
1233
1227
|
}
|
|
1234
|
-
|
|
1235
|
-
|
|
1236
|
-
|
|
1237
|
-
|
|
1238
|
-
|
|
1239
|
-
|
|
1240
|
-
const
|
|
1241
|
-
|
|
1242
|
-
|
|
1243
|
-
|
|
1244
|
-
|
|
1245
|
-
|
|
1246
|
-
|
|
1247
|
-
|
|
1248
|
-
|
|
1249
|
-
|
|
1250
|
-
|
|
1251
|
-
if (asset) {
|
|
1252
|
-
const [relativeUrl, sameDir] = this.getSrcUrl(bundleMain || file, asset);
|
|
1253
|
-
if (relativeUrl) {
|
|
1254
|
-
output = (0, util_1.spliceString)(output, a, b, quote + (sameDir ? './' : '') + relativeUrl + quote, REGEXP_IMPORTMODULE);
|
|
1255
|
-
}
|
|
1228
|
+
output = code;
|
|
1229
|
+
let mainFile, pathname, match;
|
|
1230
|
+
const ignorePath = bundleMain && (mainFile = this.findSourceRoot(bundleMain.uri)) && (Document.isDir(mainFile) || (mainFile = path.dirname(mainFile))) && mainFile === localFile;
|
|
1231
|
+
while (match = REGEXP_IMPORTMODULE.exec(output)) {
|
|
1232
|
+
const type = match[3] || match[5];
|
|
1233
|
+
const idx = match[1] ? 1 : match[2] ? 2 : 4;
|
|
1234
|
+
const [a, b] = match.indices[idx];
|
|
1235
|
+
const from = (0, util_1.trimQuote)(match[idx]);
|
|
1236
|
+
const quote = output[a];
|
|
1237
|
+
const relative = /^\.{0,2}\//.test(from);
|
|
1238
|
+
if (type && /\btype\s*:\s*(["'`])(?:css|json)\1/.test(type)) {
|
|
1239
|
+
try {
|
|
1240
|
+
const asset = host.findAsset(relative ? new URL(from, uri) : from);
|
|
1241
|
+
if (asset) {
|
|
1242
|
+
const [relativeUrl, sameDir] = this.getSrcUrl(bundleMain || file, asset);
|
|
1243
|
+
if (relativeUrl) {
|
|
1244
|
+
output = (0, util_1.spliceString)(output, a, b, quote + (sameDir ? './' : '') + relativeUrl + quote, REGEXP_IMPORTMODULE);
|
|
1256
1245
|
}
|
|
1257
1246
|
}
|
|
1258
|
-
catch {
|
|
1259
|
-
}
|
|
1260
|
-
continue;
|
|
1261
1247
|
}
|
|
1262
|
-
|
|
1263
|
-
if (ignorePath) {
|
|
1264
|
-
continue;
|
|
1265
|
-
}
|
|
1266
|
-
pathname = path.join(localFile, from);
|
|
1248
|
+
catch {
|
|
1267
1249
|
}
|
|
1268
|
-
|
|
1269
|
-
|
|
1270
|
-
|
|
1271
|
-
|
|
1272
|
-
|
|
1273
|
-
pathname = asset.localUri;
|
|
1274
|
-
}
|
|
1275
|
-
if (pathname && Document.isPath(pathname)) {
|
|
1276
|
-
output = (0, util_1.spliceString)(output, a, b, quote + pathname + quote, REGEXP_IMPORTMODULE);
|
|
1250
|
+
continue;
|
|
1251
|
+
}
|
|
1252
|
+
if (relative) {
|
|
1253
|
+
if (ignorePath) {
|
|
1254
|
+
continue;
|
|
1277
1255
|
}
|
|
1256
|
+
pathname = path.join(localFile, from);
|
|
1278
1257
|
}
|
|
1279
|
-
|
|
1280
|
-
|
|
1281
|
-
|
|
1282
|
-
|
|
1283
|
-
|
|
1258
|
+
else if (!(pathname = this.findSourceRoot(from)) || !Document.isPath(pathname)) {
|
|
1259
|
+
const asset = host.findAsset(from);
|
|
1260
|
+
if (!asset || asset.invalid) {
|
|
1261
|
+
continue;
|
|
1262
|
+
}
|
|
1263
|
+
pathname = asset.localUri;
|
|
1284
1264
|
}
|
|
1285
|
-
|
|
1286
|
-
|
|
1265
|
+
if (pathname && Document.isPath(pathname)) {
|
|
1266
|
+
output = (0, util_1.spliceString)(output, a, b, quote + pathname + quote, REGEXP_IMPORTMODULE);
|
|
1287
1267
|
}
|
|
1288
1268
|
}
|
|
1269
|
+
REGEXP_IMPORTMODULE.lastIndex = 0;
|
|
1289
1270
|
}
|
|
1290
|
-
|
|
1291
|
-
|
|
1292
|
-
|
|
1293
|
-
|
|
1294
|
-
|
|
1295
|
-
|
|
1296
|
-
if (!(0, types_1.isEmpty)(bundleId)) {
|
|
1297
|
-
for (const asset of this.assets) {
|
|
1298
|
-
if (asset.bundleIndex === 0 && asset.bundleId === bundleId) {
|
|
1299
|
-
const output = this.processUrl(host, file, source, 'css', asset);
|
|
1300
|
-
if (output) {
|
|
1301
|
-
source = output;
|
|
1302
|
-
file.modified = true;
|
|
1303
|
-
}
|
|
1304
|
-
break;
|
|
1271
|
+
if (output && output !== code) {
|
|
1272
|
+
if (index === 0) {
|
|
1273
|
+
source = output;
|
|
1274
|
+
}
|
|
1275
|
+
else {
|
|
1276
|
+
trailing = output;
|
|
1305
1277
|
}
|
|
1306
1278
|
}
|
|
1307
1279
|
}
|
|
1308
|
-
|
|
1309
|
-
|
|
1310
|
-
|
|
1311
|
-
|
|
1280
|
+
});
|
|
1281
|
+
}
|
|
1282
|
+
break;
|
|
1283
|
+
case "text/css":
|
|
1284
|
+
if (file.editing) {
|
|
1285
|
+
const bundleId = file.bundleId;
|
|
1286
|
+
if (!(0, types_1.isEmpty)(bundleId)) {
|
|
1287
|
+
for (const asset of this.assets) {
|
|
1288
|
+
if (asset.bundleIndex === 0 && asset.bundleId === bundleId) {
|
|
1289
|
+
const output = this.processUrl(host, file, source, 'css', asset);
|
|
1290
|
+
if (output) {
|
|
1291
|
+
source = output;
|
|
1292
|
+
file.modified = true;
|
|
1293
|
+
}
|
|
1294
|
+
break;
|
|
1312
1295
|
}
|
|
1313
1296
|
}
|
|
1314
1297
|
}
|
|
1315
|
-
|
|
1316
|
-
|
|
1298
|
+
if (trailing && this.htmlFile) {
|
|
1299
|
+
const output = this.processUrl(host, file, trailing, 'css', this.htmlFile);
|
|
1300
|
+
if (output) {
|
|
1301
|
+
trailing = output;
|
|
1302
|
+
}
|
|
1303
|
+
}
|
|
1304
|
+
}
|
|
1305
|
+
break;
|
|
1317
1306
|
}
|
|
1318
1307
|
return (trailing !== undefined ? [source, trailing] : source);
|
|
1319
1308
|
}
|
|
@@ -1380,7 +1369,7 @@ class ChromeDocument extends Document {
|
|
|
1380
1369
|
if (match) {
|
|
1381
1370
|
const layer = match[1];
|
|
1382
1371
|
const supports = match[3]?.trim();
|
|
1383
|
-
const query = match[4].trim();
|
|
1372
|
+
const query = match[4].trim().replace(/;+$/, '');
|
|
1384
1373
|
if (layer || supports || query) {
|
|
1385
1374
|
const newline = (0, util_1.getNewline)(source);
|
|
1386
1375
|
let result = supports ? `@supports (${supports}) {` + newline : '';
|
|
@@ -1388,8 +1377,8 @@ class ChromeDocument extends Document {
|
|
|
1388
1377
|
result += `@media ${query} {` + newline;
|
|
1389
1378
|
}
|
|
1390
1379
|
if (layer) {
|
|
1391
|
-
|
|
1392
|
-
result += '@layer ' + (name
|
|
1380
|
+
const name = match[2]?.trim();
|
|
1381
|
+
result += '@layer ' + (name ? name + ' ' : '') + `{${newline + source + newline}}` + (query ? newline + '}' : '');
|
|
1393
1382
|
}
|
|
1394
1383
|
else if (query) {
|
|
1395
1384
|
result += source + newline + '}';
|
|
@@ -3561,27 +3550,25 @@ class ChromeDocument extends Document {
|
|
|
3561
3550
|
const baseHref = collectBaseUrl(importFile || file, this.baseUrl);
|
|
3562
3551
|
const isHtml = type === 'html';
|
|
3563
3552
|
const isJs = type === 'js';
|
|
3564
|
-
const
|
|
3565
|
-
pattern
|
|
3566
|
-
REGEXP_IMAGESET.lastIndex = 0;
|
|
3553
|
+
const imageSet = /\b(?:-webkit-)?image-set\(/gi;
|
|
3554
|
+
const pattern = isJs ? /\bimport\(/g : type === 'svg' ? /(?:\b[Uu][Rr][Ll]\(|@import\s+(["'])|\b([Hh][Rr][Ee][Ff])\s*=)/g : /(?:\b[Uu][Rr][Ll]\(|@import\s+(["'])|\b([Hh][Rr][Ee][Ff])\s*=)/g;
|
|
3567
3555
|
let length = source.length, modified = false, match;
|
|
3568
|
-
while (match =
|
|
3556
|
+
while (match = imageSet.exec(source)) {
|
|
3569
3557
|
const startIndex = match.index + match[0].length;
|
|
3570
3558
|
const endIndex = findClosingIndex(source, startIndex, '(');
|
|
3571
|
-
if (endIndex
|
|
3572
|
-
|
|
3573
|
-
|
|
3574
|
-
|
|
3575
|
-
|
|
3576
|
-
|
|
3577
|
-
|
|
3578
|
-
|
|
3579
|
-
|
|
3580
|
-
modified
|
|
3581
|
-
|
|
3582
|
-
|
|
3583
|
-
|
|
3584
|
-
modified = false;
|
|
3559
|
+
if (endIndex !== -1) {
|
|
3560
|
+
REGEXP_IMAGESET_URL.lastIndex = 0;
|
|
3561
|
+
let content = source.substring(startIndex, endIndex), url;
|
|
3562
|
+
while (url = REGEXP_IMAGESET_URL.exec(content)) {
|
|
3563
|
+
const quote = url[2] ? '"' : "'";
|
|
3564
|
+
const [a, b] = url.indices[1];
|
|
3565
|
+
content = (0, util_1.spliceString)(content, a, b, `url(${quote + (url[2] || url[3]).trim() + quote})`, REGEXP_IMAGESET_URL);
|
|
3566
|
+
modified = true;
|
|
3567
|
+
}
|
|
3568
|
+
if (modified) {
|
|
3569
|
+
source = (0, util_1.spliceString)(source, startIndex, endIndex, content, imageSet);
|
|
3570
|
+
modified = false;
|
|
3571
|
+
}
|
|
3585
3572
|
}
|
|
3586
3573
|
}
|
|
3587
3574
|
while (match = pattern.exec(source)) {
|
|
@@ -3705,7 +3692,7 @@ class ChromeDocument extends Document {
|
|
|
3705
3692
|
if (quote) {
|
|
3706
3693
|
value = quote + value + quote;
|
|
3707
3694
|
}
|
|
3708
|
-
const revised = isJs ?
|
|
3695
|
+
const revised = isJs ? `import(${value + trailing})` : isHref ? 'href=' + value : (isText ? '@import ' + value : `url(${value})`) + trailing;
|
|
3709
3696
|
source = (0, util_1.spliceString)(source, startIndex, i + 1, revised, pattern);
|
|
3710
3697
|
length = source.length;
|
|
3711
3698
|
modified = true;
|
|
@@ -3715,7 +3702,7 @@ class ChromeDocument extends Document {
|
|
|
3715
3702
|
if (!quote) {
|
|
3716
3703
|
continue;
|
|
3717
3704
|
}
|
|
3718
|
-
const target = new RegExp(
|
|
3705
|
+
const target = new RegExp(`^\\s*(${quote}((?:[^${quote}]|(?<=\\\\)${quote})+)${quote})\\s*(,.+)$`).exec(content);
|
|
3719
3706
|
if (target) {
|
|
3720
3707
|
url = target[1].trim();
|
|
3721
3708
|
trailing = target[2].trim();
|
|
@@ -3741,7 +3728,11 @@ class ChromeDocument extends Document {
|
|
|
3741
3728
|
else if (baseHref.length > 0) {
|
|
3742
3729
|
let fullUrl, asset;
|
|
3743
3730
|
for (const parentUrl of baseHref) {
|
|
3744
|
-
asset = host.findAsset(fullUrl = Document.resolvePath(url, parentUrl), { replaced: true })
|
|
3731
|
+
asset = host.findAsset(fullUrl = Document.resolvePath(url, parentUrl), { replaced: true });
|
|
3732
|
+
if (!asset) {
|
|
3733
|
+
const assets = this.related.get(file);
|
|
3734
|
+
asset = assets && host.findAsset(fullUrl, { assets: Array.from(assets), replaced: true });
|
|
3735
|
+
}
|
|
3745
3736
|
if (asset) {
|
|
3746
3737
|
break;
|
|
3747
3738
|
}
|
|
@@ -3772,16 +3763,16 @@ class ChromeDocument extends Document {
|
|
|
3772
3763
|
revised = this.processUrl(host, file, this.removeServerRoot(revised), type, asset) || revised;
|
|
3773
3764
|
source = (0, util_1.spliceString)(source, k, l + 1, revised, pattern);
|
|
3774
3765
|
length = source.length;
|
|
3775
|
-
if (
|
|
3776
|
-
host.deleteFile(asset.localUri, { ignorePermission: true, emptyDir: true, all: true, id: asset.id });
|
|
3777
|
-
asset.invalid = true;
|
|
3778
|
-
}
|
|
3779
|
-
else {
|
|
3766
|
+
if (file.watch) {
|
|
3780
3767
|
related.push(asset);
|
|
3781
3768
|
if (!(0, types_1.existsFlag)(asset.flags)) {
|
|
3782
3769
|
asset.flags |= 8;
|
|
3783
3770
|
}
|
|
3784
3771
|
}
|
|
3772
|
+
else if (asset.localUri) {
|
|
3773
|
+
host.deleteFile(asset.localUri, { ignorePermission: true, emptyDir: true, all: true, id: asset.id });
|
|
3774
|
+
asset.invalid = true;
|
|
3775
|
+
}
|
|
3785
3776
|
modified = true;
|
|
3786
3777
|
continue;
|
|
3787
3778
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@pi-r/chrome",
|
|
3
|
-
"version": "0.11.
|
|
3
|
+
"version": "0.11.2",
|
|
4
4
|
"description": "Chrome document constructor for E-mc.",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"types": "index.d.ts",
|
|
@@ -20,10 +20,10 @@
|
|
|
20
20
|
"license": "MIT",
|
|
21
21
|
"homepage": "https://github.com/anpham6/pi-r#readme",
|
|
22
22
|
"dependencies": {
|
|
23
|
-
"@e-mc/cloud": "^0.13.
|
|
24
|
-
"@e-mc/core": "^0.13.
|
|
25
|
-
"@e-mc/document": "^0.13.
|
|
26
|
-
"@e-mc/types": "^0.13.
|
|
23
|
+
"@e-mc/cloud": "^0.13.9",
|
|
24
|
+
"@e-mc/core": "^0.13.9",
|
|
25
|
+
"@e-mc/document": "^0.13.9",
|
|
26
|
+
"@e-mc/types": "^0.13.9",
|
|
27
27
|
"image-size": "^2.0.2"
|
|
28
28
|
}
|
|
29
29
|
}
|
package/types/squared.d.ts
CHANGED
|
@@ -91,7 +91,7 @@ export interface UnusedAtRule {
|
|
|
91
91
|
selector?: string;
|
|
92
92
|
media?: ConditionProperty;
|
|
93
93
|
supports?: ConditionProperty;
|
|
94
|
-
container?: CssConditionData & Partial<ConditionProperty>;
|
|
94
|
+
container?: Omit<CssConditionData, "conditionText"> & Partial<ConditionProperty>;
|
|
95
95
|
layer?: string[];
|
|
96
96
|
}
|
|
97
97
|
|