@pi-r/chrome 0.7.4 → 0.7.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.
- package/LICENSE +6 -6
- package/index.d.ts +6 -6
- package/index.js +4 -3
- package/package.json +5 -5
package/LICENSE
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
Copyright 2024 An Pham
|
|
2
|
-
|
|
3
|
-
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
|
|
4
|
-
|
|
5
|
-
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
|
|
6
|
-
|
|
1
|
+
Copyright 2024 An Pham
|
|
2
|
+
|
|
3
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
|
|
4
|
+
|
|
5
|
+
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
|
|
6
|
+
|
|
7
7
|
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
package/index.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import type { IFileManager } from '@e-mc/types/lib';
|
|
2
|
-
|
|
3
|
-
import type { ChromeDocumentConstructor, DocumentAsset } from './types';
|
|
4
|
-
|
|
5
|
-
declare const Chrome: ChromeDocumentConstructor<IFileManager<DocumentAsset>>;
|
|
6
|
-
|
|
1
|
+
import type { IFileManager } from '@e-mc/types/lib';
|
|
2
|
+
|
|
3
|
+
import type { ChromeDocumentConstructor, DocumentAsset } from './types';
|
|
4
|
+
|
|
5
|
+
declare const Chrome: ChromeDocumentConstructor<IFileManager<DocumentAsset>>;
|
|
6
|
+
|
|
7
7
|
export = Chrome;
|
package/index.js
CHANGED
|
@@ -200,7 +200,7 @@ function hasCondition(data, condition) {
|
|
|
200
200
|
if (items.length && !isSpace(match[0][0])) {
|
|
201
201
|
return false;
|
|
202
202
|
}
|
|
203
|
-
items.push([match[1], match[2], match[3]]);
|
|
203
|
+
items.push([match[1], trimQuote(match[2]), trimQuote(match[3])]);
|
|
204
204
|
}
|
|
205
205
|
REGEXP_TEMPLATECOMPARISON.lastIndex = 0;
|
|
206
206
|
const length = items.length;
|
|
@@ -3149,7 +3149,8 @@ class ChromeDocument extends Document {
|
|
|
3149
3149
|
const row = items[0];
|
|
3150
3150
|
let condition = NaN;
|
|
3151
3151
|
for (let seg of template) {
|
|
3152
|
-
|
|
3152
|
+
seg = seg.trim();
|
|
3153
|
+
switch (seg.toLowerCase()) {
|
|
3153
3154
|
case ':is(and)':
|
|
3154
3155
|
if (condition === 0) {
|
|
3155
3156
|
remove = false;
|
|
@@ -3344,7 +3345,7 @@ class ChromeDocument extends Document {
|
|
|
3344
3345
|
const parseSelector = (value) => {
|
|
3345
3346
|
const items = [];
|
|
3346
3347
|
const revised = value.replace(useUnsafeCssReplace ? REGEXP_NTHCHILD_UNSAFE : REGEXP_NTHCHILD, (...capture) => {
|
|
3347
|
-
return '`%' + (items.push('\\(' + getStringSome() + (capture[1] === '-' ? '\\x2d' : '\\x2b?') + (capture[2] || '[01]?') + (capture[3] === '0' ? !capture[1] && !capture[2] && !capture[4] && !capture[5] ? '[+-]?0[nN]?' : '0' : '[nN]') + getStringSome() + (capture[5] ? (capture[4] === '-' ? '\\x2d' : '\\x2b') + getStringSome() + capture[5] : `(?:[+-]${getStringSome()}0)?`) + (capture[6] ? getStringMany() + '[oO][fF]' + getStringMany() + capture[6].trim() : '') + getStringSome() + '\\)') - 1) + '`';
|
|
3348
|
+
return '`%' + (items.push('\\(' + getStringSome() + (capture[1] === '-' ? '\\x2d' : '\\x2b?') + (capture[2] || '[01]?') + (capture[3] === '0' ? !capture[1] && !capture[2] && !capture[4] && !capture[5] ? '[+-]?0[nN]?' : '0' : '[nN]?') + getStringSome() + (capture[5] ? (capture[4] === '-' ? '\\x2d' : '\\x2b?') + getStringSome() + capture[5] : `(?:[+-]${getStringSome()}0)?`) + (capture[6] ? getStringMany() + '[oO][fF]' + getStringMany() + capture[6].trim() : '') + getStringSome() + '\\)') - 1) + '`';
|
|
3348
3349
|
});
|
|
3349
3350
|
let selector = '';
|
|
3350
3351
|
for (let i = 0, length = revised.length, casing = false, attr = false, quote = false; i < length; i++) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@pi-r/chrome",
|
|
3
|
-
"version": "0.7.
|
|
3
|
+
"version": "0.7.5",
|
|
4
4
|
"description": "Chrome document constructor for E-mc.",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"publishConfig": {
|
|
@@ -20,9 +20,9 @@
|
|
|
20
20
|
"license": "MIT",
|
|
21
21
|
"homepage": "https://github.com/anpham6/pi-r#readme",
|
|
22
22
|
"dependencies": {
|
|
23
|
-
"@e-mc/cloud": "^0.9.
|
|
24
|
-
"@e-mc/core": "^0.9.
|
|
25
|
-
"@e-mc/document": "^0.9.
|
|
26
|
-
"@e-mc/types": "^0.9.
|
|
23
|
+
"@e-mc/cloud": "^0.9.18",
|
|
24
|
+
"@e-mc/core": "^0.9.18",
|
|
25
|
+
"@e-mc/document": "^0.9.18",
|
|
26
|
+
"@e-mc/types": "^0.9.18"
|
|
27
27
|
}
|
|
28
28
|
}
|